Minor - Code style updates based on scrutinizer checks

pull/2487/head
Yannick Warnier 8 years ago
parent c4aa8786dd
commit c0467f78c0
  1. 34
      main/blog/blog.php
  2. 4
      main/inc/lib/blog.lib.php
  3. 4
      main/lp/learnpath.class.php

@ -207,56 +207,32 @@ if (isset($_GET['action']) && $_GET['action'] == 'view_post') {
switch ($action) { switch ($action) {
case 'new_post' : case 'new_post' :
$nameTools = get_lang('NewPost'); $nameTools = get_lang('NewPost');
$interbreadcrumb[] = array(
'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
"name" => Blog::getBlogTitle($blog_id),
);
break; break;
case 'view_post' : case 'view_post' :
$nameTools = ''; $nameTools = '';
$interbreadcrumb[] = array(
'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
"name" => Blog::getBlogTitle($blog_id),
);
break; break;
case 'manage_tasks' : case 'manage_tasks' :
$nameTools = get_lang('TaskManager'); $nameTools = get_lang('TaskManager');
$interbreadcrumb[] = array(
'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
"name" => Blog::getBlogTitle($blog_id),
);
break; break;
case 'manage_members' : case 'manage_members' :
$nameTools = get_lang('MemberManager'); $nameTools = get_lang('MemberManager');
$interbreadcrumb[] = array(
'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
"name" => Blog::getBlogTitle($blog_id),
);
break; break;
case 'manage_rights' : case 'manage_rights' :
$nameTools = get_lang('RightsManager'); $nameTools = get_lang('RightsManager');
$interbreadcrumb[] = array(
'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
'name' => Blog::getBlogTitle($blog_id),
);
break; break;
case 'view_search_result' : case 'view_search_result' :
$nameTools = get_lang('SearchResults'); $nameTools = get_lang('SearchResults');
$interbreadcrumb[] = array(
'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
'name' => Blog::getBlogTitle($blog_id),
);
break; break;
case 'execute_task' : case 'execute_task' :
$nameTools = get_lang('ExecuteThisTask'); $nameTools = get_lang('ExecuteThisTask');
$interbreadcrumb[] = array(
'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
'name' => Blog::getBlogTitle($blog_id),
);
break; break;
default : default:
$nameTools = Blog::getBlogTitle($blog_id); $nameTools = Blog::getBlogTitle($blog_id);
} }
$interbreadcrumb[] = array(
'url' => "blog.php?blog_id=$blog_id&".api_get_cidreq(),
'name' => Blog::getBlogTitle($blog_id),
);
$actionsLeft = []; $actionsLeft = [];
$actionsLeft[] = Display::url( $actionsLeft[] = Display::url(

@ -1532,7 +1532,7 @@ class Blog
if ($form->validate()) { if ($form->validate()) {
$values = $form->exportValues(); $values = $form->exportValues();
$postId = Blog::createPost( $postId = self::createPost(
$values['title'], $values['title'],
$values['full_text'], $values['full_text'],
$values['post_file_comment'], $values['post_file_comment'],
@ -1608,7 +1608,7 @@ class Blog
$form->addButton('save', get_lang('Save')); $form->addButton('save', get_lang('Save'));
$form->setDefaults($blog_post); $form->setDefaults($blog_post);
return $form->return_form(); return $form->returnForm();
} }
/** /**

@ -10346,7 +10346,7 @@ EOD;
if ($this->debug > 0) { if ($this->debug > 0) {
error_log('New LP - In learnpath::clear_prerequisites()', 0); error_log('New LP - In learnpath::clear_prerequisites()', 0);
} }
$tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
$lp_id = $this->get_id(); $lp_id = $this->get_id();
//Cleaning prerequisites //Cleaning prerequisites
$sql = "UPDATE $tbl_lp_item SET prerequisite = '' $sql = "UPDATE $tbl_lp_item SET prerequisite = ''
@ -10361,7 +10361,7 @@ EOD;
public function set_previous_step_as_prerequisite_for_all_items() public function set_previous_step_as_prerequisite_for_all_items()
{ {
$tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
$course_id = $this->get_course_int_id(); $course_id = $this->get_course_int_id();
$lp_id = $this->get_id(); $lp_id = $this->get_id();

Loading…
Cancel
Save