1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Tablerender: setContent('list') added to login menu and news menus.

This commit is contained in:
Cameron 2019-06-16 13:30:16 -07:00
parent 9e3a77fdf7
commit 478fc8d060
6 changed files with 44 additions and 3 deletions

View File

@ -1026,7 +1026,7 @@ if (!class_exists('e107table', false))
*/
public function setUniqueId($id)
{
$this->uniqueId = !empty($id) ? $id : null;
$this->uniqueId = !empty($id) ? eHelper::dasherize($id) : null;
return $this;
}

View File

@ -908,7 +908,17 @@ class e_news_tree extends e_front_tree_model
}
$mod = true === $tablerender ? 'news_latest_menu' : $tablerender;
return e107::getRender()->tablerender($caption, $ret, varset($parms['mode'], $mod), $return);
if(strpos($ret,'<ul ') !== false)
{
e107::getRender()->setUniqueId(varset($parms['mode'], $mod))->setContent('list', true);
}
$text = e107::getRender()->tablerender($caption, $ret, varset($parms['mode'], $mod), $return);
return $text;
}
if($return) return $ret;
@ -1134,7 +1144,17 @@ class e_news_category_tree extends e_front_tree_model
}
$mod = true === $tablerender ? 'news_categories_menu' : $tablerender;
return e107::getRender()->tablerender($caption, $ret, varset($parms['mode'], $mod), $return);
if(strpos($ret,'<ul ') !== false)
{
e107::getRender()->setUniqueId($mod)->setContent('list', true);
}
$text = e107::getRender()->tablerender($caption, $ret, varset($parms['mode'], $mod), $return);
return $text;
}
if($return) return $ret;

View File

@ -152,6 +152,11 @@ if (USER == TRUE || ADMIN == TRUE)
}
//render
if(strpos($text,'<ul ') !== false)
{
$ns->setUniqueId('login-menu')->setContent('list', true);
}
$ns->tablerender($caption, $text, 'login');
// END LOGGED CODE
@ -188,6 +193,7 @@ else
} else {
$caption = LAN_LOGINMENU_5;
}
$ns->tablerender($caption, $text, 'login');
}
// END NOT LOGGED CODE

View File

@ -105,6 +105,12 @@ e107::plugLan('news');
$caption = !empty($parm['caption'][e_LANGUAGE]) ? $parm['caption'][e_LANGUAGE] : LAN_NEWSARCHIVE_MENU_TITLE;
if(strpos($start,'<ul ') !== false)
{
e107::getRender()->setUniqueId('news-archive-menu')->setContent('list', true);
}
e107::getRender()->tablerender($caption, $start.$text.$end, 'news-archive-menu');
//e107::getDebug()->log($arr);

View File

@ -23,6 +23,7 @@ if(false === $cached)
$parms = $parm;
}
/** @var e_news_category_tree $ctree */
$ctree = e107::getObject('e_news_category_tree', null, e_HANDLER.'news_class.php');
$parms['tmpl'] = 'news_menu';

View File

@ -134,7 +134,15 @@ if(false === $cached)
$cached .= $footer;
}
if(strpos($cached,'<ul ') !== false)
{
e107::getRender()->setUniqueId('news-months-menu')->setContent('list', true);
}
$cached = $ns->tablerender(BLOGCAL_L1." ".$req_year, $cached, 'news_months_menu', true);
}
e107::getCache()->set($cString, $cached);
}