/**
  * Sync with codepools
  * 
  * @param string $component
  */
 protected function getTypeOptionsByComponent($component)
 {
     // Initialise variables.
     $options = array();
     $paths = array(JPATH_SITE . '/components/' . $component);
     foreach (JoomlaOverrideHelperCodepool::addCodePath() as $codePool) {
         $paths[] = JPath::clean($codePool . '/' . $component);
     }
     $file = 'metadata.xml';
     $mainXML = JPath::find($paths, $file);
     if (is_file($mainXML)) {
         $options = $this->getTypeOptionsFromXML($mainXML, $component);
     }
     if (empty($options)) {
         $options = $this->getTypeOptionsFromMVC($component);
     }
     return $options;
 }
 /**
  * onAfterInitialise function.
  * 
  * @access public
  * @return void
  */
 public function onAfterInitialise()
 {
     JoomlaOverrideHelperCodepool::initialize();
     //template name
     $template = JFactory::getApplication()->getTemplate();
     //code pools
     $includePath = array();
     //global extensions path
     $customPath = JPath::clean($this->params->get('global_path', 'templates/system/code'));
     $basePath = JPATH_SITE . DIRECTORY_SEPARATOR . $customPath;
     //add administrator scope
     if (JFactory::getApplication()->isAdmin()) {
         $basePath .= '/administrator';
     }
     $includePath[] = $basePath;
     //template code path
     $includePath[] = JPATH_THEMES . '/' . $template . '/code';
     JoomlaOverrideHelperCodepool::addCodePath($includePath);
 }
Beispiel #3
0
 /**
  * Sync with codepools
  * 
  * Method to load and return a view object. This method first looks in the
  * current template directory for a match and, failing that, uses a default
  * set path to load the view class file.
  *
  * Note the "name, prefix, type" order of parameters, which differs from the
  * "name, type, prefix" order used in related public methods.
  *
  * @param   string  $name    The name of the view.
  * @param   string  $prefix  Optional prefix for the view class name.
  * @param   string  $type    The type of view.
  * @param   array   $config  Configuration array for the view. Optional.
  *
  * @return  mixed  View object on success; null or error result on failure.
  *
  * @since   11.1
  * @note    Replaces _createView.
  */
 protected function createView($name, $prefix = '', $type = '', $config = array())
 {
     $option = JFactory::getApplication()->input->get('option');
     foreach (JoomlaOverrideHelperCodepool::addCodePath() as $codepool) {
         $this->addViewPath($codepool . '/' . $option . '/views');
     }
     return parent::createView($name, $prefix, $type, $config);
 }
 /**
  * Here we initialize a file to people can add new Buttons and Submenus
  *
  * @param string $option
  * @param string $extension
  */
 public static function includeInitialize($option, $extension)
 {
     if (!JFactory::getApplication()->isAdmin()) {
         return false;
     }
     if ($file = JPath::find(JoomlaOverrideHelperCodepool::addCodePath(), $option . '/initialize.php')) {
         require_once $file;
     }
     if ($option == 'com_categories' && !empty($extension)) {
         if ($file = JPath::find(JoomlaOverrideHelperCodepool::addCodePath(), $extension . '/initialize.php')) {
             require_once $file;
         }
     }
 }