hier mal die controller.php (sehr einfach gehalten):
Code: Select all
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.controller');
class LiquormanagersController extends JController {
function display() {
parent::display();
}
function __construct() {
parent::__construct();
$this->registerTask( 'add', 'edit' );
}
function edit() {
JRequest::setVar( 'view', 'liquormanager' );
JRequest::setVar( 'layout', 'form' );
JRequest::setVar( 'hidemainmenu', 1 );
parent::display();
}
function save() {
$model = $this->getModel('liquormanager');
if ($model->store()) {
$msg = 'Speichern war erfolgreich';
} else {
$msg = 'Fehler beim Speichern';
}
$this->setRedirect( 'index.php?option=com_liquormanager',
$msg);
}
function remove() {
$model = $this->getModel('liquormanager');
if($model->delete()) {
$msg = 'Löschen war erfolgreich';
} else {
$msg = 'Fehler beim Löschen';
}
$this->setRedirect( 'index.php?option=com_liquormanager',
$msg );
}
function cancel() {
$msg = 'Aktion abgebrochen';
$this->setRedirect( 'index.php?option=com_liquormanager',
$msg );
}
}
?>