protected function getOptions()
 {
     // if the component is not installed
     if (!JFolder::exists(JPATH_ROOT . '/administrator/components/com_jshopping') or !JFile::exists(JPATH_ROOT . '/modules/mod_maximenuck/helper_joomshopping.php')) {
         // add the root item
         $option = new stdClass();
         $option->text = JText::_('MOD_MAXIMENUCK_JOOMSHOPPING_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_joomshopping.php';
     $cats = modMaximenuckjoomshoppingHelper::getItems($params, true);
     // add the root item
     $option = new stdClass();
     $option->text = JText::_('MOD_MAXIMENUCK_JOOMSHOPPING_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->category_id;
         $options[] = $option;
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
Ejemplo n.º 2
0
     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;
 default:
 case 'adsmanager':
     // Include the syndicate functions only once
     if (JFile::exists(JPATH_ROOT . '/plugins/system/maximenuck_' . $thirdparty . '/helper/helper_maximenuck_' . $thirdparty . '.php')) {
         require_once JPATH_ROOT . '/plugins/system/maximenuck_' . $thirdparty . '/helper/helper_maximenuck_' . $thirdparty . '.php';
         $className = 'modMaximenuck' . $thirdparty . 'Helper';
         $items = $className::getItems($params, false);
     } else {
         echo '<p style="color:red;font-weight:bold;">Plugin maximenuck_' . $thirdparty . ' not found ! Please download the patch for Maximenu - ' . ucfirst($thirdparty) . ' on <a href="http://www.joomlack.fr">http://www.joomlack.fr</a></p>';
         return false;