first commit

This commit is contained in:
alazhar
2020-01-02 22:20:31 +07:00
commit 10eb3340ad
5753 changed files with 631345 additions and 0 deletions

View File

@ -0,0 +1,423 @@
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles_category
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$com_path = JPATH_SITE.'/components/com_content/';
require_once $com_path.'router.php';
require_once $com_path.'helpers/route.php';
JModelLegacy::addIncludePath($com_path . '/models', 'ContentModel');
/**
* Helper for mod_articles_category
*
* @package Joomla.Site
* @subpackage mod_articles_category
*/
abstract class ModArticlesCategoryHelper
{
public static function getList(&$params)
{
// Get an instance of the generic articles model
$articles = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
// Set application parameters in model
$app = JFactory::getApplication();
$appParams = $app->getParams();
$articles->setState('params', $appParams);
// Set the filters based on the module params
$articles->setState('list.start', 0);
$articles->setState('list.limit', (int) $params->get('count', 0));
$articles->setState('filter.published', 1);
// Access filter
$access = !JComponentHelper::getParams('com_content')->get('show_noauth');
$authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id'));
$articles->setState('filter.access', $access);
// Prep for Normal or Dynamic Modes
$mode = $params->get('mode', 'normal');
switch ($mode)
{
case 'dynamic':
$option = $app->input->get('option');
$view = $app->input->get('view');
if ($option === 'com_content')
{
switch($view)
{
case 'category':
$catids = array($app->input->getInt('id'));
break;
case 'categories':
$catids = array($app->input->getInt('id'));
break;
case 'article':
if ($params->get('show_on_article_page', 1))
{
$article_id = $app->input->getInt('id');
$catid = $app->input->getInt('catid');
if (!$catid)
{
// Get an instance of the generic article model
$article = JModelLegacy::getInstance('Article', 'ContentModel', array('ignore_request' => true));
$article->setState('params', $appParams);
$article->setState('filter.published', 1);
$article->setState('article.id', (int) $article_id);
$item = $article->getItem();
$catids = array($item->catid);
}
else
{
$catids = array($catid);
}
}
else {
// Return right away if show_on_article_page option is off
return;
}
break;
case 'featured':
default:
// Return right away if not on the category or article views
return;
}
}
else {
// Return right away if not on a com_content page
return;
}
break;
case 'normal':
default:
$catids = $params->get('catid');
$articles->setState('filter.category_id.include', (bool) $params->get('category_filtering_type', 1));
break;
}
// Category filter
if ($catids)
{
if ($params->get('show_child_category_articles', 0) && (int) $params->get('levels', 0) > 0)
{
// Get an instance of the generic categories model
$categories = JModelLegacy::getInstance('Categories', 'ContentModel', array('ignore_request' => true));
$categories->setState('params', $appParams);
$levels = $params->get('levels', 1) ? $params->get('levels', 1) : 9999;
$categories->setState('filter.get_children', $levels);
$categories->setState('filter.published', 1);
$categories->setState('filter.access', $access);
$additional_catids = array();
foreach ($catids as $catid)
{
$categories->setState('filter.parentId', $catid);
$recursive = true;
$items = $categories->getItems($recursive);
if ($items)
{
foreach ($items as $category)
{
$condition = (($category->level - $categories->getParent()->level) <= $levels);
if ($condition)
{
$additional_catids[] = $category->id;
}
}
}
}
$catids = array_unique(array_merge($catids, $additional_catids));
}
$articles->setState('filter.category_id', $catids);
}
// Ordering
$articles->setState('list.ordering', $params->get('article_ordering', 'a.ordering'));
$articles->setState('list.direction', $params->get('article_ordering_direction', 'ASC'));
// New Parameters
$articles->setState('filter.featured', $params->get('show_front', 'show'));
$articles->setState('filter.author_id', $params->get('created_by', ""));
$articles->setState('filter.author_id.include', $params->get('author_filtering_type', 1));
$articles->setState('filter.author_alias', $params->get('created_by_alias', ""));
$articles->setState('filter.author_alias.include', $params->get('author_alias_filtering_type', 1));
$excluded_articles = $params->get('excluded_articles', '');
if ($excluded_articles)
{
$excluded_articles = explode("\r\n", $excluded_articles);
$articles->setState('filter.article_id', $excluded_articles);
$articles->setState('filter.article_id.include', false); // Exclude
}
$date_filtering = $params->get('date_filtering', 'off');
if ($date_filtering !== 'off')
{
$articles->setState('filter.date_filtering', $date_filtering);
$articles->setState('filter.date_field', $params->get('date_field', 'a.created'));
$articles->setState('filter.start_date_range', $params->get('start_date_range', '1000-01-01 00:00:00'));
$articles->setState('filter.end_date_range', $params->get('end_date_range', '9999-12-31 23:59:59'));
$articles->setState('filter.relative_date', $params->get('relative_date', 30));
}
// Filter by language
$articles->setState('filter.language', $app->getLanguageFilter());
$items = $articles->getItems();
// Display options
$show_date = $params->get('show_date', 0);
$show_date_field = $params->get('show_date_field', 'created');
$show_date_format = $params->get('show_date_format', 'Y-m-d H:i:s');
$show_category = $params->get('show_category', 0);
$show_hits = $params->get('show_hits', 0);
$show_author = $params->get('show_author', 0);
$show_introtext = $params->get('show_introtext', 0);
$introtext_limit = $params->get('introtext_limit', 100);
// Find current Article ID if on an article page
$option = $app->input->get('option');
$view = $app->input->get('view');
if ($option === 'com_content' && $view === 'article')
{
$active_article_id = $app->input->getInt('id');
}
else
{
$active_article_id = 0;
}
// Prepare data for display using display options
foreach ($items as &$item)
{
$item->slug = $item->id.':'.$item->alias;
$item->catslug = $item->catid ? $item->catid .':'.$item->category_alias : $item->catid;
if ($access || in_array($item->access, $authorised))
{
// We know that user has the privilege to view the article
$item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug));
}
else
{
$app = JFactory::getApplication();
$menu = $app->getMenu();
$menuitems = $menu->getItems('link', 'index.php?option=com_users&view=login');
if (isset($menuitems[0]))
{
$Itemid = $menuitems[0]->id;
}
elseif ($app->input->getInt('Itemid') > 0)
{
// Use Itemid from requesting page only if there is no existing menu
$Itemid = $app->input->getInt('Itemid');
}
$item->link = JRoute::_('index.php?option=com_users&view=login&Itemid='.$Itemid);
}
// Used for styling the active article
$item->active = $item->id == $active_article_id ? 'active' : '';
$item->displayDate = '';
if ($show_date)
{
$item->displayDate = JHTML::_('date', $item->$show_date_field, $show_date_format);
}
if ($item->catid)
{
$item->displayCategoryLink = JRoute::_(ContentHelperRoute::getCategoryRoute($item->catid));
$item->displayCategoryTitle = $show_category ? '<a href="'.$item->displayCategoryLink.'">'.$item->category_title.'</a>' : '';
}
else {
$item->displayCategoryTitle = $show_category ? $item->category_title : '';
}
$item->displayHits = $show_hits ? $item->hits : '';
$item->displayAuthorName = $show_author ? $item->author : '';
if ($show_introtext)
{
$item->introtext = JHtml::_('content.prepare', $item->introtext, '', 'mod_articles_category.content');
$item->introtext = self::_cleanIntrotext($item->introtext);
}
$item->displayIntrotext = $show_introtext ? self::truncate($item->introtext, $introtext_limit) : '';
$item->displayReadmore = $item->alternative_readmore;
}
return $items;
}
public static function _cleanIntrotext($introtext)
{
$introtext = str_replace('<p>', ' ', $introtext);
$introtext = str_replace('</p>', ' ', $introtext);
$introtext = strip_tags($introtext, '<a><em><strong>');
$introtext = trim($introtext);
return $introtext;
}
/**
* Method to truncate introtext
*
* The goal is to get the proper length plain text string with as much of
* the html intact as possible with all tags properly closed.
*
* @param string $html The content of the introtext to be truncated
* @param integer $maxLength The maximum number of charactes to render
*
* @return string The truncated string
*/
public static function truncate($html, $maxLength = 0)
{
$baseLength = strlen($html);
// First get the plain text string. This is the rendered text we want to end up with.
$ptString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = false);
for ($maxLength; $maxLength < $baseLength;)
{
// Now get the string if we allow html.
$htmlString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = true);
// Now get the plain text from the html string.
$htmlStringToPtString = JHtml::_('string.truncate', $htmlString, $maxLength, $noSplit = true, $allowHtml = false);
// If the new plain text string matches the original plain text string we are done.
if ($ptString == $htmlStringToPtString)
{
return $htmlString;
}
// Get the number of html tag characters in the first $maxlength characters
$diffLength = strlen($ptString) - strlen($htmlStringToPtString);
// Set new $maxlength that adjusts for the html tags
$maxLength += $diffLength;
if ($baseLength <= $maxLength || $diffLength <= 0)
{
return $htmlString;
}
}
return $html;
}
public static function groupBy($list, $fieldName, $article_grouping_direction, $fieldNameToKeep = null)
{
$grouped = array();
if (!is_array($list))
{
if ($list == '')
{
return $grouped;
}
$list = array($list);
}
foreach ($list as $key => $item)
{
if (!isset($grouped[$item->$fieldName]))
{
$grouped[$item->$fieldName] = array();
}
if (is_null($fieldNameToKeep))
{
$grouped[$item->$fieldName][$key] = $item;
}
else {
$grouped[$item->$fieldName][$key] = $item->$fieldNameToKeep;
}
unset($list[$key]);
}
$article_grouping_direction($grouped);
return $grouped;
}
public static function groupByDate($list, $type = 'year', $article_grouping_direction, $month_year_format = 'F Y')
{
$grouped = array();
if (!is_array($list))
{
if ($list == '')
{
return $grouped;
}
$list = array($list);
}
foreach ($list as $key => $item)
{
switch($type)
{
case 'month_year':
$month_year = JString::substr($item->created, 0, 7);
if (!isset($grouped[$month_year]))
{
$grouped[$month_year] = array();
}
$grouped[$month_year][$key] = $item;
break;
case 'year':
default:
$year = JString::substr($item->created, 0, 4);
if (!isset($grouped[$year]))
{
$grouped[$year] = array();
}
$grouped[$year][$key] = $item;
break;
}
unset($list[$key]);
}
$article_grouping_direction($grouped);
if ($type === 'month_year')
{
foreach ($grouped as $group => $items)
{
$date = new JDate($group);
$formatted_group = $date->format($month_year_format);
$grouped[$formatted_group] = $items;
unset($grouped[$group]);
}
}
return $grouped;
}
}

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,90 @@
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles_category
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
// Include the helper functions only once
require_once __DIR__ . '/helper.php';
$input = JFactory::getApplication()->input;
// Prep for Normal or Dynamic Modes
$mode = $params->get('mode', 'normal');
$idbase = null;
switch($mode)
{
case 'dynamic':
$option = $input->get('option');
$view = $input->get('view');
if ($option === 'com_content')
{
switch($view)
{
case 'category':
$idbase = $input->getInt('id');
break;
case 'categories':
$idbase = $input->getInt('id');
break;
case 'article':
if ($params->get('show_on_article_page', 1))
{
$idbase = $input->getInt('catid');
}
break;
}
}
break;
case 'normal':
default:
$idbase = $params->get('catid');
break;
}
$cacheid = md5(serialize(array ($idbase, $module->module)));
$cacheparams = new stdClass;
$cacheparams->cachemode = 'id';
$cacheparams->class = 'ModArticlesCategoryHelper';
$cacheparams->method = 'getList';
$cacheparams->methodparams = $params;
$cacheparams->modeparams = $cacheid;
$list = JModuleHelper::moduleCache($module, $params, $cacheparams);
if (!empty($list))
{
$grouped = false;
$article_grouping = $params->get('article_grouping', 'none');
$article_grouping_direction = $params->get('article_grouping_direction', 'ksort');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
$item_heading = $params->get('item_heading');
if ($article_grouping !== 'none')
{
$grouped = true;
switch($article_grouping)
{
case 'year':
case 'month_year':
$list = ModArticlesCategoryHelper::groupByDate($list, $article_grouping, $article_grouping_direction, $params->get('month_year_format', 'F Y'));
break;
case 'author':
case 'category_title':
$list = ModArticlesCategoryHelper::groupBy($list, $article_grouping, $article_grouping_direction);
break;
default:
break;
}
}
require JModuleHelper::getLayoutPath('mod_articles_category', $params->get('layout', 'default'));
}

