| Current Path : /home/w/u/e/wuectly/www/03cbe/ |
| Current File : /home/w/u/e/wuectly/www/03cbe/com_content.tar |
content.php 0000604 00000001235 15245530277 0006736 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright (C) 2008 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.tabstate');
if (!JFactory::getUser()->authorise('core.manage', 'com_content'))
{
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
}
JLoader::register('ContentHelper', __DIR__ . '/helpers/content.php');
$controller = JControllerLegacy::getInstance('Content');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
models/archive.php 0000604 00000013044 15245530277 0010171 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 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;
JLoader::register('ContentModelArticles', __DIR__ . '/articles.php');
/**
* Content Component Archive Model
*
* @since 1.5
*/
class ContentModelArchive extends ContentModelArticles
{
/**
* Model context string.
*
* @var string
*/
public $_context = 'com_content.archive';
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering The field to order on.
* @param string $direction The direction to order on.
*
* @return void
*
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
parent::populateState();
$app = JFactory::getApplication();
// Add archive properties
$params = $this->state->params;
// Filter on archived articles
$this->setState('filter.published', 2);
// Filter on month, year
$this->setState('filter.month', $app->input->getInt('month'));
$this->setState('filter.year', $app->input->getInt('year'));
// Optional filter text
$this->setState('list.filter', $app->input->getString('filter-search'));
// Get list limit
$itemid = $app->input->get('Itemid', 0, 'int');
$limit = $app->getUserStateFromRequest('com_content.archive.list' . $itemid . '.limit', 'limit', $params->get('display_num'), 'uint');
$this->setState('list.limit', $limit);
// Set the archive ordering
$articleOrderby = $params->get('orderby_sec', 'rdate');
$articleOrderDate = $params->get('order_date');
// No category ordering
$secondary = ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate);
$this->setState('list.ordering', $secondary . ', a.created DESC');
$this->setState('list.direction', '');
}
/**
* Get the master query for retrieving a list of articles subject to the model state.
*
* @return JDatabaseQuery
*
* @since 1.6
*/
protected function getListQuery()
{
$params = $this->state->params;
$app = JFactory::getApplication('site');
$catids = ArrayHelper::toInteger($app->input->get('catid', array(), 'array'));
$catids = array_values(array_diff($catids, array(0)));
$articleOrderDate = $params->get('order_date');
// Create a new query object.
$query = parent::getListQuery();
// Add routing for archive
// Sqlsrv changes
$case_when = ' CASE WHEN ';
$case_when .= $query->charLength('a.alias', '!=', '0');
$case_when .= ' THEN ';
$a_id = $query->castAsChar('a.id');
$case_when .= $query->concatenate(array($a_id, 'a.alias'), ':');
$case_when .= ' ELSE ';
$case_when .= $a_id . ' END as slug';
$query->select($case_when);
$case_when = ' CASE WHEN ';
$case_when .= $query->charLength('c.alias', '!=', '0');
$case_when .= ' THEN ';
$c_id = $query->castAsChar('c.id');
$case_when .= $query->concatenate(array($c_id, 'c.alias'), ':');
$case_when .= ' ELSE ';
$case_when .= $c_id . ' END as catslug';
$query->select($case_when);
// Filter on month, year
// First, get the date field
$queryDate = ContentHelperQuery::getQueryDate($articleOrderDate);
if ($month = $this->getState('filter.month'))
{
$query->where($query->month($queryDate) . ' = ' . $month);
}
if ($year = $this->getState('filter.year'))
{
$query->where($query->year($queryDate) . ' = ' . $year);
}
if (count($catids) > 0)
{
$query->where('c.id IN (' . implode(', ', $catids) . ')');
}
return $query;
}
/**
* Method to get the archived article list
*
* @access public
* @return array
*/
public function getData()
{
$app = JFactory::getApplication();
// Lets load the content if it doesn't already exist
if (empty($this->_data))
{
// Get the page/component configuration
$params = $app->getParams();
// Get the pagination request variables
$limit = $app->input->get('limit', $params->get('display_num', 20), 'uint');
$limitstart = $app->input->get('limitstart', 0, 'uint');
$query = $this->_buildQuery();
$this->_data = $this->_getList($query, $limitstart, $limit);
}
return $this->_data;
}
/**
* JModelLegacy override to add alternating value for $odd
*
* @param string $query The query.
* @param integer $limitstart Offset.
* @param integer $limit The number of records.
*
* @return array An array of results.
*
* @since 3.0.1
* @throws RuntimeException
*/
protected function _getList($query, $limitstart=0, $limit=0)
{
$result = parent::_getList($query, $limitstart, $limit);
$odd = 1;
foreach ($result as $k => $row)
{
$result[$k]->odd = $odd;
$odd = 1 - $odd;
}
return $result;
}
/**
* Gets the archived articles years
*
* @return array
*
* @since 3.6.0
*/
public function getYears()
{
$db = $this->getDbo();
$nullDate = $db->quote($db->getNullDate());
$nowDate = $db->quote(JFactory::getDate()->toSql());
$query = $db->getQuery(true);
$years = $query->year($db->qn('created'));
$query->select('DISTINCT (' . $years . ')')
->from($db->qn('#__content'))
->where($db->qn('state') . '= 2')
->where('(publish_up = ' . $nullDate . ' OR publish_up <= ' . $nowDate . ')')
->where('(publish_down = ' . $nullDate . ' OR publish_down >= ' . $nowDate . ')')
->order('1 ASC');
$db->setQuery($query);
return $db->loadColumn();
}
}
models/article.php 0000604 00000060526 15245530277 0010202 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright (C) 2008 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\Utilities\ArrayHelper;
JLoader::register('ContentHelper', JPATH_ADMINISTRATOR . '/components/com_content/helpers/content.php');
/**
* Item Model for an Article.
*
* @since 1.6
*/
class ContentModelArticle extends JModelAdmin
{
/**
* The prefix to use with controller messages.
*
* @var string
* @since 1.6
*/
protected $text_prefix = 'COM_CONTENT';
/**
* The type alias for this content type (for example, 'com_content.article').
*
* @var string
* @since 3.2
*/
public $typeAlias = 'com_content.article';
/**
* The context used for the associations table
*
* @var string
* @since 3.4.4
*/
protected $associationsContext = 'com_content.item';
/**
* Function that can be overridden to do any data cleanup after batch copying data
*
* @param \JTableInterface $table The table object containing the newly created item
* @param integer $newId The id of the new item
* @param integer $oldId The original item id
*
* @return void
*
* @since 3.8.12
*/
protected function cleanupPostBatchCopy(\JTableInterface $table, $newId, $oldId)
{
// Check if the article was featured and update the #__content_frontpage table
if ($table->featured == 1)
{
$db = $this->getDbo();
$query = $db->getQuery(true)
->insert($db->quoteName('#__content_frontpage'))
->values($newId . ', 0');
$db->setQuery($query);
$db->execute();
}
// Register FieldsHelper
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
$oldItem = $this->getTable();
$oldItem->load($oldId);
$fields = FieldsHelper::getFields('com_content.article', $oldItem, true);
$fieldsData = array();
if (!empty($fields))
{
$fieldsData['com_fields'] = array();
foreach ($fields as $field)
{
$fieldsData['com_fields'][$field->name] = $field->rawvalue;
}
}
JEventDispatcher::getInstance()->trigger('onContentAfterSave', array('com_content.article', &$this->table, true, $fieldsData));
}
/**
* Batch move categories to a new category.
*
* @param integer $value The new category ID.
* @param array $pks An array of row IDs.
* @param array $contexts An array of item contexts.
*
* @return boolean True on success.
*
* @since 3.8.6
*/
protected function batchMove($value, $pks, $contexts)
{
if (empty($this->batchSet))
{
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
}
$categoryId = (int) $value;
if (!$this->checkCategoryId($categoryId))
{
return false;
}
JPluginHelper::importPlugin('system');
$dispatcher = JEventDispatcher::getInstance();
// Register FieldsHelper
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// Fatal error
$this->setError($error);
return false;
}
else
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
$fields = FieldsHelper::getFields('com_content.article', $this->table, true);
$fieldsData = array();
if (!empty($fields))
{
$fieldsData['com_fields'] = array();
foreach ($fields as $field)
{
$fieldsData['com_fields'][$field->name] = $field->rawvalue;
}
}
// Set the new category ID
$this->table->catid = $categoryId;
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
return false;
}
if (!empty($this->type))
{
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
return false;
}
// Run event for moved article
$dispatcher->trigger('onContentAfterSave', array('com_content.article', &$this->table, false, $fieldsData));
}
// Clean the cache
$this->cleanCache();
return true;
}
/**
* Method to test whether a record can be deleted.
*
* @param object $record A record object.
*
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canDelete($record)
{
if (empty($record->id) || $record->state != -2)
{
return false;
}
return JFactory::getUser()->authorise('core.delete', 'com_content.article.' . (int) $record->id);
}
/**
* Method to test whether a record can have its state edited.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
// Check for existing article.
if (!empty($record->id))
{
return $user->authorise('core.edit.state', 'com_content.article.' . (int) $record->id);
}
// New article, so check against the category.
if (!empty($record->catid))
{
return $user->authorise('core.edit.state', 'com_content.category.' . (int) $record->catid);
}
// Default to component settings if neither article nor category known.
return parent::canEditState($record);
}
/**
* Prepare and sanitise the table data prior to saving.
*
* @param JTable $table A JTable object.
*
* @return void
*
* @since 1.6
*/
protected function prepareTable($table)
{
// Set the publish date to now
if ($table->state == 1 && (int) $table->publish_up == 0)
{
$table->publish_up = JFactory::getDate()->toSql();
}
if ($table->state == 1 && intval($table->publish_down) == 0)
{
$table->publish_down = $this->getDbo()->getNullDate();
}
// Increment the content version number.
$table->version++;
// Reorder the articles within the category so the new article is first
if (empty($table->id))
{
$table->reorder('catid = ' . (int) $table->catid . ' AND state >= 0');
}
}
/**
* Returns a Table object, always creating it.
*
* @param string $type The table type to instantiate
* @param string $prefix A prefix for the table class name. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return JTable A database object
*/
public function getTable($type = 'Content', $prefix = 'JTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
/**
* Method to get a single record.
*
* @param integer $pk The id of the primary key.
*
* @return mixed Object on success, false on failure.
*/
public function getItem($pk = null)
{
if ($item = parent::getItem($pk))
{
// Convert the params field to an array.
$registry = new Registry($item->attribs);
$item->attribs = $registry->toArray();
// Convert the metadata field to an array.
$registry = new Registry($item->metadata);
$item->metadata = $registry->toArray();
// Convert the images field to an array.
$registry = new Registry($item->images);
$item->images = $registry->toArray();
// Convert the urls field to an array.
$registry = new Registry($item->urls);
$item->urls = $registry->toArray();
$item->articletext = trim($item->fulltext) != '' ? $item->introtext . "<hr id=\"system-readmore\" />" . $item->fulltext : $item->introtext;
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_content.article');
}
}
// Load associated content items
$assoc = JLanguageAssociations::isEnabled();
if ($assoc)
{
$item->associations = array();
if ($item->id != null)
{
$associations = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', $item->id);
foreach ($associations as $tag => $association)
{
$item->associations[$tag] = $association->id;
}
}
}
return $item;
}
/**
* Method to get the record form.
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return JForm|boolean A JForm object on success, false on failure
*
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
// Get the form.
$form = $this->loadForm('com_content.article', 'article', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
{
return false;
}
$jinput = JFactory::getApplication()->input;
/*
* The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
* The back end uses id so we use that the rest of the time and set it to 0 by default.
*/
$id = (int) $jinput->get('a_id', $jinput->get('id', 0));
// Determine correct permissions to check.
if ($id = $this->getState('article.id', $id))
{
// Existing record. Can only edit in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.edit');
// Existing record. Can only edit own articles in selected categories.
if ($app->isClient('administrator'))
{
$form->setFieldAttribute('catid', 'action', 'core.edit.own');
}
else
// Existing record. We can't edit the category in frontend if not edit.state.
{
if ($id != 0 && (!$user->authorise('core.edit.state', 'com_content.article.' . (int) $id))
|| ($id == 0 && !$user->authorise('core.edit.state', 'com_content')))
{
$form->setFieldAttribute('catid', 'readonly', 'true');
$form->setFieldAttribute('catid', 'required', 'false');
$form->setFieldAttribute('catid', 'filter', 'unset');
}
}
}
else
{
// New record. Can only create in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.create');
}
// Object uses for checking edit state permission of article
$record = new stdClass;
$record->id = $id;
// Get the category which the article is being added to
if (!empty($data['catid']))
{
$catId = (int) $data['catid'];
}
else
{
$catIds = $form->getValue('catid');
$catId = is_array($catIds)
? (int) reset($catIds)
: (int) $catIds;
if (!$catId)
{
$catId = (int) $form->getFieldAttribute('catid', 'default', 0);
}
}
$record->catid = $catId;
// Modify the form based on Edit State access controls.
if (!$this->canEditState($record))
{
// Disable fields for display.
$form->setFieldAttribute('featured', 'disabled', 'true');
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('publish_up', 'disabled', 'true');
$form->setFieldAttribute('publish_down', 'disabled', 'true');
$form->setFieldAttribute('state', 'disabled', 'true');
// Disable fields while saving.
// The controller has already verified this is an article you can edit.
$form->setFieldAttribute('featured', 'filter', 'unset');
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('publish_up', 'filter', 'unset');
$form->setFieldAttribute('publish_down', 'filter', 'unset');
$form->setFieldAttribute('state', 'filter', 'unset');
}
// Prevent messing with article language and category when editing existing article with associations
$assoc = JLanguageAssociations::isEnabled();
// Check if article is associated
if ($this->getState('article.id') && $app->isClient('site') && $assoc)
{
$associations = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', $id);
// Make fields read only
if (!empty($associations))
{
$form->setFieldAttribute('language', 'readonly', 'true');
$form->setFieldAttribute('catid', 'readonly', 'true');
$form->setFieldAttribute('language', 'filter', 'unset');
$form->setFieldAttribute('catid', 'filter', 'unset');
}
}
return $form;
}
/**
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
*
* @since 1.6
*/
protected function loadFormData()
{
// Check the session for previously entered form data.
$app = JFactory::getApplication();
$data = $app->getUserState('com_content.edit.article.data', array());
if (empty($data))
{
$data = $this->getItem();
// Pre-select some filters (Status, Category, Language, Access) in edit form if those have been selected in Article Manager: Articles
if ($this->getState('article.id') == 0)
{
$filters = (array) $app->getUserState('com_content.articles.filter');
$data->set(
'state',
$app->input->getInt(
'state',
((isset($filters['published']) && $filters['published'] !== '') ? $filters['published'] : null)
)
);
$data->set('catid', $app->input->getInt('catid', (!empty($filters['category_id']) ? $filters['category_id'] : null)));
$data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));
$data->set('access',
$app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))
);
}
}
// If there are params fieldsets in the form it will fail with a registry object
if (isset($data->params) && $data->params instanceof Registry)
{
$data->params = $data->params->toArray();
}
$this->preprocessData('com_content.article', $data);
return $data;
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return array|boolean Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 3.7.0
*/
public function validate($form, $data, $group = null)
{
// Don't allow to change the users if not allowed to access com_users.
if (!JFactory::getUser()->authorise('core.manage', 'com_users'))
{
if (isset($data['created_by']))
{
unset($data['created_by']);
}
}
if (!JFactory::getUser()->authorise('core.admin', 'com_content'))
{
if (isset($data['rules']))
{
unset($data['rules']);
}
}
return parent::validate($form, $data, $group);
}
/**
* Method to save the form data.
*
* @param array $data The form data.
*
* @return boolean True on success.
*
* @since 1.6
*/
public function save($data)
{
$input = JFactory::getApplication()->input;
$filter = JFilterInput::getInstance();
if (isset($data['metadata']) && isset($data['metadata']['author']))
{
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
}
if (isset($data['created_by_alias']))
{
$data['created_by_alias'] = $filter->clean($data['created_by_alias'], 'TRIM');
}
if (isset($data['images']) && is_array($data['images']))
{
$registry = new Registry($data['images']);
$data['images'] = (string) $registry;
}
JLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/categories.php');
// Create new category, if needed.
$createCategory = true;
// If category ID is provided, check if it's valid.
if (is_numeric($data['catid']) && $data['catid'])
{
$createCategory = !CategoriesHelper::validateCategoryId($data['catid'], 'com_content');
}
// Save New Category
if ($createCategory && $this->canCreateCategory())
{
$table = array();
// Remove #new# prefix, if exists.
$table['title'] = strpos($data['catid'], '#new#') === 0 ? substr($data['catid'], 5) : $data['catid'];
$table['parent_id'] = 1;
$table['extension'] = 'com_content';
$table['language'] = $data['language'];
$table['published'] = 1;
// Create new category and get catid back
$data['catid'] = CategoriesHelper::createCategory($table);
}
if (isset($data['urls']) && is_array($data['urls']))
{
$check = $input->post->get('jform', array(), 'array');
foreach ($data['urls'] as $i => $url)
{
if ($url != false && ($i == 'urla' || $i == 'urlb' || $i == 'urlc'))
{
if (preg_match('~^#[a-zA-Z]{1}[a-zA-Z0-9-_:.]*$~', $check['urls'][$i]) == 1)
{
$data['urls'][$i] = $check['urls'][$i];
}
else
{
$data['urls'][$i] = JStringPunycode::urlToPunycode($url);
}
}
}
unset($check);
$registry = new Registry($data['urls']);
$data['urls'] = (string) $registry;
}
// Alter the title for save as copy
if ($input->get('task') == 'save2copy')
{
$origTable = clone $this->getTable();
$origTable->load($input->getInt('id'));
if ($data['title'] == $origTable->title)
{
list($title, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['title']);
$data['title'] = $title;
$data['alias'] = $alias;
}
else
{
if ($data['alias'] == $origTable->alias)
{
$data['alias'] = '';
}
}
$data['state'] = 0;
}
// Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (!isset($data['id']) || (int) $data['id'] == 0))
{
if ($data['alias'] == null)
{
if (JFactory::getConfig()->get('unicodeslugs') == 1)
{
$data['alias'] = JFilterOutput::stringURLUnicodeSlug($data['title']);
}
else
{
$data['alias'] = JFilterOutput::stringURLSafe($data['title']);
}
$table = JTable::getInstance('Content', 'JTable');
if ($table->load(array('alias' => $data['alias'], 'catid' => $data['catid'])))
{
$msg = JText::_('COM_CONTENT_SAVE_WARNING');
}
list($title, $alias) = $this->generateNewTitle($data['catid'], $data['alias'], $data['title']);
$data['alias'] = $alias;
if (isset($msg))
{
JFactory::getApplication()->enqueueMessage($msg, 'warning');
}
}
}
if (parent::save($data))
{
if (isset($data['featured']))
{
$this->featured($this->getState($this->getName() . '.id'), $data['featured']);
}
return true;
}
return false;
}
/**
* Method to toggle the featured setting of articles.
*
* @param array $pks The ids of the items to toggle.
* @param integer $value The value to toggle to.
*
* @return boolean True on success.
*/
public function featured($pks, $value = 0)
{
// Sanitize the ids.
$pks = (array) $pks;
$pks = ArrayHelper::toInteger($pks);
if (empty($pks))
{
$this->setError(JText::_('COM_CONTENT_NO_ITEM_SELECTED'));
return false;
}
$table = $this->getTable('Featured', 'ContentTable');
try
{
$db = $this->getDbo();
$query = $db->getQuery(true)
->update($db->quoteName('#__content'))
->set('featured = ' . (int) $value)
->where('id IN (' . implode(',', $pks) . ')');
$db->setQuery($query);
$db->execute();
if ((int) $value == 0)
{
// Adjust the mapping table.
// Clear the existing features settings.
$query = $db->getQuery(true)
->delete($db->quoteName('#__content_frontpage'))
->where('content_id IN (' . implode(',', $pks) . ')');
$db->setQuery($query);
$db->execute();
}
else
{
// First, we find out which of our new featured articles are already featured.
$query = $db->getQuery(true)
->select('f.content_id')
->from('#__content_frontpage AS f')
->where('content_id IN (' . implode(',', $pks) . ')');
$db->setQuery($query);
$oldFeatured = $db->loadColumn();
// We diff the arrays to get a list of the articles that are newly featured
$newFeatured = array_diff($pks, $oldFeatured);
// Featuring.
$tuples = array();
foreach ($newFeatured as $pk)
{
$tuples[] = $pk . ', 0';
}
if (count($tuples))
{
$columns = array('content_id', 'ordering');
$query = $db->getQuery(true)
->insert($db->quoteName('#__content_frontpage'))
->columns($db->quoteName($columns))
->values($tuples);
$db->setQuery($query);
$db->execute();
}
}
}
catch (Exception $e)
{
$this->setError($e->getMessage());
return false;
}
$table->reorder();
$this->cleanCache();
return true;
}
/**
* A protected method to get a set of ordering conditions.
*
* @param object $table A record object.
*
* @return array An array of conditions to add to add to ordering queries.
*
* @since 1.6
*/
protected function getReorderConditions($table)
{
return array('catid = ' . (int) $table->catid);
}
/**
* Allows preprocessing of the JForm object.
*
* @param JForm $form The form object
* @param array $data The data to be merged into the form object
* @param string $group The plugin group to be executed
*
* @return void
*
* @since 3.0
*/
protected function preprocessForm(JForm $form, $data, $group = 'content')
{
if ($this->canCreateCategory())
{
$form->setFieldAttribute('catid', 'allowAdd', 'true');
// Add a prefix for categories created on the fly.
$form->setFieldAttribute('catid', 'customPrefix', '#new#');
}
// Association content items
if (JLanguageAssociations::isEnabled())
{
$languages = JLanguageHelper::getContentLanguages(false, true, null, 'ordering', 'asc');
if (count($languages) > 1)
{
$addform = new SimpleXMLElement('<form />');
$fields = $addform->addChild('fields');
$fields->addAttribute('name', 'associations');
$fieldset = $fields->addChild('fieldset');
$fieldset->addAttribute('name', 'item_associations');
foreach ($languages as $language)
{
$field = $fieldset->addChild('field');
$field->addAttribute('name', $language->lang_code);
$field->addAttribute('type', 'modal_article');
$field->addAttribute('language', $language->lang_code);
$field->addAttribute('label', $language->title);
$field->addAttribute('translate_label', 'false');
$field->addAttribute('select', 'true');
$field->addAttribute('new', 'true');
$field->addAttribute('edit', 'true');
$field->addAttribute('clear', 'true');
$field->addAttribute('propagate', 'true');
}
$form->load($addform, false);
}
}
parent::preprocessForm($form, $data, $group);
}
/**
* Custom clean the cache of com_content and content modules
*
* @param string $group The cache group
* @param integer $clientId The ID of the client
*
* @return void
*
* @since 1.6
*/
protected function cleanCache($group = null, $clientId = 0)
{
parent::cleanCache('com_content');
parent::cleanCache('mod_articles_archive');
parent::cleanCache('mod_articles_categories');
parent::cleanCache('mod_articles_category');
parent::cleanCache('mod_articles_latest');
parent::cleanCache('mod_articles_news');
parent::cleanCache('mod_articles_popular');
}
/**
* Void hit function for pagebreak when editing content from frontend
*
* @return void
*
* @since 3.6.0
*/
public function hit()
{
return;
}
/**
* Is the user allowed to create an on the fly category?
*
* @return boolean
*
* @since 3.6.1
*/
private function canCreateCategory()
{
return JFactory::getUser()->authorise('core.create', 'com_content');
}
/**
* Delete #__content_frontpage items if the deleted articles was featured
*
* @param object $pks The primary key related to the contents that was deleted.
*
* @return boolean
*
* @since 3.7.0
*/
public function delete(&$pks)
{
$return = parent::delete($pks);
if ($return)
{
// Now check to see if this articles was featured if so delete it from the #__content_frontpage table
$db = $this->getDbo();
$query = $db->getQuery(true)
->delete($db->quoteName('#__content_frontpage'))
->where('content_id IN (' . implode(',', $pks) . ')');
$db->setQuery($query);
$db->execute();
}
return $return;
}
}
models/categories.php 0000604 00000006574 15245530277 0010707 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2009 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 lists of article categories.
*
* @since 1.6
*/
class ContentModelCategories extends JModelList
{
/**
* Model context string.
*
* @var string
*/
public $_context = 'com_content.categories';
/**
* The category context (allows other extensions to derived from this model).
*
* @var string
*/
protected $_extension = 'com_content';
private $_parent = null;
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering The field to order on.
* @param string $direction The direction to order on.
*
* @return void
*
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
$this->setState('filter.extension', $this->_extension);
// Get the parent id if defined.
$parentId = $app->input->getInt('id');
$this->setState('filter.parentId', $parentId);
$params = $app->getParams();
$this->setState('params', $params);
$this->setState('filter.published', 1);
$this->setState('filter.access', true);
}
/**
* Method to get a store id based on model configuration state.
*
* This is necessary because the model is used by the component and
* different modules that might need different sets of data or different
* ordering requirements.
*
* @param string $id A prefix for the store id.
*
* @return string A store id.
*/
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':' . $this->getState('filter.extension');
$id .= ':' . $this->getState('filter.published');
$id .= ':' . $this->getState('filter.access');
$id .= ':' . $this->getState('filter.parentId');
return parent::getStoreId($id);
}
/**
* Redefine the function an add some properties to make the styling more easy
*
* @param bool $recursive True if you want to return children recursively.
*
* @return mixed An array of data items on success, false on failure.
*
* @since 1.6
*/
public function getItems($recursive = false)
{
$store = $this->getStoreId();
if (!isset($this->cache[$store]))
{
$app = JFactory::getApplication();
$menu = $app->getMenu();
$active = $menu->getActive();
$params = new Registry;
if ($active)
{
$params->loadString($active->params);
}
$options = array();
$options['countItems'] = $params->get('show_cat_num_articles_cat', 1) || !$params->get('show_empty_categories_cat', 0);
$categories = JCategories::getInstance('Content', $options);
$this->_parent = $categories->get($this->getState('filter.parentId', 'root'));
if (is_object($this->_parent))
{
$this->cache[$store] = $this->_parent->getChildren($recursive);
}
else
{
$this->cache[$store] = false;
}
}
return $this->cache[$store];
}
/**
* Get the parent.
*
* @return object An array of data items on success, false on failure.
*
* @since 1.6
*/
public function getParent()
{
if (!is_object($this->_parent))
{
$this->getItems();
}
return $this->_parent;
}
}
models/articles.php 0000604 00000031630 15245530277 0010357 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright (C) 2008 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;
/**
* Methods supporting a list of article records.
*
* @since 1.6
*/
class ContentModelArticles extends JModelList
{
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @since 1.6
* @see JControllerLegacy
*/
public function __construct($config = array())
{
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'catid', 'a.catid', 'category_title',
'state', 'a.state',
'access', 'a.access', 'access_level',
'created', 'a.created',
'modified', 'a.modified',
'created_by', 'a.created_by',
'created_by_alias', 'a.created_by_alias',
'ordering', 'a.ordering',
'featured', 'a.featured',
'language', 'a.language',
'hits', 'a.hits',
'publish_up', 'a.publish_up',
'publish_down', 'a.publish_down',
'published', 'a.published',
'author_id',
'category_id',
'level',
'tag',
'rating_count', 'rating',
);
if (JLanguageAssociations::isEnabled())
{
$config['filter_fields'][] = 'association';
}
}
parent::__construct($config);
}
/**
* 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 1.6
*/
protected function populateState($ordering = 'a.id', $direction = 'desc')
{
$app = JFactory::getApplication();
$forcedLanguage = $app->input->get('forcedLanguage', '', 'cmd');
// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
// Adjust the context to support forced languages.
if ($forcedLanguage)
{
$this->context .= '.' . $forcedLanguage;
}
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$level = $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level');
$this->setState('filter.level', $level);
$language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '');
$this->setState('filter.language', $language);
$formSubmited = $app->input->post->get('form_submited');
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access');
$authorId = $this->getUserStateFromRequest($this->context . '.filter.author_id', 'filter_author_id');
$categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id');
$tag = $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', '');
if ($formSubmited)
{
$access = $app->input->post->get('access');
$this->setState('filter.access', $access);
$authorId = $app->input->post->get('author_id');
$this->setState('filter.author_id', $authorId);
$categoryId = $app->input->post->get('category_id');
$this->setState('filter.category_id', $categoryId);
$tag = $app->input->post->get('tag');
$this->setState('filter.tag', $tag);
}
// List state information.
parent::populateState($ordering, $direction);
// Force a language
if (!empty($forcedLanguage))
{
$this->setState('filter.language', $forcedLanguage);
$this->setState('filter.forcedLanguage', $forcedLanguage);
}
}
/**
* Method to get a store id based on model configuration state.
*
* This is necessary because the model is used by the component and
* different modules that might need different sets of data or different
* ordering requirements.
*
* @param string $id A prefix for the store id.
*
* @return string A store id.
*
* @since 1.6
*/
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':' . $this->getState('filter.search');
$id .= ':' . serialize($this->getState('filter.access'));
$id .= ':' . $this->getState('filter.published');
$id .= ':' . serialize($this->getState('filter.category_id'));
$id .= ':' . serialize($this->getState('filter.author_id'));
$id .= ':' . $this->getState('filter.language');
$id .= ':' . serialize($this->getState('filter.tag'));
return parent::getStoreId($id);
}
/**
* Build an SQL query to load the list data.
*
* @return JDatabaseQuery
*
* @since 1.6
*/
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
$user = JFactory::getUser();
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid' .
', a.state, a.access, a.created, a.created_by, a.created_by_alias, a.modified, a.ordering, a.featured, a.language, a.hits' .
', a.publish_up, a.publish_down, a.note'
)
);
$query->from('#__content AS a');
// Join over the language
$query->select('l.title AS language_title, l.image AS language_image')
->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('uc.name AS editor')
->join('LEFT', '#__users AS uc ON uc.id=a.checked_out');
// Join over the asset groups.
$query->select('ag.title AS access_level')
->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Join over the categories.
$query->select('c.title AS category_title, c.created_user_id AS category_uid, c.level AS category_level')
->join('LEFT', '#__categories AS c ON c.id = a.catid');
// Join over the parent categories.
$query->select('parent.title AS parent_category_title, parent.id AS parent_category_id,
parent.created_user_id AS parent_category_uid, parent.level AS parent_category_level')
->join('LEFT', '#__categories AS parent ON parent.id = c.parent_id');
// Join over the users for the author.
$query->select('ua.name AS author_name')
->join('LEFT', '#__users AS ua ON ua.id = a.created_by');
// Join on voting table
if (JPluginHelper::isEnabled('content', 'vote'))
{
$query->select('COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating,
COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count')
->join('LEFT', '#__content_rating AS v ON a.id = v.content_id');
}
// Join over the associations.
if (JLanguageAssociations::isEnabled())
{
$subQuery = $db->getQuery(true)
->select('COUNT(' . $db->quoteName('asso1.id') . ') > 1')
->from($db->quoteName('#__associations', 'asso1'))
->join('INNER', $db->quoteName('#__associations', 'asso2') . ' ON ' . $db->quoteName('asso1.key') . ' = ' . $db->quoteName('asso2.key'))
->where(
array(
$db->quoteName('asso1.id') . ' = ' . $db->quoteName('a.id'),
$db->quoteName('asso1.context') . ' = ' . $db->quote('com_content.item'),
)
);
$query->select('(' . $subQuery . ') AS ' . $db->quoteName('association'));
}
// Filter by access level.
$access = $this->getState('filter.access');
if (is_numeric($access))
{
$query->where('a.access = ' . (int) $access);
}
elseif (is_array($access))
{
$access = ArrayHelper::toInteger($access);
$access = implode(',', $access);
$query->where('a.access IN (' . $access . ')');
}
// Filter by access level on categories.
if (!$user->authorise('core.admin'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
$query->where('c.access IN (' . $groups . ')');
}
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
$query->where('a.state = ' . (int) $published);
}
elseif ($published === '')
{
$query->where('(a.state = 0 OR a.state = 1)');
}
// Filter by categories and by level
$categoryId = $this->getState('filter.category_id', array());
$level = $this->getState('filter.level');
if (!is_array($categoryId))
{
$categoryId = $categoryId ? array($categoryId) : array();
}
// Case: Using both categories filter and by level filter
if (count($categoryId))
{
$categoryId = ArrayHelper::toInteger($categoryId);
$categoryTable = JTable::getInstance('Category', 'JTable');
$subCatItemsWhere = array();
foreach ($categoryId as $filter_catid)
{
$categoryTable->load($filter_catid);
$subCatItemsWhere[] = '(' .
($level ? 'c.level <= ' . ((int) $level + (int) $categoryTable->level - 1) . ' AND ' : '') .
'c.lft >= ' . (int) $categoryTable->lft . ' AND ' .
'c.rgt <= ' . (int) $categoryTable->rgt . ')';
}
$query->where('(' . implode(' OR ', $subCatItemsWhere) . ')');
}
// Case: Using only the by level filter
elseif ($level)
{
$query->where('c.level <= ' . (int) $level);
}
// Filter by author
$authorId = $this->getState('filter.author_id');
if (is_numeric($authorId))
{
$type = $this->getState('filter.author_id.include', true) ? '= ' : '<>';
$query->where('a.created_by ' . $type . (int) $authorId);
}
elseif (is_array($authorId))
{
$authorId = ArrayHelper::toInteger($authorId);
$authorId = implode(',', $authorId);
$query->where('a.created_by IN (' . $authorId . ')');
}
// Filter by search in title.
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0)
{
$query->where('a.id = ' . (int) substr($search, 3));
}
elseif (stripos($search, 'author:') === 0)
{
$search = $db->quote('%' . $db->escape(substr($search, 7), true) . '%');
$query->where('(ua.name LIKE ' . $search . ' OR ua.username LIKE ' . $search . ')');
}
elseif (stripos($search, 'content:') === 0)
{
$search = $db->quote('%' . $db->escape(substr($search, 8), true) . '%');
$query->where('(a.introtext LIKE ' . $search . ' OR a.fulltext LIKE ' . $search . ')');
}
else
{
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
$query->where('(a.title LIKE ' . $search . ' OR a.alias LIKE ' . $search . ' OR a.note LIKE ' . $search . ')');
}
}
// Filter on the language.
if ($language = $this->getState('filter.language'))
{
$query->where('a.language = ' . $db->quote($language));
}
$tag = $this->getState('filter.tag');
// Run simplified query when filtering by one tag.
if (\is_array($tag) && \count($tag) === 1)
{
$tag = $tag[0];
}
if ($tag && \is_array($tag))
{
$tag = ArrayHelper::toInteger($tag);
$subQuery = $db->getQuery(true)
->select('DISTINCT ' . $db->quoteName('content_item_id'))
->from($db->quoteName('#__contentitem_tag_map'))
->where(
array(
$db->quoteName('tag_id') . ' IN (' . implode(',', $tag) . ')',
$db->quoteName('type_alias') . ' = ' . $db->quote('com_content.article'),
)
);
$query->join(
'INNER',
'(' . $subQuery . ') AS ' . $db->quoteName('tagmap')
. ' ON ' . $db->quoteName('tagmap.content_item_id') . ' = ' . $db->quoteName('a.id')
);
}
elseif ($tag = (int) $tag)
{
$query->join(
'INNER',
$db->quoteName('#__contentitem_tag_map', 'tagmap')
. ' ON ' . $db->quoteName('tagmap.content_item_id') . ' = ' . $db->quoteName('a.id')
)
->where(
array(
$db->quoteName('tagmap.tag_id') . ' = ' . $tag,
$db->quoteName('tagmap.type_alias') . ' = ' . $db->quote('com_content.article'),
)
);
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'DESC');
if ($orderCol == 'a.ordering' || $orderCol == 'category_title')
{
$orderCol = $db->quoteName('c.title') . ' ' . $orderDirn . ', ' . $db->quoteName('a.ordering');
}
$query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn));
return $query;
}
/**
* Build a list of authors
*
* @return stdClass
*
* @since 1.6
*
* @deprecated 4.0 To be removed with Hathor
*/
public function getAuthors()
{
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
// Construct the query
$query->select('u.id AS value, u.name AS text')
->from('#__users AS u')
->join('INNER', '#__content AS c ON c.created_by = u.id')
->group('u.id, u.name')
->order('u.name');
// Setup the query
$db->setQuery($query);
// Return the result
return $db->loadObjectList();
}
}
models/category.php 0000604 00000030527 15245530277 0010372 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 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\Utilities\ArrayHelper;
/**
* This models supports retrieving a category, the articles associated with the category,
* sibling, child and parent categories.
*
* @since 1.5
*/
class ContentModelCategory extends JModelList
{
/**
* Category items data
*
* @var array
*/
protected $_item = null;
protected $_articles = null;
protected $_siblings = null;
protected $_children = null;
protected $_parent = null;
/**
* Model context string.
*
* @var string
*/
protected $_context = 'com_content.category';
/**
* The category that applies.
*
* @access protected
* @var object
*/
protected $_category = null;
/**
* The list of other newfeed categories.
*
* @access protected
* @var array
*/
protected $_categories = null;
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @since 1.6
*/
public function __construct($config = array())
{
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'catid', 'a.catid', 'category_title',
'state', 'a.state',
'access', 'a.access', 'access_level',
'created', 'a.created',
'created_by', 'a.created_by',
'modified', 'a.modified',
'ordering', 'a.ordering',
'featured', 'a.featured',
'language', 'a.language',
'hits', 'a.hits',
'publish_up', 'a.publish_up',
'publish_down', 'a.publish_down',
'author', 'a.author',
'filter_tag'
);
}
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering The field to order on.
* @param string $direction The direction to order on.
*
* @return void
*
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication('site');
$pk = $app->input->getInt('id');
$this->setState('category.id', $pk);
// Load the parameters. Merge Global and Menu Item params into new object
$params = $app->getParams();
$menuParams = new Registry;
if ($menu = $app->getMenu()->getActive())
{
$menuParams->loadString($menu->params);
}
$mergedParams = clone $menuParams;
$mergedParams->merge($params);
$this->setState('params', $mergedParams);
$user = JFactory::getUser();
$asset = 'com_content';
if ($pk)
{
$asset .= '.category.' . $pk;
}
if ((!$user->authorise('core.edit.state', $asset)) && (!$user->authorise('core.edit', $asset)))
{
// Limit to published for people who can't edit or edit.state.
$this->setState('filter.published', 1);
}
else
{
$this->setState('filter.published', array(0, 1, 2));
}
// Process show_noauth parameter
if (!$params->get('show_noauth'))
{
$this->setState('filter.access', true);
}
else
{
$this->setState('filter.access', false);
}
$itemid = $app->input->get('id', 0, 'int') . ':' . $app->input->get('Itemid', 0, 'int');
$value = $this->getUserStateFromRequest('com_content.category.filter.' . $itemid . '.tag', 'filter_tag', 0, 'int', false);
$this->setState('filter.tag', $value);
// Optional filter text
$search = $app->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter-search', 'filter-search', '', 'string');
$this->setState('list.filter', $search);
// Filter.order
$orderCol = $app->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order', 'filter_order', '', 'string');
if (!in_array($orderCol, $this->filter_fields))
{
$orderCol = 'a.ordering';
}
$this->setState('list.ordering', $orderCol);
$listOrder = $app->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', '', 'cmd');
if (!in_array(strtoupper($listOrder), array('ASC', 'DESC', '')))
{
$listOrder = 'ASC';
}
$this->setState('list.direction', $listOrder);
$this->setState('list.start', $app->input->get('limitstart', 0, 'uint'));
// Set limit for query. If list, use parameter. If blog, add blog parameters for limit.
if (($app->input->get('layout') === 'blog') || $params->get('layout_type') === 'blog')
{
$limit = $params->get('num_leading_articles') + $params->get('num_intro_articles') + $params->get('num_links');
$this->setState('list.links', $params->get('num_links'));
}
else
{
$limit = $app->getUserStateFromRequest('com_content.category.list.' . $itemid . '.limit', 'limit', $params->get('display_num'), 'uint');
}
$this->setState('list.limit', $limit);
// Set the depth of the category query based on parameter
$showSubcategories = $params->get('show_subcategory_content', '0');
if ($showSubcategories)
{
$this->setState('filter.max_category_levels', $params->get('show_subcategory_content', '1'));
$this->setState('filter.subcategories', true);
}
$this->setState('filter.language', JLanguageMultilang::isEnabled());
$this->setState('layout', $app->input->getString('layout'));
// Set the featured articles state
$this->setState('filter.featured', $params->get('show_featured'));
}
/**
* Get the articles in the category
*
* @return mixed An array of articles or false if an error occurs.
*
* @since 1.5
*/
public function getItems()
{
$limit = $this->getState('list.limit');
if ($this->_articles === null && $category = $this->getCategory())
{
$model = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
$model->setState('params', JFactory::getApplication()->getParams());
$model->setState('filter.category_id', $category->id);
$model->setState('filter.published', $this->getState('filter.published'));
$model->setState('filter.access', $this->getState('filter.access'));
$model->setState('filter.language', $this->getState('filter.language'));
$model->setState('filter.featured', $this->getState('filter.featured'));
$model->setState('list.ordering', $this->_buildContentOrderBy());
$model->setState('list.start', $this->getState('list.start'));
$model->setState('list.limit', $limit);
$model->setState('list.direction', $this->getState('list.direction'));
$model->setState('list.filter', $this->getState('list.filter'));
$model->setState('filter.tag', $this->getState('filter.tag'));
// Filter.subcategories indicates whether to include articles from subcategories in the list or blog
$model->setState('filter.subcategories', $this->getState('filter.subcategories'));
$model->setState('filter.max_category_levels', $this->getState('filter.max_category_levels'));
$model->setState('list.links', $this->getState('list.links'));
if ($limit >= 0)
{
$this->_articles = $model->getItems();
if ($this->_articles === false)
{
$this->setError($model->getError());
}
}
else
{
$this->_articles = array();
}
$this->_pagination = $model->getPagination();
}
return $this->_articles;
}
/**
* Build the orderby for the query
*
* @return string $orderby portion of query
*
* @since 1.5
*/
protected function _buildContentOrderBy()
{
$app = JFactory::getApplication('site');
$db = $this->getDbo();
$params = $this->state->params;
$itemid = $app->input->get('id', 0, 'int') . ':' . $app->input->get('Itemid', 0, 'int');
$orderCol = $app->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order', 'filter_order', '', 'string');
$orderDirn = $app->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', '', 'cmd');
$orderby = ' ';
if (!in_array($orderCol, $this->filter_fields))
{
$orderCol = null;
}
if (!in_array(strtoupper($orderDirn), array('ASC', 'DESC', '')))
{
$orderDirn = 'ASC';
}
if ($orderCol && $orderDirn)
{
$orderby .= $db->escape($orderCol) . ' ' . $db->escape($orderDirn) . ', ';
}
$articleOrderby = $params->get('orderby_sec', 'rdate');
$articleOrderDate = $params->get('order_date');
$categoryOrderby = $params->def('orderby_pri', '');
$secondary = ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate) . ', ';
$primary = ContentHelperQuery::orderbyPrimary($categoryOrderby);
$orderby .= $primary . ' ' . $secondary . ' a.created ';
return $orderby;
}
/**
* Method to get a JPagination object for the data set.
*
* @return JPagination A JPagination object for the data set.
*
* @since 3.0.1
*/
public function getPagination()
{
if (empty($this->_pagination))
{
return null;
}
return $this->_pagination;
}
/**
* Method to get category data for the current category
*
* @return object
*
* @since 1.5
*/
public function getCategory()
{
if (!is_object($this->_item))
{
if (isset($this->state->params))
{
$params = $this->state->params;
$options = array();
$options['countItems'] = $params->get('show_cat_num_articles', 1) || !$params->get('show_empty_categories_cat', 0);
$options['access'] = $params->get('check_access_rights', 1);
}
else
{
$options['countItems'] = 0;
}
$categories = JCategories::getInstance('Content', $options);
$this->_item = $categories->get($this->getState('category.id', 'root'));
// Compute selected asset permissions.
if (is_object($this->_item))
{
$user = JFactory::getUser();
$asset = 'com_content.category.' . $this->_item->id;
// Check general create permission.
if ($user->authorise('core.create', $asset))
{
$this->_item->getParams()->set('access-create', true);
}
// TODO: Why aren't we lazy loading the children and siblings?
$this->_children = $this->_item->getChildren();
$this->_parent = false;
if ($this->_item->getParent())
{
$this->_parent = $this->_item->getParent();
}
$this->_rightsibling = $this->_item->getSibling();
$this->_leftsibling = $this->_item->getSibling(false);
}
else
{
$this->_children = false;
$this->_parent = false;
}
}
return $this->_item;
}
/**
* Get the parent category.
*
* @return mixed An array of categories or false if an error occurs.
*
* @since 1.6
*/
public function getParent()
{
if (!is_object($this->_item))
{
$this->getCategory();
}
return $this->_parent;
}
/**
* Get the left sibling (adjacent) categories.
*
* @return mixed An array of categories or false if an error occurs.
*
* @since 1.6
*/
public function &getLeftSibling()
{
if (!is_object($this->_item))
{
$this->getCategory();
}
return $this->_leftsibling;
}
/**
* Get the right sibling (adjacent) categories.
*
* @return mixed An array of categories or false if an error occurs.
*
* @since 1.6
*/
public function &getRightSibling()
{
if (!is_object($this->_item))
{
$this->getCategory();
}
return $this->_rightsibling;
}
/**
* Get the child categories.
*
* @return mixed An array of categories or false if an error occurs.
*
* @since 1.6
*/
public function &getChildren()
{
if (!is_object($this->_item))
{
$this->getCategory();
}
// Order subcategories
if ($this->_children)
{
$params = $this->getState()->get('params');
$orderByPri = $params->get('orderby_pri');
if ($orderByPri === 'alpha' || $orderByPri === 'ralpha')
{
$this->_children = ArrayHelper::sortObjects($this->_children, 'title', ($orderByPri === 'alpha') ? 1 : (-1));
}
}
return $this->_children;
}
/**
* Increment the hit counter for the category.
*
* @param int $pk Optional primary key of the category to increment.
*
* @return boolean True if successful; false otherwise and internal error set.
*/
public function hit($pk = 0)
{
$input = JFactory::getApplication()->input;
$hitcount = $input->getInt('hitcount', 1);
if ($hitcount)
{
$pk = (!empty($pk)) ? $pk : (int) $this->getState('category.id');
$table = JTable::getInstance('Category', 'JTable');
$table->hit($pk);
}
return true;
}
}
models/forms/filter_articles.xml 0000604 00000011366 15245530277 0013067 0 ustar 00 <?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="filter">
<field
name="search"
type="text"
inputmode="search"
label="COM_CONTENT_FILTER_SEARCH_LABEL"
description="COM_CONTENT_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
/>
<field
name="published"
type="status"
label="COM_CONTENT_FILTER_PUBLISHED"
description="COM_CONTENT_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
</field>
<field
name="category_id"
type="category"
label="JOPTION_FILTER_CATEGORY"
description="JOPTION_FILTER_CATEGORY_DESC"
multiple="true"
class="multipleCategories"
extension="com_content"
onchange="this.form.submit();"
published="0,1,2"
/>
<field
name="access"
type="accesslevel"
label="JOPTION_FILTER_ACCESS"
description="JOPTION_FILTER_ACCESS_DESC"
multiple="true"
class="multipleAccessLevels"
onchange="this.form.submit();"
/>
<field
name="author_id"
type="author"
label="COM_CONTENT_FILTER_AUTHOR"
description="COM_CONTENT_FILTER_AUTHOR_DESC"
multiple="true"
class="multipleAuthors"
onchange="this.form.submit();"
>
<option value="0">JNONE</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="tag"
type="tag"
label="JOPTION_FILTER_TAG"
description="JOPTION_FILTER_TAG_DESC"
multiple="true"
class="multipleTags"
mode="nested"
onchange="this.form.submit();"
/>
<field
name="level"
type="integer"
label="JOPTION_FILTER_LEVEL"
description="JOPTION_FILTER_LEVEL_DESC"
first="1"
last="10"
step="1"
languages="*"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_MAX_LEVELS</option>
</field>
<input type="hidden" name="form_submited" value="1"/>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="COM_CONTENT_LIST_FULL_ORDERING"
description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();"
default="a.id DESC"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.state ASC">JSTATUS_ASC</option>
<option value="a.state DESC">JSTATUS_DESC</option>
<option value="a.featured ASC">JFEATURED_ASC</option>
<option value="a.featured DESC">JFEATURED_DESC</option>
<option value="a.title ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.title DESC">JGLOBAL_TITLE_DESC</option>
<option value="category_title ASC">JCATEGORY_ASC</option>
<option value="category_title DESC">JCATEGORY_DESC</option>
<option value="a.access ASC">JGRID_HEADING_ACCESS_ASC</option>
<option value="a.access DESC">JGRID_HEADING_ACCESS_DESC</option>
<option value="association ASC" requires="associations">JASSOCIATIONS_ASC</option>
<option value="association DESC" requires="associations">JASSOCIATIONS_DESC</option>
<option value="a.created_by ASC">JAUTHOR_ASC</option>
<option value="a.created_by DESC">JAUTHOR_DESC</option>
<option value="language ASC">JGRID_HEADING_LANGUAGE_ASC</option>
<option value="language DESC">JGRID_HEADING_LANGUAGE_DESC</option>
<option value="a.created ASC">JDATE_ASC</option>
<option value="a.created DESC">JDATE_DESC</option>
<option value="a.modified ASC">COM_CONTENT_MODIFIED_ASC</option>
<option value="a.modified DESC">COM_CONTENT_MODIFIED_DESC</option>
<option value="a.publish_up ASC">COM_CONTENT_PUBLISH_UP_ASC</option>
<option value="a.publish_up DESC">COM_CONTENT_PUBLISH_UP_DESC</option>
<option value="a.publish_down ASC">COM_CONTENT_PUBLISH_DOWN_ASC</option>
<option value="a.publish_down DESC">COM_CONTENT_PUBLISH_DOWN_DESC</option>
<option value="a.hits ASC">JGLOBAL_HITS_ASC</option>
<option value="a.hits DESC">JGLOBAL_HITS_DESC</option>
<option value="rating_count ASC" requires="vote">JGLOBAL_VOTES_ASC</option>
<option value="rating_count DESC" requires="vote">JGLOBAL_VOTES_DESC</option>
<option value="rating ASC" requires="vote">JGLOBAL_RATINGS_ASC</option>
<option value="rating DESC" requires="vote">JGLOBAL_RATINGS_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_CONTENT_LIST_LIMIT"
description="COM_CONTENT_LIST_LIMIT_DESC"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>
models/forms/article.xml 0000604 00000055206 15245530277 0011340 0 ustar 00 <?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset addfieldpath="/administrator/components/com_categories/models/fields" >
<field
name="id"
type="number"
label="JGLOBAL_FIELD_ID_LABEL"
description="JGLOBAL_FIELD_ID_DESC"
class="readonly"
size="10"
default="0"
readonly="true"
/>
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<field
name="title"
type="text"
label="JGLOBAL_TITLE"
description="JFIELD_TITLE_DESC"
class="input-xxlarge input-large-text"
size="40"
required="true"
/>
<field
name="alias"
type="text"
label="JFIELD_ALIAS_LABEL"
description="JFIELD_ALIAS_DESC"
hint="JFIELD_ALIAS_PLACEHOLDER"
size="40"
/>
<field
name="note"
type="text"
label="COM_CONTENT_FIELD_NOTE_LABEL"
description="COM_CONTENT_FIELD_NOTE_DESC"
class="span12"
size="40"
maxlength="255"
/>
<field
name="version_note"
type="text"
label="JGLOBAL_FIELD_VERSION_NOTE_LABEL"
description="JGLOBAL_FIELD_VERSION_NOTE_DESC"
class="span12"
maxlength="255"
size="45"
/>
<field
name="articletext"
type="editor"
label="COM_CONTENT_FIELD_ARTICLETEXT_LABEL"
description="COM_CONTENT_FIELD_ARTICLETEXT_DESC"
filter="JComponentHelper::filterText"
buttons="true"
/>
<field
name="state"
type="list"
label="JSTATUS"
description="JFIELD_PUBLISHED_DESC"
class="chzn-color-state"
filter="intval"
size="1"
default="1"
>
<option value="1">JPUBLISHED</option>
<option value="0">JUNPUBLISHED</option>
<option value="2">JARCHIVED</option>
<option value="-2">JTRASHED</option>
</field>
<field
name="catid"
type="categoryedit"
label="JCATEGORY"
description="JFIELD_CATEGORY_DESC"
required="true"
default=""
/>
<field
name="tags"
type="tag"
label="JTAG"
description="JTAG_DESC"
class="span12"
multiple="true"
/>
<field
name="buttonspacer"
type="spacer"
description="JGLOBAL_ACTION_PERMISSIONS_DESCRIPTION"
/>
<field
name="created"
type="calendar"
label="COM_CONTENT_FIELD_CREATED_LABEL"
description="COM_CONTENT_FIELD_CREATED_DESC"
translateformat="true"
showtime="true"
size="22"
filter="user_utc"
/>
<field
name="created_by"
type="user"
label="COM_CONTENT_FIELD_CREATED_BY_LABEL"
description="COM_CONTENT_FIELD_CREATED_BY_DESC"
/>
<field
name="created_by_alias"
type="text"
label="COM_CONTENT_FIELD_CREATED_BY_ALIAS_LABEL"
description="COM_CONTENT_FIELD_CREATED_BY_ALIAS_DESC"
size="20"
/>
<field
name="modified"
type="calendar"
label="JGLOBAL_FIELD_MODIFIED_LABEL"
description="COM_CONTENT_FIELD_MODIFIED_DESC"
class="readonly"
translateformat="true"
showtime="true"
size="22"
readonly="true"
filter="user_utc"
/>
<field
name="modified_by"
type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
class="readonly"
readonly="true"
filter="unset"
/>
<field
name="checked_out"
type="hidden"
filter="unset"
/>
<field
name="checked_out_time"
type="hidden"
filter="unset"
/>
<field
name="publish_up"
type="calendar"
label="COM_CONTENT_FIELD_PUBLISH_UP_LABEL"
description="COM_CONTENT_FIELD_PUBLISH_UP_DESC"
translateformat="true"
showtime="true"
size="22"
filter="user_utc"
/>
<field
name="publish_down"
type="calendar"
label="COM_CONTENT_FIELD_PUBLISH_DOWN_LABEL"
description="COM_CONTENT_FIELD_PUBLISH_DOWN_DESC"
translateformat="true"
showtime="true"
size="22"
filter="user_utc"
/>
<field
name="version"
type="text"
label="COM_CONTENT_FIELD_VERSION_LABEL"
description="COM_CONTENT_FIELD_VERSION_DESC"
size="6"
class="readonly"
readonly="true"
filter="unset"
/>
<field
name="ordering"
type="text"
label="JFIELD_ORDERING_LABEL"
description="JFIELD_ORDERING_DESC"
size="6"
default="0"
/>
<field
name="metakey"
type="textarea"
label="JFIELD_META_KEYWORDS_LABEL"
description="JFIELD_META_KEYWORDS_DESC"
rows="3"
cols="30"
/>
<field
name="metadesc"
type="textarea"
label="JFIELD_META_DESCRIPTION_LABEL"
description="JFIELD_META_DESCRIPTION_DESC"
rows="3"
cols="30"
/>
<field
name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
size="1"
/>
<field
name="hits"
type="number"
label="JGLOBAL_HITS"
description="COM_CONTENT_FIELD_HITS_DESC"
class="readonly"
size="6"
readonly="true"
filter="unset"
/>
<field
name="language"
type="contentlanguage"
label="JFIELD_LANGUAGE_LABEL"
description="COM_CONTENT_FIELD_LANGUAGE_DESC"
>
<option value="*">JALL</option>
</field>
<field
name="featured"
type="radio"
label="JFEATURED"
description="COM_CONTENT_FIELD_FEATURED_DESC"
class="btn-group btn-group-yesno"
default="0"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="rules"
type="rules"
label="JFIELD_RULES_LABEL"
translate_label="false"
filter="rules"
component="com_content"
section="article"
validate="rules"
/>
</fieldset>
<fields name="attribs" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">
<fieldset name="basic" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">
<field
name="article_layout"
type="componentlayout"
label="JFIELD_ALT_LAYOUT_LABEL"
description="JFIELD_ALT_COMPONENT_LAYOUT_DESC"
useglobal="true"
extension="com_content"
view="article"
/>
<field
name="show_title"
type="list"
label="JGLOBAL_SHOW_TITLE_LABEL"
description="JGLOBAL_SHOW_TITLE_DESC"
class="chzn-color"
useglobal="true"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="link_titles"
type="list"
label="JGLOBAL_LINKED_TITLES_LABEL"
description="JGLOBAL_LINKED_TITLES_DESC"
class="chzn-color"
useglobal="true"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_tags"
type="list"
label="COM_CONTENT_FIELD_SHOW_TAGS_LABEL"
description="COM_CONTENT_FIELD_SHOW_TAGS_DESC"
class="chzn-color"
useglobal="true"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_intro"
type="list"
label="JGLOBAL_SHOW_INTRO_LABEL"
description="JGLOBAL_SHOW_INTRO_DESC"
class="chzn-color"
useglobal="true"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="info_block_position"
type="list"
label="COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL"
description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC"
useglobal="true"
>
<option value="0">COM_CONTENT_FIELD_OPTION_ABOVE</option>
<option value="1">COM_CONTENT_FIELD_OPTION_BELOW</option>
<option value="2">COM_CONTENT_FIELD_OPTION_SPLIT</option>
</field>
<field
name="info_block_show_title"
type="list"
label="COM_CONTENT_FIELD_INFOBLOCK_TITLE_LABEL"
description="COM_CONTENT_FIELD_INFOBLOCK_TITLE_DESC"
class="chzn-color"
useglobal="true"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_category"
type="list"
label="JGLOBAL_SHOW_CATEGORY_LABEL"
description="JGLOBAL_SHOW_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_category"
type="list"
label="JGLOBAL_LINK_CATEGORY_LABEL"
description="JGLOBAL_LINK_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_parent_category"
type="list"
label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL"
description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_parent_category"
type="list"
label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL"
description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_associations"
type="list"
label="JGLOBAL_SHOW_ASSOCIATIONS_LABEL"
description="JGLOBAL_SHOW_ASSOCIATIONS_DESC"
class="chzn-color"
useglobal="true"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_author"
type="list"
label="JGLOBAL_SHOW_AUTHOR_LABEL"
description="JGLOBAL_SHOW_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_author"
type="list"
label="JGLOBAL_LINK_AUTHOR_LABEL"
description="JGLOBAL_LINK_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_create_date"
type="list"
label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
description="JGLOBAL_SHOW_CREATE_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_modify_date"
type="list"
label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
description="JGLOBAL_SHOW_MODIFY_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_publish_date"
type="list"
label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"
class="chzn-color"
useglobal="true"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_item_navigation"
type="list"
label="JGLOBAL_SHOW_NAVIGATION_LABEL"
description="JGLOBAL_SHOW_NAVIGATION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_icons"
type="list"
label="JGLOBAL_SHOW_ICONS_LABEL"
description="JGLOBAL_SHOW_ICONS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_print_icon"
type="list"
label="JGLOBAL_SHOW_PRINT_ICON_LABEL"
description="JGLOBAL_SHOW_PRINT_ICON_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_email_icon"
type="list"
label="JGLOBAL_SHOW_EMAIL_ICON_LABEL"
description="JGLOBAL_SHOW_EMAIL_ICON_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_vote"
type="list"
label="JGLOBAL_SHOW_VOTE_LABEL"
description="JGLOBAL_SHOW_VOTE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_hits"
type="list"
label="JGLOBAL_SHOW_HITS_LABEL"
description="JGLOBAL_SHOW_HITS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_noauth"
type="list"
label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL"
description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="urls_position"
type="list"
label="COM_CONTENT_FIELD_URLSPOSITION_LABEL"
description="COM_CONTENT_FIELD_URLSPOSITION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">COM_CONTENT_FIELD_OPTION_ABOVE</option>
<option value="1">COM_CONTENT_FIELD_OPTION_BELOW</option>
</field>
<field
name="spacer2"
type="spacer"
hr="true"
/>
<field
name="alternative_readmore"
type="text"
label="JFIELD_READMORE_LABEL"
description="JFIELD_READMORE_DESC"
size="25"
/>
<field
name="article_page_title"
type="text"
label="COM_CONTENT_FIELD_BROWSER_PAGE_TITLE_LABEL"
description="COM_CONTENT_FIELD_BROWSER_PAGE_TITLE_DESC"
size="25"
/>
</fieldset>
<fieldset name="editorConfig" label="COM_CONTENT_EDITORCONFIG_FIELDSET_LABEL">
<field
name="show_publishing_options"
type="list"
label="COM_CONTENT_SHOW_PUBLISHING_OPTIONS_LABEL"
description="COM_CONTENT_SHOW_PUBLISHING_OPTIONS_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_article_options"
type="list"
label="COM_CONTENT_SHOW_ARTICLE_OPTIONS_LABEL"
description="COM_CONTENT_SHOW_ARTICLE_OPTIONS_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_urls_images_backend"
type="list"
label="COM_CONTENT_SHOW_IMAGES_URLS_BACK_LABEL"
description="COM_CONTENT_SHOW_IMAGES_URLS_BACK_DESC"
useglobal="true"
class="chzn-color"
default=""
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_urls_images_frontend"
type="list"
label="COM_CONTENT_SHOW_IMAGES_URLS_FRONT_LABEL"
description="COM_CONTENT_SHOW_IMAGES_URLS_FRONT_DESC"
useglobal="true"
class="chzn-color"
default=""
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
<fieldset name="basic-limited" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">
<field
name="show_title"
type="hidden"
label="JGLOBAL_SHOW_TITLE_LABEL"
description="JGLOBAL_SHOW_TITLE_DESC"
/>
<field
name="link_titles"
type="hidden"
label="JGLOBAL_LINKED_TITLES_LABEL"
description="JGLOBAL_LINKED_TITLES_DESC"
/>
<field
name="show_intro"
type="hidden"
label="JGLOBAL_SHOW_INTRO_LABEL"
description="JGLOBAL_SHOW_INTRO_DESC"
/>
<field
name="show_category"
type="hidden"
label="JGLOBAL_SHOW_CATEGORY_LABEL"
description="JGLOBAL_SHOW_CATEGORY_DESC"
/>
<field
name="link_category"
type="hidden"
label="JGLOBAL_LINK_CATEGORY_LABEL"
description="JGLOBAL_LINK_CATEGORY_DESC"
/>
<field
name="show_parent_category"
type="hidden"
label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL"
description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"
/>
<field
name="link_parent_category"
type="hidden"
label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL"
description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"
/>
<field
name="show_author"
type="hidden"
label="JGLOBAL_SHOW_AUTHOR_LABEL"
description="JGLOBAL_SHOW_AUTHOR_DESC"
/>
<field
name="link_author"
type="hidden"
label="JGLOBAL_LINK_AUTHOR_LABEL"
description="JGLOBAL_LINK_AUTHOR_DESC"
/>
<field
name="show_create_date"
type="hidden"
label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
description="JGLOBAL_SHOW_CREATE_DATE_DESC"
/>
<field
name="show_modify_date"
type="hidden"
label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
description="JGLOBAL_SHOW_MODIFY_DATE_DESC"
/>
<field
name="show_publish_date"
type="hidden"
label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"
/>
<field
name="show_item_navigation"
type="hidden"
label="JGLOBAL_SHOW_NAVIGATION_LABEL"
description="JGLOBAL_SHOW_NAVIGATION_DESC"
/>
<field
name="show_icons"
type="hidden"
label="JGLOBAL_SHOW_ICONS_LABEL"
description="JGLOBAL_SHOW_ICONS_DESC"
/>
<field
name="show_print_icon"
type="hidden"
label="JGLOBAL_SHOW_PRINT_ICON_LABEL"
description="JGLOBAL_SHOW_PRINT_ICON_DESC"
/>
<field
name="show_email_icon"
type="hidden"
label="JGLOBAL_SHOW_EMAIL_ICON_LABEL"
description="JGLOBAL_SHOW_EMAIL_ICON_DESC"
/>
<field
name="show_vote"
type="hidden"
label="JGLOBAL_SHOW_VOTE_LABEL"
description="JGLOBAL_SHOW_VOTE_DESC"
/>
<field
name="show_hits"
type="hidden"
label="JGLOBAL_SHOW_HITS_LABEL"
description="JGLOBAL_SHOW_HITS_DESC"
/>
<field
name="show_noauth"
type="hidden"
label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL"
description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC"
/>
<field
name="alternative_readmore"
type="hidden"
label="JFIELD_READMORE_LABEL"
description="JFIELD_READMORE_DESC"
size="25"
/>
<field
name="article_layout"
type="hidden"
label="JFIELD_ALT_LAYOUT_LABEL"
description="JFIELD_ALT_COMPONENT_LAYOUT_DESC"
useglobal="true"
extension="com_content" view="article"
/>
</fieldset>
</fields>
<field
name="xreference"
type="text"
label="JFIELD_KEY_REFERENCE_LABEL"
description="JFIELD_KEY_REFERENCE_DESC"
size="20"
/>
<fields name="images" label="COM_CONTENT_FIELD_IMAGE_OPTIONS">
<field
name="image_intro"
type="media"
label="COM_CONTENT_FIELD_INTRO_LABEL"
description="COM_CONTENT_FIELD_INTRO_DESC"
/>
<field
name="float_intro"
type="list"
label="COM_CONTENT_FLOAT_LABEL"
description="COM_CONTENT_FLOAT_DESC"
useglobal="true"
>
<option value="right">COM_CONTENT_RIGHT</option>
<option value="left">COM_CONTENT_LEFT</option>
<option value="none">COM_CONTENT_NONE</option>
</field>
<field
name="image_intro_alt"
type="text"
label="COM_CONTENT_FIELD_IMAGE_ALT_LABEL"
description="COM_CONTENT_FIELD_IMAGE_ALT_DESC"
size="20"
/>
<field
name="image_intro_caption"
type="text"
label="COM_CONTENT_FIELD_IMAGE_CAPTION_LABEL"
description="COM_CONTENT_FIELD_IMAGE_CAPTION_DESC"
size="20"
/>
<field
name="spacer1"
type="spacer"
hr="true"
/>
<field
name="image_fulltext"
type="media"
label="COM_CONTENT_FIELD_FULL_LABEL"
description="COM_CONTENT_FIELD_FULL_DESC"
/>
<field
name="float_fulltext"
type="list"
label="COM_CONTENT_FLOAT_LABEL"
description="COM_CONTENT_FLOAT_DESC"
useglobal="true"
>
<option value="right">COM_CONTENT_RIGHT</option>
<option value="left">COM_CONTENT_LEFT</option>
<option value="none">COM_CONTENT_NONE</option>
</field>
<field
name="image_fulltext_alt"
type="text"
label="COM_CONTENT_FIELD_IMAGE_ALT_LABEL"
description="COM_CONTENT_FIELD_IMAGE_ALT_DESC"
size="20"
/>
<field
name="image_fulltext_caption"
type="text"
label="COM_CONTENT_FIELD_IMAGE_CAPTION_LABEL"
description="COM_CONTENT_FIELD_IMAGE_CAPTION_DESC"
size="20"
/>
</fields>
<fields name="urls" label="COM_CONTENT_FIELD_URLS_OPTIONS">
<field
name="urla"
type="url"
label="COM_CONTENT_FIELD_URLA_LABEL"
description="COM_CONTENT_FIELD_URL_DESC"
validate="url"
filter="url"
relative="true"
/>
<field
name="urlatext"
type="text"
label="COM_CONTENT_FIELD_URLA_LINK_TEXT_LABEL"
description="COM_CONTENT_FIELD_URL_LINK_TEXT_DESC"
size="20"
/>
<field
name="targeta"
type="list"
label="COM_CONTENT_URL_FIELD_BROWSERNAV_LABEL"
description="COM_CONTENT_URL_FIELD_BROWSERNAV_DESC"
default=""
filter="options"
useglobal="true"
>
<option value="0">JBROWSERTARGET_PARENT</option>
<option value="1">JBROWSERTARGET_NEW</option>
<option value="2">JBROWSERTARGET_POPUP</option>
<option value="3">JBROWSERTARGET_MODAL</option>
</field>
<field
name="spacer3"
type="spacer"
hr="true"
/>
<field
name="urlb"
type="url"
label="COM_CONTENT_FIELD_URLB_LABEL"
description="COM_CONTENT_FIELD_URL_DESC"
validate="url"
filter="url"
relative="true"
/>
<field
name="urlbtext"
type="text"
label="COM_CONTENT_FIELD_URLB_LINK_TEXT_LABEL"
description="COM_CONTENT_FIELD_URL_LINK_TEXT_DESC"
size="20"
/>
<field
name="targetb"
type="list"
label="COM_CONTENT_URL_FIELD_BROWSERNAV_LABEL"
description="COM_CONTENT_URL_FIELD_BROWSERNAV_DESC"
default=""
filter="options"
useglobal="true"
>
<option value="0">JBROWSERTARGET_PARENT</option>
<option value="1">JBROWSERTARGET_NEW</option>
<option value="2">JBROWSERTARGET_POPUP</option>
<option value="3">JBROWSERTARGET_MODAL</option>
</field>
<field
name="spacer4"
type="spacer"
hr="true"
/>
<field
name="urlc"
type="url"
label="COM_CONTENT_FIELD_URLC_LABEL"
description="COM_CONTENT_FIELD_URL_DESC"
validate="url"
filter="url"
relative="true"
/>
<field
name="urlctext"
type="text"
label="COM_CONTENT_FIELD_URLC_LINK_TEXT_LABEL"
description="COM_CONTENT_FIELD_URL_LINK_TEXT_DESC"
size="20"
/>
<field
name="targetc"
type="list"
label="COM_CONTENT_URL_FIELD_BROWSERNAV_LABEL"
description="COM_CONTENT_URL_FIELD_BROWSERNAV_DESC"
default=""
filter="options"
useglobal="true"
>
<option value="0">JBROWSERTARGET_PARENT</option>
<option value="1">JBROWSERTARGET_NEW</option>
<option value="2">JBROWSERTARGET_POPUP</option>
<option value="3">JBROWSERTARGET_MODAL</option>
</field>
</fields>
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="jmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<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>
<field
name="author"
type="text"
label="JAUTHOR"
description="JFIELD_METADATA_AUTHOR_DESC"
size="20"
/>
<field
name="rights"
type="textarea"
label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC"
filter="string"
cols="30"
rows="2"
/>
<field
name="xreference"
type="text"
label="COM_CONTENT_FIELD_XREFERENCE_LABEL"
description="COM_CONTENT_FIELD_XREFERENCE_DESC"
size="20"
/>
</fieldset>
</fields>
<!-- These fields are used to get labels for the Content History Preview and Compare Views -->
<fields>
<field
name="introtext"
label="COM_CONTENT_FIELD_INTROTEXT"
/>
<field
name="fulltext"
label="COM_CONTENT_FIELD_FULLTEXT"
/>
</fields>
</form>
models/form.php 0000604 00000012512 15245530277 0007512 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2009 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\Utilities\ArrayHelper;
// Base this model on the backend version.
JLoader::register('ContentModelArticle', JPATH_ADMINISTRATOR . '/components/com_content/models/article.php');
/**
* Content Component Article Model
*
* @since 1.5
*/
class ContentModelForm extends ContentModelArticle
{
/**
* Model typeAlias string. Used for version history.
*
* @var string
*/
public $typeAlias = 'com_content.article';
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
*
* @since 1.6
*/
protected function populateState()
{
$app = JFactory::getApplication();
// Load the parameters.
$params = $app->getParams();
$this->setState('params', $params);
if ($params && $params->get('enable_category') == 1 && $params->get('catid'))
{
$catId = $params->get('catid');
}
else
{
$catId = 0;
}
// Load state from the request.
$pk = $app->input->getInt('a_id');
$this->setState('article.id', $pk);
$this->setState('article.catid', $app->input->getInt('catid', $catId));
$return = $app->input->get('return', null, 'base64');
$this->setState('return_page', base64_decode($return));
$this->setState('layout', $app->input->getString('layout'));
}
/**
* Method to get article data.
*
* @param integer $itemId The id of the article.
*
* @return mixed Content item data object on success, false on failure.
*/
public function getItem($itemId = null)
{
$itemId = (int) (!empty($itemId)) ? $itemId : $this->getState('article.id');
// Get a row instance.
$table = $this->getTable();
// Attempt to load the row.
$return = $table->load($itemId);
// Check for a table object error.
if ($return === false && $table->getError())
{
$this->setError($table->getError());
return false;
}
$properties = $table->getProperties(1);
$value = ArrayHelper::toObject($properties, 'JObject');
// Convert attrib field to Registry.
$value->params = new Registry($value->attribs);
// Compute selected asset permissions.
$user = JFactory::getUser();
$userId = $user->get('id');
$asset = 'com_content.article.' . $value->id;
// Check general edit permission first.
if ($user->authorise('core.edit', $asset))
{
$value->params->set('access-edit', true);
}
// Now check if edit.own is available.
elseif (!empty($userId) && $user->authorise('core.edit.own', $asset))
{
// Check for a valid user and that they are the owner.
if ($userId == $value->created_by)
{
$value->params->set('access-edit', true);
}
}
// Check edit state permission.
if ($itemId)
{
// Existing item
$value->params->set('access-change', $user->authorise('core.edit.state', $asset));
}
else
{
// New item.
$catId = (int) $this->getState('article.catid');
if ($catId)
{
$value->params->set('access-change', $user->authorise('core.edit.state', 'com_content.category.' . $catId));
$value->catid = $catId;
}
else
{
$value->params->set('access-change', $user->authorise('core.edit.state', 'com_content'));
}
}
$value->articletext = $value->introtext;
if (!empty($value->fulltext))
{
$value->articletext .= '<hr id="system-readmore" />' . $value->fulltext;
}
// Convert the metadata field to an array.
$registry = new Registry($value->metadata);
$value->metadata = $registry->toArray();
if ($itemId)
{
$value->tags = new JHelperTags;
$value->tags->getTagIds($value->id, 'com_content.article');
$value->metadata['tags'] = $value->tags;
}
return $value;
}
/**
* Get the return URL.
*
* @return string The return URL.
*
* @since 1.6
*/
public function getReturnPage()
{
return base64_encode($this->getState('return_page'));
}
/**
* Method to save the form data.
*
* @param array $data The form data.
*
* @return boolean True on success.
*
* @since 3.2
*/
public function save($data)
{
// Associations are not edited in frontend ATM so we have to inherit them
if (JLanguageAssociations::isEnabled() && !empty($data['id'])
&& $associations = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', $data['id']))
{
foreach ($associations as $tag => $associated)
{
$associations[$tag] = (int) $associated->id;
}
$data['associations'] = $associations;
}
return parent::save($data);
}
/**
* Allows preprocessing of the JForm object.
*
* @param JForm $form The form object
* @param array $data The data to be merged into the form object
* @param string $group The plugin group to be executed
*
* @return void
*
* @since 3.7.0
*/
protected function preprocessForm(JForm $form, $data, $group = 'content')
{
$params = $this->getState()->get('params');
if ($params && $params->get('enable_category') == 1 && $params->get('catid'))
{
$form->setFieldAttribute('catid', 'default', $params->get('catid'));
$form->setFieldAttribute('catid', 'readonly', 'true');
}
parent::preprocessForm($form, $data, $group);
}
}
models/featured.php 0000604 00000020404 15245530277 0010345 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright (C) 2009 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;
JLoader::register('ContentModelArticles', __DIR__ . '/articles.php');
/**
* Methods supporting a list of featured article records.
*
* @since 1.6
*/
class ContentModelFeatured extends ContentModelArticles
{
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @see JControllerLegacy
* @since 1.6
*/
public function __construct($config = array())
{
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'id', 'a.id',
'title', 'a.title',
'alias', 'a.alias',
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'catid', 'a.catid', 'category_title',
'state', 'a.state',
'access', 'a.access', 'access_level',
'created', 'a.created',
'created_by', 'a.created_by',
'created_by_alias', 'a.created_by_alias',
'ordering', 'a.ordering',
'featured', 'a.featured',
'language', 'a.language',
'hits', 'a.hits',
'publish_up', 'a.publish_up',
'publish_down', 'a.publish_down',
'fp.ordering',
'published', 'a.published',
'author_id',
'category_id',
'level',
'tag',
'rating_count', 'rating',
);
}
parent::__construct($config);
}
/**
* Build an SQL query to load the list data.
*
* @return JDatabaseQuery
*
* @since 1.6
*/
protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
$user = JFactory::getUser();
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.id, a.title, a.alias, a.checked_out, a.checked_out_time, a.catid, a.state, a.access, a.created, a.hits,' .
'a.created_by, a.featured, a.language, a.created_by_alias, a.publish_up, a.publish_down, a.note'
)
);
$query->from('#__content AS a');
// Join over the language
$query->select('l.title AS language_title, l.image AS language_image')
->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language');
// Join over the content table.
$query->select('fp.ordering')
->join('INNER', '#__content_frontpage AS fp ON fp.content_id = a.id');
// Join over the users for the checked out user.
$query->select('uc.name AS editor')
->join('LEFT', '#__users AS uc ON uc.id=a.checked_out');
// Join over the asset groups.
$query->select('ag.title AS access_level')
->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Join over the categories.
$query->select('c.title AS category_title, c.created_user_id AS category_uid, c.level AS category_level')
->join('LEFT', '#__categories AS c ON c.id = a.catid');
// Join over the parent categories.
$query->select('parent.title AS parent_category_title, parent.id AS parent_category_id,
parent.created_user_id AS parent_category_uid, parent.level AS parent_category_level')
->join('LEFT', '#__categories AS parent ON parent.id = c.parent_id');
// Join over the users for the author.
$query->select('ua.name AS author_name')
->join('LEFT', '#__users AS ua ON ua.id = a.created_by');
// Join on voting table
if (JPluginHelper::isEnabled('content', 'vote'))
{
$query->select('COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating,
COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count')
->join('LEFT', '#__content_rating AS v ON a.id = v.content_id');
}
// Filter by access level.
$access = $this->getState('filter.access');
if (is_numeric($access))
{
$query->where('a.access = ' . (int) $access);
}
elseif (is_array($access))
{
$access = ArrayHelper::toInteger($access);
$access = implode(',', $access);
$query->where('a.access IN (' . $access . ')');
}
// Filter by access level on categories.
if (!$user->authorise('core.admin'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
$query->where('c.access IN (' . $groups . ')');
}
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
$query->where('a.state = ' . (int) $published);
}
elseif ($published === '')
{
$query->where('(a.state = 0 OR a.state = 1)');
}
// Filter by a single or group of categories.
$baselevel = 1;
$categoryId = $this->getState('filter.category_id');
if (is_array($categoryId) && count($categoryId) === 1)
{
$cat_tbl = JTable::getInstance('Category', 'JTable');
$cat_tbl->load($categoryId[0]);
$rgt = $cat_tbl->rgt;
$lft = $cat_tbl->lft;
$baselevel = (int) $cat_tbl->level;
$query->where('c.lft >= ' . (int) $lft)
->where('c.rgt <= ' . (int) $rgt);
}
elseif (is_array($categoryId))
{
$categoryId = implode(',', ArrayHelper::toInteger($categoryId));
$query->where('a.catid IN (' . $categoryId . ')');
}
// Filter on the level.
if ($level = $this->getState('filter.level'))
{
$query->where('c.level <= ' . ((int) $level + (int) $baselevel - 1));
}
// Filter by author
$authorId = $this->getState('filter.author_id');
if (is_numeric($authorId))
{
$type = $this->getState('filter.author_id.include', true) ? '= ' : '<>';
$query->where('a.created_by ' . $type . (int) $authorId);
}
elseif (is_array($authorId))
{
$authorId = ArrayHelper::toInteger($authorId);
$authorId = implode(',', $authorId);
$query->where('a.created_by IN (' . $authorId . ')');
}
// Filter by search in title.
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0)
{
$query->where('a.id = ' . (int) substr($search, 3));
}
elseif (stripos($search, 'author:') === 0)
{
$search = $db->quote('%' . $db->escape(substr($search, 7), true) . '%');
$query->where('(ua.name LIKE ' . $search . ' OR ua.username LIKE ' . $search . ')');
}
elseif (stripos($search, 'content:') === 0)
{
$search = $db->quote('%' . $db->escape(substr($search, 8), true) . '%');
$query->where('(a.introtext LIKE ' . $search . ' OR a.fulltext LIKE ' . $search . ')');
}
else
{
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
$query->where('(a.title LIKE ' . $search . ' OR a.alias LIKE ' . $search . ' OR a.note LIKE ' . $search . ')');
}
}
// Filter on the language.
if ($language = $this->getState('filter.language'))
{
$query->where('a.language = ' . $db->quote($language));
}
// Filter by a single or group of tags.
$tagId = $this->getState('filter.tag');
if (is_array($tagId) && count($tagId) === 1)
{
$tagId = current($tagId);
}
if (is_array($tagId))
{
$tagId = implode(',', ArrayHelper::toInteger($tagId));
if ($tagId)
{
$subQuery = $db->getQuery(true)
->select('DISTINCT content_item_id')
->from($db->quoteName('#__contentitem_tag_map'))
->where('tag_id IN (' . $tagId . ')')
->where('type_alias = ' . $db->quote('com_content.article'));
$query->join('INNER', '(' . (string) $subQuery . ') AS tagmap ON tagmap.content_item_id = a.id');
}
}
elseif ($tagId)
{
$query->join(
'INNER',
$db->quoteName('#__contentitem_tag_map', 'tagmap')
. ' ON tagmap.tag_id = ' . (int) $tagId
. ' AND tagmap.content_item_id = a.id'
. ' AND tagmap.type_alias = ' . $db->quote('com_content.article')
);
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.title');
$orderDirn = $this->state->get('list.direction', 'ASC');
$query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn));
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.5
*/
protected function populateState($ordering = 'a.title', $direction = 'asc')
{
parent::populateState($ordering, $direction);
}
}
views/form/tmpl/edit.xml 0000604 00000003614 15245530277 0011301 0 ustar 00 <?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_CONTENT_FORM_VIEW_DEFAULT_TITLE" option="COM_CONTENT_FORM_VIEW_DEFAULT_OPTION">
<help
key = "JHELP_MENUS_MENU_ITEM_ARTICLE_CREATE"
/>
<message>
<![CDATA[COM_CONTENT_FORM_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_categories/models/fields"
>
<field
name="enable_category"
type="radio"
label="COM_CONTENT_CREATE_ARTICLE_CATEGORY_LABEL"
description="COM_CONTENT_CREATE_ARTICLE_CATEGORY_DESC"
class="btn-group btn-group-yesno"
default="0"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="catid"
type="modal_category"
label="JGLOBAL_CHOOSE_CATEGORY_LABEL"
description="JGLOBAL_CHOOSE_CATEGORY_DESC"
extension="com_content"
select="true"
new="true"
edit="true"
clear="true"
showon="enable_category:1"
/>
<field
name="redirect_menuitem"
type="modal_menu"
label="COM_CONTENT_CREATE_ARTICLE_REDIRECTMENU_LABEL"
description="COM_CONTENT_CREATE_ARTICLE_REDIRECTMENU_DESC"
>
<option value="">JDEFAULT</option>
</field>
<field
name="custom_cancel_redirect"
type="radio"
label="COM_CONTENT_CREATE_ARTICLE_CUSTOM_CANCEL_REDIRECT_LABEL"
description="COM_CONTENT_CREATE_ARTICLE_CUSTOM_CANCEL_REDIRECT_DESC"
class="btn-group btn-group-yesno"
default="0"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="cancel_redirect_menuitem"
type="modal_menu"
label="COM_CONTENT_CREATE_ARTICLE_CANCEL_REDIRECT_MENU_LABEL"
description="COM_CONTENT_CREATE_ARTICLE_CANCEL_REDIRECT_MENU_DESC"
showon="custom_cancel_redirect:1"
>
<option value="">JDEFAULT</option>
</field>
</fieldset>
</fields>
</metadata>
views/form/tmpl/edit.php 0000604 00000015441 15245530277 0011271 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.tabstate');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', '#jform_catid', null, array('disable_search_threshold' => 0));
JHtml::_('formbehavior.chosen', '#jform_tags', null, array('placeholder_text_multiple' => JText::_('JGLOBAL_TYPE_OR_SELECT_SOME_TAGS')));
JHtml::_('formbehavior.chosen', 'select');
$this->tab_name = 'com-content-form';
$this->ignore_fieldsets = array('image-intro', 'image-full', 'jmetadata', 'item_associations');
// Create shortcut to parameters.
$params = $this->state->get('params');
// This checks if the editor config options have ever been saved. If they haven't they will fall back to the original settings.
$editoroptions = isset($params->show_publishing_options);
if (!$editoroptions)
{
$params->show_urls_images_frontend = '0';
}
JFactory::getDocument()->addScriptDeclaration("
Joomla.submitbutton = function(task)
{
if (task == 'article.cancel' || document.formvalidator.isValid(document.getElementById('adminForm')))
{
" . $this->form->getField('articletext')->save() . "
Joomla.submitform(task);
}
}
");
?>
<div class="edit item-page<?php echo $this->pageclass_sfx; ?>">
<?php if ($params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<form action="<?php echo JRoute::_('index.php?option=com_content&a_id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical">
<fieldset>
<?php echo JHtml::_('bootstrap.startTabSet', $this->tab_name, array('active' => 'editor')); ?>
<?php echo JHtml::_('bootstrap.addTab', $this->tab_name, 'editor', JText::_('COM_CONTENT_ARTICLE_CONTENT')); ?>
<?php echo $this->form->renderField('title'); ?>
<?php if (is_null($this->item->id)) : ?>
<?php echo $this->form->renderField('alias'); ?>
<?php endif; ?>
<?php echo $this->form->getInput('articletext'); ?>
<?php if ($this->captchaEnabled) : ?>
<?php echo $this->form->renderField('captcha'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if ($params->get('show_urls_images_frontend')) : ?>
<?php echo JHtml::_('bootstrap.addTab', $this->tab_name, 'images', JText::_('COM_CONTENT_IMAGES_AND_URLS')); ?>
<?php echo $this->form->renderField('image_intro', 'images'); ?>
<?php echo $this->form->renderField('image_intro_alt', 'images'); ?>
<?php echo $this->form->renderField('image_intro_caption', 'images'); ?>
<?php echo $this->form->renderField('float_intro', 'images'); ?>
<?php echo $this->form->renderField('image_fulltext', 'images'); ?>
<?php echo $this->form->renderField('image_fulltext_alt', 'images'); ?>
<?php echo $this->form->renderField('image_fulltext_caption', 'images'); ?>
<?php echo $this->form->renderField('float_fulltext', 'images'); ?>
<?php echo $this->form->renderField('urla', 'urls'); ?>
<?php echo $this->form->renderField('urlatext', 'urls'); ?>
<div class="control-group">
<div class="controls">
<?php echo $this->form->getInput('targeta', 'urls'); ?>
</div>
</div>
<?php echo $this->form->renderField('urlb', 'urls'); ?>
<?php echo $this->form->renderField('urlbtext', 'urls'); ?>
<div class="control-group">
<div class="controls">
<?php echo $this->form->getInput('targetb', 'urls'); ?>
</div>
</div>
<?php echo $this->form->renderField('urlc', 'urls'); ?>
<?php echo $this->form->renderField('urlctext', 'urls'); ?>
<div class="control-group">
<div class="controls">
<?php echo $this->form->getInput('targetc', 'urls'); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo JHtml::_('bootstrap.addTab', $this->tab_name, 'publishing', JText::_('COM_CONTENT_PUBLISHING')); ?>
<?php echo $this->form->renderField('catid'); ?>
<?php echo $this->form->renderField('tags'); ?>
<?php echo $this->form->renderField('note'); ?>
<?php if ($params->get('save_history', 0)) : ?>
<?php echo $this->form->renderField('version_note'); ?>
<?php endif; ?>
<?php if ($params->get('show_publishing_options', 1) == 1) : ?>
<?php echo $this->form->renderField('created_by_alias'); ?>
<?php endif; ?>
<?php if ($this->item->params->get('access-change')) : ?>
<?php echo $this->form->renderField('state'); ?>
<?php echo $this->form->renderField('featured'); ?>
<?php if ($params->get('show_publishing_options', 1) == 1) : ?>
<?php echo $this->form->renderField('publish_up'); ?>
<?php echo $this->form->renderField('publish_down'); ?>
<?php endif; ?>
<?php endif; ?>
<?php echo $this->form->renderField('access'); ?>
<?php if (is_null($this->item->id)) : ?>
<div class="control-group">
<div class="control-label">
</div>
<div class="controls">
<?php echo JText::_('COM_CONTENT_ORDERING'); ?>
</div>
</div>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', $this->tab_name, 'language', JText::_('JFIELD_LANGUAGE_LABEL')); ?>
<?php echo $this->form->renderField('language'); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if ($params->get('show_publishing_options', 1) == 1) : ?>
<?php echo JHtml::_('bootstrap.addTab', $this->tab_name, 'metadata', JText::_('COM_CONTENT_METADATA')); ?>
<?php echo $this->form->renderField('metadesc'); ?>
<?php echo $this->form->renderField('metakey'); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="return" value="<?php echo $this->return_page; ?>" />
<?php echo JHtml::_('form.token'); ?>
</fieldset>
<div class="btn-toolbar">
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('article.save')">
<span class="icon-ok"></span><?php echo JText::_('JSAVE') ?>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn" onclick="Joomla.submitbutton('article.cancel')">
<span class="icon-cancel"></span><?php echo JText::_('JCANCEL') ?>
</button>
</div>
<?php if ($params->get('save_history', 0) && $this->item->id) : ?>
<div class="btn-group">
<?php echo $this->form->getInput('contenthistory'); ?>
</div>
<?php endif; ?>
</div>
</form>
</div>
views/form/view.html.php 0000604 00000011076 15245530277 0011305 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* HTML Article View class for the Content component
*
* @since 1.5
*/
class ContentViewForm extends JViewLegacy
{
protected $form;
protected $item;
protected $return_page;
protected $state;
/**
* Should we show a captcha form for the submission of the article?
*
* @var bool
* @since 3.7.0
*/
protected $captchaEnabled = false;
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*/
public function display($tpl = null)
{
$user = JFactory::getUser();
$app = JFactory::getApplication();
// Get model data.
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->form = $this->get('Form');
$this->return_page = $this->get('ReturnPage');
if (empty($this->item->id))
{
$catid = $this->state->params->get('catid');
if ($this->state->params->get('enable_category') == 1 && $catid)
{
$authorised = $user->authorise('core.create', 'com_content.category.' . $catid);
}
else
{
$authorised = $user->authorise('core.create', 'com_content') || count($user->getAuthorisedCategories('com_content', 'core.create'));
}
}
else
{
$authorised = $this->item->params->get('access-edit');
}
if ($authorised !== true)
{
$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
$app->setHeader('status', 403, true);
return false;
}
$this->item->tags = new JHelperTags;
if (!empty($this->item->id))
{
$this->item->tags->getItemTags('com_content.article', $this->item->id);
$this->item->images = json_decode($this->item->images);
$this->item->urls = json_decode($this->item->urls);
$tmp = new stdClass;
$tmp->images = $this->item->images;
$tmp->urls = $this->item->urls;
$this->form->bind($tmp);
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseWarning(500, implode("\n", $errors));
return false;
}
// Create a shortcut to the parameters.
$params = &$this->state->params;
// Escape strings for HTML output
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx', ''));
$this->params = $params;
// Override global params with article specific params
$this->params->merge($this->item->params);
$this->user = $user;
// Propose current language as default when creating new article
if (empty($this->item->id) && JLanguageMultilang::isEnabled())
{
$lang = JFactory::getLanguage()->getTag();
$this->form->setFieldAttribute('language', 'default', $lang);
}
$captchaSet = $params->get('captcha', JFactory::getApplication()->get('captcha', '0'));
foreach (JPluginHelper::getPlugin('captcha') as $plugin)
{
if ($captchaSet === $plugin->name)
{
$this->captchaEnabled = true;
break;
}
}
$this->_prepareDocument();
parent::display($tpl);
}
/**
* Prepares the document
*
* @return void
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading', JText::_('COM_CONTENT_FORM_EDIT_ARTICLE'));
}
$title = $this->params->def('page_title', JText::_('COM_CONTENT_FORM_EDIT_ARTICLE'));
if ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
$pathway = $app->getPathWay();
$pathway->addItem($title, '');
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots', $this->params->get('robots'));
}
}
}
views/category/view.html.php 0000604 00000017367 15245530277 0012170 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 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\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Registry\Registry;
/**
* HTML View class for the Content component
*
* @since 1.5
*/
class ContentViewCategory extends JViewCategory
{
/**
* @var array Array of leading items for blog display
* @since 3.2
*/
protected $lead_items = array();
/**
* @var array Array of intro (multicolumn display) items for blog display
* @since 3.2
*/
protected $intro_items = array();
/**
* @var array Array of links in blog display
* @since 3.2
*/
protected $link_items = array();
/**
* @var integer Number of columns in a multi column display
* @since 3.2
* @deprecated 4.0
*/
protected $columns = 1;
/**
* @var string The name of the extension for the category
* @since 3.2
*/
protected $extension = 'com_content';
/**
* @var string Default title to use for page title
* @since 3.2
*/
protected $defaultPageTitle = 'JGLOBAL_ARTICLES';
/**
* @var string The name of the view to link individual items to
* @since 3.2
*/
protected $viewName = 'article';
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*/
public function display($tpl = null)
{
parent::commonCategoryDisplay();
// Flag indicates to not add limitstart=0 to URL
$this->pagination->hideEmptyLimitstart = true;
// Prepare the data
// Get the metrics for the structural page layout.
$params = $this->params;
$numLeading = $params->def('num_leading_articles', 1);
$numIntro = $params->def('num_intro_articles', 4);
$numLinks = $params->def('num_links', 4);
$this->vote = PluginHelper::isEnabled('content', 'vote');
PluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
// Compute the article slugs and prepare introtext (runs content plugins).
foreach ($this->items as $item)
{
$item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id;
$item->parent_slug = $item->parent_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id;
// No link for ROOT category
if ($item->parent_alias === 'root')
{
$item->parent_slug = null;
}
$item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid;
$item->event = new stdClass;
// Old plugins: Ensure that text property is available
if (!isset($item->text))
{
$item->text = $item->introtext;
}
$dispatcher->trigger('onContentPrepare', array ('com_content.category', &$item, &$item->params, 0));
// Old plugins: Use processed text as introtext
$item->introtext = $item->text;
$results = $dispatcher->trigger('onContentAfterTitle', array('com_content.category', &$item, &$item->params, 0));
$item->event->afterDisplayTitle = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.category', &$item, &$item->params, 0));
$item->event->beforeDisplayContent = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentAfterDisplay', array('com_content.category', &$item, &$item->params, 0));
$item->event->afterDisplayContent = trim(implode("\n", $results));
}
// For blog layouts, preprocess the breakdown of leading, intro and linked articles.
// This makes it much easier for the designer to just interrogate the arrays.
if ($params->get('layout_type') === 'blog' || $this->getLayout() === 'blog')
{
foreach ($this->items as $i => $item)
{
if ($i < $numLeading)
{
$this->lead_items[] = $item;
}
elseif ($i >= $numLeading && $i < $numLeading + $numIntro)
{
$this->intro_items[] = $item;
}
elseif ($i < $numLeading + $numIntro + $numLinks)
{
$this->link_items[] = $item;
}
else
{
continue;
}
}
$this->columns = max(1, $params->def('num_columns', 1));
$order = $params->def('multi_column_order', 1);
if ($order == 0 && $this->columns > 1)
{
// Call order down helper
$this->intro_items = ContentHelperQuery::orderDownColumns($this->intro_items, $this->columns);
}
}
// Because the application sets a default page title,
// we need to get it from the menu item itself
$app = Factory::getApplication();
$active = $app->getMenu()->getActive();
if ($active
&& $active->component == 'com_content'
&& isset($active->query['view'], $active->query['id'])
&& $active->query['view'] == 'category'
&& $active->query['id'] == $this->category->id)
{
$this->params->def('page_heading', $this->params->get('page_title', $active->title));
$title = $this->params->get('page_title', $active->title);
}
else
{
$this->params->def('page_heading', $this->category->title);
$title = $this->category->title;
$this->params->set('page_title', $title);
}
// Check for empty title and add site name if param is set
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
if (empty($title))
{
$title = $this->category->title;
}
$this->document->setTitle($title);
if ($this->category->metadesc)
{
$this->document->setDescription($this->category->metadesc);
}
elseif ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->category->metakey)
{
$this->document->setMetadata('keywords', $this->category->metakey);
}
elseif ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots', $this->params->get('robots'));
}
if (!is_object($this->category->metadata))
{
$this->category->metadata = new Registry($this->category->metadata);
}
if (($app->get('MetaAuthor') == '1') && $this->category->get('author', ''))
{
$this->document->setMetaData('author', $this->category->get('author', ''));
}
$mdata = $this->category->metadata->toArray();
foreach ($mdata as $k => $v)
{
if ($v)
{
$this->document->setMetadata($k, $v);
}
}
return parent::display($tpl);
}
/**
* Prepares the document
*
* @return void
*/
protected function prepareDocument()
{
parent::prepareDocument();
$menu = $this->menu;
$id = (int) @$menu->query['id'];
if ($menu && (!isset($menu->query['option']) || $menu->query['option'] !== 'com_content' || $menu->query['view'] === 'article'
|| $id != $this->category->id))
{
$path = array(array('title' => $this->category->title, 'link' => ''));
$category = $this->category->getParent();
while ($category !== null && $category->id !== 'root'
&& (!isset($menu->query['option']) || $menu->query['option'] !== 'com_content' || $menu->query['view'] === 'article' || $id != $category->id))
{
$path[] = array('title' => $category->title, 'link' => ContentHelperRoute::getCategoryRoute($category->id));
$category = $category->getParent();
}
$path = array_reverse($path);
foreach ($path as $item)
{
$this->pathway->addItem($item['title'], $item['link']);
}
}
parent::addFeed();
}
}
views/category/view.feed.php 0000604 00000004264 15245530277 0012117 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* HTML View class for the Content component
*
* @since 1.5
*/
class ContentViewCategory extends JViewCategoryfeed
{
/**
* @var string The name of the view to link individual items to
* @since 3.2
*/
protected $viewName = 'article';
/**
* Method to reconcile non standard names from components to usage in this class.
* Typically overridden in the component feed view class.
*
* @param object $item The item for a feed, an element of the $items array.
*
* @return void
*
* @since 3.2
*/
protected function reconcileNames($item)
{
// Get description, intro_image, author and date
$app = JFactory::getApplication();
$params = $app->getParams();
$item->description = '';
$obj = json_decode($item->images);
$introImage = isset($obj->{'image_intro'}) ? $obj->{'image_intro'} : '';
if (isset($introImage) && ($introImage != ''))
{
$image = preg_match('/http/', $introImage) ? $introImage : JURI::root() . $introImage;
$item->description = '<p><img src="' . $image . '" /></p>';
}
$item->description .= ($params->get('feed_summary', 0) ? $item->introtext . $item->fulltext : $item->introtext);
// Add readmore link to description if introtext is shown, show_readmore is true and fulltext exists
if (!$item->params->get('feed_summary', 0) && $item->params->get('feed_show_readmore', 0) && $item->fulltext)
{
// Compute the article slug
$item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id;
// URL link to article
$link = JRoute::_(
ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language),
true,
$app->get('force_ssl') == 2 ? \JRoute::TLS_FORCE : \JRoute::TLS_IGNORE,
true
);
$item->description .= '<p class="feed-readmore"><a target="_blank" href="' . $link . '">' . JText::_('COM_CONTENT_FEED_READMORE') . '</a></p>';
}
$item->author = $item->created_by_alias ?: $item->author;
}
}
views/category/tmpl/blog_item.php 0000604 00000010077 15245530277 0013157 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Create a shortcut for params.
$params = $this->item->params;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$canEdit = $this->item->params->get('access-edit');
$info = $params->get('info_block_position', 0);
// Check if associations are implemented. If they are, define the parameter.
$assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));
$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
$isUnpublished = ($this->item->state == 0 || $this->item->publish_up > $currentDate)
|| ($this->item->publish_down < $currentDate && $this->item->publish_down !== JFactory::getDbo()->getNullDate());
?>
<?php if ($isUnpublished) : ?>
<div class="system-unpublished">
<?php endif; ?>
<?php echo JLayoutHelper::render('joomla.content.blog_style_default_item_title', $this->item); ?>
<?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
<?php echo JLayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $this->item, 'print' => false)); ?>
<?php endif; ?>
<?php // Todo Not that elegant would be nice to group the params ?>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author') || $assocParam); ?>
<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?>
<?php endif; ?>
<?php if ($info == 0 && $params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?>
<?php endif; ?>
<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
<?php if (!$params->get('show_intro')) : ?>
<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
<?php echo $this->item->event->afterDisplayTitle; ?>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php echo $this->item->introtext; ?>
<?php if ($info == 1 || $info == 2) : ?>
<?php if ($useDefList) : ?>
<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?>
<?php endif; ?>
<?php if ($params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($params->get('show_readmore') && $this->item->readmore) :
if ($params->get('access-view')) :
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
else :
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false));
$link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)));
endif; ?>
<?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>
<?php endif; ?>
<?php if ($isUnpublished) : ?>
</div>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
<?php echo $this->item->event->afterDisplayContent; ?>
views/category/tmpl/blog_children.php 0000604 00000006731 15245530277 0014013 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('bootstrap.tooltip');
$class = ' class="first"';
$lang = JFactory::getLanguage();
$user = JFactory::getUser();
$groups = $user->getAuthorisedViewLevels();
if ($this->maxLevel != 0 && count($this->children[$this->category->id]) > 0) : ?>
<?php foreach ($this->children[$this->category->id] as $id => $child) : ?>
<?php // Check whether category access level allows access to subcategories. ?>
<?php if (in_array($child->access, $groups)) : ?>
<?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) :
if (!isset($this->children[$this->category->id][$id + 1])) :
$class = ' class="last"';
endif;
?>
<div<?php echo $class; ?>>
<?php $class = ''; ?>
<?php if ($lang->isRtl()) : ?>
<h3 class="page-header item-title">
<?php if ( $this->params->get('show_cat_num_articles', 1)) : ?>
<span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_CONTENT_NUM_ITEMS_TIP'); ?>">
<?php echo $child->getNumItems(true); ?>
</span>
<?php endif; ?>
<a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id)); ?>">
<?php echo $this->escape($child->title); ?></a>
<?php if ($this->maxLevel > 1 && count($child->getChildren()) > 0) : ?>
<a href="#category-<?php echo $child->id; ?>" data-toggle="collapse" class="btn btn-mini pull-right" aria-label="<?php echo JText::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"><span class="icon-plus" aria-hidden="true"></span></a>
<?php endif; ?>
</h3>
<?php else : ?>
<h3 class="page-header item-title"><a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id)); ?>">
<?php echo $this->escape($child->title); ?></a>
<?php if ( $this->params->get('show_cat_num_articles', 1)) : ?>
<span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_CONTENT_NUM_ITEMS_TIP'); ?>">
<?php echo JText::_('COM_CONTENT_NUM_ITEMS'); ?>
<?php echo $child->getNumItems(true); ?>
</span>
<?php endif; ?>
<?php if ($this->maxLevel > 1 && count($child->getChildren()) > 0) : ?>
<a href="#category-<?php echo $child->id; ?>" data-toggle="collapse" class="btn btn-mini pull-right" aria-label="<?php echo JText::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"><span class="icon-plus" aria-hidden="true"></span></a>
<?php endif; ?>
</h3>
<?php endif; ?>
<?php if ($this->params->get('show_subcat_desc') == 1) : ?>
<?php if ($child->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare', $child->description, '', 'com_content.category'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->maxLevel > 1 && count($child->getChildren()) > 0) : ?>
<div class="collapse fade" id="category-<?php echo $child->id; ?>">
<?php
$this->children[$child->id] = $child->getChildren();
$this->category = $child;
$this->maxLevel--;
echo $this->loadTemplate('children');
$this->category = $child->getParent();
$this->maxLevel++;
?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif;
views/category/tmpl/default_children.php 0000604 00000006635 15245530277 0014517 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('bootstrap.tooltip');
$class = ' class="first"';
$lang = JFactory::getLanguage();
$user = JFactory::getUser();
$groups = $user->getAuthorisedViewLevels();
?>
<?php if (count($this->children[$this->category->id]) > 0) : ?>
<?php foreach ($this->children[$this->category->id] as $id => $child) : ?>
<?php // Check whether category access level allows access to subcategories. ?>
<?php if (in_array($child->access, $groups)) : ?>
<?php
if ($this->params->get('show_empty_categories') || $child->getNumItems(true) || count($child->getChildren())) :
if (!isset($this->children[$this->category->id][$id + 1])) :
$class = ' class="last"';
endif;
?>
<div<?php echo $class; ?>>
<?php $class = ''; ?>
<?php if ($lang->isRtl()) : ?>
<h3 class="page-header item-title">
<?php if ( $this->params->get('show_cat_num_articles', 1)) : ?>
<span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_CONTENT_NUM_ITEMS_TIP'); ?>">
<?php echo $child->getNumItems(true); ?>
</span>
<?php endif; ?>
<a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id)); ?>">
<?php echo $this->escape($child->title); ?></a>
<?php if (count($child->getChildren()) > 0 && $this->maxLevel > 1) : ?>
<a href="#category-<?php echo $child->id; ?>" data-toggle="collapse" class="btn btn-mini pull-right" aria-label="<?php echo JText::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"><span class="icon-plus" aria-hidden="true"></span></a>
<?php endif; ?>
</h3>
<?php else : ?>
<h3 class="page-header item-title"><a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id)); ?>">
<?php echo $this->escape($child->title); ?></a>
<?php if ( $this->params->get('show_cat_num_articles', 1)) : ?>
<span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_CONTENT_NUM_ITEMS_TIP'); ?>">
<?php echo $child->getNumItems(true); ?>
</span>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0 && $this->maxLevel > 1) : ?>
<a href="#category-<?php echo $child->id; ?>" data-toggle="collapse" class="btn btn-mini pull-right" aria-label="<?php echo JText::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"><span class="icon-plus" aria-hidden="true"></span></a>
<?php endif; ?>
</h3>
<?php endif; ?>
<?php if ($this->params->get('show_subcat_desc') == 1) : ?>
<?php if ($child->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare', $child->description, '', 'com_content.category'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0 && $this->maxLevel > 1) : ?>
<div class="collapse fade" id="category-<?php echo $child->id; ?>">
<?php
$this->children[$child->id] = $child->getChildren();
$this->category = $child;
$this->maxLevel--;
echo $this->loadTemplate('children');
$this->category = $child->getParent();
$this->maxLevel++;
?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
views/category/tmpl/default_articles.php 0000604 00000032626 15245530277 0014534 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2009 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\CMS\Component\ComponentHelper;
use Joomla\CMS\Language\Multilanguage;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
// Create some shortcuts.
$n = count($this->items);
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$langFilter = false;
// Tags filtering based on language filter
if (($this->params->get('filter_field') === 'tag') && (Multilanguage::isEnabled()))
{
$tagfilter = ComponentHelper::getParams('com_tags')->get('tag_list_language_filter');
switch ($tagfilter)
{
case 'current_language' :
$langFilter = JFactory::getApplication()->getLanguage()->getTag();
break;
case 'all' :
$langFilter = false;
break;
default :
$langFilter = $tagfilter;
}
}
// Check for at least one editable article
$isEditable = false;
if (!empty($this->items))
{
foreach ($this->items as $article)
{
if ($article->params->get('access-edit'))
{
$isEditable = true;
break;
}
}
}
// For B/C we also add the css classes inline. This will be removed in 4.0.
JFactory::getDocument()->addStyleDeclaration('
.hide { display: none; }
.table-noheader { border-collapse: collapse; }
.table-noheader thead { display: none; }
');
$tableClass = $this->params->get('show_headings') != 1 ? ' table-noheader' : '';
$nullDate = JFactory::getDbo()->getNullDate();
$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
?>
<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm" class="form-inline">
<?php if ($this->params->get('filter_field') !== 'hide' || $this->params->get('show_pagination_limit')) : ?>
<fieldset class="filters btn-toolbar clearfix">
<legend class="hide"><?php echo JText::_('COM_CONTENT_FORM_FILTER_LEGEND'); ?></legend>
<?php if ($this->params->get('filter_field') !== 'hide') : ?>
<div class="btn-group">
<?php if ($this->params->get('filter_field') === 'tag') : ?>
<select name="filter_tag" id="filter_tag" onchange="document.adminForm.submit();">
<option value=""><?php echo JText::_('JOPTION_SELECT_TAG'); ?></option>
<?php echo JHtml::_('select.options', JHtml::_('tag.options', array('filter.published' => array(1), 'filter.language' => $langFilter), true), 'value', 'text', $this->state->get('filter.tag')); ?>
</select>
<?php elseif ($this->params->get('filter_field') === 'month') : ?>
<select name="filter-search" id="filter-search" onchange="document.adminForm.submit();">
<option value=""><?php echo JText::_('JOPTION_SELECT_MONTH'); ?></option>
<?php echo JHtml::_('select.options', JHtml::_('content.months', $this->state), 'value', 'text', $this->state->get('list.filter')); ?>
</select>
<?php else : ?>
<label class="filter-search-lbl element-invisible" for="filter-search">
<?php echo JText::_('COM_CONTENT_' . $this->params->get('filter_field') . '_FILTER_LABEL') . ' '; ?>
</label>
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" title="<?php echo JText::_('COM_CONTENT_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_CONTENT_' . $this->params->get('filter_field') . '_FILTER_LABEL'); ?>" />
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="btn-group pull-right">
<label for="limit" class="element-invisible">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
<input type="hidden" name="filter_order" value="" />
<input type="hidden" name="filter_order_Dir" value="" />
<input type="hidden" name="limitstart" value="" />
<input type="hidden" name="task" value="" />
</fieldset>
<div class="control-group hide pull-right">
<div class="controls">
<button type="submit" name="filter_submit" class="btn btn-primary"><?php echo JText::_('COM_CONTENT_FORM_FILTER_SUBMIT'); ?></button>
</div>
</div>
<?php endif; ?>
<?php if (empty($this->items)) : ?>
<?php if ($this->params->get('show_no_articles', 1)) : ?>
<p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p>
<?php endif; ?>
<?php else : ?>
<table class="category table table-striped table-bordered table-hover<?php echo $tableClass; ?>">
<caption class="hide"><?php echo JText::sprintf('COM_CONTENT_CATEGORY_LIST_TABLE_CAPTION', $this->category->title); ?></caption>
<thead>
<tr>
<th scope="col" id="categorylist_header_title">
<?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder, null, 'asc', '', 'adminForm'); ?>
</th>
<?php if ($date = $this->params->get('list_show_date')) : ?>
<th scope="col" id="categorylist_header_date">
<?php if ($date === 'created') : ?>
<?php echo JHtml::_('grid.sort', 'COM_CONTENT_' . $date . '_DATE', 'a.created', $listDirn, $listOrder); ?>
<?php elseif ($date === 'modified') : ?>
<?php echo JHtml::_('grid.sort', 'COM_CONTENT_' . $date . '_DATE', 'a.modified', $listDirn, $listOrder); ?>
<?php elseif ($date === 'published') : ?>
<?php echo JHtml::_('grid.sort', 'COM_CONTENT_' . $date . '_DATE', 'a.publish_up', $listDirn, $listOrder); ?>
<?php endif; ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('list_show_author')) : ?>
<th scope="col" id="categorylist_header_author">
<?php echo JHtml::_('grid.sort', 'JAUTHOR', 'author', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('list_show_hits')) : ?>
<th scope="col" id="categorylist_header_hits">
<?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?>
<th scope="col" id="categorylist_header_votes">
<?php echo JHtml::_('grid.sort', 'COM_CONTENT_VOTES', 'rating_count', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('list_show_ratings', 0) && $this->vote) : ?>
<th scope="col" id="categorylist_header_ratings">
<?php echo JHtml::_('grid.sort', 'COM_CONTENT_RATINGS', 'rating', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if ($isEditable) : ?>
<th scope="col" id="categorylist_header_edit"><?php echo JText::_('COM_CONTENT_EDIT_ITEM'); ?></th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php foreach ($this->items as $i => $article) : ?>
<?php if ($this->items[$i]->state == 0) : ?>
<tr class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
<?php else : ?>
<tr class="cat-list-row<?php echo $i % 2; ?>" >
<?php endif; ?>
<td headers="categorylist_header_title" class="list-title">
<?php if (in_array($article->access, $this->user->getAuthorisedViewLevels())) : ?>
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language)); ?>">
<?php echo $this->escape($article->title); ?>
</a>
<?php if (JLanguageAssociations::isEnabled() && $this->params->get('show_associations')) : ?>
<?php $associations = ContentHelperAssociation::displayAssociations($article->id); ?>
<?php foreach ($associations as $association) : ?>
<?php if ($this->params->get('flags', 1) && $association['language']->image) : ?>
<?php $flag = JHtml::_('image', 'mod_languages/' . $association['language']->image . '.gif', $association['language']->title_native, array('title' => $association['language']->title_native), true); ?>
<a href="<?php echo JRoute::_($association['item']); ?>"><?php echo $flag; ?></a>
<?php else : ?>
<?php $class = 'label label-association label-' . $association['language']->sef; ?>
<a class="<?php echo $class; ?>" href="<?php echo JRoute::_($association['item']); ?>"><?php echo strtoupper($association['language']->sef); ?></a>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php else : ?>
<?php
echo $this->escape($article->title) . ' : ';
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false));
$link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language)));
?>
<a href="<?php echo $link; ?>" class="register">
<?php echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE'); ?>
</a>
<?php if (JLanguageAssociations::isEnabled() && $this->params->get('show_associations')) : ?>
<?php $associations = ContentHelperAssociation::displayAssociations($article->id); ?>
<?php foreach ($associations as $association) : ?>
<?php if ($this->params->get('flags', 1)) : ?>
<?php $flag = JHtml::_('image', 'mod_languages/' . $association['language']->image . '.gif', $association['language']->title_native, array('title' => $association['language']->title_native), true); ?>
<a href="<?php echo JRoute::_($association['item']); ?>"><?php echo $flag; ?></a>
<?php else : ?>
<?php $class = 'label label-association label-' . $association['language']->sef; ?>
<a class="' . <?php echo $class; ?> . '" href="<?php echo JRoute::_($association['item']); ?>"><?php echo strtoupper($association['language']->sef); ?></a>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($article->state == 0) : ?>
<span class="list-published label label-warning">
<?php echo JText::_('JUNPUBLISHED'); ?>
</span>
<?php endif; ?>
<?php if ($article->publish_up > $currentDate) : ?>
<span class="list-published label label-warning">
<?php echo JText::_('JNOTPUBLISHEDYET'); ?>
</span>
<?php endif; ?>
<?php if ($article->publish_down < $currentDate && $article->publish_down !== $nullDate) : ?>
<span class="list-published label label-warning">
<?php echo JText::_('JEXPIRED'); ?>
</span>
<?php endif; ?>
</td>
<?php if ($this->params->get('list_show_date')) : ?>
<td headers="categorylist_header_date" class="list-date small">
<?php
echo JHtml::_(
'date', $article->displayDate,
$this->escape($this->params->get('date_format', JText::_('DATE_FORMAT_LC3')))
); ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('list_show_author', 1)) : ?>
<td headers="categorylist_header_author" class="list-author">
<?php if (!empty($article->author) || !empty($article->created_by_alias)) : ?>
<?php $author = $article->author ?>
<?php $author = $article->created_by_alias ?: $author; ?>
<?php if (!empty($article->contact_link) && $this->params->get('link_author') == true) : ?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', $article->contact_link, $author)); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
<?php endif; ?>
<?php endif; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('list_show_hits', 1)) : ?>
<td headers="categorylist_header_hits" class="list-hits">
<span class="badge badge-info">
<?php echo JText::sprintf('JGLOBAL_HITS_COUNT', $article->hits); ?>
</span>
</td>
<?php endif; ?>
<?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?>
<td headers="categorylist_header_votes" class="list-votes">
<span class="badge badge-success">
<?php echo JText::sprintf('COM_CONTENT_VOTES_COUNT', $article->rating_count); ?>
</span>
</td>
<?php endif; ?>
<?php if ($this->params->get('list_show_ratings', 0) && $this->vote) : ?>
<td headers="categorylist_header_ratings" class="list-ratings">
<span class="badge badge-warning">
<?php echo JText::sprintf('COM_CONTENT_RATINGS_COUNT', $article->rating); ?>
</span>
</td>
<?php endif; ?>
<?php if ($isEditable) : ?>
<td headers="categorylist_header_edit" class="list-edit">
<?php if ($article->params->get('access-edit')) : ?>
<?php echo JHtml::_('icon.edit', $article, $article->params); ?>
<?php endif; ?>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php // Code to add a link to submit an article. ?>
<?php if ($this->category->getParams()->get('access-create')) : ?>
<?php echo JHtml::_('icon.create', $this->category, $this->category->params); ?>
<?php endif; ?>
<?php // Add pagination links ?>
<?php if (!empty($this->items)) : ?>
<?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
<div class="pagination">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter pull-right">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
</form>
views/category/tmpl/default.php 0000604 00000001023 15245530277 0012631 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');
?>
<div class="category-list<?php echo $this->pageclass_sfx; ?>">
<?php
$this->subtemplatename = 'articles';
echo JLayoutHelper::render('joomla.content.category_default', $this);
?>
</div>
views/category/tmpl/default.xml 0000604 00000042463 15245530277 0012657 0 ustar 00 <?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_CONTENT_CATEGORY_VIEW_DEFAULT_TITLE" option="COM_CONTENT_CATEGORY_VIEW_DEFAULT_OPTION">
<help
key = "JHELP_MENUS_MENU_ITEM_ARTICLE_CATEGORY_LIST"
/>
<message>
<![CDATA[COM_CONTENT_CATEGORY_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_categories/models/fields"
>
<field
name="id"
type="modal_category"
label="JGLOBAL_CHOOSE_CATEGORY_LABEL"
description="JGLOBAL_CHOOSE_CATEGORY_DESC"
extension="com_content"
required="true"
select="true"
new="true"
edit="true"
clear="true"
/>
<field
name="filter_tag"
type="tag"
label="JTAG"
description="JTAG_FIELD_SELECT_DESC"
multiple="true"
mode="nested"
/>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<fieldset name="basic" label="JGLOBAL_CATEGORY_OPTIONS">
<field
name="show_category_title"
type="list"
label="JGLOBAL_SHOW_CATEGORY_TITLE"
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_description"
type="list"
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_description_image"
type="list"
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="maxLevel"
type="list"
label="JGLOBAL_MAXLEVEL_LABEL"
description="JGLOBAL_MAXLEVEL_DESC"
useglobal="true"
>
<option value="-1">JALL</option>
<option value="0">JNONE</option>
<option value="1">J1</option>
<option value="2">J2</option>
<option value="3">J3</option>
<option value="4">J4</option>
<option value="5">J5</option>
</field>
<field
name="show_empty_categories"
type="list"
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
description="COM_CONTENT_SHOW_EMPTY_CATEGORIES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_no_articles"
type="list"
label="COM_CONTENT_NO_ARTICLES_LABEL"
description="COM_CONTENT_NO_ARTICLES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_category_heading_title_text"
type="list"
label="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_LABEL"
description="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_subcat_desc"
type="list"
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_cat_num_articles"
type="list"
label="COM_CONTENT_NUMBER_CATEGORY_ITEMS_LABEL"
description="COM_CONTENT_NUMBER_CATEGORY_ITEMS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_cat_tags"
type="list"
label="COM_CONTENT_FIELD_SHOW_CAT_TAGS_LABEL"
description="COM_CONTENT_FIELD_SHOW_CAT_TAGS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="page_subheading"
type="text"
label="JGLOBAL_SUBHEADING_LABEL"
description="JGLOBAL_SUBHEADING_DESC"
size="20"
/>
</fieldset>
<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS">
<field
name="show_pagination_limit"
type="list"
label="JGLOBAL_DISPLAY_SELECT_LABEL"
description="JGLOBAL_DISPLAY_SELECT_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="filter_field"
type="list"
label="JGLOBAL_FILTER_FIELD_LABEL"
description="JGLOBAL_FILTER_FIELD_DESC"
useglobal="true"
>
<option value="hide">JHIDE</option>
<option value="title">JGLOBAL_TITLE</option>
<option value="author">JAUTHOR</option>
<option value="hits">JGLOBAL_HITS</option>
<option value="tag">JTAG</option>
<option value="month">JMONTH_PUBLISHED</option>
</field>
<field
name="show_headings"
type="list"
label="JGLOBAL_SHOW_HEADINGS_LABEL"
description="JGLOBAL_SHOW_HEADINGS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="list_show_date"
type="list"
label="JGLOBAL_SHOW_DATE_LABEL"
description="JGLOBAL_SHOW_DATE_DESC"
useglobal="true"
>
<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="date_format"
type="text"
label="JGLOBAL_DATE_FORMAT_LABEL"
description="JGLOBAL_DATE_FORMAT_DESC"
size="15"
useglobal="true"
/>
<field
name="list_show_hits"
type="list"
label="JGLOBAL_LIST_HITS_LABEL"
description="JGLOBAL_LIST_HITS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="list_show_author"
type="list"
label="JGLOBAL_LIST_AUTHOR_LABEL"
description="JGLOBAL_LIST_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="list_show_votes"
type="list"
label="JGLOBAL_LIST_VOTES_LABEL"
description="JGLOBAL_LIST_VOTES_DESC"
class="btn-group btn-group-yesno"
useglobal="true"
>
<option value="1" requires="vote">JSHOW</option>
<option value="0" requires="vote">JHIDE</option>
</field>
<field
name="list_show_ratings"
type="list"
label="JGLOBAL_LIST_RATINGS_LABEL"
description="JGLOBAL_LIST_RATINGS_DESC"
class="btn-group btn-group-yesno"
useglobal="true"
>
<option value="1" requires="vote">JSHOW</option>
<option value="0" requires="vote">JHIDE</option>
</field>
<field
name="spacer1"
type="spacer"
hr="true"
/>
<field
name="orderby_pri"
type="list"
label="JGLOBAL_CATEGORY_ORDER_LABEL"
description="JGLOBAL_CATEGORY_ORDER_DESC"
useglobal="true"
>
<option value="none">JGLOBAL_NO_ORDER</option>
<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
<option value="order">JGLOBAL_CATEGORY_MANAGER_ORDER</option>
</field>
<field
name="orderby_sec"
type="list"
label="JGLOBAL_ARTICLE_ORDER_LABEL"
description="JGLOBAL_ARTICLE_ORDER_DESC"
useglobal="true"
>
<option value="front">COM_CONTENT_FEATURED_ORDER</option>
<option value="rdate">JGLOBAL_MOST_RECENT_FIRST</option>
<option value="date">JGLOBAL_OLDEST_FIRST</option>
<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
<option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option>
<option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option>
<option value="hits">JGLOBAL_MOST_HITS</option>
<option value="rhits">JGLOBAL_LEAST_HITS</option>
<option value="random">JGLOBAL_RANDOM_ORDER</option>
<option value="order">JGLOBAL_ORDERING</option>
<option value="rorder">JGLOBAL_REVERSE_ORDERING</option>
<option value="vote" requires="vote">JGLOBAL_VOTES_DESC</option>
<option value="rvote" requires="vote">JGLOBAL_VOTES_ASC</option>
<option value="rank" requires="vote"> JGLOBAL_RATINGS_DESC</option>
<option value="rrank" requires="vote">JGLOBAL_RATINGS_ASC</option>
</field>
<field
name="order_date"
type="list"
label="JGLOBAL_ORDERING_DATE_LABEL"
description="JGLOBAL_ORDERING_DATE_DESC"
useglobal="true"
>
<option value="created">JGLOBAL_CREATED</option>
<option value="modified">JGLOBAL_MODIFIED</option>
<option value="published">JPUBLISHED</option>
</field>
<field
name="show_pagination"
type="list"
label="JGLOBAL_PAGINATION_LABEL"
description="JGLOBAL_PAGINATION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">JGLOBAL_AUTO</option>
</field>
<field
name="show_pagination_results"
type="list"
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
description="JGLOBAL_PAGINATION_RESULTS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="display_num"
type="list"
label="JGLOBAL_NUMBER_ITEMS_LIST_LABEL"
description="JGLOBAL_NUMBER_ITEMS_LIST_DESC"
default="10"
>
<option value="5">J5</option>
<option value="10">J10</option>
<option value="15">J15</option>
<option value="20">J20</option>
<option value="25">J25</option>
<option value="30">J30</option>
<option value="50">J50</option>
<option value="100">J100</option>
<option value="0">JALL</option>
</field>
<field
name="show_featured"
type="list"
label="JGLOBAL_SHOW_FEATURED_ARTICLES_LABEL"
description="JGLOBAL_SHOW_FEATURED_ARTICLES_DESC"
useglobal="true"
default=""
>
<option value="show">JSHOW</option>
<option value="hide">JHIDE</option>
<option value="only">JONLY</option>
</field>
</fieldset>
<fieldset name="article" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">
<field
name="article_layout" type="componentlayout"
label="JGLOBAL_FIELD_LAYOUT_LABEL"
description="JGLOBAL_FIELD_LAYOUT_DESC"
menuitems="true"
extension="com_content"
view="article"
/>
<field
name="show_title"
type="list"
label="JGLOBAL_SHOW_TITLE_LABEL"
description="JGLOBAL_SHOW_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_titles"
type="list"
label="JGLOBAL_LINKED_TITLES_LABEL"
description="JGLOBAL_LINKED_TITLES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_intro"
type="list"
label="JGLOBAL_SHOW_INTRO_LABEL"
description="JGLOBAL_SHOW_INTRO_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_category"
type="list"
label="JGLOBAL_SHOW_CATEGORY_LABEL"
description="JGLOBAL_SHOW_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_category"
type="list"
label="JGLOBAL_LINK_CATEGORY_LABEL"
description="JGLOBAL_LINK_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_parent_category"
type="list"
label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL"
description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_parent_category"
type="list"
label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL"
description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_associations"
type="list"
label="JGLOBAL_SHOW_ASSOCIATIONS_LABEL"
description="JGLOBAL_SHOW_ASSOCIATIONS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_author"
type="list"
label="JGLOBAL_SHOW_AUTHOR_LABEL"
description="JGLOBAL_SHOW_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_author"
type="list"
label="JGLOBAL_LINK_AUTHOR_LABEL"
description="JGLOBAL_LINK_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_create_date"
type="list"
label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
description="JGLOBAL_SHOW_CREATE_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_modify_date"
type="list"
label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
description="JGLOBAL_SHOW_MODIFY_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_publish_date"
type="list"
label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_item_navigation"
type="list"
label="JGLOBAL_SHOW_NAVIGATION_LABEL"
description="JGLOBAL_SHOW_NAVIGATION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_vote"
type="list"
label="JGLOBAL_SHOW_VOTE_LABEL"
description="JGLOBAL_SHOW_VOTE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_readmore"
type="list"
label="JGLOBAL_SHOW_READMORE_LABEL"
description="JGLOBAL_SHOW_READMORE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_readmore_title"
type="list"
label="JGLOBAL_SHOW_READMORE_TITLE_LABEL"
description="JGLOBAL_SHOW_READMORE_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_icons"
type="list"
label="JGLOBAL_SHOW_ICONS_LABEL"
description="JGLOBAL_SHOW_ICONS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_print_icon"
type="list"
label="JGLOBAL_SHOW_PRINT_ICON_LABEL"
description="JGLOBAL_SHOW_PRINT_ICON_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_email_icon"
type="list"
label="JGLOBAL_SHOW_EMAIL_ICON_LABEL"
description="JGLOBAL_SHOW_EMAIL_ICON_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_hits"
type="list"
label="JGLOBAL_SHOW_HITS_LABEL"
description="JGLOBAL_SHOW_HITS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_noauth"
type="list"
label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL"
description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
<fieldset name="integration" label="COM_MENUS_INTEGRATION_FIELDSET_LABEL">
<field
name="show_feed_link"
type="list"
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
description="JGLOBAL_SHOW_FEED_LINK_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="feed_summary"
type="list"
label="JGLOBAL_FEED_SUMMARY_LABEL"
description="JGLOBAL_FEED_SUMMARY_DESC"
useglobal="true"
>
<option value="0">JGLOBAL_INTRO_TEXT</option>
<option value="1">JGLOBAL_FULL_TEXT</option>
</field>
</fieldset>
</fields>
</metadata>
views/category/tmpl/blog_links.php 0000604 00000001042 15245530277 0013331 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<ol class="nav nav-tabs nav-stacked">
<?php foreach ($this->link_items as &$item) : ?>
<li>
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); ?>">
<?php echo $item->title; ?></a>
</li>
<?php endforeach; ?>
</ol>
views/category/tmpl/blog.xml 0000604 00000045715 15245530277 0012161 0 ustar 00 <?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_CONTENT_CATEGORY_VIEW_BLOG_TITLE" option="COM_CONTENT_CATEGORY_VIEW_BLOG_OPTION">
<help key = "JHELP_MENUS_MENU_ITEM_ARTICLE_CATEGORY_BLOG" />
<message>
<![CDATA[COM_CONTENT_CATEGORY_VIEW_BLOG_DESC]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_categories/models/fields"
>
<field
name="id"
type="modal_category"
label="JGLOBAL_CHOOSE_CATEGORY_LABEL"
description="JGLOBAL_CHOOSE_CATEGORY_DESC"
extension="com_content"
required="true"
select="true"
new="true"
edit="true"
clear="true"
/>
<field
name="filter_tag"
type="tag"
label="JTAG"
description="JTAG_FIELD_SELECT_DESC"
multiple="true"
mode="nested"
/>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<fieldset name="basic" label="JGLOBAL_CATEGORY_OPTIONS">
<field
name="layout_type"
type="hidden"
default="blog"
/>
<field
name="show_category_heading_title_text"
type="list"
label="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_LABEL"
description="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_category_title"
type="list"
label="JGLOBAL_SHOW_CATEGORY_TITLE"
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_description"
type="list"
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_description_image"
type="list"
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="maxLevel"
type="list"
label="JGLOBAL_MAXLEVEL_LABEL"
description="JGLOBAL_MAXLEVEL_DESC"
useglobal="true"
>
<option value="-1">JALL</option>
<option value="0">JNONE</option>
<option value="1">J1</option>
<option value="2">J2</option>
<option value="3">J3</option>
<option value="4">J4</option>
<option value="5">J5</option>
</field>
<field
name="show_empty_categories"
type="list"
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
description="COM_CONTENT_SHOW_EMPTY_CATEGORIES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_no_articles"
type="list"
label="COM_CONTENT_NO_ARTICLES_LABEL"
description="COM_CONTENT_NO_ARTICLES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_subcat_desc"
type="list"
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_cat_num_articles"
type="list"
label="COM_CONTENT_NUMBER_CATEGORY_ITEMS_LABEL"
description="COM_CONTENT_NUMBER_CATEGORY_ITEMS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_cat_tags"
type="list"
label="COM_CONTENT_FIELD_SHOW_CAT_TAGS_LABEL"
description="COM_CONTENT_FIELD_SHOW_CAT_TAGS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="page_subheading"
type="text"
label="JGLOBAL_SUBHEADING_LABEL"
description="JGLOBAL_SUBHEADING_DESC"
size="20"
/>
</fieldset>
<fieldset name="advanced" label="JGLOBAL_BLOG_LAYOUT_OPTIONS">
<field
name="bloglayout"
type="spacer"
label="JGLOBAL_SUBSLIDER_BLOG_LAYOUT_LABEL"
class="text"
/>
<field
name="num_leading_articles"
type="number"
label="JGLOBAL_NUM_LEADING_ARTICLES_LABEL"
description="JGLOBAL_NUM_LEADING_ARTICLES_DESC"
useglobal="true"
size="3"
/>
<field
name="num_intro_articles"
type="number"
label="JGLOBAL_NUM_INTRO_ARTICLES_LABEL"
description="JGLOBAL_NUM_INTRO_ARTICLES_DESC"
useglobal="true"
size="3"
/>
<field
name="num_columns"
type="number"
label="JGLOBAL_NUM_COLUMNS_LABEL"
description="JGLOBAL_NUM_COLUMNS_DESC"
useglobal="true"
size="3"
/>
<field
name="num_links"
type="number"
label="JGLOBAL_NUM_LINKS_LABEL"
description="JGLOBAL_NUM_LINKS_DESC"
useglobal="true"
size="3"
/>
<field
name="multi_column_order"
type="list"
label="JGLOBAL_MULTI_COLUMN_ORDER_LABEL"
description="JGLOBAL_MULTI_COLUMN_ORDER_DESC"
useglobal="true"
>
<option value="0">JGLOBAL_DOWN</option>
<option value="1">JGLOBAL_ACROSS</option>
</field>
<field
name="show_subcategory_content"
type="list"
label="JGLOBAL_SHOW_SUBCATEGORY_CONTENT_LABEL"
description="JGLOBAL_SHOW_SUBCATEGORY_CONTENT_DESC"
useglobal="true"
>
<option value="0">JNONE</option>
<option value="-1">JALL</option>
<option value="1">J1</option>
<option value="2">J2</option>
<option value="3">J3</option>
<option value="4">J4</option>
<option value="5">J5</option>
</field>
<field
name="spacer1"
type="spacer"
hr="true"
/>
<field
name="orderby_pri"
type="list"
label="JGLOBAL_CATEGORY_ORDER_LABEL"
description="JGLOBAL_CATEGORY_ORDER_DESC"
useglobal="true"
>
<option value="none">JGLOBAL_NO_ORDER</option>
<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
<option value="order">JGLOBAL_CATEGORY_MANAGER_ORDER</option>
</field>
<field
name="orderby_sec"
type="list"
label="JGLOBAL_ARTICLE_ORDER_LABEL"
description="JGLOBAL_ARTICLE_ORDER_DESC"
useglobal="true"
>
<option value="front">COM_CONTENT_FEATURED_ORDER</option>
<option value="rdate">JGLOBAL_MOST_RECENT_FIRST</option>
<option value="date">JGLOBAL_OLDEST_FIRST</option>
<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
<option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option>
<option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option>
<option value="hits">JGLOBAL_MOST_HITS</option>
<option value="rhits">JGLOBAL_LEAST_HITS</option>
<option value="random">JGLOBAL_RANDOM_ORDER</option>
<option value="order">JGLOBAL_ORDERING</option>
<option value="rorder">JGLOBAL_REVERSE_ORDERING</option>
<option value="vote" requires="vote">JGLOBAL_VOTES_DESC</option>
<option value="rvote" requires="vote">JGLOBAL_VOTES_ASC</option>
<option value="rank" requires="vote">JGLOBAL_RATINGS_DESC</option>
<option value="rrank" requires="vote">JGLOBAL_RATINGS_ASC</option>
</field>
<field
name="order_date"
type="list"
label="JGLOBAL_ORDERING_DATE_LABEL"
description="JGLOBAL_ORDERING_DATE_DESC"
useglobal="true"
>
<option value="created">JGLOBAL_CREATED</option>
<option value="modified">JGLOBAL_MODIFIED</option>
<option value="published">JPUBLISHED</option>
<option value="unpublished">JUNPUBLISHED</option>
</field>
<field
name="show_pagination"
type="list"
label="JGLOBAL_PAGINATION_LABEL"
description="JGLOBAL_PAGINATION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">JGLOBAL_AUTO</option>
</field>
<field
name="show_pagination_results"
type="list"
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
description="JGLOBAL_PAGINATION_RESULTS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_featured"
type="list"
default=""
label="JGLOBAL_SHOW_FEATURED_ARTICLES_LABEL"
description="JGLOBAL_SHOW_FEATURED_ARTICLES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="show">JSHOW</option>
<option value="hide">JHIDE</option>
<option value="only">JONLY</option>
</field>
</fieldset>
<fieldset name="article" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">
<field
name="article_layout" type="componentlayout"
label="JGLOBAL_FIELD_LAYOUT_LABEL"
description="JGLOBAL_FIELD_LAYOUT_DESC"
menuitems="true"
extension="com_content"
view="article"
/>
<field
name="show_title"
type="list"
label="JGLOBAL_SHOW_TITLE_LABEL"
description="JGLOBAL_SHOW_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_titles"
type="list"
label="JGLOBAL_LINKED_TITLES_LABEL"
description="JGLOBAL_LINKED_TITLES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_intro"
type="list"
label="JGLOBAL_SHOW_INTRO_LABEL"
description="JGLOBAL_SHOW_INTRO_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="info_block_position"
type="list"
label="COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL"
description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">COM_CONTENT_FIELD_OPTION_ABOVE</option>
<option value="1">COM_CONTENT_FIELD_OPTION_BELOW</option>
<option value="2">COM_CONTENT_FIELD_OPTION_SPLIT</option>
</field>
<field
name="info_block_show_title"
type="list"
label="COM_CONTENT_FIELD_INFOBLOCK_TITLE_LABEL"
description="COM_CONTENT_FIELD_INFOBLOCK_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_category"
type="list"
label="JGLOBAL_SHOW_CATEGORY_LABEL"
description="JGLOBAL_SHOW_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_category"
type="list"
label="JGLOBAL_LINK_CATEGORY_LABEL"
description="JGLOBAL_LINK_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_parent_category"
type="list"
label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL"
description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_parent_category"
type="list"
label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL"
description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_associations"
type="list"
label="JGLOBAL_SHOW_ASSOCIATIONS_LABEL"
description="JGLOBAL_SHOW_ASSOCIATIONS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_author"
type="list"
label="JGLOBAL_SHOW_AUTHOR_LABEL"
description="JGLOBAL_SHOW_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_author"
type="list"
label="JGLOBAL_LINK_AUTHOR_LABEL"
description="JGLOBAL_LINK_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_create_date"
type="list"
label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
description="JGLOBAL_SHOW_CREATE_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_modify_date"
type="list"
label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
description="JGLOBAL_SHOW_MODIFY_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_publish_date"
type="list"
label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_item_navigation"
type="list"
label="JGLOBAL_SHOW_NAVIGATION_LABEL"
description="JGLOBAL_SHOW_NAVIGATION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_vote"
type="list"
label="JGLOBAL_SHOW_VOTE_LABEL"
description="JGLOBAL_SHOW_VOTE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_readmore"
type="list"
label="JGLOBAL_SHOW_READMORE_LABEL"
description="JGLOBAL_SHOW_READMORE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_readmore_title"
type="list"
label="JGLOBAL_SHOW_READMORE_TITLE_LABEL"
description="JGLOBAL_SHOW_READMORE_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_icons"
type="list"
label="JGLOBAL_SHOW_ICONS_LABEL"
description="JGLOBAL_SHOW_ICONS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_print_icon"
type="list"
label="JGLOBAL_SHOW_PRINT_ICON_LABEL"
description="JGLOBAL_SHOW_PRINT_ICON_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_email_icon"
type="list"
label="JGLOBAL_Show_Email_Icon_Label"
description="JGLOBAL_Show_Email_Icon_Desc"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_hits"
type="list"
label="JGLOBAL_SHOW_HITS_LABEL"
description="JGLOBAL_SHOW_HITS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_tags"
type="list"
label="COM_CONTENT_FIELD_SHOW_TAGS_LABEL"
description="COM_CONTENT_FIELD_SHOW_TAGS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_noauth"
type="list"
label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL"
description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
<fieldset name="integration" label="COM_MENUS_INTEGRATION_FIELDSET_LABEL">
<field
name="show_feed_link"
type="list"
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
description="JGLOBAL_SHOW_FEED_LINK_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="feed_summary"
type="list"
label="JGLOBAL_FEED_SUMMARY_LABEL"
description="JGLOBAL_FEED_SUMMARY_DESC"
useglobal="true"
>
<option value="0">JGLOBAL_INTRO_TEXT</option>
<option value="1">JGLOBAL_FULL_TEXT</option>
</field>
</fieldset>
</fields>
</metadata>
views/category/tmpl/blog.php 0000604 00000013331 15245530277 0012135 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');
$dispatcher = JEventDispatcher::getInstance();
$this->category->text = $this->category->description;
$dispatcher->trigger('onContentPrepare', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$this->category->description = $this->category->text;
$results = $dispatcher->trigger('onContentAfterTitle', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$afterDisplayTitle = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentBeforeDisplay', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$beforeDisplayContent = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentAfterDisplay', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$afterDisplayContent = trim(implode("\n", $results));
?>
<div class="blog<?php echo $this->pageclass_sfx; ?>" itemscope itemtype="https://schema.org/Blog">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_category_title', 1) or $this->params->get('page_subheading')) : ?>
<h2> <?php echo $this->escape($this->params->get('page_subheading')); ?>
<?php if ($this->params->get('show_category_title')) : ?>
<span class="subheading-category"><?php echo $this->category->title; ?></span>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php echo $afterDisplayTitle; ?>
<?php if ($this->params->get('show_cat_tags', 1) && !empty($this->category->tags->itemTags)) : ?>
<?php $this->category->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->category->tagLayout->render($this->category->tags->itemTags); ?>
<?php endif; ?>
<?php if ($beforeDisplayContent || $afterDisplayContent || $this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
<div class="category-desc clearfix">
<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
<img src="<?php echo $this->category->getParams()->get('image'); ?>" alt="<?php echo htmlspecialchars($this->category->getParams()->get('image_alt'), ENT_COMPAT, 'UTF-8'); ?>"/>
<?php endif; ?>
<?php echo $beforeDisplayContent; ?>
<?php if ($this->params->get('show_description') && $this->category->description) : ?>
<?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?>
<?php endif; ?>
<?php echo $afterDisplayContent; ?>
</div>
<?php endif; ?>
<?php if (empty($this->lead_items) && empty($this->link_items) && empty($this->intro_items)) : ?>
<?php if ($this->params->get('show_no_articles', 1)) : ?>
<p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p>
<?php endif; ?>
<?php endif; ?>
<?php $leadingcount = 0; ?>
<?php if (!empty($this->lead_items)) : ?>
<div class="items-leading clearfix">
<?php foreach ($this->lead_items as &$item) : ?>
<div class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</div>
<?php $leadingcount++; ?>
<?php endforeach; ?>
</div><!-- end items-leading -->
<?php endif; ?>
<?php
$introcount = count($this->intro_items);
$counter = 0;
?>
<?php if (!empty($this->intro_items)) : ?>
<?php foreach ($this->intro_items as $key => &$item) : ?>
<?php $rowcount = ((int) $key % (int) $this->columns) + 1; ?>
<?php if ($rowcount === 1) : ?>
<?php $row = $counter / $this->columns; ?>
<div class="items-row cols-<?php echo (int) $this->columns; ?> <?php echo 'row-' . $row; ?> row-fluid clearfix">
<?php endif; ?>
<div class="span<?php echo round(12 / $this->columns); ?>">
<div class="item column-<?php echo $rowcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</div>
<!-- end item -->
<?php $counter++; ?>
</div><!-- end span -->
<?php if (($rowcount == $this->columns) or ($counter == $introcount)) : ?>
</div><!-- end row -->
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if (!empty($this->link_items)) : ?>
<div class="items-more">
<?php echo $this->loadTemplate('links'); ?>
</div>
<?php endif; ?>
<?php if ($this->maxLevel != 0 && !empty($this->children[$this->category->id])) : ?>
<div class="cat-children">
<?php if ($this->params->get('show_category_heading_title_text', 1) == 1) : ?>
<h3> <?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?> </h3>
<?php endif; ?>
<?php echo $this->loadTemplate('children'); ?> </div>
<?php endif; ?>
<?php if (($this->params->def('show_pagination', 1) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 1)) : ?>
<div class="pagination">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter pull-right"> <?php echo $this->pagination->getPagesCounter(); ?> </p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?> </div>
<?php endif; ?>
</div>
views/article/view.html.php 0000604 00000010651 15245530277 0011763 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright (C) 2008 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* View to edit an article.
*
* @since 1.6
*/
class ContentViewArticle extends JViewLegacy
{
/**
* The JForm object
*
* @var JForm
*/
protected $form;
/**
* The active item
*
* @var object
*/
protected $item;
/**
* The model state
*
* @var object
*/
protected $state;
/**
* The actions the user is authorised to perform
*
* @var JObject
*/
protected $canDo;
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 1.6
*/
public function display($tpl = null)
{
if ($this->getLayout() == 'pagebreak')
{
return parent::display($tpl);
}
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->canDo = JHelperContent::getActions('com_content', 'article', $this->item->id);
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode("\n", $errors), 500);
}
// If we are forcing a language in modal (used for associations).
if ($this->getLayout() === 'modal' && $forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'cmd'))
{
// Set the language field to the forcedLanguage and disable changing it.
$this->form->setValue('language', null, $forcedLanguage);
$this->form->setFieldAttribute('language', 'readonly', 'true');
// Only allow to select categories with All language or with the forced language.
$this->form->setFieldAttribute('catid', 'language', '*,' . $forcedLanguage);
// Only allow to select tags with All language or with the forced language.
$this->form->setFieldAttribute('tags', 'language', '*,' . $forcedLanguage);
}
$this->addToolbar();
return parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$userId = $user->id;
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
// Built the actions for new and existing records.
$canDo = $this->canDo;
JToolbarHelper::title(
JText::_('COM_CONTENT_PAGE_' . ($checkedOut ? 'VIEW_ARTICLE' : ($isNew ? 'ADD_ARTICLE' : 'EDIT_ARTICLE'))),
'pencil-2 article-add'
);
// For new records, check the create permission.
if ($isNew && (count($user->getAuthorisedCategories('com_content', 'core.create')) > 0))
{
JToolbarHelper::apply('article.apply');
JToolbarHelper::save('article.save');
JToolbarHelper::save2new('article.save2new');
JToolbarHelper::cancel('article.cancel');
}
else
{
// Since it's an existing record, check the edit permission, or fall back to edit own if the owner.
$itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId);
// Can't save the record if it's checked out and editable
if (!$checkedOut && $itemEditable)
{
JToolbarHelper::apply('article.apply');
JToolbarHelper::save('article.save');
// We can save this record, but check the create permission to see if we can return to make a new one.
if ($canDo->get('core.create'))
{
JToolbarHelper::save2new('article.save2new');
}
}
// If checked out, we can still save
if ($canDo->get('core.create'))
{
JToolbarHelper::save2copy('article.save2copy');
}
if (JComponentHelper::isEnabled('com_contenthistory') && $this->state->params->get('save_history', 0) && $itemEditable)
{
JToolbarHelper::versions('com_content.article', $this->item->id);
}
if (JLanguageAssociations::isEnabled() && JComponentHelper::isEnabled('com_associations'))
{
JToolbarHelper::custom('article.editAssociations', 'contract', 'contract', 'JTOOLBAR_ASSOCIATIONS', false, false);
}
JToolbarHelper::cancel('article.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_CONTENT_ARTICLE_MANAGER_EDIT');
}
}
views/article/tmpl/default.xml 0000604 00000016540 15245530277 0012462 0 ustar 00 <?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_CONTENT_ARTICLE_VIEW_DEFAULT_TITLE" option="COM_CONTENT_ARTICLE_VIEW_DEFAULT_OPTION">
<help
key = "JHELP_MENUS_MENU_ITEM_ARTICLE_SINGLE_ARTICLE"
/>
<message>
<![CDATA[COM_CONTENT_ARTICLE_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_content/models/fields">
<field
name="id"
type="modal_article"
label="COM_CONTENT_FIELD_SELECT_ARTICLE_LABEL"
description="COM_CONTENT_FIELD_SELECT_ARTICLE_DESC"
required="true"
select="true"
new="true"
edit="true"
clear="true"
/>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<!-- Basic options. -->
<fieldset name="basic"
label="COM_CONTENT_ATTRIBS_ARTICLE_SETTINGS_LABEL">
<field
name="show_title"
type="list"
label="JGLOBAL_SHOW_TITLE_LABEL"
description="JGLOBAL_SHOW_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="link_titles"
type="list"
label="JGLOBAL_LINKED_TITLES_LABEL"
description="JGLOBAL_LINKED_TITLES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="show_intro"
type="list"
label="JGLOBAL_SHOW_INTRO_LABEL"
description="JGLOBAL_SHOW_INTRO_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="info_block_position"
type="list"
label="COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL"
description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC"
useglobal="true"
>
<option value="0">COM_CONTENT_FIELD_OPTION_ABOVE</option>
<option value="1">COM_CONTENT_FIELD_OPTION_BELOW</option>
<option value="2">COM_CONTENT_FIELD_OPTION_SPLIT</option>
</field>
<field
name="info_block_show_title"
type="list"
label="COM_CONTENT_FIELD_INFOBLOCK_TITLE_LABEL"
description="COM_CONTENT_FIELD_INFOBLOCK_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_category"
type="list"
label="JGLOBAL_SHOW_CATEGORY_LABEL"
description="JGLOBAL_SHOW_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="link_category"
type="list"
label="JGLOBAL_LINK_CATEGORY_LABEL"
description="JGLOBAL_LINK_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="show_parent_category"
type="list"
label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL"
description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="link_parent_category"
type="list"
label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL"
description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="show_associations"
type="list"
label="JGLOBAL_SHOW_ASSOCIATIONS_LABEL"
description="JGLOBAL_SHOW_ASSOCIATIONS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_author"
type="list"
label="JGLOBAL_SHOW_AUTHOR_LABEL"
description="JGLOBAL_SHOW_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="link_author"
type="list"
label="JGLOBAL_LINK_AUTHOR_LABEL"
description="JGLOBAL_LINK_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="show_create_date"
type="list"
label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
description="JGLOBAL_SHOW_CREATE_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_modify_date"
type="list"
label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
description="JGLOBAL_SHOW_MODIFY_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_publish_date"
type="list"
label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_item_navigation"
type="list"
label="JGLOBAL_SHOW_NAVIGATION_LABEL"
description="JGLOBAL_SHOW_NAVIGATION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_vote"
type="list"
label="JGLOBAL_SHOW_VOTE_LABEL"
description="JGLOBAL_SHOW_VOTE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_icons"
type="list"
label="JGLOBAL_SHOW_ICONS_LABEL"
description="JGLOBAL_SHOW_ICONS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_print_icon"
type="list"
label="JGLOBAL_SHOW_PRINT_ICON_LABEL"
description="JGLOBAL_SHOW_PRINT_ICON_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_email_icon"
type="list"
label="JGLOBAL_SHOW_EMAIL_ICON_LABEL"
description="JGLOBAL_SHOW_EMAIL_ICON_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_hits"
type="list"
label="JGLOBAL_SHOW_HITS_LABEL"
description="JGLOBAL_SHOW_HITS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_tags"
type="list"
label="JGLOBAL_SHOW_TAGS_LABEL"
description="JGLOBAL_SHOW_TAGS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_noauth"
type="list"
label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL"
description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="urls_position"
type="list"
label="COM_CONTENT_FIELD_URLSPOSITION_LABEL"
description="COM_CONTENT_FIELD_URLSPOSITION_DESC"
useglobal="true"
>
<option value="0">COM_CONTENT_FIELD_OPTION_ABOVE</option>
<option value="1">COM_CONTENT_FIELD_OPTION_BELOW</option>
</field>
</fieldset>
</fields>
</metadata>
views/article/tmpl/default.php 0000604 00000016200 15245530277 0012442 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
// Create shortcuts to some parameters.
$params = $this->item->params;
$urls = json_decode($this->item->urls);
$canEdit = $params->get('access-edit');
$user = JFactory::getUser();
$info = $params->get('info_block_position', 0);
// Check if associations are implemented. If they are, define the parameter.
$assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));
JHtml::_('behavior.caption');
$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
$isNotPublishedYet = $this->item->publish_up > $currentDate;
$isExpired = $this->item->publish_down < $currentDate && $this->item->publish_down !== JFactory::getDbo()->getNullDate();
?>
<div class="item-page<?php echo $this->pageclass_sfx; ?>" itemscope itemtype="https://schema.org/Article">
<meta itemprop="inLanguage" content="<?php echo ($this->item->language === '*') ? JFactory::getConfig()->get('language') : $this->item->language; ?>" />
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
</div>
<?php endif;
if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && $this->item->paginationrelative)
{
echo $this->item->pagination;
}
?>
<?php // Todo Not that elegant would be nice to group the params ?>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author') || $assocParam); ?>
<?php if (!$useDefList && $this->print) : ?>
<div id="pop-print" class="btn hidden-print">
<?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
</div>
<div class="clearfix"> </div>
<?php endif; ?>
<?php if ($params->get('show_title')) : ?>
<div class="page-header">
<h2 itemprop="headline">
<?php echo $this->escape($this->item->title); ?>
</h2>
<?php if ($this->item->state == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<?php if ($isNotPublishedYet) : ?>
<span class="label label-warning"><?php echo JText::_('JNOTPUBLISHEDYET'); ?></span>
<?php endif; ?>
<?php if ($isExpired) : ?>
<span class="label label-warning"><?php echo JText::_('JEXPIRED'); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if (!$this->print) : ?>
<?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
<?php echo JLayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $this->item, 'print' => false)); ?>
<?php endif; ?>
<?php else : ?>
<?php if ($useDefList) : ?>
<div id="pop-print" class="btn hidden-print">
<?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
<?php echo $this->item->event->afterDisplayTitle; ?>
<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?>
<?php endif; ?>
<?php if ($info == 0 && $params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '0')) || ($params->get('urls_position') == '0' && empty($urls->urls_position)))
|| (empty($urls->urls_position) && (!$params->get('urls_position')))) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if ($params->get('access-view')) : ?>
<?php echo JLayoutHelper::render('joomla.content.full_image', $this->item); ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && !$this->item->paginationrelative) :
echo $this->item->pagination;
endif;
?>
<?php if (isset ($this->item->toc)) :
echo $this->item->toc;
endif; ?>
<div itemprop="articleBody">
<?php echo $this->item->text; ?>
</div>
<?php if ($info == 1 || $info == 2) : ?>
<?php if ($useDefList) : ?>
<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?>
<?php endif; ?>
<?php if ($params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && !$this->item->paginationrelative) :
echo $this->item->pagination;
?>
<?php endif; ?>
<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '1')) || ($params->get('urls_position') == '1'))) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php // Optional teaser intro text for guests ?>
<?php elseif ($params->get('show_noauth') == true && $user->get('guest')) : ?>
<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
<?php echo JHtml::_('content.prepare', $this->item->introtext); ?>
<?php // Optional link to let them register to see the whole article. ?>
<?php if ($params->get('show_readmore') && $this->item->fulltext != null) : ?>
<?php $menu = JFactory::getApplication()->getMenu(); ?>
<?php $active = $menu->getActive(); ?>
<?php $itemId = $active->id; ?>
<?php $link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); ?>
<?php $link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language))); ?>
<?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>
<?php endif; ?>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && $this->item->paginationrelative) :
echo $this->item->pagination;
?>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
<?php echo $this->item->event->afterDisplayContent; ?>
</div>
views/article/tmpl/default_links.php 0000604 00000005000 15245530277 0013636 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Create shortcut
$urls = json_decode($this->item->urls);
// Create shortcuts to some parameters.
$params = $this->item->params;
if ($urls && (!empty($urls->urla) || !empty($urls->urlb) || !empty($urls->urlc))) :
?>
<div class="content-links">
<ul class="nav nav-tabs nav-stacked">
<?php
$urlarray = array(
array($urls->urla, $urls->urlatext, $urls->targeta, 'a'),
array($urls->urlb, $urls->urlbtext, $urls->targetb, 'b'),
array($urls->urlc, $urls->urlctext, $urls->targetc, 'c')
);
foreach ($urlarray as $url) :
$link = $url[0];
$label = $url[1];
$target = $url[2];
$id = $url[3];
if ( ! $link) :
continue;
endif;
// If no label is present, take the link
$label = $label ?: $link;
// If no target is present, use the default
$target = $target ?: $params->get('target' . $id);
?>
<li class="content-links-<?php echo $id; ?>">
<?php
// Compute the correct link
switch ($target)
{
case 1:
// Open in a new window
echo '<a href="' . htmlspecialchars($link, ENT_COMPAT, 'UTF-8') . '" target="_blank" rel="nofollow noopener noreferrer">' .
htmlspecialchars($label, ENT_COMPAT, 'UTF-8') . '</a>';
break;
case 2:
// Open in a popup window
$attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600';
echo "<a href=\"" . htmlspecialchars($link, ENT_COMPAT, 'UTF-8') . "\" onclick=\"window.open(this.href, 'targetWindow', '" . $attribs . "'); return false;\" rel=\"noopener noreferrer\">" .
htmlspecialchars($label, ENT_COMPAT, 'UTF-8') . '</a>';
break;
case 3:
// Open in a modal window
JHtml::_('behavior.modal', 'a.modal');
echo '<a class="modal" href="' . htmlspecialchars($link, ENT_COMPAT, 'UTF-8') . '" rel="{handler: \'iframe\', size: {x:600, y:600}} noopener noreferrer">' .
htmlspecialchars($label, ENT_COMPAT, 'UTF-8') . ' </a>';
break;
default:
// Open in parent window
echo '<a href="' . htmlspecialchars($link, ENT_COMPAT, 'UTF-8') . '" rel="nofollow">' .
htmlspecialchars($label, ENT_COMPAT, 'UTF-8') . ' </a>';
break;
}
?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
views/categories/tmpl/default.php 0000604 00000002357 15245530277 0013154 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');
JHtml::_('behavior.core');
// Add strings for translations in Javascript.
JText::script('JGLOBAL_EXPAND_CATEGORIES');
JText::script('JGLOBAL_COLLAPSE_CATEGORIES');
JFactory::getDocument()->addScriptDeclaration("
jQuery(function($) {
$('.categories-list').find('[id^=category-btn-]').each(function(index, btn) {
var btn = $(btn);
btn.on('click', function() {
btn.find('span').toggleClass('icon-plus');
btn.find('span').toggleClass('icon-minus');
if (btn.attr('aria-label') === Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES'))
{
btn.attr('aria-label', Joomla.JText._('JGLOBAL_COLLAPSE_CATEGORIES'));
} else {
btn.attr('aria-label', Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES'));
}
});
});
});");
?>
<div class="categories-list<?php echo $this->pageclass_sfx; ?>">
<?php
echo JLayoutHelper::render('joomla.content.categories_default', $this);
echo $this->loadTemplate('items');
?>
</div>
views/categories/tmpl/default.xml 0000604 00000045431 15245530277 0013165 0 ustar 00 <?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_CONTENT_CATEGORIES_VIEW_DEFAULT_TITLE" option="COM_CONTENT_CATEGORIES_VIEW_DEFAULT_OPTION">
<help
key = "JHELP_MENUS_MENU_ITEM_ARTICLE_CATEGORIES"
/>
<message>
<![CDATA[COM_CONTENT_CATEGORIES_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset name="request"
>
<field
name="id"
type="category"
label="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_LABEL"
description="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_DESC"
extension="com_content"
show_root="true"
required="true"
/>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<fieldset name="basic" label="JGLOBAL_CATEGORIES_OPTIONS">
<field
name="show_base_description"
type="list"
label="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_LABEL"
description="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="categories_description"
type="textarea"
label="JGLOBAL_FIELD_CATEGORIES_DESC_LABEL"
description="JGLOBAL_FIELD_CATEGORIES_DESC_DESC"
cols="25"
rows="5"
/>
<field
name="maxLevelcat"
type="list"
label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
useglobal="true"
>
<option value="-1">JALL</option>
<option value="1">J1</option>
<option value="2">J2</option>
<option value="3">J3</option>
<option value="4">J4</option>
<option value="5">J5</option>
</field>
<field
name="show_empty_categories_cat"
type="list"
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
description="COM_CONTENT_SHOW_EMPTY_CATEGORIES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_subcat_desc_cat"
type="list"
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_cat_num_articles_cat"
type="list"
label="COM_CONTENT_NUMBER_CATEGORY_ITEMS_LABEL"
description="COM_CONTENT_NUMBER_CATEGORY_ITEMS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
<fieldset name="category" label="JGLOBAL_CATEGORY_OPTIONS">
<field
name="spacer3"
type="spacer"
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
class="text"
/>
<field
name="show_category_title"
type="list"
label="JGLOBAL_SHOW_CATEGORY_TITLE"
description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_description"
type="list"
label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_description_image"
type="list"
label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="maxLevel"
type="list"
label="JGLOBAL_MAXLEVEL_LABEL"
description="JGLOBAL_MAXLEVEL_DESC"
useglobal="true"
>
<option value="-1">JALL</option>
<option value="0">JNONE</option>
<option value="1">J1</option>
<option value="2">J2</option>
<option value="3">J3</option>
<option value="4">J4</option>
<option value="5">J5</option>
</field>
<field
name="show_empty_categories"
type="list"
label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
description="COM_CONTENT_SHOW_EMPTY_CATEGORIES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_no_articles"
type="list"
label="COM_CONTENT_NO_ARTICLES_LABEL"
description="COM_CONTENT_NO_ARTICLES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_subcat_desc"
type="list"
label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_cat_num_articles"
type="list"
label="COM_CONTENT_NUMBER_CATEGORY_ITEMS_LABEL"
description="COM_CONTENT_NUMBER_CATEGORY_ITEMS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
<fieldset name="blog" label="JGLOBAL_BLOG_LAYOUT_OPTIONS">
<field
name="spacer4"
type="spacer"
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
class="text"
/>
<field
name="num_leading_articles"
type="number"
label="JGLOBAL_NUM_LEADING_ARTICLES_LABEL"
description="JGLOBAL_NUM_LEADING_ARTICLES_DESC"
size="3"
useglobal="true"
/>
<field
name="num_intro_articles"
type="number"
label="JGLOBAL_NUM_INTRO_ARTICLES_LABEL"
description="JGLOBAL_NUM_INTRO_ARTICLES_DESC"
size="3"
useglobal="true"
/>
<field
name="num_columns"
type="number"
label="JGLOBAL_NUM_COLUMNS_LABEL"
description="JGLOBAL_NUM_COLUMNS_DESC"
size="3"
useglobal="true"
/>
<field
name="num_links"
type="number"
label="JGLOBAL_NUM_LINKS_LABEL"
description="JGLOBAL_NUM_LINKS_DESC"
size="3"
useglobal="true"
/>
<field
name="multi_column_order"
type="list"
description="JGLOBAL_MULTI_COLUMN_ORDER_DESC"
label="JGLOBAL_MULTI_COLUMN_ORDER_LABEL"
useglobal="true"
>
<option value="0">JGLOBAL_DOWN</option>
<option value="1">JGLOBAL_ACROSS</option>
</field>
<field
name="show_subcategory_content"
type="list"
label="JGLOBAL_SHOW_SUBCATEGORY_CONTENT_LABEL"
description="JGLOBAL_SHOW_SUBCATEGORY_CONTENT_DESC"
useglobal="true"
>
<option value="0">JNONE</option>
<option value="-1">JALL</option>
<option value="1">J1</option>
<option value="2">J2</option>
<option value="3">J3</option>
<option value="4">J4</option>
<option value="5">J5</option>
</field>
<field
name="spacer5"
type="spacer"
hr="true"
/>
<field
name="orderby_pri"
type="list"
label="JGLOBAL_CATEGORY_ORDER_LABEL"
description="JGLOBAL_CATEGORY_ORDER_DESC"
useglobal="true"
>
<option value="none">JGLOBAL_NO_ORDER</option>
<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
<option value="order">JGLOBAL_CATEGORY_MANAGER_ORDER</option>
</field>
<field
name="orderby_sec"
type="list"
label="JGLOBAL_ARTICLE_ORDER_LABEL"
description="JGLOBAL_ARTICLE_ORDER_DESC"
useglobal="true"
>
<option value="front">COM_CONTENT_FEATURED_ORDER</option>
<option value="rdate">JGLOBAL_MOST_RECENT_FIRST</option>
<option value="date">JGLOBAL_OLDEST_FIRST</option>
<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
<option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option>
<option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option>
<option value="hits">JGLOBAL_MOST_HITS</option>
<option value="rhits">JGLOBAL_LEAST_HITS</option>
<option value="order">JGLOBAL_ORDERING</option>
<option value="rorder">JGLOBAL_REVERSE_ORDERING</option>
<option value="vote" requires="vote">JGLOBAL_VOTES_DESC</option>
<option value="rvote" requires="vote">JGLOBAL_VOTES_ASC</option>
<option value="rank" requires="vote">JGLOBAL_RATINGS_DESC</option>
<option value="rrank" requires="vote">JGLOBAL_RATINGS_ASC</option>
</field>
<field
name="order_date"
type="list"
label="JGLOBAL_ORDERING_DATE_LABEL"
description="JGLOBAL_ORDERING_DATE_DESC"
useglobal="true"
>
<option value="created">JGLOBAL_CREATED</option>
<option value="modified">JGLOBAL_MODIFIED</option>
<option value="published">JPUBLISHED</option>
</field>
</fieldset>
<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS" >
<field
name="spacer6"
type="spacer"
label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
class="text"
/>
<field
name="show_pagination_limit"
type="list"
label="JGLOBAL_DISPLAY_SELECT_LABEL"
description="JGLOBAL_DISPLAY_SELECT_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="filter_field"
type="list"
label="JGLOBAL_FILTER_FIELD_LABEL"
description="JGLOBAL_FILTER_FIELD_DESC"
useglobal="true"
>
<option value="hide">JHIDE</option>
<option value="title">JGLOBAL_TITLE</option>
<option value="author">JAUTHOR</option>
<option value="hits">JGLOBAL_HITS</option>
</field>
<field
name="show_headings"
type="list"
label="JGLOBAL_SHOW_HEADINGS_LABEL"
description="JGLOBAL_SHOW_HEADINGS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="list_show_date"
type="list"
label="JGLOBAL_SHOW_DATE_LABEL"
description="JGLOBAL_SHOW_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<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="date_format"
type="text"
label="JGLOBAL_DATE_FORMAT_LABEL"
description="JGLOBAL_DATE_FORMAT_DESC"
size="15"
useglobal="true"
/>
<field
name="list_show_hits"
type="list"
label="JGLOBAL_LIST_HITS_LABEL"
description="JGLOBAL_LIST_HITS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="list_show_author"
type="list"
label="JGLOBAL_LIST_AUTHOR_LABEL"
description="JGLOBAL_LIST_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="display_num"
type="list"
label="JGLOBAL_NUMBER_ITEMS_LIST_LABEL"
description="JGLOBAL_NUMBER_ITEMS_LIST_DESC"
default="10"
>
<option value="5">J5</option>
<option value="10">J10</option>
<option value="15">J15</option>
<option value="20">J20</option>
<option value="25">J25</option>
<option value="30">J30</option>
<option value="50">J50</option>
<option value="100">J100</option>
<option value="0">JALL</option>
</field>
</fieldset>
<fieldset name="shared" label="COM_CONTENT_SHARED_LABEL" description="COM_CONTENT_SHARED_DESC">
<field
name="show_pagination"
type="list"
label="JGLOBAL_PAGINATION_LABEL"
description="JGLOBAL_PAGINATION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">JGLOBAL_AUTO</option>
</field>
<field
name="show_pagination_results"
type="list"
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
description="JGLOBAL_PAGINATION_RESULTS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
<fieldset name="article" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">
<field
name="article_layout"
type="componentlayout"
label="JGLOBAL_FIELD_LAYOUT_LABEL"
description="JGLOBAL_FIELD_LAYOUT_DESC"
menuitems="true"
extension="com_content"
view="article"
/>
<field
name="show_title"
type="list"
label="JGLOBAL_SHOW_TITLE_LABEL"
description="JGLOBAL_SHOW_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_titles"
type="list"
label="JGLOBAL_LINKED_TITLES_LABEL"
description="JGLOBAL_LINKED_TITLES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_intro"
type="list"
label="JGLOBAL_SHOW_INTRO_LABEL"
description="JGLOBAL_SHOW_INTRO_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_category"
type="list"
label="JGLOBAL_SHOW_CATEGORY_LABEL"
description="JGLOBAL_SHOW_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_category"
type="list"
label="JGLOBAL_LINK_CATEGORY_LABEL"
description="JGLOBAL_LINK_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_parent_category"
type="list"
label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL"
description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_parent_category"
type="list"
label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL"
description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_author"
type="list"
label="JGLOBAL_SHOW_AUTHOR_LABEL"
description="JGLOBAL_SHOW_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_author"
type="list"
label="JGLOBAL_LINK_AUTHOR_LABEL"
description="JGLOBAL_LINK_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_create_date"
type="list"
label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
description="JGLOBAL_SHOW_CREATE_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_modify_date"
type="list"
label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
description="JGLOBAL_SHOW_MODIFY_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_publish_date"
type="list"
label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_item_navigation"
type="list"
label="JGLOBAL_SHOW_NAVIGATION_LABEL"
description="JGLOBAL_SHOW_NAVIGATION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_vote"
type="list"
label="JGLOBAL_SHOW_VOTE_LABEL"
description="JGLOBAL_SHOW_VOTE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_readmore"
type="list"
label="JGLOBAL_SHOW_READMORE_LABEL"
description="JGLOBAL_SHOW_READMORE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_readmore_title"
type="list"
label="JGLOBAL_SHOW_READMORE_TITLE_LABEL"
description="JGLOBAL_SHOW_READMORE_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_icons"
type="list"
label="JGLOBAL_SHOW_ICONS_LABEL"
description="JGLOBAL_SHOW_ICONS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_print_icon"
type="list"
label="JGLOBAL_SHOW_PRINT_ICON_LABEL"
description="JGLOBAL_SHOW_PRINT_ICON_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_email_icon"
type="list"
label="JGLOBAL_SHOW_EMAIL_ICON_LABEL"
description="JGLOBAL_SHOW_EMAIL_ICON_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_hits"
type="list"
label="JGLOBAL_SHOW_HITS_LABEL"
description="JGLOBAL_SHOW_HITS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_noauth"
type="list"
label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL"
description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
<fieldset name="integration">
<field
name="show_feed_link"
type="list"
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
description="JGLOBAL_SHOW_FEED_LINK_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="feed_summary"
type="list"
label="JGLOBAL_FEED_SUMMARY_LABEL"
description="JGLOBAL_FEED_SUMMARY_DESC"
useglobal="true"
>
<option value="0">JGLOBAL_INTRO_TEXT</option>
<option value="1">JGLOBAL_FULL_TEXT</option>
</field>
</fieldset>
</fields>
</metadata>
views/categories/tmpl/default_items.php 0000604 00000005175 15245530277 0014356 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('bootstrap.tooltip');
$class = ' class="first"';
if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) :
?>
<?php foreach ($this->items[$this->parent->id] as $id => $item) : ?>
<?php
if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) :
if (!isset($this->items[$this->parent->id][$id + 1]))
{
$class = ' class="last"';
}
?>
<div <?php echo $class; ?> >
<?php $class = ''; ?>
<h3 class="page-header item-title">
<a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->id, $item->language)); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php if ($this->params->get('show_cat_num_articles_cat') == 1) :?>
<span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_CONTENT_NUM_ITEMS_TIP'); ?>">
<?php echo JText::_('COM_CONTENT_NUM_ITEMS'); ?>
<?php echo $item->numitems; ?>
</span>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
<a id="category-btn-<?php echo $item->id; ?>" href="#category-<?php echo $item->id; ?>"
data-toggle="collapse" class="btn btn-mini pull-right" aria-label="<?php echo JText::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"><span class="icon-plus" aria-hidden="true"></span></a>
<?php endif; ?>
</h3>
<?php if ($this->params->get('show_description_image') && $item->getParams()->get('image')) : ?>
<img src="<?php echo $item->getParams()->get('image'); ?>" alt="<?php echo htmlspecialchars($item->getParams()->get('image_alt'), ENT_COMPAT, 'UTF-8'); ?>" />
<?php endif; ?>
<?php if ($this->params->get('show_subcat_desc_cat') == 1) : ?>
<?php if ($item->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare', $item->description, '', 'com_content.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
<div class="collapse fade" id="category-<?php echo $item->id; ?>">
<?php
$this->items[$item->id] = $item->getChildren();
$this->parent = $item;
$this->maxLevelcat--;
echo $this->loadTemplate('items');
$this->parent = $item->getParent();
$this->maxLevelcat++;
?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
views/categories/view.html.php 0000604 00000001170 15245530277 0012461 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Content categories view.
*
* @since 1.5
*/
class ContentViewCategories extends JViewCategories
{
/**
* Language key for default page heading
*
* @var string
* @since 3.2
*/
protected $pageHeading = 'JGLOBAL_ARTICLES';
/**
* @var string The name of the extension for the category
* @since 3.2
*/
protected $extension = 'com_content';
}
views/archive/view.html.php 0000604 00000013101 15245530277 0011752 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* HTML View class for the Content component
*
* @since 1.5
*/
class ContentViewArchive extends JViewLegacy
{
protected $state = null;
protected $item = null;
protected $items = null;
protected $pagination = null;
protected $years = null;
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*/
public function display($tpl = null)
{
$user = JFactory::getUser();
$state = $this->get('State');
$items = $this->get('Items');
$pagination = $this->get('Pagination');
// Flag indicates to not add limitstart=0 to URL
$pagination->hideEmptyLimitstart = true;
// Get the page/component configuration
$params = &$state->params;
JPluginHelper::importPlugin('content');
foreach ($items as $item)
{
$item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid;
$item->parent_slug = $item->parent_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id;
// No link for ROOT category
if ($item->parent_alias === 'root')
{
$item->parent_slug = null;
}
$item->event = new stdClass;
$dispatcher = JEventDispatcher::getInstance();
// Old plugins: Ensure that text property is available
if (!isset($item->text))
{
$item->text = $item->introtext;
}
$dispatcher->trigger('onContentPrepare', array ('com_content.archive', &$item, &$item->params, 0));
// Old plugins: Use processed text as introtext
$item->introtext = $item->text;
$results = $dispatcher->trigger('onContentAfterTitle', array('com_content.archive', &$item, &$item->params, 0));
$item->event->afterDisplayTitle = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content.archive', &$item, &$item->params, 0));
$item->event->beforeDisplayContent = trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentAfterDisplay', array('com_content.archive', &$item, &$item->params, 0));
$item->event->afterDisplayContent = trim(implode("\n", $results));
}
$form = new stdClass;
// Month Field
$months = array(
'' => JText::_('COM_CONTENT_MONTH'),
'1' => JText::_('JANUARY_SHORT'),
'2' => JText::_('FEBRUARY_SHORT'),
'3' => JText::_('MARCH_SHORT'),
'4' => JText::_('APRIL_SHORT'),
'5' => JText::_('MAY_SHORT'),
'6' => JText::_('JUNE_SHORT'),
'7' => JText::_('JULY_SHORT'),
'8' => JText::_('AUGUST_SHORT'),
'9' => JText::_('SEPTEMBER_SHORT'),
'10' => JText::_('OCTOBER_SHORT'),
'11' => JText::_('NOVEMBER_SHORT'),
'12' => JText::_('DECEMBER_SHORT')
);
$form->monthField = JHtml::_(
'select.genericlist',
$months,
'month',
array(
'list.attr' => 'size="1" class="inputbox"',
'list.select' => $state->get('filter.month'),
'option.key' => null
)
);
// Year Field
$this->years = $this->getModel()->getYears();
$years = array();
$years[] = JHtml::_('select.option', null, JText::_('JYEAR'));
for ($i = 0, $iMax = count($this->years); $i < $iMax; $i++)
{
$years[] = JHtml::_('select.option', $this->years[$i], $this->years[$i]);
}
$form->yearField = JHtml::_(
'select.genericlist',
$years,
'year',
array('list.attr' => 'size="1" class="inputbox"', 'list.select' => $state->get('filter.year'))
);
$form->limitField = $pagination->getLimitBox();
// Escape strings for HTML output
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx', ''));
$this->filter = $state->get('list.filter');
$this->form = &$form;
$this->items = &$items;
$this->params = &$params;
$this->user = &$user;
$this->pagination = &$pagination;
$this->pagination->setAdditionalUrlParam('month', $state->get('filter.month'));
$this->pagination->setAdditionalUrlParam('year', $state->get('filter.year'));
$this->_prepareDocument();
parent::display($tpl);
}
/**
* Prepares the document
*
* @return void
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading', JText::_('JGLOBAL_ARTICLES'));
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots', $this->params->get('robots'));
}
}
}
views/archive/tmpl/default_items.php 0000604 00000022415 15245530277 0013646 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
$params = $this->params;
?>
<div id="archive-items">
<?php foreach ($this->items as $i => $item) : ?>
<?php $info = $item->params->get('info_block_position', 0); ?>
<div class="row<?php echo $i % 2; ?>" itemscope itemtype="https://schema.org/Article">
<div class="page-header">
<h2 itemprop="headline">
<?php if ($params->get('link_titles')) : ?>
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); ?>" itemprop="url">
<?php echo $this->escape($item->title); ?>
</a>
<?php else : ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
</h2>
<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
<?php echo $item->event->afterDisplayTitle; ?>
<?php if ($params->get('show_author') && !empty($item->author )) : ?>
<div class="createdby" itemprop="author" itemscope itemtype="https://schema.org/Person">
<?php $author = $item->created_by_alias ?: $item->author; ?>
<?php $author = '<span itemprop="name">' . $author . '</span>'; ?>
<?php if (!empty($item->contact_link) && $params->get('link_author') == true) : ?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', $this->item->contact_link, $author, array('itemprop' => 'url'))); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category')); ?>
<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
<div class="article-info muted">
<dl class="article-info">
<dt class="article-info-term">
<?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?>
</dt>
<?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?>
<dd>
<div class="parent-category-name">
<?php $title = $this->escape($item->parent_title); ?>
<?php if ($params->get('link_parent_category') && !empty($item->parent_slug)) : ?>
<?php $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd>
<div class="category-name">
<?php $title = $this->escape($item->category_title); ?>
<?php if ($params->get('link_category') && $item->catslug) : ?>
<?php $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd>
<div class="published">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished">
<?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($info == 0) : ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd>
<div class="modified">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified">
<?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd>
<div class="create">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated">
<?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd>
<div class="hits">
<span class="icon-eye-open"></span>
<meta itemprop="interactionCount" content="UserPageVisits:<?php echo $item->hits; ?>" />
<?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $item->hits); ?>
</div>
</dd>
<?php endif; ?>
<?php endif; ?>
</dl>
</div>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
<?php echo $item->event->beforeDisplayContent; ?>
<?php if ($params->get('show_intro')) : ?>
<div class="intro" itemprop="articleBody"> <?php echo JHtml::_('string.truncateComplex', $item->introtext, $params->get('introtext_limit')); ?> </div>
<?php endif; ?>
<?php if ($useDefList && ($info == 1 || $info == 2)) : ?>
<div class="article-info muted">
<dl class="article-info">
<dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
<?php if ($info == 1) : ?>
<?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?>
<dd>
<div class="parent-category-name">
<?php $title = $this->escape($item->parent_title); ?>
<?php if ($params->get('link_parent_category') && $item->parent_slug) : ?>
<?php $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd>
<div class="category-name">
<?php $title = $this->escape($item->category_title); ?>
<?php if ($params->get('link_category') && $item->catslug) : ?>
<?php $url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?>
<?php endif; ?>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd>
<div class="published">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished">
<?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd>
<div class="create">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated">
<?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd>
<div class="modified">
<span class="icon-calendar" aria-hidden="true"></span>
<time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified">
<?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
</time>
</div>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd>
<div class="hits">
<span class="icon-eye-open"></span>
<meta content="UserPageVisits:<?php echo $item->hits; ?>" itemprop="interactionCount" />
<?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $item->hits); ?>
</div>
</dd>
<?php endif; ?>
</dl>
</div>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
<?php echo $item->event->afterDisplayContent; ?>
</div>
<?php endforeach; ?>
</div>
<div class="pagination">
<p class="counter"> <?php echo $this->pagination->getPagesCounter(); ?> </p>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
views/archive/tmpl/default.php 0000604 00000003412 15245530277 0012441 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.caption');
?>
<div class="archive<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<form id="adminForm" action="<?php echo JRoute::_('index.php'); ?>" method="post" class="form-inline">
<fieldset class="filters">
<div class="filter-search">
<?php if ($this->params->get('filter_field') !== 'hide') : ?>
<label class="filter-search-lbl element-invisible" for="filter-search"><?php echo JText::_('COM_CONTENT_TITLE_FILTER_LABEL') . ' '; ?></label>
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->filter); ?>" class="inputbox span2" onchange="document.getElementById('adminForm').submit();" placeholder="<?php echo JText::_('COM_CONTENT_TITLE_FILTER_LABEL'); ?>" />
<?php endif; ?>
<?php echo $this->form->monthField; ?>
<?php echo $this->form->yearField; ?>
<?php echo $this->form->limitField; ?>
<button type="submit" class="btn btn-primary" style="vertical-align: top;"><?php echo JText::_('JGLOBAL_FILTER_BUTTON'); ?></button>
<input type="hidden" name="view" value="archive" />
<input type="hidden" name="option" value="com_content" />
<input type="hidden" name="limitstart" value="0" />
</div>
<br />
</fieldset>
<?php echo $this->loadTemplate('items'); ?>
</form>
</div>
views/archive/tmpl/default.xml 0000604 00000017172 15245530277 0012462 0 ustar 00 <?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_CONTENT_ARCHIVE_VIEW_DEFAULT_TITLE" option="COM_CONTENT_ARCHIVE_VIEW_DEFAULT_OPTION">
<help
key = "JHELP_MENUS_MENU_ITEM_ARTICLE_ARCHIVED"
/>
<message>
<![CDATA[com_content_archive_view_default_desc]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_categories/models/fields"
>
<field
name="catid"
type="category"
extension="com_content"
multiple="true"
size="5"
label="JCATEGORY"
description="JFIELD_CATEGORY_DESC"
>
<option value="">JOPTION_ALL_CATEGORIES</option>
</field>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<!-- Basic options. -->
<fieldset name="basic" label="JGLOBAL_ARCHIVE_OPTIONS"
>
<field
name="orderby_sec"
type="list"
label="JGLOBAL_ARTICLE_ORDER_LABEL"
description="JGLOBAL_ARTICLE_ORDER_DESC"
default="alpha"
>
<option value="date">JGLOBAL_OLDEST_FIRST</option>
<option value="rdate">JGLOBAL_MOST_RECENT_FIRST</option>
<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
<option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option>
<option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option>
<option value="hits">JGLOBAL_MOST_HITS</option>
<option value="rhits">JGLOBAL_LEAST_HITS</option>
<option value="order">JGLOBAL_ARTICLE_MANAGER_ORDER</option>
<option value="vote" requires="vote">JGLOBAL_VOTES_DESC</option>
<option value="rvote" requires="vote">JGLOBAL_VOTES_ASC</option>
<option value="rank" requires="vote">JGLOBAL_RATINGS_DESC</option>
<option value="rrank" requires="vote">JGLOBAL_RATINGS_ASC</option>
</field>
<field
name="order_date"
type="list"
label="JGLOBAL_ORDERING_DATE_LABEL"
description="JGLOBAL_ORDERING_DATE_DESC"
default="created"
>
<option value="created">JGLOBAL_Created</option>
<option value="modified">JGLOBAL_Modified</option>
<option value="published">JPUBLISHED</option>
</field>
<field
name="display_num"
type="list"
label="JGLOBAL_NUMBER_ITEMS_LIST_LABEL"
description="JGLOBAL_NUMBER_ITEMS_LIST_DESC"
default="5"
>
<option value="5">J5</option>
<option value="10">J10</option>
<option value="15">J15</option>
<option value="20">J20</option>
<option value="25">J25</option>
<option value="30">J30</option>
<option value="50">J50</option>
<option value="100">J100</option>
<option value="0">JALL</option>
</field>
<field
name="filter_field"
type="list"
label="JGLOBAL_FILTER_FIELD_LABEL"
description="JGLOBAL_FILTER_FIELD_DESC"
default=""
useglobal="true"
>
<option value="hide">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="introtext_limit"
type="number"
label="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_LABEL"
description="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_DESC"
default="100"
/>
</fieldset>
<!-- Articles options. -->
<fieldset name="articles"
label="COM_CONTENT_ATTRIBS_ARTICLE_SETTINGS_LABEL"
>
<field
name="show_intro"
type="list"
label="JGLOBAL_SHOW_INTRO_LABEL"
description="JGLOBAL_SHOW_INTRO_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="info_block_position"
type="list"
label="COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL"
description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
<option value="0">COM_CONTENT_FIELD_OPTION_ABOVE</option>
<option value="1">COM_CONTENT_FIELD_OPTION_BELOW</option>
<option value="2">COM_CONTENT_FIELD_OPTION_SPLIT</option>
</field>
<field
name="info_block_show_title"
type="list"
label="COM_CONTENT_FIELD_INFOBLOCK_TITLE_LABEL"
description="COM_CONTENT_FIELD_INFOBLOCK_TITLE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_category"
type="list"
label="JGLOBAL_SHOW_CATEGORY_LABEL"
description="JGLOBAL_SHOW_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_category"
type="list"
label="JGLOBAL_LINK_CATEGORY_LABEL"
description="JGLOBAL_LINK_CATEGORY_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_parent_category"
type="list"
label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL"
description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"
useglobal="true"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_parent_category"
type="list"
label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL"
description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"
useglobal="true"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="link_titles"
type="list"
label="JGLOBAL_LINKED_TITLES_LABEL"
description="JGLOBAL_LINKED_TITLES_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_author"
type="list"
label="JGLOBAL_SHOW_AUTHOR_LABEL"
description="JGLOBAL_SHOW_AUTHOR_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="link_author"
type="list"
label="JGLOBAL_LINK_AUTHOR_LABEL"
description="JGLOBAL_LINK_AUTHOR_DESC"
useglobal="true"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field
name="show_create_date"
type="list"
label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
description="JGLOBAL_SHOW_CREATE_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_modify_date"
type="list"
label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
description="JGLOBAL_SHOW_MODIFY_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_publish_date"
type="list"
label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_item_navigation"
type="list"
label="JGLOBAL_SHOW_NAVIGATION_LABEL"
description="JGLOBAL_SHOW_NAVIGATION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_hits"
type="list"
label="JGLOBAL_SHOW_HITS_LABEL"
description="JGLOBAL_SHOW_HITS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
</fields>
</metadata>
views/featured/tmpl/default.xml 0000604 00000000322 15245530277 0012625 0 ustar 00 <?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_CONTENT_FEATURED_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_CONTENT_FEATURED_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>
views/featured/tmpl/default.php 0000604 00000032275 15245530277 0012630 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => JText::_('JOPTION_SELECT_ACCESS')));
JHtml::_('formbehavior.chosen', '.multipleAuthors', null, array('placeholder_text_multiple' => JText::_('JOPTION_SELECT_AUTHOR')));
JHtml::_('formbehavior.chosen', '.multipleCategories', null, array('placeholder_text_multiple' => JText::_('JOPTION_SELECT_CATEGORY')));
JHtml::_('formbehavior.chosen', '.multipleTags', null, array('placeholder_text_multiple' => JText::_('JOPTION_SELECT_TAG')));
JHtml::_('formbehavior.chosen', 'select');
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$saveOrder = $listOrder == 'fp.ordering';
$columns = 10;
if (strpos($listOrder, 'publish_up') !== false)
{
$orderingColumn = 'publish_up';
}
elseif (strpos($listOrder, 'publish_down') !== false)
{
$orderingColumn = 'publish_down';
}
else
{
$orderingColumn = 'created';
}
if ($saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_content&task=featured.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'articleList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_content&view=featured'); ?>" method="post" name="adminForm" id="adminForm">
<?php if (!empty( $this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php
// Search tools bar
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="articleList">
<thead>
<tr>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('searchtools.sort', '', 'fp.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="1%" class="center">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<th width="1%" style="min-width:55px" class="nowrap center">
<?php echo JHtml::_('searchtools.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder); ?>
</th>
<th>
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JAUTHOR', 'a.created_by', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder); ?>
</th>
<th width="10%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'COM_CONTENT_HEADING_DATE_' . strtoupper($orderingColumn), 'a.' . $orderingColumn, $listDirn, $listOrder); ?>
</th>
<th width="1%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
</th>
<?php if ($this->vote) : ?>
<?php $columns++; ?>
<th width="1%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_VOTES', 'rating_count', $listDirn, $listOrder); ?>
</th>
<?php $columns++; ?>
<th width="1%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGLOBAL_RATINGS', 'rating', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<th width="1%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="<?php echo $columns; ?>">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php $count = count($this->items); ?>
<?php foreach ($this->items as $i => $item) :
$item->max_ordering = 0;
$ordering = ($listOrder == 'fp.ordering');
$assetId = 'com_content.article.' . $item->id;
$canCreate = $user->authorise('core.create', 'com_content.category.' . $item->catid);
$canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id);
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0;
$canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin;
$canEditCat = $user->authorise('core.edit', 'com_content.category.' . $item->catid);
$canEditOwnCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->catid) && $item->category_uid == $userId;
$canEditParCat = $user->authorise('core.edit', 'com_content.category.' . $item->parent_category_id);
$canEditOwnParCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->parent_category_id) && $item->parent_category_uid == $userId;
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="order nowrap center hidden-phone">
<?php
$iconClass = '';
if (!$canChange)
{
$iconClass = ' inactive';
}
elseif (!$saveOrder)
{
$iconClass = ' inactive tip-top hasTooltip" title="' . JHtml::_('tooltipText', 'JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass ?>">
<span class="icon-menu" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order" />
<?php endif; ?>
</td>
<td class="center">
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
</td>
<td class="center">
<div class="btn-group">
<?php echo JHtml::_('jgrid.published', $item->state, $i, 'articles.', $canChange, 'cb', $item->publish_up, $item->publish_down); ?>
<?php echo JHtml::_('contentadministrator.featured', $item->featured, $i, $canChange); ?>
<?php // Create dropdown items and render the dropdown list.
if ($canChange)
{
JHtml::_('actionsdropdown.' . ((int) $item->state === 2 ? 'un' : '') . 'archive', 'cb' . $i, 'articles');
JHtml::_('actionsdropdown.' . ((int) $item->state === -2 ? 'un' : '') . 'trash', 'cb' . $i, 'articles');
echo JHtml::_('actionsdropdown.render', $this->escape($item->title));
}
?>
</div>
</td>
<td class="has-context">
<div class="pull-left break-word">
<?php if ($item->checked_out) : ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'articles.', $canCheckin); ?>
<?php endif; ?>
<?php if ($canEdit) : ?>
<a class="hasTooltip" href="<?php echo JRoute::_('index.php?option=com_content&task=article.edit&return=featured&id=' . $item->id); ?>" title="<?php echo JText::_('JACTION_EDIT'); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php else : ?>
<span title="<?php echo JText::sprintf('JFIELD_ALIAS_LABEL', $this->escape($item->alias)); ?>"><?php echo $this->escape($item->title); ?></span>
<?php endif; ?>
<span class="small break-word">
<?php if (empty($item->note)) : ?>
<?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->alias)); ?>
<?php else : ?>
<?php echo JText::sprintf('JGLOBAL_LIST_ALIAS_NOTE', $this->escape($item->alias), $this->escape($item->note)); ?>
<?php endif; ?>
</span>
<div class="small">
<?php
$ParentCatUrl = JRoute::_('index.php?option=com_categories&task=category.edit&id=' . $item->parent_category_id . '&extension=com_content');
$CurrentCatUrl = JRoute::_('index.php?option=com_categories&task=category.edit&id=' . $item->catid . '&extension=com_content');
$EditCatTxt = JText::_('COM_CONTENT_EDIT_CATEGORY');
echo JText::_('JCATEGORY') . ': ';
if ($item->category_level != '1') :
if ($item->parent_category_level != '1') :
echo ' » ';
endif;
endif;
if (JFactory::getLanguage()->isRtl())
{
if ($canEditCat || $canEditOwnCat) :
echo '<a class="hasTooltip" href="' . $CurrentCatUrl . '" title="' . $EditCatTxt . '">';
endif;
echo $this->escape($item->category_title);
if ($canEditCat || $canEditOwnCat) :
echo '</a>';
endif;
if ($item->category_level != '1') :
echo ' « ';
if ($canEditParCat || $canEditOwnParCat) :
echo '<a class="hasTooltip" href="' . $ParentCatUrl . '" title="' . $EditCatTxt . '">';
endif;
echo $this->escape($item->parent_category_title);
if ($canEditParCat || $canEditOwnParCat) :
echo '</a>';
endif;
endif;
}
else
{
if ($item->category_level != '1') :
if ($canEditParCat || $canEditOwnParCat) :
echo '<a class="hasTooltip" href="' . $ParentCatUrl . '" title="' . $EditCatTxt . '">';
endif;
echo $this->escape($item->parent_category_title);
if ($canEditParCat || $canEditOwnParCat) :
echo '</a>';
endif;
echo ' » ';
endif;
if ($canEditCat || $canEditOwnCat) :
echo '<a class="hasTooltip" href="' . $CurrentCatUrl . '" title="' . $EditCatTxt . '">';
endif;
echo $this->escape($item->category_title);
if ($canEditCat || $canEditOwnCat) :
echo '</a>';
endif;
}
?>
</div>
</div>
</td>
<td class="small hidden-phone">
<?php echo $this->escape($item->access_level); ?>
</td>
<td class="small hidden-phone">
<?php if ((int) $item->created_by != 0) : ?>
<?php if ($item->created_by_alias) : ?>
<a class="hasTooltip" href="<?php echo JRoute::_('index.php?option=com_users&task=user.edit&id=' . (int) $item->created_by); ?>" title="<?php echo JText::_('JAUTHOR'); ?>">
<?php echo $this->escape($item->author_name); ?></a>
<div class="smallsub"><?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->created_by_alias)); ?></div>
<?php else : ?>
<a class="hasTooltip" href="<?php echo JRoute::_('index.php?option=com_users&task=user.edit&id=' . (int) $item->created_by); ?>" title="<?php echo JText::_('JAUTHOR'); ?>">
<?php echo $this->escape($item->author_name); ?></a>
<?php endif; ?>
<?php else : ?>
<?php if ($item->created_by_alias) : ?>
<?php echo JText::_('JNONE'); ?>
<div class="smallsub"><?php echo JText::sprintf('JGLOBAL_LIST_ALIAS', $this->escape($item->created_by_alias)); ?></div>
<?php else : ?>
<?php echo JText::_('JNONE'); ?>
<?php endif; ?>
<?php endif; ?>
</td>
<td class="small hidden-phone">
<?php echo JLayoutHelper::render('joomla.content.language', $item); ?>
</td>
<td class="nowrap small hidden-phone">
<?php
$date = $item->{$orderingColumn};
echo $date > 0 ? JHtml::_('date', $date, JText::_('DATE_FORMAT_LC4')) : '-';
?>
</td>
<td class="center hidden-phone">
<span class="badge badge-info">
<?php echo (int) $item->hits; ?>
</span>
</td>
<?php if ($this->vote) : ?>
<td class="hidden-phone">
<span class="badge badge-success" >
<?php echo (int) $item->rating_count; ?>
</span>
</td>
<td class="hidden-phone">
<span class="badge badge-warning" >
<?php echo (int) $item->rating; ?>
</span>
</td>
<?php endif; ?>
<td class="center hidden-phone">
<?php echo (int) $item->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="featured" value="1" />
<input type="hidden" name="boxchecked" value="0" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
views/featured/tmpl/default_item.php 0000604 00000011460 15245530277 0013637 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Create a shortcut for params.
$params = &$this->item->params;
$canEdit = $this->item->params->get('access-edit');
$info = $this->item->params->get('info_block_position', 0);
// Check if associations are implemented. If they are, define the parameter.
$assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));
$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
$isExpired = $this->item->publish_down < $currentDate && $this->item->publish_down !== JFactory::getDbo()->getNullDate();
$isNotPublishedYet = $this->item->publish_up > $currentDate;
$isUnpublished = $this->item->state == 0 || $isNotPublishedYet || $isExpired;
?>
<?php if ($isUnpublished) : ?>
<div class="system-unpublished">
<?php endif; ?>
<?php if ($params->get('show_title')) : ?>
<h2 class="item-title" itemprop="headline">
<?php if ($params->get('link_titles') && $params->get('access-view')) : ?>
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); ?>" itemprop="url">
<?php echo $this->escape($this->item->title); ?>
</a>
<?php else : ?>
<?php echo $this->escape($this->item->title); ?>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php if ($this->item->state == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<?php if ($isNotPublishedYet) : ?>
<span class="label label-warning"><?php echo JText::_('JNOTPUBLISHEDYET'); ?></span>
<?php endif; ?>
<?php if ($isExpired) : ?>
<span class="label label-warning"><?php echo JText::_('JEXPIRED'); ?></span>
<?php endif; ?>
<?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
<?php echo JLayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $this->item, 'print' => false)); ?>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
<?php echo $this->item->event->afterDisplayTitle; ?>
<?php // Todo Not that elegant would be nice to group the params ?>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author') || $assocParam); ?>
<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?>
<?php endif; ?>
<?php if ($info == 0 && $params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?>
<?php endif; ?>
<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
<?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php echo $this->item->introtext; ?>
<?php if ($info == 1 || $info == 2) : ?>
<?php if ($useDefList) : ?>
<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?>
<?php endif; ?>
<?php if ($params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($params->get('show_readmore') && $this->item->readmore) :
if ($params->get('access-view')) :
$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
else :
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false));
$link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)));
endif; ?>
<?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>
<?php endif; ?>
<?php if ($isUnpublished) : ?>
</div>
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
<?php echo $this->item->event->afterDisplayContent; ?>
views/featured/tmpl/default_links.php 0000604 00000001033 15245530277 0014014 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<ol class="nav nav-tabs nav-stacked">
<?php foreach ($this->link_items as &$item) : ?>
<li>
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); ?>">
<?php echo $item->title; ?></a>
</li>
<?php endforeach; ?>
</ol>
views/featured/view.feed.php 0000604 00000006620 15245530277 0012077 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Frontpage View class
*
* @since 1.5
*/
class ContentViewFeatured extends JViewLegacy
{
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*/
public function display($tpl = null)
{
// Parameters
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$params = $app->getParams();
$feedEmail = $app->get('feed_email', 'none');
$siteEmail = $app->get('mailfrom');
$doc->link = JRoute::_('index.php?option=com_content&view=featured');
// Get some data from the model
$app->input->set('limit', $app->get('feed_limit'));
$categories = JCategories::getInstance('Content');
$rows = $this->get('Items');
foreach ($rows as $row)
{
// Strip html from feed item title
$title = $this->escape($row->title);
$title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
// Compute the article slug
$row->slug = $row->alias ? ($row->id . ':' . $row->alias) : $row->id;
// URL link to article
$link = ContentHelperRoute::getArticleRoute($row->slug, $row->catid, $row->language);
$description = '';
$obj = json_decode($row->images);
$introImage = isset($obj->{'image_intro'}) ? $obj->{'image_intro'} : '';
if (isset($introImage) && ($introImage != ''))
{
$image = preg_match('/http/', $introImage) ? $introImage : JURI::root() . $introImage;
$description = '<p><img src="' . $image . '" /></p>';
}
$description .= ($params->get('feed_summary', 0) ? $row->introtext . $row->fulltext : $row->introtext);
$author = $row->created_by_alias ?: $row->author;
// Load individual item creator class
$item = new JFeedItem;
$item->title = $title;
$item->link = \JRoute::_($link);
$item->date = $row->publish_up;
$item->category = array();
// All featured articles are categorized as "Featured"
$item->category[] = JText::_('JFEATURED');
for ($item_category = $categories->get($row->catid); $item_category !== null; $item_category = $item_category->getParent())
{
// Only add non-root categories
if ($item_category->id > 1)
{
$item->category[] = $item_category->title;
}
}
$item->author = $author;
if ($feedEmail === 'site')
{
$item->authorEmail = $siteEmail;
}
elseif ($feedEmail === 'author')
{
$item->authorEmail = $row->author_email;
}
// Add readmore link to description if introtext is shown, show_readmore is true and fulltext exists
if (!$params->get('feed_summary', 0) && $params->get('feed_show_readmore', 0) && $row->fulltext)
{
$link = \JRoute::_($link, true, $app->get('force_ssl') == 2 ? \JRoute::TLS_FORCE : \JRoute::TLS_IGNORE, true);
$description .= '<p class="feed-readmore"><a target="_blank" href="' . $link . '">' . JText::_('COM_CONTENT_FEED_READMORE') . '</a></p>';
}
// Load item description and add div
$item->description = '<div class="feed-description">' . $description . '</div>';
// Loads item info into rss array
$doc->addItem($item);
}
}
}
views/featured/view.html.php 0000604 00000011031 15245530277 0012130 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* View class for a list of featured articles.
*
* @since 1.6
*/
class ContentViewFeatured extends JViewLegacy
{
/**
* The item authors
*
* @var stdClass
*
* @deprecated 4.0 To be removed with Hathor
*/
protected $authors;
/**
* An array of items
*
* @var array
*/
protected $items;
/**
* The pagination object
*
* @var JPagination
*/
protected $pagination;
/**
* The model state
*
* @var object
*/
protected $state;
/**
* Form object for search filters
*
* @var JForm
*/
public $filterForm;
/**
* The active search filters
*
* @var array
*/
public $activeFilters;
/**
* The sidebar markup
*
* @var string
*/
protected $sidebar;
/**
* Display the view
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*/
public function display($tpl = null)
{
ContentHelper::addSubmenu('featured');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->authors = $this->get('Authors');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->vote = JPluginHelper::isEnabled('content', 'vote');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode("\n", $errors), 500);
}
// Levels filter - Used in Hathor.
// @deprecated 4.0 To be removed with Hathor
$this->f_levels = array(
JHtml::_('select.option', '1', JText::_('J1')),
JHtml::_('select.option', '2', JText::_('J2')),
JHtml::_('select.option', '3', JText::_('J3')),
JHtml::_('select.option', '4', JText::_('J4')),
JHtml::_('select.option', '5', JText::_('J5')),
JHtml::_('select.option', '6', JText::_('J6')),
JHtml::_('select.option', '7', JText::_('J7')),
JHtml::_('select.option', '8', JText::_('J8')),
JHtml::_('select.option', '9', JText::_('J9')),
JHtml::_('select.option', '10', JText::_('J10')),
);
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
return parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = JHelperContent::getActions('com_content', 'category', $this->state->get('filter.category_id'));
JToolbarHelper::title(JText::_('COM_CONTENT_FEATURED_TITLE'), 'star featured');
if ($canDo->get('core.create'))
{
JToolbarHelper::addNew('article.add');
}
if ($canDo->get('core.edit'))
{
JToolbarHelper::editList('article.edit');
}
if ($canDo->get('core.edit.state'))
{
JToolbarHelper::publish('articles.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('articles.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::custom('articles.unfeatured', 'unfeatured.png', 'featured_f2.png', 'JUNFEATURE', true);
JToolbarHelper::archiveList('articles.archive');
JToolbarHelper::checkin('articles.checkin');
}
if ($state->get('filter.published') == -2 && $canDo->get('core.delete'))
{
JToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'articles.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($canDo->get('core.edit.state'))
{
JToolbarHelper::trash('articles.trash');
}
if ($canDo->get('core.admin') || $canDo->get('core.options'))
{
JToolbarHelper::preferences('com_content');
}
JToolbarHelper::help('JHELP_CONTENT_FEATURED_ARTICLES');
}
/**
* Returns an array of fields the table can be sorted by
*
* @return array Array containing the field name to sort by as the key and display text as value
*
* @since 3.0
*/
protected function getSortFields()
{
return array(
'fp.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.state' => JText::_('JSTATUS'),
'a.title' => JText::_('JGLOBAL_TITLE'),
'category_title' => JText::_('JCATEGORY'),
'access_level' => JText::_('JGRID_HEADING_ACCESS'),
'a.created_by' => JText::_('JAUTHOR'),
'language' => JText::_('JGRID_HEADING_LANGUAGE'),
'a.created' => JText::_('JDATE'),
'a.id' => JText::_('JGRID_HEADING_ID'),
);
}
}
controller.php 0000604 00000002755 15245530277 0007457 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Component Controller
*
* @since 1.5
*/
class ContentController extends JControllerLegacy
{
/**
* The default view.
*
* @var string
* @since 1.6
*/
protected $default_view = 'articles';
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return ContentController This object to support chaining.
*
* @since 1.5
*/
public function display($cachable = false, $urlparams = array())
{
$view = $this->input->get('view', 'articles');
$layout = $this->input->get('layout', 'articles');
$id = $this->input->getInt('id');
// Check for edit form.
if ($view == 'article' && $layout == 'edit' && !$this->checkEditId('com_content.edit.article', $id))
{
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_content&view=articles', false));
return false;
}
return parent::display();
}
}
controllers/article.php 0000604 00000006357 15245530277 0011267 0 ustar 00 <?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright (C) 2009 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;
/**
* The article controller
*
* @since 1.6
*/
class ContentControllerArticle extends JControllerForm
{
/**
* Class constructor.
*
* @param array $config A named array of configuration variables.
*
* @since 1.6
*/
public function __construct($config = array())
{
parent::__construct($config);
// An article edit form can come from the articles or featured view.
// Adjust the redirect view on the value of 'return' in the request.
if ($this->input->get('return') == 'featured')
{
$this->view_list = 'featured';
$this->view_item = 'article&return=featured';
}
}
/**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
*
* @return boolean
*
* @since 1.6
*/
protected function allowAdd($data = array())
{
$categoryId = ArrayHelper::getValue($data, 'catid', $this->input->getInt('filter_category_id'), 'int');
$allow = null;
if ($categoryId)
{
// If the category has been passed in the data or URL check it.
$allow = JFactory::getUser()->authorise('core.create', 'com_content.category.' . $categoryId);
}
if ($allow === null)
{
// In the absence of better information, revert to the component permissions.
return parent::allowAdd();
}
return $allow;
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
*
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$user = JFactory::getUser();
// Zero record (id:0), return component edit permission by calling parent controller method
if (!$recordId)
{
return parent::allowEdit($data, $key);
}
// Check edit on the record asset (explicit or inherited)
if ($user->authorise('core.edit', 'com_content.article.' . $recordId))
{
return true;
}
// Check edit own on the record asset (explicit or inherited)
if ($user->authorise('core.edit.own', 'com_content.article.' . $recordId))
{
// Existing record already has an owner, get it
$record = $this->getModel()->getItem($recordId);
if (empty($record))
{
return false;
}
// Grant if current user is owner of the record
return $user->id == $record->created_by;
}
return false;
}
/**
* Method to run batch operations.
*
* @param object $model The model.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 1.6
*/
public function batch($model = null)
{
$this->checkToken();
// Set the model
/** @var ContentModelArticle $model */
$model = $this->getModel('Article', '', array());
// Preset the redirect
$this->setRedirect(JRoute::_('index.php?option=com_content&view=articles' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
}
helpers/association.php 0000604 00000010327 15245530277 0011244 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2012 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('ContentHelper', JPATH_ADMINISTRATOR . '/components/com_content/helpers/content.php');
JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php');
JLoader::register('CategoryHelperAssociation', JPATH_ADMINISTRATOR . '/components/com_categories/helpers/association.php');
/**
* Content Component Association Helper
*
* @since 3.0
*/
abstract class ContentHelperAssociation extends CategoryHelperAssociation
{
/**
* Method to get the associations for a given item
*
* @param integer $id Id of the item
* @param string $view Name of the view
* @param string $layout View layout
*
* @return array Array of associations for the item
*
* @since 3.0
*/
public static function getAssociations($id = 0, $view = null, $layout = null)
{
$jinput = JFactory::getApplication()->input;
$view = $view === null ? $jinput->get('view') : $view;
$component = $jinput->getCmd('option');
$id = empty($id) ? $jinput->getInt('id') : $id;
if ($layout === null && $jinput->get('view') == $view && $component == 'com_content')
{
$layout = $jinput->get('layout', '', 'string');
}
if ($view === 'article')
{
if ($id)
{
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
$db = JFactory::getDbo();
$advClause = array();
// Filter by user groups
$advClause[] = 'c2.access IN (' . $groups . ')';
// Filter by current language
$advClause[] = 'c2.language != ' . $db->quote(JFactory::getLanguage()->getTag());
if (!$user->authorise('core.edit.state', 'com_content') && !$user->authorise('core.edit', 'com_content'))
{
// Filter by start and end dates.
$nullDate = $db->quote($db->getNullDate());
$date = JFactory::getDate();
$nowDate = $db->quote($date->toSql());
$advClause[] = '(c2.publish_up = ' . $nullDate . ' OR c2.publish_up <= ' . $nowDate . ')';
$advClause[] = '(c2.publish_down = ' . $nullDate . ' OR c2.publish_down >= ' . $nowDate . ')';
// Filter by published
$advClause[] = 'c2.state = 1';
}
$associations = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', $id, 'id', 'alias', 'catid', $advClause);
$return = array();
foreach ($associations as $tag => $item)
{
$return[$tag] = ContentHelperRoute::getArticleRoute($item->id, (int) $item->catid, $item->language, $layout);
}
return $return;
}
}
if ($view === 'category' || $view === 'categories')
{
return self::getCategoryAssociations($id, 'com_content', $layout);
}
return array();
}
/**
* Method to display in frontend the associations for a given article
*
* @param integer $id Id of the article
*
* @return array An array containing the association URL and the related language object
*
* @since 3.7.0
*/
public static function displayAssociations($id)
{
$return = array();
if ($associations = self::getAssociations($id, 'article'))
{
$levels = JFactory::getUser()->getAuthorisedViewLevels();
$languages = JLanguageHelper::getLanguages();
foreach ($languages as $language)
{
// Do not display language when no association
if (empty($associations[$language->lang_code]))
{
continue;
}
// Do not display language without frontend UI
if (!array_key_exists($language->lang_code, JLanguageHelper::getInstalledLanguages(0)))
{
continue;
}
// Do not display language without specific home menu
if (!array_key_exists($language->lang_code, JLanguageMultilang::getSiteHomePages()))
{
continue;
}
// Do not display language without authorized access level
if (isset($language->access) && $language->access && !in_array($language->access, $levels))
{
continue;
}
$return[$language->lang_code] = array('item' => $associations[$language->lang_code], 'language' => $language);
}
}
return $return;
}
}
helpers/route.php 0000604 00000004124 15245530277 0010064 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Content Component Route Helper.
*
* @since 1.5
*/
abstract class ContentHelperRoute
{
/**
* Get the article route.
*
* @param integer $id The route of the content item.
* @param integer $catid The category ID.
* @param integer $language The language code.
* @param string $layout The layout value.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getArticleRoute($id, $catid = 0, $language = 0, $layout = null)
{
// Create the link
$link = 'index.php?option=com_content&view=article&id=' . $id;
if ((int) $catid > 1)
{
$link .= '&catid=' . $catid;
}
if ($language && $language !== '*' && JLanguageMultilang::isEnabled())
{
$link .= '&lang=' . $language;
}
if ($layout)
{
$link .= '&layout=' . $layout;
}
return $link;
}
/**
* Get the category route.
*
* @param integer $catid The category ID.
* @param integer $language The language code.
* @param string $layout The layout value.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getCategoryRoute($catid, $language = 0, $layout = null)
{
if ($catid instanceof JCategoryNode)
{
$id = $catid->id;
}
else
{
$id = (int) $catid;
}
if ($id < 1)
{
return '';
}
$link = 'index.php?option=com_content&view=category&id=' . $id;
if ($language && $language !== '*' && JLanguageMultilang::isEnabled())
{
$link .= '&lang=' . $language;
}
if ($layout)
{
$link .= '&layout=' . $layout;
}
return $link;
}
/**
* Get the form route.
*
* @param integer $id The form ID.
*
* @return string The article route.
*
* @since 1.5
*/
public static function getFormRoute($id)
{
return 'index.php?option=com_content&task=article.edit&a_id=' . (int) $id;
}
}
helpers/icon.php 0000604 00000016773 15245530277 0007673 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2007 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;
/**
* Content Component HTML Helper
*
* @since 1.5
*/
abstract class JHtmlIcon
{
/**
* Method to generate a link to the create item page for the given category
*
* @param object $category The category information
* @param Registry $params The item parameters
* @param array $attribs Optional attributes for the link
* @param boolean $legacy True to use legacy images, false to use icomoon based graphic
*
* @return string The HTML markup for the create item link
*/
public static function create($category, $params, $attribs = array(), $legacy = false)
{
$uri = JUri::getInstance();
$url = 'index.php?option=com_content&task=article.add&return=' . base64_encode($uri) . '&a_id=0&catid=' . $category->id;
$text = JLayoutHelper::render('joomla.content.icons.create', array('params' => $params, 'legacy' => $legacy));
// Add the button classes to the attribs array
if (isset($attribs['class']))
{
$attribs['class'] .= ' btn btn-primary';
}
else
{
$attribs['class'] = 'btn btn-primary';
}
$button = JHtml::_('link', JRoute::_($url), $text, $attribs);
$output = '<span class="hasTooltip" title="' . JHtml::_('tooltipText', 'COM_CONTENT_CREATE_ARTICLE') . '">' . $button . '</span>';
return $output;
}
/**
* Method to generate a link to the email item page for the given article
*
* @param object $article The article information
* @param Registry $params The item parameters
* @param array $attribs Optional attributes for the link
* @param boolean $legacy True to use legacy images, false to use icomoon based graphic
*
* @return string The HTML markup for the email item link
*
* @deprecated 4.0 The functionality to email an article is removed in Joomla 4
*/
public static function email($article, $params, $attribs = array(), $legacy = false)
{
JLoader::register('MailtoHelper', JPATH_SITE . '/components/com_mailto/helpers/mailto.php');
$uri = JUri::getInstance();
$base = $uri->toString(array('scheme', 'host', 'port'));
$template = JFactory::getApplication()->getTemplate();
$link = $base . JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language), false);
$url = 'index.php?option=com_mailto&tmpl=component&template=' . $template . '&link=' . MailtoHelper::addLink($link);
$height = JFactory::getApplication()->get('captcha', '0') === '0' ? 450 : 550;
$status = 'width=400,height=' . $height . ',menubar=yes,resizable=yes';
$text = JLayoutHelper::render('joomla.content.icons.email', array('params' => $params, 'legacy' => $legacy));
$attribs['title'] = JText::_('JGLOBAL_EMAIL_TITLE');
$attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;";
$attribs['rel'] = 'nofollow';
return JHtml::_('link', JRoute::_($url), $text, $attribs);
}
/**
* Display an edit icon for the article.
*
* This icon will not display in a popup window, nor if the article is trashed.
* Edit access checks must be performed in the calling code.
*
* @param object $article The article information
* @param Registry $params The item parameters
* @param array $attribs Optional attributes for the link
* @param boolean $legacy True to use legacy images, false to use icomoon based graphic
*
* @return string The HTML for the article edit icon.
*
* @since 1.6
*/
public static function edit($article, $params, $attribs = array(), $legacy = false)
{
$user = JFactory::getUser();
$uri = JUri::getInstance();
// Ignore if in a popup window.
if ($params && $params->get('popup'))
{
return;
}
// Ignore if the state is negative (trashed).
if ($article->state < 0)
{
return;
}
// Show checked_out icon if the article is checked out by a different user
if (property_exists($article, 'checked_out')
&& property_exists($article, 'checked_out_time')
&& $article->checked_out > 0
&& $article->checked_out != $user->get('id'))
{
$checkoutUser = JFactory::getUser($article->checked_out);
$date = JHtml::_('date', $article->checked_out_time);
$tooltip = JText::_('JLIB_HTML_CHECKED_OUT') . ' :: ' . JText::sprintf('COM_CONTENT_CHECKED_OUT_BY', $checkoutUser->name)
. ' <br /> ' . $date;
$text = JLayoutHelper::render('joomla.content.icons.edit_lock', array('tooltip' => $tooltip, 'legacy' => $legacy));
$output = JHtml::_('link', '#', $text, $attribs);
return $output;
}
$contentUrl = ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language);
$url = $contentUrl . '&task=article.edit&a_id=' . $article->id . '&return=' . base64_encode($uri);
if ($article->state == 0)
{
$overlib = JText::_('JUNPUBLISHED');
}
else
{
$overlib = JText::_('JPUBLISHED');
}
$date = JHtml::_('date', $article->created);
$author = $article->created_by_alias ?: $article->author;
$overlib .= '<br />';
$overlib .= $date;
$overlib .= '<br />';
$overlib .= JText::sprintf('COM_CONTENT_WRITTEN_BY', htmlspecialchars($author, ENT_COMPAT, 'UTF-8'));
$text = JLayoutHelper::render('joomla.content.icons.edit', array('article' => $article, 'overlib' => $overlib, 'legacy' => $legacy));
$attribs['title'] = JText::_('JGLOBAL_EDIT_TITLE');
$output = JHtml::_('link', JRoute::_($url), $text, $attribs);
return $output;
}
/**
* Method to generate a popup link to print an article
*
* @param object $article The article information
* @param Registry $params The item parameters
* @param array $attribs Optional attributes for the link
* @param boolean $legacy True to use legacy images, false to use icomoon based graphic
*
* @return string The HTML markup for the popup link
*/
public static function print_popup($article, $params, $attribs = array(), $legacy = false)
{
$url = ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language);
$url .= '&tmpl=component&print=1&layout=default';
$status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no';
$text = JLayoutHelper::render('joomla.content.icons.print_popup', array('params' => $params, 'legacy' => $legacy));
$attribs['title'] = JText::sprintf('JGLOBAL_PRINT_TITLE', htmlspecialchars($article->title, ENT_QUOTES, 'UTF-8'));
$attribs['onclick'] = "window.open(this.href,'win2','" . $status . "'); return false;";
$attribs['rel'] = 'nofollow';
return JHtml::_('link', JRoute::_($url), $text, $attribs);
}
/**
* Method to generate a link to print an article
*
* @param object $article Not used, @deprecated for 4.0
* @param Registry $params The item parameters
* @param array $attribs Not used, @deprecated for 4.0
* @param boolean $legacy True to use legacy images, false to use icomoon based graphic
*
* @return string The HTML markup for the popup link
*/
public static function print_screen($article, $params, $attribs = array(), $legacy = false)
{
$text = JLayoutHelper::render('joomla.content.icons.print_screen', array('params' => $params, 'legacy' => $legacy));
return '<a href="#" onclick="window.print();return false;">' . $text . '</a>';
}
}
helpers/query.php 0000604 00000015411 15245530277 0010074 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2007 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Content Component Query Helper
*
* @since 1.5
*/
class ContentHelperQuery
{
/**
* Translate an order code to a field for primary category ordering.
*
* @param string $orderby The ordering code.
*
* @return string The SQL field(s) to order by.
*
* @since 1.5
*/
public static function orderbyPrimary($orderby)
{
switch ($orderby)
{
case 'alpha' :
$orderby = 'c.path, ';
break;
case 'ralpha' :
$orderby = 'c.path DESC, ';
break;
case 'order' :
$orderby = 'c.lft, ';
break;
default :
$orderby = '';
break;
}
return $orderby;
}
/**
* Translate an order code to a field for secondary category ordering.
*
* @param string $orderby The ordering code.
* @param string $orderDate The ordering code for the date.
*
* @return string The SQL field(s) to order by.
*
* @since 1.5
*/
public static function orderbySecondary($orderby, $orderDate = 'created')
{
$queryDate = self::getQueryDate($orderDate);
switch ($orderby)
{
case 'date' :
$orderby = $queryDate;
break;
case 'rdate' :
$orderby = $queryDate . ' DESC ';
break;
case 'alpha' :
$orderby = 'a.title';
break;
case 'ralpha' :
$orderby = 'a.title DESC';
break;
case 'hits' :
$orderby = 'a.hits DESC';
break;
case 'rhits' :
$orderby = 'a.hits';
break;
case 'order' :
$orderby = 'a.ordering';
break;
case 'rorder' :
$orderby = 'a.ordering DESC';
break;
case 'author' :
$orderby = 'author';
break;
case 'rauthor' :
$orderby = 'author DESC';
break;
case 'front' :
$orderby = 'a.featured DESC, fp.ordering, ' . $queryDate . ' DESC ';
break;
case 'random' :
$orderby = JFactory::getDbo()->getQuery(true)->Rand();
break;
case 'vote' :
$orderby = 'a.id DESC ';
if (JPluginHelper::isEnabled('content', 'vote'))
{
$orderby = 'rating_count DESC ';
}
break;
case 'rvote' :
$orderby = 'a.id ASC ';
if (JPluginHelper::isEnabled('content', 'vote'))
{
$orderby = 'rating_count ASC ';
}
break;
case 'rank' :
$orderby = 'a.id DESC ';
if (JPluginHelper::isEnabled('content', 'vote'))
{
$orderby = 'rating DESC ';
}
break;
case 'rrank' :
$orderby = 'a.id ASC ';
if (JPluginHelper::isEnabled('content', 'vote'))
{
$orderby = 'rating ASC ';
}
break;
default :
$orderby = 'a.ordering';
break;
}
return $orderby;
}
/**
* Translate an order code to a field for primary category ordering.
*
* @param string $orderDate The ordering code.
*
* @return string The SQL field(s) to order by.
*
* @since 1.6
*/
public static function getQueryDate($orderDate)
{
$db = JFactory::getDbo();
switch ($orderDate)
{
case 'modified' :
$queryDate = ' CASE WHEN a.modified = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.modified END';
break;
// Use created if publish_up is not set
case 'published' :
$queryDate = ' CASE WHEN a.publish_up = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END ';
break;
case 'unpublished' :
$queryDate = ' CASE WHEN a.publish_down = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_down END ';
break;
case 'created' :
default :
$queryDate = ' a.created ';
break;
}
return $queryDate;
}
/**
* Get join information for the voting query.
*
* @param \Joomla\Registry\Registry $params An options object for the article.
*
* @return array A named array with "select" and "join" keys.
*
* @since 1.5
*/
public static function buildVotingQuery($params = null)
{
if (!$params)
{
$params = JComponentHelper::getParams('com_content');
}
$voting = $params->get('show_vote');
if ($voting)
{
// Calculate voting count
$select = ' , ROUND(v.rating_sum / v.rating_count) AS rating, v.rating_count';
$join = ' LEFT JOIN #__content_rating AS v ON a.id = v.content_id';
}
else
{
$select = '';
$join = '';
}
return array('select' => $select, 'join' => $join);
}
/**
* Method to order the intro articles array for ordering
* down the columns instead of across.
* The layout always lays the introtext articles out across columns.
* Array is reordered so that, when articles are displayed in index order
* across columns in the layout, the result is that the
* desired article ordering is achieved down the columns.
*
* @param array &$articles Array of intro text articles
* @param integer $numColumns Number of columns in the layout
*
* @return array Reordered array to achieve desired ordering down columns
*
* @since 1.6
* @deprecated 4.0
*/
public static function orderDownColumns(&$articles, $numColumns = 1)
{
$count = count($articles);
// Just return the same array if there is nothing to change
if ($numColumns == 1 || !is_array($articles) || $count <= $numColumns)
{
$return = $articles;
}
// We need to re-order the intro articles array
else
{
// We need to preserve the original array keys
$keys = array_keys($articles);
$maxRows = ceil($count / $numColumns);
$numCells = $maxRows * $numColumns;
$numEmpty = $numCells - $count;
$index = array();
// Calculate number of empty cells in the array
// Fill in all cells of the array
// Put -1 in empty cells so we can skip later
for ($row = 1, $i = 1; $row <= $maxRows; $row++)
{
for ($col = 1; $col <= $numColumns; $col++)
{
if ($numEmpty > ($numCells - $i))
{
// Put -1 in empty cells
$index[$row][$col] = -1;
}
else
{
// Put in zero as placeholder
$index[$row][$col] = 0;
}
$i++;
}
}
// Layout the articles in column order, skipping empty cells
$i = 0;
for ($col = 1; ($col <= $numColumns) && ($i < $count); $col++)
{
for ($row = 1; ($row <= $maxRows) && ($i < $count); $row++)
{
if ($index[$row][$col] != - 1)
{
$index[$row][$col] = $keys[$i];
$i++;
}
}
}
// Now read the $index back row by row to get articles in right row/col
// so that they will actually be ordered down the columns (when read by row in the layout)
$return = array();
$i = 0;
for ($row = 1; ($row <= $maxRows) && ($i < $count); $row++)
{
for ($col = 1; ($col <= $numColumns) && ($i < $count); $col++)
{
$return[$keys[$i]] = $articles[$index[$row][$col]];
$i++;
}
}
}
return $return;
}
}
helpers/category.php 0000604 00000001175 15245530277 0010546 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Content Component Category Tree
*
* @since 1.6
*/
class ContentCategories extends JCategories
{
/**
* Class constructor
*
* @param array $options Array of options
*
* @since 1.7.0
*/
public function __construct($options = array())
{
$options['table'] = '#__content';
$options['extension'] = 'com_content';
parent::__construct($options);
}
}
helpers/legacyrouter.php 0000604 00000023557 15245530277 0011446 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Legacy routing rules class from com_content
*
* @since 3.6
* @deprecated 4.0
*/
class ContentRouterRulesLegacy implements JComponentRouterRulesInterface
{
/**
* Constructor for this legacy router
*
* @param JComponentRouterView $router The router this rule belongs to
*
* @since 3.6
* @deprecated 4.0
*/
public function __construct($router)
{
$this->router = $router;
}
/**
* Preprocess the route for the com_content component
*
* @param array &$query An array of URL arguments
*
* @return void
*
* @since 3.6
* @deprecated 4.0
*/
public function preprocess(&$query)
{
}
/**
* Build the route for the com_content component
*
* @param array &$query An array of URL arguments
* @param array &$segments The URL arguments to use to assemble the subsequent URL.
*
* @return void
*
* @since 3.6
* @deprecated 4.0
*/
public function build(&$query, &$segments)
{
// Get a menu item based on Itemid or currently active
$params = JComponentHelper::getParams('com_content');
$advanced = $params->get('sef_advanced_link', 0);
// We need a menu item. Either the one specified in the query, or the current active one if none specified
if (empty($query['Itemid']))
{
$menuItem = $this->router->menu->getActive();
$menuItemGiven = false;
}
else
{
$menuItem = $this->router->menu->getItem($query['Itemid']);
$menuItemGiven = true;
}
// Check again
if ($menuItemGiven && isset($menuItem) && $menuItem->component != 'com_content')
{
$menuItemGiven = false;
unset($query['Itemid']);
}
if (isset($query['view']))
{
$view = $query['view'];
}
else
{
// We need to have a view in the query or it is an invalid URL
return;
}
// Are we dealing with an article or category that is attached to a menu item?
if ($menuItem !== null
&& isset($menuItem->query['view'], $query['view'], $menuItem->query['id'], $query['id'])
&& $menuItem->query['view'] == $query['view']
&& $menuItem->query['id'] == (int) $query['id'])
{
unset($query['view']);
if (isset($query['catid']))
{
unset($query['catid']);
}
if (isset($query['layout']))
{
unset($query['layout']);
}
unset($query['id']);
return;
}
if ($view == 'category' || $view == 'article')
{
if (!$menuItemGiven)
{
$segments[] = $view;
}
unset($query['view']);
if ($view == 'article')
{
if (isset($query['id']) && isset($query['catid']) && $query['catid'])
{
$catid = $query['catid'];
// Make sure we have the id and the alias
if (strpos($query['id'], ':') === false)
{
$db = JFactory::getDbo();
$dbQuery = $db->getQuery(true)
->select('alias')
->from('#__content')
->where('id=' . (int) $query['id']);
$db->setQuery($dbQuery);
$alias = $db->loadResult();
$query['id'] = $query['id'] . ':' . $alias;
}
}
else
{
// We should have these two set for this view. If we don't, it is an error
return;
}
}
else
{
if (isset($query['id']))
{
$catid = $query['id'];
}
else
{
// We should have id set for this view. If we don't, it is an error
return;
}
}
if ($menuItemGiven && isset($menuItem->query['id']))
{
$mCatid = $menuItem->query['id'];
}
else
{
$mCatid = 0;
}
$categories = JCategories::getInstance('Content');
$category = $categories->get($catid);
if (!$category)
{
// We couldn't find the category we were given. Bail.
return;
}
$path = array_reverse($category->getPath());
$array = array();
foreach ($path as $id)
{
if ((int) $id == (int) $mCatid)
{
break;
}
list($tmp, $id) = explode(':', $id, 2);
$array[] = $id;
}
$array = array_reverse($array);
if (!$advanced && count($array))
{
$array[0] = (int) $catid . ':' . $array[0];
}
$segments = array_merge($segments, $array);
if ($view == 'article')
{
if ($advanced)
{
list($tmp, $id) = explode(':', $query['id'], 2);
}
else
{
$id = $query['id'];
}
$segments[] = $id;
}
unset($query['id'], $query['catid']);
}
if ($view == 'archive')
{
if (!$menuItemGiven)
{
$segments[] = $view;
unset($query['view']);
}
if (isset($query['year']))
{
if ($menuItemGiven)
{
$segments[] = $query['year'];
unset($query['year']);
}
}
if (isset($query['year']) && isset($query['month']))
{
if ($menuItemGiven)
{
$segments[] = $query['month'];
unset($query['month']);
}
}
}
if ($view == 'featured')
{
if (!$menuItemGiven)
{
$segments[] = $view;
}
unset($query['view']);
}
/*
* If the layout is specified and it is the same as the layout in the menu item, we
* unset it so it doesn't go into the query string.
*/
if (isset($query['layout']))
{
if ($menuItemGiven && isset($menuItem->query['layout']))
{
if ($query['layout'] == $menuItem->query['layout'])
{
unset($query['layout']);
}
}
else
{
if ($query['layout'] == 'default')
{
unset($query['layout']);
}
}
}
$total = count($segments);
for ($i = 0; $i < $total; $i++)
{
$segments[$i] = str_replace(':', '-', $segments[$i]);
}
}
/**
* Parse the segments of a URL.
*
* @param array &$segments The segments of the URL to parse.
* @param array &$vars The URL attributes to be used by the application.
*
* @return void
*
* @since 3.6
* @deprecated 4.0
*/
public function parse(&$segments, &$vars)
{
$total = count($segments);
for ($i = 0; $i < $total; $i++)
{
$segments[$i] = preg_replace('/-/', ':', $segments[$i], 1);
}
// Get the active menu item.
$item = $this->router->menu->getActive();
$params = JComponentHelper::getParams('com_content');
$advanced = $params->get('sef_advanced_link', 0);
$db = JFactory::getDbo();
// Count route segments
$count = count($segments);
/*
* Standard routing for articles. If we don't pick up an Itemid then we get the view from the segments
* the first segment is the view and the last segment is the id of the article or category.
*/
if (!isset($item))
{
$vars['view'] = $segments[0];
$vars['id'] = $segments[$count - 1];
return;
}
/*
* If there is only one segment, then it points to either an article or a category.
* We test it first to see if it is a category. If the id and alias match a category,
* then we assume it is a category. If they don't we assume it is an article
*/
if ($count == 1)
{
// We check to see if an alias is given. If not, we assume it is an article
if (strpos($segments[0], ':') === false)
{
$vars['view'] = 'article';
$vars['id'] = (int) $segments[0];
return;
}
list($id, $alias) = explode(':', $segments[0], 2);
// First we check if it is a category
$category = JCategories::getInstance('Content')->get($id);
if ($category && $category->alias == $alias)
{
$vars['view'] = 'category';
$vars['id'] = $id;
return;
}
else
{
$query = $db->getQuery(true)
->select($db->quoteName(array('alias', 'catid')))
->from($db->quoteName('#__content'))
->where($db->quoteName('id') . ' = ' . (int) $id);
$db->setQuery($query);
$article = $db->loadObject();
if ($article)
{
if ($article->alias == $alias)
{
$vars['view'] = 'article';
$vars['catid'] = (int) $article->catid;
$vars['id'] = (int) $id;
return;
}
}
}
}
/*
* If there was more than one segment, then we can determine where the URL points to
* because the first segment will have the target category id prepended to it. If the
* last segment has a number prepended, it is an article, otherwise, it is a category.
*/
if (!$advanced)
{
$cat_id = (int) $segments[0];
$article_id = (int) $segments[$count - 1];
if ($article_id > 0)
{
$vars['view'] = 'article';
$vars['catid'] = $cat_id;
$vars['id'] = $article_id;
}
else
{
$vars['view'] = 'category';
$vars['id'] = $cat_id;
}
return;
}
// We get the category id from the menu item and search from there
$id = $item->query['id'];
$category = JCategories::getInstance('Content')->get($id);
if (!$category)
{
JError::raiseError(404, JText::_('COM_CONTENT_ERROR_PARENT_CATEGORY_NOT_FOUND'));
return;
}
$categories = $category->getChildren();
$vars['catid'] = $id;
$vars['id'] = $id;
$found = 0;
foreach ($segments as $segment)
{
$segment = str_replace(':', '-', $segment);
foreach ($categories as $category)
{
if ($category->alias == $segment)
{
$vars['id'] = $category->id;
$vars['catid'] = $category->id;
$vars['view'] = 'category';
$categories = $category->getChildren();
$found = 1;
break;
}
}
if ($found == 0)
{
if ($advanced)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from('#__content')
->where($db->quoteName('catid') . ' = ' . (int) $vars['catid'])
->where($db->quoteName('alias') . ' = ' . $db->quote($segment));
$db->setQuery($query);
$cid = $db->loadResult();
}
else
{
$cid = $segment;
}
$vars['id'] = $cid;
if ($item->query['view'] == 'archive' && $count != 1)
{
$vars['year'] = $count >= 2 ? $segments[$count - 2] : null;
$vars['month'] = $segments[$count - 1];
$vars['view'] = 'archive';
}
else
{
$vars['view'] = 'article';
}
}
$found = 0;
}
}
}
router.php 0000604 00000015305 15245530277 0006607 0 ustar 00 <?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Routing class of com_content
*
* @since 3.3
*/
class ContentRouter extends JComponentRouterView
{
protected $noIDs = false;
/**
* Content Component router constructor
*
* @param JApplicationCms $app The application object
* @param JMenu $menu The menu object to work with
*/
public function __construct($app = null, $menu = null)
{
$params = JComponentHelper::getParams('com_content');
$this->noIDs = (bool) $params->get('sef_ids');
$categories = new JComponentRouterViewconfiguration('categories');
$categories->setKey('id');
$this->registerView($categories);
$category = new JComponentRouterViewconfiguration('category');
$category->setKey('id')->setParent($categories, 'catid')->setNestable()->addLayout('blog');
$this->registerView($category);
$article = new JComponentRouterViewconfiguration('article');
$article->setKey('id')->setParent($category, 'catid');
$this->registerView($article);
$this->registerView(new JComponentRouterViewconfiguration('archive'));
$this->registerView(new JComponentRouterViewconfiguration('featured'));
$form = new JComponentRouterViewconfiguration('form');
$form->setKey('a_id');
$this->registerView($form);
parent::__construct($app, $menu);
$this->attachRule(new JComponentRouterRulesMenu($this));
if ($params->get('sef_advanced', 0))
{
$this->attachRule(new JComponentRouterRulesStandard($this));
$this->attachRule(new JComponentRouterRulesNomenu($this));
}
else
{
JLoader::register('ContentRouterRulesLegacy', __DIR__ . '/helpers/legacyrouter.php');
$this->attachRule(new ContentRouterRulesLegacy($this));
}
}
/**
* Method to get the segment(s) for a category
*
* @param string $id ID of the category to retrieve the segments for
* @param array $query The request that is built right now
*
* @return array|string The segments of this item
*/
public function getCategorySegment($id, $query)
{
$category = JCategories::getInstance($this->getName())->get($id);
if ($category)
{
$path = array_reverse($category->getPath(), true);
$path[0] = '1:root';
if ($this->noIDs)
{
foreach ($path as &$segment)
{
list($id, $segment) = explode(':', $segment, 2);
}
}
return $path;
}
return array();
}
/**
* Method to get the segment(s) for a category
*
* @param string $id ID of the category to retrieve the segments for
* @param array $query The request that is built right now
*
* @return array|string The segments of this item
*/
public function getCategoriesSegment($id, $query)
{
return $this->getCategorySegment($id, $query);
}
/**
* Method to get the segment(s) for an article
*
* @param string $id ID of the article to retrieve the segments for
* @param array $query The request that is built right now
*
* @return array|string The segments of this item
*/
public function getArticleSegment($id, $query)
{
if (!strpos($id, ':'))
{
$db = JFactory::getDbo();
$dbquery = $db->getQuery(true);
$dbquery->select($dbquery->qn('alias'))
->from($dbquery->qn('#__content'))
->where('id = ' . $dbquery->q($id));
$db->setQuery($dbquery);
$id .= ':' . $db->loadResult();
}
if ($this->noIDs)
{
list($void, $segment) = explode(':', $id, 2);
return array($void => $segment);
}
return array((int) $id => $id);
}
/**
* Method to get the segment(s) for a form
*
* @param string $id ID of the article form to retrieve the segments for
* @param array $query The request that is built right now
*
* @return array|string The segments of this item
*
* @since 3.7.3
*/
public function getFormSegment($id, $query)
{
return $this->getArticleSegment($id, $query);
}
/**
* Method to get the id for a category
*
* @param string $segment Segment to retrieve the ID for
* @param array $query The request that is parsed right now
*
* @return mixed The id of this item or false
*/
public function getCategoryId($segment, $query)
{
if (isset($query['id']))
{
$category = JCategories::getInstance($this->getName(), array('access' => false))->get($query['id']);
if ($category)
{
foreach ($category->getChildren() as $child)
{
if ($this->noIDs)
{
if ($child->alias == $segment)
{
return $child->id;
}
}
else
{
if ($child->id == (int) $segment)
{
return $child->id;
}
}
}
}
}
return false;
}
/**
* Method to get the segment(s) for a category
*
* @param string $segment Segment to retrieve the ID for
* @param array $query The request that is parsed right now
*
* @return mixed The id of this item or false
*/
public function getCategoriesId($segment, $query)
{
return $this->getCategoryId($segment, $query);
}
/**
* Method to get the segment(s) for an article
*
* @param string $segment Segment of the article to retrieve the ID for
* @param array $query The request that is parsed right now
*
* @return mixed The id of this item or false
*/
public function getArticleId($segment, $query)
{
if ($this->noIDs)
{
$db = JFactory::getDbo();
$dbquery = $db->getQuery(true);
$dbquery->select($dbquery->qn('id'))
->from($dbquery->qn('#__content'))
->where('alias = ' . $dbquery->q($segment))
->where('catid = ' . $dbquery->q($query['id']));
$db->setQuery($dbquery);
return (int) $db->loadResult();
}
return (int) $segment;
}
}
/**
* Content router functions
*
* These functions are proxys for the new router interface
* for old SEF extensions.
*
* @param array &$query An array of URL arguments
*
* @return array The URL arguments to use to assemble the subsequent URL.
*
* @deprecated 4.0 Use Class based routers instead
*/
function contentBuildRoute(&$query)
{
$app = JFactory::getApplication();
$router = new ContentRouter($app, $app->getMenu());
return $router->build($query);
}
/**
* Parse the segments of a URL.
*
* This function is a proxy for the new router interface
* for old SEF extensions.
*
* @param array $segments The segments of the URL to parse.
*
* @return array The URL attributes to be used by the application.
*
* @since 3.3
* @deprecated 4.0 Use Class based routers instead
*/
function contentParseRoute($segments)
{
$app = JFactory::getApplication();
$router = new ContentRouter($app, $app->getMenu());
return $router->parse($segments);
}
js/admin-article-readmore.js 0000604 00000002163 15245530365 0012031 0 ustar 00 /**
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
window.insertReadmore = function(editor) {
"use strict";
if (!Joomla.getOptions('xtd-readmore')) {
// Something went wrong!
return false;
}
var content, options = window.Joomla.getOptions('xtd-readmore');
if (window.Joomla && window.Joomla.editors && window.Joomla.editors.instances && window.Joomla.editors.instances.hasOwnProperty(editor)) {
content = window.Joomla.editors.instances[editor].getValue();
} else {
content = (new Function('return ' + options.editor))();
}
if (content.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i)) {
alert(options.exists);
return false;
} else {
/** Use the API, if editor supports it **/
if (window.Joomla && window.Joomla.editors && window.Joomla.editors.instances && window.Joomla.editors.instances.hasOwnProperty(editor)) {
window.Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore" />');
} else {
window.jInsertEditorText('<hr id="system-readmore" />', editor);
}
}
};
js/admin-articles-modal.min.js 0000604 00000002274 15245530365 0012277 0 ustar 00 !function(){"use strict";window.jSelectArticle=function(a,b,c,d,e,f){var h,i,g="";return Joomla.getOptions("xtd-articles")?(h=Joomla.getOptions("xtd-articles").editor,""!==f&&(g=' hreflang="'+f+'"'),i="<a"+g+' href="'+e+'">'+b+"</a>",window.parent.Joomla&&window.parent.Joomla.editors&&window.parent.Joomla.editors.instances&&window.parent.Joomla.editors.instances.hasOwnProperty(h)?window.parent.Joomla.editors.instances[h].replaceSelection(i):window.parent.jInsertEditorText(i,h),void window.parent.jModalClose()):(window.parent.jModalClose(),!1)},document.addEventListener("DOMContentLoaded",function(){for(var a=document.querySelectorAll(".select-link"),b=0,c=a.length;c>b;b++)a[b].addEventListener("click",function(a){a.preventDefault();var b=a.target.getAttribute("data-function");"jSelectArticle"===b?window[b](a.target.getAttribute("data-id"),a.target.getAttribute("data-title"),a.target.getAttribute("data-cat-id"),null,a.target.getAttribute("data-uri"),a.target.getAttribute("data-language")):window.parent[b](a.target.getAttribute("data-id"),a.target.getAttribute("data-title"),a.target.getAttribute("data-cat-id"),null,a.target.getAttribute("data-uri"),a.target.getAttribute("data-language"))})})}(); js/admin-article-pagebreak.js 0000604 00000002303 15245530365 0012150 0 ustar 00 /**
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(function() {
"use strict";
window.insertPagebreak = function(editor) {
/** Get the pagebreak title **/
var alt, tag, title = document.getElementById('title').value;
if (!window.parent.Joomla.getOptions('xtd-pagebreak')) {
// Something went wrong!
window.parent.jModalClose();
return false;
}
/** Get the pagebreak toc alias -- not inserting for now **/
/** don't know which attribute to use... **/
alt = document.getElementById('alt').value;
title = (title != '') ? 'title="' + title + '"' : '';
alt = (alt != '') ? 'alt="' + alt + '"' : '';
tag = '<hr class="system-pagebreak" ' + title + ' ' + alt + '/>';
/** Use the API, if editor supports it **/
if (window.parent.Joomla && window.parent.Joomla.editors && window.parent.Joomla.editors.instances && window.parent.Joomla.editors.instances.hasOwnProperty(editor)) {
window.parent.Joomla.editors.instances[editor].replaceSelection(tag)
} else {
window.parent.jInsertEditorText(tag, editor);
}
window.parent.jModalClose();
return false;
};
})();
js/admin-article-readmore.min.js 0000604 00000001265 15245530365 0012615 0 ustar 00 window.insertReadmore=function(a){"use strict";if(!Joomla.getOptions("xtd-readmore"))return!1;var b,c=window.Joomla.getOptions("xtd-readmore");if(b=window.Joomla&&window.Joomla.editors&&window.Joomla.editors.instances&&window.Joomla.editors.instances.hasOwnProperty(a)?window.Joomla.editors.instances[a].getValue():new Function("return "+c.editor)(),b.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i))return alert(c.exists),!1;window.Joomla&&window.Joomla.editors&&window.Joomla.editors.instances&&window.Joomla.editors.instances.hasOwnProperty(a)?window.Joomla.editors.instances[a].replaceSelection('<hr id="system-readmore" />'):window.jInsertEditorText('<hr id="system-readmore" />',a)}; js/admin-article-pagebreak.min.js 0000604 00000001155 15245530365 0012736 0 ustar 00 !function(){"use strict";window.insertPagebreak=function(a){var b,c,d=document.getElementById("title").value;return window.parent.Joomla.getOptions("xtd-pagebreak")?(b=document.getElementById("alt").value,d=""!=d?'title="'+d+'"':"",b=""!=b?'alt="'+b+'"':"",c='<hr class="system-pagebreak" '+d+" "+b+"/>",window.parent.Joomla&&window.parent.Joomla.editors&&window.parent.Joomla.editors.instances&&window.parent.Joomla.editors.instances.hasOwnProperty(a)?window.parent.Joomla.editors.instances[a].replaceSelection(c):window.parent.jInsertEditorText(c,a),window.parent.jModalClose(),!1):(window.parent.jModalClose(),!1)}}(); js/admin-articles-modal.js 0000604 00000004244 15245530365 0011514 0 ustar 00 /**
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(function() {
"use strict";
/**
* Javascript to insert the link
* View element calls jSelectArticle when an article is clicked
* jSelectArticle creates the link tag, sends it to the editor,
* and closes the select frame.
**/
window.jSelectArticle = function (id, title, catid, object, link, lang) {
var hreflang = '', editor, tag;
if (!Joomla.getOptions('xtd-articles')) {
// Something went wrong!
window.parent.jModalClose();
return false;
}
editor = Joomla.getOptions('xtd-articles').editor;
if (lang !== '')
{
hreflang = ' hreflang="' + lang + '"';
}
tag = '<a' + hreflang + ' href="' + link + '">' + title + '</a>';
/** Use the API, if editor supports it **/
if (window.parent.Joomla && window.parent.Joomla.editors && window.parent.Joomla.editors.instances && window.parent.Joomla.editors.instances.hasOwnProperty(editor)) {
window.parent.Joomla.editors.instances[editor].replaceSelection(tag)
} else {
window.parent.jInsertEditorText(tag, editor);
}
window.parent.jModalClose();
};
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 === 'jSelectArticle') {
// Used in xtd_contacts
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'));
} 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'));
}
})
}
});
})();
com_content.php 0000604 00000051716 15245561270 0007602 0 ustar 00 <?php
/**
* @version $Id$
* @copyright Copyright (C) 2007 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once JPATH_SITE . '/components/com_content/helpers/route.php';
require_once JPATH_SITE . '/components/com_content/helpers/query.php';
/**
* Handles standard Joomla's Content articles/categories
*
* This plugin is able to expand the categories keeping the right order of the
* articles acording to the menu settings and the user session data (user state).
*
* This is a very complex plugin, if you are trying to build your own plugin
* for other component, I suggest you to take a look to another plugis as
* they are usually most simple. ;)
*/
class xmap_com_content
{
/**
* This function is called before a menu item is printed. We use it to set the
* proper uniqueid for the item
*
* @param object Menu item to be "prepared"
* @param array The extension params
*
* @return void
* @since 1.2
*/
static function prepareMenuItem($node, &$params)
{
$db = JFactory::getDbo();
$link_query = parse_url($node->link);
if (!isset($link_query['query'])) {
return;
}
parse_str(html_entity_decode($link_query['query']), $link_vars);
$view = JArrayHelper::getValue($link_vars, 'view', '');
$layout = JArrayHelper::getValue($link_vars, 'layout', '');
$id = JArrayHelper::getValue($link_vars, 'id', 0);
//----- Set add_images param
$params['add_images'] = JArrayHelper::getValue($params, 'add_images', 0);
//----- Set add pagebreaks param
$add_pagebreaks = JArrayHelper::getValue($params, 'add_pagebreaks', 1);
$params['add_pagebreaks'] = JArrayHelper::getValue($params, 'add_pagebreaks', 1);
switch ($view) {
case 'category':
if ($id) {
$node->uid = 'com_contentc' . $id;
} else {
$node->uid = 'com_content' . $layout;
}
$node->expandible = true;
break;
case 'article':
$node->uid = 'com_contenta' . $id;
$node->expandible = false;
$query = $db->getQuery(true);
$query->select($db->quoteName('created'))
->select($db->quoteName('modified'))
->from($db->quoteName('#__content'))
->where($db->quoteName('id').'='.intval($id));
if ($params['add_pagebreaks'] || $params['add_images']){
$query->select($db->quoteName('introtext'))
->select($db->quoteName('fulltext'));
}
$db->setQuery($query);
if (($row = $db->loadObject()) != NULL) {
$node->modified = $row->modified;
$text = @$item->introtext . @$item->fulltext;
if ($params['add_images']) {
$node->images = XmapHelper::getImages($text,JArrayHelper::getValue($params, 'max_images', 1000));
}
if ($params['add_pagebreaks']) {
$node->subnodes = XmapHelper::getPagebreaks($text,$node->link);
$node->expandible = (count($node->subnodes) > 0); // This article has children
}
}
break;
case 'archive':
$node->expandible = true;
break;
case 'featured':
$node->uid = 'com_contentfeatured';
$node->expandible = false;
}
}
/**
* Expands a com_content menu item
*
* @return void
* @since 1.0
*/
static function getTree($xmap, $parent, &$params)
{
$db = JFactory::getDBO();
$app = JFactory::getApplication();
$user = JFactory::getUser();
$result = null;
$link_query = parse_url($parent->link);
if (!isset($link_query['query'])) {
return;
}
parse_str(html_entity_decode($link_query['query']), $link_vars);
$view = JArrayHelper::getValue($link_vars, 'view', '');
$id = intval(JArrayHelper::getValue($link_vars, 'id', ''));
/* * *
* Parameters Initialitation
* */
//----- Set expand_categories param
$expand_categories = JArrayHelper::getValue($params, 'expand_categories', 1);
$expand_categories = ( $expand_categories == 1
|| ( $expand_categories == 2 && $xmap->view == 'xml')
|| ( $expand_categories == 3 && $xmap->view == 'html')
|| $xmap->view == 'navigator');
$params['expand_categories'] = $expand_categories;
//----- Set expand_featured param
$expand_featured = JArrayHelper::getValue($params, 'expand_featured', 1);
$expand_featured = ( $expand_featured == 1
|| ( $expand_featured == 2 && $xmap->view == 'xml')
|| ( $expand_featured == 3 && $xmap->view == 'html')
|| $xmap->view == 'navigator');
$params['expand_featured'] = $expand_featured;
//----- Set expand_featured param
$include_archived = JArrayHelper::getValue($params, 'include_archived', 2);
$include_archived = ( $include_archived == 1
|| ( $include_archived == 2 && $xmap->view == 'xml')
|| ( $include_archived == 3 && $xmap->view == 'html')
|| $xmap->view == 'navigator');
$params['include_archived'] = $include_archived;
//----- Set show_unauth param
$show_unauth = JArrayHelper::getValue($params, 'show_unauth', 1);
$show_unauth = ( $show_unauth == 1
|| ( $show_unauth == 2 && $xmap->view == 'xml')
|| ( $show_unauth == 3 && $xmap->view == 'html'));
$params['show_unauth'] = $show_unauth;
//----- Set add_images param
$add_images = JArrayHelper::getValue($params, 'add_images', 0) && $xmap->isImages;
$add_images = ( $add_images && $xmap->view == 'xml');
$params['add_images'] = $add_images;
$params['max_images'] = JArrayHelper::getValue($params, 'max_images', 1000);
//----- Set add pagebreaks param
$add_pagebreaks = JArrayHelper::getValue($params, 'add_pagebreaks', 1);
$add_pagebreaks = ( $add_pagebreaks == 1
|| ( $add_pagebreaks == 2 && $xmap->view == 'xml')
|| ( $add_pagebreaks == 3 && $xmap->view == 'html')
|| $xmap->view == 'navigator');
$params['add_pagebreaks'] = $add_pagebreaks;
if ($params['add_pagebreaks'] && !defined('_XMAP_COM_CONTENT_LOADED')) {
define('_XMAP_COM_CONTENT_LOADED',1); // Load it just once
$lang = JFactory::getLanguage();
$lang->load('plg_content_pagebreak');
}
//----- Set cat_priority and cat_changefreq params
$priority = JArrayHelper::getValue($params, 'cat_priority', $parent->priority);
$changefreq = JArrayHelper::getValue($params, 'cat_changefreq', $parent->changefreq);
if ($priority == '-1')
$priority = $parent->priority;
if ($changefreq == '-1')
$changefreq = $parent->changefreq;
$params['cat_priority'] = $priority;
$params['cat_changefreq'] = $changefreq;
//----- Set art_priority and art_changefreq params
$priority = JArrayHelper::getValue($params, 'art_priority', $parent->priority);
$changefreq = JArrayHelper::getValue($params, 'art_changefreq', $parent->changefreq);
if ($priority == '-1')
$priority = $parent->priority;
if ($changefreq == '-1')
$changefreq = $parent->changefreq;
$params['art_priority'] = $priority;
$params['art_changefreq'] = $changefreq;
$params['max_art'] = intval(JArrayHelper::getValue($params, 'max_art', 0));
$params['max_art_age'] = intval(JArrayHelper::getValue($params, 'max_art_age', 0));
$params['nullDate'] = $db->Quote($db->getNullDate());
$params['nowDate'] = $db->Quote(JFactory::getDate()->toSql());
$params['groups'] = implode(',', $user->getAuthorisedViewLevels());
// Define the language filter condition for the query
$params['language_filter'] = $app->getLanguageFilter();
switch ($view) {
case 'category':
if (!$id) {
$id = intval(JArrayHelper::getValue($params, 'id', 0));
}
if ($params['expand_categories'] && $id) {
$result = self::expandCategory($xmap, $parent, $id, $params, $parent->id);
}
break;
case 'featured':
if ($params['expand_featured']) {
$result = self::includeCategoryContent($xmap, $parent, 'featured', $params,$parent->id);
}
break;
case 'categories':
if ($params['expand_categories']) {
$result = self::expandCategory($xmap, $parent, ($id ? $id : 1), $params, $parent->id);
}
break;
case 'archive':
if ($params['expand_featured']) {
$result = self::includeCategoryContent($xmap, $parent, 'archived', $params,$parent->id);
}
break;
case 'article':
// if it's an article menu item, we have to check if we have to expand the
// article's page breaks
if ($params['add_pagebreaks']){
$query = $db->getQuery(true);
$query->select($db->quoteName('introtext'))
->select($db->quoteName('fulltext'))
->select($db->quoteName('alias'))
->select($db->quoteName('catid'))
->from($db->quoteName('#__content'))
->where($db->quoteName('id').'='.intval($id));
$db->setQuery($query);
$row = $db->loadObject();
$parent->slug = $row->alias ? ($id . ':' . $row->alias) : $id;
$parent->link = ContentHelperRoute::getArticleRoute($parent->slug, $row->catid);
$subnodes = XmapHelper::getPagebreaks($row->introtext.$row->fulltext,$parent->link);
self::printNodes($xmap, $parent, $params, $subnodes);
}
}
return $result;
}
/**
* Get all content items within a content category.
* Returns an array of all contained content items.
*
* @param object $xmap
* @param object $parent the menu item
* @param int $catid the id of the category to be expanded
* @param array $params an assoc array with the params for this plugin on Xmap
* @param int $itemid the itemid to use for this category's children
*/
static function expandCategory($xmap, $parent, $catid, &$params, $itemid)
{
$db = JFactory::getDBO();
$where = array('a.parent_id = ' . $catid . ' AND a.published = 1 AND a.extension=\'com_content\'');
if ($params['language_filter'] ) {
$where[] = 'a.language in ('.$db->quote(JFactory::getLanguage()->getTag()).','.$db->quote('*').')';
}
if (!$params['show_unauth']) {
$where[] = 'a.access IN (' . $params['groups'] . ') ';
}
$orderby = 'a.lft';
$query = 'SELECT a.id, a.title, a.alias, a.access, a.path AS route, '
. 'a.created_time created, a.modified_time modified '
. 'FROM #__categories AS a '
. 'WHERE '. implode(' AND ',$where)
. ( $xmap->view != 'xml' ? "\n ORDER BY " . $orderby . "" : '' );
$db->setQuery($query);
#echo nl2br(str_replace('#__','jos_',$db->getQuery()));exit;
$items = $db->loadObjectList();
if (count($items) > 0) {
$xmap->changeLevel(1);
foreach ($items as $item) {
$node = new stdclass();
$node->id = $parent->id;
$node->uid = $parent->uid . 'c' . $item->id;
$node->browserNav = $parent->browserNav;
$node->priority = $params['cat_priority'];
$node->changefreq = $params['cat_changefreq'];
$node->name = $item->title;
$node->expandible = true;
$node->secure = $parent->secure;
// TODO: Should we include category name or metakey here?
// $node->keywords = $item->metakey;
$node->newsItem = 0;
// For the google news we should use te publication date instead
// the last modification date. See
if ($xmap->isNews || !$item->modified)
$item->modified = $item->created;
$node->slug = $item->route ? ($item->id . ':' . $item->route) : $item->id;
$node->link = ContentHelperRoute::getCategoryRoute($node->slug);
if (strpos($node->link,'Itemid=')===false) {
$node->itemid = $itemid;
$node->link .= '&Itemid='.$itemid;
} else {
$node->itemid = preg_replace('/.*Itemid=([0-9]+).*/','$1',$node->link);
}
if ($xmap->printNode($node)) {
self::expandCategory($xmap, $parent, $item->id, $params, $node->itemid);
}
}
$xmap->changeLevel(-1);
}
// Include Category's content
self::includeCategoryContent($xmap, $parent, $catid, $params, $itemid);
return true;
}
/**
* Get all content items within a content category.
* Returns an array of all contained content items.
*
* @since 2.0
*/
static function includeCategoryContent($xmap, $parent, $catid, &$params,$Itemid)
{
$db = JFactory::getDBO();
// We do not do ordering for XML sitemap.
if ($xmap->view != 'xml') {
$orderby = self::buildContentOrderBy($parent->params,$parent->id,$Itemid);
//$orderby = !empty($menuparams['orderby']) ? $menuparams['orderby'] : (!empty($menuparams['orderby_sec']) ? $menuparams['orderby_sec'] : 'rdate' );
//$orderby = self::orderby_sec($orderby);
}
if ($params['include_archived']) {
$where = array('(a.state = 1 or a.state = 2)');
} else {
$where = array('a.state = 1');
}
if ($catid=='featured') {
$where[] = 'a.featured=1';
} elseif ($catid=='archived') {
$where = array('a.state=2');
} elseif(is_numeric($catid)) {
$where[] = 'a.catid='.(int) $catid;
}
if ($params['max_art_age'] || $xmap->isNews) {
$days = (($xmap->isNews && ($params['max_art_age'] > 3 || !$params['max_art_age'])) ? 3 : $params['max_art_age']);
$where[] = "( a.created >= '"
. date('Y-m-d H:i:s', time() - $days * 86400) . "' ) ";
}
if ($params['language_filter'] ) {
$where[] = 'a.language in ('.$db->quote(JFactory::getLanguage()->getTag()).','.$db->quote('*').')';
}
if (!$params['show_unauth'] ){
$where[] = 'a.access IN (' . $params['groups'] . ') ';
}
$query = 'SELECT a.id, a.title, a.alias, a.catid, '
. 'a.created created, a.modified modified'
. ',a.language'
. (($params['add_images'] || $params['add_pagebreaks']) ? ',a.introtext, a.fulltext ' : ' ')
. 'FROM #__content AS a '
. ($catid =='featured'? 'LEFT JOIN #__content_frontpage AS fp ON a.id = fp.content_id ' : ' ')
. 'WHERE ' . implode(' AND ',$where) . ' AND '
. ' (a.publish_up = ' . $params['nullDate']
. ' OR a.publish_up <= ' . $params['nowDate'] . ') AND '
. ' (a.publish_down = ' . $params['nullDate']
. ' OR a.publish_down >= ' . $params['nowDate'] . ') '
. ( $xmap->view != 'xml' ? "\n ORDER BY $orderby " : '' )
. ( $params['max_art'] ? "\n LIMIT {$params['max_art']}" : '');
$db->setQuery($query);
//echo nl2br(str_replace('#__','mgbj2_',$db->getQuery()));
$items = $db->loadObjectList();
if (count($items) > 0) {
$xmap->changeLevel(1);
foreach ($items as $item) {
$node = new stdclass();
$node->id = $parent->id;
$node->uid = $parent->uid . 'a' . $item->id;
$node->browserNav = $parent->browserNav;
$node->priority = $params['art_priority'];
$node->changefreq = $params['art_changefreq'];
$node->name = $item->title;
$node->modified = $item->modified;
$node->expandible = false;
$node->secure = $parent->secure;
// TODO: Should we include category name or metakey here?
// $node->keywords = $item->metakey;
$node->newsItem = 1;
$node->language = $item->language;
// For the google news we should use te publication date instead
// the last modification date. See
if ($xmap->isNews || !$node->modified)
$node->modified = $item->created;
$node->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id;
//$node->catslug = $item->category_route ? ($catid . ':' . $item->category_route) : $catid;
$node->catslug = $item->catid;
$node->link = ContentHelperRoute::getArticleRoute($node->slug, $node->catslug);
// Add images to the article
$text = @$item->introtext . @$item->fulltext;
if ($params['add_images']) {
$node->images = XmapHelper::getImages($text,$params['max_images']);
}
if ($params['add_pagebreaks']) {
$subnodes = XmapHelper::getPagebreaks($text,$node->link);
$node->expandible = (count($subnodes) > 0); // This article has children
}
if ($xmap->printNode($node) && $node->expandible) {
self::printNodes($xmap, $parent, $params, $subnodes);
}
}
$xmap->changeLevel(-1);
}
return true;
}
static private function printNodes($xmap, $parent, &$params, &$subnodes)
{
$xmap->changeLevel(1);
$i=0;
foreach ($subnodes as $subnode) {
$i++;
$subnode->id = $parent->id;
$subnode->uid = $parent->uid.'p'.$i;
$subnode->browserNav = $parent->browserNav;
$subnode->priority = $params['art_priority'];
$subnode->changefreq = $params['art_changefreq'];
$subnode->secure = $parent->secure;
$xmap->printNode($subnode);
}
$xmap->changeLevel(-1);
}
/**
* Generates the order by part of the query according to the
* menu/component/user settings. It checks if the current user
* has already changed the article's ordering column in the frontend
*
* @param JRegistry $params
* @param int $parentId
* @param int $itemid
* @return string
*/
static function buildContentOrderBy(&$params,$parentId,$itemid)
{
$app = JFactory::getApplication('site');
// Case when the child gets a different menu itemid than it's parent
if ($parentId != $itemid) {
$menu = $app->getMenu();
$item = $menu->getItem($itemid);
$menuParams = clone($params);
$itemParams = new JRegistry($item->params);
$menuParams->merge($itemParams);
} else {
$menuParams =& $params;
}
$filter_order = $app->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order', 'filter_order', '', 'string');
$filter_order_Dir = $app->getUserStateFromRequest('com_content.category.list.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', '', 'cmd');
$orderby = ' ';
if ($filter_order && $filter_order_Dir) {
$orderby .= $filter_order . ' ' . $filter_order_Dir . ', ';
}
$articleOrderby = $menuParams->get('orderby_sec', 'rdate');
$articleOrderDate = $menuParams->get('order_date');
//$categoryOrderby = $menuParams->def('orderby_pri', '');
$secondary = ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate) . ', ';
//$primary = ContentHelperQuery::orderbyPrimary($categoryOrderby);
//$orderby .= $primary . ' ' . $secondary . ' a.created ';
$orderby .= $secondary . ' a.created ';
return $orderby;
}
} com_content.xml 0000604 00000017645 15245561270 0007616 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?>
<!-- $Id$ -->
<extension type="plugin" group="xmap" version="2.5" method="upgrade">
<name>Xmap Content Plugin</name>
<author>Guillermo Vargas</author>
<creationDate>02-05-2014</creationDate>
<copyright>GNU GPL</copyright>
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<authorEmail>guille@vargas.co.cr</authorEmail>
<authorUrl>joomla.vargas.co.cr</authorUrl>
<version>2.0.4c</version>
<description>XMAP_CONTENT_PLUGIN_DESCRIPTION</description>
<files>
<filename plugin="com_content">com_content.php</filename>
<filename>index.html</filename>
</files>
<languages folder="language">
<!--
these files will be installed in the administrator/language folder.
-->
<language tag="en-GB">en-GB.plg_xmap_com_content.ini</language>
<language tag="es-ES">es-ES.plg_xmap_com_content.ini</language>
<language tag="fr-FR">fr-FR.plg_xmap_com_content.ini</language>
<language tag="fa-IR">fa-IR.plg_xmap_com_content.ini</language>
<language tag="cs-CZ">cs-CZ.plg_xmap_com_content.ini</language>
<language tag="nl-NL">nl-NL.plg_xmap_com_content.ini</language>
<language tag="ru-RU">ru-RU.plg_xmap_com_content.ini</language>
</languages>
<config>
<fields name="params">
<fieldset name="basic">
<field name="expand_categories" type="list" default="1" label="XMAP_SETTING_EXPAND_CATEGORIES" description="XMAP_SETTING_EXPAND_CATEGORIES_DESC">
<option value="0">XMAP_OPTION_NEVER</option>
<option value="1">XMAP_OPTION_ALWAYS</option>
<option value="2">XMAP_OPTION_XML_ONLY</option>
<option value="3">XMAP_OPTION_HTML_ONLY</option>
</field>
<field name="expand_featured" type="list" default="1" label="XMAP_SETTING_EXPAND_FEATURED" description="XMAP_SETTING_EXPAND_FEATURED_DESC">
<option value="0">XMAP_OPTION_NEVER</option>
<option value="1">XMAP_OPTION_ALWAYS</option>
<option value="2">XMAP_OPTION_XML_ONLY</option>
<option value="3">XMAP_OPTION_HTML_ONLY</option>
</field>
<field name="include_archived" type="list" default="2" label="XMAP_SETTING_INCLUDE_ARCHIVED" description="XMAP_SETTING_INCLUDE_ARCHIVED_DESC">
<option value="0">XMAP_OPTION_NEVER</option>
<option value="1">XMAP_OPTION_ALWAYS</option>
<option value="2">XMAP_OPTION_XML_ONLY</option>
<option value="3">XMAP_OPTION_HTML_ONLY</option>
</field>
<field name="show_unauth" type="list" default="0" label="XMAP_SETTING_SHOW_UNAUTH_LINKS" description="XMAP_SETTING_SHOW_UNAUTH_LINKS_DESC">
<option value="0">XMAP_OPTION_NEVER</option>
<option value="1">XMAP_OPTION_ALWAYS</option>
<option value="2">XMAP_OPTION_XML_ONLY</option>
<option value="3">XMAP_OPTION_HTML_ONLY</option>
</field>
<field name="add_pagebreaks" type="list" default="1" label="XMAP_SETTING_ADD_PAGEBREAKS_LABEL" description="XMAP_SETTING_ADD_PAGEBREAKS_DESC">
<option value="0">XMAP_OPTION_NEVER</option>
<option value="1">XMAP_OPTION_ALWAYS</option>
<option value="2">XMAP_OPTION_XML_ONLY</option>
<option value="3">XMAP_OPTION_HTML_ONLY</option>
</field>
<field name="max_art" type="text" default="0" label="XMAP_SETTING_MAX_ART_CAT" description="XMAP_SETTING_MAX_ART_CAT_DESC" />
<field name="max_art_age" type="text" default="0" label="XMAP_SETTING_MAX_ART_AGE" description="XMAP_SETTING_MAX_ART_AGE_DESC" />
</fieldset>
<fieldset name="xml">
<field name="add_images" type="list" default="1" label="XMAP_SETTING_ADD_IMAGES_LABEL" description="XMAP_SETTING_ADD_IMAGES_DESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="cat_priority" type="list" default="-1" label="XMAP_SETTING_CAT_PRIORITY" description="XMAP_SETTING_CAT_PRIORITY_DESC">
<option value="-1">XMAP_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="XMAP_SETTING_CAT_CHANCE_FREQ" description="XMAP_SETTING_CAT_CHANCE_FREQ_DESC">
<option value="-1">XMAP_OPTION_USE_PARENT_MENU</option>
<option value="always">XMAP_OPTION_ALWAYS</option>
<option value="hourly">XMAP_OPTION_HOURLY</option>
<option value="daily">XMAP_OPTION_DAILY</option>
<option value="weekly">XMAP_OPTION_WEEKLY</option>
<option value="monthly">XMAP_OPTION_MONTHLY</option>
<option value="yearly">XMAP_OPTION_YEARLY</option>
<option value="never">XMAP_OPTION_NEVER</option>
</field>
<field name="art_priority" type="list" default="-1" label="XMAP_SETTING_ART_PRIORITY" description="XMAP_SETTING_ART_PRIORITY_DESC">
<option value="-1">XMAP_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="art_changefreq" type="list" default="-1" label="XMAP_SETTING_ART_CHANCE_FREQ" description="XMAP_SETTING_ART_CHANCE_FREQ_DESC">
<option value="-1">XMAP_OPTION_USE_PARENT_MENU</option>
<option value="always">XMAP_OPTION_ALWAYS</option>
<option value="hourly">XMAP_OPTION_HOURLY</option>
<option value="daily">XMAP_OPTION_DAILY</option>
<option value="weekly">XMAP_OPTION_WEEKLY</option>
<option value="monthly">XMAP_OPTION_MONTHLY</option>
<option value="yearly">XMAP_OPTION_YEARLY</option>
<option value="never">XMAP_OPTION_NEVER</option>
</field>
</fieldset>
<fieldset name="news">
<field name="keywords" type="list" default="1" label="XMAP_SETTING_NEWS_KEYWORDS_LABEL" description="XMAP_SETTING_NEWS_KEYWORDS_DESC">
<option value="metakey">XMAP_SETTING_NEWS_KEYWORDS_METAKEYS</option>
<option value="category">XMAP_SETTING_NEWS_KEYWORDS_CATTITLE</option>
<option value="both">XMAP_SETTING_NEWS_KEYWORDS_METAKEYS_CATTITLE</option>
<option value="none">XMAP_SETTING_NEWS_KEYWORDS_NONE</option>
</field>
</fieldset>
</fields>
</config>
</extension>
index.html 0000604 00000000036 15245561270 0006543 0 ustar 00 <!DOCTYPE html><title></title>