\Meta\Core\Form::validateRequired('label'); $new_name = \Meta\Core\Form::value('name'); // page rename action detect $renamed = false; if (is_post() && $new_name != $path) { $renamed = true; // validate page exists if (isset($pages[$new_name])) { \Meta\Core\Form::addError(t('This page already exists')); } } if (\Meta\Core\Form::hasValidated()) { if (is_demo()) { \Meta\Core\Flash::error(\Meta\Builder::demoMsg()); } else { \Meta\Core\Flash::success(t('Page updated.')); // changes the new page name if ($renamed) { $pages[$new_name] = $pages[$path]; unset($pages[$path]); $path = $new_name; } // atualiza array $page = new \Meta\Builder\Page($path, $pageArray); $page->label = \Meta\Core\Form::value('label'); $page->showonmenu = \Meta\Core\Form::checked('showonmenu'); $page->checkperms = \Meta\Core\Form::checked('checkperms'); $page->groupsAllowed = array_keys((array) $_REQUEST['groups']); $page->parentmenu = \Meta\Core\Form::value('parentmenu'); $page->menuIcon = \Meta\Core\Form::value('menuIcon'); $page->pageType = \Meta\Core\Form::value('pageType');
protected function messageSuccess($message) { Flash::success($message); return true; }