From 633498fa7b70b0c0b10f7280d887d3f1e4f97a8d Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 20 Feb 2015 16:10:19 +0100 Subject: [PATCH] Fix - PHP warnings, renaming class add_hidden -> addHidden --- main/blog/blog.php | 2 +- main/blog/blog_admin.php | 20 +++++++++---------- .../course_description_form.class.php | 6 +++--- main/glossary/glossary_form.class.php | 8 ++++---- main/glossary/upload_file_form.class.php | 2 +- .../lib/formvalidator/FormValidator.class.php | 2 +- 6 files changed, 19 insertions(+), 21 deletions(-) diff --git a/main/blog/blog.php b/main/blog/blog.php index 28da6c62ce..3f98d7c0fb 100755 --- a/main/blog/blog.php +++ b/main/blog/blog.php @@ -256,7 +256,7 @@ echo '
'; echo '
'; // Tool introduction -Display::display_introduction_section(TOOL_BLOG); +Display::display_introduction_section(TOOL_BLOGS); //Display::display_header($nameTools,'Blogs'); ?> diff --git a/main/blog/blog_admin.php b/main/blog/blog_admin.php index 5853833dcf..a5e6a15f20 100755 --- a/main/blog/blog_admin.php +++ b/main/blog/blog_admin.php @@ -5,9 +5,7 @@ * This file takes care of all blog navigation and displaying. * @package chamilo.blogs */ -/** - * Code - */ + // name of the language file that needs to be included $language_file = 'blog'; @@ -23,7 +21,7 @@ $blog_table_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT); api_protect_course_script(true); // ONLY USERS REGISTERED IN THE COURSE -if((!$is_allowed_in_course || !$is_courseMember) && !api_is_allowed_to_edit()) { +if ((!$is_allowed_in_course || !$is_courseMember) && !api_is_allowed_to_edit()) { api_not_allowed(true);//print headers/footers } @@ -43,15 +41,15 @@ if (api_is_allowed_to_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 - ); + /*$interbreadcrumb[] = array( + 'url' => 'blog_admin.php?' . $my_url, + 'name' => $current_section + );*/ Display::display_header(''); - } else { } echo '
'; - echo "",Display::return_icon('new_blog.png',get_lang('AddBlog'),'',ICON_SIZE_MEDIUM).""; + echo "", + Display::return_icon('new_blog.png',get_lang('AddBlog'),'',ICON_SIZE_MEDIUM).""; echo '
'; /* @@ -62,7 +60,7 @@ if (api_is_allowed_to_edit()) { $get_blog_id = Security::remove_XSS($_POST['blog_id']); if (!empty($_POST['new_blog_submit']) AND !empty($_POST['blog_name'])) { - if (strlen(trim($_POST['blog_name']))>0) { + if (isset($_POST['blog_name'])) { Blog::create_blog($get_blog_name,$get_blog_subtitle); Display::display_confirmation_message(get_lang('BlogStored')); } diff --git a/main/course_description/course_description_form.class.php b/main/course_description/course_description_form.class.php index d2270f13e2..3d2307197b 100755 --- a/main/course_description/course_description_form.class.php +++ b/main/course_description/course_description_form.class.php @@ -71,9 +71,9 @@ class CourseDescriptionForm extends \FormValidator $defaults['content'] = $description->content; $this->add_header($description->get_title()); - $this->add_hidden('description_type', $description->get_description_type()); - $this->add_hidden('c_id', $description->c_id); - $this->add_hidden('id', $description->id); + $this->addHidden('description_type', $description->get_description_type()); + $this->addHidden('c_id', $description->c_id); + $this->addHidden('id', $description->id); $this->add_textfield('title', get_lang('Title'), true, array('size' => 'width: 350px;')); $this->applyFilter('title', 'html_filter'); $this->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200')); diff --git a/main/glossary/glossary_form.class.php b/main/glossary/glossary_form.class.php index 7a241b7a3d..ab2964871d 100755 --- a/main/glossary/glossary_form.class.php +++ b/main/glossary/glossary_form.class.php @@ -68,10 +68,10 @@ class GlossaryForm extends \FormValidator $defaults['name'] = $glossary->name; $defaults['description'] = $glossary->description; - $this->add_hidden('c_id', $glossary->c_id); - $this->add_hidden('id', $glossary->id); - $this->add_hidden('session_id', $glossary->session_id); - $this->add_hidden(Request::PARAM_SEC_TOKEN, Access::instance()->get_token()); + $this->addHidden('c_id', $glossary->c_id); + $this->addHidden('id', $glossary->id); + $this->addHidden('session_id', $glossary->session_id); + $this->addHidden(Request::PARAM_SEC_TOKEN, Access::instance()->get_token()); $form_name = $glossary->id ? get_lang('TermEdit') : get_lang('TermAddNew'); $this->add_header($form_name); diff --git a/main/glossary/upload_file_form.class.php b/main/glossary/upload_file_form.class.php index b338b74064..d88bfeae8d 100755 --- a/main/glossary/upload_file_form.class.php +++ b/main/glossary/upload_file_form.class.php @@ -44,7 +44,7 @@ class UploadFileForm extends \FormValidator $form_name = get_lang('ImportGlossary'); $this->add_header($form_name); - $this->add_hidden(Request::PARAM_SEC_TOKEN, Access::instance()->get_token()); + $this->addHidden(Request::PARAM_SEC_TOKEN, Access::instance()->get_token()); $label = get_lang('ImportCSVFileLocation'); $this->add_file('file', $label); $this->addRule('file', get_lang('ThisFieldIsRequired'), 'required'); diff --git a/main/inc/lib/formvalidator/FormValidator.class.php b/main/inc/lib/formvalidator/FormValidator.class.php index 5b3946933b..fc6b3b8a2a 100755 --- a/main/inc/lib/formvalidator/FormValidator.class.php +++ b/main/inc/lib/formvalidator/FormValidator.class.php @@ -272,7 +272,7 @@ EOT; * @param string $name * @param string $value */ - public function add_hidden($name, $value) + public function addHidden($name, $value) { $this->addElement('hidden', $name, $value); }