aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/plugin.php32
1 files changed, 29 insertions, 3 deletions
diff --git a/include/plugin.php b/include/plugin.php
index 80c303b42..3a64f67cc 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -556,21 +556,47 @@ function head_add_css($src, $media = 'screen') {
function head_remove_css($src, $media = 'screen') {
$index = array_search(array($src, $media), App::$css_sources);
- if ($index !== false)
+ if($index !== false)
unset(App::$css_sources[$index]);
}
function head_get_css() {
$str = '';
$sources = App::$css_sources;
- if (count($sources)) {
- foreach ($sources as $source)
+ if(count($sources)) {
+ foreach($sources as $source)
$str .= format_css_if_exists($source);
}
return $str;
}
+function head_add_link($arr) {
+ if($arr) {
+ App::$linkrel[] = $arr;
+ }
+}
+
+function head_get_links() {
+ $str = '';
+ $sources = App::$linkrel;
+ if(count($sources)) {
+ foreach($sources as $source) {
+ if(is_array($source) && count($source)) {
+ $str .= '<link';
+ foreach($source as $k => $v) {
+ $str .= ' ' . $k . '="' . $v . '"';
+ }
+ $str .= ' />' . "\r\n";
+
+ }
+ }
+ }
+
+ return $str;
+}
+
+
function format_css_if_exists($source) {
$path_prefix = script_path() . '/';