Example #1
0
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
require_once JPATH_COMPONENT . DS . 'controller.php';
require_once JPATH_COMPONENT . DS . 'helper.php';
require_once JApplicationHelper::getPath('admin_html');
// Set the helper directory
JHTML::addIncludePath(JPATH_COMPONENT . DS . 'helper');
$controller = new ContentController();
$task = JRequest::getCmd('task');
switch (strtolower($task)) {
    case 'element':
    case 'wizard':
        $controller->execute($task);
        $controller->redirect();
        break;
    case 'add':
    case 'new':
        ContentController::editContent(false);
        break;
    case 'edit':
        ContentController::editContent(true);
        break;
    case 'go2menu':
    case 'go2menuitem':
    case 'resethits':
    case 'menulink':
    case 'apply':
    case 'save':
        ContentController::saveContent();
 /**
  * @param array          $data
  * @param ConsoleForm    $form
  * @param SS_HTTPRequest $request
  */
 public function submitForm($data, ConsoleForm $form, SS_HTTPRequest $request)
 {
     //TODO : do something with data or form
     return $this->controller->redirect('/console/index/' . $data['Name']);
 }