Handle the updation page submission
506733
public function handleEdit(int $id = null, array $request = [])
    {
        if ($id === null) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('navigations-page') . "?m=4");
            } else {
                return 'Redirect: ' . $this->router->generate('navigations-page') . "?m=4";
            }
        }
        $navigation = $this->core->api('Navigation/' . $id, 'GET')->run();
        if ($navigation['headers'][0][2] === 422) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('navigations-page') . "?m=4");
            } else {
                return 'Redirect: ' . $this->router->generate('navigations-page') . "?m=4";
            }
        } elseif (($navigation["headers"][0][2] - 200) * ($navigation["headers"][0][2] - 299) > 0) {
            return $this->templates->render("500", [
                "error" => $navigation['response'],
                "result" => ''
            ]);
        }
        $navigation = $navigation['response'];

        if (isset($request['class']) === true && $request['class'] === '') {
            unset($request['class']);
        }
        if (isset($request['link']) === true && $request['link'] === '') {
            unset($request['link']);
        }
        if (isset($request['navigation_id']) === true && $request['navigation_id'] === '') {
            unset($request['navigation_id']);
        }
        $validator = new \Valitron\Validator($request);
        $validator->rule('required', ['title']);
        $validator->rule('optional', ['class', 'link', 'navigation_id']);
        $validator->rule(function ($field, $value, array $params, array $fields) {
            return file_exists(rtrim(public_path(), '/') . $value) || (filter_var($value, FILTER_VALIDATE_URL) !== false);
        }, 'link')->message("{field} must be an external link or a local file path");
        $validator->rule(function ($field, $value, $params, $fields) {
            if (is_array($value) === true || preg_match('/\w+(,\s?\w+)*/', $value) === 1) {
                return true;
            }
            return false;
        }, "class")->message("{field} must be an array or comma-separated");
        $validator->rule(function ($field, $value, $params, $fields) {
            $navigation = Model\Navigation::find($value);
            if ($navigation === null) {
                return false;
            }
            return true;
        }, "navigation_id")->message("{field} must be child of a valid navigation link");
        if ($validator->validate() === false) {
            if (headers_sent() === false) {
                header('X-PHP-Response-Code: 422', true, 422);
            }
            $navigations_list = $this->core->api('Navigation/all/flatten', 'GET')->run();
            $pages = $this->core->api('Page/all', 'GET')->run();
            $pages_list = [];
            foreach ($pages['response'] as $key => $page) {
                if ($page->status === true) {
                    $pages_list[] = $page;
                }
            }
            return $this->templates->render("Main::Navigation", [
                "messages" => [
                    'error' => $validator->errors(),
                    'info' => '',
                    'success' => '',
                    'warning' => ''
                ],
                "navigations" => $navigations_list['response'],
                "pages" => $pages_list
            ]);
        }

        $response = $this->core->api('Navigation/' . $navigation->id, 'PUT')->run($request);

        if (headers_sent() === false) {
            foreach ($response["headers"] as $header) {
                header($header[0], $header[1], $header[2]);
            }
        }
        if ($response["headers"][0][2] === 422) {
            $navigations_list = $this->core->api('Navigation/all/flatten', 'GET')->run();
            $pages = $this->core->api('Page/all', 'GET')->run();
            $pages_list = [];
            foreach ($pages['response'] as $key => $page) {
                if ($page->status === true) {
                    $pages_list[] = $page;
                }
            }
            return $this->templates->render("Main::Navigation", [
                "messages" => [
                    'error' => $response['response'],
                    'info' => '',
                    'success' => '',
                    'warning' => ''
                ],
                "navigations" => $navigations_list['response'],
                "pages" => $pages_list
            ]);
        } elseif (($response["headers"][0][2] - 200) * ($response["headers"][0][2] - 299) <= 0) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('navigations-page') . "?m=2");
            } else {
                return 'Redirect: ' . $this->router->generate('navigations-page') . "?m=2";
            }
        } else {
            return $this->templates->render("500", [
                "error" => $response['response'],
                "result" => ''
            ]);
        }
    }
