From 238756446cb77163d9da7e2ceb26dd83c7ff60e0 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 4 Feb 2017 13:45:11 -0800 Subject: [PATCH] Remove deprecated $HEADER / $FOOTER from bootstrap3 theme to avoid confusing developers. --- e107_admin/menus.php | 8 +- e107_admin/plugin.php | 6 +- e107_themes/bootstrap3/theme.php | 256 +------------------- e107_themes/bootstrap3/theme_shortcodes.php | 41 +++- 4 files changed, 57 insertions(+), 254 deletions(-) diff --git a/e107_admin/menus.php b/e107_admin/menus.php index 149877060..76d38e26a 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -42,7 +42,7 @@ require_once("../class2.php"); if(e_MENUMANAGER_ACTIVE === false ) { - if(!deftrue("e_DEBUG_MENUMANAGER")) + if(!deftrue("e_DEBUG")) { e107::getJs()->inlineCSS(' @@ -879,7 +879,7 @@ class e_menu_layout { $template = $head[$k]."\n{---}".$foot[$k]; $layout['templates'][$k] = $template; - $layout['menus'][$k] = self::countMenus($template); + $layout['menus'][$k] = self::countMenus($template, $k); } @@ -889,7 +889,7 @@ class e_menu_layout } - private static function countMenus($template) + private static function countMenus($template, $name) { if(preg_match_all("/\{MENU=([\d]{1,3})(:[\w\d]*)?\}/", $template, $matches)) { @@ -897,6 +897,8 @@ class e_menu_layout return $matches[1]; } + e107::getDebug()->log("No Menus Found in Template:".$name." with strlen: ".strlen($template)); + return array(); } diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index 521ecd1dd..42b121910 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -1247,6 +1247,8 @@ class pluginManager{ $text = ""; + $plg = e107::getPlug(); + foreach($pluginList as $plug) { e107::loadLanFiles($plug['plugin_path'],'admin'); @@ -1264,10 +1266,10 @@ class pluginManager{ $plugin_config_icon = ""; - if(deftrue('e_DEBUG_PLUGMANAGER')) { - $plug_vars = e107::getPlug()->getMeta($plug['plugin_path']); + $plg->load($plug['plugin_path']); + $plug_vars = $plg->getMeta(); } else { diff --git a/e107_themes/bootstrap3/theme.php b/e107_themes/bootstrap3/theme.php index 0112961d5..583af387c 100644 --- a/e107_themes/bootstrap3/theme.php +++ b/e107_themes/bootstrap3/theme.php @@ -541,245 +541,9 @@ $LAYOUT['jumbotron_sidebar_right'] = ' /* XXX EVERYTHING BELOW THIS POINT IS UNUSED FOR NOW */ - - - - -$HEADER['default'] = ' - -
-
-
- {NAVIGATION|s=side} - {SETSTYLE=menu} - {MENU=1} -
-
- {SETSTYLE=default} - {WMESSAGE} -'; - - - -$FOOTER['default'] = ' - {SETSTYLE=span4} - -
-
- -
- -
- {SITEDISCLAIMER} -
- -
'; - - -$HEADER['default-home'] = $HEADER['default']; - - -$FOOTER['default-home'] = ' - - {SETSTYLE=span4} - -
- {MENU=2} -
-
- {MENU=3} -
- - - - -
- - - -'; - - - - - - - - - - -// HERO http://twitter.github.com/bootstrap/examples/hero.html -//FIXME insert shortcodes while maintaining only bootstrap classes. - -$HEADER['hero'] = ' - - - -
- - -
'; - - /* -

Hello, world!

-

This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.

-

Learn more »

- */ - - -//FIXME insert shortcodes while maintaining classes. -$FOOTER['hero'] = ' -
- - -
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-

Heading

-

Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.

-

View details »

-
-
-

Heading

-

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

-

View details »

-
-
- -
- -
-

© Company 2012

-
- -
'; - - -// Marketing Narrow - http://twitter.github.com/bootstrap/examples/marketing-narrow.html -//FIXME insert shortcodes while maintaing classes. - -$HEADER['marketing-narrow'] = ' -
- -
- -

Project name

-
- -
- -
-

Super awesome marketing speak!

-

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

- Sign up today -'; - - -//FIXME insert shortcodes while maintaing classes. - -$FOOTER['marketing-narrow'] = ' -
- -
- -
-
-

Subheading

-

Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.

- -

Subheading

-

Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.

- -

Subheading

-

Maecenas sed diam eget risus varius blandit sit amet non magna.

-
- -
-

Subheading

-

Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.

- -

Subheading

-

Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.

- -

Subheading

-

Maecenas sed diam eget risus varius blandit sit amet non magna.

-
-
- -
- - - -
- -'; - - - - - +/** +* $HEADER AND $FOOTER are deprecated. +*/ /* @@ -789,9 +553,9 @@ $FOOTER['marketing-narrow'] = ' */ +/* - -$HEADER['docs'] = << @@ -836,13 +600,9 @@ $HEADER['docs'] = << + {---} - -TMPL; - - -$FOOTER['docs'] = << @@ -869,7 +629,7 @@ $FOOTER['docs'] = << +?> \ No newline at end of file diff --git a/e107_themes/bootstrap3/theme_shortcodes.php b/e107_themes/bootstrap3/theme_shortcodes.php index 8f6f452d8..34d0a61f1 100644 --- a/e107_themes/bootstrap3/theme_shortcodes.php +++ b/e107_themes/bootstrap3/theme_shortcodes.php @@ -224,7 +224,46 @@ class theme_shortcodes extends e_shortcode return $tp->parseTemplate($text,true,$login_menu_shortcodes); } - + + /* + * @example shortcode to render news. + */ + function sc_bootstrap_news_example($parm=null) + { + $news = e107::getObject('e_news_tree'); // get news class. + $sc = e107::getScBatch('news'); // get news shortcodes. + $tp = e107::getParser(); // get parser. + + $newsCategory = 1; // null, number or array(1,3,4); + + $opts = array( + 'db_order' =>'n.news_sticky DESC, n.news_datestamp DESC', //default is n.news_datestamp DESC + 'db_where' => "FIND_IN_SET(0, n.news_render_type)", // optional + 'db_limit' => '6', // default is 10 + ); + + // load active news items. ie. the correct userclass, start/end time etc. + $data = $news->loadJoinActive($newsCategory, false, $opts)->toArray(); // false to utilize the built-in cache. + $TEMPLATE = "{NEWS_TITLE} : {NEWS_CATEGORY_NAME}
"; + + $text = ''; + + foreach($data as $row) + { + + $sc->setScVar('news_item', $row); // send $row values to shortcodes. + $text .= $tp->parseTemplate($TEMPLATE, true, $sc); // parse news shortcodes. + } + + return $text; + + + } + + + + + }