diff --git a/bl-kernel/abstract/dblist.class.php b/bl-kernel/abstract/dblist.class.php index 92513116..f1f86f47 100644 --- a/bl-kernel/abstract/dblist.class.php +++ b/bl-kernel/abstract/dblist.class.php @@ -26,13 +26,19 @@ class dbList extends dbJSON public function getList($key, $pageNumber, $amountOfItems) { - if( !isset($this->db[$key]) ) { + if (!isset($this->db[$key])) { Log::set(__METHOD__.LOG_SEP.'Error key does not exist '.$key); return false; } $list = $this->db[$key]['list']; + if ($amountOfItems==-1) { + // Invert keys to values, is necesary returns as key the key pages + $list = array_flip($list); + return $list; + } + // The first page number is 1, so the real is 0 $realPageNumber = $pageNumber - 1; diff --git a/bl-kernel/abstract/plugin.class.php b/bl-kernel/abstract/plugin.class.php index 95d4e14e..01671df1 100644 --- a/bl-kernel/abstract/plugin.class.php +++ b/bl-kernel/abstract/plugin.class.php @@ -181,6 +181,11 @@ class Plugin { return $this->getMetadata('website'); } + public function position() + { + return $this->getValue('position'); + } + public function version() { return $this->getMetadata('version'); @@ -220,7 +225,7 @@ class Plugin { } // Return TRUE if the installation success, otherwise FALSE. - public function install($position=0) + public function install($position=1) { if($this->installed()) { return false; diff --git a/bl-kernel/admin/views/pages.php b/bl-kernel/admin/views/pages.php index e4f422e6..1bad7730 100644 --- a/bl-kernel/admin/views/pages.php +++ b/bl-kernel/admin/views/pages.php @@ -51,7 +51,7 @@ echo ' } for($i=1; $i<=Paginator::amountOfPages(); $i++) { - echo '
  • '.$i.'
  • '; + echo '
  • '.$i.'
  • '; } // Show next page link diff --git a/bl-kernel/admin/views/settings-advanced.php b/bl-kernel/admin/views/settings-advanced.php index 481ae35b..654710c6 100644 --- a/bl-kernel/admin/views/settings-advanced.php +++ b/bl-kernel/admin/views/settings-advanced.php @@ -14,7 +14,7 @@ HTML::formOpen(array('class'=>'uk-form-horizontal')); HTML::formSelect(array( 'name'=>'itemsPerPage', 'label'=>$L->g('Items per page'), - 'options'=>array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8'), + 'options'=>array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8', '-1'=>'All pages'), 'selected'=>$Site->itemsPerPage(), 'class'=>'uk-width-1-3 uk-form-medium', 'tip'=>$L->g('Number of items to show per page') diff --git a/bl-kernel/boot/rules/60.plugins.php b/bl-kernel/boot/rules/60.plugins.php index 87e968fb..73ea21c6 100644 --- a/bl-kernel/boot/rules/60.plugins.php +++ b/bl-kernel/boot/rules/60.plugins.php @@ -102,6 +102,11 @@ function buildPlugins() } } } + + uasort($plugins['siteSidebar'], function ($a, $b) { + return $a->position()>$b->position(); + } + ); } } diff --git a/bl-kernel/boot/rules/69.pages.php b/bl-kernel/boot/rules/69.pages.php index 82f07b72..34bad64a 100644 --- a/bl-kernel/boot/rules/69.pages.php +++ b/bl-kernel/boot/rules/69.pages.php @@ -85,7 +85,7 @@ $pagesByParentByKey = array(PARENT=>array()); // ============================================================================ // Execute the scheduler -if( $dbPages->scheduler() ) { +if ($dbPages->scheduler()) { // Reindex tags reindexTags(); @@ -103,7 +103,7 @@ if( $dbPages->scheduler() ) { buildPagesByParent(true); // Set home page is the user defined one -if( $Site->homepage() && $Url->whereAmI()==='home' ) { +if ($Site->homepage() && $Url->whereAmI()==='home') { $pageKey = $Site->homepage(); if( $dbPages->exists($pageKey) ) { $Url->setSlug($pageKey); @@ -112,31 +112,28 @@ if( $Site->homepage() && $Url->whereAmI()==='home' ) { } // Build specific page -if( $Url->whereAmI()==='page' ) { +if ($Url->whereAmI()==='page') { buildThePage(); } // Build pages by tag -elseif( $Url->whereAmI()==='tag' ) { +elseif ($Url->whereAmI()==='tag') { buildPagesByTag(); } // Build pages by category -elseif( $Url->whereAmI()==='category' ) { +elseif ($Url->whereAmI()==='category') { buildPagesByCategory(); } // Build pages for the homepage -elseif( $Url->whereAmI()==='home' ) { +elseif ($Url->whereAmI()==='home') { buildPagesForHome(); } // Build pages for the admin area -elseif( $Url->whereAmI()==='admin' ) { +elseif ($Url->whereAmI()==='admin') { buildPagesForAdmin(); } // Set page 404 not found -if( $Url->notFound() ) { - $Url->setWhereAmI('page'); - $Url->setHttpCode(404); - +if ($Url->notFound()) { $page = $Page = buildPage('error'); if ($page===false) { $page = buildErrorPage(); diff --git a/bl-kernel/dbpages.class.php b/bl-kernel/dbpages.class.php index 7331497d..2018f3c5 100644 --- a/bl-kernel/dbpages.class.php +++ b/bl-kernel/dbpages.class.php @@ -319,7 +319,7 @@ class dbPages extends dbJSON // Remove Error page from the list unset($db['error']); - if($amountOfItems==-1) { + if ($amountOfItems==-1) { return $db; } diff --git a/bl-kernel/functions.php b/bl-kernel/functions.php index 3ee45ca8..e8b553a4 100644 --- a/bl-kernel/functions.php +++ b/bl-kernel/functions.php @@ -154,7 +154,7 @@ function buildPagesFor($for, $categoryKey=false, $tagKey=false) { } // There are not items, invalid tag, invalid category, out of range, etc... - if( $list===false ) { + if ($list===false) { $Url->setNotFound(); return false; } diff --git a/bl-kernel/url.class.php b/bl-kernel/url.class.php index d266fa63..a977d123 100644 --- a/bl-kernel/url.class.php +++ b/bl-kernel/url.class.php @@ -144,6 +144,7 @@ class Url public function setNotFound() { + $this->whereAmI = 'page'; $this->notFound = true; $this->httpCode = 404; $this->httpMessage = 'Not Found'; diff --git a/bl-themes/editorial/assets/css/bludit.css b/bl-themes/editorial/assets/css/bludit.css index 889c616e..2b4c1c30 100644 --- a/bl-themes/editorial/assets/css/bludit.css +++ b/bl-themes/editorial/assets/css/bludit.css @@ -30,7 +30,7 @@ div.plugin a { cursor: pointer; display: block; font-size: 1.1em; - padding: 0.625em 0; + padding: 0; } /* Plugin Tags