View File

@ -0,0 +1,434 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="3.1" client="site" method="upgrade">
<name>mod_articles_category</name>
<author>Joomla! Project</author>
<creationDate>February 2010</creationDate>
<copyright>Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>3.0.0</version>
<description>MOD_ARTICLES_CATEGORY_XML_DESCRIPTION</description>
<files>
<filename module="mod_articles_category">mod_articles_category.php</filename>
<folder>tmpl</folder>
<filename>helper.php</filename>
<filename>index.html</filename>
<filename>mod_articles_category.xml</filename>
</files>
<languages>
<language tag="en-GB">en-GB.mod_articles_category.ini</language>
<language tag="en-GB">en-GB.mod_articles_category.sys.ini</language>
</languages>
<help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_CATEGORY" />
<config>
<fields name="params">
<fieldset name="basic">
<field name="mode" type="list" default="normal"
label="MOD_ARTICLES_CATEGORY_FIELD_MODE_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_MODE_DESC"
>
<option value="normal">MOD_ARTICLES_CATEGORY_OPTION_NORMAL_VALUE
</option>
<option value="dynamic">MOD_ARTICLES_CATEGORY_OPTION_DYNAMIC_VALUE
</option>
</field>
</fieldset>
<fieldset name="dynamic"
label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_DYNAMIC_LABEL"
>
<field name="show_on_article_page" type="radio"
class="btn-group"
default="1"
label="MOD_ARTICLES_CATEGORY_FIELD_SHOWONARTICLEPAGE_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_SHOWONARTICLEPAGE_DESC"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
</fieldset>
<fieldset name="filtering"
label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_FILTERING_LABEL"
>
<field name="show_front" type="list" default="show"
label="MOD_ARTICLES_CATEGORY_FIELD_SHOWFEATURED_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_SHOWFEATURED_DESC"
>
<option value="show">JSHOW
</option>
<option value="hide">JHIDE
</option>
<option value="only">MOD_ARTICLES_CATEGORY_OPTION_ONLYFEATURED_VALUE
</option>
</field>
<field name="count" type="text" default="0"
label="MOD_ARTICLES_CATEGORY_FIELD_COUNT_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_COUNT_DESC" />
<field name="filteringspacer1" type="spacer" hr="true" />
<field name="category_filtering_type" type="list"
default="1"
label="MOD_ARTICLES_CATEGORY_FIELD_CATFILTERINGTYPE_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_CATFILTERINGTYPE_DESC"
>
<option value="1">MOD_ARTICLES_CATEGORY_OPTION_INCLUSIVE_VALUE
</option>
<option value="0">MOD_ARTICLES_CATEGORY_OPTION_EXCLUSIVE_VALUE
</option>
</field>
<field name="catid" type="category" extension="com_content"
multiple="true" size="5"
label="JCATEGORY"
description="MOD_ARTICLES_CATEGORY_FIELD_CATEGORY_DESC"
>
<option value="">JOPTION_ALL_CATEGORIES</option>
</field>
<field name="show_child_category_articles" type="list"
default="0"
label="MOD_ARTICLES_CATEGORY_FIELD_SHOWCHILDCATEGORYARTICLES_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_SHOWCHILDCATEGORYARTICLES_DESC"
>
<option value="1">MOD_ARTICLES_CATEGORY_OPTION_INCLUDE_VALUE
</option>
<option value="0">MOD_ARTICLES_CATEGORY_OPTION_EXCLUDE_VALUE
</option>
</field>
<field name="levels" type="text" default="1"
label="MOD_ARTICLES_CATEGORY_FIELD_CATDEPTH_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_CATDEPTH_DESC" />
<field name="filteringspacer2" type="spacer" hr="true" />
<field name="author_filtering_type" type="list"
default="1"
label="MOD_ARTICLES_CATEGORY_FIELD_AUTHORFILTERING_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_AUTHORFILTERING_DESC"
>
<option value="1">MOD_ARTICLES_CATEGORY_OPTION_INCLUSIVE_VALUE
</option>
<option value="0">MOD_ARTICLES_CATEGORY_OPTION_EXCLUSIVE_VALUE
</option>
</field>
<field name="created_by" type="sql"
multiple="true" size="5"
label="MOD_ARTICLES_CATEGORY_FIELD_AUTHOR_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_AUTHOR_DESC"
query="select id, name, username from #__users where id IN (select distinct(created_by) from #__content) order by name ASC"
key_field="id" value_field="name"
>
<option value="">JOPTION_SELECT_AUTHORS</option>
</field>
<field name="filteringspacer3" type="spacer" hr="true" />
<field name="author_alias_filtering_type" type="list"
default="1"
label="MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIASFILTERING_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIASFILTERING_DESC"
>
<option value="1">MOD_ARTICLES_CATEGORY_OPTION_INCLUSIVE_VALUE
</option>
<option value="0">MOD_ARTICLES_CATEGORY_OPTION_EXCLUSIVE_VALUE
</option>
</field>
<field name="created_by_alias" type="sql"
multiple="true" size="5"
label="MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIAS_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_AUTHORALIAS_DESC"
query="select distinct(created_by_alias) from #__content where created_by_alias != '' order by created_by_alias ASC"
key_field="created_by_alias" value_field="created_by_alias"
>
<option value="">JOPTION_SELECT_AUTHOR_ALIASES
</option>
</field>
<field name="filteringspacer4" type="spacer" hr="true" />
<field name="excluded_articles" type="textarea"
cols="10" rows="3"
label="MOD_ARTICLES_CATEGORY_FIELD_EXCLUDEDARTICLES_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_EXCLUDEDARTICLES_DESC" />
<field name="filteringspacer5" type="spacer" hr="true" />
<field name="filteringspacer6" type="spacer" hr="true" />
<field name="date_filtering" type="list" default="off"
label="MOD_ARTICLES_CATEGORY_FIELD_DATEFILTERING_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_DATEFILTERING_DESC"
>
<option value="off">MOD_ARTICLES_CATEGORY_OPTION_OFF_VALUE
</option>
<option value="range">MOD_ARTICLES_CATEGORY_OPTION_DATERANGE_VALUE
</option>
<option value="relative">MOD_ARTICLES_CATEGORY_OPTION_RELATIVEDAY_VALUE
</option>
</field>
<field name="date_field" type="list" default="a.created"
label="MOD_ARTICLES_CATEGORY_FIELD_DATERANGEFIELD_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_DATERANGEFIELD_DESC"
>
<option value="a.created">MOD_ARTICLES_CATEGORY_OPTION_CREATED_VALUE
</option>
<option value="a.modified">MOD_ARTICLES_CATEGORY_OPTION_MODIFIED_VALUE
</option>
<option value="a.publish_up">MOD_ARTICLES_CATEGORY_OPTION_STARTPUBLISHING_VALUE
</option>
</field>
<field name="start_date_range" type="calendar"
format="%Y-%m-%d %H:%M:%S"
label="MOD_ARTICLES_CATEGORY_FIELD_STARTDATE_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_STARTDATE_DESC"
size="22"
filter="user_utc" />
<field name="end_date_range" type="calendar"
format="%Y-%m-%d %H:%M:%S"
label="MOD_ARTICLES_CATEGORY_FIELD_ENDDATE_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_ENDDATE_DESC"
size="22"
filter="user_utc" />
<field name="relative_date" type="text" default="30"
label="MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_DESC" />
</fieldset>
<fieldset name="ordering"
label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_ORDERING_LABEL"
>
<field name="article_ordering" type="list"
default="a.title"
label="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERING_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERING_DESC"
>
<option value="a.ordering">MOD_ARTICLES_CATEGORY_OPTION_ORDERING_VALUE
</option>
<option value="fp.ordering">MOD_ARTICLES_CATEGORY_OPTION_ORDERINGFEATURED_VALUE
</option>
<option value="a.hits">MOD_ARTICLES_CATEGORY_OPTION_HITS_VALUE
</option>
<option value="a.title">JGLOBAL_TITLE
</option>
<option value="a.id">MOD_ARTICLES_CATEGORY_OPTION_ID_VALUE
</option>
<option value="a.alias">JFIELD_ALIAS_LABEL
</option>
<option value="a.created">MOD_ARTICLES_CATEGORY_OPTION_CREATED_VALUE
</option>
<option value="modified">MOD_ARTICLES_CATEGORY_OPTION_MODIFIED_VALUE
</option>
<option value="publish_up">MOD_ARTICLES_CATEGORY_OPTION_STARTPUBLISHING_VALUE
</option>
<option value="a.publish_down">MOD_ARTICLES_CATEGORY_OPTION_FINISHPUBLISHING_VALUE
</option>
</field>
<field name="article_ordering_direction" type="list"
default="ASC"
label="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERINGDIR_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEORDERINGDIR_DESC"
>
<option value="DESC">MOD_ARTICLES_CATEGORY_OPTION_DESCENDING_VALUE
</option>
<option value="ASC">MOD_ARTICLES_CATEGORY_OPTION_ASCENDING_VALUE
</option>
</field>
</fieldset>
<fieldset name="grouping"
label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_GROUPING_LABEL"
>
<field name="article_grouping" type="list"
default="none"
label="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPING_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPING_DESC"
>
<option value="none">JNONE
</option>
<option value="year">MOD_ARTICLES_CATEGORY_OPTION_YEAR_VALUE
</option>
<option value="month_year">MOD_ARTICLES_CATEGORY_OPTION_MONTHYEAR_VALUE
</option>
<option value="author">JAUTHOR
</option>
<option value="category_title">JCATEGORY
</option>
</field>
<field name="article_grouping_direction" type="list"
default="ksort"
label="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPINGDIR_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_ARTICLEGROUPINGDIR_DESC"
>
<option value="krsort">MOD_ARTICLES_CATEGORY_OPTION_DESCENDING_VALUE
</option>
<option value="ksort">MOD_ARTICLES_CATEGORY_OPTION_ASCENDING_VALUE
</option>
</field>
<field name="month_year_format" type="text"
default="F Y"
label="MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_DESC" />
</fieldset>
<fieldset name="display"
label="MOD_ARTICLES_CATEGORY_FIELD_GROUP_DISPLAY_LABEL"
>
<field name="link_titles" type="radio" default="1"
class="btn-group"
label="MOD_ARTICLES_CATEGORY_FIELD_LINKTITLES_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_LINKTITLES_DESC"
>
<option value="1">JYES
</option>
<option value="0">JNO
</option>
</field>
<field name="show_date" type="radio" default="0"
class="btn-group"
label="JDATE"
description="MOD_ARTICLES_CATEGORY_FIELD_SHOWDATE_DESC"
>
<option value="1">JSHOW
</option>
<option value="0">JHIDE
</option>
</field>
<field name="show_date_field" type="list" default="created"
label="MOD_ARTICLES_CATEGORY_FIELD_DATEFIELD_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_DATEFIELD_DESC"
>
<option value="created">MOD_ARTICLES_CATEGORY_OPTION_CREATED_VALUE
</option>
<option value="modified">MOD_ARTICLES_CATEGORY_OPTION_MODIFIED_VALUE
</option>
<option value="publish_up">MOD_ARTICLES_CATEGORY_OPTION_STARTPUBLISHING_VALUE
</option>
</field>
<field name="show_date_format" type="text"
default="Y-m-d H:i:s"
label="MOD_ARTICLES_CATEGORY_FIELD_DATEFIELDFORMAT_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_DATEFIELDFORMAT_DESC" />
<field name="show_category" type="radio" default="0"
class="btn-group"
label="JCATEGORY"
description="MOD_ARTICLES_CATEGORY_FIELD_SHOWCATEGORY_DESC"
>
<option value="1">JSHOW
</option>
<option value="0">JHIDE
</option>
</field>
<field name="show_hits" type="radio" default="0"
class="btn-group"
label="MOD_ARTICLES_CATEGORY_FIELD_SHOWHITS_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_SHOWHITS_DESC"
>
<option value="1">JSHOW
</option>
<option value="0">JHIDE
</option>
</field>
<field name="show_author" type="radio" default="0"
class="btn-group"
label="JAUTHOR"
description="MOD_ARTICLES_CATEGORY_FIELD_SHOWAUTHOR_DESC"
>
<option value="1">JSHOW
</option>
<option value="0">JHIDE
</option>
</field>
<field name="show_introtext" type="radio" default="0"
class="btn-group"
label="MOD_ARTICLES_CATEGORY_FIELD_SHOWINTROTEXT_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_SHOWINTROTEXT_DESC"
>
<option value="1">JSHOW
</option>
<option value="0">JHIDE
</option>
</field>
<field name="introtext_limit" type="text" default="100"
label="MOD_ARTICLES_CATEGORY_FIELD_INTROTEXTLIMIT_LABEL"
description="MOD_ARTICLES_CATEGORY_FIELD_INTROTEXTLIMIT_DESC" />
<field
name="show_readmore"
label="JGLOBAL_SHOW_READMORE_LABEL"
description="JGLOBAL_SHOW_READMORE_DESC"
type="radio"
default="0"
class="btn-group"
>
<option value="1">JSHOW
</option>
<option value="0">JHIDE
</option>
</field>
<field
name="show_readmore_title"
label="JGLOBAL_SHOW_READMORE_TITLE_LABEL"
description="JGLOBAL_SHOW_READMORE_TITLE_DESC"
type="radio"
default="1"
class="btn-group"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="readmore_limit"
type="text"
default="15"
label="JGLOBAL_SHOW_READMORE_LIMIT_LABEL"
description="JGLOBAL_SHOW_READMORE_LIMIT_DESC"
/>
</fieldset>
<fieldset name="advanced">
<field name="layout" type="modulelayout"
label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
<field name="moduleclass_sfx" type="textarea" rows="3"
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
<field name="owncache" type="list" default="1"
label="COM_MODULES_FIELD_CACHING_LABEL" description="COM_MODULES_FIELD_CACHING_DESC" >
<option value="1">JGLOBAL_USE_GLOBAL</option>
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING
</option>
</field>
<field name="cache_time" type="text" default="900"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
</fieldset>
</fields>
</config>
</extension>

