本文整理汇总了PHP中JControllerForm::save方法的典型用法代码示例。如果您正苦于以下问题:PHP JControllerForm::save方法的具体用法?PHP JControllerForm::save怎么用?PHP JControllerForm::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JControllerForm
的用法示例。
在下文中一共展示了JControllerForm::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* Save the configuration
*
* @return void
* @since 1.0
*/
function save()
{
$jform = JRequest::getVar('jform', array(), 'post', 'array');
$iid = $jform['series_id'];
$aid = $jform['automailing_id'];
$msg = false;
if (isset($jform['time_start']) && empty($jform['time_start'])) {
$err = true;
$msg = JText::_("COM_NEWSLETTER_START_TIME_IS_EMPTY");
}
// if (isset($jform['time_offset']) && empty($jform['time_offset'])) {
// $err = true;
// $msg = JText::_("COM_NEWSLETTER_TIME_OFFSET_IS_EMPTY");
// }
if (empty($err) && parent::save()) {
// Set the redirect based on the task.
switch ($this->getTask()) {
case 'save':
$this->setRedirect(JRoute::_('index.php?option=com_newsletter&view=close&tmpl=component', false));
break;
}
return true;
}
$this->setRedirect(JRoute::_('index.php?option=com_newsletter&tmpl=component&view=' . $this->view_item . $this->getRedirectToItemAppend($iid, 'series_id') . '&automailing_id=' . $aid, false), $msg);
return false;
}
示例2: execute
public function execute($task = null)
{
$app = JFactory::getApplication();
$modelName = $app->input->get('model', 'Calendar');
// Required objects
$input = JFactory::getApplication()->input;
// Get the form data
$this->formData = new JRegistry($input->get('jform', '', 'array'));
//Get model class
$this->model = $this->getModel($modelName);
if ($task == 'deleteListDaytime') {
$this->deleteListDaytime();
} elseif ($task == 'cancel') {
$this->cancel();
} else {
if ($task == 'apply') {
parent::save();
$app->enqueueMessage('Calendrier sauvé avec succès!');
$app->redirect($_SERVER['HTTP_REFERER']);
} else {
if ($task == 'save') {
parent::save();
} else {
$this->edit();
}
}
}
}
示例3: save
public function save($key = NULL, $urlVar = NULL)
{
if (!parent::save($key = NULL, $urlVar = NULL)) {
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', JText::_('COM_HTRAININGLOGS_PORTLET_EXISTS')));
$this->setMessage($this->getError(), 'error');
}
}
示例4: save
public function save($key = null, $urlVar = null)
{
$data = $this->input->post->get('jform', array(), 'array');
$model = $this->getModel();
$table = $model->getTable();
$url = $table->getKeyName();
parent::save($key = $data['id'], $urlVar = $url);
}
示例5: save
/**
* Save a template field
*
* @copyright
* @author RolanD
* @todo
* @see
* @access public
* @param
* @return
* @since 4.3
*/
public function save($key = null, $urlVar = null)
{
if (parent::save($key, $urlVar)) {
$this->setRedirect('');
JFactory::getDocument()->addScriptDeclaration('window.parent.location.href = window.parent.location.href;');
JFactory::getDocument()->addScriptDeclaration('window.parent.SqueezeBox.close();');
}
}
示例6: save
public function save()
{
if (parent::save()) {
$msg = JText::_('SL_SAVED');
} else {
$msg = JText::_('SL_ERROR_SAVE');
}
$this->setRedirect('index.php?option=com_slp&controller=slpedit', $msg);
}
示例7: save
public function save($key = null, $urlVar = null)
{
parent::save($key = null, $urlVar = null);
// $this->input = $this->input->post->get('ziak_id', 0, 'int');
// echo $this->input;
$this->input = JFactory::getApplication()->input->getInt('trieda_id', 0);
$this->setRedirect(JRoute::_('index.php?option=com_absolventi&view=ziacilist&trieda_id=' . $this->input, false));
$this->redirect;
}
示例8: save
public function save($key = NULL, $urlVar = NULL)
{
//print_r($_POST);exit;
if (!parent::save($key = NULL, $urlVar = NULL)) {
//$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', JText::_('COM_HTRAININGLOGS_RECORDEXISTS')));
$this->setMessage($this->getError(), 'error');
}
$this->setRedirect(JRoute::_('index.php?option=com_htraininglogs&view=sessions', false));
}
示例9: save
public function save($key = null, $urlVar = 'a_id')
{
$result = parent::save($key, $urlVar);
// If ok, redirect to the return page.
if ($result) {
$this->setRedirect($this->getReturnPage());
}
return $result;
}
示例10: save
function save($key = NULL, $urlVar = NULL)
{
parent::save();
if (JRequest::getVar('fc_doajax_submit')) {
JFactory::getApplication()->enqueueMessage(JText::_('FLEXI_ITEM_SAVED'), 'message');
echo flexicontent_html::get_system_messages_html();
exit;
// Ajax submit, do not rerender the view
}
}
示例11: save
function save($key = null, $urlVar = null)
{
if (parent::save($key = null, $urlVar = null)) {
$post = JFactory::getApplication()->input->getArray($_POST);
if ($post['config_currency_auto']) {
$model = $this->getModel('currencies');
$model->updateCurrencies(true);
}
}
}
示例12: save
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since 11.1
*/
public function save($key = null, $urlVar = null)
{
$app = JFactory::getApplication();
$brb = $app->input->post->get('brb');
if ($brb) {
self::save2($key, $urlVar, $brb);
} else {
return parent::save($key, $urlVar);
}
}
示例13: save
/**
* Overrides parent save method to check the submitted passwords match.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since 3.2
*/
public function save($key = null, $urlVar = null)
{
$this->setRedirect(JRoute::_('index.php?option=com_admin&view=profile&layout=edit&id=' . JFactory::getUser()->id, false));
$return = parent::save();
if ($this->getTask() != 'apply') {
// Redirect to the main page.
$this->setRedirect(JRoute::_('index.php', false));
}
return $return;
}
示例14: save
/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $url_var The name of the URL variable if different from the primary key.
*
* @return boolean True if successful, false otherwise.
*/
public function save($key = null, $url_var = 'id')
{
$result = parent::save($key, $url_var);
$project = JRequest::getUint('filter_project', 0);
$parent = JRequest::getUint('filter_parent_id', 0);
// If ok, redirect to the return page.
if ($result) {
$this->setRedirect($this->getReturnPage($parent, $project));
}
return $result;
}
示例15: save
function save($key = null, $urlVar = null)
{
if (parent::save($key, $urlVar)) {
require_once JPATH_SITE . '/components/com_j2store/helpers/cart.php';
$storeprofile = J2StoreHelperCart::getStoreAddress();
if ($storeprofile->config_currency_auto) {
$model = $this->getModel('currencies');
$model->updateCurrencies(true);
}
}
}