Exemple #1
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('id', $properties)) {
         $value = Util\Converter::int('id' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setId($value);
         }
     }
     if (!isset($properties) || in_array('moduleId', $properties)) {
         $value = Util\Converter::int('moduleId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setModuleId($value);
         }
     }
     if (!isset($properties) || in_array('field', $properties)) {
         $value = Util\Converter::string('field' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setField($value);
         }
     }
     if (!isset($properties) || in_array('status', $properties)) {
         $value = Util\Converter::int('status' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setStatus($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #2
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('id', $properties)) {
         $value = Util\Converter::int('id' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setId($value);
         }
     }
     if (!isset($properties) || in_array('userId', $properties)) {
         $value = Util\Converter::int('userId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setUserId($value);
         }
     }
     if (!isset($properties) || in_array('signIn', $properties)) {
         $value = Util\Converter::string('signIn' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setSignIn($value);
         }
     }
     if (!isset($properties) || in_array('secure', $properties)) {
         $value = Util\Converter::string('secure' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setSecure($value);
         }
     }
     if (!isset($properties) || in_array('type', $properties)) {
         $value = Util\Converter::int('type' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setType($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #3
0
 public function form()
 {
     $simple = new \Rebond\Bus\Simple\Form();
     $post = Util\Converter::string('send', 'post');
     if (isset($post)) {
         if ($simple->setFromPost()->validate()->isValid()) {
             $result = Util\Media::UploadForm('photoId');
             if ($result->result == ResultType::SUCCESS) {
                 $simple->setPhotoId($result->id);
             }
             if ($result->result != ResultType::ERROR) {
                 $simple->save();
                 Util\Session::set('siteSuccess', 'submitted');
             } else {
                 Util\Session::set('siteError', $result->message);
             }
         } else {
             Util\Session::set('siteError', 'invalid');
         }
     }
     // view
     $this->setTpl();
     // main
     $tplMain = new Util\Template(Util\Template::MODULE, ['bus', 'simple']);
     $tplMain->set('item', $simple);
     // layout
     $this->tplLayout->set('column1', $tplMain->render('form'));
     // template
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-2-col'));
     return $this->tplMaster->render('tpl-default');
 }
Exemple #4
0
 public function user_password()
 {
     // auth
     Auth::isAdminAuthorized($this->signedUser, 'admin.user.password', true, '/user');
     // check
     $id = \Rebond\Util\Converter::int('id');
     $save = \Rebond\Util\Converter::string('save', 'post');
     $user = \Rebond\Core\User\Data::loadById($id);
     if (!isset($user)) {
         Session::adminError('itemNotFound', [$id], '/user');
     }
     $form = new \Rebond\Core\User\Form($user);
     // action
     if (isset($save)) {
         $form->changePassword('/user', false);
     }
     // view
     $this->setTpl();
     // main
     $tplMain = new Template(Template::MODULE, ['core', 'user']);
     $tplMain->set('item', $form);
     // layout
     $this->tplLayout->set('column1', $tplMain->render('editor-password-admin'));
     // master
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col'));
     $this->tplMaster->set('jsLauncher', 'userPassword');
     return $this->tplMaster->render('tpl-default');
 }
Exemple #5
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('id', $properties)) {
         $value = Util\Converter::int('id' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setId($value);
         }
     }
     if (!isset($properties) || in_array('parentId', $properties)) {
         $value = Util\Converter::int('parentId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setParentId($value);
         }
     }
     if (!isset($properties) || in_array('title', $properties)) {
         $value = Util\Converter::string('title' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTitle($value);
         }
     }
     if (!isset($properties) || in_array('displayOrder', $properties)) {
         $value = Util\Converter::int('displayOrder' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setDisplayOrder($value);
         }
     }
     if (!isset($properties) || in_array('status', $properties)) {
         $value = Util\Converter::int('status' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setStatus($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #6
0
 public function changePassword($redirect, $checkCurrentPassword = true)
 {
     $currentPassword = $this->getModel()->getPassword();
     $this->setFromPost();
     $newPassword = Util\Converter::string('passwordnew', 'post');
     $fields = [];
     $fields['token'] = $this->validateToken();
     if ($checkCurrentPassword) {
         $fields['password'] = $this->validatePassword();
     }
     $fields['passwordnew'] = Util\Validate::validate('passwordnew', $newPassword, ['password' => true, 'required' => true, 'minLength' => 4, 'maxLength' => 40, 'different' => $this->getModel()->getPassword()]);
     $this->getValidation()->setFields($fields);
     if ($this->getValidation()->isValid()) {
         if (!$checkCurrentPassword || Service::validatePassword($currentPassword, $this->getModel()->getPassword())) {
             $this->getModel()->setPassword(Util\Security::encryptPassword($newPassword));
             \Rebond\Core\User\Data::savePassword($this->getModel());
             \Rebond\Core\UserSecurity\Data::deleteSecure($this->getModel()->getId(), \Rebond\Core\UserSecurity\Model::RESET);
             Util\Session::allSuccess('passwordChanged', $redirect);
         } else {
             Util\Session::set('allError', Util\Lang::lang('errorWrongPassword'));
         }
     } else {
         Util\Session::set('allError', $this->getValidation()->getMessage());
     }
 }
Exemple #7
0
 public function setFromPost($properties = null)
 {
     parent::setFromPost($properties);
     if (!isset($properties) || in_array('appId', $properties)) {
         $value = Util\Converter::int('appId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setAppId($value);
         }
     }
     if (!isset($properties) || in_array('mediaId', $properties)) {
         $value = Util\Converter::int('mediaId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setMediaId($value);
         }
     }
     if (!isset($properties) || in_array('description', $properties)) {
         $value = Util\Converter::string('description' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setDescription($value);
         }
     }
     if (!isset($properties) || in_array('displayOrder', $properties)) {
         $value = Util\Converter::int('displayOrder' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setDisplayOrder($value);
         }
     }
     return $this;
 }
Exemple #8
0
 public function edit()
 {
     // auth
     Auth::isAdminAuthorized($this->signedUser, 'admin.page', true, '/page');
     // check
     $id = Converter::int('id');
     $pid = Converter::int('pid', 'get', 1);
     $page = \Rebond\Cms\Page\Data::loadById($id);
     if (!isset($page)) {
         $page = new \Rebond\Cms\Page\Model();
         $title = Lang::lang('newPage');
     } else {
         $title = Lang::lang('edit') . ' ' . $page->getTitle();
     }
     if ($page->getId() != 1 && $page->getParentId() == 1) {
         $page->setParentId($pid);
     }
     $form = new \Rebond\Cms\Page\Form($page);
     // action
     $save = Converter::string('save', 'post');
     if (isset($save)) {
         Auth::isAdminAuthorized($this->signedUser, 'admin.page.edit', true, '/page');
         if ($form->setFromPost()->validate()->isValid()) {
             // set new friendly url hidden
             $page->setFriendlyUrl(strtolower($page->getFriendlyUrl()));
             $fuh = \Rebond\Cms\Page\Data::fullFriendlyUrl($page->getParentId());
             $page->setFriendlyUrlPath($fuh);
             $page->save();
             // update children pages
             \Rebond\Cms\Page\Data::updateChildrenFriendlyUrl($page->getId(), $page->getFriendlyUrlPath(), $page->getFriendlyUrl());
             Session::adminSuccess('saved', '/page');
         } else {
             Session::set('adminError', $form->getValidation()->getMessage());
         }
     }
     // view
     $this->setTpl();
     // main
     $tplMain = new Template(Template::MODULE, ['cms', 'page']);
     $tplMain->set('title', $title);
     $tplMain->set('siteUrl', 'http://' . \Rebond\Config::getPath('siteUrl'));
     $tplMain->set('item', $form);
     // layout
     if (Auth::isAdminAuthorized($this->signedUser, 'admin.page.edit', false)) {
         $this->tplLayout->set('column1', $tplMain->render('editor'));
     } else {
         $this->tplLayout->set('column1', $tplMain->render('view'));
     }
     // master
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col'));
     $this->tplMaster->set('jsLauncher', 'page');
     return $this->tplMaster->render('tpl-default');
 }
Exemple #9
0
 public function generic()
 {
     $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
     $error = Util\Converter::string('404', 'get');
     $tpl = new Util\Template(Util\Template::MODULE, ['app', 'error']);
     if ($error != '') {
         header('HTTP/1.1 404 Not Found');
         $tpl->set('title', Util\Lang::lang('pageNotFound'));
         $tpl->set('error', $error);
     } else {
         $tpl->set('title', Util\Lang::lang('error'));
         $tpl->set('error', Util\Lang::lang('errorUnknown'));
     }
     $tpl->set('referer', $referer);
     return $tpl->render('generic');
 }
Exemple #10
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('roleId', $properties)) {
         $value = Util\Converter::int('roleId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setRoleId($value);
         }
     }
     if (!isset($properties) || in_array('permissionId', $properties)) {
         $value = Util\Converter::int('permissionId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setPermissionId($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #11
0
 public function edit()
 {
     // auth
     Auth::isAdminAuthorized($this->signedUser, 'admin.media', true, '/media');
     // action
     $id = Converter::int('id');
     $media = \Rebond\Core\Media\Data::loadById($id);
     if (!isset($media)) {
         Session::adminError('itemNotFound', [$id], '/media');
     }
     $form = new \Rebond\Core\Media\Form($media);
     $save = Converter::string('save', 'post');
     if (isset($save)) {
         Auth::isAdminAuthorized($this->signedUser, 'admin.media.edit', true, '/media/edit');
         $oldUpload = $media->getUpload();
         $form->setFromPost();
         // extension removed in form
         $media->setUpload($media->getUpload() . '.' . $media->getExtension());
         if ($form->validate()->isValid()) {
             \Rebond\Util\File::rename($media->getPath(), $oldUpload, $media->getUpload());
             $media->save();
             Session::adminSuccess('saved', '/media');
         } else {
             Session::set('adminError', $form->getValidation()->getMessage());
         }
     }
     // view
     $this->setTpl();
     // media
     $tplMain = new Template(Template::MODULE, ['core', 'media']);
     $tplMain->set('item', $form);
     $tplMain->set('url', 'http://' . \Rebond\Config::getPath('siteUrl') . \Rebond\Config::getPath('mediaFolder') . $media->getUpload());
     // layout
     if (Auth::isAdminAuthorized($this->signedUser, 'admin.media.edit', false)) {
         $this->tplLayout->set('column1', $tplMain->render('editor'));
     } else {
         $this->tplLayout->set('column1', $tplMain->render('view'));
     }
     //master
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col'));
     $this->tplMaster->set('jsLauncher', 'mediaEdit');
     return $this->tplMaster->render('tpl-default');
 }
Exemple #12
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('id', $properties)) {
         $value = Util\Converter::int('id' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setId($value);
         }
     }
     if (!isset($properties) || in_array('title', $properties)) {
         $value = Util\Converter::string('title' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTitle($value);
         }
     }
     if (!isset($properties) || in_array('summary', $properties)) {
         $value = Util\Converter::string('summary' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setSummary($value);
         }
     }
     if (!isset($properties) || in_array('filename', $properties)) {
         $value = Util\Converter::string('filename' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setFilename($value);
         }
     }
     if (!isset($properties) || in_array('columns', $properties)) {
         $value = Util\Converter::int('columns' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setColumns($value);
         }
     }
     if (!isset($properties) || in_array('status', $properties)) {
         $value = Util\Converter::int('status' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setStatus($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #13
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('id', $properties)) {
         $value = Util\Converter::int('id' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setId($value);
         }
     }
     if (!isset($properties) || in_array('userId', $properties)) {
         $value = Util\Converter::int('userId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setUserId($value);
         }
     }
     if (!isset($properties) || in_array('mediaView', $properties)) {
         $value = Util\Converter::int('mediaView' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setMediaView($value);
         }
     }
     if (!isset($properties) || in_array('mediaPaging', $properties)) {
         $value = Util\Converter::int('mediaPaging' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setMediaPaging($value);
         }
     }
     if (!isset($properties) || in_array('contentPaging', $properties)) {
         $value = Util\Converter::int('contentPaging' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setContentPaging($value);
         }
     }
     if (!isset($properties) || in_array('paging', $properties)) {
         $value = Util\Converter::int('paging' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setPaging($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #14
0
 public function generic()
 {
     $this->setBaseTpl();
     // auth
     Auth::isAdminAuthorized($this->signedUser, null, true, '/profile/sign-in');
     $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
     $error = Converter::string('404', 'get');
     // main
     if ($error != '') {
         header('HTTP/1.1 404 Not Found');
         $this->tplMain->set('title', Lang::lang('pageNotFound'));
         $this->tplMain->set('error', $error);
     } else {
         $this->tplMain->set('error', Lang::lang('errorUnknown'));
     }
     $this->tplMain->set('referer', $referer);
     // layout
     $this->tplLayout->set('column1', $this->tplMain->render('generic'));
     // master
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col'));
     return $this->tplMaster->render('tpl-error');
 }
 public function lang_edit()
 {
     // auth
     Auth::isAdminAuthorized($this->signedUser, 'admin.config.lang.edit', true, '/configuration/lang');
     // check
     $file = Converter::string('f');
     $tplFile = Converter::string('tpl-file', 'post');
     $filePath = \Rebond\Config::getPath('lang') . $file;
     if ($file == '') {
         header('Location: /configuration/lang');
         exit;
     }
     if (!file_exists($filePath)) {
         Session::adminError('itemNotFound', [$filePath], '/configuration/lang');
     }
     // action
     if (isset($_POST['save'])) {
         file_put_contents($filePath, $tplFile);
         Session::adminSuccess('saved', '/configuration/lang');
     }
     // view
     $this->setTpl();
     // main
     $tplMain = new Template(Template::SITE, ['admin', 'configuration']);
     $tplMain->set('file', $file);
     $tplMain->set('filePath', $filePath);
     // layout
     $this->tplLayout->set('column1', $tplMain->render('lang-form'));
     // master
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col'));
     $this->tplMaster->set('jsLauncher', 'configLang');
     $this->tplMaster->addCss('/css/codemirror.css');
     $this->tplMaster->addJs('/js/codemirror/codemirror.js');
     $this->tplMaster->addJs('/js/codemirror/xml.js');
     return $this->tplMaster->render('tpl-default');
 }
Exemple #16
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('id', $properties)) {
         $value = Util\Converter::int('id' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setId($value);
         }
     }
     if (!isset($properties) || in_array('title', $properties)) {
         $value = Util\Converter::string('title' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTitle($value);
         }
     }
     if (!isset($properties) || in_array('summary', $properties)) {
         $value = Util\Converter::string('summary' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setSummary($value);
         }
     }
     if (!isset($properties) || in_array('workflow', $properties)) {
         $value = Util\Converter::int('workflow' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setWorkflow($value);
         }
     }
     if (!isset($properties) || in_array('hasFilter', $properties)) {
         $value = Util\Converter::bool('hasFilter' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setHasFilter($value);
         }
     }
     if (!isset($properties) || in_array('hasContent', $properties)) {
         $value = Util\Converter::bool('hasContent' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setHasContent($value);
         }
     }
     if (!isset($properties) || in_array('status', $properties)) {
         $value = Util\Converter::int('status' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setStatus($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #17
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('id', $properties)) {
         $value = Util\Converter::int('id' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setId($value);
         }
     }
     if (!isset($properties) || in_array('title', $properties)) {
         $value = Util\Converter::string('title' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTitle($value);
         }
     }
     if (!isset($properties) || in_array('summary', $properties)) {
         $value = Util\Converter::string('summary' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setSummary($value);
         }
     }
     if (!isset($properties) || in_array('filename', $properties)) {
         $value = Util\Converter::string('filename' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setFilename($value);
         }
     }
     if (!isset($properties) || in_array('menu', $properties)) {
         $value = Util\Converter::int('menu' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setMenu($value);
         }
     }
     if (!isset($properties) || in_array('menuLevel', $properties)) {
         $value = Util\Converter::int('menuLevel' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setMenuLevel($value);
         }
     }
     if (!isset($properties) || in_array('inBreadcrumb', $properties)) {
         $value = Util\Converter::bool('inBreadcrumb' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setInBreadcrumb($value);
         }
     }
     if (!isset($properties) || in_array('sideNav', $properties)) {
         $value = Util\Converter::int('sideNav' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setSideNav($value);
         }
     }
     if (!isset($properties) || in_array('sideNavLevel', $properties)) {
         $value = Util\Converter::int('sideNavLevel' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setSideNavLevel($value);
         }
     }
     if (!isset($properties) || in_array('inFooter', $properties)) {
         $value = Util\Converter::bool('inFooter' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setInFooter($value);
         }
     }
     if (!isset($properties) || in_array('footerLevel', $properties)) {
         $value = Util\Converter::int('footerLevel' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setFooterLevel($value);
         }
     }
     if (!isset($properties) || in_array('status', $properties)) {
         $value = Util\Converter::int('status' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setStatus($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #18
0
 public function quickedit()
 {
     // auth
     Auth::isAdminAuthorized($this->signedUser, 'admin.tools', true, '/');
     // check
     $module = Converter::string('module');
     $id = Converter::int('id');
     $id2 = Converter::int('id2');
     $save = Converter::string('save', 'post');
     if ($module == '') {
         header('Location: /tools/quickview');
         exit;
     }
     $busModel = '\\Rebond\\Bus\\' . $module . '\\Model';
     $busData = '\\Rebond\\Bus\\' . $module . '\\Data';
     $busForm = '\\Rebond\\Bus\\' . $module . '\\Form';
     if ($id == 0) {
         $entity = new $busModel();
     } else {
         if ($id2 != 0) {
             $entity = $busData::loadById($id, $id2);
         } else {
             $entity = $busData::loadById($id);
         }
         if (!isset($entity)) {
             $entity = new $busModel();
         }
     }
     $form = new $busForm($entity);
     // action
     if (isset($save)) {
         if ($form->setFromPost()->validate()->isValid()) {
             $entity->save();
             Session::adminSuccess('saved', '/tools/quickview/#!/' . $module);
         }
         Session::set('adminError', $form->getValidation()->getMessage());
     }
     // view
     $this->setTpl();
     // nav
     $entities = \Rebond\Util\File::getFolders('Rebond/Bus/');
     $tplNav = new Template(Template::SITE, ['admin', 'tools']);
     $tplNav->set('entities', $entities);
     $tplNav->set('active', $module);
     // main
     $tplMain = new Template(Template::MODULE, ['Bus', $module]);
     $tplMain->set('item', $form);
     // layout
     $this->tplLayout->set('column1', $tplMain->render('bus-editor'));
     // master
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col'));
     $this->tplMaster->set('navSide', $tplNav->render('nav'));
     $this->tplMaster->set('page', 'tools');
     $this->tplMaster->addJs('/js/tinymce/tinymce.min.js');
     $this->tplMaster->set('jsLauncher', 'toolsQuickEdit');
     return $this->tplMaster->render('tpl-default');
 }
Exemple #19
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('id', $properties)) {
         $value = Util\Converter::int('id' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setId($value);
         }
     }
     if (!isset($properties) || in_array('parentId', $properties)) {
         $value = Util\Converter::int('parentId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setParentId($value);
         }
     }
     if (!isset($properties) || in_array('templateId', $properties)) {
         $value = Util\Converter::int('templateId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTemplateId($value);
         }
     }
     if (!isset($properties) || in_array('layoutId', $properties)) {
         $value = Util\Converter::int('layoutId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setLayoutId($value);
         }
     }
     if (!isset($properties) || in_array('title', $properties)) {
         $value = Util\Converter::string('title' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTitle($value);
         }
     }
     if (!isset($properties) || in_array('css', $properties)) {
         $value = Util\Converter::string('css' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setCss($value);
         }
     }
     if (!isset($properties) || in_array('js', $properties)) {
         $value = Util\Converter::string('js' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setJs($value);
         }
     }
     if (!isset($properties) || in_array('inNavHeader', $properties)) {
         $value = Util\Converter::bool('inNavHeader' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setInNavHeader($value);
         }
     }
     if (!isset($properties) || in_array('inNavSide', $properties)) {
         $value = Util\Converter::bool('inNavSide' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setInNavSide($value);
         }
     }
     if (!isset($properties) || in_array('inSitemap', $properties)) {
         $value = Util\Converter::bool('inSitemap' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setInSitemap($value);
         }
     }
     if (!isset($properties) || in_array('inBreadcrumb', $properties)) {
         $value = Util\Converter::bool('inBreadcrumb' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setInBreadcrumb($value);
         }
     }
     if (!isset($properties) || in_array('inNavFooter', $properties)) {
         $value = Util\Converter::bool('inNavFooter' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setInNavFooter($value);
         }
     }
     if (!isset($properties) || in_array('friendlyUrlPath', $properties)) {
         $value = Util\Converter::string('friendlyUrlPath' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setFriendlyUrlPath($value);
         }
     }
     if (!isset($properties) || in_array('friendlyUrl', $properties)) {
         $value = Util\Converter::string('friendlyUrl' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setFriendlyUrl($value);
         }
     }
     if (!isset($properties) || in_array('redirect', $properties)) {
         $value = Util\Converter::string('redirect' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setRedirect($value);
         }
     }
     if (!isset($properties) || in_array('class', $properties)) {
         $value = Util\Converter::string('class' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setClass($value);
         }
     }
     if (!isset($properties) || in_array('permission', $properties)) {
         $value = Util\Converter::string('permission' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setPermission($value);
         }
     }
     if (!isset($properties) || in_array('displayOrder', $properties)) {
         $value = Util\Converter::int('displayOrder' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setDisplayOrder($value);
         }
     }
     if (!isset($properties) || in_array('status', $properties)) {
         $value = Util\Converter::int('status' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setStatus($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #20
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('id', $properties)) {
         $value = Util\Converter::int('id' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setId($value);
         }
     }
     if (!isset($properties) || in_array('code', $properties)) {
         $value = Util\Converter::int('code' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setCode($value);
         }
     }
     if (!isset($properties) || in_array('userId', $properties)) {
         $value = Util\Converter::int('userId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setUserId($value);
         }
     }
     if (!isset($properties) || in_array('ip', $properties)) {
         $value = Util\Converter::string('ip' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setIp($value);
         }
     }
     if (!isset($properties) || in_array('requestUri', $properties)) {
         $value = Util\Converter::string('requestUri' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setRequestUri($value);
         }
     }
     if (!isset($properties) || in_array('referer', $properties)) {
         $value = Util\Converter::string('referer' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setReferer($value);
         }
     }
     if (!isset($properties) || in_array('message', $properties)) {
         $value = Util\Converter::string('message' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setMessage($value);
         }
     }
     if (!isset($properties) || in_array('trace', $properties)) {
         $value = Util\Converter::string('trace' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTrace($value);
         }
     }
     if (!isset($properties) || in_array('file', $properties)) {
         $value = Util\Converter::string('file' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setFile($value);
         }
     }
     if (!isset($properties) || in_array('line', $properties)) {
         $value = Util\Converter::int('line' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setLine($value);
         }
     }
     if (!isset($properties) || in_array('status', $properties)) {
         $value = Util\Converter::int('status' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setStatus($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #21
0
 public static function renderBreadcrumb($pageId)
 {
     $render = false;
     $html = '';
     $title = Util\Converter::string('title');
     if (isset($title)) {
         $html = '<li class="active">' . $title . '</li>';
     }
     while ($pageId != 0) {
         $page = Data::loadById($pageId);
         $pageId = $page->getParentId();
         if (!$page->getInBreadcrumb()) {
             continue;
         }
         if ($html == '') {
             $html = '<li class="active">' . $page->getTitle() . '</li>' . $html;
         } else {
             if ($page->getRedirect() != '') {
                 $isLink = 1;
             } else {
                 $options = [];
                 $options['where'][] = ['gadget.page_id = ?', $page->getId()];
                 $options['where'][] = 'gadget.status = 1';
                 $isLink = \Rebond\Cms\Gadget\Data::count($options);
             }
             if ($isLink > 0) {
                 $render = true;
                 $html = '<li><a href="' . $page->getFullUrl() . '">' . $page->getTitle() . '</a></li>' . $html;
             } else {
                 $render = true;
                 $html = '<li><span>' . $page->getTitle() . '</span></li>' . $html;
             }
         }
     }
     if ($render) {
         return '<ul id="r-breadcrumb">' . $html . '</ul>';
     }
     return '';
 }
Exemple #22
0
 public function delete()
 {
     // auth
     Auth::isAdminAuthorized($this->signedUser, 'admin.content.edit', true, '/content/');
     // check
     $moduleName = Converter::string('module');
     $id = Converter::int('id');
     $module = $this->findModule($moduleName);
     $appData = '\\Rebond\\App\\' . $module->getTitle() . '\\Data';
     $model = $appData::loadById($id);
     if (!isset($model)) {
         Session::adminError('itemNotFound', [$moduleName . ' (' . $id . ')'], '/content/');
     }
     $appData::updateVersion($model, \Rebond\Cms\VersionType::DELETED);
     Session::adminSuccess('deleted', '/content/#!/' . $moduleName . '/published/');
 }
Exemple #23
0
 public function changePassword()
 {
     $signedUser = $this->app->user();
     // auth
     if (!Util\Auth::isAuth($signedUser)) {
         header('Location: /profile');
         exit;
     }
     $form = new \Rebond\Core\User\Form($signedUser);
     // action
     $change = Util\Converter::string('resetPassword', 'post');
     if (isset($change)) {
         $form->changePassword('/profile');
     }
     $tpl = new Util\Template(Util\Template::MODULE, ['app', 'User']);
     $tpl->set('item', $form);
     $tpl->set('checkCurrentPassword', true);
     return $tpl->render('password-change');
 }
Exemple #24
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('id', $properties)) {
         $value = Util\Converter::int('id' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setId($value);
         }
     }
     if (!isset($properties) || in_array('title', $properties)) {
         $value = Util\Converter::string('title' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTitle($value);
         }
     }
     if (!isset($properties) || in_array('googleAnalytics', $properties)) {
         $value = Util\Converter::string('googleAnalytics' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setGoogleAnalytics($value);
         }
     }
     if (!isset($properties) || in_array('keywords', $properties)) {
         $value = Util\Converter::string('keywords' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setKeywords($value);
         }
     }
     if (!isset($properties) || in_array('description', $properties)) {
         $value = Util\Converter::string('description' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setDescription($value);
         }
     }
     if (!isset($properties) || in_array('css', $properties)) {
         $value = Util\Converter::string('css' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setCss($value);
         }
     }
     if (!isset($properties) || in_array('js', $properties)) {
         $value = Util\Converter::string('js' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setJs($value);
         }
     }
     if (!isset($properties) || in_array('signInUrl', $properties)) {
         $value = Util\Converter::string('signInUrl' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setSignInUrl($value);
         }
     }
     if (!isset($properties) || in_array('environment', $properties)) {
         $value = Util\Converter::int('environment' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setEnvironment($value);
         }
     }
     if (!isset($properties) || in_array('sqlLog', $properties)) {
         $value = Util\Converter::bool('sqlLog' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setSqlLog($value);
         }
     }
     if (!isset($properties) || in_array('timezone', $properties)) {
         $value = Util\Converter::string('timezone' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTimezone($value);
         }
     }
     if (!isset($properties) || in_array('isCms', $properties)) {
         $value = Util\Converter::bool('isCms' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setIsCms($value);
         }
     }
     if (!isset($properties) || in_array('cacheTime', $properties)) {
         $value = Util\Converter::int('cacheTime' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setCacheTime($value);
         }
     }
     if (!isset($properties) || in_array('useDeviceTemplate', $properties)) {
         $value = Util\Converter::bool('useDeviceTemplate' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setUseDeviceTemplate($value);
         }
     }
     if (!isset($properties) || in_array('skin', $properties)) {
         $value = Util\Converter::string('skin' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setSkin($value);
         }
     }
     if (!isset($properties) || in_array('sendMailOnError', $properties)) {
         $value = Util\Converter::bool('sendMailOnError' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setSendMailOnError($value);
         }
     }
     if (!isset($properties) || in_array('mailListOnError', $properties)) {
         $value = Util\Converter::string('mailListOnError' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setMailListOnError($value);
         }
     }
     if (!isset($properties) || in_array('status', $properties)) {
         $value = Util\Converter::int('status' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setStatus($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #25
0
 public function feedback()
 {
     // auth
     Auth::isAdminAuthorized($this->signedUser, null, true, '/profile/sign-in');
     // prep
     $save = Converter::string('save', 'post');
     // check
     $feedback = new \Rebond\Core\Feedback\Model();
     $feedback->setStatus(\Rebond\Core\StatusType::INACTIVE);
     $feedback->setUserId($this->signedUser->getId());
     $feedback->setTitle($this->signedUser->getUsername() . '-' . date('ymd-His'));
     $form = new \Rebond\Core\Feedback\Form($feedback);
     // action
     if (isset($save)) {
         if ($form->setFromPost()->validate()->isValid()) {
             $feedback->save();
             Session::adminSuccess('feedbackSent', '/profile/feedback');
         } else {
             Session::set('adminError', $form->getValidation()->getMessage());
         }
     }
     // view
     $this->setTpl();
     $tplMain = new Template(Template::MODULE, ['core', 'feedback']);
     $tplMain->set('item', $form);
     // layout
     $this->tplLayout->set('column1', $tplMain->render('editor'));
     // master
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col'));
     $this->tplMaster->set('jsLauncher', 'profile');
     return $this->tplMaster->render('tpl-default');
 }
Exemple #26
0
 public function reinitialize()
 {
     // auth
     Util\Auth::isAdminAuthorized($this->signedUser, 'admin.dev', true, '/');
     // check
     $action = Util\Converter::string('action');
     if (isset($action)) {
         $result = [];
         $result['status'] = true;
         $result['message'] = '';
         $site = \Rebond\Core\Site\Data::loadById(1);
         $db = new \Rebond\Util\Data();
         switch ($action) {
             case 'file':
                 \Rebond\Core\Site\Service::resetFiles();
                 break;
             case 'restore':
                 $files = \Rebond\Util\File::getFiles('files/backup');
                 $fileFound = false;
                 foreach ($files as $file) {
                     if (stripos($file, 'launch') !== false) {
                         $fileFound = true;
                         $result = $db->restore($file);
                         break;
                     }
                 }
                 if (!$fileFound) {
                     $result['status'] = false;
                     $result['message'] = Util\Lang::lang('dbLaunchFileNotFound');
                 } else {
                     \Rebond\Core\Site\Service::resetFiles();
                 }
                 break;
             case 'full':
                 \Rebond\Core\Site\Service::resetFiles();
                 $result = $db->reset();
                 Util\Session::adminSuccess('resetSuccessful', '/');
                 break;
         }
         if ($result['status']) {
             Util\Session::set('adminSuccess', Util\Lang::lang('resetSuccessful'));
         } else {
             Util\Session::set('adminError', $result['message']);
         }
     }
     // view
     $this->setTpl();
     // main
     $tplMain = new Util\Template(Util\Template::SITE, ['admin', 'dev']);
     // layout
     $this->tplLayout->set('column1', $tplMain->render('reinitialize'));
     // master
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col'));
     $this->tplMaster->set('jsLauncher', 'dev');
     return $this->tplMaster->render('tpl-default');
 }
Exemple #27
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('id', $properties)) {
         $value = Util\Converter::int('id' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setId($value);
         }
     }
     if (!isset($properties) || in_array('folderId', $properties)) {
         $value = Util\Converter::int('folderId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setFolderId($value);
         }
     }
     if (!isset($properties) || in_array('title', $properties)) {
         $value = Util\Converter::string('title' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTitle($value);
         }
     }
     if (!isset($properties) || in_array('tags', $properties)) {
         $value = Util\Converter::string('tags' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTags($value);
         }
     }
     if (!isset($properties) || in_array('upload', $properties)) {
         $value = Util\Converter::string('upload' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setUpload($value);
         }
     }
     if (!isset($properties) || in_array('originalFilename', $properties)) {
         $value = Util\Converter::string('originalFilename' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setOriginalFilename($value);
         }
     }
     if (!isset($properties) || in_array('path', $properties)) {
         $value = Util\Converter::string('path' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setPath($value);
         }
     }
     if (!isset($properties) || in_array('extension', $properties)) {
         $value = Util\Converter::string('extension' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setExtension($value);
         }
     }
     if (!isset($properties) || in_array('mimeType', $properties)) {
         $value = Util\Converter::string('mimeType' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setMimeType($value);
         }
     }
     if (!isset($properties) || in_array('fileSize', $properties)) {
         $value = Util\Converter::int('fileSize' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setFileSize($value);
         }
     }
     if (!isset($properties) || in_array('width', $properties)) {
         $value = Util\Converter::int('width' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setWidth($value);
         }
     }
     if (!isset($properties) || in_array('height', $properties)) {
         $value = Util\Converter::int('height' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setHeight($value);
         }
     }
     if (!isset($properties) || in_array('alt', $properties)) {
         $value = Util\Converter::string('alt' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setAlt($value);
         }
     }
     if (!isset($properties) || in_array('isSelectable', $properties)) {
         $value = Util\Converter::bool('isSelectable' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setIsSelectable($value);
         }
     }
     if (!isset($properties) || in_array('status', $properties)) {
         $value = Util\Converter::int('status' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setStatus($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }
Exemple #28
0
 public function tpl_edit()
 {
     // auth
     Util\Auth::isAdminAuthorized($this->signedUser, 'admin.designer', true, '/');
     // check
     $file = Util\Converter::string('f');
     $app = Util\Converter::string('app');
     $save = Util\Converter::string('save', 'post');
     if (empty($file)) {
         Util\Session::adminError('itemNotFound', [$file], '/designer/tpl');
     }
     $validator = Util\Validate::validateFilename('file', $file, true);
     if (!$validator->isValid()) {
         Util\Session::setAndRedirect('adminError', $validator->getMessage(), '/designer/tpl');
     }
     $filePath = FULL_PATH . 'views/www/';
     if (!empty($app)) {
         $filePath = FULL_PATH . 'Rebond/App/' . $app . '/template/';
         $validator = Util\Validate::validateAlphaNumeric('app', $app, true);
         if (!$validator->isValid()) {
             Util\Session::setAndRedirect('adminError', $validator->getMessage(), '/designer/tpl');
         }
     }
     if (!file_exists($filePath)) {
         Util\Session::adminError('itemNotFound', [$filePath], '/designer/tpl');
     }
     // action
     if (isset($save)) {
         $filePost = Util\Converter::string('file', 'post');
         $tplFile = Util\Converter::string('tpl-file', 'post');
         $appPost = Util\Converter::string('app', 'post');
         $file = FULL_PATH . 'views/' . \Rebond\Config::getPath('siteFolder') . '/' . $filePost;
         if (!empty($appPost)) {
             $file = \Rebond\Config::getPath('rebond') . 'App/' . $appPost . '/template/' . $filePost;
         }
         if (!isset($file) || Util\File::getExtension($file) != 'tpl') {
             Util\Session::adminError('fileNotFoundOrValid', [$file], '/designer/css');
         }
         if (!copy($file, Util\File::getNoExtension($file) . '-' . Util\Format::date(time(), 'string') . '.bak')) {
             Util\Session::adminError('itemNotCopied', [$file], '/designer/css');
         }
         file_put_contents($file, $tplFile);
         Util\Session::adminSuccess('saved', '/designer/tpl');
     }
     // view
     $this->setTpl();
     // main
     $tplMain = new Util\Template(Util\Template::SITE, ['admin', 'designer']);
     $tplMain->set('file', $file);
     $tplMain->set('app', $app);
     $tplMain->set('filePath', $filePath);
     $tplMain->set('editable', Util\File::getExtension($file) == 'tpl');
     // layout
     $this->tplLayout->set('column1', $tplMain->render('tpl-form'));
     // master
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col'));
     $this->tplMaster->set('jsLauncher', 'designerTpl');
     $this->tplMaster->addCss('/css/codemirror.css');
     $this->tplMaster->addJs('/js/codemirror/codemirror.js');
     $this->tplMaster->addJs('/js/codemirror/htmlmixed.js');
     $this->tplMaster->addJs('/js/codemirror/xml.js');
     $this->tplMaster->addJs('/js/codemirror/clike.js');
     $this->tplMaster->addJs('/js/codemirror/php.js');
     return $this->tplMaster->render('tpl-default');
 }
Exemple #29
0
 public function module_edit()
 {
     // auth
     Auth::isAdminAuthorized($this->signedUser, 'admin.cms.module', true, '/cms/module');
     // check
     $id = Converter::int('id');
     $module = \Rebond\Cms\Module\Data::loadById($id);
     if (!isset($module)) {
         Session::adminError('itemNotFound', [$id], '/cms/module');
     }
     $form = new \Rebond\Cms\Module\Form($module);
     // action
     $save = Converter::string('save', 'post');
     if (isset($save)) {
         Auth::isAdminAuthorized($this->signedUser, 'admin.cms.module.edit', true, '/cms/module-edit?id=' . $id);
         if ($form->setFromPost()->validate()->isValid()) {
             $module->save();
             Session::adminSuccess('saved', '/cms/module');
         } else {
             Session::set('adminError', $form->getValidation()->getMessage());
         }
     }
     // view
     $this->setTpl();
     // main
     $tplMain = new Template(Template::MODULE, ['cms', 'module']);
     $tplMain->set('item', $form);
     // layout
     if (Auth::isAdminAuthorized($this->signedUser, 'admin.cms.module.edit', false)) {
         $this->tplLayout->set('column1', $tplMain->render('editor'));
     } else {
         $this->tplLayout->set('column1', $tplMain->render('view'));
     }
     // master
     $this->tplMaster->set('layout', $this->tplLayout->render('layout-1-col'));
     return $this->tplMaster->render('tpl-default');
 }
Exemple #30
0
 public function setFromPost($properties = null)
 {
     if (!isset($properties) || in_array('moduleId', $properties)) {
         $value = Util\Converter::int('moduleId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setModuleId($value);
         }
     }
     if (!isset($properties) || in_array('appId', $properties)) {
         $value = Util\Converter::int('appId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setAppId($value);
         }
     }
     if (!isset($properties) || in_array('contentGroup', $properties)) {
         $value = Util\Converter::int('contentGroup' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setContentGroup($value);
         }
     }
     if (!isset($properties) || in_array('filterId', $properties)) {
         $value = Util\Converter::int('filterId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setFilterId($value);
         }
     }
     if (!isset($properties) || in_array('authorId', $properties)) {
         $value = Util\Converter::int('authorId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setAuthorId($value);
         }
     }
     if (!isset($properties) || in_array('publisherId', $properties)) {
         $value = Util\Converter::int('publisherId' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setPublisherId($value);
         }
     }
     if (!isset($properties) || in_array('title', $properties)) {
         $value = Util\Converter::string('title' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setTitle($value);
         }
     }
     if (!isset($properties) || in_array('urlFriendlyTitle', $properties)) {
         $value = Util\Converter::string('urlFriendlyTitle' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setUrlFriendlyTitle($value);
         }
     }
     if (!isset($properties) || in_array('useExpiration', $properties)) {
         $value = Util\Converter::bool('useExpiration' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setUseExpiration($value);
         }
     }
     if (!isset($properties) || in_array('goLiveDate', $properties)) {
         $value = Util\Converter::datetime('goLiveDate' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setGoLiveDate($value);
         }
     }
     if (!isset($properties) || in_array('expiryDate', $properties)) {
         $value = Util\Converter::datetime('expiryDate' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setExpiryDate($value);
         }
     }
     if (!isset($properties) || in_array('publishedDate', $properties)) {
         $value = Util\Converter::datetime('publishedDate' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setPublishedDate($value);
         }
     }
     if (!isset($properties) || in_array('version', $properties)) {
         $value = Util\Converter::int('version' . $this->unique, 'post');
         if (isset($value)) {
             $this->getModel()->setVersion($value);
         }
     }
     $this->token = Util\Converter::string('token' . $this->unique, 'post', $this->token);
     return $this;
 }