Commit b7dbcb51 authored by chealer's avatar chealer

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

[FIX] HTML special chars encoding
parent a27054e0
......@@ -2805,6 +2805,7 @@ modules/mod-func-last_images.php -text
modules/mod-func-last_modif_events.php -text
modules/mod-func-last_modif_pages.php -text
modules/mod-func-last_modified_blogs.php -text
modules/mod-func-last_submissions.php -text
modules/mod-func-last_tracker_comments.php -text
modules/mod-func-last_tracker_items.php -text
modules/mod-func-live_support.php -text
......@@ -2844,7 +2845,6 @@ modules/mod-func-who_is_there.php -text
modules/mod-func-wiki_last_comments.php -text
modules/mod-func-youtube.php -text
modules/mod-last_articles.php -text
modules/mod-last_submissions.php -text
modules/mod-last_visitors.php -text
modules/mod-months_links.php -text
modules/mod-shoutbox.php -text
......
<?php
//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_last_submissions_info() {
return array(
'name' => tra('Last submissions'),
'description' => tra('Lists the specified number of article submissions from newest to oldest.'),
'prefs' => array("feature_submissions"),
'params' => array(),
'common_params' => array('nonums', 'rows')
);
}
function module_last_submissions( $mod_reference, $module_params ) {
global $tikilib, $smarty;
$ranking = $tikilib->list_submissions(0, $mod_reference['rows'], 'created_desc', '', '');
$smarty->assign('modLastSubmissions', $ranking["data"]);
}
<?php
//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;
}
global $tikilib, $smarty;
$ranking = $tikilib->list_submissions(0, $module_rows, 'created_desc', '', '');
$smarty->assign('modLastSubmissions', $ranking["data"]);
$smarty->assign('nonums', isset($module_params["nonums"]) ? $module_params["nonums"] : 'n');
{* $Id$ *}
{if $prefs.feature_submissions eq 'y'}
{if !isset($tpl_module_title)}
{if $nonums eq 'y'}
{eval var="<a href=\"tiki-list_submissions.php\">{tr}Last `$module_rows` submissions{/tr}</a>" assign="tpl_module_title"}
{else}
{eval var="<a href=\"tiki-list_submissions.php\">{tr}Last submissions{/tr}</a>" assign="tpl_module_title"}
{/if}
{/if}
{tikimodule error=$module_params.error title=$tpl_module_title name="last_submissions" 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=$modLastSubmissions}
<li>
{if $tiki_p_edit_submission eq 'y'}
<a class="linkmodule" href="tiki-edit_submission.php?subId={$modLastSubmissions[ix].subId}">
{$modLastSubmissions[ix].title}
{$modLastSubmissions[ix].title|escape}
</a>
{else}
<span class="module">{$modLastSubmissions[ix].title}</span>
<span class="module">{$modLastSubmissions[ix].title|escape}</span>
{/if}
</li>
{/section}
{if $nonums != 'y'}</ol>{else}</ul>{/if}
{/tikimodule}
{/if}
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