Show a form to change the template of the page.

@param Page $page

@return View
165627
public function getTemplate(Page $page)
    {
        $this->authorize('editTemplate', $page);

        return view("$this->viewPrefix.template", [
            'current'   => $page->getTemplate(),
            'templates' => TemplateFacade::findValid(),
        ]);
    }
668760
public function actionChangeVisible($id, $page = 1)
    {
        $model = $this->findModel($id);
        $model->is_visible = $model->is_visible ? false: true;
        $model->orderBy = $model::$defaultOrderBy;
        $model->save(false, ['is_visible']);

        $model->page = $model->calcPage($model::find()->where(['parent_id' => $model->parent_id]));

        return $this->redirect(['index',
            'parent' => $model->parent_id,
            'page'   => $model->page,
            'id'     => $id,
            'sort'   => $model->orderByToSort(),
        ]);
    }
1269085
protected function process(FormRequest $request, Page $page)
    {
        // Prepare required input fields
        $data = $request->validated();

        // Verify existing view
        if (! view()->exists($data['view'])) {
            return intend([
                'back' => true,
                'withInput' => $request->all(),
                'withErrors' => ['view' => trans('cortex/pages::messages.page.invalid_view')],
            ]);
        }

        ! $request->hasFile('profile_picture')
        || $page->addMediaFromRequest('profile_picture')
                  ->sanitizingFileName(function ($fileName) {
                      return md5($fileName).'.'.pathinfo($fileName, PATHINFO_EXTENSION);
                  })
                  ->toMediaCollection('profile_picture', config('cortex.auth.media.disk'));

        ! $request->hasFile('cover_photo')
        || $page->addMediaFromRequest('cover_photo')
                  ->sanitizingFileName(function ($fileName) {
                      return md5($fileName).'.'.pathinfo($fileName, PATHINFO_EXTENSION);
                  })
                  ->toMediaCollection('cover_photo', config('cortex.auth.media.disk'));

        // Save page
        $page->fill($data)->save();

        return intend([
            'url' => route('adminarea.pages.index'),
            'with' => ['success' => trans('cortex/foundation::messages.resource_saved', ['resource' => trans('cortex/pages::common.page'), 'identifier' => $page->name])],
        ]);
    }
508352
public function addPage($page = null)
    {
        if ($page = parent::addPage($page)) {
            $page->setParent($this);
        }

        return $page;
    }
114799
protected function process(FormRequest $request, Page $page)
    {
        // Prepare required input fields
        $data = $request->validated();

        // Verify existing view
        if (! view()->exists($data['view'])) {
            return intend([
                'back' => true,
                'withInput' => $request->all(),
                'withErrors' => ['view' => trans('cortex/pages::messages.page.invalid_view')],
            ]);
        }

        // Save page
        $page->fill($data)->save();

        return intend([
            'url' => route('managerarea.pages.index'),
            'with' => ['success' => trans('cortex/foundation::messages.resource_saved', ['resource' => trans('cortex/pages::common.page'), 'identifier' => $page->name])],
        ]);
    }
559024
public function allowPage($page)
    {
        if (is_array($page)) {
            foreach ($page as $p) {
                $this->allowPage($p);
            }

            return $this;
        }
        $this->allowed_pages[] = $page;

        return $this;
    }
921626
public function update(PageRequest $request, Model $page)
    {
        $page->update($request->all());
        return redirect()->route('admin.page.index');
    }
117746
public function index(Page $page)
    {
        $this->auth($page);

        return view('boomcms::editor.page.settings.acl', [
            'page'      => $page,
            'allGroups' => GroupFacade::findAll(),
            'groupIds'  => $page->getAclGroupIds(),
        ]);
    }
1107405
public function view($page, $id)
    {
        $this->authorize('view', $eloquent = app('scaffold.model'));

        app('scaffold.widget')->add(
            (new EloquentWidget($eloquent))
                ->setOrder(0)
                ->setTab(AbstractWidget::TAB_DEFAULT)
                ->setPlacement('model')
        );

        return view(app('scaffold.template')->view('index'), [
            'item' => $eloquent,
        ]);
    }
8094
protected function loadStaticPage($page)
    {
        $layout = $this->layout ?: $this;
        try {
            $t = 'page/'.str_replace('_', '/', strtolower($page));
            $this->template->findTemplate($t);

            $this->page_object = $layout->add($this->page_class, $page, 'Content', array($t));
        } catch (Exception_PathFinder $e2) {
            $t = 'page/'.strtolower($page);
            $this->template->findTemplate($t);
            $this->page_object = $layout->add($this->page_class, $page, 'Content', array($t));
        }

        return $this->page_object;
    }
467972
private function createDeleteForm(Page $page)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('core_page_delete', array('id' => $page->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }
710902
protected function createSettingsForm(BasePage $page)
    {
        $form = $this->createForm($this->getPageSettingsType(), $page);

        if ($page instanceof BusinessPage) {
            $form = $this->createForm($this->getBusinessPageType(), $page);
        }

        return $form;
    }
1201340
public function update(PageRequest $request, Page $page)
    {
        $page->update($request->all());
        return new PageResource($page);
    }
660472
public function render_assign_submit_for_grading_page($page) {
        $o = '';

        $o .= $this->output->container_start('submitforgrading');
        $o .= $this->output->heading(get_string('confirmsubmissionheading', 'assign'), 3);

        $cancelurl = new moodle_url('/mod/assign/view.php', array('id' => $page->coursemoduleid));
        if (count($page->notifications)) {
            // At least one of the submission plugins is not ready for submission.

            $o .= $this->output->heading(get_string('submissionnotready', 'assign'), 4);

            foreach ($page->notifications as $notification) {
                $o .= $this->output->notification($notification);
            }

            $o .= $this->output->continue_button($cancelurl);
        } else {
            // All submission plugins ready - show the confirmation form.
            $o .= $this->moodleform($page->confirmform);
        }
        $o .= $this->output->container_end();

        return $o;
    }
727859
public function setPage(\VFou\CmsBundle\Entity\Page $page = null)
    {
        $this->page = $page;

        return $this;
    }
1082021
public function createForm($page)
    {
        /** @type Form $form */
        $form = $page->add('Form', null, null, array('form/minimal'));

        /** @type Field $email */
        $email = $this->model->hasElement($this->login_field);

        /** @type Field $password */
        $password = $this->model->hasElement($this->password_field);

        // set captions
        if ($this->model instanceof \atk4\data\Model) {
            $email = $email && isset($email->caption) ? $email->caption : 'E-mail';
            $password = $password && isset($password->caption) ? $password->caption : 'Password';
        } else {
            $email = $email ? $email->caption() : 'E-mail';
            $password = $password ? $password->caption() : 'Password';
        }

        $form->addField('Line', 'username', $email);
        $form->addField('Password', 'password', $password);
        $form->addSubmit('Login')->addClass('atk-jackscrew')->addClass('atk-swatch-green');

        return $form;
    }
1358217
public function update(Page $page, array $data)
    {
        if (Session::has('multi_language_enabled')) {
            $languageId = $data['language_id'];
            $languaModel = Language::find($languageId);
            
            if ($languaModel->is_default) {
                return $page->update($data);
            } else {
                
                $translatedModel = $page
                    ->translations()
                    ->whereLanguageId($languageId)
                    ->first();
                if (null === $translatedModel) {
                    return PageTranslation::create(
                        array_merge($data, ['page_id' => $page->id])
                    );
                } else {
                    $translatedModel->update(
                        $data,
                        $page->getTranslatedAttributes()
                    );

                    return $translatedModel;
                }

            }
        } else {
            return $page->update($data);
        }
    }