View File

@ -0,0 +1,138 @@
<?php
/**
* @package Joomla.Site
* @subpackage mod_articles_category
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<ul class="category-module<?php echo $moduleclass_sfx; ?>">
<?php if ($grouped) : ?>
<?php foreach ($list as $group_name => $group) : ?>
<li>
<ul>
<?php foreach ($group as $item) : ?>
<li>
<?php if ($params->get('link_titles') == 1) : ?>
<a class="mod-articles-category-title <?php echo $item->active; ?>" href="<?php echo $item->link; ?>">
<?php echo $item->title; ?>
</a>
<?php else : ?>
<?php echo $item->title; ?>
<?php endif; ?>
<?php if ($item->displayHits) : ?>
<span class="mod-articles-category-hits">
(<?php echo $item->displayHits; ?>) </span>
<?php endif; ?>
<?php if ($params->get('show_author')) :?>
<span class="mod-articles-category-writtenby">
<?php echo $item->displayAuthorName; ?>
</span>
<?php endif;?>
<?php if ($item->displayCategoryTitle) :?>
<span class="mod-articles-category-category">
(<?php echo $item->displayCategoryTitle; ?>)
</span>
<?php endif; ?>
<?php if ($item->displayDate) : ?>
<span class="mod-articles-category-date"><?php echo $item->displayDate; ?></span>
<?php endif; ?>
<?php if ($params->get('show_introtext')) :?>
<p class="mod-articles-category-introtext">
<?php echo $item->displayIntrotext; ?>
</p>
<?php endif; ?>
<?php if ($params->get('show_readmore')) :?>
<p class="mod-articles-category-readmore">
<a class="mod-articles-category-title <?php echo $item->active; ?>" href="<?php echo $item->link; ?>">
<?php if ($item->params->get('access-view') == false) :
echo JText::_('MOD_ARTICLES_CATEGORY_REGISTER_TO_READ_MORE');
elseif ($readmore = $item->alternative_readmore) :
echo $readmore;
echo JHtml::_('string.truncate', $item->title, $params->get('readmore_limit'));
if ($params->get('show_readmore_title', 0) != 0) :
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
endif;
elseif ($params->get('show_readmore_title', 0) == 0) :
echo JText::sprintf('MOD_ARTICLES_CATEGORY_READ_MORE_TITLE');
else :
echo JText::_('MOD_ARTICLES_CATEGORY_READ_MORE');
echo JHtml::_('string.truncate', ($item->title), $params->get('readmore_limit'));
endif; ?>
</a>
</p>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</li>
<?php endforeach; ?>
<?php else : ?>
<?php foreach ($list as $item) : ?>
<li>
<?php if ($params->get('link_titles') == 1) : ?>
<a class="mod-articles-category-title <?php echo $item->active; ?>" href="<?php echo $item->link; ?>">
<?php echo $item->title; ?>
</a>
<?php else : ?>
<?php echo $item->title; ?>
<?php endif; ?>
<?php if ($item->displayHits) :?>
<span class="mod-articles-category-hits">
(<?php echo $item->displayHits; ?>) </span>
<?php endif; ?>
<?php if ($params->get('show_author')) :?>
<span class="mod-articles-category-writtenby">
<?php echo $item->displayAuthorName; ?>
</span>
<?php endif;?>
<?php if ($item->displayCategoryTitle) :?>
<span class="mod-articles-category-category">
(<?php echo $item->displayCategoryTitle; ?>)
</span>
<?php endif; ?>
<?php if ($item->displayDate) : ?>
<span class="mod-articles-category-date"><?php echo $item->displayDate; ?></span>
<?php endif; ?>
<?php if ($params->get('show_introtext')) :?>
<p class="mod-articles-category-introtext">
<?php echo $item->displayIntrotext; ?>
</p>
<?php endif; ?>
<?php if ($params->get('show_readmore')) :?>
<p class="mod-articles-category-readmore">
<a class="mod-articles-category-title <?php echo $item->active; ?>" href="<?php echo $item->link; ?>">
<?php if ($item->params->get('access-view') == false) :
echo JText::_('MOD_ARTICLES_CATEGORY_REGISTER_TO_READ_MORE');
elseif ($readmore = $item->alternative_readmore) :
echo $readmore;
echo JHtml::_('string.truncate', $item->title, $params->get('readmore_limit'));
elseif ($params->get('show_readmore_title', 0) == 0) :
echo JText::sprintf('MOD_ARTICLES_CATEGORY_READ_MORE_TITLE');
else :
echo JText::_('MOD_ARTICLES_CATEGORY_READ_MORE');
echo JHtml::_('string.truncate', $item->title, $params->get('readmore_limit'));
endif; ?>
</a>
</p>
<?php endif; ?>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>