mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 23:26:41 +02:00
Option to prevent loading of js/css
This commit is contained in:
@@ -792,8 +792,13 @@ class e_menu_layout
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e107::set('css_enabled',false);
|
||||||
|
e107::set('js_enabled',false);
|
||||||
|
|
||||||
require($file);
|
require($file);
|
||||||
|
|
||||||
|
e107::set('css_enabled',true);
|
||||||
|
e107::set('js_enabled',true);
|
||||||
|
|
||||||
$head = array();
|
$head = array();
|
||||||
$foot = array();
|
$foot = array();
|
||||||
@@ -988,7 +993,7 @@ class e_menu_layout
|
|||||||
|
|
||||||
foreach ($areas as $menu_act)
|
foreach ($areas as $menu_act)
|
||||||
{
|
{
|
||||||
$text .= "<li><input type='submit' class='btn btn-primary btn-block' id='menuActivate_".trim($menu_act)."' name='menuActivate[".trim($menu_act)."]' value='".MENLAN_13." ".trim($menu_act)."' /></li>\n";
|
$text .= "<li><input type='submit' class='btn btn-primary btn-block' name='menuActivate[".trim($menu_act)."]' value='".MENLAN_13." ".trim($menu_act)."' /></li>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= '</ul>';
|
$text .= '</ul>';
|
||||||
|
@@ -127,6 +127,22 @@ class e107
|
|||||||
*/
|
*/
|
||||||
protected static $_theme_config_arr = array();
|
protected static $_theme_config_arr = array();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* e107 e107::css() on/off flag.
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected static $_css_enabled = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* e107 e107::js() on/off flag.
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected static $_js_enabled = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Core handlers array
|
* Core handlers array
|
||||||
* For new/missing handler add
|
* For new/missing handler add
|
||||||
@@ -1844,7 +1860,23 @@ class e107
|
|||||||
}
|
}
|
||||||
return e_jsmanager::getInstance();
|
return e_jsmanager::getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function set($type=null, $val=true)
|
||||||
|
{
|
||||||
|
if($type === 'js_enabled')
|
||||||
|
{
|
||||||
|
self::$_js_enabled = (bool) $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($type === 'css_enabled')
|
||||||
|
{
|
||||||
|
self::$_css_enabled = (bool) $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JS Common Public Function. Prefered is shortcode script path
|
* JS Common Public Function. Prefered is shortcode script path
|
||||||
* @param string $type core|theme|footer|inline|footer-inline|url or any existing plugin_name
|
* @param string $type core|theme|footer|inline|footer-inline|url or any existing plugin_name
|
||||||
@@ -1854,6 +1886,11 @@ class e107
|
|||||||
*/
|
*/
|
||||||
public static function js($type, $data, $dep = null, $zone = null, $pre = '', $post = '')
|
public static function js($type, $data, $dep = null, $zone = null, $pre = '', $post = '')
|
||||||
{
|
{
|
||||||
|
if(self::$_js_enabled === false)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$jshandler = e107::getJs();
|
$jshandler = e107::getJs();
|
||||||
$jshandler->setDependency($dep);
|
$jshandler->setDependency($dep);
|
||||||
|
|
||||||
@@ -1946,6 +1983,11 @@ class e107
|
|||||||
{
|
{
|
||||||
define("BOOTSTRAP", true);
|
define("BOOTSTRAP", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(self::$_css_enabled === false)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$jshandler = e107::getJs();
|
$jshandler = e107::getJs();
|
||||||
$jshandler->setDependency($dep);
|
$jshandler->setDependency($dep);
|
||||||
|
@@ -206,7 +206,7 @@ class e_menuManager {
|
|||||||
// $cnt = $sql->select("menus", "*", "menu_location > 0 AND menu_layout = '$curLayout' ORDER BY menu_name "); // calculate height to remove vertical scroll-bar.
|
// $cnt = $sql->select("menus", "*", "menu_location > 0 AND menu_layout = '$curLayout' ORDER BY menu_name "); // calculate height to remove vertical scroll-bar.
|
||||||
|
|
||||||
// $text = "<object class='well' type='text/html' id='menu_iframe' data='".$url."' width='100%' style='overflow:auto;width: 100%; height: ".(($cnt*90)+600)."px; border: 0px' ></object>";
|
// $text = "<object class='well' type='text/html' id='menu_iframe' data='".$url."' width='100%' style='overflow:auto;width: 100%; height: ".(($cnt*90)+600)."px; border: 0px' ></object>";
|
||||||
$text = "<iframe class='well' id='menu_iframe' name='e-mm-iframe' src='".$url."' width='100%' style='width: 100%; height: 90vh; border: 0px' ></iframe>";
|
$text = "<iframe class='well' id='menu_iframe' name='e-mm-iframe' src='".$url."' width='100' style='width: 100%; height: 90vh; border: 0px' ></iframe>";
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user