Update action
POST | AJAX

@return void
15091
public function update()
    {
        if (!$this->request->is('post')) {
            if ($this->request->is('ajax')) {
                throw new MethodNotAllowedException();
            } else {
                $this->Flash->error($this->invalidRequestMessage);
                $this->redirect(['action' => 'index']);
                return;
            }
        }

        if (empty($this->request->data) && !$this->request->is('ajax')) {
            $this->Flash->warning(__d('wasabi_core', 'There are no permissions to update yet.'));
            $this->redirect(['action' => 'index']);
            return;
        }

        // save the new language positions
        $permissions = $this->GroupPermissions->patchEntities(
            $this->GroupPermissions->find('all'),
            $this->request->data
        );

        /** @var Connection $connection */
        $connection = $this->GroupPermissions->connection();
        $connection->begin();
        foreach ($permissions as $permission) {
            if (!$this->GroupPermissions->save($permission)) {
                $connection->rollback();
                break;
            }
        }

        if ($connection->inTransaction()) {
            $connection->commit();
            Cache::clear(false, 'wasabi/core/group_permissions');
            if ($this->request->is('ajax')) {
                $status = 'success';
                $this->set(compact('status'));
                $this->set('_serialize', ['status']);
            } else {
                $this->Flash->success(__d('wasabi_core', 'All permissions have been saved.'));
                $this->redirect(['action' => 'index']);
                return;
            }
        } else {
            $this->Flash->error($this->dbErrorMessage);
        }
    }
958808
public function initUpdate()
    {
        $this->addAction(['icon' => 'edit'], new jsModal('Edit', $this->pageUpdate, [$this->name => $this->jsRow()->data('id'), $this->name.'_sort' => $this->getSortBy()]));

        $this->pageUpdate->set(function () {
            $this->model->load($this->app->stickyGet($this->name));

            // Maybe developer has already created form
            if (!is_object($this->formUpdate) || !$this->formUpdate->_initialized) {
                $this->formUpdate = $this->pageUpdate->add($this->formUpdate ?: $this->formDefault);
            }

            $this->formUpdate->setModel($this->model, $this->fieldsUpdate ?: $this->fieldsDefault);

            if ($sortBy = $this->getSortBy()) {
                $this->formUpdate->stickyGet($this->name.'_sort', $sortBy);
            }

            // set save handler with reload trigger
            // adds default submit hook if it is not already set for this form
            if (!$this->formUpdate->hookHasCallbacks('submit')) {
                $this->formUpdate->onSubmit(function ($form) {
                    $form->model->save();

                    return $this->jsSaveUpdate();
                });
            }
        });
    }
551110
public function update()
    {
        $inputs = Input::all();
        $s      = $this->request->session();
        $route  = uri();

        $session = $s->get($route, []);
        if (empty($session)) {
            return false;
        }
        if (is_null($column = array_get($inputs, 'column'))) {
            return false;
        }
        if (!isset($session[$column]['values'])) {
            return false;
        }

        $old        = !is_null($serialized = array_get($inputs, 'serialized')) ? unserialize($serialized) : array_get($inputs, 'old');
        $new        = array_get($inputs, 'new');
        $index      = array_search($old, $session[$column]['values']);
        if ($index !== false) {
            unset($session[$column]['values'][$index]);
        }
        $session[$column]['values'][] = $new;

        $sidebars = $this->adapter->getDeleteSidebarItem($column, $session[$column], $new);
        if (!empty($sidebars)) {
            $s->put($route, [$column => $session[$column]]);
            $s->save();
            return response(implode('', $sidebars), 200);
        }
    }
913698
public function actionUpdate()
	{
		$model=$this->loadModel();
		if(isset($_POST['ajax']) && $_POST['ajax']==='comment-form')
		{
			echo CActiveForm::validate($model);
			Yii::app()->end();
		}
		if(isset($_POST['Comment']))
		{
			$model->attributes=$_POST['Comment'];
			if($model->save())
				$this->redirect(array('index'));
		}

		$this->render('update',array(
			'model'=>$model,
		));
	}
1230989
public function loadPOST()
    {
        $post = $_POST;

        $this->hook('loadPOST', [&$post]);
        $errors = [];

        foreach ($this->fields as $key => $field) {
            try {
                $value = isset($post[$key]) ? $post[$key] : null;

                // save field value only if field was editable in form at all
                if (!$field->readonly && !$field->disabled) {
                    $this->model[$key] = $this->app->ui_persistence->typecastLoadField($field->field, $value);
                }
            } catch (\atk4\core\Exception $e) {
                $errors[$key] = $e->getMessage();
            }
        }

        if ($errors) {
            throw new \atk4\data\ValidationException($errors);
        }
    }
1025676
public function postUpdate() {
        $Model = $this->Model;

        //determine which field from ExtJs to use as the primary key
        //may replace with $id = Input::get('id');
        $id = $this->getKeyFromInput();

        //get record
        $record = $Model::findOrFail($id);
        $record->update(Input::all());

        return ( $record->errors )
            ? $this->failure($record, $record->getErrors())
            : $this->success($record);

    }
553852
protected function _update()
    {
        $this->oxnews__oxdate->setValue(\OxidEsales\Eshop\Core\Registry::getUtilsDate()->formatDBDate($this->oxnews__oxdate->value, true));

        parent::_update();
    }
