mirror of
https://github.com/e107inc/e107.git
synced 2025-03-17 10:59:49 +01:00
Additional information passed to news_style function (theme function) - current action and parameters (as set in news class and news view)
This commit is contained in:
parent
015fe6bbfc
commit
02b66d3899
@ -507,7 +507,8 @@ class news {
|
||||
{
|
||||
global $NEWSSTYLE, $NEWSLISTSTYLE;
|
||||
|
||||
if ($override_newsitem = e107::getSingleton('override', true)->override_check('render_newsitem')) {
|
||||
if ($override_newsitem = e107::getSingleton('override', true)->override_check('render_newsitem'))
|
||||
{
|
||||
$result = call_user_func($override_newsitem, $news, $mode, $n_restrict, $NEWS_TEMPLATE, $param);
|
||||
if ($result == 'return')
|
||||
{
|
||||
@ -587,8 +588,10 @@ class news {
|
||||
if ($NEWS_TEMPLATE) {
|
||||
$NEWS_PARSE = $NEWS_TEMPLATE;
|
||||
} else {
|
||||
if (function_exists("news_style")) {
|
||||
$NEWS_PARSE = news_style($news);
|
||||
if (function_exists("news_style"))
|
||||
{
|
||||
$action = varset($param['current_action'], 'default');
|
||||
$NEWS_PARSE = news_style($news, $action, $param);
|
||||
} else {
|
||||
$NEWS_PARSE = $NEWSSTYLE;
|
||||
}
|
||||
|
9
news.php
9
news.php
@ -157,7 +157,9 @@ if ($action == 'cat' || $action == 'all')
|
||||
define('e_PAGETITLE', $tp->toHTML($category_name,FALSE,'TITLE'));
|
||||
}
|
||||
|
||||
$currentNewsAction = $action;
|
||||
require_once(HEADERF);
|
||||
$action = $currentNewsAction;
|
||||
|
||||
if(!$NEWSLISTSTYLE)
|
||||
{
|
||||
@ -324,7 +326,9 @@ if ($action == 'extend')
|
||||
$news['news_extended'].="<br /><br />";
|
||||
}*/
|
||||
|
||||
$currentNewsAction = $action;
|
||||
require_once(HEADERF);
|
||||
$action = $currentNewsAction;
|
||||
|
||||
$param = array();
|
||||
$param['current_action'] = $action;
|
||||
@ -553,7 +557,10 @@ switch($action)
|
||||
define("e_PAGETITLE", $p_title);
|
||||
}*/
|
||||
|
||||
$currentNewsAction = $action;
|
||||
require_once(HEADERF);
|
||||
$action = $currentNewsAction;
|
||||
|
||||
if(!$action)
|
||||
{
|
||||
// Removed, themes should use {FEATUREBOX} shortcode instead
|
||||
@ -585,7 +592,7 @@ if(isset($pref['news_unstemplate']) && $pref['news_unstemplate'] && file_exists(
|
||||
foreach($newsAr as $news) {
|
||||
|
||||
if(is_array($ALTERNATECLASSES)) {
|
||||
$newsdata[$loop] .= "<div class='{$ALTERNATECLASSES[0]}'>".$ix->render_newsitem($news, "return")."</div>";
|
||||
$newsdata[$loop] .= "<div class='{$ALTERNATECLASSES[0]}'>".$ix->render_newsitem($news, "return", '', '', $param)."</div>";
|
||||
$ALTERNATECLASSES = array_reverse($ALTERNATECLASSES);
|
||||
} else {
|
||||
$newsdata[$loop] .= $ix->render_newsitem($news, 'return', '', '', $param);
|
||||
|
Loading…
x
Reference in New Issue
Block a user