예제 #1
0
 /**
  * Get Scriptegrator plugin params
  * 
  * @param $param
  * @param $default
  * @return string or array
  */
 function pluginParam($param = '', $default = '')
 {
     $plugin =& JPluginHelper::getPlugin('system', JScriptegrator::properties('name'));
     $params = new JParameter($plugin->params);
     if (!$param) {
         return $params;
     }
     return $params->get($param, $default);
 }
예제 #2
0
 /**
  * Check if library is enabled (jQuery, Highslide...)
  * 
  * @param $library
  * @param $interface
  * 
  * @return boolean
  */
 function checkLibrary($library = 'jquery', $interface = 'site')
 {
     $plugin =& JPluginHelper::getPlugin('system', JScriptegrator::properties('name'));
     $pluginParams = new JParameter($plugin->params);
     $pluginParams = (int) $pluginParams->get($library, 0);
     $library = false;
     switch ($interface) {
         case 'site':
             switch ($pluginParams) {
                 case 1:
                 case 3:
                     $library = true;
                     break;
                 default:
                     $library = false;
                     break;
             }
             break;
         case 'admin':
             switch ($pluginParams) {
                 case 2:
                 case 3:
                     $library = true;
                     break;
                 default:
                     $library = false;
                     break;
             }
             break;
     }
     return $library;
 }