diff --git a/.gitignore b/.gitignore index 26dd0e10..6d8587f9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ bl-content/* bl-plugins/timemachine bl-plugins/remote-content -bl-kernel/bludit.pro.php \ No newline at end of file +bl-kernel/bludit.pro.php +bl-themes/docs diff --git a/bl-kernel/admin/controllers/settings-advanced.php b/bl-kernel/admin/controllers/settings-advanced.php index 7b70a5c2..f789a6a5 100644 --- a/bl-kernel/admin/controllers/settings-advanced.php +++ b/bl-kernel/admin/controllers/settings-advanced.php @@ -29,11 +29,11 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { // ============================================================================ // Main after POST // ============================================================================ -$allPublishedPages = buildAllpages(true); +$allPages = buildAllpages($publishedPages=true, $staticPages=true, $draftPages=false, $scheduledPages=false); // Homepage select options $homepageOptions = array(' '=>'- '.$L->g('Latest content').' -'); -foreach($allPublishedPages as $key=>$page) { +foreach ($allPages as $key=>$page) { $parentKey = $page->parentKey(); if ($parentKey) { $homepageOptions[$key] = $pagesByParentByKey[PARENT][$parentKey]->title() .'->'. $page->title(); diff --git a/bl-kernel/admin/views/edit-content.php b/bl-kernel/admin/views/edit-content.php index 105cbb7e..a1745a68 100644 --- a/bl-kernel/admin/views/edit-content.php +++ b/bl-kernel/admin/views/edit-content.php @@ -162,7 +162,7 @@ echo '
'.$backLinksMarkup.'
'; - } - - $Element['text'][1]['text'] []= array( - 'name' => 'li', - 'attributes' => array('id' => 'fn:'.$definitionId), - 'text' => "\n".$text."\n", - ); - } - - return $Element; - } - - # ~ - - protected function parseAttributeData($attributeString) - { - $Data = array(); - - $attributes = preg_split('/[ ]+/', $attributeString, - 1, PREG_SPLIT_NO_EMPTY); - - foreach ($attributes as $attribute) - { - if ($attribute[0] === '#') - { - $Data['id'] = substr($attribute, 1); - } - else # "." - { - $classes []= substr($attribute, 1); - } - } - - if (isset($classes)) - { - $Data['class'] = implode(' ', $classes); - } - - return $Data; - } - - # ~ - - protected function processTag($elementMarkup) # recursive - { - # http://stackoverflow.com/q/1148928/200145 - libxml_use_internal_errors(true); - - $DOMDocument = new DOMDocument; - - # http://stackoverflow.com/q/11309194/200145 - $elementMarkup = mb_convert_encoding($elementMarkup, 'HTML-ENTITIES', 'UTF-8'); - - # http://stackoverflow.com/q/4879946/200145 - $DOMDocument->loadHTML($elementMarkup); - $DOMDocument->removeChild($DOMDocument->doctype); - $DOMDocument->replaceChild($DOMDocument->firstChild->firstChild->firstChild, $DOMDocument->firstChild); - - $elementText = ''; - - if ($DOMDocument->documentElement->getAttribute('markdown') === '1') - { - foreach ($DOMDocument->documentElement->childNodes as $Node) - { - $elementText .= $DOMDocument->saveHTML($Node); - } - - $DOMDocument->documentElement->removeAttribute('markdown'); - - $elementText = "\n".$this->text($elementText)."\n"; - } - else - { - foreach ($DOMDocument->documentElement->childNodes as $Node) - { - $nodeMarkup = $DOMDocument->saveHTML($Node); - - if ($Node instanceof DOMElement and ! in_array($Node->nodeName, $this->textLevelElements)) - { - $elementText .= $this->processTag($nodeMarkup); - } - else - { - $elementText .= $nodeMarkup; - } - } - } - - # because we don't want for markup to get encoded - $DOMDocument->documentElement->nodeValue = 'placeholder\x1A'; - - $markup = $DOMDocument->saveHTML($DOMDocument->documentElement); - $markup = str_replace('placeholder\x1A', $elementText, $markup); - - return $markup; - } - - # ~ - - protected function sortFootnotes($A, $B) # callback - { - return $A['number'] - $B['number']; - } - - # - # Fields - # - - protected $regexAttribute = '(?:[#.][-\w]+[ ]*)'; -} diff --git a/bl-languages/en.json b/bl-languages/en.json index 2fbf334d..8229bb23 100644 --- a/bl-languages/en.json +++ b/bl-languages/en.json @@ -232,5 +232,6 @@ "scheduled": "Scheduled", "this-token-is-similar-to-a-password-it-should-not-be-shared": "This token is similar to a password, it should not be shared.", "congratulations-you-have-successfully-installed-your-bludit": "Congratulations you have successfully installed your **Bludit**.", - "this-theme-may-not-be-supported-by-this-version-of-bludit": "This theme may not be supported by this version of Bludit" -} \ No newline at end of file + "this-theme-may-not-be-supported-by-this-version-of-bludit": "This theme may not be supported by this version of Bludit", + "read-more": "Read more" +} diff --git a/bl-languages/ru_RU.json b/bl-languages/ru_RU.json index e192da82..64a6dc2c 100644 --- a/bl-languages/ru_RU.json +++ b/bl-languages/ru_RU.json @@ -231,5 +231,6 @@ "scheduled": "Запланировано", "this-token-is-similar-to-a-password-it-should-not-be-shared": "Этот токен похож на пароль, он не должен демонстрироваться.", "congratulations-you-have-successfully-installed-your-bludit": "Поздравляем! Вы успешно установили **Bludit**", - "this-theme-may-not-be-supported-by-this-version-of-bludit": "Эта тема может не поддерживаться текущей версией Bludit" + "this-theme-may-not-be-supported-by-this-version-of-bludit": "Эта тема может не поддерживаться текущей версией Bludit", + "read-more": "Далее" } diff --git a/bl-plugins/api/plugin.php b/bl-plugins/api/plugin.php index d721dcbe..9e1de637 100644 --- a/bl-plugins/api/plugin.php +++ b/bl-plugins/api/plugin.php @@ -168,14 +168,14 @@ class pluginAPI extends Plugin { $inputs = $_GET; break; case "PUT": - $inputs = file_get_contents("php://input"); + $inputs = ''; break; default: $inputs = json_encode(array()); break; } - // Try to get raw data + // Try to get raw/json data if (empty($inputs)) { $inputs = file_get_contents('php://input'); } @@ -183,6 +183,25 @@ class pluginAPI extends Plugin { return $this->cleanInputs($inputs); } + // Returns an array with key=>value + // If the content is JSON is parsed to array + private function cleanInputs($inputs) + { + $tmp = array(); + if (is_array($inputs)) { + foreach ($inputs as $key=>$value) { + $tmp[$key] = Sanitize::html($value); + } + } elseif (is_string($inputs)) { + $tmp = json_decode($inputs, true); + if (json_last_error()!==JSON_ERROR_NONE) { + $tmp = array(); + } + } + + return $tmp; + } + private function getEndpointParameters($URI) { // ENDPOINT Parameters @@ -202,23 +221,6 @@ class pluginAPI extends Plugin { return $parameters; } - private function cleanInputs($inputs) - { - $tmp = array(); - if (is_array($inputs)) { - foreach ($inputs as $key=>$value) { - $tmp[$key] = Sanitize::html($value); - } - } elseif(is_string($inputs)) { - $tmp = json_decode($inputs, true); - if (json_last_error()!==JSON_ERROR_NONE) { - $tmp = array(); - } - } - - return $tmp; - } - private function response($code=200, $message='OK', $data=array()) { header('HTTP/1.1 '.$code.' '.$message); diff --git a/bl-plugins/categories/languages/ru_RU.json b/bl-plugins/categories/languages/ru_RU.json new file mode 100644 index 00000000..60be6574 --- /dev/null +++ b/bl-plugins/categories/languages/ru_RU.json @@ -0,0 +1,8 @@ +{ + "plugin-data": + { + "name": "Categories", + "description": "Показывает все категории на боковой панели." + }, + "hide-categories-without-content": "Скрывать пустые категории" +} diff --git a/bl-plugins/disqus/languages/en.json b/bl-plugins/disqus/languages/en.json index ff728f5a..b4b6f9af 100644 --- a/bl-plugins/disqus/languages/en.json +++ b/bl-plugins/disqus/languages/en.json @@ -4,5 +4,7 @@ "name": "Disqus", "description": "Disqus is a comment hosting service for web sites.