aboutsummaryrefslogtreecommitdiffstats
path: root/include/plugin.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-xinclude/plugin.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/plugin.php b/include/plugin.php
index 9982a48a2..5c425ac58 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -94,6 +94,17 @@ function load_plugin($plugin) {
}
+function plugin_is_installed($name) {
+ $r = q("select name from addon where name = '%s' and installed = 1 limit 1",
+ dbesc($name)
+ );
+ if($r)
+ return true;
+ return false;
+}
+
+
+
// reload all updated plugins
function reload_plugins() {
@@ -562,11 +573,25 @@ function head_get_js() {
$str = '';
$sources = get_app()->js_sources;
if(count($sources))
- foreach($sources as $source)
+ foreach($sources as $source) {
+ if($source === 'main.js')
+ continue;
$str .= format_js_if_exists($source);
+ }
return $str;
}
+function head_get_main_js() {
+ $str = '';
+ $sources = array('main.js');
+ if(count($sources))
+ foreach($sources as $source)
+ $str .= format_js_if_exists($source,true);
+ return $str;
+}
+
+
+
function format_js_if_exists($source) {
if(strpos($source,'/') !== false)