');
+
+ $form2->addElement('html', $option2);
+ $form2->addElement('checkbox', 'right', null, get_lang('Yes'));
+ $form2->addElement('button', 'submit', get_lang('Send'));
+ $formHtml2 = $form2->return_form();
+
+ if ($form2->validate()) {
+ $result = $form2->getSubmitValues();
+ if (isset($result['right']) && $result['right']) {
+ header('Location: '.$urlOption2);
+ exit;
+ }
+ }
+ }
+
+ $_template['form_option1'] = $formHtml;
+ $_template['form_option2'] = $formHtml2;
+}
diff --git a/plugin/before_login/plugin.php b/plugin/before_login/plugin.php
new file mode 100644
index 0000000000..290584e74e
--- /dev/null
+++ b/plugin/before_login/plugin.php
@@ -0,0 +1,51 @@
+Plugins)
+ * @package chamilo.plugin
+ * @author Julio Montoya
+ */
+
+/* Plugin config */
+
+// The plugin title.
+$plugin_info['title'] = 'Show HTML before login';
+// The comments that go with the plugin.
+$plugin_info['comment'] = "Show a content before loading the login page.";
+// The plugin version.
+$plugin_info['version'] = '1.0';
+// The plugin author.
+$plugin_info['author'] = 'Julio Montoya';
+
+// The plugin configuration.
+$form = new FormValidator('form');
+$form->addElement('select', 'language', get_lang('Language'), api_get_languages_to_array());
+
+$form->addElement('header', 'Option 1');
+$form->addElement('textarea', 'option1', get_lang('Description'), array('rows' => 10, 'class' => 'span6'));
+$form->addElement('text', 'option1_url', get_lang('RedirectTo'));
+
+$form->addElement('header', 'Option 2');
+$form->addElement('textarea', 'option2', get_lang('Description'), array('rows' => 10, 'class' => 'span6'));
+$form->addElement('text', 'option2_url', get_lang('RedirectTo'));
+$form->addElement('button', 'submit_button', get_lang('Save'));
+
+// Get default value for form
+
+$defaults = array();
+$defaults['language'] = api_get_plugin_setting('before_login', 'language');
+$defaults['option1'] = api_get_plugin_setting('before_login', 'option1');
+$defaults['option2'] = api_get_plugin_setting('before_login', 'option2');
+
+$defaults['option1_url'] = api_get_plugin_setting('before_login', 'option1_url');
+$defaults['option2_url'] = api_get_plugin_setting('before_login', 'option2_url');
+
+$plugin_info['templates'] = array('template.tpl');
+if (file_exists(__DIR__.'/custom.template.tpl')) {
+ $plugin_info['templates'] = array( 'custom.template.tpl');
+}
+$form->setDefaults($defaults);
+
+// Display form
+$plugin_info['settings_form'] = $form;
diff --git a/plugin/before_login/readme.txt b/plugin/before_login/readme.txt
new file mode 100644
index 0000000000..72946833c4
--- /dev/null
+++ b/plugin/before_login/readme.txt
@@ -0,0 +1,10 @@
+README
+
+This plugins shows page before showing the login page.
+This is useful if you want a question before a user has the opportunity to login.
+
+Example:
+You're old enough to enter this site? If you accept the "option 1" then
+you can enter to the campus (the login will appeared).
+
+If you select "option 2" then you're redirected to another page.
\ No newline at end of file
diff --git a/plugin/before_login/template.tpl b/plugin/before_login/template.tpl
new file mode 100644
index 0000000000..77fa85e4ba
--- /dev/null
+++ b/plugin/before_login/template.tpl
@@ -0,0 +1,14 @@
+{% if before_login.form_option1 %}
+
+
+
+ {{ before_login.form_option1 }}
+
+
+ {{ before_login.form_option2 }}
+
+
+
+{% else %}
+
+{% endif %}
\ No newline at end of file
diff --git a/plugin/dashboard/block_course/block_course.class.php b/plugin/dashboard/block_course/block_course.class.php
index db412b4e46..1a45c4b8c4 100644
--- a/plugin/dashboard/block_course/block_course.class.php
+++ b/plugin/dashboard/block_course/block_course.class.php
@@ -9,189 +9,200 @@
/**
* required files for getting data
*/
+require_once api_get_path(LIBRARY_PATH) . 'thematic.lib.php';
/**
* This class is used like controller for this course block plugin,
* the class name must be registered inside path.info file (e.g: controller = "BlockCourse"), so dashboard controller will be instantiate it
* @package chamilo.dashboard
*/
-class BlockCourse extends Block {
-
- private $user_id;
- private $courses;
- private $path;
- private $permission = array(DRH);
-
- /**
- * Constructor
- */
- public function __construct ($user_id) {
- $this->user_id = $user_id;
- $this->path = 'block_course';
- if ($this->is_block_visible_for_user($user_id)) {
- /*if (api_is_platform_admin()) {
- $this->courses = CourseManager::get_real_course_list();
- } else {*/
- $this->courses = CourseManager::get_courses_followed_by_drh($user_id);
- //}
- }
- }
+class BlockCourse extends Block
+{
+
+ private $user_id;
+ private $courses;
+ private $path;
+ private $permission = array(DRH);
- /**
- * This method check if a user is allowed to see the block inside dashboard interface
- * @param int User id
- * @return bool Is block visible for user
- */
- public function is_block_visible_for_user($user_id) {
- $user_info = api_get_user_info($user_id);
- $user_status = $user_info['status'];
- $is_block_visible_for_user = false;
- if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) {
- $is_block_visible_for_user = true;
- }
- return $is_block_visible_for_user;
+ /**
+ * Constructor
+ */
+ public function __construct($user_id)
+ {
+ $this->user_id = $user_id;
+ $this->path = 'block_course';
+ if ($this->is_block_visible_for_user($user_id)) {
+ $this->courses = CourseManager::get_courses_followed_by_drh($user_id);
+ }
}
+ /**
+ * This method check if a user is allowed to see the block inside dashboard interface
+ * @param int User id
+ * @return bool Is block visible for user
+ */
+ public function is_block_visible_for_user($user_id)
+ {
+ $user_info = api_get_user_info($user_id);
+ $user_status = $user_info['status'];
+ $is_block_visible_for_user = false;
+ if (UserManager::is_admin($user_id) || in_array(
+ $user_status,
+ $this->permission
+ )
+ ) {
+ $is_block_visible_for_user = true;
+ }
+ return $is_block_visible_for_user;
+ }
/**
* This method return content html containing information about courses and its position for showing it inside dashboard interface
* it's important to use the name 'get_block' for beeing used from dashboard controller
* @return array column and content html
*/
- public function get_block() {
-
- global $charset;
-
- $column = 2;
- $data = array();
- $content = '';
- $data_table = '';
- $content = $this->get_content_html();
- $html = '
+ public function get_block()
+ {
+ global $charset;
+ $column = 2;
+ $data = array();
+ $content = $this->get_content_html();
+ $html = '
+ ';
$data['column'] = $column;
$data['content_html'] = $html;
@@ -124,10 +120,13 @@ class BlockEvaluationGraph extends Block {
}
/**
- * This method return a graph containing informations about evaluations inside base courses, it's used inside get_block method for showing it inside dashboard interface
+ * This method return a graph containing informations about evaluations
+ * inside base courses, it's used inside get_block method for showing
+ * it inside dashboard interface
* @return string img html
*/
- public function get_evaluations_base_courses_graph() {
+ public function get_evaluations_base_courses_graph()
+ {
$graphs = array();
if (!empty($this->courses)) {
$courses_code = array_keys($this->courses);
@@ -160,7 +159,7 @@ class BlockEvaluationGraph extends Block {
$data_set->RemoveSerie("Items");
$data_set->SetAbsciseLabelSerie("Items");
$graph_id = $this->user_id.'StudentEvaluationGraph';
- $cache = new pCache(api_get_path(SYS_ARCHIVE_PATH));
+ $cache = new pCache();
// the graph id
$data = $data_set->GetData();
if ($cache->IsInCache($graph_id, $data)) {
@@ -211,19 +210,20 @@ class BlockEvaluationGraph extends Block {
}
/**
- * This method return a graph containing informations about evaluations inside courses in sessions, it's used inside get_block method for showing it inside dashboard interface
+ * This method return a graph containing information about evaluations
+ * inside courses in sessions, it's used inside get_block method for
+ * showing it inside dashboard interface
* @return string img html
*/
- public function get_evaluations_courses_in_sessions_graph() {
+ public function get_evaluations_courses_in_sessions_graph()
+ {
$graphs = array();
if (!empty($this->sessions)) {
$session_ids = array_keys($this->sessions);
foreach ($session_ids as $session_id) {
$courses_code = array_keys(Tracking::get_courses_list_from_session($session_id));
$courses_graph = array();
- foreach ($courses_code as $courseId) {
- $courseInfo = api_get_course_info_by_id($courseId);
- $course_code = $courseInfo['code'];
+ foreach ($courses_code as $course_code) {
$cats = Category::load(null, null, $course_code, null, null, $session_id);
if (isset($cats) && isset($cats[0])) {
$alleval = $cats[0]->get_evaluations(null, true, $course_code);
@@ -251,7 +251,7 @@ class BlockEvaluationGraph extends Block {
$data_set->RemoveSerie("Items");
$data_set->SetAbsciseLabelSerie("Items");
$graph_id = $this->user_id.'StudentEvaluationGraph';
- $cache = new pCache(api_get_path(SYS_ARCHIVE_PATH));
+ $cache = new pCache();
// the graph id
$data = $data_set->GetData();
if ($cache->IsInCache($graph_id, $data)) {
@@ -303,4 +303,4 @@ class BlockEvaluationGraph extends Block {
}
return $graphs;
}
-}
\ No newline at end of file
+}
diff --git a/plugin/dashboard/block_global_info/block_global_info.class.php b/plugin/dashboard/block_global_info/block_global_info.class.php
index 67448f0e50..240b73355c 100644
--- a/plugin/dashboard/block_global_info/block_global_info.class.php
+++ b/plugin/dashboard/block_global_info/block_global_info.class.php
@@ -10,6 +10,8 @@
/**
* required files for getting data
*/
+require_once api_get_path(SYS_CODE_PATH).'admin/statistics/statistics.lib.php';
+
/**
* This class is used like controller for this global info block plugin
* the class name must be registered inside path.info file
@@ -59,15 +61,12 @@ class BlockGlobalInfo extends Block
* it's important to use the name 'get_block' for beeing used from dashboard controller
* @return array column and content html
*/
- public function get_block() {
-
+ public function get_block()
+ {
global $charset;
-
$column = 2;
$data = array();
- $content = '';
- $data_table = '';
- $content = $this->get_content_html();
+ $content = $this->get_content_html();
$html = '
@@ -89,8 +88,8 @@ class BlockGlobalInfo extends Block
* This method return a content html, it's used inside get_block method for showing it inside dashboard interface
* @return string content html
*/
- public function get_content_html() {
-
+ public function get_content_html()
+ {
$global_data = $this->get_global_information_data();
$content = '
';
$content .= '
'.get_lang('GlobalPlatformInformation').'
';
@@ -139,7 +138,7 @@ class BlockGlobalInfo extends Block
array(get_lang('NumberOfCoursesPublic'), ''.Statistics::count_courses_by_visibility(COURSE_VISIBILITY_OPEN_WORLD).''),
array(get_lang('NumberOfCoursesOpen'), ''.Statistics::count_courses_by_visibility(COURSE_VISIBILITY_OPEN_PLATFORM).''),
array(get_lang('NumberOfCoursesPrivate'), ''.Statistics::count_courses_by_visibility(COURSE_VISIBILITY_REGISTERED).''),
- array(get_lang('NumberOfCoursesClosed'), ''.Statistics::count_courses_by_visibility(COURSE_VISIBILITY_CLOSED).'')
+ array(get_lang('NumberOfCoursesClosed'), ''.Statistics::count_courses_by_visibility(COURSE_VISIBILITY_CLOSED).''),
array(get_lang('NumberOfCoursesHidden'), ''.Statistics::count_courses_by_visibility(COURSE_VISIBILITY_HIDDEN).'')
);
return $global_info;
diff --git a/plugin/dashboard/block_session/block_session.class.php b/plugin/dashboard/block_session/block_session.class.php
index a582fb6486..fc12b55f64 100644
--- a/plugin/dashboard/block_session/block_session.class.php
+++ b/plugin/dashboard/block_session/block_session.class.php
@@ -9,13 +9,16 @@
/**
* required files for getting data
*/
+require_once api_get_path(LIBRARY_PATH).'course_description.lib.php';
/**
* This class is used like controller for this session block plugin,
- * the class name must be registered inside path.info file (e.g: controller = "BlockSession"), so dashboard controller will be instantiate it
+ * the class name must be registered inside path.info file
+ * (e.g: controller = "BlockSession"), so dashboard controller will be instantiate it
* @package chamilo.dashboard
*/
-class BlockSession extends Block {
+class BlockSession extends Block
+{
private $user_id;
private $sessions;
@@ -25,15 +28,12 @@ class BlockSession extends Block {
/**
* Constructor
*/
- public function __construct ($user_id) {
+ public function __construct ($user_id)
+ {
$this->user_id = $user_id;
$this->path = 'block_session';
if ($this->is_block_visible_for_user($user_id)) {
- /*if (api_is_platform_admin()) {
- $this->sessions = SessionManager::get_sessions_list();
- } else {*/
- $this->sessions = SessionManager::get_sessions_followed_by_drh($user_id);
- //}
+ $this->sessions = SessionManager::get_sessions_followed_by_drh($user_id);
}
}
@@ -42,7 +42,8 @@ class BlockSession extends Block {
* @param int User id
* @return bool Is block visible for user
*/
- public function is_block_visible_for_user($user_id) {
+ public function is_block_visible_for_user($user_id)
+ {
$user_info = api_get_user_info($user_id);
$user_status = $user_info['status'];
$is_block_visible_for_user = false;
@@ -57,7 +58,8 @@ class BlockSession extends Block {
* it's important to use the name 'get_block' for beeing used from dashboard controller
* @return array column and content html
*/
- public function get_block() {
+ public function get_block()
+ {
global $charset;
@@ -88,7 +90,8 @@ class BlockSession extends Block {
* This method return a content html, it's used inside get_block method for showing it inside dashboard interface
* @return string content html
*/
- public function get_content_html() {
+ public function get_content_html()
+ {
$content = '';
$sessions = $this->sessions;
@@ -108,7 +111,12 @@ class BlockSession extends Block {
$session_id = intval($session['id']);
$title = $session['name'];
- $date_string = SessionManager::parse_session_dates($session);
+
+ if ($session['date_start'] != '0000-00-00' && $session['date_end'] != '0000-00-00') {
+ $date = get_lang('From').' '.api_convert_and_format_date($session['date_start'], DATE_FORMAT_SHORT, date_default_timezone_get()).' '.get_lang('To').' '.api_convert_and_format_date($session['date_end'], DATE_FORMAT_SHORT, date_default_timezone_get());
+ } else {
+ $date = ' - ';
+ }
$count_courses_in_session = count(Tracking::get_courses_list_from_session($session_id));
@@ -117,7 +125,7 @@ class BlockSession extends Block {
$sessions_table .= '
'.$title.'
-
'.$date_string.'
+
'.$date.'
'.$count_courses_in_session.'
';
$i++;
@@ -141,8 +149,9 @@ class BlockSession extends Block {
* Get number of sessions
* @return int
*/
- function get_number_of_sessions() {
+ function get_number_of_sessions()
+ {
return count($this->sessions);
}
-}
\ No newline at end of file
+}
diff --git a/plugin/dashboard/block_student/block_student.class.php b/plugin/dashboard/block_student/block_student.class.php
index 290b9546bf..fcbe118c10 100644
--- a/plugin/dashboard/block_student/block_student.class.php
+++ b/plugin/dashboard/block_student/block_student.class.php
@@ -9,6 +9,7 @@
/**
* required files for getting data
*/
+require_once api_get_path(LIBRARY_PATH).'attendance.lib.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/gradebookitem.class.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/evaluation.class.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/result.class.php';
@@ -20,7 +21,8 @@ require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/category.class.php';
* the class name must be registered inside path.info file (e.g: controller = "BlockStudent"), so dashboard controller will be instantiate it
* @package chamilo.dashboard
*/
-class BlockStudent extends Block {
+class BlockStudent extends Block
+{
private $user_id;
private $students;
@@ -30,16 +32,12 @@ class BlockStudent extends Block {
/**
* Constructor
*/
- public function __construct ($user_id) {
+ public function __construct ($user_id)
+ {
$this->user_id = $user_id;
$this->path = 'block_student';
if ($this->is_block_visible_for_user($user_id)) {
- /*if (api_is_platform_admin()) {
- $this->students = UserManager::get_user_list(array('status' => STUDENT));
- } else {*/
-
$this->students = UserManager::get_users_followed_by_drh($user_id, STUDENT);
- //}
}
}
@@ -48,7 +46,8 @@ class BlockStudent extends Block {
* @param int User id
* @return bool Is block visible for user
*/
- public function is_block_visible_for_user($user_id) {
+ public function is_block_visible_for_user($user_id)
+ {
$user_info = api_get_user_info($user_id);
$user_status = $user_info['status'];
$is_block_visible_for_user = false;
@@ -63,7 +62,8 @@ class BlockStudent extends Block {
* it's important to use the name 'get_block' for beeing used from dashboard controller
* @return array column and content html
*/
- public function get_block() {
+ public function get_block()
+ {
global $charset;
$column = 1;
$data = array();
@@ -89,7 +89,8 @@ class BlockStudent extends Block {
* This method return a content html, it's used inside get_block method for showing it inside dashboard interface
* @return string content html
*/
- public function get_students_content_html_for_platform_admin() {
+ public function get_students_content_html_for_platform_admin()
+ {
$students = $this->students;
$content = '
@@ -157,8 +158,7 @@ class BlockStudent extends Block {
return $content;
}
- public function get_students_content_html_for_drh()
- {
+ public function get_students_content_html_for_drh() {
$attendance = new Attendance();
$students = $this->students;
$content = '
';
@@ -235,6 +235,7 @@ class BlockStudent extends Block {
';
}
$content .= '';
+
return $content;
}
@@ -242,7 +243,8 @@ class BlockStudent extends Block {
* Get number of students
* @return int
*/
- function get_number_of_students() {
+ function get_number_of_students()
+ {
return count($this->students);
}
-}
\ No newline at end of file
+}
diff --git a/plugin/dashboard/block_student_graph/block_student_graph.class.php b/plugin/dashboard/block_student_graph/block_student_graph.class.php
index e88f532865..0314b060b9 100644
--- a/plugin/dashboard/block_student_graph/block_student_graph.class.php
+++ b/plugin/dashboard/block_student_graph/block_student_graph.class.php
@@ -13,6 +13,11 @@
* required files for getting data
*/
+require_once api_get_path(LIBRARY_PATH).'attendance.lib.php';
+require_once api_get_path(LIBRARY_PATH).'pchart/pData.class.php';
+require_once api_get_path(LIBRARY_PATH).'pchart/pChart.class.php';
+require_once api_get_path(LIBRARY_PATH).'pchart/pCache.class.php';
+require_once api_get_path(LIBRARY_PATH).'pchart/MyHorBar.class.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/gradebookitem.class.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/evaluation.class.php';
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/result.class.php';
@@ -24,7 +29,8 @@ require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/be/category.class.php';
* the class name must be registered inside path.info file (e.g: controller = "BlockStudentGraph"), so dashboard controller will be instantiate it
* @package chamilo.dashboard
*/
-class BlockStudentGraph extends Block {
+class BlockStudentGraph extends Block
+{
private $user_id;
private $students;
@@ -34,7 +40,8 @@ class BlockStudentGraph extends Block {
/**
* Constructor
*/
- public function __construct ($user_id) {
+ public function __construct ($user_id)
+ {
$this->user_id = $user_id;
$this->path = 'block_student_graph';
if ($this->is_block_visible_for_user($user_id)) {
@@ -51,7 +58,8 @@ class BlockStudentGraph extends Block {
* @param int User id
* @return bool Is block visible for user
*/
- public function is_block_visible_for_user($user_id) {
+ public function is_block_visible_for_user($user_id)
+ {
$user_info = api_get_user_info($user_id);
$user_status = $user_info['status'];
$is_block_visible_for_user = false;
@@ -62,14 +70,15 @@ class BlockStudentGraph extends Block {
}
/**
- * This method return content html containing information about students and its position for showing it inside dashboard interface
- * it's important to use the name 'get_block' for beeing used from dashboard controller
+ * This method return content html containing information about students
+ * and its position for showing it inside dashboard interface
+ * it's important to use the name 'get_block' for being used from dashboard controller
* @return array column and content html
*/
- public function get_block() {
+ public function get_block()
+ {
global $charset;
-
$column = 1;
$data = array();
$students_attendance_graph = $this->get_students_attendance_graph();
@@ -90,10 +99,12 @@ class BlockStudentGraph extends Block {
}
/**
- * This method return a graph containing informations about students evaluation, it's used inside get_block method for showing it inside dashboard interface
+ * This method return a graph containing information about students evaluation,
+ * it's used inside get_block method for showing it inside dashboard interface
* @return string img html
*/
- public function get_students_attendance_graph() {
+ public function get_students_attendance_graph()
+ {
$students = $this->students;
$attendance = new Attendance();
@@ -138,7 +149,7 @@ class BlockStudentGraph extends Block {
// prepare cache for saving image
$graph_id = $this->user_id.'StudentEvaluationGraph'; // the graph id
- $cache = new pCache(api_get_path(SYS_ARCHIVE_PATH));
+ $cache = new pCache();
$data = $data_set->GetData(); // return $this->DataDescription
@@ -198,7 +209,8 @@ class BlockStudentGraph extends Block {
* Get number of students
* @return int
*/
- function get_number_of_students() {
+ function get_number_of_students()
+ {
return count($this->students);
}
-}
\ No newline at end of file
+}
diff --git a/plugin/dashboard/block_teacher/block_teacher.class.php b/plugin/dashboard/block_teacher/block_teacher.class.php
index 8ea2b24c5d..5e30feb30f 100644
--- a/plugin/dashboard/block_teacher/block_teacher.class.php
+++ b/plugin/dashboard/block_teacher/block_teacher.class.php
@@ -12,10 +12,12 @@
/**
* This class is used like controller for teacher block plugin,
- * the class name must be registered inside path.info file (e.g: controller = "BlockTeacher"), so dashboard controller will be instantiate it
+ * the class name must be registered inside path.info file
+ * (e.g: controller = "BlockTeacher"), so dashboard controller will be instantiate it
* @package chamilo.dashboard
*/
-class BlockTeacher extends Block {
+class BlockTeacher extends Block
+{
private $user_id;
private $teachers;
@@ -25,15 +27,12 @@ class BlockTeacher extends Block {
/**
* Controller
*/
- public function __construct ($user_id) {
+ public function __construct ($user_id)
+ {
$this->user_id = $user_id;
$this->path = 'block_teacher';
if ($this->is_block_visible_for_user($user_id)) {
- /*if (api_is_platform_admin()) {
- $this->teachers = UserManager::get_user_list(array('status' => COURSEMANAGER));
- } else {*/
- $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER);
- //}
+ $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER);
}
}
@@ -42,7 +41,8 @@ class BlockTeacher extends Block {
* @param int User id
* @return bool Is block visible for user
*/
- public function is_block_visible_for_user($user_id) {
+ public function is_block_visible_for_user($user_id)
+ {
$user_info = api_get_user_info($user_id);
$user_status = $user_info['status'];
$is_block_visible_for_user = false;
@@ -57,20 +57,16 @@ class BlockTeacher extends Block {
* it's important to use the name 'get_block' for beeing used from dashboard controller
* @return array column and content html
*/
- public function get_block() {
+ public function get_block()
+ {
global $charset;
-
$column = 1;
- $data = array();
-
- /*if (api_is_platform_admin()) {
- $teacher_content_html = $this->get_teachers_content_html_for_platform_admin();
- } else if (api_is_drh()) {*/
- $teacher_content_html = $this->get_teachers_content_html_for_drh();
- //}
+ $data = array();
+ $teacher_content_html = $this->get_teachers_content_html_for_drh();
- $html = '
';
}
$content .= '';
+
return $content;
}
@@ -186,7 +200,8 @@ class BlockTeacher extends Block {
* Get number of teachers
* @return int
*/
- function get_number_of_teachers() {
+ function get_number_of_teachers()
+ {
return count($this->teachers);
}
-}
\ No newline at end of file
+}
diff --git a/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php b/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php
index 7022937845..bd81c97a7d 100644
--- a/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php
+++ b/plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php
@@ -9,14 +9,20 @@
/**
* required files for getting data
*/
+require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
+require_once api_get_path(LIBRARY_PATH).'course.lib.php';
+require_once api_get_path(LIBRARY_PATH).'tracking.lib.php';
+require_once api_get_path(LIBRARY_PATH).'pchart/pData.class.php';
+require_once api_get_path(LIBRARY_PATH).'pchart/pChart.class.php';
+require_once api_get_path(LIBRARY_PATH).'pchart/pCache.class.php';
/**
* This class is used like controller for teacher graph block plugin,
* the class name must be registered inside path.info file (e.g: controller = "BlockTeacherGraph"), so dashboard controller will be instantiate it
* @package chamilo.dashboard
*/
-class BlockTeacherGraph extends Block {
-
+class BlockTeacherGraph extends Block
+{
private $user_id;
private $teachers;
private $path;
@@ -25,15 +31,12 @@ class BlockTeacherGraph extends Block {
/**
* Controller
*/
- public function __construct ($user_id) {
+ public function __construct ($user_id)
+ {
$this->user_id = $user_id;
$this->path = 'block_teacher_graph';
if ($this->is_block_visible_for_user($user_id)) {
- /*if (api_is_platform_admin()) {
- $this->teachers = UserManager::get_user_list(array('status' => COURSEMANAGER));
- } else {*/
- $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER);
- //}
+ $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER);
}
}
@@ -42,7 +45,8 @@ class BlockTeacherGraph extends Block {
* @param int User id
* @return bool Is block visible for user
*/
- public function is_block_visible_for_user($user_id) {
+ public function is_block_visible_for_user($user_id)
+ {
$user_info = api_get_user_info($user_id);
$user_status = $user_info['status'];
$is_block_visible_for_user = false;
@@ -57,41 +61,43 @@ class BlockTeacherGraph extends Block {
* it's important to use the name 'get_block' for beeing used from dashboard controller
* @return array column and content html
*/
- public function get_block() {
+ public function get_block()
+ {
global $charset;
$column = 1;
$data = array();
+ $teacher_information_graph = $this->get_teachers_information_graph();
+ $html = '
+
';
}
+
return $graph;
}
@@ -176,7 +185,9 @@ class BlockTeacherGraph extends Block {
* Get number of teachers
* @return int
*/
- function get_number_of_teachers() {
+ function get_number_of_teachers()
+ {
return count($this->teachers);
}
-}
\ No newline at end of file
+
+}
diff --git a/plugin/date/plugin.php b/plugin/date/plugin.php
index 2f0db43ca4..2822ac1cc6 100644
--- a/plugin/date/plugin.php
+++ b/plugin/date/plugin.php
@@ -1,4 +1,4 @@
-Plugins)
@@ -15,4 +15,4 @@ $plugin_info['comment']="Multinational date display";
//the plugin version
$plugin_info['version']='1.0';
//the plugin author
-$plugin_info['author']='Yannick Warnier';
\ No newline at end of file
+$plugin_info['author']='Yannick Warnier';
diff --git a/plugin/ext_auth_chamilo_logout_button_behaviour/index.php b/plugin/ext_auth_chamilo_logout_button_behaviour/index.php
index 5da0e9b154..a4749fe7f0 100755
--- a/plugin/ext_auth_chamilo_logout_button_behaviour/index.php
+++ b/plugin/ext_auth_chamilo_logout_button_behaviour/index.php
@@ -1,9 +1,12 @@
addElement('style_submit_button', 'submit_button', get_lang('Save'));
//get default value for form
$tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url');
$tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_infobulle = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_infobulle');
-$tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_image = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_image');
+$Tab_Default_Ext_Auth_Chamilo_Logout_Button_Behaviour_Eaclbb_Form_Link_Image = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_image');
$tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_onoff = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_onoff');
$tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_text = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_text');
$defaults['eaclbb_form_link_url'] = $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url['eaclbb_form_link_url'];
@@ -44,5 +43,5 @@ $form->setDefaults($defaults);
//display form
$plugin_info['settings_form'] = $form;
-//set the smarty templates that are going to be used
+// Set the templates that are going to be used
$plugin_info['templates'] = array('template.tpl');
diff --git a/plugin/formLogin_hide_unhide/plugin.php b/plugin/formLogin_hide_unhide/plugin.php
index a9dc57ec72..b7180590bc 100644
--- a/plugin/formLogin_hide_unhide/plugin.php
+++ b/plugin/formLogin_hide_unhide/plugin.php
@@ -9,8 +9,6 @@
* Plugin details (must be present)
*/
-
-
//the plugin title
$plugin_info['title'] = 'Hide/Unhide the Login/Password default form';
diff --git a/plugin/hello_world/index.php b/plugin/hello_world/index.php
index 3d74c3029f..4b1f02967a 100644
--- a/plugin/hello_world/index.php
+++ b/plugin/hello_world/index.php
@@ -3,13 +3,13 @@
* @package chamilo.plugin.hello_world
*/
-// See also the share_user_info plugin
+// See also the share_user_info plugin
echo '
';
if (!empty($plugin_info['settings']['hello_world_show_type'])) {
echo "
';
foreach ($courses as $key => $course)
@@ -262,13 +262,13 @@ EOT;
}
/**
- * Displays the subscribe icon if subscribing is allowed and
+ * Displays the subscribe icon if subscribing is allowed and
* if the user is not yet subscribed to this course
- *
+ *
* @global type $stok
* @param array $current_course
* @param array $user_courses
- * @return bool
+ * @return bool
*/
function display_subscribe_icon($current_course, $user_courses)
{
@@ -289,7 +289,7 @@ EOT;
return false;
}
- //Subscribe form
+ //Subscribe form
$self = $_SERVER['PHP_SELF'];
echo <<
@@ -307,10 +307,10 @@ EOT;
EOT;
}
- $web_path = api_get_path(WEB_IMG_PATH);
+ $web_path = api_get_path(WEB_PATH);
$subscribe_label = get_lang('Subscribe');
echo <<$subscribe_label
+ $subscribe_label
EOT;
return true;
@@ -323,9 +323,9 @@ EOT;
/**
* Search courses that match the search term.
* Search is done on the code, title and tutor fields.
- *
- * @param string $search_term
- * @return array
+ *
+ * @param string $search_term
+ * @return array
*/
function retrieve_courses($search_term)
{
@@ -348,9 +348,9 @@ EOT;
}
$sql = <<get_info();
\ No newline at end of file
diff --git a/plugin/share_buttons/plugin.php b/plugin/share_buttons/plugin.php
index 7fb406420f..52eda64478 100755
--- a/plugin/share_buttons/plugin.php
+++ b/plugin/share_buttons/plugin.php
@@ -1,20 +1,20 @@
Plugins)
* @package chamilo.plugin
* @author Julio Montoya
*/
/* Plugin config */
-//the plugin title
+// The plugin title.
$plugin_info['title'] = 'Share this page';
-//the comments that go with the plugin
+// The comments that go with the plugin.
$plugin_info['comment'] = "Show social icons to share a page using addthis.com";
-//the plugin version
+// The plugin version.
$plugin_info['version'] = '1.0';
-//the plugin author
+// The plugin author.
$plugin_info['author'] = 'Julio Montoya';
-//For bigger icons change this value to addthis_32x32_style
-$plugin_info['icon_class'] = '';
+// For bigger icons change this value to addthis_32x32_style
+$plugin_info['icon_class'] = '';
diff --git a/plugin/show_regions/index.php b/plugin/show_regions/index.php
index 5d41562f5a..2d2a43e0b0 100644
--- a/plugin/show_regions/index.php
+++ b/plugin/show_regions/index.php
@@ -1,9 +1,9 @@
';
//We can have access to the current block and the block information with the variable $plugin_info (see your plugin.php)
echo $plugin_info['current_region'];
- echo '';
+ echo '';
}
\ No newline at end of file
diff --git a/plugin/show_user_info/index.php b/plugin/show_user_info/index.php
index 68b86a68ad..40c71f0d04 100644
--- a/plugin/show_user_info/index.php
+++ b/plugin/show_user_info/index.php
@@ -1,18 +1,17 @@
get_content();
-
$title = $plugin->get_block_title();
$title = $title ? "
$title
" : '';
diff --git a/plugin/static/lib/static_plugin.class.php b/plugin/static/lib/static_plugin.class.php
index 9f9018bd9d..39ca774328 100644
--- a/plugin/static/lib/static_plugin.class.php
+++ b/plugin/static/lib/static_plugin.class.php
@@ -9,10 +9,9 @@
*/
class StaticPlugin extends Plugin
{
-
/**
*
- * @return StaticPlugin
+ * @return StaticPlugin
*/
static function create()
{
@@ -35,4 +34,4 @@ class StaticPlugin extends Plugin
parent::__construct('1.1', 'Laurent Opprecht', array('block_title' => 'text', 'content' => 'wysiwyg'));
}
-}
\ No newline at end of file
+}
diff --git a/plugin/static/plugin.php b/plugin/static/plugin.php
index 8a1df4011b..011e20bd16 100644
--- a/plugin/static/plugin.php
+++ b/plugin/static/plugin.php
@@ -6,6 +6,7 @@
* @author Laurent Opprecht
*/
+require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
require_once dirname(__FILE__) . '/lib/static_plugin.class.php';
$plugin_info = StaticPlugin::create()->get_info();
\ No newline at end of file
diff --git a/plugin/ticket/config.install.php b/plugin/ticket/config.install.php
new file mode 100644
index 0000000000..03a683fc16
--- /dev/null
+++ b/plugin/ticket/config.install.php
@@ -0,0 +1,10 @@
+install();
\ No newline at end of file
diff --git a/plugin/ticket/lang/english.php b/plugin/ticket/lang/english.php
new file mode 100644
index 0000000000..f68bac5d88
--- /dev/null
+++ b/plugin/ticket/lang/english.php
@@ -0,0 +1,35 @@
+Estimado(a):
';
+
+}
+/**
+ * Get the total number of users on the platform
+ * @see SortableTable#get_total_number_of_items()
+ */
+function get_number_of_users() {
+ $user_table = Database :: get_main_table(TABLE_MAIN_USER);
+ $sql = "SELECT COUNT(u.user_id) AS total_number_of_items FROM $user_table u";
+ if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
+ $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
+ $sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.user_id=url_rel_user.user_id)";
+ }
+ if ( isset ($_GET['keyword'])) {
+ $keyword = Database::escape_string(trim($_GET['keyword']));
+ $sql .= " WHERE (u.firstname LIKE '%".$keyword."%' OR u.lastname LIKE '%".$keyword."%' OR concat(u.firstname,' ',u.lastname) LIKE '%".$keyword."%' OR concat(u.lastname,' ',u.firstname) LIKE '%".$keyword."%' OR u.username LIKE '%".$keyword."%' OR u.email LIKE '%".$keyword."%' OR u.official_code LIKE '%".$keyword."%') ";
+ }
+ $res = Database::query($sql);
+ $obj = Database::fetch_object($res);
+ return $obj->total_number_of_items;
+}
+/**
+ * Get the users to display on the current page (fill the sortable-table)
+ * @param int offset of first user to recover
+ * @param int Number of users to get
+ * @param int Column to sort on
+ * @param string Order (ASC,DESC)
+ * @see SortableTable#get_table_data($from)
+ */
+function get_user_data($from, $number_of_items, $column, $direction)
+{
+ $user_table = Database :: get_main_table(TABLE_MAIN_USER);
+ $admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN);
+ $sql = "SELECT
+ u.user_id AS col0,
+ u.official_code AS col2,
+ ".(api_is_western_name_order()
+ ? "u.firstname AS col3,
+ u.lastname AS col4,"
+ : "u.lastname AS col3,
+ u.firstname AS col4,")."
+ u.username AS col5,
+ u.email AS col6,
+ u.status AS col7,
+ u.active AS col8,
+ u.user_id AS col9 ".
+ ", u.expiration_date AS exp ".
+ " FROM $user_table u ";
+
+ if (isset ($_GET['keyword']) ) {
+ $keyword = Database::escape_string(trim($_GET['keyword']));
+ $sql .= " WHERE (u.firstname LIKE '%".$keyword."%' OR u.lastname LIKE '%".$keyword."%' OR concat(u.firstname,' ',u.lastname) LIKE '%".$keyword."%' OR concat(u.lastname,' ',u.firstname) LIKE '%".$keyword."%' OR u.username LIKE '%".$keyword."%' OR u.official_code LIKE '%".$keyword."%' OR u.email LIKE '%".$keyword."%' )";
+ }
+ if (!in_array($direction, array('ASC','DESC'))) {
+ $direction = 'ASC';
+ }
+ $column = intval($column);
+ $from = intval($from);
+ $number_of_items = intval($number_of_items);
+
+ $sql .= " ORDER BY col$column $direction ";
+ $sql .= " LIMIT $from,$number_of_items";
+
+ $res = Database::query($sql);
+
+ $users = array ();
+ $t = time();
+ while ($user = Database::fetch_row($res)) {
+ $image_path = UserManager::get_user_picture_path_by_id($user[0], 'web', false, true);
+ $user_profile = UserManager::get_picture_user($user[0], $image_path['file'], 22, USER_IMAGE_SIZE_SMALL, ' width="22" height="22" ');
+ if (!api_is_anonymous()) {
+ $photo = '