You've already forked joomla_test
first commit
This commit is contained in:
38
modules/mod_articles_categories/helper.php
Normal file
38
modules/mod_articles_categories/helper.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_articles_categories
|
||||
*
|
||||
* @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;
|
||||
|
||||
require_once JPATH_SITE.'/components/com_content/helpers/route.php';
|
||||
|
||||
/**
|
||||
* Helper for mod_articles_categories
|
||||
*
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_articles_categories
|
||||
*/
|
||||
abstract class ModArticlesCategoriesHelper
|
||||
{
|
||||
public static function getList(&$params)
|
||||
{
|
||||
$categories = JCategories::getInstance('Content');
|
||||
$category = $categories->get($params->get('parent', 'root'));
|
||||
|
||||
if ($category != null)
|
||||
{
|
||||
$items = $category->getChildren();
|
||||
if ($params->get('count', 0) > 0 && count($items) > $params->get('count', 0))
|
||||
{
|
||||
$items = array_slice($items, 0, $params->get('count', 0));
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
1
modules/mod_articles_categories/index.html
Normal file
1
modules/mod_articles_categories/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
21
modules/mod_articles_categories/mod_articles_categories.php
Normal file
21
modules/mod_articles_categories/mod_articles_categories.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_articles_categories
|
||||
*
|
||||
* @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';
|
||||
|
||||
$list = ModArticlesCategoriesHelper::getList($params);
|
||||
if (!empty($list))
|
||||
{
|
||||
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
|
||||
$startLevel = reset($list)->getParent()->level;
|
||||
require JModuleHelper::getLayoutPath('mod_articles_categories', $params->get('layout', 'default'));
|
||||
}
|
126
modules/mod_articles_categories/mod_articles_categories.xml
Normal file
126
modules/mod_articles_categories/mod_articles_categories.xml
Normal file
@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension
|
||||
type="module" version="3.1" client="site" method="upgrade">
|
||||
<name>mod_articles_categories</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_CATEGORIES_XML_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename module="mod_articles_categories">mod_articles_categories.php</filename>
|
||||
<folder>tmpl</folder>
|
||||
<filename>helper.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<filename>mod_articles_categories.xml</filename>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">en-GB.mod_articles_categories.ini</language>
|
||||
<language tag="en-GB">en-GB.mod_articles_categories.sys.ini</language>
|
||||
</languages>
|
||||
<help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_CATEGORIES" />
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic">
|
||||
<field
|
||||
name="parent"
|
||||
type="category"
|
||||
extension="com_content"
|
||||
published=""
|
||||
label="MOD_ARTICLES_CATEGORIES_FIELD_PARENT_LABEL"
|
||||
description="MOD_ARTICLES_CATEGORIES_FIELD_PARENT_DESC"/>
|
||||
<field
|
||||
name="show_description"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_CATEGORIES_FIELD_SHOW_DESCRIPTION_LABEL"
|
||||
description="MOD_ARTICLES_CATEGORIES_FIELD_SHOW_DESCRIPTION_DESC">
|
||||
<option
|
||||
value="0">JNO</option>
|
||||
<option
|
||||
value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="show_children"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="MOD_ARTICLES_CATEGORIES_FIELD_SHOW_CHILDREN_LABEL"
|
||||
description="MOD_ARTICLES_CATEGORIES_FIELD_SHOW_CHILDREN_DESC">
|
||||
<option
|
||||
value="0">JNO</option>
|
||||
<option
|
||||
value="1">JYES</option>
|
||||
</field>
|
||||
<field name="count" type="list"
|
||||
label="MOD_ARTICLES_CATEGORIES_FIELD_COUNT_LABEL"
|
||||
description="MOD_ARTICLES_CATEGORIES_FIELD_COUNT_DESC"
|
||||
default="0"
|
||||
>
|
||||
<option value="0">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>
|
||||
<option value="6">J6</option>
|
||||
<option value="7">J7</option>
|
||||
<option value="8">J8</option>
|
||||
<option value="9">J9</option>
|
||||
<option value="10">J10</option>
|
||||
</field>
|
||||
|
||||
<field name="maxlevel" type="list"
|
||||
label="MOD_ARTICLES_CATEGORIES_FIELD_MAXLEVEL_LABEL"
|
||||
description="MOD_ARTICLES_CATEGORIES_FIELD_MAXLEVEL_DESC"
|
||||
default="0"
|
||||
>
|
||||
<option value="0">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>
|
||||
<option value="6">J6</option>
|
||||
<option value="7">J7</option>
|
||||
<option value="8">J8</option>
|
||||
<option value="9">J9</option>
|
||||
<option value="10">J10</option>
|
||||
</field>
|
||||
|
||||
</fieldset>
|
||||
<fieldset name="advanced">
|
||||
<field name="layout" type="modulelayout"
|
||||
label="JFIELD_ALT_LAYOUT_LABEL" description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
|
||||
<field name="item_heading" type="list" default="4"
|
||||
label="MOD_ARTICLES_CATEGORIES_TITLE_HEADING_LABEL"
|
||||
description="MOD_ARTICLES_CATEGORIES_TITLE_HEADING_DESC"
|
||||
>
|
||||
<option value="1">JH1</option>
|
||||
<option value="2">JH2</option>
|
||||
<option value="3">JH3</option>
|
||||
<option value="4">JH4</option>
|
||||
<option value="5">JH5</option>
|
||||
</field>
|
||||
|
||||
<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>
|
15
modules/mod_articles_categories/tmpl/default.php
Normal file
15
modules/mod_articles_categories/tmpl/default.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_articles_categories
|
||||
*
|
||||
* @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="categories-module<?php echo $moduleclass_sfx; ?>">
|
||||
<?php
|
||||
require JModuleHelper::getLayoutPath('mod_articles_categories', $params->get('layout', 'default').'_items');
|
||||
?></ul>
|
37
modules/mod_articles_categories/tmpl/default_items.php
Normal file
37
modules/mod_articles_categories/tmpl/default_items.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage mod_articles_categories
|
||||
*
|
||||
* @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;
|
||||
foreach ($list as $item) :
|
||||
|
||||
?>
|
||||
<li <?php if ($_SERVER['PHP_SELF'] == JRoute::_(ContentHelperRoute::getCategoryRoute($item->id))) echo ' class="active"';?>> <?php $levelup = $item->level - $startLevel - 1; ?>
|
||||
<h<?php echo $params->get('item_heading') + $levelup; ?>>
|
||||
<a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->id)); ?>">
|
||||
<?php echo $item->title;?></a>
|
||||
</h<?php echo $params->get('item_heading') + $levelup; ?>>
|
||||
|
||||
<?php
|
||||
if ($params->get('show_description', 0))
|
||||
{
|
||||
echo JHtml::_('content.prepare', $item->description, $item->getParams(), 'mod_articles_categories.content');
|
||||
}
|
||||
if ($params->get('show_children', 0) && (($params->get('maxlevel', 0) == 0) || ($params->get('maxlevel') >= ($item->level - $startLevel))) && count($item->getChildren()))
|
||||
{
|
||||
|
||||
echo '<ul>';
|
||||
$temp = $list;
|
||||
$list = $item->getChildren();
|
||||
require JModuleHelper::getLayoutPath('mod_articles_categories', $params->get('layout', 'default').'_items');
|
||||
$list = $temp;
|
||||
echo '</ul>';
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
1
modules/mod_articles_categories/tmpl/index.html
Normal file
1
modules/mod_articles_categories/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
Reference in New Issue
Block a user