From 3b16635c327dc94aab51586bb34e2898f98ea50f Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 24 Jul 2012 18:49:14 +0200 Subject: [PATCH 1/6] Should fix bug when including file see #5244 --- plugin/bbb/config.php | 5 ++++- plugin/bbb/install.php | 2 +- plugin/bbb/lib/bbb.lib.php | 3 --- plugin/bbb/listing.php | 2 +- plugin/bbb/plugin.php | 2 +- plugin/bbb/start.php | 2 +- plugin/bbb/uninstall.php | 2 +- plugin/olpc_peru_filter/install.php | 2 +- plugin/olpc_peru_filter/plugin.php | 2 +- plugin/olpc_peru_filter/uninstall.php | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plugin/bbb/config.php b/plugin/bbb/config.php index a8e79220ec..fda6f94043 100644 --- a/plugin/bbb/config.php +++ b/plugin/bbb/config.php @@ -4,5 +4,8 @@ /* bbb parameters that will be registered in the course settings */ require_once '../../main/inc/global.inc.php'; +require_once api_get_path(LIBRARY_PATH).'plugin.class.php'; + require_once 'lib/bbb.lib.php'; -require_once 'lib/bbb_api.php'; \ No newline at end of file +require_once 'lib/bbb_api.php'; +require_once 'lib/bbb_plugin.class.php'; \ No newline at end of file diff --git a/plugin/bbb/install.php b/plugin/bbb/install.php index 3b5bba2956..5b38d0d2ae 100644 --- a/plugin/bbb/install.php +++ b/plugin/bbb/install.php @@ -8,5 +8,5 @@ * Initialization */ -require_once 'config.php'; +require_once dirname(__FILE__).'/config.php'; BBBPlugin::create()->install(); \ No newline at end of file diff --git a/plugin/bbb/lib/bbb.lib.php b/plugin/bbb/lib/bbb.lib.php index 2b90ac3b66..22bb147a67 100644 --- a/plugin/bbb/lib/bbb.lib.php +++ b/plugin/bbb/lib/bbb.lib.php @@ -4,9 +4,6 @@ * @package chamilo.plugin.bigbluebutton */ -require_once api_get_path(LIBRARY_PATH).'plugin.class.php'; -require_once 'bbb_plugin.class.php'; - class bbb { var $url; diff --git a/plugin/bbb/listing.php b/plugin/bbb/listing.php index 23079d55c7..30f17744ef 100644 --- a/plugin/bbb/listing.php +++ b/plugin/bbb/listing.php @@ -8,7 +8,7 @@ */ $course_plugin = 'bbb'; //needed in order to load the plugin lang variables -require_once 'config.php'; +require_once dirname(__FILE__).'/config.php'; $tool_name = get_lang('Videoconference'); $tpl = new Template($tool_name); diff --git a/plugin/bbb/plugin.php b/plugin/bbb/plugin.php index 0b24ed9070..4c38a011e1 100644 --- a/plugin/bbb/plugin.php +++ b/plugin/bbb/plugin.php @@ -1,4 +1,4 @@ get_info(); \ No newline at end of file diff --git a/plugin/bbb/start.php b/plugin/bbb/start.php index aa5d59dbfb..69de4bdb6a 100644 --- a/plugin/bbb/start.php +++ b/plugin/bbb/start.php @@ -8,7 +8,7 @@ */ $course_plugin = 'bbb'; //needed in order to load the plugin lang variables -require_once 'config.php'; +require_once dirname(__FILE__).'/config.php'; $tool_name = get_lang('Videoconference'); $tpl = new Template($tool_name); $bbb = new bbb(); diff --git a/plugin/bbb/uninstall.php b/plugin/bbb/uninstall.php index 4167a208a2..e8f6b3d23a 100644 --- a/plugin/bbb/uninstall.php +++ b/plugin/bbb/uninstall.php @@ -9,5 +9,5 @@ /** * Queries */ -require_once 'config.php'; +require_once dirname(__FILE__).'/config.php'; BBBPlugin::create()->uninstall(); \ No newline at end of file diff --git a/plugin/olpc_peru_filter/install.php b/plugin/olpc_peru_filter/install.php index da546374e3..d95a8ed8b8 100644 --- a/plugin/olpc_peru_filter/install.php +++ b/plugin/olpc_peru_filter/install.php @@ -9,5 +9,5 @@ * Initialization */ -require_once 'config.php'; +require_once dirname(__FILE__).'/config.php'; OLPC_Peru_FilterPlugin::create()->install(); \ No newline at end of file diff --git a/plugin/olpc_peru_filter/plugin.php b/plugin/olpc_peru_filter/plugin.php index 4da5e508fd..775d8bf38b 100644 --- a/plugin/olpc_peru_filter/plugin.php +++ b/plugin/olpc_peru_filter/plugin.php @@ -1,4 +1,4 @@ get_info(); diff --git a/plugin/olpc_peru_filter/uninstall.php b/plugin/olpc_peru_filter/uninstall.php index 213dfcb190..e1813f8e50 100644 --- a/plugin/olpc_peru_filter/uninstall.php +++ b/plugin/olpc_peru_filter/uninstall.php @@ -9,5 +9,5 @@ /** * Queries */ -require_once 'config.php'; +require_once dirname(__FILE__).'/config.php'; OLPC_Peru_FilterPlugin::create()->uninstall(); From 136227c8e9241521b154ed60c7bfea8963aca719 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 24 Jul 2012 18:50:03 +0200 Subject: [PATCH 2/6] Minor - Fixing PHP warnings --- main/inc/lib/display.lib.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php index 1f25c123a2..ae5524335f 100644 --- a/main/inc/lib/display.lib.php +++ b/main/inc/lib/display.lib.php @@ -1292,7 +1292,7 @@ class Display { * @param bool add a div wrapper * @todo use templates **/ - public function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true) { + public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true) { $number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null; $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0; @@ -1336,11 +1336,11 @@ class Display { return $html; } - function return_default_table_class() { + public static function return_default_table_class() { return 'data_table'; } - public function page_header($title, $second_title = null) { + public static function page_header($title, $second_title = null) { $title = Security::remove_XSS($title); if (!empty($second_title)) { $second_title = Security::remove_XSS($second_title); @@ -1349,17 +1349,17 @@ class Display { return ''; } - public function page_header_and_translate($title, $second_title = null) { + public static function page_header_and_translate($title, $second_title = null) { $title = get_lang($title); return self::page_header($title, $second_title); } - public function page_subheader_and_translate($title, $second_title = null) { + public static function page_subheader_and_translate($title, $second_title = null) { $title = get_lang($title); return self::page_subheader($title, $second_title); } - public function page_subheader($title, $second_title = null) { + public static function page_subheader($title, $second_title = null) { if (!empty($second_title)) { $second_title = Security::remove_XSS($second_title); $title .= " $second_title"; @@ -1380,7 +1380,7 @@ class Display { return $html; } - function bar_progress($percentage, $show_percentage = true, $extra_info = null) { + public static function bar_progress($percentage, $show_percentage = true, $extra_info = null) { $percentage = intval($percentage); $div = '
@@ -1395,7 +1395,7 @@ class Display { return $div; } - function badge($count, $type ="warning") { + public static function badge($count, $type ="warning") { $class = ''; switch ($type) { @@ -1422,7 +1422,7 @@ class Display { return null; } - function badge_group($badge_list) { + public static function badge_group($badge_list) { $html = '
'; foreach ($badge_list as $badge) { $html .= $badge; @@ -1431,7 +1431,7 @@ class Display { return $html; } - function label($content, $type = null) { + public static function label($content, $type = null) { $class = ''; switch ($type) { case 'success': @@ -1460,7 +1460,7 @@ class Display { return $html; } - function actions($items) { + public static function actions($items) { if (!empty($items)) { $html = '
{% endif %} - {# ?? #} + {# Portal homepage #} {% if home_page_block %} -
+
- {{ home_page_block}} + {{ home_page_block }}
{% endif %} - + {# ?? #} {{ sniff_notification }} @@ -33,16 +33,27 @@ {{ content }}
{% endif %} - + {# Announcements #} {% if announcements_block %} -
+
{{ announcements_block }}
{% endif %} - + + {# Course categories (must be turned on in the admin settings) #} + {% if course_category_block %} +
+
+
+ {{ course_category_block }} +
+
+
+ {% endif %} + {# Hot courses template #} - {% include "default/layout/hot_courses.tpl" %} + {% include "default/layout/hot_courses.tpl" %} {# Content bottom #} {% if plugin_content_bottom %}