Browse Source

Removing require_once, files already loaded via autoload

Julio Montoya 12 years ago
parent
commit
a6833bfbac

+ 0 - 1
main/inc/ajax/model.ajax.php

@@ -649,7 +649,6 @@ if (in_array($action, $allowed_actions)) {
 
     if ($operation && $operation == 'excel') {
         $j = 1;
-        require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php';
 
         $array = array();
         if (empty($column_names)) {

+ 0 - 2
plugin/bbb/config.php

@@ -4,8 +4,6 @@
 /* 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';
 require_once 'lib/bbb_plugin.class.php';

+ 2 - 4
plugin/rss/plugin.php

@@ -1,16 +1,14 @@
 <?php
 
 /**
- * 
+ *
  * @see http://www.google.com/uds/solutions/dynamicfeed/index.html
- * 
+ *
  * @copyright (c) 2011 University of Geneva
  * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
  * @author Laurent Opprecht
  */
 
-
-require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
 require_once dirname(__FILE__) . '/lib/rss_plugin.class.php';
 
 $plugin_info = RssPlugin::create()->get_info();

+ 12 - 13
plugin/search_course/lib/register_course_widget.class.php

@@ -1,10 +1,10 @@
 <?php
 
 /**
- * Register course widget. 
+ * Register course widget.
  * Handles user's registration action.
  * Display a register to course form if required.
- * 
+ *
  * @copyright (c) 2011 University of Geneva
  * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
  * @author Laurent Opprecht
@@ -18,10 +18,10 @@ class RegisterCourseWidget
 
     /**
      * Returns $_POST data for $key is it exists or $default otherwise.
-     * 
+     *
      * @param string $key
      * @param object $default
-     * @return string 
+     * @return string
      */
     public static function post($key, $default = '')
     {
@@ -30,10 +30,10 @@ class RegisterCourseWidget
 
     /**
      * Returns $_GET data for $key is it exists or $default otherwise.
-     * 
+     *
      * @param string $key
      * @param object $default
-     * @return string 
+     * @return string
      */
     public static function get($key, $default = '')
     {
@@ -56,7 +56,7 @@ class RegisterCourseWidget
 
     /**
      * Handle the subscribe action.
-     * 
+     *
      * @return bool
      */
     function action_subscribe_user()
@@ -72,7 +72,7 @@ class RegisterCourseWidget
         {
             return false;
         }
-        
+
         $registration_code = self::post(self::PARAM_PASSCODE);
 
         if ($this->subscribe_user($course_code, $registration_code))
@@ -91,11 +91,11 @@ class RegisterCourseWidget
     /**
      * Regiser a user to a course.
      * Returns true on success, false otherwise.
-     * 
+     *
      * @param string $course_code
      * @param string $registration_code
      * @param int $user_id
-     * @return bool 
+     * @return bool
      */
     function subscribe_user($course_code, $registration_code = '', $user_id = null)
     {
@@ -118,7 +118,7 @@ class RegisterCourseWidget
     /**
      * Display the course registration form.
      * Asks for registration code/password.
-     * 
+     *
      * @param string $course_code
      */
     function display_form($course_code)
@@ -152,11 +152,10 @@ EOT;
     /**
      *
      * @param type $course_code
-     * @return type 
+     * @return type
      */
     function retrieve_course($course_code)
     {
-        require_once api_get_path(SYS_PATH) . '/main/inc/lib/course.lib.php';
         return CourseManager::get_course_information($course_code);
     }
 

+ 1 - 2
plugin/search_course/plugin.php

@@ -1,11 +1,10 @@
-<?php 
+<?php
 /**
  * @copyright (c) 2011 University of Geneva
  * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
  * @author Laurent Opprecht
  */
 
-require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
 require_once dirname(__FILE__) . '/lib/search_course_plugin.class.php';
 
 $plugin_info = SearchCoursePlugin::create()->get_info();

+ 0 - 1
plugin/static/plugin.php

@@ -6,7 +6,6 @@
  * @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();