示例#1
0
 protected function getOptions()
 {
     // if the component is not installed
     if (!JFolder::exists(JPATH_ROOT . '/administrator/components/com_k2') or !JFile::exists(JPATH_ROOT . '/modules/mod_maximenuck/helper_k2.php')) {
         // add the root item
         $option = new stdClass();
         $option->text = JText::_('MOD_MAXIMENUCK_K2_NOTFOUND');
         $option->value = '0';
         $options[] = $option;
         // Merge any additional options in the XML definition.
         $options = array_merge(parent::getOptions(), $options);
         return $options;
     }
     // get the categories form the helper
     $params = new JRegistry();
     require_once JPATH_ROOT . '/modules/mod_maximenuck/helper_k2.php';
     $cats = modMaximenuckk2Helper::getItems($params);
     // add the root item
     $option = new stdClass();
     $option->text = JText::_('MOD_MAXIMENUCK_K2_ROOTNODE');
     $option->value = '0';
     $options[] = $option;
     foreach ($cats as $cat) {
         $option = new stdClass();
         $option->text = str_repeat(" - ", $cat->level - 1) . $cat->name;
         $option->value = $cat->id;
         $options[] = $option;
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
示例#2
0
     break;
 case 'articles':
     // Include the syndicate functions only once
     if (JFile::exists(dirname(__FILE__) . '/helper_articles.php')) {
         require_once dirname(__FILE__) . '/helper_articles.php';
         $items = modMaximenuckhikashopHelper::getItems($params);
     } else {
         echo '<p style="color:red;font-weight:bold;">File helper_articles.php not found ! Please download the patch for Maximenu - Joomla articles on <a href="http://www.joomlack.fr">http://www.joomlack.fr</a></p>';
         return false;
     }
     break;
 case 'k2':
     // Include the syndicate functions only once
     if (JFile::exists(dirname(__FILE__) . '/helper_k2.php')) {
         require_once dirname(__FILE__) . '/helper_k2.php';
         $items = modMaximenuckk2Helper::getItems($params);
     } else {
         echo '<p style="color:red;font-weight:bold;">File helper_k2.php not found ! Please download the patch for Maximenu - k2 on <a href="http://www.joomlack.fr">http://www.joomlack.fr</a></p>';
         return false;
     }
     break;
 case 'joomshopping':
     // Include the syndicate functions only once
     if (JFile::exists(dirname(__FILE__) . '/helper_joomshopping.php')) {
         require_once dirname(__FILE__) . '/helper_joomshopping.php';
         $items = modMaximenuckjoomshoppingHelper::getItems($params, false);
     } else {
         echo '<p style="color:red;font-weight:bold;">File helper_joomshopping.php not found ! Please download the patch for Maximenu - Joomshopping on <a href="http://www.joomlack.fr">http://www.joomlack.fr</a></p>';
         return false;
     }
     break;