diff --git a/kernel/admin/themes/default/css/default.css b/kernel/admin/themes/default/css/default.css
index bc954195..5c48f5ce 100644
--- a/kernel/admin/themes/default/css/default.css
+++ b/kernel/admin/themes/default/css/default.css
@@ -26,9 +26,13 @@
background: #1F5FC4;
}
-.uk-form legend {
+legend {
width: 70% !important;
- margin-top: 40px;
+ margin-top: 40px !important;
+}
+
+legend.first-child {
+ margin-top: 0px !important;
}
.uk-navbar-nav > li > a {
diff --git a/kernel/admin/themes/default/init.php b/kernel/admin/themes/default/init.php
index 011c63db..945c3470 100644
--- a/kernel/admin/themes/default/init.php
+++ b/kernel/admin/themes/default/init.php
@@ -117,7 +117,9 @@ class HTML {
public static function legend($args)
{
- $html = '';
+ $class = empty($args['class']) ? '' : 'class="'.$args['class'].'"';
+
+ $html = '';
echo $html;
}
diff --git a/kernel/admin/views/edit-user.php b/kernel/admin/views/edit-user.php
index eeaeeac3..5b06f05b 100644
--- a/kernel/admin/views/edit-user.php
+++ b/kernel/admin/views/edit-user.php
@@ -19,7 +19,7 @@ HTML::formOpen(array('id'=>'edit-user-profile-form','class'=>'uk-form-horizontal
'value'=>$_user['username']
));
- HTML::legend(array('value'=>$L->g('Profile')));
+ HTML::legend(array('value'=>$L->g('Profile'), 'class'=>'first-child'));
HTML::formInputText(array(
'name'=>'usernameDisable',
diff --git a/kernel/admin/views/plugins.php b/kernel/admin/views/plugins.php
index 438414ea..9f200a38 100644
--- a/kernel/admin/views/plugins.php
+++ b/kernel/admin/views/plugins.php
@@ -15,38 +15,38 @@ echo '
';
- foreach($plugins['all'] as $Plugin)
- {
- echo '
-
-
- '.$Plugin->name().'
-
+ |
+ '.$Plugin->description().' |
+ '.$Plugin->version().' |
+ '.$Plugin->author().' |
+ ';
+
+ echo '
';
+}
echo '
-';
+';
\ No newline at end of file
diff --git a/kernel/admin/views/settings-advanced.php b/kernel/admin/views/settings-advanced.php
index dd583ee6..edf5fcdd 100644
--- a/kernel/admin/views/settings-advanced.php
+++ b/kernel/admin/views/settings-advanced.php
@@ -9,7 +9,7 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
'value'=>$Security->getTokenCSRF()
));
- HTML::legend(array('value'=>$L->g('General')));
+ HTML::legend(array('value'=>$L->g('General'), 'class'=>'first-child'));
HTML::formSelect(array(
'name'=>'postsperpage',
diff --git a/kernel/admin/views/settings-general.php b/kernel/admin/views/settings-general.php
index 27e2b61b..9291cc8d 100644
--- a/kernel/admin/views/settings-general.php
+++ b/kernel/admin/views/settings-general.php
@@ -10,7 +10,7 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
'value'=>$Security->getTokenCSRF()
));
- HTML::legend(array('value'=>$L->g('Site')));
+ HTML::legend(array('value'=>$L->g('Site information'), 'class'=>'first-child'));
HTML::formInputText(array(
'name'=>'title',
diff --git a/kernel/admin/views/settings-regional.php b/kernel/admin/views/settings-regional.php
index aee8f67a..635493ec 100644
--- a/kernel/admin/views/settings-regional.php
+++ b/kernel/admin/views/settings-regional.php
@@ -9,6 +9,8 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
'value'=>$Security->getTokenCSRF()
));
+ HTML::legend(array('value'=>$L->g('General'), 'class'=>'first-child'));
+
HTML::formSelect(array(
'name'=>'language',
'label'=>$L->g('Language'),
@@ -35,6 +37,8 @@ HTML::formOpen(array('class'=>'uk-form-horizontal'));
'tip'=>$L->g('you-can-use-this-field-to-define-a-set-off')
));
+ HTML::legend(array('value'=>$L->g('Date and time formats')));
+
HTML::formInputText(array(
'name'=>'dateFormat',
'label'=>$L->g('Date format'),
diff --git a/kernel/admin/views/themes.php b/kernel/admin/views/themes.php
index bed735e7..0f804b6c 100644
--- a/kernel/admin/views/themes.php
+++ b/kernel/admin/views/themes.php
@@ -15,31 +15,31 @@ echo '
';
- foreach($themes as $theme)
- {
- echo '
-
-
- '.$theme['name'].'
-
- ';
+foreach($themes as $theme)
+{
+ echo '
+
+
+ '.$theme['name'].'
+
- |
- '.$theme['description'].' |
- '.$theme['version'].' |
- '.$theme['author'].' |
- ';
-
- echo ' ';
+ if($theme['dirname']!=$Site->theme()) {
+ echo ' '.$L->g('Activate').'';
}
+ echo '
+
+ |
+ '.$theme['description'].' |
+ '.$theme['version'].' |
+ '.$theme['author'].' |
+ ';
+
+ echo '
';
+}
+
echo '
-';
+';
\ No newline at end of file
diff --git a/kernel/boot/init.php b/kernel/boot/init.php
index 7c537758..030db91f 100644
--- a/kernel/boot/init.php
+++ b/kernel/boot/init.php
@@ -194,11 +194,10 @@ define('PATH_THEME_JS', PATH_THEME.'js'.DS);
define('PATH_THEME_IMG', PATH_THEME.'img'.DS);
define('PATH_THEME_LANG', PATH_THEME.'languages'.DS);
-// Objects with dependency
+// --- Objects with dependency ---
$Language = new dbLanguage( $Site->locale() );
$Login = new Login( $dbUsers );
-
$Url->checkFilters( $Site->uriFilters() );
-// Objects shortcuts
+// --- Objects shortcuts ---
$L = $Language;
diff --git a/kernel/dbsite.class.php b/kernel/dbsite.class.php
index d9c167da..41ef8d1f 100644
--- a/kernel/dbsite.class.php
+++ b/kernel/dbsite.class.php
@@ -152,6 +152,22 @@ class dbSite extends dbJSON
public function domain()
{
+ // If the URL field is not set, try detect the domain.
+ if(Text::isEmpty( $this->url() ))
+ {
+ if(!empty($_SERVER['HTTPS'])) {
+ $protocol = 'https://';
+ }
+ else {
+ $protocol = 'http://';
+ }
+
+ $domain = $_SERVER['HTTP_HOST'];
+
+ return $protocol.$domain.HTML_PATH_ROOT;
+ }
+
+ // Parse the domain from the field URL.
$parse = parse_url($this->url());
$domain = $parse['scheme']."://".$parse['host'];
diff --git a/kernel/helpers/text.class.php b/kernel/helpers/text.class.php
index 9b445c21..ad3d7999 100644
--- a/kernel/helpers/text.class.php
+++ b/kernel/helpers/text.class.php
@@ -165,11 +165,13 @@ class Text {
return ucfirst($string);
}
- // Find position of first occurrence of substring in a string.
- public static function strpos($string, $substring)
+ // Find position of first occurrence of substring in a string otherwise returns FALSE.
+ public static function stringPosition($string, $substring)
{
- if(MB_STRING)
+ if(MB_STRING) {
return mb_strpos($string, $substring, 0, 'UTF-8');
+ }
+
return strpos($string, $substring);
}
diff --git a/kernel/url.class.php b/kernel/url.class.php
index 1071134a..e62661f5 100644
--- a/kernel/url.class.php
+++ b/kernel/url.class.php
@@ -32,7 +32,7 @@ class Url
$this->filters = array();
}
- // Filters may be changed for different languages
+ // Filters change for different languages
// Ex (Spanish): Array('post'=>'/publicacion/', 'tag'=>'/etiqueta/', ....)
// Ex (English): Array('post'=>'/post/', 'tag'=>'/tag/', ....)
public function checkFilters($filters)
@@ -41,35 +41,33 @@ class Url
$adminFilter['admin'] = $filters['admin'];
unset($filters['admin']);
- // Sort by filter length
+ // Sort filters by length
uasort($filters, array($this, 'sortByLength'));
// Push the admin filter first
$filters = $adminFilter + $filters;
-
$this->filters = $filters;
- foreach($filters as $filterKey=>$filter)
+ foreach($filters as $filterName=>$filterURI)
{
- // getSlugAfterFilter() set the variable $this->slug
- $slug = $this->getSlugAfterFilter($filter);
+ // $slug will be FALSE if the filter is not included in the URI.
+ $slug = $this->getSlugAfterFilter($filterURI);
- // If the filter is included in the URI.
if($slug!==false)
{
- // Where Am I is the filter now, because is in the URI.
- $this->whereAmI = $filterKey;
+ $this->slug = $slug;
+ $this->whereAmI = $filterName;
- // If the slug empty
- if(empty($slug))
+ // If the slug is empty
+ if(Text::isEmpty($slug))
{
- if($filter==='/')
+ if($filterURI==='/')
{
$this->whereAmI = 'home';
break;
}
- if($filter===$adminFilter['admin'])
+ if($filterURI===$adminFilter['admin'])
{
$this->whereAmI = 'admin';
$this->slug = 'dashboard';
@@ -140,43 +138,50 @@ class Url
$this->notFound = $error;
}
- public function getDomain()
- {
- if(!empty($_SERVER['HTTPS'])) {
- $protocol = 'https://';
- }
- else {
- $protocol = 'http://';
- }
-
- $domain = $_SERVER['HTTP_HOST'];
-
- return $protocol.$domain.HTML_PATH_ROOT;
- }
-
- // Return the slug after the $filter
+ // Returns the slug after the $filter, the slug could be an empty string
// If the filter is not included in the uri, returns FALSE
- // If the filter is included in the uri and the slug is not empty, returns the slug
// ex: http://domain.com/cms/$filter/slug123 => slug123
+ // ex: http://domain.com/cms/$filter/name/lastname => name/lastname
+ // ex: http://domain.com/cms/$filter/ => empty string
+ // ex: http://domain.com/cms/$filter => empty string
private function getSlugAfterFilter($filter)
{
- if($filter=='/') {
- $filter = HTML_PATH_ROOT;
- }
+ // Remove both slash from the filter
+ $filter = trim($filter, '/');
+
+ // Add to the filter the root directory
+ $filter = HTML_PATH_ROOT.$filter;
// Check if the filter is in the uri.
- $position = Text::strpos($this->uri, $filter);
+ $position = Text::stringPosition($this->uri, $filter);
+
+ // If the position is FALSE, the filter isn't in the URI.
if($position===false) {
return false;
}
+ // Start position to cut
$start = $position + Text::length($filter);
+
+ // End position to cut
$end = $this->uriStrlen;
+ // Get the slug from the URI
$slug = Text::cut($this->uri, $start, $end);
- $this->slug = trim($slug, '/');
- return $slug;
+ if(Text::isEmpty($slug)) {
+ return '';
+ }
+
+ if($slug[0]=='/') {
+ return ltrim($slug, '/');
+ }
+
+ if($filter==HTML_PATH_ROOT) {
+ return $slug;
+ }
+
+ return false;
}
private function sortByLength($a, $b)
@@ -184,4 +189,4 @@ class Url
return strlen($b)-strlen($a);
}
-}
+}
\ No newline at end of file
diff --git a/languages/en_US.json b/languages/en_US.json
index 421ec689..3887ffa1 100644
--- a/languages/en_US.json
+++ b/languages/en_US.json
@@ -213,5 +213,10 @@
"the-about-page-is-very-important": "The about page is an important and powerful tool for potential clients and partners. For those who wonder who is behind the website, your About page is the first source of information.",
"change-this-pages-content-on-the-admin-panel": "Change this page's content on the admin panel, manage, pages and click on the about page.",
"about-your-site-or-yourself": "About your site or yourself",
- "welcome-to-bludit": "Welcome to Bludit"
+ "welcome-to-bludit": "Welcome to Bludit",
+
+ "site-information": "Site information",
+ "date-and-time-formats": "Date and time formats",
+ "activate": "Activate",
+ "deactivate": "Deactivate"
}
\ No newline at end of file
diff --git a/themes/pure/languages/en_US.json b/themes/pure/languages/en_US.json
index 8d996c17..788d1b4b 100644
--- a/themes/pure/languages/en_US.json
+++ b/themes/pure/languages/en_US.json
@@ -2,7 +2,7 @@
"theme-data":
{
"name": "Pure",
- "description": "Simple and clean theme, based on the framework Pure.css.",
+ "description": "Simple and clean, based on the framework Pure.css.",
"author": "Bludit",
"email": "",
"website": "https://github.com/dignajar/bludit-themes",