Файловый менеджер - Редактировать - /home/wuectly/www/03cbe/src.zip
Назад
PK <t!]{�9� Helper.phpnu &1i� <?php /** * @package Tabs * @version 7.6.0 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2020 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\System\Tabs; defined('_JEXEC') or die; use Joomla\CMS\Factory as JFactory; use RegularLabs\Library\Article as RL_Article; use RegularLabs\Library\Document as RL_Document; use RegularLabs\Library\Html as RL_Html; /** * Plugin that replaces stuff */ class Helper { public function onContentPrepare($context, &$article, &$params) { $area = isset($article->created_by) ? 'article' : 'other'; $context = (($params instanceof \JRegistry) && $params->get('rl_search')) ? 'com_search.' . $params->get('readmore_limit') : $context; RL_Article::process($article, $context, $this, 'replaceTags', [$area, $context]); } public function onAfterDispatch() { Document::addHeadStuff(); if ( ! $buffer = RL_Document::getBuffer()) { return; } if ( ! Replace::replaceTags($buffer, 'component')) { return; } RL_Document::setBuffer($buffer); } public function onAfterRender() { $html = JFactory::getApplication()->getBody(); if ($html == '') { return; } $params = Params::get(); list($tag_start, $tag_end) = Params::getTagCharacters(); if ( strpos($html, $tag_start . $params->tag_open) === false && strpos($html, 'rl_tabs-scrollto') === false ) { Document::removeHeadStuff($html); Clean::cleanLeftoverJunk($html); JFactory::getApplication()->setBody($html); return; } // only do stuff in body list($pre, $body, $post) = RL_Html::getBody($html); Replace::replaceTags($body, 'body'); $html = $pre . $body . $post; Clean::cleanLeftoverJunk($html); JFactory::getApplication()->setBody($html); } public function replaceTags(&$string, $area = 'article', $context = '') { Replace::replaceTags($string, $area, $context); } } PK <t!]N3��x x Clean.phpnu &1i� <?php /** * @package Tabs * @version 7.6.0 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2020 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\System\Tabs; defined('_JEXEC') or die; use RegularLabs\Library\Protect as RL_Protect; class Clean { /** * Just in case you can't figure the method name out: this cleans the left-over junk */ public static function cleanLeftoverJunk(&$string) { $params = Params::get(); Protect::unprotectTags($string); RL_Protect::removeFromHtmlTagContent($string, Params::getTags(true)); RL_Protect::removeInlineComments($string, 'Tabs'); if ( ! $params->place_comments) { RL_Protect::removeCommentTags($string, 'Tabs'); } } } PK <t!]-�4� � Protect.phpnu &1i� <?php /** * @package Tabs * @version 8.0.1 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\System\Tabs; defined('_JEXEC') or die; use RegularLabs\Library\Protect as RL_Protect; class Protect { static $name = 'Tabs'; public static function _(&$string) { RL_Protect::protectHtmlCommentTags($string); RL_Protect::protectFields($string, Params::getTags(true)); RL_Protect::protectSourcerer($string); } public static function protectTags(&$string) { RL_Protect::protectTags($string, Params::getTags(true)); } public static function unprotectTags(&$string) { RL_Protect::unprotectTags($string, Params::getTags(true)); } /** * Wrap the comment in comment tags * * @param string $comment * * @return string */ public static function wrapInCommentTags($comment) { return RL_Protect::wrapInCommentTags(self::$name, $comment); } /** * Get the html start comment tags * * @return string */ public static function getCommentStartTag() { return RL_Protect::getCommentStartTag(self::$name); } /** * Get the html end comment tags * * @return string */ public static function getCommentEndTag() { return RL_Protect::getCommentEndTag(self::$name); } } PK <t!]$ ��1^ 1^ Replace.phpnu &1i� <?php /** * @package Tabs * @version 8.0.1 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\System\Tabs; defined('_JEXEC') or die; use Joomla\CMS\Factory as JFactory; use Joomla\CMS\Router\Route as JRoute; use Joomla\CMS\Uri\Uri as JUri; use RegularLabs\Library\Alias as RL_Alias; use RegularLabs\Library\Html as RL_Html; use RegularLabs\Library\HtmlTag as RL_HtmlTag; use RegularLabs\Library\PluginTag as RL_PluginTag; use RegularLabs\Library\Protect as RL_Protect; use RegularLabs\Library\RegEx as RL_RegEx; use RegularLabs\Library\StringHelper as RL_String; use RegularLabs\Library\Title as RL_Title; use RegularLabs\Library\Uri as RL_Uri; class Replace { static $context = ''; static $sets = []; static $ids = []; static $matches = []; static $allitems = []; static $setcount = 0; public static function replaceTags(&$string, $area = 'article', $context = '') { if ( ! is_string($string) || $string == '') { return false; } self::$context = $context; // Check if tags are in the text snippet used for the search component if (strpos($context, 'com_search.') === 0) { $limit = explode('.', $context, 2); $limit = (int) array_pop($limit); $string_check = substr($string, 0, $limit); if ( ! RL_String::contains($string_check, Params::getTags(true))) { return false; } } $params = Params::get(); // allow in component? if (RL_Protect::isRestrictedComponent(isset($params->disabled_components) ? $params->disabled_components : [], $area)) { Protect::_($string); self::handlePrintPage($string); RL_Protect::unprotect($string); return true; } if ( ! RL_String::contains($string, Params::getTags(true))) { // Links with #tab-name or &tab=tab-name self::replaceLinks($string); return true; } Protect::_($string); list($start_tags, $end_tags) = Params::getTags(); list($pre_string, $string, $post_string) = RL_Html::getContentContainingSearches( $string, $start_tags, $end_tags ); if (JFactory::getApplication()->input->getInt('print', 0)) { // Replace syntax with general html on print pages self::handlePrintPage($string); $string = $pre_string . $string . $post_string; RL_Protect::unprotect($string); return true; } $sets = self::getSets($string); self::initSets($sets); // Tag syntax: {tab ...} self::replaceSyntax($string, $sets); // Closing tag: {/tab} self::replaceClosingTag($string); // Links with #tab-name or &tab=tab-name self::replaceLinks($string); // Link tag {tablink ...} self::replaceLinkTag($string); $string = $pre_string . $string . $post_string; RL_Protect::unprotect($string); return true; } private static function handlePrintPage(&$string) { $sets = self::getSets($string); self::initSets($sets); $prefix = ''; foreach ($sets as $items) { foreach ($items as $item) { $class = 'rl_tabs-print'; if ($item->open) { $class .= ' active'; } $replace = $prefix . '<div id="' . $item->id . '" class="' . $class . '">' . '<' . $item->title_tag . ' class="rl_tabs-title nn_tabs-title">' . '<a id="anchor-' . $item->id . '" class="anchor"></a>' . $item->title_full . '</' . $item->title_tag . '>'; $string = RL_String::replaceOnce($item->orig, $replace, $string); $prefix = '</div>'; } } $regex = Params::getRegex('end'); RL_RegEx::matchAll($regex, $string, $matches); $replace = '</div>'; foreach ($matches as $match) { $string = RL_String::replaceOnce($match[0], $replace, $string); $replace = ''; } $regex = Params::getRegex('link'); RL_RegEx::matchAll($regex, $string, $matches); foreach ($matches as $match) { $href = RL_Uri::get($match['id']); $link = '<a href="' . $href . '">' . $match['text'] . '</a>'; $string = RL_String::replaceOnce($match[0], $link, $string); } } public static function getSets(&$string, $only_basic_details = false) { $regex = Params::getRegex(); RL_RegEx::matchAll($regex, $string, $matches); if (empty($matches)) { return []; } self::$sets = []; $set_ids = []; foreach ($matches as $match) { if (substr($match['tag'], 0, 1) == '/') { if (empty($set_ids)) { continue; } $set_id = key($set_ids); array_pop($set_ids); if (empty($set_id)) { continue; } self::$sets[$set_id][0]->ending = $match[0]; continue; } end($set_ids); $item = self::getSetItem($match, $set_ids, $only_basic_details); if ($only_basic_details) { if ( ! isset(self::$sets['basic'])) { self::$sets['basic'] = []; } self::$sets['basic'][] = $item; continue; } if ( ! isset(self::$sets[$item->set])) { self::$sets[$item->set] = []; } self::$sets[$item->set][] = $item; } return self::$sets; } private static function getSetItem($match, &$set_ids, $only_basic_details = false) { $item = (object) []; // Set the values from the tag $tag = RL_Title::clean($match['data'], false, false); self::setTagAttributes($item, $tag); if ($only_basic_details) { return $item; } $item->orig = $match[0]; $item->set_id = trim(str_replace('-', '_', $match['set_id'])); // New set if (empty($set_ids) || current($set_ids) != $item->set_id) { self::$setcount++; $set_ids[self::$setcount . '.' . $item->set_id] = $item->set_id; } $item->set = array_search($item->set_id, array_reverse($set_ids)); $item->level = self::getSetLevel($item->set, $set_ids); list($item->pre, $item->post) = RL_Html::cleanSurroundingTags( [$match['pre'], $match['post']], ['div', 'p', 'span', 'h[0-6]'] ); return $item; } private static function getSetLevel($set_id, $set_ids) { // Sets are still empty, so this is the first set if (empty(self::$sets)) { return 1; } // Grab the level from the previous entry of this set if (isset(self::$sets[$set_id])) { return self::$sets[$set_id][0]->level; } // Look up the level of the previous set $previous_set_id = array_search(prev($set_ids), array_reverse($set_ids)); // Grab the level from the previous entry of this set if (isset(self::$sets[$previous_set_id])) { return self::$sets[$previous_set_id][0]->level + 1; } return 1; } private static function getParent($set_id, $level) { if (empty(self::$sets)) { return false; } if (isset(self::$sets[$set_id])) { return self::$sets[$set_id][0]->parent; } reset(self::$sets); $previous_set = current(self::$sets); $prev_level = $prev_level = $previous_set[0]->level; while ($prev_level >= $level) { $previous_set = prev(self::$sets); if (empty($previous_set)) { end(self::$sets); return false; } $prev_level = $previous_set[0]->level; } end(self::$sets); end($previous_set); $parent_item = key($previous_set); return [$previous_set[$parent_item]->set, $parent_item]; } private static function addChildToParent($item) { if (empty($item->parent)) { return; } list($parent_set, $parent_item) = $item->parent; if (empty(self::$sets[$parent_set]) || empty(self::$sets[$parent_set][$parent_item])) { return; } self::$sets[$parent_set][$parent_item]->children[] = $item->set; } private static function initSets(&$sets) { $params = Params::get(); $urlitem = JFactory::getApplication()->input->get('tab'); $itemcount = 0; foreach ($sets as $set_id => $items) { $opened_by_default = 0; foreach ($items as $i => $item) { $item->title = isset($item->title) ? trim($item->title) : 'Tab'; $item->title_full = $item->title; if (isset($item->{'title-opened'}) || isset($item->{'title-closed'})) { $title_closed = isset($item->{'title-closed'}) ? $item->{'title-closed'} : $item->title; $title_opened = isset($item->{'title-opened'}) ? $item->{'title-opened'} : $item->title; // Set main title to the title-opened, otherwise to title-closed $item->title = $title_opened ?: ($title_closed ?: $item->title); // place the title-opened and title-closed in css controlled spans $item->title_full = '<span class="rl_tabs-title-inactive nn_tabs-title-inactive">' . $title_closed . '</span>' . '<span class="rl_tabs-title-active nn_tabs-title-active">' . $title_opened . '</span>'; } $item->haslink = RL_RegEx::match('<a [^>]*>.*?</a>', $item->title); $item->title = RL_Title::clean($item->title, true); $item->title = $item->title ?: RL_HtmlTag::getAttributeValue('title', $item->title_full); $item->title = $item->title ?: RL_HtmlTag::getAttributeValue('alt', $item->title_full); $item->alias = RL_Alias::get(isset($item->alias) ? $item->alias : $item->title); $item->alias = $item->alias ?: 'tab'; $item->id = self::createId($item->alias); $item->set = (int) $set_id; $item->count = $i + 1; $set_keys = [ 'class', 'open', 'output_title_tag', 'title_tag', 'onclick', ]; foreach ($set_keys as $key) { $item->{$key} = isset($item->{$key}) ? $item->{$key} : (isset($params->{$key}) ? $params->{$key} : ''); } $item->matches = RL_Title::getUrlMatches([$item->id, $item->title]); $item->matches[] = ++$itemcount . ''; $item->matches[] = $item->set . '.' . ($i + 1); $item->matches[] = $item->set . '-' . ($i + 1); $item->matches = array_unique($item->matches); $item->matches = array_diff($item->matches, self::$matches); self::$matches = array_merge(self::$matches, $item->matches); if (self::itemIsOpen($item, $urlitem, $i == 0)) { $opened_by_default = $i; } // Will be set after all items are checked based on the $opened_by_default id $item->open = false; $sets[$set_id][$i] = $item; self::$allitems[] = $item; } self::setOpenItem($sets[$set_id], $opened_by_default); } } private static function itemIsOpen($item, $urlitem, $is_first = false) { if ($item->haslink) { return false; } if ( ! empty($item->close)) { return false; } if (isset($item->open)) { return $item->open; } if ($urlitem && in_array($urlitem, $item->matches)) { return true; } if ($is_first) { return true; } return false; } private static function setOpenItem(&$items, $opened_by_default = 0) { $opened_by_default = (int) $opened_by_default; while (isset($items[$opened_by_default]) && $items[$opened_by_default]->haslink) { $opened_by_default++; } if ( ! isset($items[$opened_by_default])) { return; } $items[$opened_by_default]->open = true; } private static function setTagAttributes(&$item, $string) { $values = self::getTagAttributes($string); $item = (object) array_merge((array) $item, (array) $values); } private static function getTagAttributes($string) { RL_PluginTag::protectSpecialChars($string); $is_old_syntax = (strpos($string, '|') !== false); if ($is_old_syntax) { // Fix some different old syntaxes $string = str_replace( [ '|alias:', '|align_', ], [ '|alias=', '|align=', ], $string ); } RL_PluginTag::unprotectSpecialChars($string, true); $known_boolean_keys = [ 'open', 'active', 'opened', 'default', 'scroll', 'noscroll', 'nooutline', 'outline_handles', 'outline_content', 'color_inactive_handles', ]; // Get the values from the tag $attributes = RL_PluginTag::getAttributesFromString($string, 'title', $known_boolean_keys); $key_aliases = [ 'title' => ['name'], 'title-opened' => ['title-open', 'title-active'], 'title-closed' => ['title-close', 'title-inactive'], 'open' => ['active', 'opened', 'default'], 'access' => ['accesslevels', 'accesslevel'], 'usergroup' => ['usergroups', 'group', 'groups'], 'position' => ['positioning'], 'align' => ['alignment'], 'heading_attributes' => ['li_attributes'], 'link_attributes' => ['a_attributes'], 'body_attributes' => ['content_attributes'], ]; RL_PluginTag::replaceKeyAliases($attributes, $key_aliases); if ($is_old_syntax) { self::setPositionFromOldClasses($attributes); } return $attributes; } private static function setPositionFromOldClasses(&$values) { if (empty($values->class) || ! empty($values->position)) { return; } $classes = explode(' ', $values->class); $positions = ['top', 'bottom', 'left', 'right']; $found = array_intersect($classes, $positions); if (empty($found)) { return; } $position = array_shift($found); $classes = array_diff($classes, [$position]); $values->class = implode(' ', $classes); $values->position = $position; } private static function replaceSyntax(&$string, $sets) { $regex = Params::getRegex('end'); if ( ! RL_RegEx::match($regex, $string)) { return; } foreach ($sets as $items) { self::replaceSyntaxItemList($string, $items); } } private static function replaceSyntaxItemList(&$string, $items) { $first = key($items); end($items); foreach ($items as $i => &$item) { self::replaceSyntaxItem($string, $item, $items, ($i == $first)); } } private static function replaceSyntaxItem(&$string, $item, $items, $first = 0) { if (strpos($string, $item->orig) === false) { return; } $params = Params::get(); $html = []; $html[] = $item->post; $html[] = $item->pre; if ($first && $params->place_comments) { $html[] = Protect::getCommentStartTag(); } if ( ! in_array(self::$context, ['com_search.search', 'com_search.search.article', 'com_finder.indexer'])) { $html[] = self::getPreHtml($item, $items, $first); } $class = self::getItemClass($item, 'tab-pane rl_tabs-pane nn_tabs-pane'); $body_attributes = 'role="tabpanel"' . ' aria-labelledby="tab-' . $item->id . '"' . ' aria-hidden="' . ($item->open ? 'false' : 'true') . '"'; if ( ! empty($item->body_attributes)) { $body_attributes .= ' ' . $item->body_attributes; } $html[] = '<div class="' . trim($class) . '" id="' . $item->id . '" ' . $body_attributes . '>'; if ( ! $item->haslink) { if ($item->output_title_tag) { $html[] = '<' . $item->title_tag . ' class="rl_tabs-title nn_tabs-title">'; } $class = 'anchor'; $html[] = '<a id="anchor-' . $item->id . '" class="' . $class . '"></a>'; if ($item->output_title_tag) { $html[] = $item->title . '</' . $item->title_tag . '>'; } } $html = implode("\n", $html); $string = RL_String::replaceOnce($item->orig, $html, $string); } private static function getPreHtml($item, $items, $first = 0) { if ( ! $first) { return '</div>'; } $params = Params::get(); $class = self::getMainClasses($item); $html[] = '<div class="' . trim($class) . '" role="presentation">'; $html[] = self::getNav($items); $html[] = '<div class="tab-content">'; return implode("\n", $html); } private static function getMainClasses($item) { $params = Params::get(); $classes = [ 'rl_tabs nn_tabs', $params->mainclass, ]; if ( ! empty($item->mainclass)) { $classes[] = $item->mainclass; } if ( ! empty($item->nooutline)) { $item->outline_handles = false; $item->outline_content = false; } if ( ! empty($item->outline_handles) || ! empty($item->outline_content)) { $item->nooutline = false; } $settings = [ 'nooutline', 'outline_handles', 'outline_content', 'color_inactive_handles', ]; self::addClassesBySettings($item, $classes, $settings); $align = isset($item->align) ? 'align_' . $item->align : Params::getAlignment(); $position = 'top'; $classes[] = $position; $classes[] = $align; $classes = array_diff($classes, ['']); return trim(implode(' ', $classes)); } private static function getItemClass($item, $mainclass = 'rl_tabs-tab nn_tabs-tab nav-item') { // nav-item used for Boootstrap 4 $class = [$mainclass]; if ($item->open) { $class[] = 'active'; } if ( ! empty($item->mode)) { $class[] = $item->mode == 'hover' ? 'hover' : 'click'; } $class[] = trim($item->class); return trim(implode(' ', $class)); } private static function addClassesBySettings($item, &$classes, $settings = []) { foreach ($settings as $setting) { self::addClassBySetting($item, $classes, $setting); } } private static function addClassBySetting($item, &$classes, $setting = '') { if ( (empty($item->{$setting}) && empty(Params::get()->{$setting})) || (isset($item->{$setting}) && ! $item->{$setting}) ) { return; } $classes[] = $setting; } private static function replaceClosingTag(&$string) { $params = Params::get(); $regex = Params::getRegex('end'); RL_RegEx::matchAll($regex, $string, $matches); if (empty($matches)) { return; } foreach ($matches as $match) { $html = '</div></div></div>'; if ($params->place_comments) { $html .= Protect::getCommentEndTag(); } list($pre, $post) = RL_Html::cleanSurroundingTags([$match['pre'], $match['post']]); $html = $pre . $html . $post; $string = RL_String::replaceOnce($match[0], $html, $string); } } private static function replaceLinks(&$string) { // Links with #tab-name self::replaceAnchorLinks($string); // Links with &tab=tab-name self::replaceUrlLinks($string); } private static function replaceAnchorLinks(&$string) { RL_RegEx::matchAll( '(?<link><a\s[^>]*href="(?<url>([^"]*)?)\#(?<id>[^"]*)"[^>]*>)(?<text>.*?)</a>', $string, $matches ); if (empty($matches)) { return; } self::replaceLinksMatches($string, $matches); } private static function replaceUrlLinks(&$string) { RL_RegEx::matchAll( '(?<link><a\s[^>]*href="(?<url>[^"]*)(?:\?|&(?:amp;)?)tab=(?<id>[^"\#&]*)(?:\#[^"]*)?"[^>]*>)(?<text>.*?)</a>', $string, $matches ); if (empty($matches)) { return; } self::replaceLinksMatches($string, $matches); } private static function replaceLinksMatches(&$string, $matches) { $uri = JUri::getInstance(); $current_urls = []; $current_urls[] = $uri->toString(['path']); $current_urls[] = $uri->toString(['scheme', 'host', 'path']); $current_urls[] = $uri->toString(['scheme', 'host', 'port', 'path']); foreach ($matches as $match) { $link = $match['link']; if ( strpos($link, 'data-toggle=') !== false || strpos($link, 'onclick=') !== false || strpos($link, 'rl_tabs-toggle-sm') !== false || strpos($link, 'rl_tabs-link') !== false || strpos($link, 'rl_sliders-link') !== false ) { continue; } $url = $match['url']; if (strpos($url, 'index.php/') === 0) { $url = '/' . $url; } if (strpos($url, 'index.php') === 0) { $url = JRoute::_($url); } if ($url != '' && ! in_array($url, $current_urls)) { continue; } $id = $match['id']; if ( ! self::stringHasItem($string, $id)) { // This is a link to a normal anchor or other element on the page // Remove the prepending obsolete url and leave the hash // $string = str_replace('href="' . $match['url'] . '#' . $id . '"', 'href="#' . $id . '"', $string); continue; } $attributes = self::getLinkAttributes($id); // Combine attributes with original $attributes = RL_HtmlTag::combineAttributes($link, $attributes); $html = '<a ' . $attributes . '><span class="rl_tabs-link-inner nn_tabs-link-inner">' . $match['text'] . '</span></a>'; $string = str_replace($match[0], $html, $string); } } private static function replaceLinkTag(&$string) { $regex = Params::getRegex('link'); RL_RegEx::matchAll($regex, $string, $matches); if (empty($matches)) { return; } foreach ($matches as $match) { self::replaceLinkTagMatch($string, $match); } } private static function replaceLinkTagMatch(&$string, $match) { $params = Params::get(); $id = RL_Alias::get($match['id']); if ( ! self::stringHasItem($string, $id)) { $id_by_name = self::findItemByMatch($match['id']); $id_by_id = self::findItemByMatch($id); $id = $id_by_name ?: ($id_by_id ?: $id); } if ( ! self::stringHasItem($string, $id)) { $html = '<a href="' . RL_Uri::get($id) . '">' . $match['text'] . '</a>'; if ($params->place_comments) { $html = Protect::wrapInCommentTags($html); } $string = RL_String::replaceOnce($match[0], $html, $string); return; } $html = '<a ' . self::getLinkAttributes($id) . '>' . '<span class="rl_tabs-link-inner nn_tabs-link-inner">' . $match['text'] . '</span>' . '</a>'; if ($params->place_comments) { $html = Protect::wrapInCommentTags($html); } $string = RL_String::replaceOnce($match[0], $html, $string); } private static function findItemByMatch($id) { foreach (self::$allitems as $item) { if ( ! in_array($id, $item->matches)) { continue; } return $item->id; } return false; } private static function getLinkAttributes($id) { return 'href="' . RL_Uri::get($id) . '"' . ' class="rl_tabs-link rl_tabs-link-' . $id . ' nn_tabs-link nn_tabs-link-' . $id . '"' . ' data-id="' . $id . '"'; } private static function stringHasItem(&$string, $id) { return (strpos($string, 'data-toggle="tab" data-id="' . $id . '"') !== false); } private static function getNav(&$items) { $html = []; $ul_extra = ''; // Nav for non-mobile view $html[] = '<!--googleoff: index-->'; $html[] = '<a id="rl_tabs-scrollto_' . $items[0]->set . '" class="anchor rl_tabs-scroll nn_tabs-scroll"></a>'; $html[] = '<ul class="nav nav-tabs" id="set-rl_tabs-' . $items[0]->set . '" role="tablist"' . $ul_extra . '>'; foreach ($items as $item) { $href = '#' . $item->id; $title = $item->title_full; $link_attributes = ' id="tab-' . $item->id . '"' . ' data-toggle="tab" data-id="' . $item->id . '"' . ' role="tab" aria-controls="' . $item->id . '"' . ' aria-selected="' . ($item->open ? 'true' : 'false') . '"'; $class = 'rl_tabs-toggle nn_tabs-toggle'; // nav-link used for Boootstrap 4 $class .= ' nav-link'; $onclick = ''; $heading_attributes = ''; if ( ! empty($item->heading_attributes)) { $heading_attributes .= ' ' . $item->heading_attributes; } if ($item->haslink) { if (RL_RegEx::match('<a [^>]*href="(.*?)"', $title, $match)) { $href = $match[1]; } // nav-link used for Boootstrap 4 $class = 'rl_tabs-link nav-link'; if (RL_RegEx::match('<a [^>]*class="(.*?)"', $title, $match)) { $class = trim($class . ' ' . $match[1]); } $link_attributes = ''; if (RL_RegEx::match('<a ([^>]*)', $title, $match)) { $link_attributes = $match[1]; $link_attributes = trim(RL_RegEx::replace('(href|class)=".*?"', '', $link_attributes)); } if ( ! empty($item->link_attributes)) { $link_attributes .= ' ' . $item->link_attributes; } $title = RL_RegEx::replace('<a .*?>(.*?)</a>', '\1', $title); } $html[] = '<li class="' . self::getItemClass($item) . '" ' . $heading_attributes . '>' . '<a href="' . $href . '" title="' . htmlspecialchars($item->title) . '" class="' . $class . '"' . $onclick . $link_attributes . '>' . '<span class="rl_tabs-toggle-inner nn_tabs-toggle-inner">' . $title . '</span>' . '</a>' . '</li>'; } $html[] = '</ul>'; $html[] = '<!--googleon: index-->'; return implode("\n", $html); } private static function createId($alias) { $id = $alias; $i = 1; while (in_array($id, self::$ids)) { $id = $alias . '-' . ++$i; } self::$ids[] = $id; return $id; } } PK <t!]�ϖ�% % Document.phpnu &1i� <?php /** * @package Tabs * @version 8.0.1 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\System\Tabs; defined('_JEXEC') or die; use Joomla\CMS\Factory as JFactory; use Joomla\CMS\HTML\HTMLHelper as JHtml; use RegularLabs\Library\Document as RL_Document; class Document { public static function addHeadStuff() { // do not load scripts/styles on feeds or print pages if (RL_Document::isFeed() || JFactory::getApplication()->input->getInt('print', 0)) { return; } $params = Params::get(); if ( ! $params->load_bootstrap_framework && $params->load_jquery) { JHtml::_('jquery.framework'); } if ($params->load_bootstrap_framework) { JHtml::_('bootstrap.framework'); } $options = [ 'use_hash' => (int) $params->use_hash, 'reload_iframes' => (int) $params->reload_iframes, 'init_timeout' => (int) $params->init_timeout, 'urlscroll' => 0, ]; RL_Document::scriptOptions($options, 'Tabs'); RL_Document::script('tabs/script.min.js', ($params->media_versioning ? '8.0.1' : ''), [], [], $params->load_jquery); if ($params->load_stylesheet) { RL_Document::stylesheet('tabs/style.min.css', ($params->media_versioning ? '8.0.1' : '')); } } public static function removeHeadStuff(&$html) { // Don't remove if tabs class is found if (strpos($html, 'class="rl_tabs-tab') !== false) { return; } // remove style and script if no items are found RL_Document::removeScriptsStyles($html, 'Tabs'); RL_Document::removeScriptsOptions($html, 'Tabs'); } } PK <t!]Ae�Q� � Plugin.phpnu &1i� <?php /** * @package Tabs * @version 7.6.0 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2020 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ /* * This class is used as template (extend) for most Regular Labs plugins * This class is not placed in the Regular Labs Library as a re-usable class because * it also needs to be working when the Regular Labs Library is not installed */ namespace RegularLabs\Plugin\System\Tabs; defined('_JEXEC') or die; if (is_file(JPATH_LIBRARIES . '/regularlabs/autoload.php')) { require_once JPATH_LIBRARIES . '/regularlabs/autoload.php'; } use Joomla\CMS\Factory as JFactory; use Joomla\CMS\Installer\Installer as JInstaller; use Joomla\CMS\Language\Text as JText; use Joomla\CMS\Plugin\CMSPlugin as JPlugin; use Joomla\CMS\Plugin\PluginHelper as JPluginHelper; use ReflectionMethod; use RegularLabs\Library\Document as RL_Document; use RegularLabs\Library\Language as RL_Language; use RegularLabs\Library\Protect as RL_Protect; class Plugin extends JPlugin { public $_alias = ''; public $_title = ''; public $_lang_prefix = ''; public $_has_tags = false; public $_enable_in_frontend = true; public $_enable_in_admin = false; public $_can_disable_by_url = true; public $_disable_on_components = false; public $_protected_formats = []; public $_page_types = []; private $_init = false; private $_pass = null; private $_helper = null; protected function run() { if ( ! $this->passChecks()) { return false; } if ( ! $this->getHelper()) { return false; } $caller = debug_backtrace()[1]; if (empty($caller)) { return false; } $event = $caller['function']; if ( ! method_exists($this->_helper, $event)) { return false; } $reflect = new ReflectionMethod($this->_helper, $event); $parameters = $reflect->getParameters(); $arguments = []; // Check if arguments should be passed as reference or not foreach ($parameters as $count => $parameter) { if ($parameter->isPassedByReference()) { $arguments[] = &$caller['args'][$count]; continue; } $arguments[] = $caller['args'][$count]; } // Work-around for K2 stuff :( if ($event == 'onContentPrepare' && empty($arguments[1]->id) && strpos($arguments[0], 'com_k2') === 0 ) { return false; } return call_user_func_array([$this->_helper, $event], $arguments); } /** * Create the helper object * * @return object|null The plugins helper object */ private function getHelper() { // Already initialized, so return if ($this->_init) { return $this->_helper; } $this->_init = true; RL_Language::load('plg_' . $this->_type . '_' . $this->_name); $this->init(); $this->_helper = new Helper; return $this->_helper; } private function passChecks() { if ( ! is_null($this->_pass)) { return $this->_pass; } $this->_pass = false; if ( ! $this->isFrameworkEnabled()) { return false; } if ( ! self::passPageTypes()) { return false; } // allow in frontend? if ( ! $this->_enable_in_frontend && ! RL_Document::isAdmin()) { return false; } // allow in admin? if ( ! $this->_enable_in_admin && RL_Document::isAdmin() && ( ! isset(Params::get()->enable_admin) || ! Params::get()->enable_admin)) { return false; } // disabled by url? if ($this->_can_disable_by_url && RL_Protect::isDisabledByUrl($this->_alias)) { return false; } // disabled by component? if ($this->_disable_on_components && RL_Protect::isRestrictedComponent(isset(Params::get()->disabled_components) ? Params::get()->disabled_components : [], 'component')) { return false; } // restricted page? if (RL_Protect::isRestrictedPage($this->_has_tags, $this->_protected_formats)) { return false; } if ( ! $this->extraChecks()) { return false; } $this->_pass = true; return true; } public function passPageTypes() { if (empty($this->_page_types)) { return true; } if (in_array('*', $this->_page_types)) { return true; } if (empty(JFactory::$document)) { return true; } if (RL_Document::isFeed()) { return in_array('feed', $this->_page_types); } if (RL_Document::isPDF()) { return in_array('pdf', $this->_page_types); } $page_type = JFactory::getDocument()->getType(); if (in_array($page_type, $this->_page_types)) { return true; } return false; } public function extraChecks() { $input = JFactory::getApplication()->input; // Disable on Gridbox edit form: option=com_gridbox&view=gridbox if ($input->get('option') == 'com_gridbox' && $input->get('view') == 'gridbox') { return false; } // Disable on SP PageBuilder edit form: option=com_sppagebuilder&view=form if ($input->get('option') == 'com_sppagebuilder' && $input->get('view') == 'form') { return false; } return true; } public function init() { return; } /** * Check if the Regular Labs Library is enabled * * @return bool */ private function isFrameworkEnabled() { if ( ! defined('REGULAR_LABS_LIBRARY_ENABLED')) { $this->setIsFrameworkEnabled(); } if ( ! REGULAR_LABS_LIBRARY_ENABLED) { $this->throwError('REGULAR_LABS_LIBRARY_NOT_ENABLED'); } return REGULAR_LABS_LIBRARY_ENABLED; } /** * Set the define with whether the Regular Labs Library is enabled */ private function setIsFrameworkEnabled() { // Return false if Regular Labs Library is not installed if ( ! $this->isFrameworkInstalled()) { define('REGULAR_LABS_LIBRARY_ENABLED', false); return; } if ( ! JPluginHelper::isEnabled('system', 'regularlabs')) { $this->throwError('REGULAR_LABS_LIBRARY_NOT_ENABLED'); define('REGULAR_LABS_LIBRARY_ENABLED', false); return; } define('REGULAR_LABS_LIBRARY_ENABLED', true); } /** * Check if the Regular Labs Library is installed * * @return bool */ private function isFrameworkInstalled() { if ( ! defined('REGULAR_LABS_LIBRARY_INSTALLED')) { $this->setIsFrameworkInstalled(); } switch (REGULAR_LABS_LIBRARY_INSTALLED) { case 'outdated': $this->throwError('REGULAR_LABS_LIBRARY_OUTDATED'); return false; case 'no': $this->throwError('REGULAR_LABS_LIBRARY_NOT_INSTALLED'); return false; case 'yes': default: return true; } } /** * set the define with whether the Regular Labs Library is installed */ private function setIsFrameworkInstalled() { if ( ! is_file(JPATH_PLUGINS . '/system/regularlabs/regularlabs.xml') || ! is_file(JPATH_LIBRARIES . '/regularlabs/autoload.php') ) { define('REGULAR_LABS_LIBRARY_INSTALLED', 'no'); return; } $plugin = JInstaller::parseXMLInstallFile(JPATH_PLUGINS . '/system/regularlabs/regularlabs.xml'); $library = JInstaller::parseXMLInstallFile(JPATH_LIBRARIES . '/regularlabs/regularlabs.xml'); if (empty($plugin) || empty($library)) { define('REGULAR_LABS_LIBRARY_INSTALLED', 'no'); return; } if (version_compare($plugin['version'], '20.6.16076', '<') || version_compare($library['version'], '20.6.16076', '<')) { define('REGULAR_LABS_LIBRARY_INSTALLED', 'outdated'); return; } define('REGULAR_LABS_LIBRARY_INSTALLED', 'yes'); } /** * Place an error in the message queue */ private function throwError($error) { // Return if page is not an admin page or the admin login page if ( ! JFactory::getApplication()->isClient('administrator') || JFactory::getUser()->get('guest') ) { return; } // load the admin language file JFactory::getLanguage()->load('plg_' . $this->_type . '_' . $this->_name, JPATH_PLUGINS . '/' . $this->_type . '/' . $this->_name); $text = JText::sprintf($this->_lang_prefix . '_' . $error, JText::_($this->_title)); $text = JText::_($text) . ' ' . JText::sprintf($this->_lang_prefix . '_EXTENSION_CAN_NOT_FUNCTION', JText::_($this->_title)); // Check if message is not already in queue $messagequeue = JFactory::getApplication()->getMessageQueue(); foreach ($messagequeue as $message) { if ($message['message'] == $text) { return; } } JFactory::getApplication()->enqueueMessage($text, 'error'); } } PK <t!]dr� � � Params.phpnu &1i� <?php /** * @package Regular Labs Library * @version 21.4.10972 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\System\RegularLabs; defined('_JEXEC') or die; use RegularLabs\Library\Parameters as RL_Parameters; class Params { protected static $params = null; public static function get() { if ( ! is_null(self::$params)) { return self::$params; } self::$params = RL_Parameters::getInstance()->getPluginParams('regularlabs'); return self::$params; } } PK At!]V�� � Helper/UUID4.phpnu &1i� <?php /* * @package akeebabackup * @copyright Copyright (c)2006-2020 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Joomla\Plugin\Console\AkeebaBackup\Helper; defined('_JEXEC') || die; class UUID4 { protected $isUpperCase; public function __construct($isUpperCase = false) { $this->isUpperCase = !!$isUpperCase; } public function get($sep = '-') { $result = ''; // time_low unsigned 32 bit integer $result .= $this->random(32); // "-" $result .= $sep; // time_mid unsigned 16 bit integer $result .= $this->random(16); // "-" $result .= $sep; // time_hi_and_version unsigned 16 bit integer // version (0100) $result .= $this->hexString(1 << 2, 4); // time-hi $result .= $this->random(12); // "-" $result .= $sep; // clock_seq_hi_and_reserved unsigned 8 bit integer // 10xxxxxx (x is random) $result .= $this->hexString(1 << 7 | random_int(0, 2 ** 6 - 1), 8); // clock_seq_low unsigned 8 bit integer $result .= $this->random(8); // "-" $result .= $sep; // node unsigned 48 bit integer $result .= $this->random(48); return $result; } protected function random($bitNum) { $result = ''; $bits = 16; $sum = 0; while ($bitNum != $sum && $bits > 0) { $bits = (($bitNum - $sum) > 16) ? 16 : $bitNum - $sum; $sum += $bits; $val = random_int(0, 2 ** $bits - 1); $result = $this->hexString($val, $bits) . $result; } return $result; } protected function hexString($val, $bits) { $digits = (int) ($bits / 4 + 0.9); return sprintf('%0' . $digits . ($this->isUpperCase ? 'X' : 'x'), $val); } } PK At!]�u u Extension/AkeebaBackup.phpnu &1i� <?php /* * @package akeebabackup * @copyright Copyright (c)2006-2020 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Joomla\Plugin\Console\AkeebaBackup\Extension; defined('_JEXEC') || die; use Akeeba\Backup\Admin\Helper\SecretWord; use Akeeba\Backup\Admin\Model\ControlPanel; use Akeeba\Engine\Factory; use Akeeba\Engine\Platform; use FOF30\Container\Container; use Joomla\Application\ApplicationEvents; use Joomla\Application\Event\ApplicationEvent; use Joomla\CMS\Application\ConsoleApplication; use Joomla\CMS\Factory as JFactory; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\Console\Command\AbstractCommand; use Joomla\Database\DatabaseDriver; use Joomla\Event\SubscriberInterface; use RuntimeException; use Throwable; class AkeebaBackup extends CMSPlugin implements SubscriberInterface { /** * Load the language file on instantiation. * * @var boolean * @since 7.5.0 */ protected $autoloadLanguage = true; /** * Application object. * * @var ConsoleApplication * @since 7.5.0 */ protected $app; /** * Returns an array of events this subscriber will listen to. * * @return array * * @since 7.5.0 */ public static function getSubscribedEvents(): array { return [ ApplicationEvents::BEFORE_EXECUTE => 'registerCLICommands', ]; } /** * Registers command classes to the CLI application. * * This is an event handled for the ApplicationEvents::BEFORE_EXECUTE event. * * @param ApplicationEvent $event The before_execite application event being handled * * @since 7.5.0 */ public function registerCLICommands(ApplicationEvent $event) { // Only register CLI commands if we can boot up the Akeeba Backup component enough to make it usable. try { //$this->initialiseComponent(); } catch (Throwable $e) { return; } $this->initialiseComponent(); /** @var ConsoleApplication $app */ $app = $event->getApplication(); // Try to find all commands in the CliCommands directory of the component $baseNamespace = '\Akeeba\Backup\Admin\CliCommands\\'; $files = Folder::files(JPATH_ADMINISTRATOR . '/components/com_akeeba/CliCommands', '.php'); $files = is_array($files) ? $files : []; foreach ($files as $file) { // Construct a fully qualified class name $className = $baseNamespace . basename($file, '.php'); /** * Make sure the class exists. Works around hosts renaming/duplicating files with silly extensions like * .1.php or .disabled.php. We've been seeing that nonsense since as early as 2013. */ if (!class_exists($className)) { continue; } // If I can construct the command object add it to the application. Otherwise move to the next file. try { $o = new $className; if (!($o instanceof AbstractCommand)) { continue; } $app->addCommand($o); } catch (Throwable $e) { continue; } } } private function initialiseComponent(): void { if (!defined('FOF30_INCLUDED') && !@include_once(JPATH_LIBRARIES . '/fof30/include.php')) { throw new RuntimeException('FOF 3.0 is not installed', 500); } if (!defined('AKEEBA_CACERT_PEM')) { define('AKEEBA_CACERT_PEM', JPATH_LIBRARIES . '/src/Http/Transport/cacert.pem'); } $container = Container::getInstance('com_akeeba', [], 'admin'); // Load the FOF language $lang = $container->platform->getLanguage(); $lang->load('lib_fof30', JPATH_ADMINISTRATOR, 'en-GB', true, true); $lang->load('lib_fof30', JPATH_ADMINISTRATOR, null, true, false); // Load the Akeeba Backup language files $lang->load('com_akeeba', JPATH_SITE, 'en-GB', true, true); $lang->load('com_akeeba', JPATH_SITE, null, true, false); $lang->load('com_akeeba', JPATH_ADMINISTRATOR, 'en-GB', true, true); $lang->load('com_akeeba', JPATH_ADMINISTRATOR, null, true, false); // Necessary for routing the Alice view $container->inflector->addWord('Alice', 'Alices'); // Load Akeeba Engine $this->loadAkeebaEngine(); // Load the Akeeba Engine configuration $retryLoadingEngineConfiguration = false; try { $this->loadAkeebaEngineConfiguration(); } catch (\Exception $e) { // Maybe the tables are not installed? /** @var ControlPanel $cPanelModel */ $cPanelModel = $container->factory->model('ControlPanel')->tmpInstance(); $cPanelModel->checkAndFixDatabase(); $retryLoadingEngineConfiguration = true; } if ($retryLoadingEngineConfiguration) { $this->loadAkeebaEngineConfiguration(); } // Prevents the "SQLSTATE[HY000]: General error: 2014" due to resource sharing with Akeeba Engine // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // !!!!! WARNING: ALWAYS GO THROUGH JFactory; DO NOT GO THROUGH $this->container->db !!!!! // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (version_compare(PHP_VERSION, '7.999.999', 'le')) { /** @var DatabaseDriver $jDbo */ $jDbo = JFactory::getContainer()->get('DatabaseDriver'); if ($jDbo->getName() == 'pdomysql') { @$jDbo->disconnect(); } } // Make sure the front-end backup Secret Word is stored encrypted $params = $container->params; SecretWord::enforceEncryption($params, 'frontend_secret_word'); // Make sure we have a version loaded @include_once($container->backEndPath . '/version.php'); if (!defined('AKEEBA_VERSION')) { define('AKEEBA_VERSION', 'dev'); define('AKEEBA_DATE', date('Y-m-d')); } } public function loadAkeebaEngine(): void { $container = Container::getInstance('com_akeeba', [], 'admin'); // Necessary defines for Akeeba Engine if (!defined('AKEEBAENGINE')) { define('AKEEBAENGINE', 1); define('AKEEBAROOT', $container->backEndPath . '/BackupEngine'); } if (!defined('AKEEBA_BACKUP_ORIGIN')) { define('AKEEBA_BACKUP_ORIGIN', 'cli'); } // Make sure we have a profile set throughout the component's lifetime $profile_id = $container->platform->getSessionVar('profile', null, 'akeeba'); if (is_null($profile_id)) { $container->platform->setSessionVar('profile', 1, 'akeeba'); } // Load Akeeba Engine $basePath = $container->backEndPath; require_once $basePath . '/BackupEngine/Factory.php'; } public function loadAkeebaEngineConfiguration(): void { $container = Container::getInstance('com_akeeba', [], 'admin'); Platform::addPlatform('joomla3x', $container->backEndPath . '/BackupPlatform/Joomla3x'); $akeebaEngineConfig = Factory::getConfiguration(); Platform::getInstance()->load_configuration(); unset($akeebaEngineConfig); } } PK �|!]X9�� � Extension/Jce.phpnu &1i� <?php /** * @package JCE * @subpackage Installer.Jce * * @copyright Copyright (C) 2005 - 2023 Open Source Matters, Inc. All rights reserved * @copyright Copyright (C) 2023 - 2024 Ryan Demmer. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Plugin\Installer\Jce\Extension; \defined('_JEXEC') or die; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\Database\DatabaseAwareTrait; use Joomla\Plugin\Installer\Jce\PluginTraits\EventsTrait; class Jce extends CMSPlugin { use EventsTrait; use DatabaseAwareTrait; /** * Affects constructor behavior. If true, language files will be loaded automatically. * * @var boolean */ protected $autoloadLanguage = true; private function getDownloadKeyFromUpdateSites() { $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('package_id') ->from('#__extensions') ->where('element = ' . $db->quote('com_jce')); $db->setQuery($query); $packageId = $db->loadResult(); if (is_null($packageId)) { return null; } $query = $db->getQuery(true) ->select($db->quoteName('update_sites.extra_query')) ->from($db->quoteName('#__update_sites', 'update_sites')) ->join( 'INNER', $db->quoteName('#__update_sites_extensions', 'update_sites_extensions') . ' ON ' . $db->quoteName('update_sites_extensions.update_site_id') . ' = ' . $db->quoteName('update_sites.update_site_id') ) ->where($db->quoteName('update_sites_extensions.extension_id') . ' = ' . (int) $packageId); $db->setQuery($query); $result = $db->loadResult(); if ($result) { // Parse the `extra_query` to extract the key value parse_str($result, $parsedQuery); if (isset($parsedQuery['key'])) { return $parsedQuery['key']; } } return null; } /** * Get the download key from the update sites table. * * @return string|null The download key or null if not found */ public function getDownloadKey() { // get the key directly from the update sites table, eg: when updating a plugin $key = $this->getDownloadKeyFromUpdateSites(); // Return the key or null if not found return $key; } } PK �|!]z_�m m PluginTraits/EventsTrait.phpnu &1i� <?php /** * @package JCE * @subpackage Installer.Jce * * @copyright Copyright (C) 2005 - 2023 Open Source Matters, Inc. All rights reserved * @copyright Copyright (C) 2023 - 2024 Ryan Demmer. All rights reserved * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Plugin\Installer\Jce\PluginTraits; defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\Http\HttpFactory; use Joomla\CMS\Language\Text; use Joomla\CMS\Uri\Uri; /** * JCE Installer Events Trait * * @since 2.9.73 */ trait EventsTrait { private function checkIfKeyRequired($query) { // get the file name from the url without the xml extension $file = isset($query['file']) ? $query['file'] : ''; if (empty($file)) { return false; } // jce pro requires a key if (strpos($file, 'pkg_jce_pro_') !== false) { return true; } // jce core does not require a key if (strpos($file, 'pkg_jce_') !== false) { return false; } // jce plugins require a key if (strpos($file, 'plg_jce_') !== false) { return true; } // mediabox does not require a key if (strpos($file, 'plg_system_jcemediabox') !== false) { return false; } return false; } /** * Handle adding credentials to package download request. * * @param string $url url from which package is going to be downloaded * @param array $headers headers to be sent along the download request (key => value format) * * @return bool true if credentials have been added to request or not our business, false otherwise (credentials not set by user) * * @since 3.0 */ public function onInstallerBeforePackageDownload(&$url, &$headers) { $app = Factory::getApplication(); $uri = Uri::getInstance($url); $host = $uri->getHost(); if ($host !== 'www.joomlacontenteditor.net') { return true; } // check if the key has already been set via the dlid field. This will only be available in Joomla 4.x and later $key = $uri->getVar('key', ''); // get the key from the component params or Update Sites (in the case of plugin updates) if (empty($key)) { $key = $this->getDownloadKey(); } // if no key is set... if (empty($key)) { $query = $uri->getQuery(true); // if we are attempting to update JCE Pro or JCE Plugins, display a notice message if ($this->checkIfKeyRequired($query) === true) { $app->enqueueMessage(Text::_('PLG_INSTALLER_JCE_KEY_WARNING'), 'notice'); return true; } } // Append the subscription key to the download URL if it exists if (!empty($key)) { $uri->setVar('key', $key); } // create the url string $url = $uri->toString(); // check validity of the key and display a message if it is invalid / expired try { $tmpUri = clone $uri; $tmpUri->setVar('task', 'update.validate'); $tmpUrl = $tmpUri->toString(); $response = HttpFactory::getHttp()->get($tmpUrl, array()); } catch (\RuntimeException $exception) { $app->enqueueMessage($exception->getMessage(), 'notice'); return true; } // invalid key, display a notice message if (403 == $response->code || 401 == $response->code) { $app->enqueueMessage(Text::_('PLG_INSTALLER_JCE_KEY_INVALID'), 'notice'); } // update limit exceeded if (498 === $response->code) { $app->enqueueMessage(Text::_('PLG_INSTALLER_JCE_KEY_LIMIT'), 'notice'); } return true; } }PK ~!]^`�� � Extension/MediaJce.phpnu &1i� <?php /** * @package Jce.Plugin * @subpackage Fields.mediajce * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @copyright (C) 2020 - 2024 Ryan Demmer. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Plugin\Fields\MediaJce\Extension; use Joomla\Component\Fields\Administrator\Plugin\FieldsPlugin; use Joomla\Plugin\Fields\MediaJce\PluginTraits\FormTrait; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Fields Media Plugin * * @since 2.9.73 */ final class MediaJce extends FieldsPlugin { use FormTrait; }PK ~!]� 6 6 PluginTraits/FormTrait.phpnu &1i� <?php /** * @package JCE * @subpackage Fields.MediaJce * * @copyright Copyright (C) 2005 - 2023 Open Source Matters, Inc. All rights reserved. * @copyright Copyright (C) 2020 - 2024 Ryan Demmer. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Plugin\Fields\MediaJce\PluginTraits; defined('_JEXEC') or die; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Form\Form; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Uri\Uri; /** * Fields MediaJce FormTrait * * @since 2.9.73 */ trait FormTrait { private $mediaLoaded = false; /** * Transforms the field into a DOM XML element and appends it as a child on the given parent. * * @param stdClass $field The field. * @param DOMElement $parent The field node parent. * @param Form $form The form. * * @return DOMElement * * @since 3.7.0 */ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form) { $fieldNode = parent::onCustomFieldsPrepareDom($field, $parent, $form); if (!$fieldNode) { return $fieldNode; } if ($field->type !== 'mediajce') { return $fieldNode; } // override "Edit Custom Field Value" permission if set $fieldNode->setAttribute('disabled', 'false'); $fieldParams = clone $this->params; $fieldParams->merge($field->fieldparams); $field->fieldparams = clone $fieldParams; $form->addFieldPath(JPATH_PLUGINS . '/fields/mediajce/fields'); Factory::getApplication()->triggerEvent('onWfCustomFieldsPrepareDom', array($field, $fieldNode, $form)); return $fieldNode; } /** * Before prepares the field value. * * @param string $context The context. * @param \stdclass $item The item. * @param \stdclass $field The field. * * @return void * * @since 3.7.0 */ public function onCustomFieldsBeforePrepareField($context, $item, $field) { // Check if the field should be processed by us if ($field->type !== 'mediajce') { return; } // Check if the field value is an old (string) value if (is_string($field->value)) { $field->value = $this->checkValue($field->value); } $fieldParams = clone $this->params; $fieldParams->merge($field->fieldparams); $field->fieldparams = clone $fieldParams; // if extendedmedia is disabled, use restricted media support if ((int) $fieldParams->get('extendedmedia', 0) == 0 && is_array($field->value)) { $field->value['media_supported'] = array('img', 'a'); } } /** * Before prepares the field value. * * @param string $value The value to check. * * @return array The checked value * * @since 4.0.0 */ private function checkValue($value) { json_decode($value); if (json_last_error() === JSON_ERROR_NONE) { return (array) json_decode($value, true); } return array('media_src' => $value, 'media_text' => ''); } } PK B~!]�ݵ � SearchHelper.phpnu &1i� <?php /** * @package Regular Labs Library * @version 21.4.10972 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\System\RegularLabs; defined('_JEXEC') or die; use Joomla\CMS\Factory as JFactory; use RegularLabs\Library\Document as RL_Document; class SearchHelper { public static function load() { // Only in frontend search component view if ( ! RL_Document::isClient('site') || JFactory::getApplication()->input->get('option') != 'com_search') { return; } $classes = get_declared_classes(); if (in_array('SearchModelSearch', $classes) || in_array('searchmodelsearch', $classes)) { return; } require_once JPATH_LIBRARIES . '/regularlabs/helpers/search.php'; } } PK B~!]R��%� � DownloadKey.phpnu &1i� <?php /** * @package Regular Labs Library * @version 21.4.10972 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\System\RegularLabs; defined('_JEXEC') or die; use Joomla\CMS\Factory as JFactory; use RegularLabs\Library\Document as RL_Document; class DownloadKey { public static function update() { // Save the download key from the Regular Labs Extension Manager config to the update sites if ( RL_Document::isClient('site') || JFactory::getApplication()->input->get('option') != 'com_config' || JFactory::getApplication()->input->get('task') != 'config.save.component.apply' || JFactory::getApplication()->input->get('component') != 'com_regularlabsmanager' ) { return; } $form = JFactory::getApplication()->input->post->get('jform', [], 'array'); if ( ! isset($form['key'])) { return; } $key = $form['key']; $db = JFactory::getDbo(); $query = $db->getQuery(true) ->update('#__update_sites') ->set($db->quoteName('extra_query') . ' = ' . $db->quote('k=' . $key)) ->where($db->quoteName('location') . ' LIKE ' . $db->quote('%download.regularlabs.com%')); $db->setQuery($query); $db->execute(); } } PK B~!]��i� � AdminMenu.phpnu &1i� <?php /** * @package Regular Labs Library * @version 21.4.10972 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\System\RegularLabs; defined('_JEXEC') or die; use Joomla\CMS\Factory as JFactory; use RegularLabs\Library\RegEx as RL_RegEx; class AdminMenu { public static function combine() { $params = Params::get(); if ( ! $params->combine_admin_menu) { return; } $html = JFactory::getApplication()->getBody(); if ($html == '') { return; } if (strpos($html, '<ul id="menu"') === false || (strpos($html, '">Regular Labs ') === false && strpos($html, '" >Regular Labs ') === false) ) { return; } if ( ! RL_RegEx::matchAll( '<li><a class="(?:no-dropdown )?menu-[^>]*>Regular Labs [^<]*</a></li>', $html, $matches, null, PREG_PATTERN_ORDER ) ) { return; } $menu_items = $matches[0]; if (count($menu_items) < 2) { return; } $manager = null; foreach ($menu_items as $i => &$menu_item) { RL_RegEx::match('class="(?:no-dropdown )?menu-(.*?)"', $menu_item, $icon); $icon = str_replace('icon-icon-', 'icon-', 'icon-' . $icon[1]); $menu_item = str_replace( ['>Regular Labs - ', '>Regular Labs '], '><span class="icon-reglab ' . $icon . '"></span> ', $menu_item ); if ($icon != 'icon-regularlabsmanager') { continue; } $manager = $menu_item; unset($menu_items[$i]); } $main_link = ""; if ( ! is_null($manager)) { array_unshift($menu_items, $manager); $main_link = 'href="index.php?option=com_regularlabsmanager"'; } $new_menu_item = '<li class="dropdown-submenu">' . '<a class="dropdown-toggle menu-regularlabs" data-toggle="dropdown" ' . $main_link . '>Regular Labs</a>' . "\n" . '<ul id="menu-cregularlabs" class="dropdown-menu menu-scrollable menu-component">' . "\n" . implode("\n", $menu_items) . "\n" . '</ul>' . '</li>'; $first = array_shift($matches[0]); $html = str_replace($first, $new_menu_item, $html); $html = str_replace($matches[0], '', $html); JFactory::getApplication()->setBody($html); } public static function addHelpItem() { $params = Params::get(); if ( ! $params->show_help_menu) { return; } $html = JFactory::getApplication()->getBody(); if ($html == '') { return; } $pos_1 = strpos($html, '<!-- Top Navigation -->'); $pos_2 = strpos($html, '<!-- Header -->'); if ( ! $pos_1 || ! $pos_2) { return; } $nav = substr($html, $pos_1, $pos_2 - $pos_1); $shop_item = '(\s*<li>\s*<a [^>]*class="[^"]*menu-help-)shop("\s[^>]*)href="[^"]+\.joomla\.org[^"]*"([^>]*>)[^<]*(</a>s*</li>)'; $nav = RL_RegEx::replace( $shop_item, '\0<li class="divider"><span></span></li>\1dev\2href="https://regularlabs.com"\3Regular Labs Extensions\4', $nav ); // Just in case something fails if (empty($nav)) { return; } $html = substr_replace($html, $nav, $pos_1, $pos_2 - $pos_1); JFactory::getApplication()->setBody($html); } } PK B~!]�֜u u Application.phpnu &1i� <?php /** * @package Regular Labs Library * @version 21.4.10972 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\System\RegularLabs; defined('_JEXEC') or die; use Joomla\CMS\Factory as JFactory; use Joomla\CMS\Plugin\PluginHelper as JPluginHelper; class Application { public function render() { $app = JFactory::getApplication(); $document = JFactory::getDocument(); $app->loadDocument($document); $params = [ 'template' => $app->get('theme'), 'file' => $app->get('themeFile', 'index.php'), 'params' => $app->get('themeParams'), 'directory' => self::getThemesDirectory(), ]; // Parse the document. $document->parse($params); // Trigger the onBeforeRender event. JPluginHelper::importPlugin('system'); $app->triggerEvent('onBeforeRender'); $caching = false; if ($app->isClient('site') && $app->get('caching') && $app->get('caching', 2) == 2 && ! JFactory::getUser()->get('id')) { $caching = true; } // Render the document. $data = $document->render($caching, $params); // Set the application output data. $app->setBody($data); // Trigger the onAfterRender event. $app->triggerEvent('onAfterRender'); // Mark afterRender in the profiler. // Causes issues, so commented out. // JDEBUG ? $app->profiler->mark('afterRender') : null; } static function getThemesDirectory() { if (JFactory::getApplication()->get('themes.base')) { return JFactory::getApplication()->get('themes.base'); } if (defined('JPATH_THEMES')) { return JPATH_THEMES; } if (defined('JPATH_BASE')) { return JPATH_BASE . '/themes'; } return __DIR__ . '/themes'; } } PK B~!]q�� � QuickPage.phpnu &1i� <?php /** * @package Regular Labs Library * @version 21.4.10972 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2021 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ namespace RegularLabs\Plugin\System\RegularLabs; defined('_JEXEC') or die; use Joomla\CMS\Factory as JFactory; use Joomla\CMS\HTML\HTMLHelper as JHtml; use Joomla\CMS\Uri\Uri as JUri; use RegularLabs\Library\Document as RL_Document; use RegularLabs\Library\RegEx as RL_RegEx; class QuickPage { public static function render() { if ( ! JFactory::getApplication()->input->getInt('rl_qp', 0)) { return; } $url = JFactory::getApplication()->input->getString('url', ''); if ($url) { echo \RegularLabs\Library\Http::getFromServer($url, JFactory::getApplication()->input->getInt('timeout', '')); die; } $allowed = [ 'administrator/components/com_dbreplacer/ajax.php', 'administrator/modules/mod_addtomenu/popup.php', 'media/rereplacer/images/popup.php', 'plugins/editors-xtd/articlesanywhere/popup.php', 'plugins/editors-xtd/conditionalcontent/popup.php', 'plugins/editors-xtd/contenttemplater/data.php', 'plugins/editors-xtd/contenttemplater/popup.php', 'plugins/editors-xtd/dummycontent/popup.php', 'plugins/editors-xtd/modals/popup.php', 'plugins/editors-xtd/modulesanywhere/popup.php', 'plugins/editors-xtd/sliders/data.php', 'plugins/editors-xtd/sliders/popup.php', 'plugins/editors-xtd/snippets/popup.php', 'plugins/editors-xtd/sourcerer/popup.php', 'plugins/editors-xtd/tabs/data.php', 'plugins/editors-xtd/tabs/popup.php', 'plugins/editors-xtd/tooltips/popup.php', ]; $file = JFactory::getApplication()->input->getString('file', ''); $folder = JFactory::getApplication()->input->getString('folder', ''); if ($folder) { $file = implode('/', explode('.', $folder)) . '/' . $file; } if ( ! $file || in_array($file, $allowed) === false) { die; } jimport('joomla.filesystem.file'); if (RL_Document::isClient('site')) { JFactory::getApplication()->setTemplate('../administrator/templates/isis'); } $_REQUEST['tmpl'] = 'component'; JFactory::getApplication()->input->set('option', 'com_content'); switch (JFactory::getApplication()->input->getCmd('format', 'html')) { case 'json' : $format = 'application/json'; break; default: case 'html' : $format = 'text/html'; break; } header('Content-Type: ' . $format . '; charset=utf-8'); JHtml::_('bootstrap.framework'); JFactory::getDocument()->addScript( JUri::root(true) . '/administrator/templates/isis/js/template.js' ); JFactory::getDocument()->addStylesheet( JUri::root(true) . '/administrator/templates/isis/css/template' . (JFactory::getDocument()->direction === 'rtl' ? '-rtl' : '') . '.css' ); RL_Document::style('regularlabs/popup.min.css'); $file = JPATH_SITE . '/' . $file; $html = ''; if (is_file($file)) { ob_start(); include $file; $html = ob_get_contents(); ob_end_clean(); } RL_Document::setBuffer($html); $app = new Application; $app->render(); $html = JFactory::getApplication()->getBody(); $html = RL_RegEx::replace('\s*<link [^>]*href="[^"]*templates/system/[^"]*\.css[^"]*"[^>]*( /)?>', '', $html); $html = RL_RegEx::replace('(<body [^>]*class=")', '\1reglab-popup ', $html); $html = str_replace('<body>', '<body class="reglab-popup"', $html); // Move the template css down to last $html = RL_RegEx::replace('(<link [^>]*href="[^"]*templates/isis/[^"]*\.css[^"]*"[^>]*(?: /)?>\s*)(.*?)(<script)', '\2\1\3', $html); echo $html; die; } } PK <t!]{�9� Helper.phpnu &1i� PK <t!]N3��x x G Clean.phpnu &1i� PK <t!]-�4� � � Protect.phpnu &1i� PK <t!]$ ��1^ 1^ � Replace.phpnu &1i� PK <t!]�ϖ�% % Wp Document.phpnu &1i� PK <t!]Ae�Q� � �w Plugin.phpnu &1i� PK <t!]dr� � � � Params.phpnu &1i� PK At!]V�� � �� Helper/UUID4.phpnu &1i� PK At!]�u u � Extension/AkeebaBackup.phpnu &1i� PK �|!]X9�� � Extension/Jce.phpnu &1i� PK �|!]z_�m m � PluginTraits/EventsTrait.phpnu &1i� PK ~!]^`�� � �� Extension/MediaJce.phpnu &1i� PK ~!]� 6 6 �� PluginTraits/FormTrait.phpnu &1i� PK B~!]�ݵ � :� SearchHelper.phpnu &1i� PK B~!]R��%� � /� DownloadKey.phpnu &1i� PK B~!]��i� � �� AdminMenu.phpnu &1i� PK B~!]�֜u u � Application.phpnu &1i� PK B~!]q�� � � QuickPage.phpnu &1i� PK � �
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка