FOF30\Controller\DataController::orderup PHP Метод

orderup() публичный Метод

Moves selected items one position up the ordering list
public orderup ( ) : void
Результат void
    public function orderup()
    {
        // CSRF prevention
        $this->csrfProtection();
        $model = $this->getModel()->savestate(false);
        if (!$model->getId()) {
            $this->getIDsFromRequest($model, true);
        }
        $error = null;
        try {
            $userId = $this->container->platform->getUser()->id;
            if ($model->isLocked($userId)) {
                $model->checkIn($userId);
            }
            $model->move(-1);
            $status = true;
        } catch (\Exception $e) {
            $status = false;
            $error = $e->getMessage();
        }
        // Redirect
        if ($customURL = $this->input->getBase64('returnurl', '')) {
            $customURL = base64_decode($customURL);
        }
        $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->container->componentName . '&view=' . $this->container->inflector->pluralize($this->view) . $this->getItemidURLSuffix();
        if (!$status) {
            $this->setRedirect($url, $error, 'error');
        } else {
            $this->setRedirect($url);
        }
    }