File manager - Edit - /home/opticamezl/www/newok/Renderer.zip
Back
PK ���\���� � Pdf/ComponentRenderer.phpnu &1i� <?php /** * Joomla! Content Management System * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; defined('JPATH_PLATFORM') or die; use Joomla\CMS\Document\DocumentRenderer; /** * HTML document renderer for the component output * * @since 3.5 */ class ComponentRenderer extends DocumentRenderer { /** * 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 3.5 */ public function render($component = null, $params = array(), $content = null) { return $content; } } PK ���\��þ � Pdf/ModulesRenderer.phpnu &1i� <?php /** * Joomla! Content Management System * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; defined('JPATH_PLATFORM') or die; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Helper\ModuleHelper; use Joomla\CMS\Layout\LayoutHelper; /** * HTML document renderer for a module position * * @since 3.5 */ class ModulesRenderer extends DocumentRenderer { /** * 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 3.5 */ public function render($position, $params = array(), $content = null) { $renderer = $this->_doc->loadRenderer('module'); $buffer = ''; $app = \JFactory::getApplication(); $user = \JFactory::getUser(); $frontediting = ($app->isClient('site') && $app->get('frontediting', 1) && !$user->guest); $menusEditing = ($app->get('frontediting', 1) == 2) && $user->authorise('core.edit', 'com_menus'); foreach (ModuleHelper::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); LayoutHelper::render('joomla.edit.frontediting_modules', $displayData); } $buffer .= $moduleHtml; } \JEventDispatcher::getInstance()->trigger('onAfterRenderModules', array(&$buffer, &$params)); return $buffer; } } PK ���\}}�Q Pdf/ModuleRenderer.phpnu &1i� <?php /** * Joomla! Content Management System * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; defined('JPATH_PLATFORM') or die; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Helper\ModuleHelper; use Joomla\CMS\Log\Log; use Joomla\CMS\Layout\LayoutHelper; use Joomla\Registry\Registry; /** * HTML document renderer for a single module * * @since 3.5 */ class ModuleRenderer extends DocumentRenderer { /** * 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 3.5 */ public function render($module, $attribs = array(), $content = null) { if (!is_object($module)) { $title = isset($attribs['title']) ? $attribs['title'] : null; $module = ModuleHelper::getModule($module, $title); if (!is_object($module)) { if (is_null($content)) { return ''; } /** * 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; } } // Set the module content if (!is_null($content)) { $module->content = $content; } // Get module parameters $params = new Registry($module->params); // Use parameters from template if (isset($attribs['params'])) { $template_params = new Registry(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 && \JFactory::getConfig()->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); return ModuleHelper::ModuleCache($module, $params, $cacheparams); } return ModuleHelper::renderModule($module, $attribs); } } PK ���\�;6�� � Pdf/MessageRenderer.phpnu &1i� <?php /** * Joomla! Content Management System * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; defined('JPATH_PLATFORM') or die; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Log\Log; use Joomla\CMS\Layout\LayoutHelper; /** * HTML document renderer for the system message queue * * @since 3.5 */ class MessageRenderer extends DocumentRenderer { /** * 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 3.5 */ 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')) { Log::add('renderMessage() is deprecated. Override system message rendering with layouts instead.', Log::WARNING, 'deprecated'); return renderMessage($msgList); } return LayoutHelper::render('joomla.system.message', $displayData); } /** * Get and prepare system message data for output * * @return array An array contains system message * * @since 3.5 */ 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 ���\ 5��+ �+ Pdf/HeadRenderer.phpnu &1i� <?php /** * Joomla! Content Management System * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; defined('JPATH_PLATFORM') or die; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Uri\Uri; use Joomla\Utilities\ArrayHelper; /** * HTML document renderer for the document `<head>` element * * @since 3.5 */ class HeadRenderer extends DocumentRenderer { /** * 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 3.5 */ 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 JDocumentHtml $document The document for which the head will be created * * @return string The head hTML * * @since 3.5 * @deprecated 4.0 Method code will be moved into the render method */ public function fetchHead($document) { // Convert the tagids to titles if (isset($document->_metaTags['name']['tags'])) { $tagsHelper = new TagsHelper; $document->_metaTags['name']['tags'] = implode(', ', $tagsHelper->getTagNames($document->_metaTags['name']['tags'])); } if ($document->getScriptOptions()) { \JHtml::_('behavior.core'); } // Trigger the onBeforeCompileHead event $app = \JFactory::getApplication(); $app->triggerEvent('onBeforeCompileHead'); // Get line endings $lnEnd = $document->_getLineEnd(); $tab = $document->_getTab(); $tagEnd = ' />'; $buffer = ''; $mediaVersion = $document->getMediaVersion(); // 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="' . $base . '" />' . $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, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd; } elseif ($type != 'http-equiv' && !empty($content)) { if (is_array($content)) { foreach ($content as $value) { $buffer .= $tab . '<meta ' . $type . '="' . $name . '" content="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd; } } else { $buffer .= $tab . '<meta ' . $type . '="' . $name . '" content="' . htmlspecialchars($content, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd; } } } } // Don't add empty descriptions $documentDescription = $document->getDescription(); if ($documentDescription) { $buffer .= $tab . '<meta name="description" content="' . htmlspecialchars($documentDescription, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd; } // Don't add empty generators $generator = $document->getGenerator(); if ($generator) { $buffer .= $tab . '<meta name="generator" content="' . htmlspecialchars($generator, ENT_COMPAT, 'UTF-8') . '" />' . $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 (is_array($linkAtrr['attribs'])) { if ($temp = ArrayHelper::toString($linkAtrr['attribs'])) { $buffer .= ' ' . $temp; } } $buffer .= ' />' . $lnEnd; } $defaultCssMimes = array('text/css'); // Generate stylesheet links foreach ($document->_styleSheets as $src => $attribs) { // Check if stylesheet uses IE conditional statements. $conditional = isset($attribs['options']) && isset($attribs['options']['conditional']) ? $attribs['options']['conditional'] : null; // Check if script uses media version. if (isset($attribs['options']['version']) && $attribs['options']['version'] && strpos($src, '?') === false && ($mediaVersion || $attribs['options']['version'] !== 'auto')) { $src .= '?' . ($attribs['options']['version'] === 'auto' ? $mediaVersion : $attribs['options']['version']); } $buffer .= $tab; // This is for IE conditional statements support. if (!is_null($conditional)) { $buffer .= '<!--[if ' . $conditional . ']>'; } $buffer .= '<link href="' . $src . '" rel="stylesheet"'; // Add script tag attributes. foreach ($attribs as $attrib => $value) { // Don't add the 'options' attribute. This attribute is for internal use (version, conditional, etc). if ($attrib === 'options') { continue; } // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if (in_array($attrib, array('type', 'mime')) && $document->isHtml5() && in_array($value, $defaultCssMimes)) { continue; } // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if ($attrib === 'mime') { $attrib = 'type'; } // Add attribute to script tag output. $buffer .= ' ' . htmlspecialchars($attrib, ENT_COMPAT, 'UTF-8'); // Json encode value if it's an array. $value = !is_scalar($value) ? json_encode($value) : $value; $buffer .= '="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"'; } $buffer .= $tagEnd; // This is for IE conditional statements support. if (!is_null($conditional)) { $buffer .= '<![endif]-->'; } $buffer .= $lnEnd; } // Generate stylesheet declarations foreach ($document->_style as $type => $content) { $buffer .= $tab . '<style'; if (!is_null($type) && (!$document->isHtml5() || !in_array($type, $defaultCssMimes))) { $buffer .= ' type="' . $type . '"'; } $buffer .= '>' . $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 scripts options $scriptOptions = $document->getScriptOptions(); if (!empty($scriptOptions)) { $buffer .= $tab . '<script type="application/json" class="joomla-script-options new">'; $prettyPrint = (JDEBUG && defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : false); $jsonOptions = json_encode($scriptOptions, $prettyPrint); $jsonOptions = $jsonOptions ? $jsonOptions : '{}'; $buffer .= $jsonOptions; $buffer .= '</script>' . $lnEnd; } $defaultJsMimes = array('text/javascript', 'application/javascript', 'text/x-javascript', 'application/x-javascript'); $html5NoValueAttributes = array('defer', 'async'); // Generate script file links foreach ($document->_scripts as $src => $attribs) { // Check if script uses IE conditional statements. $conditional = isset($attribs['options']) && isset($attribs['options']['conditional']) ? $attribs['options']['conditional'] : null; // Check if script uses media version. if (isset($attribs['options']['version']) && $attribs['options']['version'] && strpos($src, '?') === false && ($mediaVersion || $attribs['options']['version'] !== 'auto')) { $src .= '?' . ($attribs['options']['version'] === 'auto' ? $mediaVersion : $attribs['options']['version']); } $buffer .= $tab; // This is for IE conditional statements support. if (!is_null($conditional)) { $buffer .= '<!--[if ' . $conditional . ']>'; } $buffer .= '<script src="' . $src . '"'; // Add script tag attributes. foreach ($attribs as $attrib => $value) { // Don't add the 'options' attribute. This attribute is for internal use (version, conditional, etc). if ($attrib === 'options') { continue; } // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if (in_array($attrib, array('type', 'mime')) && $document->isHtml5() && in_array($value, $defaultJsMimes)) { continue; } // B/C: If defer and async is false or empty don't render the attribute. if (in_array($attrib, array('defer', 'async')) && !$value) { continue; } // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if ($attrib === 'mime') { $attrib = 'type'; } // B/C defer and async can be set to yes when using the old method. elseif (in_array($attrib, array('defer', 'async')) && $value === true) { $value = $attrib; } // Add attribute to script tag output. $buffer .= ' ' . htmlspecialchars($attrib, ENT_COMPAT, 'UTF-8'); if (!($document->isHtml5() && in_array($attrib, $html5NoValueAttributes))) { // Json encode value if it's an array. $value = !is_scalar($value) ? json_encode($value) : $value; $buffer .= '="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"'; } } $buffer .= '></script>'; // This is for IE conditional statements support. if (!is_null($conditional)) { $buffer .= '<![endif]-->'; } $buffer .= $lnEnd; } // Generate script declarations foreach ($document->_script as $type => $content) { $buffer .= $tab . '<script'; if (!is_null($type) && (!$document->isHtml5() || !in_array($type, $defaultJsMimes))) { $buffer .= ' type="' . $type . '"'; } $buffer .= '>' . $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; } // 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 ltrim($buffer, $tab); } } PK ���\����% �% Feed/RssRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Feed; use Joomla\CMS\Date\Date; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * RssRenderer is a feed that implements RSS 2.0 Specification * * @link http://www.rssboard.org/rss-specification * @since 3.5 * * @property-read \Joomla\CMS\Document\FeedDocument $_doc Reference to the Document object that instantiated the renderer */ class RssRenderer extends DocumentRenderer { /** * Renderer mime type * * @var string * @since 3.5 */ 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 DocumentRenderer::render() * @since 3.5 */ public function render($name = '', $params = null, $content = null) { $app = Factory::getApplication(); $tz = new \DateTimeZone($app->get('offset')); $data = $this->_doc; // If the last build date from the document isn't a Date object, create one if (!($data->lastBuildDate instanceof Date)) { // Gets and sets timezone offset from site configuration $data->lastBuildDate = Factory::getDate(); $data->lastBuildDate->setTimezone(new \DateTimeZone($app->get('offset'))); } $url = Uri::getInstance()->toString(['scheme', 'user', 'pass', 'host', 'port']); $syndicationURL = Route::_('&format=feed&type=rss'); $title = $data->getTitle(); if ($app->get('sitename_pagetitles', 0) == 1) { $title = Text::sprintf('JPAGETITLE', $app->get('sitename'), $data->getTitle()); } elseif ($app->get('sitename_pagetitles', 0) == 2) { $title = Text::sprintf('JPAGETITLE', $data->getTitle(), $app->get('sitename')); } $feed_title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8'); $datalink = $data->getLink(); if (preg_match('/[\x80-\xFF]/', $datalink)) { $datalink = implode('/', array_map('rawurlencode', explode('/', $datalink))); } $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->getDescription() . "]]></description>\n"; $feed .= " <link>" . str_replace(' ', '%20', $url . $datalink) . "</link>\n"; $feed .= " <lastBuildDate>" . htmlspecialchars($data->lastBuildDate->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->getLanguage() !== '') { $feed .= " <language>" . $data->getLanguage() . "</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 = Factory::getDate($data->pubDate); $pubDate->setTimezone($tz); $feed .= " <pubDate>" . htmlspecialchars($pubDate->toRFC822(true), ENT_COMPAT, 'UTF-8') . "</pubDate>\n"; } if (!empty($data->category)) { 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++) { $itemlink = $data->items[$i]->link; if (preg_match('/[\x80-\xFF]/', $itemlink)) { $itemlink = implode('/', array_map('rawurlencode', explode('/', $itemlink))); } 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)) { $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 = Factory::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 ���\'�# Feed/AtomRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Feed; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; use Joomla\CMS\Version; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * AtomRenderer 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. * * @link http://www.atomenabled.org/developers/syndication/atom-format-spec.php * @since 3.5 * * @property-read \Joomla\CMS\Document\FeedDocument $_doc Reference to the Document object that instantiated the renderer */ class AtomRenderer extends DocumentRenderer { /** * Document mime type * * @var string * @since 3.5 */ 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 DocumentRenderer::render() * @since 3.5 */ public function render($name = '', $params = null, $content = null) { $app = Factory::getApplication(); // Gets and sets timezone offset from site configuration $tz = new \DateTimeZone($app->get('offset')); $now = Factory::getDate(); $now->setTimezone($tz); $data = $this->_doc; $url = Uri::getInstance()->toString(['scheme', 'user', 'pass', 'host', 'port']); $syndicationURL = Route::_('&format=feed&type=atom'); $title = $data->getTitle(); if ($app->get('sitename_pagetitles', 0) == 1) { $title = Text::sprintf('JPAGETITLE', $app->get('sitename'), $data->getTitle()); } elseif ($app->get('sitename_pagetitles', 0) == 2) { $title = Text::sprintf('JPAGETITLE', $data->getTitle(), $app->get('sitename')); } $feed_title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8'); $feed = "<feed xmlns=\"http://www.w3.org/2005/Atom\""; if ($data->getLanguage() != '') { $feed .= " xml:lang=\"" . $data->getLanguage() . "\""; } $feed .= ">\n"; $feed .= " <title type=\"text\">" . $feed_title . "</title>\n"; $feed .= " <subtitle type=\"text\">" . htmlspecialchars($data->getDescription() ?? '', ENT_COMPAT, 'UTF-8') . "</subtitle>\n"; if (!empty($data->category)) { 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"; } $versionHtmlEscaped = ''; if ($app->get('MetaVersion', 0)) { $minorVersion = Version::MAJOR_VERSION . '.' . Version::MINOR_VERSION; $versionHtmlEscaped = ' version="' . htmlspecialchars($minorVersion, ENT_COMPAT, 'UTF-8') . '"'; } $feed .= " <generator uri=\"https://www.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++) { $itemlink = $data->items[$i]->link; if (preg_match('/[\x80-\xFF]/', $itemlink)) { $itemlink = implode('/', array_map('rawurlencode', explode('/', $itemlink))); } $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 = Factory::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)) { $itemGuid = str_replace(' ', '%20', $url . $itemlink); } else { $itemGuid = htmlspecialchars($data->items[$i]->guid, ENT_COMPAT, 'UTF-8'); } $feed .= " <id>" . $itemGuid . "</id>\n"; if ($data->items[$i]->author != '') { $feed .= " <author>\n"; $feed .= " <name>" . htmlspecialchars($data->items[$i]->author, ENT_COMPAT, 'UTF-8') . "</name>\n"; if (!empty($data->items[$i]->authorEmail)) { $feed .= " <email>" . htmlspecialchars($data->items[$i]->authorEmail, ENT_COMPAT, 'UTF-8') . "</email>\n"; } $feed .= " </author>\n"; } if (!empty($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($this->_relToAbs($data->items[$i]->description), ENT_COMPAT, 'UTF-8') . "</content>\n"; } if (!empty($data->items[$i]->category)) { 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 ���\�;z+� � Partial/ModulesRenderer.phpnu &1i� <?php /** * Joomla! Content Management System * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Partial; defined('JPATH_PLATFORM') or die; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Helper\ModuleHelper; use Joomla\CMS\Layout\LayoutHelper; /** * HTML document renderer for a module position * * @since 3.5 */ class ModulesRenderer extends DocumentRenderer { /** * 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 3.5 */ public function render($position, $params = array(), $content = null) { $renderer = $this->_doc->loadRenderer('module'); $buffer = ''; $app = \JFactory::getApplication(); $user = \JFactory::getUser(); $frontediting = ($app->isClient('site') && $app->get('frontediting', 1) && !$user->guest); $menusEditing = ($app->get('frontediting', 1) == 2) && $user->authorise('core.edit', 'com_menus'); foreach (ModuleHelper::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); LayoutHelper::render('joomla.edit.frontediting_modules', $displayData); } $buffer .= $moduleHtml; } \JEventDispatcher::getInstance()->trigger('onAfterRenderModules', array(&$buffer, &$params)); return $buffer; } } PK ���\��l� � Partial/MessageRenderer.phpnu &1i� <?php /** * Joomla! Content Management System * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Partial; defined('JPATH_PLATFORM') or die; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Log\Log; use Joomla\CMS\Layout\LayoutHelper; /** * HTML document renderer for the system message queue * * @since 3.5 */ class MessageRenderer extends DocumentRenderer { /** * 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 3.5 */ 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')) { Log::add('renderMessage() is deprecated. Override system message rendering with layouts instead.', Log::WARNING, 'deprecated'); return renderMessage($msgList); } return LayoutHelper::render('joomla.system.message', $displayData); } /** * Get and prepare system message data for output * * @return array An array contains system message * * @since 3.5 */ 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 ���\��Z2 2 Partial/HeadRenderer.phpnu &1i� <?php /** * Joomla! Content Management System * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Partial; defined('JPATH_PLATFORM') or die; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Uri\Uri; use Joomla\Utilities\ArrayHelper; use Joomla\CMS\Factory; /** * HTML document renderer for the document `<head>` element * * @since 3.5 */ class HeadRenderer extends DocumentRenderer { public $excludeJsFiles = array( '/jquery.js', '/bootstrap.js' ); public $keeperJsFiles = array( '/components/com_fabrik/js/' ); /** * 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 3.5 */ 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 JDocumentHtml $document The document for which the head will be created * * @return string The head hTML * * @since 3.5 * @deprecated 4.0 Method code will be moved into the render method */ public function fetchHead($document) { // Convert the tagids to titles if (isset($document->_metaTags['name']['tags'])) { $tagsHelper = new TagsHelper; $document->_metaTags['name']['tags'] = implode(', ', $tagsHelper->getTagNames($document->_metaTags['name']['tags'])); } if ($document->getScriptOptions()) { \JHtml::_('behavior.core'); } // Trigger the onBeforeCompileHead event $app = \JFactory::getApplication(); $app->triggerEvent('onBeforeCompileHead'); // Get line endings $lnEnd = $document->_getLineEnd(); $tab = $document->_getTab(); $tagEnd = ' />'; $buffer = ''; $mediaVersion = $document->getMediaVersion(); // 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="' . $base . '" />' . $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, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd; } elseif ($type != 'http-equiv' && !empty($content)) { if (is_array($content)) { foreach ($content as $value) { $buffer .= $tab . '<meta ' . $type . '="' . $name . '" content="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd; } } else { $buffer .= $tab . '<meta ' . $type . '="' . $name . '" content="' . htmlspecialchars($content, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd; } } } } // Don't add empty descriptions $documentDescription = $document->getDescription(); if ($documentDescription) { $buffer .= $tab . '<meta name="description" content="' . htmlspecialchars($documentDescription, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd; } // Don't add empty generators $generator = $document->getGenerator(); if ($generator) { $buffer .= $tab . '<meta name="generator" content="' . htmlspecialchars($generator, ENT_COMPAT, 'UTF-8') . '" />' . $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 (is_array($linkAtrr['attribs'])) { if ($temp = ArrayHelper::toString($linkAtrr['attribs'])) { $buffer .= ' ' . $temp; } } $buffer .= ' />' . $lnEnd; } $defaultCssMimes = array('text/css'); // Generate stylesheet links foreach ($document->_styleSheets as $src => $attribs) { // Check if stylesheet uses IE conditional statements. $conditional = isset($attribs['options']) && isset($attribs['options']['conditional']) ? $attribs['options']['conditional'] : null; // Check if script uses media version. if (isset($attribs['options']['version']) && $attribs['options']['version'] && strpos($src, '?') === false && ($mediaVersion || $attribs['options']['version'] !== 'auto')) { $src .= '?' . ($attribs['options']['version'] === 'auto' ? $mediaVersion : $attribs['options']['version']); } $buffer .= $tab; // This is for IE conditional statements support. if (!is_null($conditional)) { $buffer .= '<!--[if ' . $conditional . ']>'; } $buffer .= '<link href="' . $src . '" rel="stylesheet"'; // Add script tag attributes. foreach ($attribs as $attrib => $value) { // Don't add the 'options' attribute. This attribute is for internal use (version, conditional, etc). if ($attrib === 'options') { continue; } // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if (in_array($attrib, array('type', 'mime')) && $document->isHtml5() && in_array($value, $defaultCssMimes)) { continue; } // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if ($attrib === 'mime') { $attrib = 'type'; } // Add attribute to script tag output. $buffer .= ' ' . htmlspecialchars($attrib, ENT_COMPAT, 'UTF-8'); // Json encode value if it's an array. $value = !is_scalar($value) ? json_encode($value) : $value; $buffer .= '="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"'; } $buffer .= $tagEnd; // This is for IE conditional statements support. if (!is_null($conditional)) { $buffer .= '<![endif]-->'; } $buffer .= $lnEnd; } // Generate stylesheet declarations foreach ($document->_style as $type => $content) { $buffer .= $tab . '<style'; if (!is_null($type) && (!$document->isHtml5() || !in_array($type, $defaultCssMimes))) { $buffer .= ' type="' . $type . '"'; } $buffer .= '>' . $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 scripts options $scriptOptions = $document->getScriptOptions(); if (!empty($scriptOptions)) { $buffer .= $tab . '<script type="application/json" class="joomla-script-options new">'; $prettyPrint = (JDEBUG && defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : false); $jsonOptions = json_encode($scriptOptions, $prettyPrint); $jsonOptions = $jsonOptions ? $jsonOptions : '{}'; $buffer .= $jsonOptions; $buffer .= '</script>' . $lnEnd; } $defaultJsMimes = array('text/javascript', 'application/javascript', 'text/x-javascript', 'application/x-javascript'); $html5NoValueAttributes = array('defer', 'async'); $excludeJsFiles = $this->getHeadCache(); // Generate script file links foreach ($document->_scripts as $src => $attribs) { foreach ($excludeJsFiles as $exclude) { foreach ($this->keeperJsFiles as $keeper) { if (strstr($exclude, $keeper)) { continue 2; } } if (strstr($src, $exclude)) { continue 2; } } // Check if script uses IE conditional statements. $conditional = isset($attribs['options']) && isset($attribs['options']['conditional']) ? $attribs['options']['conditional'] : null; // Check if script uses media version. if (isset($attribs['options']['version']) && $attribs['options']['version'] && strpos($src, '?') === false && ($mediaVersion || $attribs['options']['version'] !== 'auto')) { $src .= '?' . ($attribs['options']['version'] === 'auto' ? $mediaVersion : $attribs['options']['version']); } $buffer .= $tab; // This is for IE conditional statements support. if (!is_null($conditional)) { $buffer .= '<!--[if ' . $conditional . ']>'; } $buffer .= '<script src="' . $src . '"'; // Add script tag attributes. foreach ($attribs as $attrib => $value) { // Don't add the 'options' attribute. This attribute is for internal use (version, conditional, etc). if ($attrib === 'options') { continue; } // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if (in_array($attrib, array('type', 'mime')) && $document->isHtml5() && in_array($value, $defaultJsMimes)) { continue; } // B/C: If defer and async is false or empty don't render the attribute. if (in_array($attrib, array('defer', 'async')) && !$value) { continue; } // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if ($attrib === 'mime') { $attrib = 'type'; } // B/C defer and async can be set to yes when using the old method. elseif (in_array($attrib, array('defer', 'async')) && $value === true) { $value = $attrib; } // Add attribute to script tag output. $buffer .= ' ' . htmlspecialchars($attrib, ENT_COMPAT, 'UTF-8'); if (!($document->isHtml5() && in_array($attrib, $html5NoValueAttributes))) { // Json encode value if it's an array. $value = !is_scalar($value) ? json_encode($value) : $value; $buffer .= '="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"'; } } $buffer .= '></script>'; // This is for IE conditional statements support. if (!is_null($conditional)) { $buffer .= '<![endif]-->'; } $buffer .= $lnEnd; } // Generate script declarations foreach ($document->_script as $type => $content) { $buffer .= $tab . '<script'; if (!is_null($type) && (!$document->isHtml5() || !in_array($type, $defaultJsMimes))) { $buffer .= ' type="' . $type . '"'; } $buffer .= '>' . $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; } // 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 ltrim($buffer, $tab); } private function getHeadCache() { $session = \JFactory::getSession(); $doc = \JFactory::getDocument(); $app = \JFactory::getApplication(); $uri = parse_url($app->input->server->get('HTTP_REFERER', '', 'string')); $key = $uri['path']; $qs = ArrayHelper::getValue($uri, 'query', ''); if (!empty($qs)) { $key .= '?' . $qs; } $key = md5($key); $scripts = $this->excludeJsFiles; if (!empty($key)) { $key = 'fabrik.js.head.cache.' . $key; $cachedScripts = $session->get($key, ''); if (!empty($cachedScripts)) { $scripts = json_decode($cachedScripts); $scripts = ArrayHelper::fromObject($scripts); $scripts = array_keys($scripts); } } return $scripts; } } PK ���\�� � Partial/ComponentRenderer.phpnu &1i� <?php /** * Joomla! Content Management System * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Partial; defined('JPATH_PLATFORM') or die; use Joomla\CMS\Document\DocumentRenderer; /** * HTML document renderer for the component output * * @since 3.5 */ class ComponentRenderer extends DocumentRenderer { /** * 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 3.5 */ public function render($component = null, $params = array(), $content = null) { return $content; } } PK ���\09�� Partial/ModuleRenderer.phpnu &1i� <?php /** * Joomla! Content Management System * * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Partial; defined('JPATH_PLATFORM') or die; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Helper\ModuleHelper; use Joomla\CMS\Log\Log; use Joomla\CMS\Layout\LayoutHelper; use Joomla\Registry\Registry; /** * HTML document renderer for a single module * * @since 3.5 */ class ModuleRenderer extends DocumentRenderer { /** * 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 3.5 */ public function render($module, $attribs = array(), $content = null) { if (!is_object($module)) { $title = isset($attribs['title']) ? $attribs['title'] : null; $module = ModuleHelper::getModule($module, $title); if (!is_object($module)) { if (is_null($content)) { return ''; } /** * 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; } } // Set the module content if (!is_null($content)) { $module->content = $content; } // Get module parameters $params = new Registry($module->params); // Use parameters from template if (isset($attribs['params'])) { $template_params = new Registry(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 && \JFactory::getConfig()->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); return ModuleHelper::ModuleCache($module, $params, $cacheparams); } return ModuleHelper::renderModule($module, $attribs); } } PK ���\����O O Html/ModulesRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Factory; use Joomla\CMS\Helper\ModuleHelper; use Joomla\CMS\Layout\LayoutHelper; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * HTML document renderer for a module position * * @since 3.5 */ class ModulesRenderer extends DocumentRenderer { /** * 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 3.5 */ public function render($position, $params = [], $content = null) { $renderer = $this->_doc->loadRenderer('module'); $buffer = ''; $app = Factory::getApplication(); $user = Factory::getUser(); $frontediting = ($app->isClient('site') && $app->get('frontediting', 1) && !$user->guest); $menusEditing = ($app->get('frontediting', 1) == 2) && $user->authorise('core.edit', 'com_menus'); foreach (ModuleHelper::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 = ['moduleHtml' => &$moduleHtml, 'module' => $mod, 'position' => $position, 'menusediting' => $menusEditing]; LayoutHelper::render('joomla.edit.frontediting_modules', $displayData); } $buffer .= $moduleHtml; } $app->triggerEvent('onAfterRenderModules', [&$buffer, &$params]); return $buffer; } } PK ���\���� � Html/MessageRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Factory; use Joomla\CMS\Layout\LayoutHelper; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * HTML document renderer for the system message queue * * @since 3.5 */ class MessageRenderer extends DocumentRenderer { /** * 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 3.5 */ public function render($name, $params = [], $content = null) { $msgList = $this->getData(); $displayData = [ 'msgList' => $msgList, 'name' => $name, 'params' => $params, 'content' => $content, ]; $app = Factory::getApplication(); $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/message.php'; if (is_file($chromePath)) { include_once $chromePath; } if (\function_exists('renderMessage')) { @trigger_error( 'renderMessage() is deprecated. Override system message rendering with layouts instead.', E_USER_DEPRECATED ); return renderMessage($msgList); } return LayoutHelper::render('joomla.system.message', $displayData); } /** * Get and prepare system message data for output * * @return array An array contains system message * * @since 3.5 */ private function getData() { // Initialise variables. $lists = []; // Get the message queue $messages = Factory::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 ���\D�[d* d* Html/ScriptsRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\WebAsset\WebAssetItemInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * JDocument head renderer * * @since 4.0.0 */ class ScriptsRenderer extends DocumentRenderer { /** * List of already rendered src * * @var array * * @since 4.0.0 */ private $renderedSrc = []; /** * Renders the document script tags 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 4.0.0 */ public function render($head, $params = [], $content = null) { // Get line endings $lnEnd = $this->_doc->_getLineEnd(); $tab = $this->_doc->_getTab(); $buffer = ''; $wam = $this->_doc->getWebAssetManager(); $assets = $wam->getAssets('script', true); // Get a list of inline assets and their relation with regular assets $inlineAssets = $wam->filterOutInlineAssets($assets); $inlineRelation = $wam->getInlineRelation($inlineAssets); // Merge with existing scripts, for rendering $assets = array_merge(array_values($assets), $this->_doc->_scripts); // Generate script file links foreach ($assets as $key => $item) { // Check whether we have an Asset instance, or old array with attributes $asset = $item instanceof WebAssetItemInterface ? $item : null; // Add src attribute for non Asset item if (!$asset) { $item['src'] = $key; } // Check for inline content "before" if ($asset && !empty($inlineRelation[$asset->getName()]['before'])) { foreach ($inlineRelation[$asset->getName()]['before'] as $itemBefore) { $buffer .= $this->renderInlineElement($itemBefore); // Remove this item from inline queue unset($inlineAssets[$itemBefore->getName()]); } } $buffer .= $this->renderElement($item); // Check for inline content "after" if ($asset && !empty($inlineRelation[$asset->getName()]['after'])) { foreach ($inlineRelation[$asset->getName()]['after'] as $itemBefore) { $buffer .= $this->renderInlineElement($itemBefore); // Remove this item from inline queue unset($inlineAssets[$itemBefore->getName()]); } } } // Generate script declarations for assets foreach ($inlineAssets as $item) { $buffer .= $this->renderInlineElement($item); } // Generate script declarations for old scripts foreach ($this->_doc->_script as $type => $contents) { // Test for B.C. in case someone still store script declarations as single string if (\is_string($contents)) { $contents = [$contents]; } foreach ($contents as $content) { $buffer .= $this->renderInlineElement( [ 'type' => $type, 'content' => $content, ] ); } } // Output the custom tags - array_unique makes sure that we don't output the same tags twice foreach (array_unique($this->_doc->_custom) as $custom) { $buffer .= $tab . $custom . $lnEnd; } return ltrim($buffer, $tab); } /** * Renders the element * * @param WebAssetItemInterface|array $item The element * * @return string The resulting string * * @since 4.0.0 */ private function renderElement($item): string { $buffer = ''; $asset = $item instanceof WebAssetItemInterface ? $item : null; $src = $asset ? $asset->getUri() : ($item['src'] ?? ''); // Make sure we have a src, and it not already rendered if (!$src || !empty($this->renderedSrc[$src]) || ($asset && $asset->getOption('webcomponent'))) { return ''; } $lnEnd = $this->_doc->_getLineEnd(); $tab = $this->_doc->_getTab(); $mediaVersion = $this->_doc->getMediaVersion(); // Get the attributes and other options if ($asset) { $attribs = $asset->getAttributes(); $version = $asset->getVersion(); $conditional = $asset->getOption('conditional'); // Add an asset info for debugging if (JDEBUG) { $attribs['data-asset-name'] = $asset->getName(); if ($asset->getDependencies()) { $attribs['data-asset-dependencies'] = implode(',', $asset->getDependencies()); } if ($asset->getOption('deprecated')) { @trigger_error( sprintf('Web Asset script [%s] is deprecated. %s', $asset->getName(), $asset->getOption('deprecatedMsg', '')), E_USER_DEPRECATED ); } } } else { $attribs = $item; $version = isset($attribs['options']['version']) ? $attribs['options']['version'] : ''; $conditional = !empty($attribs['options']['conditional']) ? $attribs['options']['conditional'] : null; } // Add "nonce" attribute if exist if ($this->_doc->cspNonce && !is_null($this->_doc->cspNonce)) { $attribs['nonce'] = $this->_doc->cspNonce; } // To prevent double rendering $this->renderedSrc[$src] = true; // Check if script uses media version. if ($version && strpos($src, '?') === false && ($mediaVersion || $version !== 'auto')) { $src .= '?' . ($version === 'auto' ? $mediaVersion : $version); } $buffer .= $tab; // This is for IE conditional statements support. if (!\is_null($conditional)) { $buffer .= '<!--[if ' . $conditional . ']>'; } // Render the element with attributes $buffer .= '<script src="' . htmlspecialchars($src) . '"'; $buffer .= $this->renderAttributes($attribs); $buffer .= '></script>'; // This is for IE conditional statements support. if (!\is_null($conditional)) { $buffer .= '<![endif]-->'; } $buffer .= $lnEnd; return $buffer; } /** * Renders the inline element * * @param WebAssetItemInterface|array $item The element * * @return string The resulting string * * @since 4.0.0 */ private function renderInlineElement($item): string { $buffer = ''; $lnEnd = $this->_doc->_getLineEnd(); $tab = $this->_doc->_getTab(); if ($item instanceof WebAssetItemInterface) { $attribs = $item->getAttributes(); $content = $item->getOption('content'); } else { $attribs = $item; $content = $item['content'] ?? ''; unset($attribs['content']); } // Do not produce empty elements if (!$content) { return ''; } // Add "nonce" attribute if exist if ($this->_doc->cspNonce && !is_null($this->_doc->cspNonce)) { $attribs['nonce'] = $this->_doc->cspNonce; } $buffer .= $tab . '<script'; $buffer .= $this->renderAttributes($attribs); $buffer .= '>'; // This is for full XHTML support. if ($this->_doc->_mime !== 'text/html') { $buffer .= $tab . $tab . '//<![CDATA[' . $lnEnd; } $buffer .= $content; // See above note if ($this->_doc->_mime !== 'text/html') { $buffer .= $tab . $tab . '//]]>' . $lnEnd; } $buffer .= '</script>' . $lnEnd; return $buffer; } /** * Renders the element attributes * * @param array $attributes The element attributes * * @return string The attributes string * * @since 4.0.0 */ private function renderAttributes(array $attributes): string { $buffer = ''; $defaultJsMimes = ['text/javascript', 'application/javascript', 'text/x-javascript', 'application/x-javascript']; $html5NoValueAttributes = ['defer', 'async', 'nomodule']; foreach ($attributes as $attrib => $value) { // Don't add the 'options' attribute. This attribute is for internal use (version, conditional, etc). if ($attrib === 'options' || $attrib === 'src') { continue; } // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if (\in_array($attrib, ['type', 'mime']) && $this->_doc->isHtml5() && \in_array($value, $defaultJsMimes)) { continue; } // B/C: If defer and async is false or empty don't render the attribute. Also skip if value is bool:false. if (\in_array($attrib, ['defer', 'async']) && !$value || $value === false) { continue; } // NoValue attribute, if it have bool:true $isNoValueAttrib = $value === true || \in_array($attrib, $html5NoValueAttributes); // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if ($attrib === 'mime') { $attrib = 'type'; } elseif ($isNoValueAttrib) { // NoValue attribute in non HTML5 should contain a value, set it equal to attribute name. $value = $attrib; } // Add attribute to script tag output. $buffer .= ' ' . htmlspecialchars($attrib, ENT_COMPAT, 'UTF-8'); if (!($this->_doc->isHtml5() && $isNoValueAttrib)) { // Json encode value if it's an array. $value = !is_scalar($value) ? json_encode($value) : $value; $buffer .= '="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"'; } } return $buffer; } } PK ���\�ѩ� � Html/ComponentRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; use Joomla\CMS\Document\DocumentRenderer; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * HTML document renderer for the component output * * @since 3.5 */ class ComponentRenderer extends DocumentRenderer { /** * 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 3.5 */ public function render($component = null, $params = [], $content = null) { return $content; } } PK ���\��c~�( �( Html/StylesRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\WebAsset\WebAssetItemInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * JDocument styles renderer * * @since 4.0.0 */ class StylesRenderer extends DocumentRenderer { /** * List of already rendered src * * @var array * * @since 4.0.0 */ private $renderedSrc = []; /** * Renders the document stylesheets and style tags 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 4.0.0 */ public function render($head, $params = [], $content = null) { $tab = $this->_doc->_getTab(); $buffer = ''; $wam = $this->_doc->getWebAssetManager(); $assets = $wam->getAssets('style', true); // Get a list of inline assets and their relation with regular assets $inlineAssets = $wam->filterOutInlineAssets($assets); $inlineRelation = $wam->getInlineRelation($inlineAssets); // Merge with existing styleSheets, for rendering $assets = array_merge(array_values($assets), $this->_doc->_styleSheets); // Generate stylesheet links foreach ($assets as $key => $item) { $asset = $item instanceof WebAssetItemInterface ? $item : null; // Add href attribute for non Asset item if (!$asset) { $item['href'] = $key; } // Check for inline content "before" if ($asset && !empty($inlineRelation[$asset->getName()]['before'])) { foreach ($inlineRelation[$asset->getName()]['before'] as $itemBefore) { $buffer .= $this->renderInlineElement($itemBefore); // Remove this item from inline queue unset($inlineAssets[$itemBefore->getName()]); } } $buffer .= $this->renderElement($item); // Check for inline content "after" if ($asset && !empty($inlineRelation[$asset->getName()]['after'])) { foreach ($inlineRelation[$asset->getName()]['after'] as $itemBefore) { $buffer .= $this->renderInlineElement($itemBefore); // Remove this item from inline queue unset($inlineAssets[$itemBefore->getName()]); } } } // Generate script declarations for assets foreach ($inlineAssets as $item) { $buffer .= $this->renderInlineElement($item); } // Generate stylesheet declarations foreach ($this->_doc->_style as $type => $contents) { // Test for B.C. in case someone still store stylesheet declarations as single string if (\is_string($contents)) { $contents = [$contents]; } foreach ($contents as $content) { $buffer .= $this->renderInlineElement( [ 'type' => $type, 'content' => $content, ] ); } } return ltrim($buffer, $tab); } /** * Renders the element * * @param WebAssetItemInterface|array $item The element * * @return string The resulting string * * @since 4.0.0 */ private function renderElement($item): string { $buffer = ''; $asset = $item instanceof WebAssetItemInterface ? $item : null; $src = $asset ? $asset->getUri() : ($item['href'] ?? ''); // Make sure we have a src, and it not already rendered if (!$src || !empty($this->renderedSrc[$src])) { return ''; } $lnEnd = $this->_doc->_getLineEnd(); $tab = $this->_doc->_getTab(); $mediaVersion = $this->_doc->getMediaVersion(); // Get the attributes and other options if ($asset) { $attribs = $asset->getAttributes(); $version = $asset->getVersion(); $conditional = $asset->getOption('conditional'); // Add an asset info for debugging if (JDEBUG) { $attribs['data-asset-name'] = $asset->getName(); if ($asset->getDependencies()) { $attribs['data-asset-dependencies'] = implode(',', $asset->getDependencies()); } if ($asset->getOption('deprecated')) { @trigger_error( sprintf('Web Asset style [%s] is deprecated. %s', $asset->getName(), $asset->getOption('deprecatedMsg', '')), E_USER_DEPRECATED ); } } } else { $attribs = $item; $version = isset($attribs['options']['version']) ? $attribs['options']['version'] : ''; $conditional = !empty($attribs['options']['conditional']) ? $attribs['options']['conditional'] : null; } // Add "nonce" attribute if exist if ($this->_doc->cspNonce && !is_null($this->_doc->cspNonce)) { $attribs['nonce'] = $this->_doc->cspNonce; } // To prevent double rendering $this->renderedSrc[$src] = true; // Check if script uses media version. if ($version && strpos($src, '?') === false && ($mediaVersion || $version !== 'auto')) { $src .= '?' . ($version === 'auto' ? $mediaVersion : $version); } $buffer .= $tab; // This is for IE conditional statements support. if (!\is_null($conditional)) { $buffer .= '<!--[if ' . $conditional . ']>'; } $relation = isset($attribs['rel']) ? $attribs['rel'] : 'stylesheet'; if (isset($attribs['rel'])) { unset($attribs['rel']); } // Render the element with attributes $buffer .= '<link href="' . htmlspecialchars($src) . '" rel="' . $relation . '"'; $buffer .= $this->renderAttributes($attribs); $buffer .= ' />'; if ($relation === 'lazy-stylesheet') { $buffer .= '<noscript><link href="' . htmlspecialchars($src) . '" rel="stylesheet" /></noscript>'; } // This is for IE conditional statements support. if (!\is_null($conditional)) { $buffer .= '<![endif]-->'; } $buffer .= $lnEnd; return $buffer; } /** * Renders the inline element * * @param WebAssetItemInterface|array $item The element * * @return string The resulting string * * @since 4.0.0 */ private function renderInlineElement($item): string { $buffer = ''; $lnEnd = $this->_doc->_getLineEnd(); $tab = $this->_doc->_getTab(); if ($item instanceof WebAssetItemInterface) { $attribs = $item->getAttributes(); $content = $item->getOption('content'); } else { $attribs = $item; $content = $item['content'] ?? ''; unset($attribs['content']); } // Do not produce empty elements if (!$content) { return ''; } // Add "nonce" attribute if exist if ($this->_doc->cspNonce && !is_null($this->_doc->cspNonce)) { $attribs['nonce'] = $this->_doc->cspNonce; } $buffer .= $tab . '<style'; $buffer .= $this->renderAttributes($attribs); $buffer .= '>'; // This is for full XHTML support. if ($this->_doc->_mime !== 'text/html') { $buffer .= $tab . $tab . '/*<![CDATA[*/' . $lnEnd; } $buffer .= $content; // See above note if ($this->_doc->_mime !== 'text/html') { $buffer .= $tab . $tab . '/*]]>*/' . $lnEnd; } $buffer .= '</style>' . $lnEnd; return $buffer; } /** * Renders the element attributes * * @param array $attributes The element attributes * * @return string The attributes string * * @since 4.0.0 */ private function renderAttributes(array $attributes): string { $buffer = ''; $defaultCssMimes = ['text/css']; foreach ($attributes as $attrib => $value) { // Don't add the 'options' attribute. This attribute is for internal use (version, conditional, etc). if ($attrib === 'options' || $attrib === 'href') { continue; } // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if (\in_array($attrib, ['type', 'mime']) && $this->_doc->isHtml5() && \in_array($value, $defaultCssMimes)) { continue; } // Skip the attribute if value is bool:false. if ($value === false) { continue; } // NoValue attribute, if it have bool:true $isNoValueAttrib = $value === true; // Don't add type attribute if document is HTML5 and it's a default mime type. 'mime' is for B/C. if ($attrib === 'mime') { $attrib = 'type'; } elseif ($isNoValueAttrib) { // NoValue attribute in non HTML5 should contain a value, set it equal to attribute name. $value = $attrib; } // Add attribute to script tag output. $buffer .= ' ' . htmlspecialchars($attrib, ENT_COMPAT, 'UTF-8'); if (!($this->_doc->isHtml5() && $isNoValueAttrib)) { // Json encode value if it's an array. $value = !is_scalar($value) ? json_encode($value) : $value; $buffer .= '="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '"'; } } return $buffer; } } PK ���\�3��� � Html/HeadRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; use Joomla\CMS\Document\DocumentRenderer; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * HTML document renderer for the document `<head>` element * * @since 3.5 */ class HeadRenderer extends DocumentRenderer { /** * 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 3.5 */ public function render($head, $params = [], $content = null) { $buffer = ''; $buffer .= $this->_doc->loadRenderer('metas')->render($head, $params, $content); $buffer .= $this->_doc->loadRenderer('styles')->render($head, $params, $content); $buffer .= $this->_doc->loadRenderer('scripts')->render($head, $params, $content); return $buffer; } } PK ���\�^�� � Html/MetasRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Factory; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Uri\Uri; use Joomla\CMS\WebAsset\WebAssetAttachBehaviorInterface; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * JDocument metas renderer * * @since 4.0.0 */ class MetasRenderer extends DocumentRenderer { /** * Renders the document metas 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 4.0.0 */ public function render($head, $params = [], $content = null) { // Convert the tagids to titles if (isset($this->_doc->_metaTags['name']['tags'])) { $tagsHelper = new TagsHelper(); $this->_doc->_metaTags['name']['tags'] = implode(', ', $tagsHelper->getTagNames($this->_doc->_metaTags['name']['tags'])); } /** @var \Joomla\CMS\Application\CMSApplication $app */ $app = Factory::getApplication(); $wa = $this->_doc->getWebAssetManager(); // Check for AttachBehavior and web components foreach ($wa->getAssets('script', true) as $asset) { if ($asset instanceof WebAssetAttachBehaviorInterface) { $asset->onAttachCallback($this->_doc); } } // Trigger the onBeforeCompileHead event $app->triggerEvent('onBeforeCompileHead'); // Add Script Options as inline asset $scriptOptions = $this->_doc->getScriptOptions(); if ($scriptOptions) { $prettyPrint = (JDEBUG && \defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : false); $jsonOptions = json_encode($scriptOptions, $prettyPrint); $jsonOptions = $jsonOptions ?: '{}'; $wa->addInlineScript( $jsonOptions, ['name' => 'joomla.script.options', 'position' => 'before'], ['type' => 'application/json', 'class' => 'joomla-script-options new'], ['core'] ); } // Lock the AssetManager $wa->lock(); // Get line endings $lnEnd = $this->_doc->_getLineEnd(); $tab = $this->_doc->_getTab(); $buffer = ''; // Generate charset when using HTML5 (should happen first) if ($this->_doc->isHtml5()) { $buffer .= $tab . '<meta charset="' . $this->_doc->getCharset() . '">' . $lnEnd; } // Generate base tag (need to happen early) $base = $this->_doc->getBase(); if (!empty($base)) { $buffer .= $tab . '<base href="' . $base . '">' . $lnEnd; } $noFavicon = true; $searchFor = 'image/vnd.microsoft.icon'; array_map(function ($value) use (&$noFavicon, $searchFor) { if (isset($value['attribs']['type']) && $value['attribs']['type'] === $searchFor) { $noFavicon = false; } }, array_values((array)$this->_doc->_links)); if ($noFavicon) { $client = $app->isClient('administrator') === true ? 'administrator/' : 'site/'; $template = $app->getTemplate(true); // Try to find a favicon by checking the template and root folder $icon = '/favicon.ico'; $foldersToCheck = [ JPATH_BASE, JPATH_ROOT . '/media/templates/' . $client . $template->template, JPATH_BASE . '/templates/' . $template->template, ]; foreach ($foldersToCheck as $base => $dir) { if ( $template->parent !== '' && $base === 1 && !is_file(JPATH_ROOT . '/media/templates/' . $client . $template->template . $icon) ) { $dir = JPATH_ROOT . '/media/templates/' . $client . $template->parent; } if (is_file($dir . $icon)) { $urlBase = in_array($base, [0, 2]) ? Uri::base(true) : Uri::root(true); $base = in_array($base, [0, 2]) ? JPATH_BASE : JPATH_ROOT; $path = str_replace($base, '', $dir); $path = str_replace('\\', '/', $path); $this->_doc->addFavicon($urlBase . $path . $icon); break; } } } // Generate META tags (needs to happen as early as possible in the head) foreach ($this->_doc->_metaTags as $type => $tag) { foreach ($tag as $name => $contents) { if ($type === 'http-equiv' && !($this->_doc->isHtml5() && $name === 'content-type')) { $buffer .= $tab . '<meta http-equiv="' . $name . '" content="' . htmlspecialchars($contents, ENT_COMPAT, 'UTF-8') . '">' . $lnEnd; } elseif ($type !== 'http-equiv' && !empty($contents)) { $buffer .= $tab . '<meta ' . $type . '="' . $name . '" content="' . htmlspecialchars($contents, ENT_COMPAT, 'UTF-8') . '">' . $lnEnd; } } } // Don't add empty descriptions $documentDescription = $this->_doc->getDescription(); if ($documentDescription) { $buffer .= $tab . '<meta name="description" content="' . htmlspecialchars($documentDescription, ENT_COMPAT, 'UTF-8') . '">' . $lnEnd; } // Don't add empty generators $generator = $this->_doc->getGenerator(); if ($generator) { $buffer .= $tab . '<meta name="generator" content="' . htmlspecialchars($generator, ENT_COMPAT, 'UTF-8') . '">' . $lnEnd; } $buffer .= $tab . '<title>' . htmlspecialchars($this->_doc->getTitle(), ENT_COMPAT, 'UTF-8') . '</title>' . $lnEnd; // Generate link declarations foreach ($this->_doc->_links as $link => $linkAtrr) { $buffer .= $tab . '<link href="' . $link . '" ' . $linkAtrr['relType'] . '="' . $linkAtrr['relation'] . '"'; if (\is_array($linkAtrr['attribs'])) { if ($temp = ArrayHelper::toString($linkAtrr['attribs'])) { $buffer .= ' ' . $temp; } } $buffer .= '>' . $lnEnd; } return ltrim($buffer, $tab); } } PK ���\����� � Html/ModuleRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Document\Renderer\Html; use Joomla\CMS\Document\DocumentRenderer; use Joomla\CMS\Factory; use Joomla\CMS\Helper\ModuleHelper; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * HTML document renderer for a single module * * @since 3.5 */ class ModuleRenderer extends DocumentRenderer { /** * 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 3.5 */ public function render($module, $attribs = [], $content = null) { if (!\is_object($module)) { $title = $attribs['title'] ?? null; $module = ModuleHelper::getModule($module, $title); if (!\is_object($module)) { if (\is_null($content)) { return ''; } /** * 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; } } // Set the module content if (!\is_null($content)) { $module->content = $content; } // Get module parameters $params = new Registry($module->params); // Use parameters from template if (isset($attribs['params'])) { $template_params = new Registry(html_entity_decode($attribs['params'], ENT_COMPAT, 'UTF-8')); $params->merge($template_params); $module = clone $module; $module->params = (string) $params; } // Set cachemode parameter or use JModuleHelper::moduleCache from within the module instead $cachemode = $params->get('cachemode', 'static'); if ($params->get('cache', 0) == 1 && Factory::getApplication()->get('caching') >= 1 && $cachemode !== 'id' && $cachemode !== 'safeuri') { // Default to itemid creating method and workarounds on $cacheparams = new \stdClass(); $cacheparams->cachemode = $cachemode; $cacheparams->class = ModuleHelper::class; $cacheparams->method = 'renderModule'; $cacheparams->methodparams = [$module, $attribs]; $cacheparams->cachesuffix = $attribs['contentOnly'] ?? false; // It need to be done here because the cache controller does not keep reference to the module object $module->content = ModuleHelper::moduleCache($module, $params, $cacheparams); $module->contentRendered = true; return $module->content; } return ModuleHelper::renderModule($module, $attribs); } } PK ���\��� � HtmlRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Error\Renderer; use Joomla\CMS\Error\AbstractRenderer; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * HTML error page renderer * * @since 4.0.0 * @todo Change this renderer to use JDocumentHtml instead of JDocumentError, the latter is only used for B/C at this time */ class HtmlRenderer extends AbstractRenderer { /** * The format (type) of the error page * * @var string * @since 4.0.0 */ protected $type = 'error'; /** * Render the error page for the given object * * @param \Throwable $error The error object to be rendered * * @return string * * @since 4.0.0 */ public function render(\Throwable $error): string { $app = Factory::getApplication(); // Get the current template from the application $template = $app->getTemplate(true); // Push the error object into the document $this->getDocument()->setError($error); // Add registry file for the template asset $wa = $this->getDocument()->getWebAssetManager()->getRegistry(); $wa->addTemplateRegistryFile($template->template, $app->getClientId()); if (!empty($template->parent)) { $wa->addTemplateRegistryFile($template->parent, $app->getClientId()); } if (ob_get_contents()) { ob_end_clean(); } $this->getDocument()->setTitle(Text::_('Error') . ': ' . $error->getCode()); return $this->getDocument()->render( false, [ 'template' => $template->template, 'directory' => JPATH_THEMES, 'debug' => JDEBUG, 'csp_nonce' => $app->get('csp_nonce'), 'templateInherits' => $template->parent, 'params' => $template->params, ] ); } } PK ���\|A�= = JsonRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Error\Renderer; use Joomla\Application\WebApplicationInterface; use Joomla\CMS\Error\AbstractRenderer; use Joomla\CMS\Factory; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * JSON error page renderer * * @since 4.0.0 */ class JsonRenderer extends AbstractRenderer { /** * The format (type) of the error page * * @var string * @since 4.0.0 */ protected $type = 'json'; /** * Render the error page for the given object * * @param \Throwable $error The error object to be rendered * * @return string * * @since 4.0.0 */ public function render(\Throwable $error): string { // Create our data object to be rendered $data = [ 'error' => true, 'code' => $error->getCode(), 'message' => $error->getMessage(), ]; // Include the stack trace if in debug mode if (JDEBUG) { $data['trace'] = $error->getTraceAsString(); } $app = Factory::getApplication(); if ($app instanceof WebApplicationInterface) { $errorCode = 500; if ($error->getCode() > 0) { $errorCode = $error->getCode(); } $app->setHeader('status', $errorCode); } // Push the data object into the document $this->getDocument()->setBuffer(json_encode($data)); if (ob_get_contents()) { ob_end_clean(); } return $this->getDocument()->render(); } } PK ���\� �yM M CliRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Error\Renderer; use Joomla\CMS\Error\AbstractRenderer; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Cli error renderer * * @since 4.0.0 */ class CliRenderer extends AbstractRenderer { /** * The format (type) * * @var string * @since 4.0.0 */ protected $type = 'cli'; /** * Render the error for the given object. * * @param \Throwable $error The error object to be rendered * * @return string * * @since 4.0.0 */ public function render(\Throwable $error): string { $buffer = PHP_EOL . 'Error occurred: ' . $error->getMessage() . PHP_EOL . $this->getTrace($error); if ($prev = $error->getPrevious()) { $buffer .= PHP_EOL . PHP_EOL . 'Previous Exception: ' . $prev->getMessage() . PHP_EOL . $this->getTrace($prev); } return $buffer; } /** * Returns a trace for the given error. * * @param \Throwable $error The error * * @return string * * @since 4.0.0 */ private function getTrace(\Throwable $error): string { // Include the stack trace only if in debug mode if (!JDEBUG) { return ''; } return PHP_EOL . $error->getTraceAsString() . PHP_EOL; } } PK ���\CtO� � XmlRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Error\Renderer; use Joomla\CMS\Error\AbstractRenderer; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * XML error page renderer * * @since 4.0.0 */ class XmlRenderer extends AbstractRenderer { /** * The format (type) of the error page * * @var string * @since 4.0.0 */ protected $type = 'xml'; /** * Render the error page for the given object * * @param \Throwable $error The error object to be rendered * * @return string * * @since 4.0.0 */ public function render(\Throwable $error): string { // Create our data object to be rendered $xw = new \XMLWriter(); $xw->openMemory(); $xw->setIndent(true); $xw->setIndentString("\t"); $xw->startDocument('1.0', 'UTF-8'); $xw->startElement('error'); $xw->writeElement('code', $error->getCode()); $xw->writeElement('message', $error->getMessage()); // Include the stack trace if in debug mode if (JDEBUG) { $xw->writeElement('trace', $error->getTraceAsString()); } // End error element $xw->endElement(); // Push the data object into the document $this->getDocument()->setBuffer($xw->outputMemory(true)); if (ob_get_contents()) { ob_end_clean(); } return $this->getDocument()->render(); } } PK ���\�Ʋrg g JsonapiRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Error\Renderer; use Joomla\Application\WebApplicationInterface; use Joomla\CMS\Error\JsonApi\AuthenticationFailedExceptionHandler; use Joomla\CMS\Error\JsonApi\CheckinCheckoutExceptionHandler; use Joomla\CMS\Error\JsonApi\InvalidParameterExceptionHandler; use Joomla\CMS\Error\JsonApi\InvalidRouteExceptionHandler; use Joomla\CMS\Error\JsonApi\NotAcceptableExceptionHandler; use Joomla\CMS\Error\JsonApi\NotAllowedExceptionHandler; use Joomla\CMS\Error\JsonApi\ResourceNotFoundExceptionHandler; use Joomla\CMS\Error\JsonApi\SaveExceptionHandler; use Joomla\CMS\Error\JsonApi\SendEmailExceptionHandler; use Joomla\CMS\Factory; use Tobscure\JsonApi\ErrorHandler; use Tobscure\JsonApi\Exception\Handler\FallbackExceptionHandler; use Tobscure\JsonApi\Exception\Handler\ResponseBag; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * JSON error page renderer * * @since 4.0.0 */ class JsonapiRenderer extends JsonRenderer { /** * The format (type) of the error page * * @var string * @since 4.0.0 */ protected $type = 'jsonapi'; /** * Render the error page for the given object * * @param \Throwable $error The error object to be rendered * * @return string * * @since 4.0.0 */ public function render(\Throwable $error): string { if ($error instanceof \Exception) { $errors = new ErrorHandler(); $errors->registerHandler(new InvalidRouteExceptionHandler()); $errors->registerHandler(new AuthenticationFailedExceptionHandler()); $errors->registerHandler(new NotAcceptableExceptionHandler()); $errors->registerHandler(new NotAllowedExceptionHandler()); $errors->registerHandler(new InvalidParameterExceptionHandler()); $errors->registerHandler(new ResourceNotFoundExceptionHandler()); $errors->registerHandler(new SaveExceptionHandler()); $errors->registerHandler(new CheckinCheckoutExceptionHandler()); $errors->registerHandler(new SendEmailExceptionHandler()); $errors->registerHandler(new FallbackExceptionHandler(JDEBUG)); $response = $errors->handle($error); } else { $code = 500; $errorInfo = ['code' => $code, 'title' => 'Internal server error']; if (JDEBUG) { $errorInfo['detail'] = (string) $error; } $response = new ResponseBag($code, $errorInfo); } $this->getDocument()->setErrors($response->getErrors()); $app = Factory::getApplication(); if ($app instanceof WebApplicationInterface) { $app->setHeader('status', $response->getStatus()); } if (ob_get_contents()) { ob_end_clean(); } return $this->getDocument()->render(); } } PK ���\7� �� � FeedRenderer.phpnu �[��� <?php /** * Joomla! Content Management System * * @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Error\Renderer; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * RSS/Atom feed error page renderer * * @since 4.0.0 */ class FeedRenderer extends XmlRenderer { } PK ���\���� � Pdf/ComponentRenderer.phpnu &1i� PK ���\��þ � � Pdf/ModulesRenderer.phpnu &1i� PK ���\}}�Q Pdf/ModuleRenderer.phpnu &1i� PK ���\�;6�� � W Pdf/MessageRenderer.phpnu &1i� PK ���\ 5��+ �+ E Pdf/HeadRenderer.phpnu &1i� PK ���\����% �% BL Feed/RssRenderer.phpnu �[��� PK ���\'�# {r Feed/AtomRenderer.phpnu �[��� PK ���\�;z+� � Ɛ Partial/ModulesRenderer.phpnu &1i� PK ���\��l� � Ҙ Partial/MessageRenderer.phpnu &1i� PK ���\��Z2 2 ǡ Partial/HeadRenderer.phpnu &1i� PK ���\�� � (� Partial/ComponentRenderer.phpnu &1i� PK ���\09�� *� Partial/ModuleRenderer.phpnu &1i� PK ���\����O O �� Html/ModulesRenderer.phpnu �[��� PK ���\���� � � Html/MessageRenderer.phpnu �[��� PK ���\D�[d* d* +� Html/ScriptsRenderer.phpnu �[��� PK ���\�ѩ� � � Html/ComponentRenderer.phpnu �[��� PK ���\��c~�( �( % Html/StylesRenderer.phpnu �[��� PK ���\�3��� � CN Html/HeadRenderer.phpnu �[��� PK ���\�^�� � {S Html/MetasRenderer.phpnu �[��� PK ���\����� � �n Html/ModuleRenderer.phpnu �[��� PK ���\��� � �| HtmlRenderer.phpnu �[��� PK ���\|A�= = �� JsonRenderer.phpnu �[��� PK ���\� �yM M +� CliRenderer.phpnu �[��� PK ���\CtO� � �� XmlRenderer.phpnu �[��� PK ���\�Ʋrg g �� JsonapiRenderer.phpnu �[��� PK ���\7� �� � ^� FeedRenderer.phpnu �[��� PK � t�
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings