Пример #1
0
 /**
  * Returns the options for extensions list
  * 
  * @param string $ext - the extension
  */
 public static function extensions($ext)
 {
     $extensions = AlternativakHelper::getExtensions();
     $options = array();
     foreach ($extensions as $extension) {
         $option = new stdClass();
         $option->text = JText::_(ucfirst($extension->name));
         $option->value = 'com_alternativak.' . $extension->name;
         $options[] = $option;
     }
     return JHtml::_('select.options', $options, 'value', 'text', $ext, true);
 }
Пример #2
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $extensions = AlternativakHelper::getExtensions();
     $options = array();
     foreach ($extensions as $extension) {
         $option = new stdClass();
         $option->text = JText::_(ucfirst((string) $extension->name));
         $option->value = (string) $extension->name;
         $options[] = $option;
     }
     return JHTML::_('select.genericlist', $options, '' . $control_name . '[' . $name . ']', 'class="inputbox"', 'value', 'text', $value, $control_name . $name);
 }
Пример #3
0
    define('DS', '/');
}
// Require the base controller
require_once JPATH_COMPONENT . '/controller.php';
jimport('joomla.application.component.model');
require_once JPATH_COMPONENT . '/models/model.php';
// Component Helper
jimport('joomla.application.component.helper');
//add Helperpath to JHTML
JHTML::addIncludePath(JPATH_COMPONENT . '/helpers');
//include Helper
require_once JPATH_COMPONENT . '/helpers/alternativak.php';
//set the default view
$controller = JRequest::getWord('view', 'alternativak');
//add submenu
AlternativakHelper::addSubmenu($controller);
$ControllerConfig = array();
// Require specific controller if requested
if ($controller) {
    $path = JPATH_COMPONENT . '/controllers/' . $controller . '.php';
    $ControllerConfig = array('viewname' => strtolower($controller), 'mainmodel' => strtolower($controller), 'itemname' => ucfirst(strtolower($controller)));
    if (file_exists($path)) {
        require_once $path;
    } else {
        $controller = '';
    }
}
// Create the controller
$classname = 'AlternativakController' . $controller;
$controller = new $classname($ControllerConfig);
// Perform the Request task