1134661
private function setSubmittedDatasFromPost()
    {
        if (null !== $_POST) {
            // If ajax, check formData parameter
            if (!empty($_SERVER['HTTP_X_REQUESTED_WITH'])
                && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'
            ) {
                $keyValuePairs = explode('&', $_POST['formData']);
                array_walk(
                    $keyValuePairs,
                    function ($value) {
                        list($key, $postValue) = explode('=', $value);
                        $this->submittedData[$key] = urldecode($postValue);
                    }
                );
            } else {
                $this->submittedData = $_POST;
            }
        }
    }
735619
public function actionEdit() 
	{
		$category=new BannerCategory('search');
		$category->unsetAttributes();	// clear any default values
		if(Yii::app()->getRequest()->getParam('BannerCategory')) {
			$category->attributes=Yii::app()->getRequest()->getParam('BannerCategory');
		}

		$columns = $category->getGridColumn($this->gridColumnTemp());
		
		$model = BannerSetting::model()->findByPk(1);
		if($model == null)
			$model=new BannerSetting;

		// Uncomment the following line if AJAX validation is needed
		$this->performAjaxValidation($model);

		if(isset($_POST['BannerSetting'])) {
			$model->attributes=$_POST['BannerSetting'];

			$jsonError = CActiveForm::validate($model);
			if(strlen($jsonError) > 2) {
				$errors = $model->getErrors();
				$summary['msg'] = "<div class='errorSummary'><strong>".Yii::t('phrase', 'Please fix the following input errors:')."</strong>";
				$summary['msg'] .= "<ul>";
				foreach($errors as $key => $value) {
					$summary['msg'] .= "<li>{$value[0]}</li>";
				}
				$summary['msg'] .= "</ul></div>";

				$message = json_decode($jsonError, true);
				$merge = array_merge_recursive($summary, $message);
				$encode = json_encode($merge);
				echo $encode;

			} else {
				if(Yii::app()->getRequest()->getParam('enablesave') == 1) {
					if($model->save()) {
						echo CJSON::encode(array(
							'type' => 0,
							'msg' => '<div class="errorSummary success"><strong>'.Yii::t('phrase', 'Banner setting success updated.').'</strong></div>',
						));
						/*
						Yii::app()->user->setFlash('success', Yii::t('phrase', 'Banner setting success updated.'));
						$this->redirect(array('edit'));
						*/
					} else
						print_r($model->getErrors());
				}
			}
			Yii::app()->end();
		}

		$this->pageTitle = Yii::t('phrase', 'Banner Settings');
		$this->pageDescription = '';
		$this->pageMeta = '';
		$this->render('admin_edit', array(
			'model'=>$model,
			'category'=>$category,
			'columns' => $columns,
		));
	}
375284
public function update($id, $title, $content, $slug, array $tags, $active, $user_id, DateTime $publish_date)
	{
		$post = $this->find($id);

		// Forget the old cache
		if (Config::get('wardrobe.cache'))
		{
			Cache::forget('post-'.$post->id);
		}

		$post->fill(compact('title', 'content', 'slug', 'active', 'user_id', 'publish_date'))->save();

		$post->tags()->delete();

		$post->tags()->createMany($this->prepareTags($tags));

		return $post;
	}
1327154
protected function postActions()
    {
        if ($this->option('createaction') != null) {
            $this->createAction();
        }
        if ($this->option('menu') != null) {
            $this->createMenu();
        }
        if ($this->option('model') != null) {
            $this->createModel($this->argument('link'));
        }
    }
1347619
public function actionAdd() 
	{
		$model=new OmmuPages;

		// Uncomment the following line if AJAX validation is needed
		$this->performAjaxValidation($model);

		if(isset($_POST['OmmuPages'])) {
			$model->attributes=$_POST['OmmuPages'];
			
			if($model->save()) {
				Yii::app()->user->setFlash('success', Yii::t('phrase', 'Pages success created.'));
				$this->redirect(array('manage'));
			}
		}

		$this->pageTitle = Yii::t('phrase', 'Add Page');
		$this->pageDescription = '';
		$this->pageMeta = '';
		$this->render('admin_add', array(
			'model'=>$model,
		));
	}
529115
function post($action,$params = array(),$options = array()){
		$options["method"] = "POST";
		return $this->_doRequest($action,$params,$options);
	}
284338
public function update(Post $post, UpdatePostRequest $request)
    {
        $this->authorize(PostsPolicy::PERMISSION_UPDATE);

        $post->updateOne($request->getValidatedData());

        $this->transNotification('updated', ['title' => $post->title], $post->toArray());

        return redirect()->route('admin::blog.posts.show', [$post]);
    }
1314389
public function ajax_find_posts() {
		if (
			defined( 'DOING_AJAX' )
			&& DOING_AJAX
			&& isset( $_POST['cmb2_attached_search'], $_POST['retrieved'], $_POST['action'], $_POST['search_types'] )
			&& 'find_posts' == $_POST['action']
			&& ! empty( $_POST['search_types'] )
		) {
			// This is not working until we fix the user query bit.
			if ( ! empty( $_POST['query_users'] ) ) {
				add_action( 'pre_get_users', array( $this, 'modify_query' ) );
			} else {
				add_action( 'pre_get_posts', array( $this, 'modify_query' ) );
			}
		}
	}
1355324
public function parsePostRoute()
    {
        if (empty($this->routes) || ! isset($this->routes['post'])) {
            return;
        }

        foreach ($this->routes['post'] as $action => $callback) {
            $this->action->add('admin_post_'.$action, $callback);
        }
    }
12413
public function update()
    {
        $tripod = $this->getTripod();
        if(isset($this->stat))
        {
            $tripod->setStat($this->stat);
        }
        $tripod->getComposite($this->operation)->update($this);
    }