Beispiel #1
0
 /**
  * Function to integrate scripts to the site
  * 
  * @return void
  */
 function onAfterInitialise()
 {
     $document =& JFactory::getDocument();
     // set document for next usage
     $doctype = $document->getType();
     // get document type
     // disable plugin for non-HTML interface (like RSS feed or PDF)
     if ($doctype !== 'html') {
         return false;
     }
     JPlugin::loadLanguage('plg_system_' . JScriptegrator::properties('name'), JPATH_ADMINISTRATOR);
     // define language
     // get folder names - from libraries folder
     $libraries = JFolder::folders(JScriptegrator::folder(true) . DS . 'libraries', false, false);
     // serach each library and call function
     foreach ($libraries as $library) {
         if ($this->enableLibrary($library)) {
             // define helper path
             $library_class_path = JScriptegrator::folder(true) . DS . 'libraries' . DS . $library . DS . $library . '.php';
             // load class file if exists
             if (JFile::exists($library_class_path)) {
                 $class_name = $library;
                 JLoader::register($class_name, $library_class_path);
                 // import header files
                 if (is_callable(array($class_name, 'importFiles'))) {
                     $files_to_import = call_user_func(array($class_name, 'importFiles'));
                     if (is_array($files_to_import)) {
                         JScriptegrator::library($library, $files_to_import);
                     }
                 }
                 // add script declaration
                 if (is_callable(array($class_name, 'scriptDeclaration'))) {
                     $script_declaration = call_user_func(array($class_name, 'scriptDeclaration'), $this->params);
                     if ($script_declaration) {
                         $document->addScriptDeclaration($script_declaration);
                     }
                 }
                 if (is_callable(array($class_name, 'load'))) {
                     call_user_func(array($class_name, 'load'));
                 }
             }
         }
     }
 }
Beispiel #2
0
 /**
  * Return list of available themes
  * 
  * @return array
  */
 function themeList()
 {
     jimport('joomla.filesystem.folder');
     $path = JScriptegrator::folder(true) . DS . 'libraries' . DS . 'jquery' . DS . 'theme';
     $files = array();
     $files = JFolder::folders($path, '.', false, false);
     return $files;
 }
Beispiel #3
0
 /**
  * Script declaration
  * 
  * @param $params
  * @return string
  */
 function scriptDeclaration($params = null)
 {
     // define database parameters
     $outlineType = $params->get('outlineType', 'rounded-white');
     $outlineWhileAnimating = (int) $params->get('outlineWhileAnimating', 1);
     $showCredits = (int) $params->get('showCredits', 1);
     $expandDuration = (int) $params->get('expandDuration', 250);
     $anchor = $params->get('anchor', 'auto');
     $align = $params->get('align', 'auto');
     $transitions = $params->get('transitions', 'expand');
     $dimmingOpacity = $params->get('dimmingOpacity', '0');
     // end
     // define script parameters
     switch ($outlineWhileAnimating) {
         case 1:
             $outlineWhileAnimating = 'true';
             break;
         case 0:
             $outlineWhileAnimating = 'false';
             break;
         default:
             $outlineWhileAnimating = 'true';
             break;
     }
     if ($showCredits) {
         $showCredits = 'true';
     } else {
         $showCredits = 'false';
     }
     switch ($transitions) {
         case 'expand':
             $transitions = '["expand"]';
             break;
         case 'fade':
             $transitions = '["fade"]';
             break;
         case 'expand+fade':
             $transitions = '["expand", "fade"]';
             break;
         case 'fade+expand':
             $transitions = '["fade", "expand"]';
             break;
         default:
             $transitions = '["expand"]';
             break;
     }
     // end
     $script = "\n\t\t<!--\n\t\tvar cdhs = hs;\n\t\ths.graphicsDir = '" . JScriptegrator::folder() . "/libraries/highslide/graphics/';\n    \ths.outlineType = '" . $outlineType . "';\n    \ths.outlineWhileAnimating = " . $outlineWhileAnimating . ";\n    \ths.showCredits = " . $showCredits . ";\n    \ths.expandDuration = " . $expandDuration . ";\n\t\ths.anchor = '" . $anchor . "';\n\t\ths.align = '" . $align . "';\n\t\ths.transitions = " . $transitions . ";\n\t\ths.dimmingOpacity = " . $dimmingOpacity . ";\n\t\ths.lang = {\n\t\t   loadingText :     '" . JText::_('CDS_LOADING') . "',\n\t\t   loadingTitle :    '" . JText::_('CDS_CANCELCLICK') . "',\n\t\t   focusTitle :      '" . JText::_('CDS_FOCUSCLICK') . "',\n\t\t   fullExpandTitle : '" . JText::_('CDS_FULLEXPANDTITLE') . "',\n\t\t   fullExpandText :  '" . JText::_('CDS_FULLEXPANDTEXT') . "',\n\t\t   creditsText :     '" . JText::_('CDS_CREDITSTEXT') . "',\n\t\t   creditsTitle :    '" . JText::_('CDS_CREDITSTITLE') . "',\n\t\t   previousText :    '" . JText::_('CDS_PREVIOUSTEXT') . "',\n\t\t   previousTitle :   '" . JText::_('CDS_PREVIOUSTITLE') . "',\n\t\t   nextText :        '" . JText::_('CDS_NEXTTEXT') . "',\n\t\t   nextTitle :       '" . JText::_('CDS_NEXTTITLE') . "',\n\t\t   moveTitle :       '" . JText::_('CDS_MOVETITLE') . "',\n\t\t   moveText :        '" . JText::_('CDS_MOVETEXT') . "',\n\t\t   closeText :       '" . JText::_('CDS_CLOSETITLE') . "',\n\t\t   closeTitle :      '" . JText::_('CDS_CLOSETEXT') . "',\n\t\t   resizeTitle :     '" . JText::_('CDS_RESIZETITLE') . "',\n\t\t   playText :        '" . JText::_('CDS_PLAYTEXT') . "',\n\t\t   playTitle :       '" . JText::_('CDS_PLAYTITLE') . "',\n\t\t   pauseText :       '" . JText::_('CDS_PAUSETEXT') . "',\n\t\t   pauseTitle :      '" . JText::_('CDS_PAUSETITLE') . "',   \n\t\t   number :          '" . JText::_('CDS_NUMBER') . "',\n\t\t   restoreTitle :    '" . JText::_('CDS_RESTORETITLE') . "'\n\t\t};\n\t\t//-->\n\t\t";
     return $script;
 }