File manager - Edit - /home/opticamezl/www/newok/Tag.tar
Back
TaggableTableTrait.php 0000644 00000002733 15172712370 0010751 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Tag; use Joomla\CMS\Helper\TagsHelper; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Defines the trait for a Taggable Table Class. * * @since 3.10.0 */ trait TaggableTableTrait { /** * The tags helper property * * @var TagsHelper * @since 4.0.0 * @note The tags helper property is set to public for backwards compatibility for Joomla 4.0. It will be made a * protected property in Joomla 5.0 */ public $tagsHelper; /** * Get the tags helper * * @return TagsHelper The tags helper object * * @since 4.0.0 */ public function getTagsHelper(): ?TagsHelper { return $this->tagsHelper; } /** * Set the tags helper * * @param TagsHelper $tagsHelper The tags helper to be set * * @return void * * @since 4.0.0 */ public function setTagsHelper(TagsHelper $tagsHelper): void { $this->tagsHelper = $tagsHelper; } /** * Clears the tags helper * * @return void * * @since 4.0.0 */ public function clearTagsHelper(): void { $this->tagsHelper = null; } } TagApiSerializerTrait.php 0000644 00000002402 15172712370 0011463 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Tag; use Joomla\CMS\Router\Route; use Joomla\CMS\Serializer\JoomlaSerializer; use Joomla\CMS\Uri\Uri; use Tobscure\JsonApi\Collection; use Tobscure\JsonApi\Relationship; use Tobscure\JsonApi\Resource; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Trait for implementing tags in an API Serializer * * @since 4.0.0 */ trait TagApiSerializerTrait { /** * Build tags relationship * * @param \stdClass $model Item model * * @return Relationship * * @since 4.0.0 */ public function tags($model) { $resources = []; $serializer = new JoomlaSerializer('tags'); foreach ($model->tags as $id => $tagName) { $resources[] = (new Resource($id, $serializer)) ->addLink('self', Route::link('site', Uri::root() . 'api/index.php/v1/tags/' . $id)); } $collection = new Collection($resources, $serializer); return new Relationship($collection); } } TaggableTableInterface.php 0000644 00000002641 15172712370 0011564 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Tag; use Joomla\CMS\Helper\TagsHelper; use Joomla\CMS\Table\TableInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Interface for a taggable Table class * * @since 3.10.0 */ interface TaggableTableInterface extends TableInterface { /** * Get the type alias for the tags mapping table * * The type alias generally is the internal component name with the * content type. Ex.: com_content.article * * @return string The alias as described above * * @since 4.0.0 */ public function getTypeAlias(); /** * Get the tags helper * * @return ?TagsHelper The tags helper object * * @since 4.0.0 */ public function getTagsHelper(): ?TagsHelper; /** * Set the tags helper * * @param TagsHelper $tagsHelper The tags helper object * * @return void * * @since 4.0.0 */ public function setTagsHelper(TagsHelper $tagsHelper): void; /** * Clears a set tags helper * * @return void * * @since 4.0.0 */ public function clearTagsHelper(): void; } TagServiceInterface.php 0000644 00000001455 15172712370 0011144 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Tag; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Access to component specific tagging information. * * @since 4.0.0 */ interface TagServiceInterface { /** * Adds Count Items for Tag Manager. * * @param \stdClass[] $items The content objects * @param string $extension The name of the active view. * * @return void * * @since 4.0.0 * @throws \Exception */ public function countTagItems(array $items, string $extension); } TagServiceTrait.php 0000644 00000003615 15172712370 0010327 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Tag; use Joomla\CMS\Helper\ContentHelper; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Trait for component tags service. * * @since 4.0.0 */ trait TagServiceTrait { /** * Adds Count Items for Tag Manager. * * @param \stdClass[] $items The content objects * @param string $extension The name of the active view. * * @return void * * @since 4.0.0 */ public function countTagItems(array $items, string $extension) { $parts = explode('.', $extension); $section = \count($parts) > 1 ? $parts[1] : null; $config = (object) [ 'related_tbl' => $this->getTableNameForSection($section), 'state_col' => $this->getStateColumnForSection($section), 'group_col' => 'tag_id', 'extension' => $extension, 'relation_type' => 'tag_assigments', ]; ContentHelper::countRelations($items, $config); } /** * Returns the table for the count items functions for the given section. * * @param string $section The section * * @return string|null * * @since 4.0.0 */ protected function getTableNameForSection(string $section = null) { return null; } /** * Returns the state column for the count items functions for the given section. * * @param string $section The section * * @return string|null * * @since 4.0.0 */ protected function getStateColumnForSection(string $section = null) { return 'state'; } } HtmlView.php 0000644 00000023150 15173222527 0007023 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_tags * * @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Tags\Site\View\Tag; use Joomla\CMS\Factory; use Joomla\CMS\Menu\MenuItem; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Router\Route; use Joomla\CMS\User\User; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * HTML View class for the Tags component * * @since 3.1 */ class HtmlView extends BaseHtmlView { /** * The model state * * @var CMSObject * * @since 3.1 */ protected $state; /** * List of items associated with the tag * * @var \stdClass[]|false * * @since 3.1 */ protected $items; /** * Tag data for the current tag or tags (on success, false on failure) * * @var CMSObject[]|boolean * * @since 3.1 */ protected $item; /** * UNUSED * * @var null * * @since 3.1 */ protected $children; /** * UNUSED * * @var null * * @since 3.1 */ protected $parent; /** * The pagination object * * @var \Joomla\CMS\Pagination\Pagination * * @since 3.1 */ protected $pagination; /** * The page parameters * * @var Registry * * @since 3.1 */ protected $params; /** * Array of tags title * * @var array * * @since 3.1 */ protected $tags_title; /** * The page class suffix * * @var string * * @since 4.0.0 */ protected $pageclass_sfx = ''; /** * The logged in user * * @var User * * @since 4.0.0 */ protected $user; /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void * * @since 3.1 */ public function display($tpl = null) { $app = Factory::getApplication(); // Get some data from the models $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->item = $this->get('Item'); $this->children = $this->get('Children'); $this->parent = $this->get('Parent'); $this->pagination = $this->get('Pagination'); $this->user = $this->getCurrentUser(); // Flag indicates to not add limitstart=0 to URL $this->pagination->hideEmptyLimitstart = true; if (count($errors = $this->get('Errors'))) { throw new GenericDataException(implode("\n", $errors), 500); } $this->params = $this->state->get('params'); /** @var MenuItem $active */ $active = $app->getMenu()->getActive(); $query = $active->query; // Merge tag params. If this is single-tag view, menu params override tag params // Otherwise, article params override menu item params foreach ($this->item as $itemElement) { // Prepare the data. $temp = new Registry($itemElement->params); // If the current view is the active item and a tag view for at least this tag, then the menu item params take priority if ($query['option'] == 'com_tags' && $query['view'] == 'tag' && in_array($itemElement->id, $query['id'])) { // Merge so that the menu item params take priority $itemElement->params = $temp; $itemElement->params->merge($this->params); // Load layout from active query (in case it is an alternative menu item) if (isset($active->query['layout'])) { $this->setLayout($active->query['layout']); } } else { $itemElement->params = clone $this->params; $itemElement->params->merge($temp); // Check for alternative layouts (since we are not in a single-tag menu item) if ($layout = $itemElement->params->get('tag_layout')) { $this->setLayout($layout); } } $itemElement->metadata = new Registry($itemElement->metadata); } PluginHelper::importPlugin('content'); foreach ($this->items as $itemElement) { $itemElement->event = new \stdClass(); // For some plugins. $itemElement->text = !empty($itemElement->core_body) ? $itemElement->core_body : ''; $itemElement->core_params = new Registry($itemElement->core_params); $app->triggerEvent('onContentPrepare', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]); $results = $app->triggerEvent( 'onContentAfterTitle', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0] ); $itemElement->event->afterDisplayTitle = trim(implode("\n", $results)); $results = $app->triggerEvent( 'onContentBeforeDisplay', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0] ); $itemElement->event->beforeDisplayContent = trim(implode("\n", $results)); $results = $app->triggerEvent( 'onContentAfterDisplay', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0] ); $itemElement->event->afterDisplayContent = trim(implode("\n", $results)); // Write the results back into the body if (!empty($itemElement->core_body)) { $itemElement->core_body = $itemElement->text; } // Categories store the images differently so lets re-map it so the display is correct if ($itemElement->type_alias === 'com_content.category') { $itemElement->core_images = json_encode( [ 'image_intro' => $itemElement->core_params->get('image', ''), 'image_intro_alt' => $itemElement->core_params->get('image_alt', ''), ] ); } } // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx', '')); $this->_prepareDocument(); parent::display($tpl); } /** * Prepares the document. * * @return void */ protected function _prepareDocument() { $app = Factory::getApplication(); $menu = $app->getMenu()->getActive(); $this->tags_title = $this->getTagsTitle(); $pathway = $app->getPathway(); $title = ''; // Highest priority for "Browser Page Title". if ($menu) { $title = $menu->getParams()->get('page_title', ''); } if ($this->tags_title) { $this->params->def('page_heading', $this->tags_title); $title = $title ?: $this->tags_title; } elseif ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); $title = $title ?: $this->params->get('page_title', $menu->title); } $this->setDocumentTitle($title); if ( $menu && isset($menu->query['option'], $menu->query['view']) && $menu->query['option'] === 'com_tags' && $menu->query['view'] === 'tag' ) { // No need to alter pathway if the active menu item links directly to tag view } else { $pathway->addItem($title); } foreach ($this->item as $itemElement) { if ($itemElement->metadesc) { $this->getDocument()->setDescription($itemElement->metadesc); } elseif ($this->params->get('menu-meta_description')) { $this->getDocument()->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('robots')) { $this->getDocument()->setMetaData('robots', $this->params->get('robots')); } } if (count($this->item) === 1) { foreach ($this->item[0]->metadata->toArray() as $k => $v) { if ($v) { $this->getDocument()->setMetaData($k, $v); } } } if ($this->params->get('show_feed_link', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = ['type' => 'application/rss+xml', 'title' => htmlspecialchars($this->getDocument()->getTitle())]; $this->getDocument()->addHeadLink(Route::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = ['type' => 'application/atom+xml', 'title' => htmlspecialchars($this->getDocument()->getTitle())]; $this->getDocument()->addHeadLink(Route::_($link . '&type=atom'), 'alternate', 'rel', $attribs); } } /** * Creates the tags title for the output * * @return string * * @since 3.1 */ protected function getTagsTitle() { $tags_title = []; foreach ($this->item as $item) { $tags_title[] = $item->title; } return implode(' ', $tags_title); } } FeedView.php 0000644 00000006227 15173222527 0006770 0 ustar 00 <?php /** * @package Joomla.Site * @subpackage com_tags * * @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Tags\Site\View\Tag; use Joomla\CMS\Document\Feed\FeedItem; use Joomla\CMS\Factory; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Router\Route; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * HTML View class for the Tags component * * @since 3.1 */ class FeedView extends BaseHtmlView { /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { $app = Factory::getApplication(); $ids = (array) $app->getInput()->get('id', [], 'int'); $i = 0; $tagIds = ''; // Remove zero values resulting from input filter $ids = array_filter($ids); foreach ($ids as $id) { if ($i !== 0) { $tagIds .= '&'; } $tagIds .= 'id[' . $i . ']=' . $id; $i++; } $this->getDocument()->link = Route::_('index.php?option=com_tags&view=tag&' . $tagIds); $app->getInput()->set('limit', $app->get('feed_limit')); $siteEmail = $app->get('mailfrom'); $fromName = $app->get('fromname'); $feedEmail = $app->get('feed_email', 'none'); $this->getDocument()->editor = $fromName; if ($feedEmail !== 'none') { $this->getDocument()->editorEmail = $siteEmail; } // Get some data from the model $items = $this->get('Items'); if ($items !== false) { foreach ($items as $item) { // Strip HTML from feed item title $title = $this->escape($item->core_title); $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8'); // Strip HTML from feed item description text $description = $item->core_body; $author = $item->core_created_by_alias ?: $item->author; $date = ($item->displayDate ? date('r', strtotime($item->displayDate)) : ''); // Load individual item creator class $feeditem = new FeedItem(); $feeditem->title = $title; $feeditem->link = Route::_($item->link); $feeditem->description = $description; $feeditem->date = $date; $feeditem->category = $title; $feeditem->author = $author; if ($feedEmail === 'site') { $item->authorEmail = $siteEmail; } elseif ($feedEmail === 'author') { $item->authorEmail = $item->author_email; } // Loads item info into RSS array $this->getDocument()->addItem($feeditem); } } } } TaggedValue.php 0000644 00000001305 15174020033 0007437 0 ustar 00 <?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Yaml\Tag; /** * @author Nicolas Grekas <p@tchwork.com> * @author Guilhem N. <egetick@gmail.com> */ final class TaggedValue { private $tag; private $value; public function __construct(string $tag, $value) { $this->tag = $tag; $this->value = $value; } public function getTag(): string { return $this->tag; } public function getValue() { return $this->value; } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings