Replacing event_access_tool with Event::event_access_tool

1.10.x
Julio Montoya 12 years ago
parent 11169305bf
commit f595e3a357
  1. 2
      main/announcements/announcements.php
  2. 4
      main/attendance/layout.php
  3. 2
      main/calendar/agenda.php
  4. 2
      main/chat/chat.php
  5. 34
      main/course_description/ajax_controller.class.php
  6. 54
      main/course_description/controller.class.php
  7. 6
      main/course_description/layout.php
  8. 6
      main/course_progress/layout.php
  9. 2
      main/course_progress/layout_no_header.php
  10. 2
      main/document/create_audio.php
  11. 2
      main/document/create_draw.php
  12. 2
      main/document/create_paint.php
  13. 2
      main/document/document_lite.php
  14. 2
      main/document/edit_document.php
  15. 2
      main/document/edit_draw.php
  16. 2
      main/document/edit_paint.php
  17. 2
      main/document/record_audio.php
  18. 2
      main/document/record_audio_wami.php
  19. 2
      main/document/webcam_clip.php
  20. 2
      main/dropbox/index.php
  21. 2
      main/forum/forumsearch.php
  22. 2
      main/forum/index.php
  23. 16
      main/glossary/ajax_controller.class.php
  24. 36
      main/glossary/controller.class.php
  25. 2
      main/glossary/index.php
  26. 36
      main/link/ajax_controller.class.php
  27. 46
      main/link/controller.class.php
  28. 2
      main/link/link.php
  29. 2
      main/newscorm/lp_edit.php
  30. 2
      main/newscorm/lp_list.php
  31. 2
      main/newscorm/lp_list_search.php
  32. 18
      main/notebook/ajax_controller.class.php
  33. 38
      main/notebook/controller.class.php
  34. 2
      main/notebook/index.php
  35. 2
      main/survey/survey_list.php
  36. 2
      main/upload/index.php
  37. 2
      main/upload/upload_ppt.php
  38. 2
      main/upload/upload_word.php
  39. 2
      main/user/user.php
  40. 2
      main/wiki/index.php
  41. 2
      main/work/work.php

