diff options
author | friendica <info@friendica.com> | 2013-12-11 18:29:56 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-12-11 18:29:56 -0800 |
commit | 2f46bacded409c86514bc7542a01337c3cbf642a (patch) | |
tree | 574fbe5aadd4249bc589867cad78888bc023b355 /include/plugin.php | |
parent | 4d187918528f12256ee7ae145b0e0e25578df8b4 (diff) | |
download | volse-hubzilla-2f46bacded409c86514bc7542a01337c3cbf642a.tar.gz volse-hubzilla-2f46bacded409c86514bc7542a01337c3cbf642a.tar.bz2 volse-hubzilla-2f46bacded409c86514bc7542a01337c3cbf642a.zip |
head_remove_css, head_remove_js
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-x | include/plugin.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/plugin.php b/include/plugin.php index 5ed2a1736..5ad467f98 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -494,6 +494,15 @@ function head_add_css($src,$media = 'screen') { get_app()->css_sources[] = array($src,$media); } + +function head_remove_css($src,$media = 'screen') { + $a = get_app(); + $index = array_search(array($src,$media),$a->css_sources); + if($index !== false) + unset($a->css_sources[$index]); + +} + function head_get_css() { $str = ''; $sources = get_app()->css_sources; @@ -515,11 +524,18 @@ function format_css_if_exists($source) { } - function head_add_js($src) { get_app()->js_sources[] = $src; } +function head_remove_js($src) { + $a = get_app(); + $index = array_search($src,$a->js_sources); + if($index !== false) + unset($a->js_sources[$index]); + +} + function head_get_js() { $str = ''; $sources = get_app()->js_sources; |