From 82a9be8082e6fc8462d4a4fa3126da0a5a5ca25b Mon Sep 17 00:00:00 2001 From: dignajar Date: Mon, 23 May 2016 23:32:06 -0300 Subject: [PATCH 1/3] CSS updates --- .../admin/themes/default/css/default.css | 1 + .../admin/themes/default/css/installer.css | 13 ++++++--- bl-kernel/admin/themes/default/css/login.css | 7 +++-- bl-kernel/admin/themes/default/index.php | 28 +++++++++---------- bl-themes/log/assets/css/bludit.css | 8 ++++++ bl-themes/log/php/page.php | 2 +- 6 files changed, 36 insertions(+), 23 deletions(-) diff --git a/bl-kernel/admin/themes/default/css/default.css b/bl-kernel/admin/themes/default/css/default.css index b45dddbe..ca64e5c6 100644 --- a/bl-kernel/admin/themes/default/css/default.css +++ b/bl-kernel/admin/themes/default/css/default.css @@ -153,6 +153,7 @@ a { .uk-panel-box { background: #F9F9F9 !important; + border: 0; } .uk-container { diff --git a/bl-kernel/admin/themes/default/css/installer.css b/bl-kernel/admin/themes/default/css/installer.css index da50e252..53fc7315 100644 --- a/bl-kernel/admin/themes/default/css/installer.css +++ b/bl-kernel/admin/themes/default/css/installer.css @@ -1,6 +1,10 @@ /* ----------- UIKIT HACKs FOR BLUDIT ----------- */ html { - background: #f1f1f1; + background: #F7F7F7; +} + +.uk-form * { + border-radius: 2px !important; } .uk-button-primary { @@ -13,8 +17,9 @@ html { input[type="text"], input[type="password"] { - border-color: #FFF !important; - background: #FFF; + border-color: #EBEBEB !important; + border-radius: 2px !important; + color: #333; } input:disabled { @@ -22,7 +27,7 @@ input:disabled { } .uk-vertical-align-middle { - margin-top: -100px; + margin-top: -150px; } .uk-panel { diff --git a/bl-kernel/admin/themes/default/css/login.css b/bl-kernel/admin/themes/default/css/login.css index 41317570..8793407f 100644 --- a/bl-kernel/admin/themes/default/css/login.css +++ b/bl-kernel/admin/themes/default/css/login.css @@ -1,6 +1,6 @@ /* ----------- UIKIT HACKs FOR BLUDIT ----------- */ html { - background: #f3f3f3; + background: #F7F7F7; } * { @@ -17,8 +17,9 @@ html { input[type="text"], input[type="password"] { - border-color: #FFF !important; + border-color: #EBEBEB !important; border-radius: 2px !important; + color: #333; } .uk-alert { @@ -49,7 +50,7 @@ div.login-form > h2 { } a.login-email { - border: 1px solid #eeeeee; + border: 0; color: #777; display: block; margin: 20px 0; diff --git a/bl-kernel/admin/themes/default/index.php b/bl-kernel/admin/themes/default/index.php index 20094594..a6b604a5 100644 --- a/bl-kernel/admin/themes/default/index.php +++ b/bl-kernel/admin/themes/default/index.php @@ -1,7 +1,6 @@ - + - @@ -9,23 +8,22 @@ <?php echo $layout['title'] ?> - + - - - - - - - - + + + + + + + - - - - + + + + diff --git a/bl-themes/log/assets/css/bludit.css b/bl-themes/log/assets/css/bludit.css index e1515592..960e7832 100644 --- a/bl-themes/log/assets/css/bludit.css +++ b/bl-themes/log/assets/css/bludit.css @@ -57,6 +57,10 @@ header p { border: 0; } +.post a { + color: #2672ec; +} + .post > header { border-bottom-color: #F7F7F7; margin-bottom: 1.3em; @@ -77,6 +81,10 @@ header p { margin-bottom: 5px; } +.post > header .title h1 a { + color: #3c3b3b; +} + .post > footer .stats { margin: 0; } diff --git a/bl-themes/log/php/page.php b/bl-themes/log/php/page.php index 3b7bc136..f1ef6e82 100644 --- a/bl-themes/log/php/page.php +++ b/bl-themes/log/php/page.php @@ -6,7 +6,7 @@
-

title() ?>

+

title() ?>

description() ?>

From 3c2ecccb7410d5ef5253077b6baaad9ba899a1e1 Mon Sep 17 00:00:00 2001 From: dignajar Date: Thu, 26 May 2016 18:48:41 -0300 Subject: [PATCH 2/3] Fixes, upload images --- install.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install.php b/install.php index 0dc79f84..96030131 100644 --- a/install.php +++ b/install.php @@ -26,6 +26,7 @@ define('PATH_LANGUAGES', PATH_ROOT.'bl-languages'.DS); define('PATH_POSTS', PATH_CONTENT.'posts'.DS); define('PATH_UPLOADS', PATH_CONTENT.'uploads'.DS); +define('PATH_TMP', PATH_CONTENT.'tmp'.DS); define('PATH_PAGES', PATH_CONTENT.'pages'.DS); define('PATH_DATABASES', PATH_CONTENT.'databases'.DS); define('PATH_PLUGINS_DATABASES',PATH_CONTENT.'databases'.DS.'plugins'.DS); @@ -308,6 +309,12 @@ function install($adminPassword, $email, $timezone) error_log($errorText, 0); } + if(!mkdir(PATH_TMP, $dirpermissions, true)) + { + $errorText = 'Error when trying to created the directory=>'.PATH_TMP; + error_log($errorText, 0); + } + if(!mkdir(PATH_UPLOADS_THUMBNAILS, $dirpermissions, true)) { $errorText = 'Error when trying to created the directory=>'.PATH_UPLOADS_THUMBNAILS; From a77e22d93b11a18cac9b58a2faba6941ea84e054 Mon Sep 17 00:00:00 2001 From: dignajar Date: Sat, 28 May 2016 00:18:13 -0300 Subject: [PATCH 3/3] Improves on pages --- .../admin/themes/default/css/default.css | 5 ++ bl-kernel/admin/views/manage-pages.php | 36 +++++---- bl-kernel/boot/rules/71.pages.php | 73 +++++++++++-------- bl-themes/log/assets/css/bludit.css | 24 ++++++ bl-themes/log/index.php | 2 +- bl-themes/log/php/post.php | 1 - 6 files changed, 94 insertions(+), 47 deletions(-) diff --git a/bl-kernel/admin/themes/default/css/default.css b/bl-kernel/admin/themes/default/css/default.css index ca64e5c6..ecef12a7 100644 --- a/bl-kernel/admin/themes/default/css/default.css +++ b/bl-kernel/admin/themes/default/css/default.css @@ -140,6 +140,11 @@ legend.first-child { padding: 15px 10px; } +.uk-table td.children { + padding: 15px 10px 15px 25px; +} + + .uk-badge { margin-right: 5px !important; font-size: 0.9em; diff --git a/bl-kernel/admin/views/manage-pages.php b/bl-kernel/admin/views/manage-pages.php index b75b7b67..0d3f809b 100644 --- a/bl-kernel/admin/views/manage-pages.php +++ b/bl-kernel/admin/views/manage-pages.php @@ -7,7 +7,6 @@ echo ' '.$L->g('Title').' - '.$L->g('Parent').' '.$L->g('Position').' '.$L->g('Friendly URL').' @@ -15,26 +14,33 @@ echo ' '; + unset($pagesParents[NO_PARENT_CHAR]); + foreach($pagesParents as $parentKey=>$pageList) { + // Parent page + $Page = $pages[$parentKey]; + + $friendlyURL = Text::isEmpty($Url->filters('page')) ? '/'.$Page->key() : '/'.$Url->filters('page').'/'.$Page->key(); + + echo ''; + echo ''; + echo ''.($Page->published()?'':''.$Language->g('Draft').' ').($Page->title()?$Page->title():''.$Language->g('Empty title').' ').''; + echo ''; + echo ''.$Page->position().''; + echo ''.$friendlyURL.''; + echo ''; + + // Children foreach($pageList as $Page) { - if($parentKey!==NO_PARENT_CHAR) { - $parentTitle = $pages[$Page->parentKey()]->title(); - } - else { - $parentTitle = ''; - } - - - - echo ''; - echo ''.($Page->parentKey()?'- ':'').''.($Page->published()?'':''.$Language->g('Draft').' ').($Page->title()?$Page->title():''.$Language->g('Empty title').' ').''; - echo ''.$parentTitle.''; - echo ''.$Page->position().''; - $friendlyURL = Text::isEmpty($Url->filters('page')) ? '/'.$Page->key() : '/'.$Url->filters('page').'/'.$Page->key(); + echo ''; + echo ''; + echo ''.($Page->published()?'':''.$Language->g('Draft').' ').($Page->title()?$Page->title():''.$Language->g('Empty title').' ').''; + echo ''; + echo ''.$Page->position().''; echo ''.$friendlyURL.''; echo ''; } diff --git a/bl-kernel/boot/rules/71.pages.php b/bl-kernel/boot/rules/71.pages.php index 361c4c0c..1a76a231 100644 --- a/bl-kernel/boot/rules/71.pages.php +++ b/bl-kernel/boot/rules/71.pages.php @@ -7,14 +7,18 @@ // Array with all pages. $pages = array(); +$pagesPublished = array(); + // Array with all pages, order by parent. $pagesParents = array(NO_PARENT_CHAR=>array()); +$pagesParentsPublished = array(); + // ============================================================================ // Functions // ============================================================================ -function sortPages($a, $b) +function sortPages2($a, $b) { if ($a->position() == $b->position()) { return 0; @@ -23,6 +27,15 @@ function sortPages($a, $b) return ($a->position() < $b->position()) ? -1 : 1; } +function sortPages($a, $b) +{ + if ($a['position'] == $b['position']) { + return 0; + } + + return ($a['position'] < $b['position']) ? -1 : 1; +} + function buildPage($key) { global $dbPages; @@ -81,63 +94,62 @@ function buildPage($key) function buildAllPages() { global $pagesParents; + global $pagesParentsPublished; + global $pagesPublished; global $dbPages; + // Get the page list $list = $dbPages->getDB(); // Clean pages array. $pages = array(); + // Remove the error page unset($list['error']); + // Sorte pages + uasort($list, 'sortPages'); + foreach($list as $key=>$db) { $Page = buildPage($key); if($Page!==false) { - // --- Order pages by parents --- + // Filter pages, with and without parent - // Generate all posible parents. - if( $Page->parentKey()===false ) - { + // If the page doesn't have a father, it's a parent page :P + if( $Page->parentKey()===false ) { // Add the parent key in the dbPages $dbPages->addParentKey($Page->key()); + // Add the page as a parent page in the array $pagesParents[NO_PARENT_CHAR][$Page->key()] = $Page; + + // If the page is published + if($Page->published()) { + $pagesParentsPublished[NO_PARENT_CHAR][$Page->key()] = $Page; + } } - else - { + else { $pagesParents[$Page->parentKey()][$Page->key()] = $Page; + + // If the page is published + if($Page->published()) { + $pagesParentsPublished[$Page->parentKey()][$Page->key()] = $Page; + } } - // --- All pages in 1 array --- + // All pages in one array $pages[$Page->key()] = $Page; + + // If the page is published + if($Page->published()) { + $pagesPublished[$Page->parentKey()][$Page->key()] = $Page; + } } } - // --- SORT PAGES --- - - // Sort parents. - $parents = $pagesParents[NO_PARENT_CHAR]; - uasort($parents, 'sortPages'); - - // Sort children. - unset($pagesParents[NO_PARENT_CHAR]); - $children = $pagesParents; - $tmpPageWithParent = array(); - foreach($children as $parentKey=>$childrenPages) - { - // If the child doesn't have a valid parent, then doesn't included them. - if(isset($pages[$parentKey])) - { - $tmpPageWithParent[$parentKey] = $childrenPages; - uasort($tmpPageWithParent[$parentKey], 'sortPages'); - } - } - - $pagesParents = array(NO_PARENT_CHAR=>$parents) + $tmpPageWithParent; - return $pages; } @@ -193,3 +205,4 @@ if($Url->notFound()) // Build all pages $pages = buildAllPages(); + diff --git a/bl-themes/log/assets/css/bludit.css b/bl-themes/log/assets/css/bludit.css index 960e7832..ffb5f1e4 100644 --- a/bl-themes/log/assets/css/bludit.css +++ b/bl-themes/log/assets/css/bludit.css @@ -16,6 +16,30 @@ h1, h2, h3, h4, h5, h6 { letter-spacing: 0; } +h1 { + font-size: 1.5em; +} + +h2 { + font-size: 1.4em; +} + +h3 { + font-size: 1.3em; +} + +h4 { + font-size: 1.2em; +} + +h5 { + font-size: 1.1em; +} + +h6 { + font-size: 1em; +} + #header { background-color: #f7f7f7; border-bottom: 0; diff --git a/bl-themes/log/index.php b/bl-themes/log/index.php index bfad24b7..d9f1999f 100644 --- a/bl-themes/log/index.php +++ b/bl-themes/log/index.php @@ -13,7 +13,7 @@