diff --git a/bl-kernel/admin/controllers/edit-content.php b/bl-kernel/admin/controllers/edit-content.php index 07baf355..a0e16354 100644 --- a/bl-kernel/admin/controllers/edit-content.php +++ b/bl-kernel/admin/controllers/edit-content.php @@ -35,6 +35,11 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { Alert::set( $Language->g('The changes have been saved') ); } } else { + // If the checkbox is not selected the form doesn't send the field + $_POST['noindex'] = isset($_POST['noindex'])?true:false; + $_POST['nofollow'] = isset($_POST['nofollow'])?true:false; + $_POST['noarchive'] = isset($_POST['noarchive'])?true:false; + $key = editPage($_POST); if ($key!==false) { Alert::set( $Language->g('The changes have been saved') ); diff --git a/bl-kernel/admin/controllers/new-content.php b/bl-kernel/admin/controllers/new-content.php index f4531771..104561f8 100644 --- a/bl-kernel/admin/controllers/new-content.php +++ b/bl-kernel/admin/controllers/new-content.php @@ -17,6 +17,11 @@ // ============================================================================ if ($_SERVER['REQUEST_METHOD'] == 'POST') { + // If the checkbox is not selected the form doesn't send the field + $_POST['noindex'] = isset($_POST['noindex'])?true:false; + $_POST['nofollow'] = isset($_POST['nofollow'])?true:false; + $_POST['noarchive'] = isset($_POST['noarchive'])?true:false; + createPage($_POST); Redirect::page('content'); } diff --git a/bl-kernel/admin/themes/booty/index.php b/bl-kernel/admin/themes/booty/index.php index efb429e8..4bcbcfe4 100644 --- a/bl-kernel/admin/themes/booty/index.php +++ b/bl-kernel/admin/themes/booty/index.php @@ -11,7 +11,7 @@ diff --git a/bl-kernel/admin/views/edit-content.php b/bl-kernel/admin/views/edit-content.php index 064dc82e..7c5e9aab 100644 --- a/bl-kernel/admin/views/edit-content.php +++ b/bl-kernel/admin/views/edit-content.php @@ -78,16 +78,9 @@ -
{{site-title}}
{{site-slogan}}
{{site-description}}
',
+ 'placeholder'=>''
+ ));
+
+ echo Bootstrap::formInputText(array(
+ 'name'=>'titleFormatPages',
+ 'label'=>'Pages',
+ 'value'=>$Site->titleFormatPages(),
+ 'class'=>'',
+ 'placeholder'=>'',
+ 'tip'=>'Variables allowed: {{page-title}}
{{page-description}}
{{site-title}}
{{site-slogan}}
{{site-description}}
',
+ 'placeholder'=>''
+ ));
+
+ echo Bootstrap::formInputText(array(
+ 'name'=>'titleFormatCategory',
+ 'label'=>'Category',
+ 'value'=>$Site->titleFormatCategory(),
+ 'class'=>'',
+ 'placeholder'=>'',
+ 'tip'=>'Variables allowed: {{category-name}}
{{site-title}}
{{site-slogan}}
{{site-description}}
',
+ 'placeholder'=>''
+ ));
+
+ echo Bootstrap::formInputText(array(
+ 'name'=>'titleFormatTag',
+ 'label'=>'Tag',
+ 'value'=>$Site->titleFormatTag(),
+ 'class'=>'',
+ 'placeholder'=>'',
+ 'tip'=>'Variables allowed: {{tag-name}}
{{site-title}}
{{site-slogan}}
{{site-description}}
',
+ 'placeholder'=>''
+ ));
+
echo Bootstrap::formTitle(array('title'=>$L->g('URL Filters')));
echo Bootstrap::formInputText(array(
diff --git a/bl-kernel/ajax/upload-files.php b/bl-kernel/ajax/upload-files.php
index a65ded6c..ee115a2a 100644
--- a/bl-kernel/ajax/upload-files.php
+++ b/bl-kernel/ajax/upload-files.php
@@ -10,6 +10,7 @@ foreach ($_FILES['bluditInputFiles']['name'] as $key=>$filename) {
// Move from temporary directory to uploads folder
rename($_FILES['bluditInputFiles']['tmp_name'][$key], PATH_UPLOADS.$nextFilename);
+ chmod(PATH_UPLOADS.$nextFilename, 0644);
// Generate Thumbnail
diff --git a/bl-kernel/dbpages.class.php b/bl-kernel/dbpages.class.php
index 54f9c88c..332ea459 100644
--- a/bl-kernel/dbpages.class.php
+++ b/bl-kernel/dbpages.class.php
@@ -443,6 +443,38 @@ class dbPages extends dbJSON
return ++$tmp;
}
+ // Returns the next page key of the current page key
+ public function nextPageKey($currentKey)
+ {
+ if ($this->db[$currentKey]['status']=='published') {
+ $keys = array_keys($this->db);
+ $position = array_search($currentKey, $keys) - 1;
+ if (isset($keys[$position])) {
+ $nextKey = $keys[$position];
+ if ($this->db[$nextKey]['status']=='published') {
+ return $nextKey;
+ }
+ }
+ }
+ return false;
+ }
+
+ // Returns the previous page key of the current page key
+ public function previousPageKey($currentKey)
+ {
+ if ($this->db[$currentKey]['status']=='published') {
+ $keys = array_keys($this->db);
+ $position = array_search($currentKey, $keys) + 1;
+ if (isset($keys[$position])) {
+ $prevKey = $keys[$position];
+ if ($this->db[$prevKey]['status']=='published') {
+ return $prevKey;
+ }
+ }
+ }
+ return false;
+ }
+
// Returns an array with a list of key of pages, FALSE if out of range
// The database is sorted by date or by position
// (int) $pageNumber, the page number
diff --git a/bl-kernel/dbsite.class.php b/bl-kernel/dbsite.class.php
index a0d0ced5..e95c99f7 100644
--- a/bl-kernel/dbsite.class.php
+++ b/bl-kernel/dbsite.class.php
@@ -34,7 +34,11 @@ class dbSite extends dbJSON
'linkedin'=> array('inFile'=>false, 'value'=>''),
'orderBy'=> array('inFile'=>false, 'value'=>'date'), // date or position
'extremeFriendly'=> array('inFile'=>false, 'value'=>true),
- 'autosaveInterval'=> array('inFile'=>false, 'value'=>2)
+ 'autosaveInterval'=> array('inFile'=>false, 'value'=>2),
+ 'titleFormatHomepage'=> array('inFile'=>false, 'value'=>'{{site-slogan}} | {{site-title}}'),
+ 'titleFormatPages'=> array('inFile'=>false, 'value'=>'{{page-title}} | {{site-title}}'),
+ 'titleFormatCategory'=> array('inFile'=>false, 'value'=>'{{category-name}} | {{site-title}}'),
+ 'titleFormatTag'=> array('inFile'=>false, 'value'=>'{{tag-name}} | {{site-title}}')
);
function __construct()
@@ -209,6 +213,26 @@ class dbSite extends dbJSON
return $this->getField('footer');
}
+ public function titleFormatPages()
+ {
+ return $this->getField('titleFormatPages');
+ }
+
+ public function titleFormatHomepage()
+ {
+ return $this->getField('titleFormatHomepage');
+ }
+
+ public function titleFormatCategory()
+ {
+ return $this->getField('titleFormatCategory');
+ }
+
+ public function titleFormatTag()
+ {
+ return $this->getField('titleFormatTag');
+ }
+
// Returns the full domain and base url
// For example, https://www.domain.com/bludit
public function url()
@@ -216,6 +240,8 @@ class dbSite extends dbJSON
return $this->getField('url');
}
+
+
// Returns the protocol and the domain, without the base url
// For example, http://www.domain.com
public function domain()
diff --git a/bl-kernel/functions.php b/bl-kernel/functions.php
index 05aeac03..675bc752 100644
--- a/bl-kernel/functions.php
+++ b/bl-kernel/functions.php
@@ -61,6 +61,10 @@ function buildPage($key) {
// Get the keys of the child
$page->setField('childrenKeys', $dbPages->getChildren($key));
+ // Set previous and next page key
+ $page->setField('previousKey', $dbPages->previousPageKey($key));
+ $page->setField('nextKey', $dbPages->nextPageKey($key));
+
return $page;
}
diff --git a/bl-kernel/helpers/theme.class.php b/bl-kernel/helpers/theme.class.php
index d81eed07..5b989421 100644
--- a/bl-kernel/helpers/theme.class.php
+++ b/bl-kernel/helpers/theme.class.php
@@ -53,41 +53,52 @@ class Theme {
return DOMAIN_ADMIN;
}
- // Return the metatag