| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/com_tags.zip |
PK �|!]�-v v helpers/tags.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @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
*/
defined('_JEXEC') or die;
/**
* Tags helper.
*
* @since 3.1
* @deprecated 4.0
*/
class TagsHelper extends JHelperContent
{
/**
* Configure the Submenu links.
*
* @param string $extension The extension.
*
* @return void
*
* @since 3.1
* @deprecated 4.0
*/
public static function addSubmenu($extension)
{
$parts = explode('.', $extension);
$component = $parts[0];
// Avoid nonsense situation.
if ($component == 'tags')
{
return;
}
// Try to find the component helper.
$file = JPath::clean(JPATH_ADMINISTRATOR . '/components/com_tags/helpers/tags.php');
if (file_exists($file))
{
$cName = 'TagsHelper';
JLoader::register($cName, $file);
if (class_exists($cName))
{
if (is_callable(array($cName, 'addSubmenu')))
{
$lang = JFactory::getLanguage();
// Loading language file from administrator/language directory then administrator/components/<extension>/language
$lang->load($component, JPATH_BASE, null, false, true)
|| $lang->load($component, JPath::clean(JPATH_ADMINISTRATOR . '/components/' . $component), null, false, true);
}
}
}
}
}
PK �|!]�tx�D D controllers/tags.phpnu &1i� <?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
*/
defined('_JEXEC') or die;
/**
* The Tags List Controller
*
* @since 3.1
*/
class TagsControllerTags extends JControllerLegacy
{
/**
* Method to search tags with AJAX
*
* @return void
*/
public function searchAjax()
{
// Required objects
$app = JFactory::getApplication();
$user = JFactory::getUser();
// Receive request data
$filters = array(
'like' => trim($app->input->get('like', null, 'string')),
'title' => trim($app->input->get('title', null, 'string')),
'flanguage' => $app->input->get('flanguage', null, 'word'),
'published' => $app->input->get('published', 1, 'int'),
'parent_id' => $app->input->get('parent_id', 0, 'int'),
'access' => $user->getAuthorisedViewLevels(),
);
if ((!$user->authorise('core.edit.state', 'com_tags')) && (!$user->authorise('core.edit', 'com_tags')))
{
// Filter on published for those who do not have edit or edit.state rights.
$filters['published'] = 1;
}
$results = JHelperTags::searchTags($filters);
if ($results)
{
// Output a JSON object
echo json_encode($results);
}
$app->close();
}
}
PK �|!]��'� � controllers/tag.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @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
*/
defined('_JEXEC') or die;
/**
* The Tag Controller
*
* @since 3.1
*/
class TagsControllerTag extends JControllerForm
{
/**
* Method to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 3.1
*/
protected function allowAdd($data = array())
{
$user = JFactory::getUser();
return $user->authorise('core.create', 'com_tags');
}
/**
* Method to check if you can edit a record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 3.1
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Since there is no asset tracking and no categories, revert to the component permissions.
return parent::allowEdit($data, $key);
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 3.1
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
$model = $this->getModel('Tag');
// Preset the redirect
$this->setRedirect('index.php?option=com_tags&view=tags');
return parent::batch($model);
}
}
PK �|!](��1 1
access.xmlnu &1i� <?xml version="1.0" encoding="utf-8" ?>
<access component="com_tags">
<section name="component">
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
<action name="core.options" title="JACTION_OPTIONS" description="JACTION_OPTIONS_COMPONENT_DESC" />
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
</section>
</access>
PK �|!]�x�� � tags.xmlnu &1i� <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.1" method="upgrade">
<name>com_tags</name>
<author>Joomla! Project</author>
<creationDate>December 2013</creationDate>
<copyright>(C) 2013 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>3.1.0</version>
<description>COM_TAGS_XML_DESCRIPTION</description>
<files folder="site">
<filename>controller.php</filename>
<filename>metadata.xml</filename>
<filename>newsfeeds.php</filename>
<filename>router.php</filename>
<folder>helpers</folder>
<folder>models</folder>
<folder>views</folder>
</files>
<languages folder="site">
<language tag="en-GB">language/en-GB.com_tags.ini</language>
</languages>
<administration>
<files folder="admin">
<filename>tags.php</filename>
<filename>config.xml</filename>
<filename>controller.php</filename>
<folder>controllers</folder>
<folder>helpers</folder>
<folder>models</folder>
<folder>views</folder>
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB.com_tags.ini</language>
<language tag="en-GB">language/en-GB.com_tags.sys.ini</language>
</languages>
<menu link="option=com_tags" img="class:tags">com_tags</menu>
</administration>
</extension>
PK �|!]��/�) �)
config.xmlnu &1i� <?xml version="1.0" encoding="utf-8"?>
<config>
<fieldset
name="taglist"
label="COM_TAGS_CONFIG_TAG_SETTINGS_LABEL"
description="COM_TAGS_CONFIG_TAG_SETTINGS_DESC">
<field
name="tag_layout"
type="componentlayout"
label="COM_TAGS_CONFIG_TAGGED_ITEMS_FIELD_LAYOUT_LABEL"
description="COM_TAGS_CONFIG_TAGGED_ITEMS_FIELD_LAYOUT_DESC"
menuitems="true"
extension="com_tags"
view="tag"
/>
<field
name="save_history"
type="radio"
label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"
description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"
class="btn-group btn-group-yesno"
default="0"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="history_limit"
type="number"
label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"
filter="integer"
default="5"
showon="save_history:1"
/>
<field
name="show_tag_title"
type="radio"
label="COM_TAGS_SHOW_TAG_TITLE_LABEL"
description="COM_TAGS_SHOW_TAG_TITLE_DESC"
class="btn-group btn-group-yesno"
default="0"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="tag_list_show_tag_image"
type="radio"
label="COM_TAGS_SHOW_TAG_IMAGE_LABEL"
description="COM_TAGS_SHOW_TAG_IMAGE_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="tag_list_show_tag_description"
type="radio"
label="COM_TAGS_SHOW_TAG_DESCRIPTION_LABEL"
description="COM_TAGS_SHOW_TAG_DESCRIPTION_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="tag_list_image"
type="media"
label="COM_TAGS_TAG_LIST_MEDIA_LABEL"
description="COM_TAGS_TAG_LIST_MEDIA_DESC"
/>
<field
name="tag_list_orderby"
type="list"
label="JGLOBAL_FIELD_FIELD_ORDERING_LABEL"
description="JGLOBAL_FIELD_FIELD_ORDERING_DESC"
default="title"
validate="options"
>
<option value="c.core_title">JGLOBAL_TITLE</option>
<option value="match_count">COM_TAGS_MATCH_COUNT</option>
<option value="c.core_created_time">JGLOBAL_CREATED_DATE</option>
<option value="c.core_modified_time">JGLOBAL_MODIFIED_DATE</option>
<option value="c.core_publish_up">JGLOBAL_PUBLISHED_DATE</option>
</field>
<field
name="tag_list_orderby_direction"
type="radio"
label="JGLOBAL_ORDER_DIRECTION_LABEL"
description="JGLOBAL_ORDER_DIRECTION_DESC"
class="btn-group btn-group-yesno"
default="ASC"
>
<option value="ASC">JGLOBAL_ORDER_ASCENDING</option>
<option value="DESC">JGLOBAL_ORDER_DESCENDING</option>
</field>
<field
name="show_headings"
type="radio"
label="COM_TAGS_TAG_LIST_SHOW_HEADINGS_LABEL"
description="COM_TAGS_TAG_LIST_SHOW_HEADINGS_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="tag_list_show_date"
type="list"
label="COM_TAGS_TAG_LIST_SHOW_DATE_DESC"
description="COM_TAGS_TAG_LIST_SHOW_DATE_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="created">JGLOBAL_CREATED</option>
<option value="modified">JGLOBAL_MODIFIED</option>
<option value="published">JPUBLISHED</option>
</field>
<field
name="tag_list_show_item_image"
type="radio"
label="COM_TAGS_SHOW_ITEM_IMAGE_LABEL"
description="COM_TAGS_SHOW_ITEM_IMAGE_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="tag_list_show_item_description"
type="radio"
label="COM_TAGS_TAG_LIST_SHOW_ITEM_DESCRIPTION_LABEL"
description="COM_TAGS_TAG_LIST_SHOW_ITEM_DESCRIPTION_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="tag_list_item_maximum_characters"
type="number"
label="COM_TAGS_LIST_MAX_CHARACTERS_LABEL"
description="COM_TAGS_LIST_MAX_CHARACTERS_DESC"
filter="integer"
showon="tag_list_show_item_description:1"
/>
</fieldset>
<fieldset
name="tagselection"
label="COM_TAGS_CONFIG_SELECTION_SETTINGS_LABEL"
description="COM_TAGS_CONFIG_SELECTION_SETTINGS_DESC">
<field
name="min_term_length"
type="integer"
label="COM_TAGS_CONFIG_TAG_MIN_LENGTH_LABEL"
description="COM_TAGS_CONFIG_TAG_MIN_LENGTH_DESC"
first="1"
last="3"
step="1"
default="3"
/>
<field
name="return_any_or_all"
type="radio"
label="COM_TAGS_SEARCH_TYPE_LABEL"
description="COM_TAGS_SEARCH_TYPE_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option value="1">COM_TAGS_ANY</option>
<option value="0">COM_TAGS_ALL</option>
</field>
<field
name="include_children"
type="radio"
label="COM_TAGS_INCLUDE_CHILDREN_LABEL"
description="COM_TAGS_INCLUDE_CHILDREN_DESC"
class="btn-group btn-group-yesno"
default="0"
>
<option value="1">COM_TAGS_INCLUDE</option>
<option value="0">COM_TAGS_EXCLUDE</option>
</field>
<field
name="maximum"
type="number"
label="COM_TAGS_LIST_MAX_LABEL"
description="COM_TAGS_LIST_MAX_DESC"
default="200"
filter="integer"
/>
<field
name="tag_list_language_filter"
type="contentlanguage"
label="COM_TAGS_FIELD_LANGUAGE_FILTER_LABEL"
description="COM_TAGS_FIELD_LANGUAGE_FILTER_DESC"
default="all"
>
<option value="all">JALL</option>
<option value="current_language">JCURRENT</option>
</field>
</fieldset>
<fieldset
name="alltags"
label="COM_TAGS_CONFIG_ALL_TAGS_SETTINGS_LABEL"
description="COM_TAGS_CONFIG_ALL_TAGS_SETTINGS_DESC">
<field
name="tags_layout"
type="componentlayout"
label="COM_TAGS_CONFIG_ALL_TAGS_FIELD_LAYOUT_LABEL"
description="COM_TAGS_CONFIG_ALL_TAGS_FIELD_LAYOUT_DESC"
menuitems="true"
extension="com_tags"
view="tags"
/>
<field
name="all_tags_orderby"
type="list"
label="JGLOBAL_FIELD_FIELD_ORDERING_LABEL"
description="JGLOBAL_FIELD_FIELD_ORDERING_DESC"
default="title"
validate="options"
>
<option value="title">JGLOBAL_TITLE</option>
<option value="hits">JGLOBAL_HITS</option>
<option value="created_time">JGLOBAL_CREATED_DATE</option>
<option value="modified_time">JGLOBAL_MODIFIED_DATE</option>
<option value="publish_up">JGLOBAL_PUBLISHED_DATE</option>
</field>
<field
name="all_tags_orderby_direction"
type="radio"
label="JGLOBAL_ORDER_DIRECTION_LABEL"
description="JGLOBAL_ORDER_DIRECTION_DESC"
class="btn-group btn-group-yesno"
default="ASC"
>
<option value="ASC">JGLOBAL_ORDER_ASCENDING</option>
<option value="DESC">JGLOBAL_ORDER_DESCENDING</option>
</field>
<field
name="all_tags_show_tag_image"
type="radio"
label="COM_TAGS_SHOW_ITEM_IMAGE_LABEL"
description="COM_TAGS_SHOW_ITEM_IMAGE_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="all_tags_show_tag_description"
type="radio"
label="COM_TAGS_SHOW_ITEM_DESCRIPTION_LABEL"
description="COM_TAGS_SHOW_ITEM_DESCRIPTION_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="all_tags_tag_maximum_characters"
type="number"
label="COM_TAGS_LIST_MAX_CHARACTERS_LABEL"
description="COM_TAGS_LIST_MAX_CHARACTERS_DESC"
filter="integer"
showon="all_tags_show_tag_description:1"
/>
<field
name="all_tags_show_tag_hits"
type="radio"
label="JGLOBAL_HITS"
description="COM_TAGS_FIELD_CONFIG_HITS_DESC"
class="btn-group btn-group-yesno"
default="0"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
</fieldset>
<fieldset
name="shared"
label="COM_TAGS_CONFIG_SHARED_SETTINGS_LABEL"
description="COM_TAGS_CONFIG_SHARED_SETTINGS_DESC">
<field
name="filter_field"
type="radio"
label="JGLOBAL_FILTER_FIELD_LABEL"
description="JGLOBAL_FILTER_FIELD_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_pagination_limit"
type="radio"
label="JGLOBAL_DISPLAY_SELECT_LABEL"
description="JGLOBAL_DISPLAY_SELECT_DESC"
default="1"
class="btn-group btn-group-yesno"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_pagination"
type="list"
label="JGLOBAL_PAGINATION_LABEL"
description="JGLOBAL_PAGINATION_DESC"
default="2"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
<option value="2">JGLOBAL_AUTO</option>
</field>
<field
name="show_pagination_results"
type="radio"
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
description="JGLOBAL_PAGINATION_RESULTS_DESC"
class="btn-group btn-group-yesno"
default="1"
showon="show_pagination:1,2"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
</fieldset>
<fieldset
name="data_entry"
label="COM_TAGS_CONFIG_DATA_ENTRY_SETTINGS_LABEL"
description="COM_TAGS_CONFIG_DATA_ENTRY_SETTINGS_DESC">
<field
name="tag_field_ajax_mode"
type="radio"
label="COM_TAGS_TAG_FIELD_MODE_LABEL"
description="COM_TAGS_TAG_FIELD_MODE_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option value="1">COM_TAGS_TAG_FIELD_MODE_AJAX</option>
<option value="0">COM_TAGS_TAG_FIELD_MODE_NESTED</option>
</field>
</fieldset>
<fieldset
name="integration"
label="JGLOBAL_INTEGRATION_LABEL"
description="COM_TAGS_CONFIG_INTEGRATION_SETTINGS_DESC"
>
<field
name="integration_newsfeeds"
type="note"
label="JGLOBAL_FEED_TITLE"
/>
<field
name="show_feed_link"
type="radio"
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
description="JGLOBAL_SHOW_FEED_LINK_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
</fieldset>
<fieldset
name="permissions"
label="JCONFIG_PERMISSIONS_LABEL"
description="JCONFIG_PERMISSIONS_DESC"
>
<field
name="rules"
type="rules"
label="JCONFIG_PERMISSIONS_LABEL"
filter="rules"
validate="rules"
component="com_tags"
section="component"
/>
</fieldset>
</config>
PK �|!]=�ӻ� � tags.phpnu &1i� <?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
*/
defined('_JEXEC') or die;
JLoader::register('TagsHelperRoute', JPATH_COMPONENT . '/helpers/route.php');
$controller = JControllerLegacy::getInstance('Tags');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
PK �|!]�C% tables/tag.phpnu &1i� <?php
/**
* @package Joomla.Administrator
* @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
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
/**
* Tags table
*
* @since 3.1
*/
class TagsTableTag extends JTableNested
{
/**
* Constructor
*
* @param JDatabaseDriver $db A database connector object
*/
public function __construct($db)
{
parent::__construct('#__tags', 'id', $db);
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_tags.tag'));
}
/**
* Overloaded bind function
*
* @param array $array Named array
* @param mixed $ignore An optional array or space separated list of properties
* to ignore while binding.
*
* @return mixed Null if operation was satisfactory, otherwise returns an error string
*
* @see JTable::bind
* @since 3.1
*/
public function bind($array, $ignore = '')
{
if (isset($array['params']) && is_array($array['params']))
{
$registry = new Registry($array['params']);
$array['params'] = (string) $registry;
}
if (isset($array['metadata']) && is_array($array['metadata']))
{
$registry = new Registry($array['metadata']);
$array['metadata'] = (string) $registry;
}
if (isset($array['urls']) && is_array($array['urls']))
{
$registry = new Registry($array['urls']);
$array['urls'] = (string) $registry;
}
if (isset($array['images']) && is_array($array['images']))
{
$registry = new Registry($array['images']);
$array['images'] = (string) $registry;
}
return parent::bind($array, $ignore);
}
/**
* Overloaded check method to ensure data integrity.
*
* @return boolean True on success.
*
* @since 3.1
* @throws UnexpectedValueException
*/
public function check()
{
// Check for valid name.
if (trim($this->title) == '')
{
throw new UnexpectedValueException(sprintf('The title is empty'));
}
if (empty($this->alias))
{
$this->alias = $this->title;
}
$this->alias = JApplicationHelper::stringURLSafe($this->alias, $this->language);
if (trim(str_replace('-', '', $this->alias)) == '')
{
$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');
}
// Check the publish down date is not earlier than publish up.
if ((int) $this->publish_down > 0 && $this->publish_down < $this->publish_up)
{
throw new UnexpectedValueException(sprintf('End publish date is before start publish date.'));
}
// Clean up keywords -- eliminate extra spaces between phrases
// and cr (\r) and lf (\n) characters from string
if (!empty($this->metakey))
{
// Only process if not empty
// Define array of characters to remove
$bad_characters = array("\n", "\r", "\"", '<', '>');
// Remove bad characters
$after_clean = StringHelper::str_ireplace($bad_characters, '', $this->metakey);
// Create array using commas as delimiter
$keys = explode(',', $after_clean);
$clean_keys = array();
foreach ($keys as $key)
{
if (trim($key))
{
// Ignore blank keywords
$clean_keys[] = trim($key);
}
}
// Put array back together delimited by ", "
$this->metakey = implode(', ', $clean_keys);
}
// Clean up description -- eliminate quotes and <> brackets
if (!empty($this->metadesc))
{
// Only process if not empty
$bad_characters = array("\"", '<', '>');
$this->metadesc = StringHelper::str_ireplace($bad_characters, '', $this->metadesc);
}
// Not Null sanity check
$date = JFactory::getDate();
if (empty($this->params))
{
$this->params = '{}';
}
if (empty($this->metadesc))
{
$this->metadesc = '';
}
if (empty($this->metakey))
{
$this->metakey = '';
}
if (empty($this->metadata))
{
$this->metadata = '{}';
}
if (empty($this->urls))
{
$this->urls = '{}';
}
if (empty($this->images))
{
$this->images = '{}';
}
if (!(int) $this->checked_out_time)
{
$this->checked_out_time = $date->toSql();
}
if (!(int) $this->modified_time)
{
$this->modified_time = $date->toSql();
}
if (!(int) $this->modified_time)
{
$this->modified_time = $date->toSql();
}
if (!(int) $this->publish_up)
{
$this->publish_up = $date->toSql();
}
if (!(int) $this->publish_down)
{
$this->publish_down = $date->toSql();
}
return true;
}
/**
* Overriden JTable::store to set modified data and user id.
*
* @param boolean $updateNulls True to update fields even if they are null.
*
* @return boolean True on success.
*
* @since 3.1
*/
public function store($updateNulls = false)
{
$date = JFactory::getDate();
$user = JFactory::getUser();
$this->modified_time = $date->toSql();
if ($this->id)
{
// Existing item
$this->modified_user_id = $user->get('id');
}
else
{
// New tag. A tag created and created_by field can be set by the user,
// so we don't touch either of these if they are set.
if (!(int) $this->created_time)
{
$this->created_time = $date->toSql();
}
if (empty($this->created_user_id))
{
$this->created_user_id = $user->get('id');
}
}
// Verify that the alias is unique
$table = JTable::getInstance('Tag', 'TagsTable', array('dbo' => $this->_db));
if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
{
$this->setError(JText::_('COM_TAGS_ERROR_UNIQUE_ALIAS'));
return false;
}
return parent::store($updateNulls);
}
/**
* Method to delete a node and, optionally, its child nodes from the table.
*
* @param integer $pk The primary key of the node to delete.
* @param boolean $children True to delete child nodes, false to move them up a level.
*
* @return boolean True on success.
*
* @since 3.1
*/
public function delete($pk = null, $children = false)
{
$return = parent::delete($pk, $children);
if ($return)
{
$helper = new JHelperTags;
$helper->tagDeleteInstances($pk);
}
return $return;
}
}
PK �|!]��1�y y controller.phpnu &1i� <?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
*/
defined('_JEXEC') or die;
/**
* Tags Component Controller
*
* @since 3.1
*/
class TagsController extends JControllerLegacy
{
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param mixed|boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JControllerLegacy This object to support chaining.
*
* @since 3.1
*/
public function display($cachable = false, $urlparams = false)
{
$user = JFactory::getUser();
// Set the default view name and format from the Request.
$vName = $this->input->get('view', 'tags');
$this->input->set('view', $vName);
if ($user->get('id') || ($this->input->getMethod() === 'POST' && $vName === 'tags'))
{
$cachable = false;
}
$safeurlparams = array(
'id' => 'ARRAY',
'type' => 'ARRAY',
'limit' => 'UINT',
'limitstart' => 'UINT',
'filter_order' => 'CMD',
'filter_order_Dir' => 'CMD',
'lang' => 'CMD'
);
return parent::display($cachable, $safeurlparams);
}
}
PK �|!]�L��
�
models/forms/filter_tags.xmlnu &1i� <?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="filter">
<field
name="search"
type="text"
inputmode="search"
label="COM_TAGS_FILTER_SEARCH_LABEL"
description="COM_TAGS_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
/>
<field
name="published"
type="status"
label="COM_TAGS_FILTER_PUBLISHED"
description="COM_TAGS_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
</field>
<field
name="access"
type="accesslevel"
label="JOPTION_FILTER_ACCESS"
description="JOPTION_FILTER_ACCESS_DESC"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_ACCESS</option>
</field>
<field
name="language"
type="contentlanguage"
label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>
<field
name="level"
type="integer"
label="JOPTION_FILTER_LEVEL"
description="JOPTION_FILTER_LEVEL_DESC"
first="1"
last="10"
step="1"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_MAX_LEVELS</option>
</field>
<field
name="extension"
type="aliastag"
label="COM_TAGS_FILTER_ALIASTYPE_LABEL"
description="COM_TAGS_FIELD_ALIASTYPE_DESC"
onchange="this.form.submit();"
>
<option value="">COM_TAGS_SELECT_TAGTYPE</option>
</field>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="COM_TAGS_LIST_FULL_ORDERING"
description="COM_TAGS_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();"
default="a.lft ASC"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.lft ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.lft DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.published ASC">JSTATUS_ASC</option>
<option value="a.published DESC">JSTATUS_DESC</option>
<option value="a.title ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title DESC">JGLOBAL_TITLE_DESC</option>
<option value="a.access ASC">JGRID_HEADING_ACCESS_ASC</option>
<option value="a.access DESC">JGRID_HEADING_ACCESS_DESC</option>
<option value="a.language ASC">JGRID_HEADING_LANGUAGE_ASC</option>
<option value="a.language DESC">JGRID_HEADING_LANGUAGE_DESC</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field
name="limit"
type="limitbox"
label="COM_TAGS_LIST_LIMIT"
description="COM_TAGS_LIST_LIMIT_DESC"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>
PK �|!]��.� � models/forms/tag.xmlnu &1i� <?xml version="1.0" encoding="utf-8"?>
<form>
<field
name="id"
type="number"
label="JGLOBAL_FIELD_ID_LABEL"
description="JGLOBAL_FIELD_ID_DESC"
default="0"
class="readonly"
readonly="true"
/>
<field
name="hits"
type="number"
label="JGLOBAL_HITS"
description="COM_TAGS_FIELD_HITS_DESC"
class="readonly"
default="0"
readonly="true"
filter="unset"
/>
<field
name="parent_id"
type="tag"
label="COM_TAGS_FIELD_PARENT_LABEL"
description="COM_TAGS_FIELD_PARENT_DESC"
mode="nested"
validate="notequals"
field="id"
parent="parent"
>
<option value="1">JNONE</option>
</field>
<field
name="lft"
type="hidden"
filter="unset"
/>
<field
name="rgt"
type="hidden"
filter="unset"
/>
<field
name="level"
type="hidden"
filter="unset"
/>
<field
name="path"
type="text"
label="CATEGORIES_PATH_LABEL"
description="CATEGORIES_PATH_DESC"
class="readonly"
size="40"
readonly="true"
/>
<field
name="title"
type="text"
label="JGLOBAL_TITLE"
description="JFIELD_TITLE_DESC"
class="input-xxlarge input-large-text"
size="40"
required="true"
/>
<field
name="note"
type="text"
label="COM_TAGS_FIELD_NOTE_LABEL"
description="COM_TAGS_FIELD_NOTE_DESC"
maxlength="255"
class="span12"
size="40"
/>
<field
name="description"
type="editor"
label="JGLOBAL_DESCRIPTION"
description="COM_TAGS_DESCRIPTION_DESC"
filter="JComponentHelper::filterText"
buttons="true"
hide="readmore,pagebreak"
/>
<field
name="published"
type="list"
label="JSTATUS"
description="JFIELD_PUBLISHED_DESC"
class="chzn-color-state"
default="1"
size="1"
>
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
<option value="2">JARCHIVED</option>
<option value="-2">JTRASHED</option>
</field>
<field
name="checked_out"
type="hidden"
filter="unset"
/>
<field
name="checked_out_time"
type="hidden"
filter="unset"
/>
<field
name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
/>
<field
name="metadesc"
type="textarea"
label="JFIELD_META_DESCRIPTION_LABEL"
description="JFIELD_META_DESCRIPTION_DESC"
rows="3"
cols="40"
/>
<field
name="metakey"
type="textarea"
label="JFIELD_META_KEYWORDS_LABEL"
description="JFIELD_META_KEYWORDS_DESC"
rows="3"
cols="40"
/>
<field
name="alias"
type="text"
label="JFIELD_ALIAS_LABEL"
description="JFIELD_ALIAS_DESC"
hint="JFIELD_ALIAS_PLACEHOLDER"
size="40"
/>
<field
name="created_user_id"
type="user"
label="JGLOBAL_FIELD_CREATED_BY_LABEL"
description="JGLOBAL_FIELD_CREATED_BY_DESC"
/>
<field
name="created_by_alias"
type="text"
label="JGLOBAL_FIELD_CREATED_BY_ALIAS_LABEL"
description="JGLOBAL_FIELD_CREATED_BY_ALIAS_DESC"
labelclass="control-label"
size="20"
/>
<field
name="created_time"
type="calendar"
label="JGLOBAL_CREATED_DATE"
description="COM_TAGS_FIELD_CREATED_DATE_DESC"
class="readonly"
translateformat="true"
showtime="true"
filter="user_utc"
readonly="true"
/>
<field
name="modified_user_id"
type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
class="readonly"
readonly="true"
filter="unset"
/>
<field
name="modified_time"
type="calendar"
label="JGLOBAL_FIELD_MODIFIED_LABEL"
description="COM_TAGS_FIELD_MODIFIED_DESC"
class="readonly"
translateformat="true"
showtime="true"
filter="user_utc"
readonly="true"
/>
<field
name="language"
type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_TAGS_FIELD_LANGUAGE_DESC"
>
<option value="*">JALL</option>
</field>
<field
name="version_note"
type="text"
label="JGLOBAL_FIELD_VERSION_NOTE_LABEL"
description="JGLOBAL_FIELD_VERSION_NOTE_DESC"
maxlength="255"
class="span12" size="45"
labelclass="control-label"
/>
<fields name="params" label="JGLOBAL_FIELDSET_DISPLAY_OPTIONS">
<fieldset
name="basic"
label="COM_TAGS_BASIC_FIELDSET_LABEL"
>
<field
name="tag_layout"
type="componentlayout"
label="JFIELD_ALT_LAYOUT_LABEL"
description="JFIELD_ALT_COMPONENT_LAYOUT_DESC"
labelclass="control-label"
useglobal="true"
extension="com_tags"
view="tag"
/>
<field
name="tag_link_class"
type="text"
label="COM_TAGS_FIELD_TAG_LINK_CLASS"
description="COM_TAGS_FIELD_TAG_LINK_CLASS_DESC"
labelclass="control-label"
size="20"
default="label label-info"
/>
</fieldset>
</fields>
<fields name="images">
<fieldset name="images" label="JGLOBAL_FIELDSET_IMAGE_OPTIONS">
<field
name="image_intro"
type="media"
label="COM_TAGS_FIELD_INTRO_LABEL"
description="COM_TAGS_FIELD_INTRO_DESC"
labelclass="control-label"
/>
<field
name="float_intro"
type="list"
label="COM_TAGS_FLOAT_LABEL"
description="COM_TAGS_FLOAT_DESC"
labelclass="control-label"
>
<option value="">JGLOBAL_SELECT_AN_OPTION</option>
<option value="right">COM_TAGS_RIGHT</option>
<option value="left">COM_TAGS_LEFT</option>
<option value="none">COM_TAGS_NONE</option>
</field>
<field
name="image_intro_alt"
type="text"
label="COM_TAGS_FIELD_IMAGE_ALT_LABEL"
description="COM_TAGS_FIELD_IMAGE_ALT_DESC"
labelclass="control-label"
size="20"
/>
<field
name="image_intro_caption"
type="text"
label="COM_TAGS_FIELD_IMAGE_CAPTION_LABEL"
description="COM_TAGS_FIELD_IMAGE_CAPTION_DESC"
size="20"
labelclass="control-label"
/>
<field
name="spacer1"
type="spacer"
hr="true"
/>
<field
name="image_fulltext"
type="media"
label="COM_TAGS_FIELD_FULL_LABEL"
description="COM_TAGS_FIELD_FULL_DESC"
labelclass="control-label"
/>
<field
name="float_fulltext"
type="list"
label="COM_TAGS_FLOAT_LABEL"
description="COM_TAGS_FLOAT_DESC"
labelclass="control-label"
>
<option value="">JGLOBAL_SELECT_AN_OPTION</option>
<option value="right">COM_TAGS_RIGHT</option>
<option value="left">COM_TAGS_LEFT</option>
<option value="none">COM_TAGS_NONE</option>
</field>
<field
name="image_fulltext_alt"
type="text"
label="COM_TAGS_FIELD_IMAGE_ALT_LABEL"
description="COM_TAGS_FIELD_IMAGE_ALT_DESC"
labelclass="control-label"
size="20"
/>
<field
name="image_fulltext_caption"
type="text"
label="COM_TAGS_FIELD_IMAGE_CAPTION_LABEL"
description="COM_TAGS_FIELD_IMAGE_CAPTION_DESC"
labelclass="control-label"
size="20"
/>
</fieldset>
</fields>
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="jmetadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<field
name="author"
type="text"
label="JAUTHOR"
description="JFIELD_METADATA_AUTHOR_DESC"
size="30"
/>
<field
name="robots"
type="list"
label="JFIELD_METADATA_ROBOTS_LABEL"
description="JFIELD_METADATA_ROBOTS_DESC"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="index, follow"></option>
<option value="noindex, follow"></option>
<option value="index, nofollow"></option>
<option value="noindex, nofollow"></option>
</field>
</fieldset>
</fields>
</form>
PK �|!]�Ϙ# # models/tag.phpnu &1i� <?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
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
/**
* Tags Component Tag Model
*
* @since 3.1
*/
class TagsModelTag extends JModelList
{
/**
* The tags that apply.
*
* @var object
* @since 3.1
*/
protected $tag = null;
/**
* The list of items associated with the tags.
*
* @var array
* @since 3.1
*/
protected $items = null;
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @see JController
* @since 3.1
*/
public function __construct($config = array())
{
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'core_content_id', 'c.core_content_id',
'core_title', 'c.core_title',
'core_type_alias', 'c.core_type_alias',
'core_checked_out_user_id', 'c.core_checked_out_user_id',
'core_checked_out_time', 'c.core_checked_out_time',
'core_catid', 'c.core_catid',
'core_state', 'c.core_state',
'core_access', 'c.core_access',
'core_created_user_id', 'c.core_created_user_id',
'core_created_time', 'c.core_created_time',
'core_modified_time', 'c.core_modified_time',
'core_ordering', 'c.core_ordering',
'core_featured', 'c.core_featured',
'core_language', 'c.core_language',
'core_hits', 'c.core_hits',
'core_publish_up', 'c.core_publish_up',
'core_publish_down', 'c.core_publish_down',
'core_images', 'c.core_images',
'core_urls', 'c.core_urls',
'match_count',
);
}
parent::__construct($config);
}
/**
* Method to get a list of items for a list of tags.
*
* @return mixed An array of objects on success, false on failure.
*
* @since 3.1
*/
public function getItems()
{
// Invoke the parent getItems method to get the main list
$items = parent::getItems();
if (!empty($items))
{
foreach ($items as $item)
{
$item->link = TagsHelperRoute::getItemRoute(
$item->content_item_id,
$item->core_alias,
$item->core_catid,
$item->core_language,
$item->type_alias,
$item->router
);
// Get display date
switch ($this->state->params->get('tag_list_show_date'))
{
case 'modified':
$item->displayDate = $item->core_modified_time;
break;
case 'created':
$item->displayDate = $item->core_created_time;
break;
default:
case 'published':
$item->displayDate = ($item->core_publish_up == 0) ? $item->core_created_time : $item->core_publish_up;
break;
}
}
}
return $items;
}
/**
* Method to build an SQL query to load the list data of all items with a given tag.
*
* @return string An SQL query
*
* @since 3.1
*/
protected function getListQuery()
{
$tagId = $this->getState('tag.id') ? : '';
$typesr = $this->getState('tag.typesr');
$orderByOption = $this->getState('list.ordering', 'c.core_title');
$includeChildren = $this->state->params->get('include_children', 0);
$orderDir = $this->getState('list.direction', 'ASC');
$matchAll = $this->getState('params')->get('return_any_or_all', 1);
$language = $this->getState('tag.language');
$stateFilter = $this->getState('tag.state');
// Optionally filter on language
if (empty($language))
{
$language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all');
}
$tagsHelper = new JHelperTags;
$query = $tagsHelper->getTagItemsQuery($tagId, $typesr, $includeChildren, $orderByOption, $orderDir, $matchAll, $language, $stateFilter);
if ($this->state->get('list.filter'))
{
$query->where($this->_db->quoteName('c.core_title') . ' LIKE ' . $this->_db->quote('%' . $this->state->get('list.filter') . '%'));
}
return $query;
}
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
*
* @return void
*
* @since 3.1
*/
protected function populateState($ordering = 'c.core_title', $direction = 'ASC')
{
$app = JFactory::getApplication();
// Load the parameters.
$params = $app->isClient('administrator') ? JComponentHelper::getParams('com_tags') : $app->getParams();
$this->setState('params', $params);
// Load state from the request.
$ids = (array) $app->input->get('id', array(), 'string');
if (count($ids) == 1)
{
$ids = explode(',', $ids[0]);
}
$ids = ArrayHelper::toInteger($ids);
// Remove zero values resulting from bad input
$ids = array_filter($ids);
$pkString = implode(',', $ids);
$this->setState('tag.id', $pkString);
// Get the selected list of types from the request. If none are specified all are used.
$typesr = $app->input->get('types', array(), 'array');
if ($typesr)
{
// Implode is needed because the array can contain a string with a coma separated list of ids
$typesr = implode(',', $typesr);
// Sanitise
$typesr = explode(',', $typesr);
$typesr = ArrayHelper::toInteger($typesr);
$this->setState('tag.typesr', $typesr);
}
$language = $app->input->getString('tag_list_language_filter');
$this->setState('tag.language', $language);
// List state information
$format = $app->input->getWord('format');
if ($format === 'feed')
{
$limit = $app->get('feed_limit');
}
else
{
$limit = $params->get('display_num', $app->get('list_limit', 20));
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $limit, 'uint');
}
$this->setState('list.limit', $limit);
$offset = $app->input->get('limitstart', 0, 'uint');
$this->setState('list.start', $offset);
$itemid = $pkString . ':' . $app->input->get('Itemid', 0, 'int');
$orderCol = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_order', 'filter_order', '', 'string');
$orderCol = !$orderCol ? $this->state->params->get('tag_list_orderby', 'c.core_title') : $orderCol;
if (!in_array($orderCol, $this->filter_fields))
{
$orderCol = 'c.core_title';
}
$this->setState('list.ordering', $orderCol);
$listOrder = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_order_direction', 'filter_order_Dir', '', 'string');
$listOrder = !$listOrder ? $this->state->params->get('tag_list_orderby_direction', 'ASC') : $listOrder;
if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', '')))
{
$listOrder = 'ASC';
}
$this->setState('list.direction', $listOrder);
$this->setState('tag.state', 1);
// Optional filter text
$filterSearch = $app->getUserStateFromRequest('com_tags.tag.list.' . $itemid . '.filter_search', 'filter-search', '', 'string');
$this->setState('list.filter', $filterSearch);
}
/**
* Method to get tag data for the current tag or tags
*
* @param integer $pk An optional ID
*
* @return object
*
* @since 3.1
*/
public function getItem($pk = null)
{
if (!isset($this->item))
{
$this->item = false;
if (empty($pk))
{
$pk = $this->getState('tag.id');
}
// Get a level row instance.
$table = JTable::getInstance('Tag', 'TagsTable');
$idsArray = explode(',', $pk);
// Attempt to load the rows into an array.
foreach ($idsArray as $id)
{
try
{
$table->load($id);
// Check published state.
if ($published = $this->getState('tag.state'))
{
if ($table->published != $published)
{
continue;
}
}
if (!in_array($table->access, JFactory::getUser()->getAuthorisedViewLevels()))
{
continue;
}
// Convert the JTable to a clean JObject.
$properties = $table->getProperties(1);
$this->item[] = ArrayHelper::toObject($properties, 'JObject');
}
catch (RuntimeException $e)
{
$this->setError($e->getMessage());
return false;
}
}
}
if (!$this->item)
{
return JError::raiseError(404, JText::_('COM_TAGS_TAG_NOT_FOUND'));
}
return $this->item;
}
/**
* Increment the hit counter.
*
* @param integer $pk Optional primary key of the article to increment.
*
* @return boolean True if successful; false otherwise and internal error set.
*
* @since 3.2
*/
public function hit($pk = 0)
{
$input = JFactory::getApplication()->input;
$hitcount = $input->getInt('hitcount', 1);
if ($hitcount)
{
$pk = (!empty($pk)) ? $pk : (int) $this->getState('tag.id');
$table = JTable::getInstance('Tag', 'TagsTable');
$table->hit($pk);
// Load the table data for later
$table->load($pk);
if (!$table->hasPrimaryKey())
{
JError::raiseError(404, JText::_('COM_TAGS_TAG_NOT_FOUND'));
}
}
return true;
}
}
PK �|!]A�p�� � models/tags.phpnu &1i� <?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
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
/**
* This models supports retrieving a list of tags.
*
* @since 3.1
*/
class TagsModelTags extends JModelList
{
/**
* Model context string.
*
* @var string
* @since 3.1
*/
public $_context = 'com_tags.tags';
/**
* Method to auto-populate the model state.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
*
* @return void
*
* @note Calling getState in this method will result in recursion.
*
* @since 3.1
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication('site');
// Load state from the request.
$pid = $app->input->getInt('parent_id');
$this->setState('tag.parent_id', $pid);
$language = $app->input->getString('tag_list_language_filter');
$this->setState('tag.language', $language);
$offset = $app->input->get('limitstart', 0, 'uint');
$this->setState('list.offset', $offset);
$app = JFactory::getApplication();
$params = $app->getParams();
$this->setState('params', $params);
$this->setState('list.limit', $params->get('maximum', 200));
$this->setState('filter.published', 1);
$this->setState('filter.access', true);
$user = JFactory::getUser();
if ((!$user->authorise('core.edit.state', 'com_tags')) && (!$user->authorise('core.edit', 'com_tags')))
{
$this->setState('filter.published', 1);
}
// Optional filter text
$itemid = $pid . ':' . $app->input->getInt('Itemid', 0);
$filterSearch = $app->getUserStateFromRequest('com_tags.tags.list.' . $itemid . '.filter_search', 'filter-search', '', 'string');
$this->setState('list.filter', $filterSearch);
}
/**
* Method to build an SQL query to load the list data.
*
* @return string An SQL query
*
* @since 1.6
*/
protected function getListQuery()
{
$app = JFactory::getApplication('site');
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
$pid = $this->getState('tag.parent_id');
$orderby = $this->state->params->get('all_tags_orderby', 'title');
$published = $this->state->params->get('published', 1);
$orderDirection = $this->state->params->get('all_tags_orderby_direction', 'ASC');
$language = $this->getState('tag.language');
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select required fields from the tags.
$query->select('a.*, u.name as created_by_user_name, u.email')
->from($db->quoteName('#__tags') . ' AS a')
->join('LEFT', '#__users AS u ON a.created_user_id = u.id')
->where($db->quoteName('a.access') . ' IN (' . $groups . ')');
if (!empty($pid))
{
$query->where($db->quoteName('a.parent_id') . ' = ' . $pid);
}
// Exclude the root.
$query->where($db->quoteName('a.parent_id') . ' <> 0');
// Optionally filter on language
if (empty($language))
{
$language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all');
}
if ($language !== 'all')
{
if ($language === 'current_language')
{
$language = JHelperContent::getCurrentLanguage();
}
$query->where($db->quoteName('language') . ' IN (' . $db->quote($language) . ', ' . $db->quote('*') . ')');
}
// List state information
$format = $app->input->getWord('format');
if ($format === 'feed')
{
$limit = $app->get('feed_limit');
}
else
{
if ($this->state->params->get('show_pagination_limit'))
{
$limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->get('list_limit'), 'uint');
}
else
{
$limit = $this->state->params->get('maximum', 20);
}
}
$this->setState('list.limit', $limit);
$offset = $app->input->get('limitstart', 0, 'uint');
$this->setState('list.start', $offset);
// Optionally filter on entered value
if ($this->state->get('list.filter'))
{
$query->where($db->quoteName('a.title') . ' LIKE ' . $db->quote('%' . $this->state->get('list.filter') . '%'));
}
$query->where($db->quoteName('a.published') . ' = ' . $published);
$query->order($db->quoteName($orderby) . ' ' . $orderDirection . ', a.title ASC');
return $query;
}
}
PK �|!]gg�&} } &