From 0c5b90521bf37a64a560cef4a3e9b8c58853efe3 Mon Sep 17 00:00:00 2001 From: dignajar Date: Sun, 23 Aug 2015 19:07:14 -0300 Subject: [PATCH] Bugs fixes --- admin/controllers/themes.php | 4 ++-- admin/views/edit-page.php | 2 +- admin/views/edit-post.php | 2 +- kernel/boot/rules/99.themes.php | 4 ++-- kernel/page.class.php | 18 +++++++---------- kernel/post.class.php | 20 +++++++++---------- .../pure/{language => languages}/en_US.json | 0 7 files changed, 22 insertions(+), 28 deletions(-) rename themes/pure/{language => languages}/en_US.json (100%) diff --git a/admin/controllers/themes.php b/admin/controllers/themes.php index cf4cd268..0d229357 100644 --- a/admin/controllers/themes.php +++ b/admin/controllers/themes.php @@ -27,8 +27,8 @@ $themesPaths = Filesystem::listDirectories(PATH_THEMES); // Load each plugin clasess foreach($themesPaths as $themePath) { - $langLocaleFile = $themePath.DS.'language'.DS.$Site->locale().'.json'; - $langDefaultFile = $themePath.DS.'language'.DS.'en_US.json'; + $langLocaleFile = $themePath.DS.'languages'.DS.$Site->locale().'.json'; + $langDefaultFile = $themePath.DS.'languages'.DS.'en_US.json'; $database = false; // Check if exists locale language diff --git a/admin/views/edit-page.php b/admin/views/edit-page.php index 2e08e672..eb5b24d0 100644 --- a/admin/views/edit-page.php +++ b/admin/views/edit-page.php @@ -11,7 +11,7 @@ p('Content') ?> p('HTML and Markdown code supported') ?> - + locale().'.json'; -$langDefaultFile = PATH_THEME.'language'.DS.'en_US.json'; +$langLocaleFile = PATH_THEME.'languages'.DS.$Site->locale().'.json'; +$langDefaultFile = PATH_THEME.'languages'.DS.'en_US.json'; $database = false; // Check if exists locale language diff --git a/kernel/page.class.php b/kernel/page.class.php index 20240db1..f4746a71 100644 --- a/kernel/page.class.php +++ b/kernel/page.class.php @@ -3,7 +3,7 @@ class Page extends fileContent { function __construct($key) - { + { // Database Key $this->setField('key', $key); @@ -16,10 +16,8 @@ class Page extends fileContent return $this->getField('title'); } - // Returns the content. - // This content is markdown parser. - // $fullContent, TRUE returns all content, if FALSE returns the first part of the content. - // $html, TRUE returns the content without satinize, FALSE otherwise. + // Returns the content. This content is markdown parser. + // (boolean) $html, TRUE returns the content without satinize, FALSE otherwise. public function content($html=true) { // This content is not sanitized. @@ -32,16 +30,14 @@ class Page extends fileContent return Sanitize::html($content); } - // Returns the content. - // This content is not markdown parser. - // $fullContent, TRUE returns all content, if FALSE returns the first part of the content. - // $html, TRUE returns the content without satinize, FALSE otherwise. - public function contentRaw($html=true) + // Returns the content. This content is not markdown parser. + // (boolean) $raw, TRUE returns the content without sanitized, FALSE otherwise. + public function contentRaw($raw=true) { // This content is not sanitized. $content = $this->getField('contentRaw'); - if($html) { + if($raw) { return $content; } diff --git a/kernel/post.class.php b/kernel/post.class.php index 50217e4c..beed0c5d 100644 --- a/kernel/post.class.php +++ b/kernel/post.class.php @@ -18,19 +18,18 @@ class Post extends fileContent // Returns the content. // This content is markdown parser. - // $fullContent, TRUE returns all content, if FALSE returns the first part of the content. - // $html, TRUE returns the content without satinize, FALSE otherwise. - public function content($fullContent=true, $html=true) + // (boolean) $fullContent, TRUE returns all content, if FALSE returns the first part of the content. + // (boolean) $raw, TRUE returns the content without sanitized, FALSE otherwise. + public function content($fullContent=true, $raw=true) { // This content is not sanitized. $content = $this->getField('content'); - if(!$fullContent) - { + if(!$fullContent) { $content = $this->getField('breakContent'); } - if($html) { + if($raw) { return $content; } @@ -42,15 +41,14 @@ class Post extends fileContent return $this->getField('readMore'); } - // Returns the content. - // This content is not markdown parser. - // $html, TRUE returns the content without satinize, FALSE otherwise. - public function contentRaw($html=true) + // Returns the content. This content is not markdown parser. + // (boolean) $raw, TRUE returns the content without sanitized, FALSE otherwise. + public function contentRaw($raw=true) { // This content is not sanitized. $content = $this->getField('contentRaw'); - if($html) { + if($raw) { return $content; } diff --git a/themes/pure/language/en_US.json b/themes/pure/languages/en_US.json similarity index 100% rename from themes/pure/language/en_US.json rename to themes/pure/languages/en_US.json