Fix - PHP warnings, renaming class add_hidden -> addHidden

1.10.x
Julio Montoya 11 years ago
parent 64f5844bdf
commit 633498fa7b
  1. 2
      main/blog/blog.php
  2. 14
      main/blog/blog_admin.php
  3. 6
      main/course_description/course_description_form.class.php
  4. 8
      main/glossary/glossary_form.class.php
  5. 2
      main/glossary/upload_file_form.class.php
  6. 2
      main/inc/lib/formvalidator/FormValidator.class.php

@ -256,7 +256,7 @@ echo '<div class=actions>';
echo '</div>'; echo '</div>';
// Tool introduction // Tool introduction
Display::display_introduction_section(TOOL_BLOG); Display::display_introduction_section(TOOL_BLOGS);
//Display::display_header($nameTools,'Blogs'); //Display::display_header($nameTools,'Blogs');
?> ?>

@ -5,9 +5,7 @@
* This file takes care of all blog navigation and displaying. * This file takes care of all blog navigation and displaying.
* @package chamilo.blogs * @package chamilo.blogs
*/ */
/**
* Code
*/
// name of the language file that needs to be included // name of the language file that needs to be included
$language_file = 'blog'; $language_file = 'blog';
@ -43,15 +41,15 @@ if (api_is_allowed_to_edit()) {
$current_section=get_lang('EditBlog'); $current_section=get_lang('EditBlog');
$my_url='action=edit&amp;blog_id='.Security::remove_XSS($_GET['blog_id']); $my_url='action=edit&amp;blog_id='.Security::remove_XSS($_GET['blog_id']);
} }
$interbreadcrumb[]= array ( /*$interbreadcrumb[] = array(
'url' => 'blog_admin.php?' . $my_url, 'url' => 'blog_admin.php?' . $my_url,
'name' => $current_section 'name' => $current_section
); );*/
Display::display_header(''); Display::display_header('');
} else {
} }
echo '<div class="actions">'; echo '<div class="actions">';
echo "<a href='".api_get_self()."?".api_get_cidreq()."&action=add'>",Display::return_icon('new_blog.png',get_lang('AddBlog'),'',ICON_SIZE_MEDIUM)."</a>"; echo "<a href='".api_get_self()."?".api_get_cidreq()."&action=add'>",
Display::return_icon('new_blog.png',get_lang('AddBlog'),'',ICON_SIZE_MEDIUM)."</a>";
echo '</div>'; echo '</div>';
/* /*
@ -62,7 +60,7 @@ if (api_is_allowed_to_edit()) {
$get_blog_id = Security::remove_XSS($_POST['blog_id']); $get_blog_id = Security::remove_XSS($_POST['blog_id']);
if (!empty($_POST['new_blog_submit']) AND !empty($_POST['blog_name'])) { 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); Blog::create_blog($get_blog_name,$get_blog_subtitle);
Display::display_confirmation_message(get_lang('BlogStored')); Display::display_confirmation_message(get_lang('BlogStored'));
} }

@ -71,9 +71,9 @@ class CourseDescriptionForm extends \FormValidator
$defaults['content'] = $description->content; $defaults['content'] = $description->content;
$this->add_header($description->get_title()); $this->add_header($description->get_title());
$this->add_hidden('description_type', $description->get_description_type()); $this->addHidden('description_type', $description->get_description_type());
$this->add_hidden('c_id', $description->c_id); $this->addHidden('c_id', $description->c_id);
$this->add_hidden('id', $description->id); $this->addHidden('id', $description->id);
$this->add_textfield('title', get_lang('Title'), true, array('size' => 'width: 350px;')); $this->add_textfield('title', get_lang('Title'), true, array('size' => 'width: 350px;'));
$this->applyFilter('title', 'html_filter'); $this->applyFilter('title', 'html_filter');
$this->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200')); $this->add_html_editor('content', get_lang('Content'), true, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '200'));

@ -68,10 +68,10 @@ class GlossaryForm extends \FormValidator
$defaults['name'] = $glossary->name; $defaults['name'] = $glossary->name;
$defaults['description'] = $glossary->description; $defaults['description'] = $glossary->description;
$this->add_hidden('c_id', $glossary->c_id); $this->addHidden('c_id', $glossary->c_id);
$this->add_hidden('id', $glossary->id); $this->addHidden('id', $glossary->id);
$this->add_hidden('session_id', $glossary->session_id); $this->addHidden('session_id', $glossary->session_id);
$this->add_hidden(Request::PARAM_SEC_TOKEN, Access::instance()->get_token()); $this->addHidden(Request::PARAM_SEC_TOKEN, Access::instance()->get_token());
$form_name = $glossary->id ? get_lang('TermEdit') : get_lang('TermAddNew'); $form_name = $glossary->id ? get_lang('TermEdit') : get_lang('TermAddNew');
$this->add_header($form_name); $this->add_header($form_name);

@ -44,7 +44,7 @@ class UploadFileForm extends \FormValidator
$form_name = get_lang('ImportGlossary'); $form_name = get_lang('ImportGlossary');
$this->add_header($form_name); $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'); $label = get_lang('ImportCSVFileLocation');
$this->add_file('file', $label); $this->add_file('file', $label);
$this->addRule('file', get_lang('ThisFieldIsRequired'), 'required'); $this->addRule('file', get_lang('ThisFieldIsRequired'), 'required');

@ -272,7 +272,7 @@ EOT;
* @param string $name * @param string $name
* @param string $value * @param string $value
*/ */
public function add_hidden($name, $value) public function addHidden($name, $value)
{ {
$this->addElement('hidden', $name, $value); $this->addElement('hidden', $name, $value);
} }

Loading…
Cancel
Save