519474
def submit
      submit!
    rescue Exception => e
      if e.respond_to?(:record)
        inherit_errors(e.record) unless e.record == self
        false
      else
        raise
      end
    end
455839
function dispatch(req, done) {
      var site = req.site
        , path = upath.join(site.path || '', req.path)
        , parent = site.parent;
      while (parent) {
        path = upath.join(parent.path || '', path);
        parent = parent.parent;
      }
      
      console.log('# ' + path);
      
      var page = new Page(path, req.context);
      pages.push(page);
      
      page.once('close', done);
      //page.site = self;
      //page.pages = pages;
      self.handle(page);
    }
465534
public function process_submission() {
        global $DB;
        // Delete all records, then add back the ones that should be allowed.
        $DB->delete_records($this->tablename);
        foreach ($this->roles as $fromroleid => $notused) {
            foreach ($this->roles as $targetroleid => $alsonotused) {
                if (optional_param('s_' . $fromroleid . '_' . $targetroleid, false, PARAM_BOOL)) {
                    $this->set_allow($fromroleid, $targetroleid);
                }
            }
        }
    }
797217
def submit(self):
        """"""
        if self._dirty:
            self.save()

        self._connection.run(['submit', '-c', str(self._change)], marshal_output=False)
610585
def submit
      service.post(node_traverse_path(opts[:node_id]), traverse_path_properties).on_error do |response|
        case response.status
        when (400..499)
          raise ClientError.new(response, response.body)
        when (500..599)
          raise ServerError.new(response, response.body)
        end
      end
    end
1179630
def submit_btn(self, value, success=None):
        """"""
        self.press("css=input[value='{}']".format(value))
        if success is not None:
            assert self.is_available(*success)
1205686
def do_POST(self):  # pylint: disable=g-bad-name
    """"""
    self._IncrementActiveCount()
    try:
      if self.path.startswith("/upload"):
        stats_collector_instance.Get().IncrementCounter(
            "frontend_http_requests", fields=["upload", "http"])

        logging.error("Requested no longer supported file upload through HTTP.")
        self.Send("File upload though HTTP is no longer supported", status=404)
      else:
        stats_collector_instance.Get().IncrementCounter(
            "frontend_http_requests", fields=["control", "http"])
        self.Control()

    except Exception as e:  # pylint: disable=broad-except
      if flags.FLAGS.pdb_post_mortem:
        pdb.post_mortem()

      logging.exception("Had to respond with status 500.")
      self.Send("Error: %s" % e, status=500)
    finally:
      self._DecrementActiveCount()
998056
void submit() {

        try {
            List<CmsUUID> modifiedResources = undelete();
            m_context.finish(modifiedResources);
        } catch (Exception e) {
            m_context.error(e);
        }
    }
260546
def handle_request(self, request, *args, **kwargs):
        """"""
        paginator = self.get_paginator()
        # Call search first, it will reset page if search is changed
        search = self.get_search()
        page = self.get_page(paginator)
        items = self.get_items(paginator, page)
        return {
            'search': search,
            'page': page,
            'page_size': self.get_page_size(),
            'num_pages': paginator.num_pages,
            'sort': self.get_sort(),
            'current_fields': self.get_current_fields(),
            'fields': self.get_all_fields(),

            'items': items,
        }
819036
void submit() {

        CmsObject cms = A_CmsUI.getCmsObject();
        try {
            List<CmsUUID> changedIds = Lists.newArrayList();
            CmsResourceDeleteMode mode = (CmsResourceDeleteMode)m_deleteSiblings.getValue();
            for (CmsResource resource : m_context.getResources()) {
                changedIds.add(resource.getStructureId());
                CmsLockActionRecord lockRecord = CmsLockUtil.ensureLock(cms, resource);
                try {
                    cms.deleteResource(cms.getSitePath(resource), mode);
                } finally {
                    if (lockRecord.getChange().equals(LockChange.locked)) {
                        if (!resource.getState().isNew()) {
                            try {
                                cms.unlockResource(resource);
                            } catch (CmsVfsResourceNotFoundException e) {
                                LOG.warn(e.getLocalizedMessage(), e);
                            } catch (CmsLockException e) {
                                LOG.warn(e.getLocalizedMessage(), e);
                            }
                        }
                    }
                }
            }
            m_context.finish(changedIds);
        } catch (Exception e) {
            m_context.error(e);
        }
    }