@ -56,7 +56,7 @@ $tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
$course_id = api_get_course_int_id();
/* Tracking */
event_access_tool(TOOL_ANNOUNCEMENT);
Event::event_access_tool(TOOL_ANNOUNCEMENT);
if (!empty($_POST['To'])) {
if (api_get_session_id() != 0 && api_is_allowed_to_session_edit(false, true) == false) {

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
/**
* Layout (principal view) used for structuring other views
* Layout (principal view) used for structuring other views
* @author Christian Fasanando <christian1827@gmail.com>
* @package chamilo.attendace
*/
@ -19,7 +19,7 @@ Display :: display_header('');
Display::display_introduction_section($tool);
// Tracking
event_access_tool($tool);
Event::event_access_tool($tool);
// Display
echo $content;

@ -63,7 +63,7 @@ function plus_repeated_event() {
// setting the name of the tool
$nameTools = get_lang('Agenda');
event_access_tool(TOOL_CALENDAR_EVENT);
Event::event_access_tool(TOOL_CALENDAR_EVENT);
// permission stuff - also used by loading from global in agenda.inc.php
$is_allowed_to_edit = api_is_allowed_to_edit(false, true) OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous());

@ -30,7 +30,7 @@ if ($origin != 'whoisonline') {
/* TRACKING */
event_access_tool(TOOL_CHAT);
Event::event_access_tool(TOOL_CHAT);
header('Content-Type: text/html; charset='.api_get_system_encoding());
/*

@ -19,14 +19,14 @@ use Header;
/**
* Ajax controller. Dispatch request and perform required action.
*
* - delete category/link
*
*
* - delete category/link
*
* Usage:
*
*
* $controller = AjaxController::instance();
* $controller->run();
*
*
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Genevas
* @license /license.txt
*/
@ -38,7 +38,7 @@ class AjaxController extends \Controller
/**
* Return the instance of the controller.
*
*
* @return \CourseDescription\AjaxController
*/
public static function instance()
@ -52,15 +52,15 @@ class AjaxController extends \Controller
protected function __construct()
{
}
/**
* Prepare the environment. Set up breadcrumps and raise tracking event.
* Prepare the environment. Set up breadcrumps and raise tracking event.
*/
protected function prolog()
{
event_access_tool(TOOL_COURSE_DESCRIPTION);
Event::event_access_tool(TOOL_COURSE_DESCRIPTION);
}
public function is_allowed_to_edit()
@ -79,7 +79,7 @@ class AjaxController extends \Controller
}
return true;
}
public function authorize()
{
$authorize = api_protect_course_script();
@ -102,7 +102,7 @@ class AjaxController extends \Controller
}
/**
*
*
*/
public function delete()
{
@ -120,7 +120,7 @@ class AjaxController extends \Controller
$this->response($success);
}
/**
*
*
*/
public function delete_by_course()
{
@ -128,11 +128,11 @@ class AjaxController extends \Controller
$this->forbidden();
return;
}
$course = (object) array();
$course->c_id = Request::get_c_id();
$course->session_id = Request::get_session_id();
$success = CourseDescription::repository()->remove_by_course($course);
$this->response($success);
@ -149,7 +149,7 @@ class AjaxController extends \Controller
}
/**
* Action exists but implementation is missing.
* Action exists but implementation is missing.
*/
public function missing()
{
@ -158,9 +158,9 @@ class AjaxController extends \Controller
/**
* Display a standard json responce.
*
*
* @param bool $success
* @param string $message
* @param string $message
* @param object $data
*/
public function response($success = false, $message = '', $data = null)

@ -13,18 +13,18 @@ use Javascript;
/**
* Controller for course description. Dispatch request and peform required action.
*
*
* - list course description for course
* - add a new course description to a course/session
* - edit a course session
* - delete a course session
*
*
* Usage:
*
*
* $controller = CourseDescriptionController::instance();
* $controller->run();
*
* @package chamilo.course_description
*
* @package chamilo.course_description
* @author Christian Fasanando <christian1827@gmail.com>
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Genevas
* @license see /license.txt
@ -42,8 +42,8 @@ class Controller extends \Controller
/**
* Return the instance of the controller.
*
* @return CourseDescriptionController
*
* @return CourseDescriptionController
*/
public static function instance()
{
@ -56,13 +56,13 @@ class Controller extends \Controller
protected function __construct()
{
}
/**
* Action to perform.
* Action to perform.
* Returns the request parameter.
*
*
* @return string
*/
public function get_action()
@ -95,8 +95,8 @@ class Controller extends \Controller
/**
* Whether the call is authorized or not.
*
* @return boolean
*
* @return boolean
*/
public function authorize()
{
@ -114,7 +114,7 @@ class Controller extends \Controller
}
/**
* Prepare the environment. Set up breadcrumps and raise tracking event.
* Prepare the environment. Set up breadcrumps and raise tracking event.
*/
protected function prolog()
{
@ -135,12 +135,12 @@ class Controller extends \Controller
$current_course_tool = TOOL_COURSE_DESCRIPTION;
// Tracking
event_access_tool(TOOL_COURSE_DESCRIPTION);
Event::event_access_tool(TOOL_COURSE_DESCRIPTION);
}
/**
* Javascript used by the controller
*
*
* @return string
*/
public function javascript()
@ -156,10 +156,10 @@ class Controller extends \Controller
/**
* Returns a url for an action that the controller can process
*
*
* @param string $action
* @param array $params
* @return string
* @return string
*/
public function url($action = '', $params = array())
{
@ -185,8 +185,8 @@ class Controller extends \Controller
/**
* List course descriptions.
*
* @param array messages
*
* @param array messages
*/
public function listing()
{
@ -203,7 +203,7 @@ class Controller extends \Controller
}
/**
* Performs the edit action.
* Performs the edit action.
*/
public function edit()
{
@ -211,7 +211,7 @@ class Controller extends \Controller
$this->forbidden();
return;
}
$id = Request::get_id();
$c_id = Request::get_c_id();
@ -223,13 +223,13 @@ class Controller extends \Controller
if ($form->validate()) {
$success = $repo->save($description);
$message = $success ? get_lang('DescriptionUpdated') : get_lang('Error');
$home = $this->url(self::ACTION_DEFAULT);
Redirect::go($home);
}
$data = (object) array();
$data->form = $form;
$this->render('edit', $data);
@ -285,7 +285,7 @@ class Controller extends \Controller
/**
* Performs the delete action.
*
*
* @todo: could be worth to require a security token in the url and check it. Currently confirmation is done through javascript confirmation only.
*/
public function delete()
@ -344,7 +344,7 @@ class Controller extends \Controller
$path = $file->tmp_name;
$reader = new CsvReader($path);
$descriptions = $reader->get_items();
$c_id = Request::get_c_id();
$session_id = Request::get_session_id();
$course = (object) array();
@ -364,10 +364,10 @@ class Controller extends \Controller
/**
* Render a template using data. Adds a few common parameters to the data array.
*
*
* @see /main/template/default/course_description/
* @param string $template
* @param array $data
* @param array $data
*/
protected function render($template, $data)
{

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
/**
* Layout (principal view) used for structuring other views
* Layout (principal view) used for structuring other views
* @author Christian Fasanando <christian1827@gmail.com>
* @package chamilo.course_description
*/
@ -17,10 +17,10 @@ Display :: display_header('');
Display::display_introduction_section(TOOL_COURSE_DESCRIPTION);
// Tracking
event_access_tool(TOOL_COURSE_DESCRIPTION);
Event::event_access_tool(TOOL_COURSE_DESCRIPTION);
// Display
echo $content;
// Footer
Display :: display_footer();
Display :: display_footer();

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
/**
* Layout (principal view) used for structuring other views
* Layout (principal view) used for structuring other views
* @author Christian Fasanando <christian1827@gmail.com>
* @package chamilo.course_progress
*/
@ -18,10 +18,10 @@ Display :: display_header('');
Display::display_introduction_section($tool);
// Tracking
event_access_tool($tool);
Event::event_access_tool($tool);
// Display
echo $content;
// Footer
Display :: display_footer();
Display :: display_footer();

@ -7,7 +7,7 @@ api_protect_course_script(true);
Display :: display_reduced_header();
// Tracking
event_access_tool($tool);
Event::event_access_tool($tool);
// Display

@ -101,7 +101,7 @@ if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_m
/* Header */
event_access_tool(TOOL_DOCUMENT);
Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir;
if (isset ($group)) {

@ -102,7 +102,7 @@ if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_m
/* Header */
event_access_tool(TOOL_DOCUMENT);
Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir;
if (isset ($group)) {
$display_dir = explode('/', $dir);

@ -102,7 +102,7 @@ if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_m
/* Header */
event_access_tool(TOOL_DOCUMENT);
Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir;
if (isset ($group)) {
$display_dir = explode('/', $dir);

@ -326,7 +326,7 @@ $(document).ready( function() {
// Lib for event log, stats & tracking & record of the access
event_access_tool(TOOL_DOCUMENT);
Event::event_access_tool(TOOL_DOCUMENT);
/* DISPLAY */
if ($to_group_id != 0) { // Add group name after for group documents

@ -180,7 +180,7 @@ if (!$is_allowed_to_edit) {
api_not_allowed(true);
}
event_access_tool(TOOL_DOCUMENT);
Event::event_access_tool(TOOL_DOCUMENT);
//TODO:check the below code and his functionality
if (!api_is_allowed_to_edit()) {

@ -121,7 +121,7 @@ if (!$is_allowedToEdit) {
api_not_allowed(true);
}
event_access_tool(TOOL_DOCUMENT);
Event::event_access_tool(TOOL_DOCUMENT);
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';

@ -124,7 +124,7 @@ if (!$is_allowedToEdit) {
api_not_allowed(true);
}
event_access_tool(TOOL_DOCUMENT);
Event::event_access_tool(TOOL_DOCUMENT);
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';

@ -90,7 +90,7 @@ if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_m
/* Header */
event_access_tool(TOOL_DOCUMENT);
Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir;
if (isset ($group)) {

@ -98,7 +98,7 @@ if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_m
/* Header */
event_access_tool(TOOL_DOCUMENT);
Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir;
if (isset ($group)) {

@ -97,7 +97,7 @@ if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_m
/* Header */
event_access_tool(TOOL_DOCUMENT);
Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir;
if (isset ($group)) {

@ -18,7 +18,7 @@ $viewReceivedCategory = isset($_GET['view_received_category']) ? Security::remov
$viewSentCategory = isset($_GET['view_sent_category']) ? Security::remove_XSS($_GET['view_sent_category']) : null;
// Do the tracking
event_access_tool(TOOL_DROPBOX);
Event::event_access_tool(TOOL_DROPBOX);
// This var is used to give a unique value to every page request. This is to prevent resubmiting data
$dropbox_unid = md5(uniqid(rand(), true));

@ -94,7 +94,7 @@ if ($origin == 'learnpath') {
Display::display_introduction_section(TOOL_FORUM);
// Tracking
event_access_tool(TOOL_FORUM);
Event::event_access_tool(TOOL_FORUM);
// Forum search
forum_search();

@ -119,7 +119,7 @@ $whatsnew_post_info = Session::read('whatsnew_post_info');
/* TRACKING */
event_access_tool(TOOL_FORUM);
Event::event_access_tool(TOOL_FORUM);
/*
RETRIEVING ALL THE FORUM CATEGORIES AND FORUMS

@ -18,16 +18,16 @@ use Header;
/**
* Ajax controller. Dispatch request and perform required action.
*
*
* - delete one glossary entry
* - delete all glossary entried in a course/session
* - returns a glossary entry from its id
*
*
* Usage:
*
*
* $controller = AjaxController::instance();
* $controller->run();
*
*
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Genevas
* @license /license.txt
*/
@ -40,7 +40,7 @@ class AjaxController extends \AjaxController
/**
* Return the instance of the controller.
*
*
* @return \Glossary\AjaxController
*/
public static function instance()
@ -53,12 +53,12 @@ class AjaxController extends \AjaxController
}
/**
* Prepare the environment. Set up breadcrumps and raise tracking event.
* Prepare the environment. Set up breadcrumps and raise tracking event.
*/
protected function prolog()
{
event_access_tool(TOOL_GLOSSARY);
}
Event::event_access_tool(TOOL_GLOSSARY);
}
public function is_allowed_to_edit()
{

@ -21,17 +21,17 @@ use Javascript;
/**
* Controller for glossary. Dispatch request and peform required action.
*
*
* - list glossary entries for course
* - add/edit glossary entry
* - change view from table to details
*
*
* Usage:
*
*
* $controller = Controller::instance();
* $controller->run();
*
* @package chamilo.course_description
*
* @package chamilo.course_description
* @author Christian Fasanando <christian1827@gmail.com>
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Genevas
* @license see /license.txt
@ -49,7 +49,7 @@ class Controller extends \Controller
/**
* Return the instance of the controller.
*
*
* @return \Glossary\Controller
*/
public static function instance()
@ -62,9 +62,9 @@ class Controller extends \Controller
}
/**
* Action to perform.
* Action to perform.
* Returns the request parameter.
*
*
* @return string
*/
public function get_action()
@ -84,7 +84,7 @@ class Controller extends \Controller
}
/**
* Prepare the environment. Set up breadcrumps and raise tracking event.
* Prepare the environment. Set up breadcrumps and raise tracking event.
*/
protected function prolog()
{
@ -100,15 +100,15 @@ class Controller extends \Controller
$current_course_tool = TOOL_GLOSSARY;
// Tracking
event_access_tool(TOOL_GLOSSARY);
Event::event_access_tool(TOOL_GLOSSARY);
}
/**
* Returns a url for an action that the controller can process
*
*
* @param string $action
* @param array $params
* @return string
* @return string
*/
public function url($action = '', $params = array())
{
@ -136,8 +136,8 @@ class Controller extends \Controller
/**
* List course descriptions.
*
* @param array messages
*
* @param array messages
*/
public function index()
{
@ -156,7 +156,7 @@ class Controller extends \Controller
}
/**
* Performs the edit action.
* Performs the edit action.
*/
public function edit()
{
@ -226,7 +226,7 @@ class Controller extends \Controller
/**
* Performs the delete action.
*
*
* @see AjaxController
*/
public function delete()
@ -288,10 +288,10 @@ class Controller extends \Controller
/**
* Render a template using data. Adds a few common parameters to the data array.
*
*
* @see /main/template/default/course_description/
* @param string $template
* @param array $data
* @param array $data
*/
protected function render($template, $data)
{

@ -34,7 +34,7 @@ $(document).ready(function () {
$tool = TOOL_GLOSSARY;
// Tracking
event_access_tool(TOOL_GLOSSARY);
Event::event_access_tool(TOOL_GLOSSARY);
function sorter($item1, $item2) {
if ($item1[2] == $item2[2])

@ -21,16 +21,16 @@ use Header;
/**
* Ajax controller. Dispatch request and perform required action.
*
* - delete category/link
*
* - delete category/link
* - hide/show link
* - sort links/categories
*
*
* Usage:
*
*
* $controller = AjaxController::instance();
* $controller->run();
*
*
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Genevas
* @license /license.txt
*/
@ -48,7 +48,7 @@ class AjaxController extends \Controller
/**
* Return the instance of the controller.
*
*
* @return \Link\AjaxController
*/
public static function instance()
@ -62,15 +62,15 @@ class AjaxController extends \Controller
protected function __construct()
{
}
/**
* Prepare the environment. Set up breadcrumps and raise tracking event.
* Prepare the environment. Set up breadcrumps and raise tracking event.
*/
protected function prolog()
{
event_access_tool(TOOL_LINK);
Event::event_access_tool(TOOL_LINK);
}
public function authorize()
@ -113,7 +113,7 @@ class AjaxController extends \Controller
}
/**
*
*
*/
public function hide_link()
{
@ -131,7 +131,7 @@ class AjaxController extends \Controller
}
/**
*
*
*/
public function show_link()
{
@ -149,7 +149,7 @@ class AjaxController extends \Controller
}
/**
*
*
*/
public function delete_link()
{
@ -168,7 +168,7 @@ class AjaxController extends \Controller
}
/**
*
*
*/
public function delete_category()
{
@ -186,7 +186,7 @@ class AjaxController extends \Controller
$this->response($success);
}
/**
*
*
*/
public function delete_by_course()
{
@ -250,7 +250,7 @@ class AjaxController extends \Controller
$repo = LinkRepository::instance();
$link = $repo->find_one_by_id($c_id, $id);
$success = $link ? $link->validate() : false;
$this->response($success);
}
@ -265,7 +265,7 @@ class AjaxController extends \Controller
}
/**
* Action exists but implementation is missing.
* Action exists but implementation is missing.
*/
public function missing()
{
@ -274,9 +274,9 @@ class AjaxController extends \Controller
/**
* Display a standard json responce.
*
*
* @param bool $success
* @param string $message
* @param string $message
* @param object $data
*/
public function response($success = false, $message = '', $data = null)

@ -18,16 +18,16 @@ use Header;
/**
* Html controller. Dispatch request and perform required action:
*
*
* - list
* - add/edit/delete link
* - add/edit/delete category
* - make visible/invisible link
* - go to link target
*
*
* Note:
* Currently some actions are only implemented in the Ajax controller.
*
*
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Genevas
* @license /license.txt
*/
@ -50,7 +50,7 @@ class Controller extends \Controller
const ACTION_DEFAULT = 'listing';
/**
*
*
* @return \Link\Controller
*/
public static function instance()
@ -82,9 +82,9 @@ class Controller extends \Controller
}
/**
* Action to perform.
* Action to perform.
* Returns the request parameter.
*
*
* @return string
*/
public function get_action()
@ -101,7 +101,7 @@ class Controller extends \Controller
public function prolog()
{
event_access_tool(TOOL_LINK);
Event::event_access_tool(TOOL_LINK);
//legacy
global $interbreadcrumb;
@ -118,8 +118,8 @@ class Controller extends \Controller
/**
* Whether the call is authorized or not.
*
* @return boolean
*
* @return boolean
*/
public function authorize()
{
@ -138,7 +138,7 @@ class Controller extends \Controller
/**
* Javascript used by the controller
*
*
* @return string
*/
public function javascript()
@ -153,10 +153,10 @@ class Controller extends \Controller
/**
* Returns a url for an action that the controller can process
*
*
* @param string $action
* @param array $params
* @return string
* @return string
*/
public function url($action, $params = array())
{
@ -213,7 +213,7 @@ class Controller extends \Controller
$link->c_id = Request::get_c_id();
$link->session_id = Request::get_session_id();
/**
* @todo: ensure session_id is correctly defaulted
* @todo: ensure session_id is correctly defaulted
*/
$action = $this->url(self::ACTION_ADD_LINK);
$form = new LinkForm('link', 'post', $action);
@ -242,13 +242,13 @@ class Controller extends \Controller
if (!$this->is_allowed_to_edit()) {
$this->forbidden();
return;
}
}
$action = $this->url(self::ACTION_IMPORT_CSV);
$form = new UploadFileForm('import_csv', 'post', $action);
$form->init();
if ($form->validate()) {
$file = $form->get_file();
$file = $form->get_file();
$path = $file['tmp_name'];
$c_id = Request::get_c_id();
$session_id = Request::get_session_id();
@ -310,7 +310,7 @@ class Controller extends \Controller
$writer->put($data);
}
}
\DocumentManager :: file_send_for_download($temp, true, get_lang('Links').'.csv');
}
@ -322,7 +322,7 @@ class Controller extends \Controller
}
/**
* See AjaxController
* See AjaxController
*/
$this->missing();
}
@ -369,7 +369,7 @@ class Controller extends \Controller
}
/**
* See AjaxController
* See AjaxController
*/
$this->missing();
}
@ -382,7 +382,7 @@ class Controller extends \Controller
}
/**
* See AjaxController
* See AjaxController
*/
$this->missing();
}
@ -495,15 +495,15 @@ class Controller extends \Controller
/**
* Render a template using data. Adds a few common parameters to the data array.
*
*
* @see /main/template/default/course_description/
* @param string $template
* @param array $data
* @param array $data
*/
protected function render($template, $data)
{
$data = $data ? $data : (object) array();
$_user = api_get_user_info();
$session_id = Request::get_session_id();
$data->session_image = api_get_session_image($session_id, $_user);

@ -102,7 +102,7 @@ $tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY);
$course_id = api_get_course_int_id();
// Statistics
event_access_tool(TOOL_LINK);
Event::event_access_tool(TOOL_LINK);
Display::display_header($nameTools, 'Links');

@ -13,7 +13,7 @@ global $charset;
$show_description_field = false; //for now
$nameTools = get_lang('Doc');
$this_section = SECTION_COURSES;
event_access_tool(TOOL_LEARNPATH);
Event::event_access_tool(TOOL_LEARNPATH);
api_protect_course_script();

@ -38,7 +38,7 @@ function confirmation(name) {
</script>";
$nameTools = get_lang('LearningPaths');
event_access_tool(TOOL_LEARNPATH);
Event::event_access_tool(TOOL_LEARNPATH);
api_protect_course_script();

@ -17,7 +17,7 @@ require api_get_path(LIBRARY_PATH).'search/ChamiloQuery.php';
require_once api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php';
require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
event_access_tool(TOOL_SEARCH);
Event::event_access_tool(TOOL_SEARCH);
if (isset($_SESSION['gradebook'])){
$gradebook = $_SESSION['gradebook'];

@ -11,16 +11,16 @@ use Header;
/**
* Ajax controller. Dispatch request and perform required action.
*
*
* - delete one note
* - delete all notes in a course/session
* - returns a note from its id
*
*
* Usage:
*
*
* $controller = AjaxController::instance();
* $controller->run();
*
*
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Genevas
* @license /license.txt
*/
@ -33,7 +33,7 @@ class AjaxController extends \AjaxController
/**
* Return the instance of the controller.
*
*
* @return \Notebook\AjaxController
*/
public static function instance()
@ -46,12 +46,12 @@ class AjaxController extends \AjaxController
}
/**
* Prepare the environment. Set up breadcrumps and raise tracking event.
* Prepare the environment. Set up breadcrumps and raise tracking event.
*/
protected function prolog()
{
event_access_tool(TOOL_NOTEBOOK);
}
Event::event_access_tool(TOOL_NOTEBOOK);
}
public function is_allowed_to_edit()
{
@ -105,4 +105,4 @@ class AjaxController extends \AjaxController
$this->response($success, '', $data);
}
}
}

@ -14,17 +14,17 @@ use Javascript;
/**
* Controller for notebook. Dispatch request and peform required action.
*
*
* - list notes for course
* - add/edit notes entry
* - change view from table to details
*
*
* Usage:
*
*
* $controller = Controller::instance();
* $controller->run();
*
* @package chamilo.course_description
*
* @package chamilo.course_description
* @author Christian Fasanando <christian1827@gmail.com>
* @author Laurent Opprecht <laurent@opprecht.info> for the Univesity of Genevas
* @license see /license.txt
@ -42,7 +42,7 @@ class Controller extends \Controller
/**
* Return the instance of the controller.
*
*
* @return \Noteboook\Controller
*/
public static function instance()
@ -55,9 +55,9 @@ class Controller extends \Controller
}
/**
* Action to perform.
* Action to perform.
* Returns the request parameter.
*
*
* @return string
*/
public function get_action()
@ -77,7 +77,7 @@ class Controller extends \Controller
}
/**
* Prepare the environment. Set up breadcrumps and raise tracking event.
* Prepare the environment. Set up breadcrumps and raise tracking event.
*/
protected function prolog()
{
@ -93,15 +93,15 @@ class Controller extends \Controller
$current_course_tool = TOOL_NOTEBOOK;
// Tracking
event_access_tool(TOOL_NOTEBOOK);
Event::event_access_tool(TOOL_NOTEBOOK);
}
/**
* Returns a url for an action that the controller can process
*
*
* @param string $action
* @param array $params
* @return string
* @return string
*/
public function url($action = '', $params = array())
{
@ -129,8 +129,8 @@ class Controller extends \Controller
/**
* List course descriptions.
*
* @param array messages
*
* @param array messages
*/
public function index()
{
@ -154,7 +154,7 @@ class Controller extends \Controller
}
/**
* Performs the edit action.
* Performs the edit action.
*/
public function edit()
{
@ -224,7 +224,7 @@ class Controller extends \Controller
/**
* Performs the delete action.
*
*
* @see AjaxController
*/
public function delete()
@ -286,10 +286,10 @@ class Controller extends \Controller
/**
* Render a template using data. Adds a few common parameters to the data array.
*
*
* @see /main/template/default/course_description/
* @param string $template
* @param array $data
* @param array $data
*/
protected function render($template, $data)
{
@ -309,4 +309,4 @@ class Controller extends \Controller
parent::render("notebook/$template.tpl", $data);
}
}
}

@ -37,7 +37,7 @@ $(document).ready(function () {
$tool = TOOL_NOTEBOOK;
// Tracking
event_access_tool(TOOL_NOTEBOOK);
Event::event_access_tool(TOOL_NOTEBOOK);
// Tool name
if (isset($_GET['action']) && $_GET['action'] == 'addnote') {

@ -29,7 +29,7 @@ api_protect_course_script(true);
require_once 'survey.lib.php';
// Tracking
event_access_tool(TOOL_SURVEY);
Event::event_access_tool(TOOL_SURVEY);
/** @todo This has to be moved to a more appropriate place (after the display_header of the code)*/
if (!api_is_allowed_to_edit(false, true)) { // Coach can see this

@ -90,7 +90,7 @@ if (isset($_REQUEST['tool'])) {
/**
* Process
*/
event_access_tool(TOOL_UPLOAD);
Event::event_access_tool(TOOL_UPLOAD);
/**
* Prepare the header

@ -67,7 +67,7 @@ if (isset($_POST['convert'])) {
}
}
event_access_tool(TOOL_UPLOAD);
Event::event_access_tool(TOOL_UPLOAD);
// check access permissions (edit permission is needed to add a document or a LP)
$is_allowed_to_edit = api_is_allowed_to_edit();

@ -81,7 +81,7 @@ if (isset($_POST['convert'])) {
}
}
event_access_tool(TOOL_UPLOAD);
Event::event_access_tool(TOOL_UPLOAD);
// check access permissions (edit permission is needed to add a document or a LP)

@ -373,7 +373,7 @@ if (isset($origin) && $origin == 'learnpath') {
}
//statistics
event_access_tool(TOOL_USER);
Event::event_access_tool(TOOL_USER);
/* Setting the permissions for this page */
$is_allowed_to_track = (api_is_course_admin() || $is_courseTutor);

@ -73,7 +73,7 @@ api_protect_course_script();
api_block_anonymous_users();
/* TRACKING */
event_access_tool(TOOL_WIKI);
Event::event_access_tool(TOOL_WIKI);
if ($groupId) {
$group_properties = GroupManager::get_group_properties($groupId);

@ -228,7 +228,7 @@ if (!empty($group_id)) {
}
//stats
event_access_tool(TOOL_STUDENTPUBLICATION);
Event::event_access_tool(TOOL_STUDENTPUBLICATION);
$is_allowed_to_edit = api_is_allowed_to_edit();

Loading…
Cancel
Save