diff --git a/main/blog/blog_admin.php b/main/blog/blog_admin.php
index ba35fbd1af..49b688a69f 100644
--- a/main/blog/blog_admin.php
+++ b/main/blog/blog_admin.php
@@ -59,12 +59,25 @@ if (api_is_allowed_to_edit())
// showing the header if we are not in the learning path, if we are in
// the learning path, we do not include the banner so we have to explicitly
// include the stylesheet, which is normally done in the header
- if ($_GET['origin'] != 'learnpath')
- {
- Display::display_header($nameTools,'Blogs');
- }
- else
- {
+ if ($_GET['origin'] != 'learnpath') {
+ $interbreadcrumb[]= array (
+ 'url' => 'blog_admin.php?',
+ 'name' => $nameTools
+ );
+ $my_url='';
+ if (isset($_GET['action']) && $_GET['action']=='add') {
+ $current_section=get_lang('AddBlog');
+ $my_url='action=add';
+ } elseif (isset($_GET['action']) && $_GET['action']=='edit') {
+ $current_section=get_lang('EditBlog');
+ $my_url='action=edit&blog_id='.Security::remove_XSS($_GET['blog_id']);
+ }
+ $interbreadcrumb[]= array (
+ 'url' => 'blog_admin.php?'.$my_url,
+ 'name' => $current_section
+ );
+ Display::display_header('');
+ } else {
echo "";
}
/*
@@ -107,32 +120,35 @@ if (api_is_allowed_to_edit())
//api_introductionsection(TOOL_BLOG);
- if (isset($_GET['action']) && $_GET['action'] == 'add')
- {
+ if (isset($_GET['action']) && $_GET['action'] == 'add') {
// we show the form if
// 1. no post data
// 2. there is post data and one of the three form elements is empty
- if (!$_POST OR (!empty($_POST) AND (empty($_POST['Submit']) OR empty($_POST['blog_name']) OR empty($_POST['blog_subtitle']))))
- {
+ if (!$_POST OR (!empty($_POST) AND (empty($_POST['Submit']) OR empty($_POST['blog_name']) OR empty($_POST['blog_subtitle'])))) {
// if there is post data there is certainly an error in the form
- if ($_POST)
- {
+ /*if ($_POST){
+ Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'));
+ }*/
+
+ if (strlen($_POST['blog_name'])==0 || strlen($_POST['blog_subtitle'])==0 ) {
+ if (count($_POST)>0) {
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'));
}
+
+
+ }
Blog::display_new_blog_form();
}
}
- if (isset($_GET['action']) && $_GET['action'] == 'edit')
- {
+ if (isset($_GET['action']) && $_GET['action'] == 'edit') {
// we show the form if
// 1. no post data
// 2. there is post data and one of the three form elements is empty
if (!$_POST OR (!empty($_POST) AND (empty($_POST['edit_blog_submit']) OR empty($_POST['blog_name']) OR empty($_POST['blog_subtitle']))))
{
// if there is post data there is certainly an error in the form
- if ($_POST)
- {
+ if ($_POST) {
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'));
}
Blog::display_edit_blog_form(Database::escape_string((int)$_GET['blog_id']));
@@ -142,17 +158,17 @@ if (api_is_allowed_to_edit())
echo '