Exemplo n.º 1
0
 /**
  * onAfterRoute function.
  *
  * @access public
  * @return void
  */
 public function onAfterRoute()
 {
     $option = $this->getOption();
     if ($option === false || !isset(self::$componentList[$option])) {
         return;
     }
     MVCOverrideHelperCodepool::initialize();
     // Add override paths for the current component files
     foreach (MVCOverrideHelperCodepool::addCodePath() as $codePool) {
         if (version_compare(JVERSION, '3.0', '>=')) {
             JViewLegacy::addViewHelperPath($codePool . '/' . $option);
             JViewLegacy::addViewTemplatePath($codePool . '/' . $option);
         } else {
             JView::addViewHelperPath($codePool . '/' . $option);
             JView::addViewTemplatePath($codePool . '/' . $option);
         }
         JModuleHelper::addIncludePath($codePool . '/modules');
         JTable::addIncludePath($codePool . '/' . $option . '/tables');
         JModelForm::addComponentFormPath($codePool . '/' . $option . '/models/forms');
         JModelForm::addComponentFieldPath($codePool . '/' . $option . '/models/fields');
     }
 }
Exemplo n.º 2
0
 /**
  * Register override paths based on codepools
  *
  * @param string $option
  */
 private static function registerPaths($option)
 {
     foreach (JoomlaOverrideHelperCodepool::addCodePath() as $codePool) {
         if (JVERSION > 2.5) {
             JModelLegacy::addIncludePath($codePool . '/' . $option . '/models');
             JViewLegacy::addViewHelperPath($codePool . '/' . $option);
             JViewLegacy::addViewTemplatePath($codePool . '/' . $option);
         } else {
             JModel::addIncludePath($codePool . '/' . $option . '/models');
             JView::addViewHelperPath($codePool . '/' . $option);
             JView::addViewTemplatePath($codePool . '/' . $option);
         }
         JTable::addIncludePath($codePool . '/' . $option . '/tables');
         JModelForm::addComponentFormPath($codePool . '/' . $option . '/models/forms');
         JModelForm::addComponentFieldPath($codePool . '/' . $option . '/models/fields');
     }
 }