Add $addCourseTool flag, so a course plugin will add an icon in the course home or not.

See BT#11080
pull/2487/head
jmontoyaa 8 years ago
parent 94614837a1
commit f8fb36d434
  1. 2
      main/inc/lib/course_home.lib.php
  2. 6
      main/inc/lib/plugin.class.php
  3. 1
      plugin/courseblock/CourseBlockPlugin.php

@ -505,7 +505,7 @@ class CourseHome
//Other queries recover id, name, link, image, visibility, admin, address, added_tool, target, category and session_id
// but plugins are not present in the tool table, only globally and inside the course_settings table once configured
$sql = "SELECT * FROM $course_tool_table t
WHERE category = 'plugin' AND c_id = $course_id $condition_session
WHERE category = 'plugin' AND name <> 'courseblock' AND c_id = $course_id $condition_session
ORDER BY id";
$result = Database::query($sql);
break;

@ -26,6 +26,8 @@ class Plugin
public $isCoursePlugin = false;
public $isAdminPlugin = false;
public $isMailPlugin = false;
// Adds icon in the course home
public $addCourseTool = true;
/**
* When creating a new course, these settings are added to the course, in
@ -461,6 +463,10 @@ class Plugin
return true;
}
if ($this->addCourseTool == false) {
return true;
}
//Add an icon in the table tool list
$table = Database::get_course_table(TABLE_TOOL_LIST);
$sql = "SELECT name FROM $table

@ -7,6 +7,7 @@
class CourseBlockPlugin extends Plugin
{
public $isCoursePlugin = true;
public $addCourseTool = false;
// When creating a new course this settings are added to the course
public $course_settings = array(

Loading…
Cancel
Save