mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
sync developers work
This commit is contained in:
@@ -1348,7 +1348,7 @@ class e107
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Proxy method for easy js registering. 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
|
||||||
* @param string $data depends on the type - path/url or inline js source
|
* @param string $data depends on the type - path/url or inline js source
|
||||||
* @param integer $zone [optional] leave it null for default zone
|
* @param integer $zone [optional] leave it null for default zone
|
||||||
@@ -1397,6 +1397,7 @@ class e107
|
|||||||
// $type is plugin name
|
// $type is plugin name
|
||||||
default:
|
default:
|
||||||
// data is e.g. 'jslib/myplug.js'
|
// data is e.g. 'jslib/myplug.js'
|
||||||
|
if(!$this->isInstalled($type)) return;
|
||||||
if(null !== $zone) $jshandler->requirePluginLib($type, $data, $zone);
|
if(null !== $zone) $jshandler->requirePluginLib($type, $data, $zone);
|
||||||
else $jshandler->requirePluginLib($type, $data);
|
else $jshandler->requirePluginLib($type, $data);
|
||||||
break;
|
break;
|
||||||
@@ -1404,7 +1405,7 @@ class e107
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Proxy method for easy css registering
|
* CSS 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
|
||||||
* @param string $data depends on the type - path/url or inline js source
|
* @param string $data depends on the type - path/url or inline js source
|
||||||
* @param string $media any valid media attribute string - http://www.w3schools.com/TAGS/att_link_media.asp
|
* @param string $media any valid media attribute string - http://www.w3schools.com/TAGS/att_link_media.asp
|
||||||
@@ -1439,7 +1440,7 @@ class e107
|
|||||||
// $type is plugin name
|
// $type is plugin name
|
||||||
default:
|
default:
|
||||||
// data is e.g. 'css/myplug.css'
|
// data is e.g. 'css/myplug.css'
|
||||||
$jshandler->pluginCSS($type, $data, $media, $preComment, $postComment);
|
if($this->isInstalled($type)) $jshandler->pluginCSS($type, $data, $media, $preComment, $postComment);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1468,88 +1469,6 @@ class e107
|
|||||||
return e107::getUrl()->response()->addMeta($name, $content, $extended);
|
return e107::getUrl()->response()->addMeta($name, $content, $extended);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* CSS Common Public Function
|
|
||||||
* @var string $type - core | inline | theme | other | (plugin folder name)
|
|
||||||
*/
|
|
||||||
public static function css($type = null, $file_path = null, $media = 'all', $preComment = '', $postComment = '')
|
|
||||||
{
|
|
||||||
if($type == 'core')
|
|
||||||
{
|
|
||||||
return e107::getJs()->coreCSS($file_path, $media, $preComment, $postComment);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($type == 'inline')
|
|
||||||
{
|
|
||||||
return e107::getJs()->inlineCSS($file_path, $media);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($type == 'theme')
|
|
||||||
{
|
|
||||||
return e107::getJs()->themeCSS($file_path, $media, $preComment, $postComment);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($type == 'other')
|
|
||||||
{
|
|
||||||
return e107::getJs()->otherCSS($file_path, $media, $preComment, $postComment);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($this->isInstalled($type)) // plugin
|
|
||||||
{
|
|
||||||
return e107::getJs()->pluginCSS($type, $file_path, $media, $preComment, $postComment);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* JS Common Public Function
|
|
||||||
* @var string $type - core | file | header_inline | footer | footer_inline | theme | (plugin folder name)
|
|
||||||
*/
|
|
||||||
public static function js($type, $file_path ='', $zone='')
|
|
||||||
{
|
|
||||||
if($type == 'core')
|
|
||||||
{
|
|
||||||
if(empty($zone)){ $zone = 2; }
|
|
||||||
return e107::getJs()->headerCore($file_path, $zone);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($type == 'file' || $type == 'header')
|
|
||||||
{
|
|
||||||
if(empty($zone)){ $zone = 5; }
|
|
||||||
e107::getJs()->headerFile($file_path, $zone);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($type == 'header_inline')
|
|
||||||
{
|
|
||||||
if(empty($zone)){ $zone = 5; }
|
|
||||||
e107::getJs()->headerInline($file_path, $zone);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($type == 'footer_inline')
|
|
||||||
{
|
|
||||||
if(empty($zone)){ $zone = 5; }
|
|
||||||
e107::getJs()->footerInline($file_path, $zone);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($type == 'footer')
|
|
||||||
{
|
|
||||||
if(empty($zone)){ $zone = 2; }
|
|
||||||
e107::getJs()->footerFile($file_path, $zone);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($type=='theme')
|
|
||||||
{
|
|
||||||
if(empty($zone)){ $zone = 5; }
|
|
||||||
return e107::getJs()->headerTheme($file_path, $zone);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($this->isInstalled($type)) // plugin
|
|
||||||
{
|
|
||||||
return e107::getJs()->headerPlugin($type, $file_path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve admin dispatcher instance.
|
* Retrieve admin dispatcher instance.
|
||||||
* It's instance is self registered (for now, this could change in the future) on initialization (__construct())
|
* It's instance is self registered (for now, this could change in the future) on initialization (__construct())
|
||||||
|
Reference in New Issue
Block a user