Commit 5bddaabf authored by chealer's avatar chealer

[ENH] change article_topics module to new module style (modules-doc).

[FIX] HTML special chars encoding
[FIX] broken check to display module contents using randomly defined ix
parent 6e38889c
......@@ -2764,10 +2764,10 @@ modules/index.php -text
modules/mod-action_calendar.php -text
modules/mod-article_archives.php -text
modules/mod-article_by_rating.php -text
modules/mod-article_topics.php -text
modules/mod-articles.php -text
modules/mod-calendar_new.php -text
modules/mod-func-adsense.php -text
modules/mod-func-article_topics.php -text
modules/mod-func-assistant.php -text
modules/mod-func-blog_last_comments.php -text
modules/mod-func-breadcrumb.php -text
......
<?php
//$Id$
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
if (!function_exists("mod_article_topics_help")) {
function mod_article_topics_help() {
return tra('list topics with links to the articles');
}
}
global $smarty;
$smarty->assign('module_title', isset($module_params["title"]) ? $module_params["title"] : tra("Article Topics"));
global $artlib; include_once('lib/articles/artlib.php');
$listTopics = $artlib->list_topics();
$smarty->assign('listTopics', $listTopics);
$smarty->assign('nonums', isset($module_params["nonums"]) ? $module_params["nonums"] : 'n');
<?php
//$Id$
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
function module_article_topics_info() {
return array(
'name' => tra('Article Topics'),
'description' => tra('Lists all article topics with links to their articles.'),
'prefs' => array( 'feature_articles' ),
'params' => array(),
'common_params' => array('nonums')
);
}
function module_article_topics( $mod_reference, $module_params ) {
global $smarty;
global $artlib; include_once('lib/articles/artlib.php');
$listTopics = $artlib->list_topics();
$smarty->assign('listTopics', $listTopics);
}
{* $Id$ *}
{if $prefs.feature_articles eq 'y'}
{if !isset($tpl_module_title)}{eval assign=tpl_module_title var="{tr}$module_title{/tr}"}{/if}
{tikimodule error=$module_params.error title=$tpl_module_title name="article_topics" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle}
{if $listTopics[ix].arts > 0}
{if $nonums != 'y'}<ol>{else}<ul>{/if}
{section name=ix loop=$listTopics}
<li>
<a class="linkmodule" href="tiki-view_articles.php?topic={$listTopics[ix].topicId}">{$listTopics[ix].name}</a>
</li>
{/section}
{if $nonums != 'y'}</ol>{else}</ul>{/if}
{/if}
{/tikimodule}
{/if}
{tikimodule error=$module_params.error title=$tpl_module_title name="article_topics" flip=$module_params.flip decorations=$module_params.decorations nobox=$module_params.nobox notitle=$module_params.notitle}
{if $nonums != 'y'}<ol>{else}<ul>{/if}
{section name=ix loop=$listTopics}
<li>
<a class="linkmodule" href="tiki-view_articles.php?topic={$listTopics[ix].topicId}">{$listTopics[ix].name|escape}</a>
</li>
{/section}
{if $nonums != 'y'}</ol>{else}</ul>{/if}
{/tikimodule}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment