registerTask( 'apply' , 'save' );
}
function save() {
$post = Factory::getApplication()->input->get('post');
$phocaSet = Factory::getApplication()->input->get( 'phocaset', array(0), 'post', 'array' );
$model = $this->getModel( 'phocadownloadset' );
$errorMsg = '';
switch ( Factory::getApplication()->input->getCmd('task') ) {
case 'apply':
if ($model->store($phocaSet, $errorMsg)) {
$msg = Text::_( 'Changes to Phoca Download Settings Saved' );
if ($errorMsg != '') {
$msg .= '
'.Text::_($errorMsg);
}
} else {
$msg = Text::_( 'Error Saving Phoca Download Settings' );
}
$this->setRedirect( 'index.php?option=com_phocadownload&view=phocadownloadset', $msg );
break;
case 'save':
default:
if ($model->store($phocaSet, $errorMsg)) {
$msg = Text::_( 'Phoca Download Settings Saved' );
if ($errorMsg != '') {
$msg .= '
'.Text::_($errorMsg);
}
} else {
$msg = Text::_( 'Error Saving Phoca Download Settings' );
}
$this->setRedirect( 'index.php?option=com_phocadownload', $msg );
break;
}
// Check the table in so it can be edited.... we are done with it anyway
$model->checkin();
}
function cancel($key = NULL) {
$model = $this->getModel( 'phocadownload' );
$model->checkin();
$this->setRedirect( 'index.php?option=com_phocadownload' );
}
}
?>