796614
def handle_POST(self):
        
        self.send_response(404)
        self.end_headers()
        self.wfile.write('not found'.encode('utf8'))
840639
def _process_submission(self, submission: praw.models.Submission):
        
        self._func_submission(submission, *self._func_submission_args)
1335173
def page_up(self, n=1, interval=0, pre_dl=None, post_dl=None):
        
        self.delay(pre_dl)
        self.k.tap_key(self.k.page_up_key, n, interval)
        self.delay(post_dl)
1320555
function doSubmit() {
            // make sure form attrs are set
            var t = $form.attr('target'), a = $form.attr('action');

            // update form attrs in IE friendly way
            form.setAttribute('target',id);
            if (!method) {
                form.setAttribute('method', 'POST');
            }
            if (a != s.url) {
                form.setAttribute('action', s.url);
            }

            // ie borks in some cases when setting encoding
            if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
                $form.attr({
                    encoding: 'multipart/form-data',
                    enctype:  'multipart/form-data'
                });
            }

            // support timout
            if (s.timeout) {
                timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
            }
            
            // look for server aborts
            function checkState() {
                try {
                    var state = getDoc(io).readyState;
                    log('state = ' + state);
                    if (state && state.toLowerCase() == 'uninitialized')
                        setTimeout(checkState,50);
                }
                catch(e) {
                    log('Server abort: ' , e, ' (', e.name, ')');
                    cb(SERVER_ABORT);
                    if (timeoutHandle)
                        clearTimeout(timeoutHandle);
                    timeoutHandle = undefined;
                }
            }

            // add "extra" data to form if provided in options
            var extraInputs = [];
            try {
                if (s.extraData) {
                    for (var n in s.extraData) {
                        if (s.extraData.hasOwnProperty(n)) {
                            extraInputs.push(
                                $('<input type="hidden" name="'+n+'">').attr('value',s.extraData[n])
                                    .appendTo(form)[0]);
                        }
                    }
                }

                if (!s.iframeTarget) {
                    // add iframe to doc and submit the form
                    $io.appendTo('body');
                    if (io.attachEvent)
                        io.attachEvent('onload', cb);
                    else
                        io.addEventListener('load', cb, false);
                }
                setTimeout(checkState,15);
                form.submit();
            }
            finally {
                // reset attrs and remove "extra" input elements
                form.setAttribute('action',a);
                if(t) {
                    form.setAttribute('target', t);
                } else {
                    $form.removeAttr('target');
                }
                $(extraInputs).remove();
            }
        }
1118157
void runHtmlUpdate() {

        if (m_runningUpdate) {
            m_updateTimer.schedule(50);
        } else {
            m_runningUpdate = true;
            m_htmlUpdateHandler.updateHtml(m_formParent, new Command() {

                public void execute() {

                    afterHtmlUpdate();
                }
            });
        }
    }
415858
public function handlePublish() : void
    {
        if ($this->presenter->isAjax() && $this->presenter->user->isAllowed(PageAuthorizator::RES_PUBLISH_HANDLE))
        {
            $published = !$this->activePage->getPublished();

            $this->pageManager->savePublish($this->activePage, $published);

            $type = $published ? 'success' : 'warning';
            $status = $published ? 'publikována' : 'vypnuta';

            $this->presenter->notificationAjax(
                "Stránka {$status}",
                "Status stránky byl upraven na: {$status}",
                $type,
                FALSE
            );

            $this->onSave();
        }
    }