mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02: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:
@@ -507,7 +507,8 @@ class news {
|
|||||||
{
|
{
|
||||||
global $NEWSSTYLE, $NEWSLISTSTYLE;
|
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);
|
$result = call_user_func($override_newsitem, $news, $mode, $n_restrict, $NEWS_TEMPLATE, $param);
|
||||||
if ($result == 'return')
|
if ($result == 'return')
|
||||||
{
|
{
|
||||||
@@ -587,8 +588,10 @@ class news {
|
|||||||
if ($NEWS_TEMPLATE) {
|
if ($NEWS_TEMPLATE) {
|
||||||
$NEWS_PARSE = $NEWS_TEMPLATE;
|
$NEWS_PARSE = $NEWS_TEMPLATE;
|
||||||
} else {
|
} else {
|
||||||
if (function_exists("news_style")) {
|
if (function_exists("news_style"))
|
||||||
$NEWS_PARSE = news_style($news);
|
{
|
||||||
|
$action = varset($param['current_action'], 'default');
|
||||||
|
$NEWS_PARSE = news_style($news, $action, $param);
|
||||||
} else {
|
} else {
|
||||||
$NEWS_PARSE = $NEWSSTYLE;
|
$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'));
|
define('e_PAGETITLE', $tp->toHTML($category_name,FALSE,'TITLE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$currentNewsAction = $action;
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
|
$action = $currentNewsAction;
|
||||||
|
|
||||||
if(!$NEWSLISTSTYLE)
|
if(!$NEWSLISTSTYLE)
|
||||||
{
|
{
|
||||||
@@ -324,7 +326,9 @@ if ($action == 'extend')
|
|||||||
$news['news_extended'].="<br /><br />";
|
$news['news_extended'].="<br /><br />";
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
$currentNewsAction = $action;
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
|
$action = $currentNewsAction;
|
||||||
|
|
||||||
$param = array();
|
$param = array();
|
||||||
$param['current_action'] = $action;
|
$param['current_action'] = $action;
|
||||||
@@ -553,7 +557,10 @@ switch($action)
|
|||||||
define("e_PAGETITLE", $p_title);
|
define("e_PAGETITLE", $p_title);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
$currentNewsAction = $action;
|
||||||
require_once(HEADERF);
|
require_once(HEADERF);
|
||||||
|
$action = $currentNewsAction;
|
||||||
|
|
||||||
if(!$action)
|
if(!$action)
|
||||||
{
|
{
|
||||||
// Removed, themes should use {FEATUREBOX} shortcode instead
|
// 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) {
|
foreach($newsAr as $news) {
|
||||||
|
|
||||||
if(is_array($ALTERNATECLASSES)) {
|
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);
|
$ALTERNATECLASSES = array_reverse($ALTERNATECLASSES);
|
||||||
} else {
|
} else {
|
||||||
$newsdata[$loop] .= $ix->render_newsitem($news, 'return', '', '', $param);
|
$newsdata[$loop] .= $ix->render_newsitem($news, 'return', '', '', $param);
|
||||||
|
Reference in New Issue
Block a user