├── .gitignore
├── .htaccess
├── LICENSE
├── README.md
├── app
├── classes
│ └── constants
│ │ ├── Constants.php
│ │ └── OptionConstants.php
├── config-sample.php
├── controllers
│ ├── ViewController.php
│ ├── admin
│ │ ├── CategoryController.php
│ │ ├── CommentController.php
│ │ ├── IndexController.php
│ │ ├── LicenseController.php
│ │ ├── MenuController.php
│ │ ├── OptionController.php
│ │ ├── OptionLicenseController.php
│ │ ├── PageController.php
│ │ ├── PostController.php
│ │ ├── ProfileController.php
│ │ ├── SidebarController.php
│ │ ├── TermController.php
│ │ └── UserController.php
│ ├── install
│ │ └── IndexController.php
│ ├── login
│ │ ├── IndexController.php
│ │ ├── LogoutController.php
│ │ └── RegisterController.php
│ └── theme
│ │ ├── CategoryController.php
│ │ ├── IndexController.php
│ │ ├── PageController.php
│ │ ├── PostController.php
│ │ ├── TermController.php
│ │ └── UserController.php
├── define.php
├── index.php
├── load.php
├── models
│ ├── LicenseAbstract.php
│ ├── LicenseInterface.php
│ ├── TemplateAbstract.php
│ ├── licenses
│ │ ├── CategoryLicense.php
│ │ ├── CommentLicense.php
│ │ ├── LicenseLicense.php
│ │ ├── MenuLicense.php
│ │ ├── OptionLicense.php
│ │ ├── OptionLicenseLicense.php
│ │ ├── PageLicense.php
│ │ ├── PostLicense.php
│ │ ├── ProfileLicense.php
│ │ ├── SidebarLicense.php
│ │ ├── TermLicense.php
│ │ └── UserLicense.php
│ ├── managers
│ │ ├── CategoriesManager.php
│ │ ├── CommentsManager.php
│ │ ├── InstallManager.php
│ │ ├── LicensesManager.php
│ │ ├── LoginManager.php
│ │ ├── MenusManager.php
│ │ ├── OptionsLicensesManager.php
│ │ ├── OptionsManager.php
│ │ ├── PagesManager.php
│ │ ├── PostsCategoriesManager.php
│ │ ├── PostsManager.php
│ │ ├── PostsTermsManager.php
│ │ ├── ProfilesLicensesManager.php
│ │ ├── ProfilesManager.php
│ │ ├── SidebarsManager.php
│ │ ├── TermsManager.php
│ │ └── UsersManager.php
│ ├── tables
│ │ ├── Category.php
│ │ ├── Comment.php
│ │ ├── License.php
│ │ ├── Menu.php
│ │ ├── Option.php
│ │ ├── OptionLicense.php
│ │ ├── Page.php
│ │ ├── Post.php
│ │ ├── PostCategory.php
│ │ ├── PostTerm.php
│ │ ├── Profile.php
│ │ ├── ProfileLicense.php
│ │ ├── Sidebar.php
│ │ ├── Term.php
│ │ └── User.php
│ └── template
│ │ ├── CategoryTemplate.php
│ │ ├── CommentTemplate.php
│ │ ├── MenuTemplate.php
│ │ ├── PageTemplate.php
│ │ ├── PostTemplate.php
│ │ ├── SidebarTemplate.php
│ │ ├── TermTemplate.php
│ │ └── UserTemplate.php
├── resources
│ ├── css
│ │ ├── normalize.css
│ │ └── style.css
│ ├── img
│ │ └── softn.png
│ └── js
│ │ ├── api-github.js
│ │ ├── common.js
│ │ ├── delete-data.js
│ │ ├── form.js
│ │ ├── jquery-3.2.1.js
│ │ ├── jquery-3.2.1.min.js
│ │ ├── option-license-form.js
│ │ └── pagination.js
├── route
│ ├── Request.php
│ ├── Route.php
│ └── Router.php
├── tests
│ ├── EscapeTest.php
│ ├── SanitizeTest.php
│ └── ValidateTest.php
├── themes
│ └── softncmsv1
│ │ ├── category
│ │ └── index.php
│ │ ├── footer.php
│ │ ├── header.php
│ │ ├── index.php
│ │ ├── index
│ │ └── index.php
│ │ ├── menu.php
│ │ ├── page
│ │ └── index.php
│ │ ├── pagination.php
│ │ ├── post
│ │ ├── comments.php
│ │ └── index.php
│ │ ├── resources
│ │ ├── css
│ │ │ └── style.css
│ │ └── img
│ │ │ ├── avatar.svg
│ │ │ └── logo_32x32.png
│ │ ├── sidebar.php
│ │ ├── term
│ │ └── index.php
│ │ └── user
│ │ └── index.php
├── util
│ ├── Arrays.php
│ ├── Escape.php
│ ├── Gravatar.php
│ ├── HTML.php
│ ├── Language.php
│ ├── Logger.php
│ ├── Messages.php
│ ├── Pagination.php
│ ├── Sanitize.php
│ ├── Token.php
│ ├── Util.php
│ ├── Validate.php
│ ├── controller
│ │ ├── ControllerAbstract.php
│ │ ├── ControllerInterface.php
│ │ └── ThemeControllerAbstract.php
│ ├── database
│ │ ├── DBAbstract.php
│ │ ├── DBInterface.php
│ │ ├── ManagerAbstract.php
│ │ ├── MySQL.php
│ │ └── TableAbstract.php
│ ├── form
│ │ ├── Form.php
│ │ ├── InputAlphabetic.php
│ │ ├── InputAlphanumeric.php
│ │ ├── InputBoolean.php
│ │ ├── InputEmail.php
│ │ ├── InputHtml.php
│ │ ├── InputInteger.php
│ │ ├── InputListAlphabetic.php
│ │ ├── InputListInteger.php
│ │ ├── InputUrl.php
│ │ ├── builders
│ │ │ ├── InputAlphabeticBuilder.php
│ │ │ ├── InputAlphanumericBuilder.php
│ │ │ ├── InputBooleanBuilder.php
│ │ │ ├── InputEmailBuilder.php
│ │ │ ├── InputHtmlBuilder.php
│ │ │ ├── InputIntegerBuilder.php
│ │ │ ├── InputListAlphabeticBuilder.php
│ │ │ ├── InputListIntegerBuilder.php
│ │ │ └── InputUrlBuilder.php
│ │ └── inputs
│ │ │ ├── Input.php
│ │ │ ├── InputBuilderInterface.php
│ │ │ ├── InputCommonInterface.php
│ │ │ ├── InputInterface.php
│ │ │ ├── InputNumberInterface.php
│ │ │ ├── InputTextInterface.php
│ │ │ ├── builders
│ │ │ ├── InputBuilder.php
│ │ │ ├── InputCommonBuilder.php
│ │ │ ├── InputNumberBuilder.php
│ │ │ ├── InputSelectBuilder.php
│ │ │ ├── InputSelectNumberBuilder.php
│ │ │ ├── InputSelectTextBuilder.php
│ │ │ └── InputTextBuilder.php
│ │ │ └── types
│ │ │ ├── InputCommon.php
│ │ │ ├── InputNumber.php
│ │ │ ├── InputSelect.php
│ │ │ ├── InputSelectNumber.php
│ │ │ ├── InputSelectText.php
│ │ │ └── InputText.php
│ └── languages
│ │ ├── en.mo
│ │ ├── en.po
│ │ ├── softncms.mo
│ │ └── softncms.pot
└── views
│ ├── admin
│ ├── category
│ │ ├── data.php
│ │ ├── form.php
│ │ └── index.php
│ ├── comment
│ │ ├── data.php
│ │ ├── form.php
│ │ └── index.php
│ ├── footer.php
│ ├── header.php
│ ├── index.php
│ ├── index
│ │ ├── apigithub.php
│ │ └── index.php
│ ├── license
│ │ ├── data.php
│ │ ├── form.php
│ │ └── index.php
│ ├── menu
│ │ ├── data.php
│ │ ├── dataedit.php
│ │ ├── dataparentmenu.php
│ │ ├── edit.php
│ │ ├── form.php
│ │ └── index.php
│ ├── modaldelete.php
│ ├── option
│ │ └── index.php
│ ├── optionlicense
│ │ ├── data.php
│ │ ├── datapages.php
│ │ ├── form.php
│ │ └── index.php
│ ├── page
│ │ ├── data.php
│ │ ├── form.php
│ │ └── index.php
│ ├── post
│ │ ├── data.php
│ │ ├── form.php
│ │ └── index.php
│ ├── profile
│ │ ├── data.php
│ │ ├── form.php
│ │ └── index.php
│ ├── sidebar.php
│ ├── sidebar
│ │ ├── data.php
│ │ ├── form.php
│ │ └── index.php
│ ├── term
│ │ ├── data.php
│ │ ├── form.php
│ │ └── index.php
│ └── user
│ │ ├── data.php
│ │ ├── form.php
│ │ └── index.php
│ ├── install
│ ├── index.php
│ └── index
│ │ └── index.php
│ ├── login
│ ├── index.php
│ ├── index
│ │ └── index.php
│ └── register
│ │ └── index.php
│ ├── messages.php
│ └── pagination.php
├── composer.json
├── composer.lock
├── favicon.ico
├── index.php
└── softn_cms.sql
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | app/vendor/
3 | *.mwb*
4 | test-*
5 | *.vpp*
6 | *.vux
7 | *.temp.*
8 | app/config.php
9 | app/log/
10 |
--------------------------------------------------------------------------------
/.htaccess:
--------------------------------------------------------------------------------
1 | Options -Indexes
2 |
3 | RewriteEngine On
4 | RewriteCond %{REQUEST_FILENAME} !-f
5 | RewriteCond %{REQUEST_FILENAME} !-d
6 | RewriteCond %{REQUEST_FILENAME} !-l
7 | RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]
8 |
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017 Nicolás Marulanda P.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/app/classes/constants/Constants.php:
--------------------------------------------------------------------------------
1 | login();
26 | $this->sendDataView([
27 | 'urlRegister' => $this->getRequest()
28 | ->getSiteUrl() . 'login/register',
29 | ]);
30 | $this->view();
31 | }
32 |
33 | private function login() {
34 | if ($this->checkSubmit(Constants::FORM_SUBMIT)) {
35 | if ($this->isValidForm()) {
36 | $user = $this->getForm('user');
37 | $rememberMe = $this->getForm('rememberMe');
38 |
39 | if (LoginManager::login($user, $rememberMe, $this->getConnectionDB())) {
40 | Messages::addSuccess(__('Inicio de sesión correcto.'), TRUE);
41 | $this->redirect('admin');
42 | }
43 | }
44 |
45 | Messages::addDanger(__('Usuario o/y contraseña incorrecto(s).'));
46 | }
47 | }
48 |
49 | protected function formToObject() {
50 | $pass = $this->getInput(UsersManager::USER_PASSWORD);
51 | $user = new User();
52 | $user->setUserLogin($this->getInput(UsersManager::USER_LOGIN));
53 | $user->setUserPassword(Util::encrypt($pass, LOGGED_KEY));
54 |
55 | return [
56 | 'user' => $user,
57 | 'rememberMe' => $this->getInput(UsersManager::USER_REMEMBER_ME),
58 | ];
59 | }
60 |
61 | protected function formInputsBuilders() {
62 | return [
63 | InputAlphanumericBuilder::init(UsersManager::USER_LOGIN)
64 | ->setAccents(FALSE)
65 | ->setWithoutSpace(TRUE)
66 | ->setReplaceSpace('')
67 | ->build(),
68 | InputAlphanumericBuilder::init(UsersManager::USER_PASSWORD)
69 | ->build(),
70 | InputBooleanBuilder::init(UsersManager::USER_REMEMBER_ME)
71 | ->setRequire(FALSE)
72 | ->build(),
73 | ];
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/app/controllers/login/LogoutController.php:
--------------------------------------------------------------------------------
1 | redirect('login');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/controllers/theme/CategoryController.php:
--------------------------------------------------------------------------------
1 | getConnectionDB());
23 | $category = $categoriesManager->searchById($id);
24 |
25 | if (empty($category)) {
26 | $this->redirect();
27 | }
28 |
29 | $postStatus = TRUE;
30 | $postsManager = new PostsManager($this->getConnectionDB());
31 | $postsCategoriesManager = new PostsCategoriesManager($this->getConnectionDB());
32 | $count = $postsCategoriesManager->countPostsByCategoryIdAndPostStatus($id, $postStatus);
33 | $limit = $this->rowsPages($count);
34 | $posts = $postsManager->searchAllByCategoryIdAndStatus($category->getId(), $postStatus, $limit);
35 | $postsTemplate = array_map(function(Post $post) {
36 | return new PostTemplate($post, TRUE, $this->getRequest()
37 | ->getSiteUrl(), $this->getConnectionDB());
38 | }, $posts);
39 |
40 | $this->sendDataView([
41 | 'posts' => $postsTemplate,
42 | 'category' => $category,
43 | ]);
44 | $this->view();
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/app/controllers/theme/IndexController.php:
--------------------------------------------------------------------------------
1 | getConnectionDB());
22 | $count = $postsManager->countByStatus($postStatus);
23 | $posts = $postsManager->searchAllByStatus($postStatus, $this->rowsPages($count));
24 | $postsTemplate = array_map(function(Post $post) {
25 | return new PostTemplate($post, TRUE, $this->getRequest()->getSiteUrl(), $this->getConnectionDB());
26 | }, $posts);
27 | $this->sendDataView(['posts' => $postsTemplate]);
28 | $this->view();
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/app/controllers/theme/TermController.php:
--------------------------------------------------------------------------------
1 | getConnectionDB());
23 | $term = $termsManager->searchById($id);
24 |
25 | if (empty($term)) {
26 | $this->redirect();
27 | }
28 |
29 | $postStatus = TRUE;
30 | $postsManager = new PostsManager($this->getConnectionDB());
31 | $postsTermsManager = new PostsTermsManager($this->getConnectionDB());
32 | $count = $postsTermsManager->countPostsByTermIdAndPostStatus($id, $postStatus);
33 | $limit = $this->rowsPages($count);
34 | $posts = $postsManager->searchAllByTermIdAndStatus($term->getId(), $postStatus, $limit);
35 | $postsTemplate = array_map(function(Post $post) {
36 | return new PostTemplate($post, TRUE, $this->getRequest()
37 | ->getSiteUrl(), $this->getConnectionDB());
38 | }, $posts);
39 |
40 | $this->sendDataView([
41 | 'posts' => $postsTemplate,
42 | 'term' => $term,
43 | ]);
44 | $this->view();
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/app/controllers/theme/UserController.php:
--------------------------------------------------------------------------------
1 | getConnectionDB());
22 | $user = $usersManager->searchById($id);
23 |
24 | if (empty($user)) {
25 | $this->redirect();
26 | }
27 |
28 | $postStatus = TRUE;
29 | $postsManager = new PostsManager($this->getConnectionDB());
30 | $count = $postsManager->countByUserIdAndStatus($id, $postStatus);
31 | $limit = $this->rowsPages($count);
32 | $posts = $postsManager->searchByUserIdAndStatus($user->getId(), $postStatus, $limit);
33 | $postsTemplate = array_map(function(Post $post) {
34 | return new PostTemplate($post, TRUE, $this->getRequest()
35 | ->getSiteUrl(), $this->getConnectionDB());
36 | }, $posts);
37 |
38 | $this->sendDataView([
39 | 'posts' => $postsTemplate,
40 | 'user' => $user,
41 | ]);
42 | $this->view();
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/app/define.php:
--------------------------------------------------------------------------------
1 | siteUrl = $siteUrl;
28 | $this->connectionDB = $connectionDB;
29 | }
30 |
31 | /**
32 | * @return string
33 | */
34 | public function getSiteUrl() {
35 | return $this->siteUrl;
36 | }
37 |
38 | /**
39 | * @param string $siteUrl
40 | */
41 | public function setSiteUrl($siteUrl) {
42 | $this->siteUrl = $siteUrl;
43 | }
44 |
45 | public abstract function initRelationship();
46 |
47 | /**
48 | * @return mixed
49 | */
50 | public function getConnectionDB() {
51 | return $this->connectionDB;
52 | }
53 |
54 | /**
55 | * @param mixed $connectionDB
56 | */
57 | public function setConnectionDB($connectionDB) {
58 | $this->connectionDB = $connectionDB;
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/app/models/licenses/CategoryLicense.php:
--------------------------------------------------------------------------------
1 | searchByName(OptionConstants::SITE_URL);
32 |
33 | if ($optionSiteUrl !== FALSE) {
34 | $siteUrl = $optionSiteUrl->getOptionValue();
35 | }
36 | }
37 |
38 | if (empty($siteUrl)) {
39 | if (empty($router)) {
40 | $router = new Router();
41 | }
42 |
43 | $urlGet = $router->getRequest()
44 | ->getUrlGet();
45 | $siteUrl = Util::getUrl($urlGet);
46 | }
47 |
48 | return $siteUrl;
49 | }
50 |
51 | /**
52 | * @param string $name
53 | *
54 | * @return bool|Option
55 | */
56 | public function searchByName($name) {
57 | $result = parent::searchAllByColumn($name, self::OPTION_NAME, \PDO::PARAM_STR, ['ORDER BY ' . self::COLUMN_ID . ' DESC']);
58 |
59 | return Arrays::findFirst($result);
60 | }
61 |
62 | /**
63 | * @param Option $option
64 | *
65 | * @return bool
66 | */
67 | public function updateByColumnName($option) {
68 | return parent::updateByColumn($option, self::OPTION_NAME);
69 | }
70 |
71 | /**
72 | * @param Option $object
73 | */
74 | protected function prepareStatement($object) {
75 | parent::addPrepareStatement(self::COLUMN_ID, $object->getId(), \PDO::PARAM_INT);
76 | parent::addPrepareStatement(self::OPTION_VALUE, $object->getOptionValue(), \PDO::PARAM_STR);
77 | parent::addPrepareStatement(self::OPTION_NAME, $object->getOptionName(), \PDO::PARAM_STR);
78 | }
79 |
80 | protected function getTable() {
81 | return self::TABLE;
82 | }
83 |
84 | protected function buildObject($result) {
85 | $option = new Option();
86 | $option->setId(Arrays::get($result, self::COLUMN_ID));
87 | $option->setOptionName(Arrays::get($result, self::OPTION_NAME));
88 | $option->setOptionValue(Arrays::get($result, self::OPTION_VALUE));
89 |
90 | return $option;
91 | }
92 |
93 | }
94 |
--------------------------------------------------------------------------------
/app/models/managers/PagesManager.php:
--------------------------------------------------------------------------------
1 | getTableWithPrefix(), self::COLUMN_ID, self::PAGE_STATUS);
37 |
38 | return Arrays::findFirst(parent::search($query));
39 | }
40 |
41 | protected function buildObject($result) {
42 | $page = new Page();
43 | $page->setId(Arrays::get($result, self::COLUMN_ID));
44 | $page->setPageTitle(Arrays::get($result, self::PAGE_TITLE));
45 | $page->setPageStatus(Arrays::get($result, self::PAGE_STATUS));
46 | $page->setPageDate(Arrays::get($result, self::PAGE_DATE));
47 | $page->setPageContents(Arrays::get($result, self::PAGE_CONTENTS));
48 | $page->setPageCommentStatus(Arrays::get($result, self::PAGE_COMMENT_STATUS));
49 | $page->setPageCommentCount(Arrays::get($result, self::PAGE_COMMENT_COUNT));
50 |
51 | return $page;
52 | }
53 |
54 | /**
55 | * @param Page $object
56 | */
57 | protected function prepareStatement($object) {
58 | parent::addPrepareStatement(self::COLUMN_ID, $object->getId(), \PDO::PARAM_INT);
59 | parent::addPrepareStatement(self::PAGE_TITLE, $object->getPageTitle(), \PDO::PARAM_STR);
60 | parent::addPrepareStatement(self::PAGE_STATUS, $object->getPageStatus(), \PDO::PARAM_STR);
61 | parent::addPrepareStatement(self::PAGE_DATE, $object->getPageDate(), \PDO::PARAM_STR);
62 | parent::addPrepareStatement(self::PAGE_CONTENTS, $object->getPageContents(), \PDO::PARAM_STR);
63 | parent::addPrepareStatement(self::PAGE_COMMENT_STATUS, $object->getPageCommentStatus(), \PDO::PARAM_STR);
64 | parent::addPrepareStatement(self::PAGE_COMMENT_COUNT, $object->getPageCommentCount(), \PDO::PARAM_STR);
65 | }
66 |
67 | protected function getTable() {
68 | return self::TABLE;
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/app/models/managers/ProfilesManager.php:
--------------------------------------------------------------------------------
1 | checkName($object);
26 |
27 | return parent::create($object);
28 | }
29 |
30 | /**
31 | * @param Profile $profile
32 | *
33 | * @return Profile
34 | */
35 | private function checkName($profile) {
36 | $name = $profile->getProfileName();
37 | $id = $profile->getId();
38 | $newName = $name;
39 | $num = 0;
40 |
41 | while ($this->nameExists($newName, $id)) {
42 | $newName = $name . ++$num;
43 | }
44 |
45 | $profile->setProfileName($newName);
46 |
47 | return $profile;
48 | }
49 |
50 | private function nameExists($name, $id) {
51 | $result = parent::searchAllByColumn($name, self::PROFILE_NAME, \PDO::PARAM_STR);
52 | $result = Arrays::findFirst($result);
53 |
54 | //Si el "id" es el mismo, estamos actualizando.
55 | return !empty($result) && $result->getId() != $id;
56 | }
57 |
58 | public function update($object) {
59 | $object = $this->checkName($object);
60 |
61 | return parent::updateByColumnId($object);
62 | }
63 |
64 | /**
65 | * @param Profile $object
66 | */
67 | protected function prepareStatement($object) {
68 | parent::addPrepareStatement(self::COLUMN_ID, $object->getId(), \PDO::PARAM_INT);
69 | parent::addPrepareStatement(self::PROFILE_DESCRIPTION, $object->getProfileDescription(), \PDO::PARAM_STR);
70 | parent::addPrepareStatement(self::PROFILE_NAME, $object->getProfileName(), \PDO::PARAM_STR);
71 | }
72 |
73 | protected function getTable() {
74 | return self::TABLE;
75 | }
76 |
77 | protected function buildObject($result) {
78 | $profile = new Profile();
79 | $profile->setId(Arrays::get($result, self::COLUMN_ID));
80 | $profile->setProfileName(Arrays::get($result, self::PROFILE_NAME));
81 | $profile->setProfileDescription(Arrays::get($result, self::PROFILE_DESCRIPTION));
82 |
83 | return $profile;
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/app/models/tables/Category.php:
--------------------------------------------------------------------------------
1 | categoryName;
30 | }
31 |
32 | /**
33 | * @param string $categoryName
34 | */
35 | public function setCategoryName($categoryName) {
36 | $this->categoryName = $categoryName;
37 | }
38 |
39 | /**
40 | * @return string
41 | */
42 | public function getCategoryDescription() {
43 | return $this->categoryDescription;
44 | }
45 |
46 | /**
47 | * @param string $categoryDescription
48 | */
49 | public function setCategoryDescription($categoryDescription) {
50 | $this->categoryDescription = $categoryDescription;
51 | }
52 |
53 | /**
54 | * @return int
55 | */
56 | public function getCategoryPostCount() {
57 | return $this->categoryPostCount;
58 | }
59 |
60 | /**
61 | * @param int $categoryPostCount
62 | */
63 | public function setCategoryPostCount($categoryPostCount) {
64 | $this->categoryPostCount = $categoryPostCount;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/models/tables/Comment.php:
--------------------------------------------------------------------------------
1 | commentStatus;
42 | }
43 |
44 | /**
45 | * @param int $commentStatus
46 | */
47 | public function setCommentStatus($commentStatus) {
48 | $this->commentStatus = $commentStatus;
49 | }
50 |
51 | /**
52 | * @return string
53 | */
54 | public function getCommentAuthor() {
55 | return $this->commentAuthor;
56 | }
57 |
58 | /**
59 | * @param string $commentAuthor
60 | */
61 | public function setCommentAuthor($commentAuthor) {
62 | $this->commentAuthor = $commentAuthor;
63 | }
64 |
65 | /**
66 | * @return string
67 | */
68 | public function getCommentAuthorEmail() {
69 | return $this->commentAuthorEmail;
70 | }
71 |
72 | /**
73 | * @param string $commentAuthorEmail
74 | */
75 | public function setCommentAuthorEmail($commentAuthorEmail) {
76 | $this->commentAuthorEmail = $commentAuthorEmail;
77 | }
78 |
79 | /**
80 | * @return string
81 | */
82 | public function getCommentDate() {
83 | return $this->commentDate;
84 | }
85 |
86 | /**
87 | * @param string $commentDate
88 | */
89 | public function setCommentDate($commentDate) {
90 | $this->commentDate = $commentDate;
91 | }
92 |
93 | /**
94 | * @return string
95 | */
96 | public function getCommentContents() {
97 | return $this->commentContents;
98 | }
99 |
100 | /**
101 | * @param string $commentContents
102 | */
103 | public function setCommentContents($commentContents) {
104 | $this->commentContents = $commentContents;
105 | }
106 |
107 | /**
108 | * @return int
109 | */
110 | public function getCommentUserId() {
111 | return $this->commentUserId;
112 | }
113 |
114 | /**
115 | * @param int $commentUserId
116 | */
117 | public function setCommentUserId($commentUserId) {
118 | $this->commentUserId = $commentUserId;
119 | }
120 |
121 | /**
122 | * @return int
123 | */
124 | public function getPostId() {
125 | return $this->postId;
126 | }
127 |
128 | /**
129 | * @param int $postId
130 | */
131 | public function setPostId($postId) {
132 | $this->postId = $postId;
133 | }
134 |
135 | }
136 |
--------------------------------------------------------------------------------
/app/models/tables/License.php:
--------------------------------------------------------------------------------
1 | licenseName;
27 | }
28 |
29 | /**
30 | * @param string $licenseName
31 | */
32 | public function setLicenseName($licenseName) {
33 | $this->licenseName = $licenseName;
34 | }
35 |
36 | /**
37 | * @return string
38 | */
39 | public function getLicenseDescription() {
40 | return $this->licenseDescription;
41 | }
42 |
43 | /**
44 | * @param string $licenseDescription
45 | */
46 | public function setLicenseDescription($licenseDescription) {
47 | $this->licenseDescription = $licenseDescription;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/app/models/tables/Menu.php:
--------------------------------------------------------------------------------
1 | menuTotalChildren;
36 | }
37 |
38 | /**
39 | * @param int $menuTotalChildren
40 | */
41 | public function setMenuTotalChildren($menuTotalChildren) {
42 | $this->menuTotalChildren = $menuTotalChildren;
43 | }
44 |
45 | /**
46 | * @return string
47 | */
48 | public function getMenuUrl() {
49 | return $this->menuUrl;
50 | }
51 |
52 | /**
53 | * @param string $menuUrl
54 | */
55 | public function setMenuUrl($menuUrl) {
56 | $this->menuUrl = $menuUrl;
57 | }
58 |
59 | /**
60 | * @return int
61 | */
62 | public function getMenuSub() {
63 | return $this->menuSub;
64 | }
65 |
66 | /**
67 | * @param int $menuSub
68 | */
69 | public function setMenuSub($menuSub) {
70 | $this->menuSub = $menuSub;
71 | }
72 |
73 | /**
74 | * @return int
75 | */
76 | public function getMenuPosition() {
77 | return $this->menuPosition;
78 | }
79 |
80 | /**
81 | * @param int $menuPosition
82 | */
83 | public function setMenuPosition($menuPosition) {
84 | $this->menuPosition = $menuPosition;
85 | }
86 |
87 | /**
88 | * @return string
89 | */
90 | public function getMenuTitle() {
91 | return $this->menuTitle;
92 | }
93 |
94 | /**
95 | * @param string $menuTitle
96 | */
97 | public function setMenuTitle($menuTitle) {
98 | $this->menuTitle = $menuTitle;
99 | }
100 |
101 | }
102 |
--------------------------------------------------------------------------------
/app/models/tables/Option.php:
--------------------------------------------------------------------------------
1 | optionName;
27 | }
28 |
29 | /**
30 | * @param string $optionName
31 | */
32 | public function setOptionName($optionName) {
33 | $this->optionName = $optionName;
34 | }
35 |
36 | /**
37 | * @return string
38 | */
39 | public function getOptionValue() {
40 | return $this->optionValue;
41 | }
42 |
43 | /**
44 | * @param string $optionValue
45 | */
46 | public function setOptionValue($optionValue) {
47 | $this->optionValue = $optionValue;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/app/models/tables/Page.php:
--------------------------------------------------------------------------------
1 | pageStatus;
39 | }
40 |
41 | /**
42 | * @param int $pageStatus
43 | */
44 | public function setPageStatus($pageStatus) {
45 | $this->pageStatus = $pageStatus;
46 | }
47 |
48 | /**
49 | * @return string
50 | */
51 | public function getPageTitle() {
52 | return $this->pageTitle;
53 | }
54 |
55 | /**
56 | * @param string $pageTitle
57 | */
58 | public function setPageTitle($pageTitle) {
59 | $this->pageTitle = $pageTitle;
60 | }
61 |
62 | /**
63 | * @return string
64 | */
65 | public function getPageDate() {
66 | return $this->pageDate;
67 | }
68 |
69 | /**
70 | * @param string $pageDate
71 | */
72 | public function setPageDate($pageDate) {
73 | $this->pageDate = $pageDate;
74 | }
75 |
76 | /**
77 | * @return string
78 | */
79 | public function getPageContents() {
80 | return $this->pageContents;
81 | }
82 |
83 | /**
84 | * @param string $pageContents
85 | */
86 | public function setPageContents($pageContents) {
87 | $this->pageContents = $pageContents;
88 | }
89 |
90 | /**
91 | * @return int
92 | */
93 | public function getPageCommentStatus() {
94 | return $this->pageCommentStatus;
95 | }
96 |
97 | /**
98 | * @param int $pageCommentStatus
99 | */
100 | public function setPageCommentStatus($pageCommentStatus) {
101 | $this->pageCommentStatus = $pageCommentStatus;
102 | }
103 |
104 | /**
105 | * @return int
106 | */
107 | public function getPageCommentCount() {
108 | return $this->pageCommentCount;
109 | }
110 |
111 | /**
112 | * @param int $pageCommentCount
113 | */
114 | public function setPageCommentCount($pageCommentCount) {
115 | $this->pageCommentCount = $pageCommentCount;
116 | }
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/app/models/tables/PostCategory.php:
--------------------------------------------------------------------------------
1 | postId;
25 | }
26 |
27 | /**
28 | * @param int $postId
29 | */
30 | public function setPostId($postId) {
31 | $this->postId = $postId;
32 | }
33 |
34 | /**
35 | * @return int
36 | */
37 | public function getCategoryId() {
38 | return $this->categoryId;
39 | }
40 |
41 | /**
42 | * @param int $categoryId
43 | */
44 | public function setCategoryId($categoryId) {
45 | $this->categoryId = $categoryId;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/app/models/tables/PostTerm.php:
--------------------------------------------------------------------------------
1 | postId;
25 | }
26 |
27 | /**
28 | * @param int $postId
29 | */
30 | public function setPostId($postId) {
31 | $this->postId = $postId;
32 | }
33 |
34 | /**
35 | * @return int
36 | */
37 | public function getTermId() {
38 | return $this->termId;
39 | }
40 |
41 | /**
42 | * @param int $termId
43 | */
44 | public function setTermId($termId) {
45 | $this->termId = $termId;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/app/models/tables/Profile.php:
--------------------------------------------------------------------------------
1 | profileName;
27 | }
28 |
29 | /**
30 | * @param string $profileName
31 | */
32 | public function setProfileName($profileName) {
33 | $this->profileName = $profileName;
34 | }
35 |
36 | /**
37 | * @return string
38 | */
39 | public function getProfileDescription() {
40 | return $this->profileDescription;
41 | }
42 |
43 | /**
44 | * @param string $profileDescription
45 | */
46 | public function setProfileDescription($profileDescription) {
47 | $this->profileDescription = $profileDescription;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/app/models/tables/ProfileLicense.php:
--------------------------------------------------------------------------------
1 | licenseId;
25 | }
26 |
27 | /**
28 | * @param int $licenseId
29 | */
30 | public function setLicenseId($licenseId) {
31 | $this->licenseId = $licenseId;
32 | }
33 |
34 | /**
35 | * @return int
36 | */
37 | public function getProfileId() {
38 | return $this->profileId;
39 | }
40 |
41 | /**
42 | * @param int $profileId
43 | */
44 | public function setProfileId($profileId) {
45 | $this->profileId = $profileId;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/app/models/tables/Sidebar.php:
--------------------------------------------------------------------------------
1 | sidebarTitle;
30 | }
31 |
32 | /**
33 | * @param string $sidebarTitle
34 | */
35 | public function setSidebarTitle($sidebarTitle) {
36 | $this->sidebarTitle = $sidebarTitle;
37 | }
38 |
39 | /**
40 | * @return string
41 | */
42 | public function getSidebarContents() {
43 | return $this->sidebarContents;
44 | }
45 |
46 | /**
47 | * @param string $sidebarContents
48 | */
49 | public function setSidebarContents($sidebarContents) {
50 | $this->sidebarContents = $sidebarContents;
51 | }
52 |
53 | /**
54 | * @return int
55 | */
56 | public function getSidebarPosition() {
57 | return $this->sidebarPosition;
58 | }
59 |
60 | /**
61 | * @param int $sidebarPosition
62 | */
63 | public function setSidebarPosition($sidebarPosition) {
64 | $this->sidebarPosition = $sidebarPosition;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/models/tables/Term.php:
--------------------------------------------------------------------------------
1 | termName;
30 | }
31 |
32 | /**
33 | * @param string $termName
34 | */
35 | public function setTermName($termName) {
36 | $this->termName = $termName;
37 | }
38 |
39 | /**
40 | * @return string
41 | */
42 | public function getTermDescription() {
43 | return $this->termDescription;
44 | }
45 |
46 | /**
47 | * @param string $termDescription
48 | */
49 | public function setTermDescription($termDescription) {
50 | $this->termDescription = $termDescription;
51 | }
52 |
53 | /**
54 | * @return int
55 | */
56 | public function getTermPostCount() {
57 | return $this->termPostCount;
58 | }
59 |
60 | /**
61 | * @param int $termPostCount
62 | */
63 | public function setTermPostCount($termPostCount) {
64 | $this->termPostCount = $termPostCount;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/models/template/CategoryTemplate.php:
--------------------------------------------------------------------------------
1 | category = $category;
39 | $this->posts = [];
40 |
41 | if ($initRelationShip) {
42 | $this->initRelationship();
43 | }
44 | }
45 |
46 | public function initRelationship() {
47 | $this->initPosts();
48 | }
49 |
50 | public function initPosts() {
51 | $postsManager = new PostsManager($this->getConnectionDB());
52 | $this->posts = $postsManager->searchAllByCategoryId($this->category->getId());
53 | $this->posts = array_map(function(Post $post) {
54 | return new PostTemplate($post, FALSE, $this->getSiteUrl(), $this->getConnectionDB());
55 | }, $this->posts);
56 | }
57 |
58 | public function initCategory($categoryId) {
59 | $categoriesManager = new CategoriesManager($this->getConnectionDB());
60 | $this->category = $categoriesManager->searchById($categoryId);
61 |
62 | if (empty($this->category)) {
63 | Logger::getInstance()
64 | ->error('La categoría no existe.', ['currentCategoryId' => $categoryId]);
65 | throw new \Exception("La categoría no existe.");
66 | }
67 | }
68 |
69 | /**
70 | * @return Category
71 | */
72 | public function getCategory() {
73 | return $this->category;
74 | }
75 |
76 | /**
77 | * @param Category $category
78 | */
79 | public function setCategory($category) {
80 | $this->category = $category;
81 | }
82 |
83 | /**
84 | * @return array
85 | */
86 | public function getPosts() {
87 | return $this->posts;
88 | }
89 |
90 | }
91 |
--------------------------------------------------------------------------------
/app/models/template/MenuTemplate.php:
--------------------------------------------------------------------------------
1 | menu = $menu;
37 | $this->subMenuList = [];
38 |
39 | if ($initRelationShip) {
40 | $this->initRelationship();
41 | }
42 | }
43 |
44 | public function initRelationship() {
45 | $this->initSubMenuList();
46 | }
47 |
48 | public function initSubMenuList() {
49 | if (!empty($this->menu)) {
50 | $menusManager = new MenusManager($this->getConnectionDB());
51 | $menuList = $menusManager->searchByMenuSub($this->menu->getId());
52 |
53 | $this->subMenuList = array_map(function(Menu $menu) {
54 | return new MenuTemplate($menu, TRUE, $this->getSiteUrl(), $this->getConnectionDB());
55 | }, $menuList);
56 | }
57 | }
58 |
59 | public function initMenu($menuId) {
60 | $menusManager = new MenusManager($this->getConnectionDB());
61 | $this->menu = $menusManager->searchById($menuId);
62 |
63 | if (empty($this->menu)) {
64 | Logger::getInstance()
65 | ->error('El menu no existe.', ['currentMenuId' => $menuId]);
66 | throw new \Exception("El menu no existe.");
67 | }
68 | }
69 |
70 | /**
71 | * @return array
72 | */
73 | public function getSubMenuList() {
74 | return $this->subMenuList;
75 | }
76 |
77 | /**
78 | * @return Menu
79 | */
80 | public function getMenu() {
81 | return $this->menu;
82 | }
83 |
84 | /**
85 | * @param Menu $menu
86 | */
87 | public function setMenu($menu) {
88 | $this->menu = $menu;
89 | }
90 |
91 | }
92 |
--------------------------------------------------------------------------------
/app/models/template/PageTemplate.php:
--------------------------------------------------------------------------------
1 | setPageContents(Escape::htmlDecode($page->getPageContents()));
35 | $this->page = $page;
36 |
37 | if ($initRelationShip) {
38 | $this->initRelationship();
39 | }
40 | }
41 |
42 | public function initRelationship() {
43 | }
44 |
45 | public function initPage($pageId) {
46 | $pagesManager = new PagesManager($this->getConnectionDB());
47 | $this->page = $pagesManager->searchById($pageId);
48 |
49 | if ($this->page === FALSE) {
50 | Logger::getInstance()
51 | ->error('La pagina no existe.', ['currentPageId' => $pageId]);
52 | throw new \Exception(__('La pagina no existe.'));
53 | }
54 | }
55 |
56 | /**
57 | * @return Page
58 | */
59 | public function getPage() {
60 | return $this->page;
61 | }
62 |
63 | /**
64 | * @param Page $page
65 | */
66 | public function setPage($page) {
67 | $this->page = $page;
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/app/models/template/SidebarTemplate.php:
--------------------------------------------------------------------------------
1 | sidebar = $sidebar;
33 | }
34 |
35 | public function initRelationship() {
36 | }
37 |
38 | public function initSidebar($sidebarId) {
39 | $sidebarsManager = new SidebarsManager($this->getConnectionDB());
40 | $this->sidebar = $sidebarsManager->searchById($sidebarId);
41 |
42 | if (empty($this->sidebar)) {
43 | Logger::getInstance()
44 | ->error('La barra lateral no existe.', ['currentSidebarId' => $sidebarId]);
45 | throw new \Exception('La barra lateral no existe.');
46 | }
47 | }
48 |
49 | /**
50 | * @return null|Sidebar
51 | */
52 | public function getSidebar() {
53 | return $this->sidebar;
54 | }
55 |
56 | /**
57 | * @param null|Sidebar $sidebar
58 | */
59 | public function setSidebar($sidebar) {
60 | $this->sidebar = $sidebar;
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/app/models/template/TermTemplate.php:
--------------------------------------------------------------------------------
1 | term = $term;
39 | $this->posts = [];
40 |
41 | if ($initRelationShip) {
42 | $this->initRelationship();
43 | }
44 | }
45 |
46 | public function initRelationship() {
47 | $this->initPosts();
48 | }
49 |
50 | public function initPosts() {
51 | $postsManager = new PostsManager($this->getConnectionDB());
52 | $this->posts = $postsManager->searchAllByTermId($this->term->getId());
53 | $this->posts = array_map(function(Post $post) {
54 | return new PostTemplate($post, FALSE, $this->getSiteUrl(), $this->getConnectionDB());
55 | }, $this->posts);
56 | }
57 |
58 | public function initTerm($termId) {
59 | $termsManager = new TermsManager($this->getConnectionDB());
60 | $this->term = $termsManager->searchById($termId);
61 |
62 | if (empty($this->term)) {
63 | Logger::getInstance()
64 | ->error('La etiqueta no existe.', ['currentTermId' => $termId]);
65 | throw new \Exception("La etiqueta no existe.");
66 | }
67 | }
68 |
69 | /**
70 | * @return Term
71 | */
72 | public function getTerm() {
73 | return $this->term;
74 | }
75 |
76 | /**
77 | * @param Term $term
78 | */
79 | public function setTerm($term) {
80 | $this->term = $term;
81 | }
82 |
83 | /**
84 | * @return array
85 | */
86 | public function getPosts() {
87 | return $this->posts;
88 | }
89 |
90 | }
91 |
--------------------------------------------------------------------------------
/app/models/template/UserTemplate.php:
--------------------------------------------------------------------------------
1 | user = $user;
39 | $this->post = [];
40 |
41 | if ($initRelationship) {
42 | $this->initRelationship();
43 | }
44 | }
45 |
46 | public function initRelationship() {
47 | $this->initPosts();
48 | }
49 |
50 | public function initPosts() {
51 | $postsManager = new PostsManager($this->getConnectionDB());
52 | $this->post = $postsManager->searchAllByUserId($this->user->getId());
53 | $this->post = array_map(function(Post $post) {
54 | return new PostTemplate($post, FALSE, $this->getSiteUrl(), $this->getConnectionDB());
55 | }, $this->post);
56 | }
57 |
58 | public function initUser($userId) {
59 | $usersManager = new UsersManager($this->getConnectionDB());
60 | $this->user = $usersManager->searchById($userId);
61 |
62 | if (empty($this->user)) {
63 | Logger::getInstance()
64 | ->error('El usuario no existe.', ['currentUserId' => $userId]);
65 | throw new \Exception("El usuario no existe.");
66 | }
67 | }
68 |
69 | /**
70 | * @return User
71 | */
72 | public function getUser() {
73 | return $this->user;
74 | }
75 |
76 | /**
77 | * @param User $user
78 | */
79 | public function setUser($user) {
80 | $this->user = $user;
81 | }
82 |
83 | /**
84 | * @return array
85 | */
86 | public function getPost() {
87 | return $this->post;
88 | }
89 |
90 | }
91 |
--------------------------------------------------------------------------------
/app/resources/img/softn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmarulo/softn-cms/2c7de7aa0874a0346cd9cd571c5df3764ab2d627/app/resources/img/softn.png
--------------------------------------------------------------------------------
/app/resources/js/api-github.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | // setDataGitHub();
3 | })();
4 |
5 | function setDataGitHub() {
6 | var url = $(document).find('.page-container').data('url');
7 | var setData = function (data) {
8 | $(document).find('#data-github').html(data);
9 | };
10 |
11 | callAjax(url + 'apiGitHub', 'POST', '', setData);
12 | }
13 |
--------------------------------------------------------------------------------
/app/resources/js/delete-data.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | var btnElement;
3 |
4 | $(document).on('click', 'button.btn-danger', function (event) {
5 | event.preventDefault();
6 | btnElement = $(this);
7 | });
8 |
9 | $('#btn-modal-delete-confirm').on('click', function () {
10 | deleteData(btnElement, $(this));
11 | });
12 | })();
13 |
14 | function deleteData(btnDelete, btnModal) {
15 | var pageContainer = btnDelete.closest('.page-container');
16 | var url = pageContainer.data('url');
17 | var id = btnDelete.data('id');
18 | var data = btnModal.data('token') + '&redirect=false';
19 | var callback = function (data) {
20 | var pagination = $(document).find('.pagination > li.active > a');
21 | var dataPaged = '';
22 |
23 | if (pagination.length > 0) {
24 | dataPaged = pagination.data('paged');
25 | }
26 |
27 | reloadDataContainer(pageContainer, dataPaged);
28 | callAjax(url + 'messages', 'GET', '', function (dataMessages) {
29 | includeMessages(dataMessages);
30 | });
31 | };
32 | callAjax(url + 'delete/' + id, 'POST', data, callback);
33 | }
34 |
--------------------------------------------------------------------------------
/app/resources/js/form.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | tinymceInit();
3 | })();
4 |
5 | function tinymceInit() {
6 | //Configuración para la librería TINYMCE.
7 | tinymce.init({
8 | selector: 'textarea#textContent',
9 | height: 500,
10 | plugins: [
11 | 'advlist autolink lists link image charmap print preview hr anchor pagebreak',
12 | 'searchreplace wordcount visualblocks visualchars code fullscreen',
13 | 'insertdatetime media nonbreaking save table contextmenu directionality',
14 | 'emoticons template paste textcolor colorpicker textpattern imagetools'
15 | ],
16 | toolbar1: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
17 | toolbar2: 'print preview media | forecolor backcolor emoticons',
18 | });
19 | }
20 |
--------------------------------------------------------------------------------
/app/resources/js/option-license-form.js:
--------------------------------------------------------------------------------
1 | var divIdPage = '';
2 | var btnIdCheckAll = '';
3 | var btnIdUnCheckAll = '';
4 | var inputsCheckBoxes = '';
5 | var divClassFormInputCheckBoxes = '';
6 | var btnClassCheckAll = '';
7 | var btnClassUnCheckAll = '';
8 |
9 | (function () {
10 | initVars();
11 | initEvents();
12 | })();
13 |
14 | function initVars() {
15 | divIdPage = '#option-license';
16 | btnIdCheckAll = '#btn-check-all';
17 | btnIdUnCheckAll = '#btn-uncheck-all';
18 | inputsCheckBoxes = findInputsCheckBoxes($(divIdPage));
19 | divClassFormInputCheckBoxes = '.form-input-checkboxes';
20 | btnClassCheckAll = '.btn-check-all';
21 | btnClassUnCheckAll = '.btn-uncheck-all';
22 | }
23 |
24 | function initEvents() {
25 | $(btnIdCheckAll).on('click', function () {
26 | changeAllCheckBox(inputsCheckBoxes, true);
27 | });
28 | $(btnIdUnCheckAll).on('click', function () {
29 | changeAllCheckBox(inputsCheckBoxes, false);
30 | });
31 | $(btnClassCheckAll).on('click', function () {
32 | var inputsCheckBoxes = findInputsCheckBoxes($(this).closest(divClassFormInputCheckBoxes));
33 | changeAllCheckBox(inputsCheckBoxes, true);
34 | });
35 | $(btnClassUnCheckAll).on('click', function () {
36 | var inputsCheckBoxes = findInputsCheckBoxes($(this).closest(divClassFormInputCheckBoxes));
37 | changeAllCheckBox(inputsCheckBoxes, false);
38 | });
39 | }
40 |
41 | function findInputsCheckBoxes(element) {
42 | return element.find('input[type="checkbox"]');
43 | }
44 |
45 | function changeAllCheckBox(inputsCheckBoxes, check) {
46 | inputsCheckBoxes.prop('checked', check);
47 | }
48 |
--------------------------------------------------------------------------------
/app/resources/js/pagination.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | $(document).on('click', 'ul.pagination a', function (event) {
3 | event.preventDefault();
4 | var element = $(this);
5 |
6 | if (element.closest('li').hasClass('disabled')) {
7 | return false;
8 | }
9 |
10 | reloadDataContainer(element.closest('.page-container'), element.data('paged'));
11 | });
12 |
13 | $(document).on('keyup', 'input.search-paged', function (event) {
14 | if (event.keyCode === 13) {
15 | reloadDataContainer($(this).closest('.page-container'), 'paged=' + $(this).val())
16 | }
17 | });
18 | })();
19 |
--------------------------------------------------------------------------------
/app/tests/EscapeTest.php:
--------------------------------------------------------------------------------
1 | html = '
Encabezado
Contenido
';
16 | }
17 |
18 | public function testHtmlEncode() {
19 | $output = Escape::htmlEncode($this->html);
20 |
21 | $this->assertEquals('<h1>Encabezado</h1><p>Contenido</p>', $output);
22 |
23 | return $output;
24 | }
25 |
26 | /**
27 | * @depends testHtmlEncode
28 | */
29 | public function testHtmlDecode($htmlEncode) {
30 | $this->assertEquals($this->html, Escape::htmlDecode($htmlEncode));
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/app/themes/softncmsv1/footer.php:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/app/themes/softncmsv1/header.php:
--------------------------------------------------------------------------------
1 |
6 |
9 |
--------------------------------------------------------------------------------
/app/themes/softncmsv1/index.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/app/themes/softncmsv1/index/index.php:
--------------------------------------------------------------------------------
1 |
9 |
10 | getSiteUrl();
12 | $urlPost = $siteUrl . 'post/';
13 | $urlCategory = $siteUrl . 'category/';
14 | $urlTerm = $siteUrl . 'term/';
15 | $urlUser = $siteUrl . 'user/';
16 | $post = $postTemplate->getPost();
17 | $user = $postTemplate->getUserTemplate()
18 | ->getUser();
19 | $termsTemplate = $postTemplate->getTermsTemplate();
20 | $categoriesTemplate = $postTemplate->getCategoriesTemplate();
21 | $postId = $post->getId();
22 | ?>
23 |
24 |
46 |
47 |
59 |
60 |
61 |
62 | getSiteUrl();
7 | $urlPage = $siteUrl . 'page/';
8 | $page = $pageTemplate->getPage();
9 | $pageId = $page->getId();
10 | ?>
11 |
12 |
13 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/themes/softncmsv1/pagination.php:
--------------------------------------------------------------------------------
1 | getUrl();
8 | $dataPaged = $pagination->getDataPaged();
9 | $leftArrow = $pagination->getDataLeftArrow();
10 | $rightArrow = $pagination->getDataRightArrow();
11 | $output = '';
12 | $outLeftArrow = '«';
13 | $outRightArrow = '»';
14 |
15 | if (empty($leftArrow)) {
16 | $outLeftArrow = '«';
17 | }
18 |
19 | if (empty($rightArrow)) {
20 | $outRightArrow = '»';
21 | }
22 | ?>
23 |
44 | getSiteUrl();
9 | $urlPost = $siteUrl . 'post/';
10 | $urlCategory = $siteUrl . 'category/';
11 | $urlTerm = $siteUrl . 'term/';
12 | $urlUser = $siteUrl . 'user/';
13 | $post = $postTemplate->getPost();
14 | $user = $postTemplate->getUserTemplate()
15 | ->getUser();
16 | $termsTemplate = $postTemplate->getTermsTemplate();
17 | $categoriesTemplate = $postTemplate->getCategoriesTemplate();
18 | $postId = $post->getId();
19 | ?>
20 |
21 |
22 |
44 |
45 |
57 |
58 |
62 |
63 |
--------------------------------------------------------------------------------
/app/themes/softncmsv1/resources/css/style.css:
--------------------------------------------------------------------------------
1 | body{
2 | -moz-white-space: pre-wrap; /* css-3 */
3 | -webkit-white-space: pre-wrap; /* css-3 */
4 | white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
5 | white-space: -pre-wrap; /* Opera 4-6 */
6 | white-space: -o-pre-wrap; /* Opera 7 */
7 | word-wrap: break-word; /* Internet Explorer 5.5+ */
8 | -ms-word-wrap: break-word;
9 | }
10 |
11 | #container{
12 | margin-top: 20px;
13 | }
14 |
15 | .bg-grey{
16 | background-color: #e9e8e9;
17 | }
18 |
19 | .navbar-white {
20 | background-color: #ffffff;
21 | border-color: #ffffff;
22 | }
23 |
24 | .navbar{
25 | border-radius: 0px;
26 | }
27 |
28 | .pagination-content{
29 | margin: auto 130px;
30 | }
31 |
32 |
33 | /** ============================================================================
34 | * CONTENTS ====================================================================
35 | * ========================================================================== */
36 | article{
37 | padding: 0px 10px 10px;
38 | margin-bottom: 30px;
39 | }
40 | .post-title{
41 | border-bottom: 5px solid #2172ba;
42 | background-color: #f9f9f9;
43 | padding: 0px 10px;
44 | margin: 15px 0px;
45 | }
46 |
47 | /** SIDEBAR ================================================================= */
48 | .sidebar{
49 | margin-bottom: 10px;
50 | }
51 | .sidebar-title{
52 | background-color: #f9f9f9;
53 | border-bottom: 5px solid #eee;
54 | padding: 15px 10px;
55 | margin-bottom: 10px;
56 | }
57 | .sidebar-content{
58 | padding: 0px 10px;
59 | }
60 |
61 | /** COMMENTS ================================================================ */
62 | #container-comments div[id*="comment-"],
63 | #container-comments-form form{
64 | padding: 0px 15px;
65 | margin-bottom: 25px;
66 | }
--------------------------------------------------------------------------------
/app/themes/softncmsv1/resources/img/avatar.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/themes/softncmsv1/resources/img/logo_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmarulo/softn-cms/2c7de7aa0874a0346cd9cd571c5df3764ab2d627/app/themes/softncmsv1/resources/img/logo_32x32.png
--------------------------------------------------------------------------------
/app/themes/softncmsv1/sidebar.php:
--------------------------------------------------------------------------------
1 |
8 |
16 |
--------------------------------------------------------------------------------
/app/themes/softncmsv1/term/index.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
Etiqueta: getTermName(); ?>
14 |
15 | getSiteUrl();
17 | $urlPost = $siteUrl . 'post/';
18 | $urlCategory = $siteUrl . 'category/';
19 | $urlTerm = $siteUrl . 'term/';
20 | $urlUser = $siteUrl . 'user/';
21 | $post = $postTemplate->getPost();
22 | $user = $postTemplate->getUserTemplate()
23 | ->getUser();
24 | $termsTemplate = $postTemplate->getTermsTemplate();
25 | $categoriesTemplate = $postTemplate->getCategoriesTemplate();
26 | $postId = $post->getId();
27 | ?>
28 |
29 |
51 |
52 |
64 |
65 |
66 |
67 |
10 |
11 |
12 |
Usuario: getUserName(); ?>
13 |
14 | getSiteUrl();
16 | $urlPost = $siteUrl . 'post/';
17 | $urlCategory = $siteUrl . 'category/';
18 | $urlTerm = $siteUrl . 'term/';
19 | $urlUser = $siteUrl . 'user/';
20 | $post = $postTemplate->getPost();
21 | $user = $postTemplate->getUserTemplate()
22 | ->getUser();
23 | $termsTemplate = $postTemplate->getTermsTemplate();
24 | $categoriesTemplate = $postTemplate->getCategoriesTemplate();
25 | $postId = $post->getId();
26 | ?>
27 |
28 |
50 |
51 |
63 |
64 |
65 |
66 | setMethod($_GET)
21 | ->setSpecialChar(TRUE)
22 | ->build()
23 | ->filter();
24 | $translator = new Translator();
25 | $translator->register();
26 |
27 | if (empty($language) && empty($paramLang)) {
28 | $language = self::getDefaultLan();
29 | } elseif (empty($language)) {
30 | $language = $paramLang;
31 | }
32 |
33 | $pathMoFile = LANGUAGES . "$language.mo";
34 |
35 | if (file_exists($pathMoFile)) {
36 | $translator->loadTranslations(Translations::fromMoFile($pathMoFile));
37 | } else {
38 | Logger::getInstance()
39 | ->debug('El fichero del idioma no existe.', [
40 | 'currentLang' => $language,
41 | 'path' => $pathMoFile,
42 | ]);
43 | }
44 | }
45 |
46 | private static function getDefaultLan() {
47 | if (defined('DEFAULT_LANGUAGE')) {
48 | return DEFAULT_LANGUAGE;
49 | }
50 |
51 | return '';
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/app/util/Messages.php:
--------------------------------------------------------------------------------
1 | $message,
38 | 'typeMessage' => $type,
39 | ];
40 |
41 | if ($session) {
42 | if (!isset($_SESSION[SESSION_MESSAGES])) {
43 | $_SESSION[SESSION_MESSAGES] = [];
44 | }
45 |
46 | $_SESSION[SESSION_MESSAGES][] = $intPut;
47 | } else {
48 | self::$MESSAGES[] = $intPut;
49 | }
50 | }
51 |
52 | /**
53 | * @param string $message
54 | * @param bool $session
55 | */
56 | public static function addSuccess($message, $session = FALSE) {
57 | self::add($message, Messages::TYPE_SUCCESS, $session);
58 | }
59 |
60 | /**
61 | * @param string $message
62 | * @param bool $session
63 | */
64 | public static function addWarning($message, $session = FALSE) {
65 | self::add($message, Messages::TYPE_WARNING, $session);
66 | }
67 |
68 | /**
69 | * @return array
70 | */
71 | public static function getMessages() {
72 | $sessionMessages = self::getSessionMessages();
73 | $messages = array_merge($sessionMessages, self::$MESSAGES);
74 | self::$MESSAGES = [];
75 |
76 | return $messages;
77 | }
78 |
79 | /**
80 | * @return array
81 | */
82 | private static function getSessionMessages() {
83 | $messages = [];
84 |
85 | if (isset($_SESSION[SESSION_MESSAGES])) {
86 | $messages = $_SESSION[SESSION_MESSAGES];
87 | unset($_SESSION[SESSION_MESSAGES]);
88 | }
89 |
90 | return $messages;
91 | }
92 |
93 | /**
94 | * @param array $value
95 | *
96 | * @return bool|string
97 | */
98 | public static function getMessage($value) {
99 | return Arrays::get($value, 'message');
100 | }
101 |
102 | /**
103 | * @param array $value
104 | *
105 | * @return bool|string
106 | */
107 | public static function getTypeMessage($value) {
108 | return Arrays::get($value, 'typeMessage');
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/app/util/controller/ControllerInterface.php:
--------------------------------------------------------------------------------
1 | connection = new \PDO($strConnection, DB_USER, DB_PASSWORD);
27 | $this->connection->setAttribute(\PDO::ATTR_EMULATE_PREPARES, FALSE);
28 | $this->connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
29 | } catch (\PDOException $ex) {
30 | die('Error al intentar establecer la conexión con la base de datos.' . $ex->getMessage());
31 | }
32 | }
33 |
34 | protected function getConnection() {
35 | return $this->connection;
36 | }
37 |
38 | protected function setConnection($value) {
39 | $this->connection = $value;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/app/util/database/TableAbstract.php:
--------------------------------------------------------------------------------
1 | id;
22 | }
23 |
24 | /**
25 | * @param int $id
26 | */
27 | public function setId($id) {
28 | $this->id = $id;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/app/util/form/Form.php:
--------------------------------------------------------------------------------
1 | filter();
69 |
70 | if ($value === '' && $data->isRequire()) {
71 | Messages::addDanger(__('El campo "%1$s" es obligatorio.', $data->getName()));
72 | $notError = FALSE;
73 | $output = FALSE;
74 | Token::regenerate();
75 | Logger::getInstance()
76 | ->debug('No se logro validar todos los campos del formulario.', [
77 | 'dataValue' => $data->getValue(),
78 | 'dataName' => $data->getName(),
79 | ]);
80 | } else {
81 | /*
82 | * El nombre del campo corresponde al indice
83 | * en la lista de datos a retornar.
84 | */
85 | $output[$data->getName()] = $value;
86 | }
87 | }
88 |
89 | return $output;
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/app/util/form/InputAlphabetic.php:
--------------------------------------------------------------------------------
1 | value, $this->accents, $this->withoutSpace, $this->replaceSpace, $this->specialChar);
27 |
28 | if (!Validate::alphabetic($output, $this->lenMax, $this->accents, $this->lenStrict, $this->specialChar)) {
29 | $output = '';
30 | }
31 |
32 | return $output;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/app/util/form/InputAlphanumeric.php:
--------------------------------------------------------------------------------
1 | value, $this->accents, $this->withoutSpace, $this->replaceSpace, $this->specialChar);
27 |
28 | if (!Validate::alphanumeric($output, $this->lenMax, $this->accents, $this->lenStrict, $this->specialChar)) {
29 | $output = '';
30 | }
31 |
32 | return $output;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/app/util/form/InputBoolean.php:
--------------------------------------------------------------------------------
1 | value);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/app/util/form/InputEmail.php:
--------------------------------------------------------------------------------
1 | value);
27 |
28 | if (!Validate::email($output)) {
29 | $output = '';
30 | }
31 |
32 | return $output;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/util/form/InputHtml.php:
--------------------------------------------------------------------------------
1 | value);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/util/form/InputInteger.php:
--------------------------------------------------------------------------------
1 | value, $this->sign);
27 |
28 | if (!Validate::integer($output, $this->lenMax, $this->lenStrict)) {
29 | $output = '';
30 | }
31 |
32 | return $output;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/util/form/InputListAlphabetic.php:
--------------------------------------------------------------------------------
1 | value;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/util/form/InputListInteger.php:
--------------------------------------------------------------------------------
1 | value, $this->listType, $this->sign);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/util/form/InputUrl.php:
--------------------------------------------------------------------------------
1 | value);
27 |
28 | if (!Validate::url($output)) {
29 | $output = '';
30 | }
31 |
32 | return $output;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/util/form/builders/InputAlphabeticBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | /**
33 | * @param $name
34 | * @param string $type
35 | *
36 | * @return InputAlphabeticBuilder
37 | */
38 | public static function init($name, $type = 'text') {
39 | $input = new InputAlphabetic();
40 | $input->setName($name);
41 | $input->setType($type);
42 |
43 | return new InputAlphabeticBuilder($input);
44 | }
45 |
46 | /**
47 | * @return InputAlphabetic
48 | */
49 | public function build() {
50 | parent::build();
51 |
52 | return $this->input;
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/app/util/form/builders/InputAlphanumericBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | /**
33 | * @param $name
34 | * @param string $type
35 | *
36 | * @return InputAlphanumericBuilder
37 | */
38 | public static function init($name, $type = 'text') {
39 | $input = new InputAlphanumeric();
40 | $input->setName($name);
41 | $input->setType($type);
42 |
43 | return new InputAlphanumericBuilder($input);
44 | }
45 |
46 | /**
47 | * @return InputAlphanumeric
48 | */
49 | public function build() {
50 | parent::build();
51 |
52 | return $this->input;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/util/form/builders/InputBooleanBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | /**
33 | * @param $name
34 | * @param string $type
35 | *
36 | * @return InputBooleanBuilder
37 | */
38 | public static function init($name, $type = 'text') {
39 | $input = new InputBoolean();
40 | $input->setName($name);
41 | $input->setType($type);
42 |
43 | return new InputBooleanBuilder($input);
44 | }
45 |
46 | /**
47 | * @return InputBoolean
48 | */
49 | public function build() {
50 | parent::build();
51 |
52 | return $this->input;
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/app/util/form/builders/InputEmailBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | public static function init($name, $type = 'text') {
33 | $input = new InputEmail();
34 | $input->setName($name);
35 | $input->setType($type);
36 |
37 | return new InputEmailBuilder($input);
38 | }
39 |
40 | public function build() {
41 | parent::build();
42 |
43 | return $this->input;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/app/util/form/builders/InputHtmlBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | public static function init($name, $type = 'text') {
33 | $input = new InputHtml();
34 | $input->setName($name);
35 | $input->setType($type);
36 |
37 | return new InputHtmlBuilder($input);
38 | }
39 |
40 | public function build() {
41 | parent::build();
42 |
43 | return $this->input;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/util/form/builders/InputIntegerBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | public static function init($name, $type = 'text') {
33 | $input = new InputInteger();
34 | $input->setName($name);
35 | $input->setType($type);
36 |
37 | return new InputIntegerBuilder($input);
38 | }
39 |
40 | public function build() {
41 | parent::build();
42 |
43 | return $this->input;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/util/form/builders/InputListAlphabeticBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | public static function init($name, $type = 'text') {
33 | $input = new InputListAlphabetic();
34 | $input->setName($name);
35 | $input->setType($type);
36 |
37 | return new InputListAlphabeticBuilder($input);
38 | }
39 |
40 | public function build() {
41 | parent::build();
42 |
43 | return $this->input;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/app/util/form/builders/InputListIntegerBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | public static function init($name, $type = 'text') {
33 | $input = new InputListInteger();
34 | $input->setName($name);
35 | $input->setType($type);
36 |
37 | return new InputListIntegerBuilder($input);
38 | }
39 |
40 | public function build() {
41 | parent::build();
42 |
43 | return $this->input;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/app/util/form/builders/InputUrlBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | public static function init($name, $type = 'text') {
33 | $input = new InputUrl();
34 | $input->setName($name);
35 | $input->setType($type);
36 |
37 | return new InputUrlBuilder($input);
38 | }
39 |
40 | public function build() {
41 | parent::build();
42 |
43 | return $this->input;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/util/form/inputs/Input.php:
--------------------------------------------------------------------------------
1 | value = '';
34 | $this->name = '';
35 | $this->type = '';
36 | $this->require = TRUE;
37 | $this->method = [];
38 | }
39 |
40 | /**
41 | * @return mixed
42 | */
43 | public function getValue() {
44 | return $this->value;
45 | }
46 |
47 | /**
48 | * @param mixed $value
49 | */
50 | public function setValue($value) {
51 | $this->value = $value;
52 | }
53 |
54 | /**
55 | * @return string
56 | */
57 | public function getName() {
58 | return $this->name;
59 | }
60 |
61 | /**
62 | * @param string $name
63 | */
64 | public function setName($name) {
65 | $this->name = $name;
66 | }
67 |
68 | /**
69 | * @return string
70 | */
71 | public function getType() {
72 | return $this->type;
73 | }
74 |
75 | /**
76 | * @param string $type
77 | */
78 | public function setType($type) {
79 | $this->type = $type;
80 | }
81 |
82 | /**
83 | * @return boolean
84 | */
85 | public function isRequire() {
86 | return $this->require;
87 | }
88 |
89 | /**
90 | * @param bool $require
91 | */
92 | public function setRequire($require) {
93 | $this->require = $require;
94 | }
95 |
96 | /**
97 | * @return array
98 | */
99 | public function getMethod() {
100 | return $this->method;
101 | }
102 |
103 | /**
104 | * @param array $method
105 | */
106 | public function setMethod($method) {
107 | $this->method = $method;
108 | }
109 |
110 | public abstract function filter();
111 |
112 | }
113 |
--------------------------------------------------------------------------------
/app/util/form/inputs/InputBuilderInterface.php:
--------------------------------------------------------------------------------
1 | input = $input;
29 | }
30 |
31 | /**
32 | * @param mixed $value
33 | *
34 | * @return $this
35 | */
36 | public function setValue($value) {
37 | $this->input->setValue($value);
38 |
39 | return $this;
40 | }
41 |
42 | /**
43 | * @param string $name
44 | *
45 | * @return $this
46 | */
47 | public function setName($name) {
48 | $this->input->setName($name);
49 |
50 | return $this;
51 | }
52 |
53 | /**
54 | * @param string $type
55 | *
56 | * @return $this
57 | */
58 | public function setType($type) {
59 | $this->input->setType($type);
60 |
61 | return $this;
62 | }
63 |
64 | /**
65 | * @param boolean $require
66 | *
67 | * @return $this
68 | */
69 | public function setRequire($require) {
70 | $this->input->setRequire($require);
71 |
72 | return $this;
73 | }
74 |
75 | /**
76 | * @param $method
77 | *
78 | * @return $this
79 | */
80 | public function setMethod($method) {
81 | $this->input->setMethod($method);
82 |
83 | return $this;
84 | }
85 |
86 | public function build(){
87 | if(empty($this->input->getMethod())){
88 | $this->input->setMethod($_POST);
89 | }
90 |
91 | $this->input->setValue(Arrays::get($this->input->getMethod(), $this->input->getName()));
92 |
93 | return $this->input;
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/app/util/form/inputs/builders/InputCommonBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | /**
33 | * @param int $lenMax
34 | *
35 | * @return $this
36 | */
37 | public function setLenMax($lenMax) {
38 | $this->input->setLenMax($lenMax);
39 |
40 | return $this;
41 | }
42 |
43 | /**
44 | * @param int $lenMin
45 | *
46 | * @return $this
47 | */
48 | public function setLenMin($lenMin) {
49 | $this->input->setLenMin($lenMin);
50 |
51 | return $this;
52 | }
53 |
54 | /**
55 | * @param boolean $lenStrict
56 | *
57 | * @return $this
58 | */
59 | public function setLenStrict($lenStrict) {
60 | $this->input->setLenStrict($lenStrict);
61 |
62 | return $this;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/app/util/form/inputs/builders/InputNumberBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | /**
33 | * @param boolean $sign
34 | *
35 | * @return $this
36 | */
37 | public function setSign($sign) {
38 | $this->input->setSign($sign);
39 |
40 | return $this;
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/app/util/form/inputs/builders/InputSelectBuilder.php:
--------------------------------------------------------------------------------
1 | input->setListType($listType);
24 |
25 | return $this;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/util/form/inputs/builders/InputSelectNumberBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/util/form/inputs/builders/InputSelectTextBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/util/form/inputs/builders/InputTextBuilder.php:
--------------------------------------------------------------------------------
1 | input = $input;
30 | }
31 |
32 | /**
33 | * @param boolean $accents
34 | *
35 | * @return $this
36 | */
37 | public function setAccents($accents) {
38 | $this->input->setAccents($accents);
39 |
40 | return $this;
41 | }
42 |
43 | /**
44 | * @param boolean $withoutSpace
45 | *
46 | * @return $this
47 | */
48 | public function setWithoutSpace($withoutSpace) {
49 | $this->input->setWithoutSpace($withoutSpace);
50 |
51 | return $this;
52 | }
53 |
54 | /**
55 | * @param string $replaceSpace
56 | *
57 | * @return $this
58 | */
59 | public function setReplaceSpace($replaceSpace) {
60 | $this->input->setReplaceSpace($replaceSpace);
61 |
62 | return $this;
63 | }
64 |
65 | /**
66 | * @param $specialChar
67 | *
68 | * @return $this
69 | */
70 | public function setSpecialChar($specialChar) {
71 | $this->input->setSpecialChar($specialChar);
72 |
73 | return $this;
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/app/util/form/inputs/types/InputCommon.php:
--------------------------------------------------------------------------------
1 | lenMax = 0;
38 | $this->lenMin = 1;
39 | $this->lenStrict = FALSE;
40 | }
41 |
42 | /**
43 | * @return int
44 | */
45 | public function getLenMax() {
46 | return $this->lenMax;
47 | }
48 |
49 | /**
50 | * @param int $lenMax
51 | */
52 | public function setLenMax($lenMax) {
53 | $this->lenMax = $lenMax;
54 | }
55 |
56 | /**
57 | * @return int
58 | */
59 | public function getLenMin() {
60 | return $this->lenMin;
61 | }
62 |
63 | /**
64 | * @param int $lenMin
65 | */
66 | public function setLenMin($lenMin) {
67 | $this->lenMin = $lenMin;
68 | }
69 |
70 | /**
71 | * @return boolean
72 | */
73 | public function isLenStrict() {
74 | return $this->lenStrict;
75 | }
76 |
77 | /**
78 | * @param bool $lenStrict
79 | */
80 | public function setLenStrict($lenStrict) {
81 | $this->lenStrict = $lenStrict;
82 | }
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/app/util/form/inputs/types/InputNumber.php:
--------------------------------------------------------------------------------
1 | sign = FALSE;
27 | }
28 |
29 | /**
30 | * @return boolean
31 | */
32 | public function isSign() {
33 | return $this->sign;
34 | }
35 |
36 | /**
37 | * @param bool $sign
38 | */
39 | public function setSign($sign) {
40 | $this->sign = $sign;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/util/form/inputs/types/InputSelect.php:
--------------------------------------------------------------------------------
1 | listType = 'integer';
26 | }
27 |
28 | /**
29 | * @return string
30 | */
31 | public function getListType() {
32 | return $this->listType;
33 | }
34 |
35 | /**
36 | * @param string $listType
37 | */
38 | public function setListType($listType) {
39 | $this->listType = $listType;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/app/util/form/inputs/types/InputSelectNumber.php:
--------------------------------------------------------------------------------
1 | accents = TRUE;
30 | $this->withoutSpace = FALSE;
31 | $this->replaceSpace = '-';
32 | $this->specialChar = FALSE;
33 | }
34 |
35 | /**
36 | * @return bool
37 | */
38 | public function isSpecialChar() {
39 | return $this->specialChar;
40 | }
41 |
42 | /**
43 | * @param bool $specialChar
44 | */
45 | public function setSpecialChar($specialChar) {
46 | $this->specialChar = $specialChar;
47 | }
48 |
49 | /**
50 | * @return boolean
51 | */
52 | public function isAccents() {
53 | return $this->accents;
54 | }
55 |
56 | /**
57 | * @param bool $accents
58 | */
59 | public function setAccents($accents) {
60 | $this->accents = $accents;
61 | }
62 |
63 | /**
64 | * @return boolean
65 | */
66 | public function isWithoutSpace() {
67 | return $this->withoutSpace;
68 | }
69 |
70 | /**
71 | * @param bool $withoutSpace
72 | */
73 | public function setWithoutSpace($withoutSpace) {
74 | $this->withoutSpace = $withoutSpace;
75 | }
76 |
77 | /**
78 | * @return string
79 | */
80 | public function getReplaceSpace() {
81 | return $this->replaceSpace;
82 | }
83 |
84 | /**
85 | * @param string $replaceSpace
86 | */
87 | public function setReplaceSpace($replaceSpace) {
88 | $this->replaceSpace = $replaceSpace;
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/app/util/languages/en.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmarulo/softn-cms/2c7de7aa0874a0346cd9cd571c5df3764ab2d627/app/util/languages/en.mo
--------------------------------------------------------------------------------
/app/util/languages/softncms.mo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nmarulo/softn-cms/2c7de7aa0874a0346cd9cd571c5df3764ab2d627/app/util/languages/softncms.mo
--------------------------------------------------------------------------------
/app/util/languages/softncms.pot:
--------------------------------------------------------------------------------
1 | msgid ""
2 | msgstr ""
3 | "Project-Id-Version: SoftN-CMS v0.4-alpha\n"
4 | "POT-Creation-Date: 2017-08-12 13:05+0200\n"
5 | "PO-Revision-Date: 2017-08-12 18:58+0200\n"
6 | "Language-Team: Nicolás Marulanda P.\n"
7 | "MIME-Version: 1.0\n"
8 | "Content-Type: text/plain; charset=UTF-8\n"
9 | "Content-Transfer-Encoding: 8bit\n"
10 | "X-Generator: Poedit 2.0.3\n"
11 | "X-Poedit-Basepath: ../..\n"
12 | "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13 | "X-Poedit-SourceCharset: UTF-8\n"
14 | "X-Poedit-KeywordsList: __\n"
15 | "Last-Translator: \n"
16 | "Language: en\n"
17 | "X-Poedit-SearchPath-0: .\n"
18 | "X-Poedit-SearchPathExcluded-0: vendor\n"
19 |
--------------------------------------------------------------------------------
/app/views/admin/category/data.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 | |
16 | |
17 | |
18 |
19 |
20 |
21 |
22 | |
23 | |
24 | |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
35 | |
36 | getCategoryName(); ?> |
37 | getCategoryPostCount(); ?> |
38 |
39 |
40 |
41 |
42 |
43 |
11 |
44 |
--------------------------------------------------------------------------------
/app/views/admin/category/index.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/views/admin/comment/data.php:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 |
25 |
26 |
27 |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
44 | |
45 | getCommentAuthor(); ?> |
46 | getCommentContents(); ?> |
47 | getCommentStatus(); ?> |
48 | getPostId(); ?> |
49 | getCommentDate(); ?> |
50 |
51 |
52 |
53 |
54 |
55 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/views/admin/footer.php:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/app/views/admin/index.php:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
29 |
30 |
31 |
32 |
42 |
50 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/app/views/admin/index/apigithub.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
18 |
19 |
20 |
:
21 | GitHub
22 |
23 |
24 | -
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
:
33 | GitHub
34 |
35 |
36 | -
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/views/admin/license/data.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 | |
15 | |
16 |
17 |
18 |
19 |
20 | |
21 | |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 | |
33 | getLicenseName(); ?> |
34 |
35 |
36 |
37 |
38 |
39 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/views/admin/menu/data.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 | |
18 | |
19 | |
20 |
21 |
22 |
23 |
24 | |
25 | |
26 | |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 | |
39 | getMenuTitle(); ?> |
40 | getMenuTotalChildren(); ?> |
41 |
42 |
43 |
44 |
45 |
46 |
8 |
14 |
--------------------------------------------------------------------------------
/app/views/admin/menu/edit.php:
--------------------------------------------------------------------------------
1 | getId();
12 | ?>
13 |
14 |
15 |
: getMenuTitle(); ?>
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/views/admin/menu/index.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/views/admin/modaldelete.php:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/app/views/admin/optionlicense/data.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 | |
14 | License |
15 |
16 |
17 |
18 |
19 | |
20 | License |
21 |
22 |
23 |
24 | getId(); ?>
26 |
27 |
28 |
29 |
32 | |
33 | getLicenseName(); ?> |
34 |
35 |
36 |
37 |
38 |
39 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/views/admin/page/data.php:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 | |
18 | |
19 | |
20 | |
21 | |
22 |
23 |
24 |
25 |
26 | |
27 | |
28 | |
29 | |
30 | |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
41 | |
42 | getPageTitle(); ?> |
43 | getPageDate(); ?> |
44 | getPageStatus(); ?> |
45 | getPageCommentCount(); ?> |
46 |
47 |
48 |
49 |
50 |
51 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/views/admin/post/data.php:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 |
25 |
26 |
27 |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
44 | |
45 | getPostTitle(); ?> |
46 | getUserId(); ?> |
47 | getPostCommentCount(); ?> |
48 | getPostDate(); ?> |
49 | getPostStatus(); ?> |
50 |
51 |
52 |
53 |
54 |
55 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/views/admin/profile/data.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 | |
15 | |
16 |
17 |
18 |
19 |
20 | |
21 | |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 | |
33 | getProfileName(); ?> |
34 |
35 |
36 |
37 |
38 |
39 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/views/admin/sidebar/data.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 | |
16 | |
17 | |
18 |
19 |
20 |
21 |
22 | |
23 | |
24 | |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
35 | |
36 | getSidebarTitle(); ?> |
37 | getSidebarPosition(); ?> |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/views/admin/sidebar/form.php:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/app/views/admin/sidebar/index.php:
--------------------------------------------------------------------------------
1 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/views/admin/term/data.php:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 | |
16 | |
17 | |
18 |
19 |
20 |
21 |
22 | |
23 | |
24 | |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
35 | |
36 | getTermName(); ?> |
37 | getTermPostCount(); ?> |
38 |
39 |
40 |
41 |
42 |
43 |
12 |
13 |
14 |
15 |
16 |
17 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/app/views/admin/term/index.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/views/admin/user/data.php:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 |
25 |
26 |
27 |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
44 | |
45 | getUserLogin(); ?> |
46 | getUserName(); ?> |
47 | getUserEmail(); ?> |
48 | getUserRegistered(); ?> |
49 | getUserPostCount(); ?> |
50 |
51 |
52 |
53 |
54 |
55 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/views/install/index.php:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | SoftN CMS |
19 |
20 |
21 |
22 |
26 |
27 |
28 |
29 |
30 |
31 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app/views/login/index.php:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
28 |
29 |
30 |
31 |
32 |
33 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/app/views/login/index/index.php:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |

15 |
16 |
17 |
39 |
40 |
41 |
42 |
43 |
48 |
49 |
--------------------------------------------------------------------------------
/app/views/login/register/index.php:
--------------------------------------------------------------------------------
1 |
10 |
47 |
48 |
--------------------------------------------------------------------------------
/app/views/messages.php:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 | getUrl();
9 | $dataPaged = $pagination->getDataPaged();
10 | $leftArrow = $pagination->getDataLeftArrow();
11 | $rightArrow = $pagination->getDataRightArrow();
12 | $output = '';
13 | $outLeftArrow = '«';
14 | $outRightArrow = '»';
15 |
16 | if (empty($leftArrow)) {
17 | $outLeftArrow = '«';
18 | }
19 |
20 | if (empty($rightArrow)) {
21 | $outRightArrow = '»';
22 | }
23 | ?>
24 |
49 |