diff --git a/system/admin/admin.php b/system/admin/admin.php
index 02a763b..f1c58d7 100644
--- a/system/admin/admin.php
+++ b/system/admin/admin.php
@@ -61,30 +61,21 @@ function edit_post($title, $tag, $url, $content, $oldfile, $destination = null)
$t = str_replace('-','',$dt);
$time = new DateTime($t);
$timestamp= $time->format("Y-m-d");
+
// The post date
$postdate = strtotime($timestamp);
+
// The post URL
$posturl = site_url().date('Y/m', $postdate).'/'.$post_url;
- if($destination == 'admin/posts') {
- $redirect = site_url() . 'admin/posts';
- header("Location: $redirect");
- }
- else if($destination == 'admin/mine') {
- $redirect = site_url() . 'admin/mine';
- header("Location: $redirect");
- }
- elseif($destination == 'admin') {
- $redirect = site_url() . 'admin';
- header("Location: $redirect");
- }
- elseif ($destination == 'post') {
+ if ($destination == 'post') {
header("Location: $posturl");
}
else {
- $redirect = site_url();
+ $redirect = site_url() . $destination;
header("Location: $redirect");
}
+
}
}
@@ -115,15 +106,11 @@ function edit_page($title, $url, $content, $oldfile, $destination = null) {
$posturl = site_url() . $post_url;
- if($destination == 'admin') {
- $redirect = site_url() . 'admin';
- header("Location: $redirect");
- }
- elseif ($destination == 'post') {
+ if ($destination == 'post') {
header("Location: $posturl");
}
else {
- $redirect = site_url();
+ $redirect = site_url() . $destination;
header("Location: $redirect");
}
@@ -238,7 +225,7 @@ function edit_profile($title, $content, $user) {
mkdir($dir, 0777, true);
file_put_contents($filename, print_r($user_content, true));
}
- $redirect = site_url() . 'admin';
+ $redirect = site_url() . 'author/' . $user;
header("Location: $redirect");
}
@@ -273,6 +260,7 @@ function migrate($title, $time, $tags, $content, $url, $user, $source) {
mkdir($dir, 0777, true);
file_put_contents($dir . $filename, print_r($post_content, true));
}
+
$redirect = site_url() . 'admin/mine';
header("Location: $redirect");
}
diff --git a/system/includes/functions.php b/system/includes/functions.php
index b1b6a88..dde77e1 100644
--- a/system/includes/functions.php
+++ b/system/includes/functions.php
@@ -925,15 +925,33 @@ function menu(){
function get_menu() {
$posts = get_static_pages();
+ $req = $_SERVER['REQUEST_URI'];
if(!empty($posts)) {
krsort($posts);
- echo '
';
- echo '- ' .config('breadcrumb.home'). '
';
+ echo '';
+ if($req == site_path() . '/') {
+ echo '- ' .config('breadcrumb.home'). '
';
+ }
+ else {
+ echo '- ' .config('breadcrumb.home'). '
';
+ }
+
+ $i = 0;
+ $len = count($posts);
+
foreach($posts as $index => $v){
+ if ($i == $len - 1) {
+ $class = 'item last';
+ }
+ else {
+ $class = 'item';
+ }
+ $i++;
+
// Replaced string
$replaced = substr($v, 0, strrpos($v, '/')) . '/';
$base = str_replace($replaced,'',$v);
@@ -951,7 +969,13 @@ function get_menu() {
else {
$title = str_replace('-',' ', str_replace('.md','',$base));
}
- echo '- ' . ucwords($title) . '
';
+
+ if(strpos($req, str_replace('.md','',$base)) !== false){
+ echo '- ' . ucwords($title) . '
';
+ }
+ else {
+ echo '- ' . ucwords($title) . '
';
+ }
}
echo '
';
@@ -1288,23 +1312,18 @@ function generate_json($posts){
return json_encode($posts);
}
-// Return toolbar
-function toolbar() {
- $user = $_SESSION['user'];
- $role = user('role', $user);
-
echo << #outer-wrapper{ padding-top:30px;} @media all and (max-width: 550px) {#outer-wrapper{ padding-top:60px;}}
+
EOF;
echo '';
}
\ No newline at end of file
diff --git a/themes/clean/css/style.css b/themes/clean/css/style.css
index 74b4fd3..f5b2065 100644
--- a/themes/clean/css/style.css
+++ b/themes/clean/css/style.css
@@ -126,48 +126,9 @@ h6{
}
/*-------------------------
- Toolbar
+ Tab
--------------------------*/
-#toolbar {
- background: #666666;
- box-shadow: 0 5px 15px #000000;
- color: #CCCCCC;
- font-family: Georgia, sans-serif;
- left: 0;
- margin: 0 -20px;
- padding: 0 25px;
- position: fixed;
- right: 0;
- top: 0;
- z-index: 600;
- border: 0 none;
- font-size: 15px;
- text-align: left;
- vertical-align: baseline;
- min-height:30px;
-}
-
-#toolbar ul {
- margin:0;
- padding-top:5px;
- padding-bottom:5px;
- padding-left:30px;
- float:left;
-}
-
-#toolbar ul li, #toolbar ul li a {
- float: left;
- list-style: none outside none;
-}
-#toolbar a {
- color: #FFFFFF;
- font-size: 0.846em;
- text-decoration: none;
- border-radius: 10px;
- padding: 0 10px;
-}
-
.tab {
width:100%;
margin: 0.5em 0 0.5em 0;
@@ -188,7 +149,6 @@ h6{
font-family: 'Open Sans',sans-serif;
}
-
/*----------------------------
Content & Posts
-----------------------------*/
diff --git a/themes/default/css/style.css b/themes/default/css/style.css
index 83b07cc..8ceffc2 100644
--- a/themes/default/css/style.css
+++ b/themes/default/css/style.css
@@ -61,50 +61,6 @@ h5 {
h6 {
font-size: 12px;
}
-
-/*-------------------------
- Toolbar
---------------------------*/
-
-#toolbar {
- background: #666666;
- box-shadow: 0 5px 15px #000000;
- color: #CCCCCC;
- font-family: Georgia, sans-serif;
- left: 0;
- margin: 0 -20px;
- padding: 0 25px;
- position: fixed;
- right: 0;
- top: 0;
- z-index: 600;
- border: 0 none;
- font-size: 15px;
- text-align: left;
- vertical-align: baseline;
- min-height:30px;
-}
-
-#toolbar ul {
- margin:0;
- padding-top:5px;
- padding-bottom:5px;
- padding-left:30px;
- float:left;
-}
-
-#toolbar ul li, #toolbar ul li a {
- float: left;
- list-style: none outside none;
- margin:0;
-}
-#toolbar a {
- color: #FFFFFF;
- font-size: 0.846em;
- text-decoration: none;
- border-radius: 10px;
- padding: 0 10px;
-}
/*-------------------------
Layout
diff --git a/themes/default/css/toolbar.css b/themes/default/css/toolbar.css
new file mode 100644
index 0000000..c5563a4
--- /dev/null
+++ b/themes/default/css/toolbar.css
@@ -0,0 +1 @@
+body{ padding-top:30px;}#toolbar {background: #666666;box-shadow: 0 5px 15px #000000;color: #CCCCCC;font-family: Georgia, sans-serif;left: 0;margin: 0 -20px;padding: 0 25px;position: fixed;right: 0;top: 0;z-index: 600;border: 0 none;font-size: 15px;text-align: left;vertical-align: baseline;min-height:30px;}#toolbar ul {margin:0;padding-top:5px;padding-bottom:5px;padding-left:30px;float:left;}#toolbar ul li, #toolbar ul li a {float: left;list-style: none outside none;margin:0;}#toolbar a {color: #FFFFFF;font-size: 0.846em;text-decoration: none;border-radius: 10px;padding: 0 10px;} @media all and (max-width: 550px) {body{ padding-top:60px;}}
\ No newline at end of file