File manager - Edit - /home/opticamezl/www/newok/com_weblinks.tar
Back
com_weblinks.xml 0000604 00000011506 15167617736 0007764 0 ustar 00 <?xml version="1.0" encoding="iso-8859-1"?> <extension type="plugin" group="osmap" version="1.6" method="upgrade"> <name>OSMap - WebLinks Plugin</name> <author>Alledia</author> <creationDate>March 10 2016</creationDate> <copyright>Copyright (C) 2016 Open Source Training, LLC. All rights reserved. / Forked from XMap - Guillermo Vargas - guille@vargas.co.cr</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>support@alledia.com</authorEmail> <authorUrl>http://www.alledia.com</authorUrl> <version>3.3.0</version> <description>OSMAP_WL_PLUGIN_DESCRIPTION</description> <files> <filename plugin="com_weblinks">com_weblinks.php</filename> </files> <languages folder="language"> <!-- these files will be installed in the administrator/language folder. --> <language tag="en-GB">en-GB.plg_osmap_com_weblinks.ini</language> </languages> <config> <fields name="params"> <fieldset name="basic"> <field name="include_links" type="list" default="1" label="OSMAP_WL_SETTING_SHOW_LINKS_LABEL" description="OSMAP_WL_SETTING_SHOW_LINKS_DESC"> <option value="0">OSMAP_OPTION_NEVER</option> <option value="1">OSMAP_OPTION_ALWAYS</option> <option value="2">OSMAP_OPTION_XML_ONLY</option> <option value="3">OSMAP_OPTION_HTML_ONLY</option> </field> <field name="max_links" type="text" default="" label="OSMAP_WL_SETTING_MAX_LINKS_LABEL" description="OSMAP_WL_SETTING_MAX_LINKS_DESC" /> </fieldset> <fieldset name="xml"> <field name="cat_priority" type="list" default="-1" label="OSMAP_WL_CATEGORY_PRIORITY_LABEL" description="OSMAP_WL_CATEGORY_PRIORITY_DESC"> <option value="-1">OSMAP_OPTION_USE_PARENT_MENU</option> <option value="0.0">0.0</option> <option value="0.1">0.1</option> <option value="0.2">0.2</option> <option value="0.3">0.3</option> <option value="0.4">0.4</option> <option value="0.5">0.5</option> <option value="0.6">0.6</option> <option value="0.7">0.7</option> <option value="0.8">0.8</option> <option value="0.9">0.9</option> <option value="1">1</option> </field> <field name="cat_changefreq" type="list" default="-1" label="OSMAP_WL_CATEGORY_CHANGEFREQ_LABEL" description="OSMAP_WL_CATEGORY_CHANGEFREQ_DESC"> <option value="-1">OSMAP_OPTION_USE_PARENT_MENU</option> <option value="always">OSMAP_OPTION_ALWAYS</option> <option value="hourly">OSMAP_OPTION_HOURLY</option> <option value="daily">OSMAP_OPTION_DAILY</option> <option value="weekly">OSMAP_OPTION_WEEKLY</option> <option value="monthly">OSMAP_OPTION_MONTHLY</option> <option value="yearly">OSMAP_OPTION_YEARLY</option> <option value="never">OSMAP_OPTION_NEVER</option> </field> <field name="link_priority" type="list" default="-1" label="OSMAP_WL_LINK_PRIORITY_LABEL" description="OSMAP_WL_LINK_PRIORITY_DESC"> <option value="-1">OSMAP_OPTION_USE_PARENT_MENU</option> <option value="0.0">0.0</option> <option value="0.2">0.2</option> <option value="0.3">0.3</option> <option value="0.4">0.4</option> <option value="0.5">0.5</option> <option value="0.6">0.6</option> <option value="0.7">0.7</option> <option value="0.8">0.8</option> <option value="0.9">0.9</option> <option value="1">1</option> </field> <field name="link_changefreq" type="list" default="-1" label="OSMAP_WL_LINK_CHANGEFREQ_LABEL" description="OSMAP_WL_LINK_CHANGEFREQ_DESC"> <option value="-1">OSMAP_OPTION_USE_PARENT_MENU</option> <option value="always">OSMAP_OPTION_ALWAYS</option> <option value="hourly">OSMAP_OPTION_HOURLY</option> <option value="daily">OSMAP_OPTION_DAILY</option> <option value="weekly">OSMAP_OPTION_WEEKLY</option> <option value="monthly">OSMAP_OPTION_MONTHLY</option> <option value="yearly">OSMAP_OPTION_YEARLY</option> <option value="never">OSMAP_OPTION_NEVER</option> </field> </fieldset> </fields> </config> </extension> com_weblinks.php 0000604 00000020112 15167617736 0007744 0 ustar 00 <?php /** * @package OSMap * @copyright 2007-2014 XMap - Joomla! Vargas. All rights reserved. * @copyright 2016 Open Source Training, LLC. All rights reserved.. * @author Guillermo Vargas <guille@vargas.co.cr> * @author Alledia <support@alledia.com> * @license GNU General Public License version 2 or later; see LICENSE.txt * * This file is part of OSMap. * * OSMap is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * any later version. * * OSMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OSMap. If not, see <http://www.gnu.org/licenses/>. */ defined('_JEXEC') or die('Restricted access'); class osmap_com_weblinks { private static $views = array('categories', 'category'); private static $enabled = null; private static $instance = null; public function __construct() { if (static::isEnabled()) { JLoader::register('WeblinksHelperRoute', JPATH_SITE . '/components/com_weblinks/helpers/route.php'); } } public static function getInstance() { if (empty(static::$instance)) { $instance = new self; static::$instance = $instance; } return static::$instance; } public function getTree($osmap, $parent, &$params) { $uri = new JUri($parent->link); if (!static::isEnabled() || !in_array($uri->getVar('view'), static::$views)) { return; } $params['groups'] = implode(',', JFactory::getUser()->getAuthorisedViewLevels()); $params['language_filter'] = JFactory::getApplication()->getLanguageFilter(); $params['include_links'] = JArrayHelper::getValue($params, 'include_links', 1); $params['include_links'] = ($params['include_links'] == 1 || ($params['include_links'] == 2 && $osmap->view == 'xml') || ($params['include_links'] == 3 && $osmap->view == 'html')); $params['show_unauth'] = JArrayHelper::getValue($params, 'show_unauth', 0); $params['show_unauth'] = ($params['show_unauth'] == 1 || ($params['show_unauth'] == 2 && $osmap->view == 'xml') || ($params['show_unauth'] == 3 && $osmap->view == 'html')); $params['category_priority'] = JArrayHelper::getValue($params, 'category_priority', $parent->priority); $params['category_changefreq'] = JArrayHelper::getValue($params, 'category_changefreq', $parent->changefreq); if ($params['category_priority'] == -1) { $params['category_priority'] = $parent->priority; } if ($params['category_changefreq'] == -1) { $params['category_changefreq'] = $parent->changefreq; } $params['link_priority'] = JArrayHelper::getValue($params, 'link_priority', $parent->priority); $params['link_changefreq'] = JArrayHelper::getValue($params, 'link_changefreq', $parent->changefreq); if ($params['link_priority'] == -1) { $params['link_priority'] = $parent->priority; } if ($params['link_changefreq'] == -1) { $params['link_changefreq'] = $parent->changefreq; } switch ($uri->getVar('view')) { case 'categories': static::getCategoryTree($osmap, $parent, $params, $uri->getVar('id')); break; case 'category': static::getlinks($osmap, $parent, $params, $uri->getVar('id')); break; } } private static function getCategoryTree(&$osmap, &$parent, &$params, $parent_id) { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select(array('c.id', 'c.alias', 'c.title', 'c.parent_id, params, metadata')) ->from('#__categories AS c') ->where('c.parent_id = ' . $db->quote($parent_id ? $parent_id : 1)) ->where('c.extension = ' . $db->quote('com_weblinks')) ->where('c.published = 1') ->order('c.lft'); if (!$params['show_unauth']) { $query->where('c.access IN(' . $params['groups'] . ')'); } if ($params['language_filter']) { $query->where('c.language IN(' . $db->quote(JFactory::getLanguage()->getTag()) . ', ' . $db->quote('*') . ')'); } $db->setQuery($query); $rows = $db->loadObjectList(); if (empty($rows)) { return; } $osmap->changeLevel(1); foreach ($rows as $row) { if (OSMAP_LICENSE === 'pro') { $content = new Alledia\OSMap\Pro\Joomla\Item($row); if (!$content->isVisibleForRobots()) { continue; } } $node = new stdclass; $node->id = $parent->id; $node->name = $row->title; $node->uid = $parent->uid . '_cid_' . $row->id; $node->browserNav = $parent->browserNav; $node->priority = $params['category_priority']; $node->changefreq = $params['category_changefreq']; $node->pid = $row->parent_id; $node->link = WeblinksHelperRoute::getCategoryRoute($row->id); if ($osmap->printNode($node) !== false) { static::getlinks($osmap, $parent, $params, $row->id); } } $osmap->changeLevel(-1); } private static function getlinks(&$osmap, &$parent, &$params, $catid) { static::getCategoryTree($osmap, $parent, $params, $catid); if (!$params['include_links']) { return; } $db = JFactory::getDbo(); $now = JFactory::getDate('now', 'UTC')->toSql(); $query = $db->getQuery(true) ->select(array('w.id', 'w.alias', 'w.title', 'params', 'metadata')) ->from('#__weblinks AS w') ->where('w.catid = ' . $db->Quote($catid)) ->where('w.state = 1') ->where('(w.publish_up = ' . $db->quote($db->getNullDate()) . ' OR w.publish_up <= ' . $db->quote($now) . ')') ->where('(w.publish_down = ' . $db->quote($db->getNullDate()) . ' OR w.publish_down >= ' . $db->quote($now) . ')') ->order('w.ordering'); if (!$params['show_unauth']) { $query->where('w.access IN(' . $params['groups'] . ')'); } if ($params['language_filter']) { $query->where('w.language IN(' . $db->quote(JFactory::getLanguage()->getTag()) . ', ' . $db->quote('*') . ')'); } $db->setQuery($query); $rows = $db->loadObjectList(); if (empty($rows)) { return; } $osmap->changeLevel(1); foreach ($rows as $row) { if (OSMAP_LICENSE === 'pro') { $content = new Alledia\OSMap\Pro\Joomla\Item($row); if (!$content->isVisibleForRobots()) { continue; } } $node = new stdclass; $node->id = $parent->id; $node->name = $row->title; $node->uid = $parent->uid . '_' . $row->id; $node->browserNav = $parent->browserNav; $node->priority = $params['link_priority']; $node->changefreq = $params['link_changefreq']; $node->link = WeblinksHelperRoute::getWeblinkRoute($row->id . ':' . $row->alias, $catid); $osmap->printNode($node); } $osmap->changeLevel(-1); } protected static function isEnabled() { if (null === static::$enabled) { $db = JFactory::getDbo(); $db->setQuery('Select enabled From #__extensions Where name=' . $db->quote('com_weblinks')); static::$enabled = (bool)$db->loadResult(); } return static::$enabled; } } js/admin-weblinks-modal.min.js 0000604 00000001556 15172564220 0012305 0 ustar 00 !function(){"use strict";window.jSelectWeblink=function(t,e,n,a,r,i){var o,l="";if(!Joomla.getOptions("xtd-weblinks"))return window.parent.Joomla.Modal.getCurrent().close(),!1;o=Joomla.getOptions("xtd-weblinks").editor,""!==i&&(l=' hreflang="'+i+'"'),e="<a"+l+' href="'+r+'">'+e+"</a>",window.parent.Joomla.editors.instances[o].replaceSelection(e),window.parent.Joomla.Modal.getCurrent().close()},document.addEventListener("DOMContentLoaded",function(){for(var t=document.querySelectorAll(".select-link"),e=0,n=t.length;e<n;e++)t[e].addEventListener("click",function(t){t.preventDefault();var e=t.target.getAttribute("data-function");("jSelectWeblink"===e?window:window.parent)[e](t.target.getAttribute("data-id"),t.target.getAttribute("data-title"),t.target.getAttribute("data-cat-id"),null,t.target.getAttribute("data-uri"),t.target.getAttribute("data-language",null))})})}(); js/admin-weblinks-modal.js 0000604 00000004004 15172564220 0011512 0 ustar 00 /** * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ (function() { "use strict"; /** * Javascript to insert the link * View element calls jSelectWeblink when an weblink is clicked * jSelectWeblink creates the link tag, sends it to the editor, * and closes the select frame. **/ window.jSelectWeblink = function (id, title, catid, object, link, lang) { var hreflang = '', editor, tag; if (!Joomla.getOptions('xtd-weblinks')) { // Something went wrong window.parent.Joomla.Modal.getCurrent().close(); return false; } editor = Joomla.getOptions('xtd-weblinks').editor; if (lang !== '') { hreflang = ' hreflang="' + lang + '"'; } tag = '<a' + hreflang + ' href="' + link + '">' + title + '</a>'; window.parent.Joomla.editors.instances[editor].replaceSelection(tag); window.parent.Joomla.Modal.getCurrent().close(); }; document.addEventListener('DOMContentLoaded', function(){ // Get the elements var elements = document.querySelectorAll('.select-link'); for(var i = 0, l = elements.length; l>i; i++) { // Listen for click event elements[i].addEventListener('click', function (event) { event.preventDefault(); var functionName = event.target.getAttribute('data-function'); if (functionName === 'jSelectWeblink') { // Used in xtd_weblinks window[functionName](event.target.getAttribute('data-id'), event.target.getAttribute('data-title'), event.target.getAttribute('data-cat-id'), null, event.target.getAttribute('data-uri'), event.target.getAttribute('data-language', null)); } else { // Used in com_menus window.parent[functionName](event.target.getAttribute('data-id'), event.target.getAttribute('data-title'), event.target.getAttribute('data-cat-id'), null, event.target.getAttribute('data-uri'), event.target.getAttribute('data-language', null)); } }) } }); })();
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings