Преглед изворни кода

Remove require_once already loaded by composer

Julio Montoya пре 9 година
родитељ
комит
6dc16448fc

+ 0 - 1
main/auth/external_login/ldap.inc.php

@@ -7,7 +7,6 @@
  * */
 //Includes the configuration file
 require_once dirname(__FILE__).'/../../inc/global.inc.php';
-require_once dirname(__FILE__).'/../../inc/conf/auth.conf.php';
 
 /**
  * Returns a transcoded and trimmed string

+ 0 - 2
main/cron/add_gradebook_certificates.php

@@ -9,8 +9,6 @@
  */
 
 require_once __DIR__.'/../inc/global.inc.php';
-require_once api_get_path(LIBRARY_PATH).'database.lib.php';
-require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/gradebook_functions.inc.php';
 
 /**
  * Get all categories and users ids from gradebook

+ 0 - 2
main/social/profile.php

@@ -11,8 +11,6 @@
 
 $cidReset = true;
 require_once '../inc/global.inc.php';
-// Include OpenGraph NOT AVAILABLE
-require_once api_get_path(LIBRARY_PATH).'opengraph/OpenGraph.php';
 
 if (api_get_setting('allow_social_tool') !='true') {
     $url = api_get_path(WEB_PATH).'whoisonline.php?id='.intval($_GET['u']);

+ 0 - 3
main/survey/survey.lib.php

@@ -4374,8 +4374,6 @@ class SurveyUtil
 
     static function get_number_of_surveys_for_coach()
     {
-        // Ugly fix
-        require_once api_get_path(LIBRARY_PATH).'surveymanager.lib.php';
         $survey_tree = new SurveyTree();
         return count($survey_tree->get_last_children_from_branch($survey_tree->surveylist));
     }
@@ -4486,7 +4484,6 @@ class SurveyUtil
 
     static function get_survey_data_for_coach($from, $number_of_items, $column, $direction)
     {
-        require_once api_get_path(LIBRARY_PATH).'surveymanager.lib.php';
         $survey_tree = new SurveyTree();
         $last_version_surveys = $survey_tree->get_last_children_from_branch($survey_tree->surveylist);
         $list = array();

+ 37 - 41
main/timeline/index.php

@@ -1,15 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
-/**	
+/**
  *	@author Julio Montoya <gugli100@gmail.com> BeezNest 2011
  *	@package chamilo.timeline
  */
-/**
- * Init
- */
-require_once '../inc/global.inc.php';
 
-require_once api_get_path(LIBRARY_PATH).'timeline.lib.php';  
+require_once '../inc/global.inc.php';
 
 $htmlHeadXtra[] = api_get_jqgrid_js();
 
@@ -23,7 +19,7 @@ $htmlHeadXtra[] = api_get_jqgrid_js();
 $action = isset($_GET['action']) ? $_GET['action'] : null;
 
 $check = Security::check_token('request');
-$token = Security::get_token();    
+$token = Security::get_token();
 
 switch ($action) {
     case 'add':
@@ -31,11 +27,11 @@ switch ($action) {
         $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add'));
         break;
     case 'edit':
-        $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));    
+        $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
         $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit'));
         break;
     case 'add_item':
-        $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));    
+        $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
         $interbreadcrumb[]=array('url' => '#','name' => get_lang('TimelineItem'));
         break;
     default:
@@ -45,18 +41,18 @@ switch ($action) {
 //jqgrid will use this URL to do the selects
 $url            = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_timelines';
 
-//The order is important you need to check the the $column variable in the model.ajax.php file 
+//The order is important you need to check the the $column variable in the model.ajax.php file
 $columns        = array(get_lang('Name'), get_lang('Actions'));
 
 //Column config
 $column_model   = array(
-                        array('name'=>'name',           'index'=>'name',        'width'=>'120',   'align'=>'left'),                        
+                        array('name'=>'name',           'index'=>'name',        'width'=>'120',   'align'=>'left'),
                         array('name'=>'actions',        'index'=>'actions',     'width'=>'100',  'align'=>'left', 'sortable'=>'false')
-                       );            
-//Autowidth             
+                       );
+//Autowidth
 $extra_params['autowidth'] = 'true';
-//height auto 
-$extra_params['height'] = 'auto'; 
+//height auto
+$extra_params['height'] = 'auto';
 
 //With this function we can add actions to the jgrid (edit, delete, etc)
 $htmlHeadXtra[] ='
@@ -74,65 +70,65 @@ switch ($action) {
     case 'add':
         if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
             api_not_allowed();
-        }        
+        }
         $url  = api_get_self().'?action='.Security::remove_XSS($_GET['action']);
         $form = $timeline->return_form($url, 'add');
 
         // The validation or display
-        if ($form->validate()) {            
+        if ($form->validate()) {
             if ($check) {
-                $values = $form->exportValues();       
-                $res    = $timeline->save($values);            
+                $values = $form->exportValues();
+                $res    = $timeline->save($values);
                 if ($res) {
                     $message = Display::return_message(get_lang('ItemAdded'),'success');
                 }
-            }        
+            }
             $content = $timeline->listing();
-        } else {            
-            $actions .= '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';            
+        } else {
+            $actions .= '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
             $form->addElement('hidden', 'sec_token');
             $form->setConstants(array('sec_token' => $token));
             $content = $form->return_form();
         }
-        break;        
+        break;
     case 'edit':
-        // Action handling: Editing 
+        // Action handling: Editing
         $url  = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']);
-        $form = $timeline->return_form($url, 'edit');    
+        $form = $timeline->return_form($url, 'edit');
 
         // The validation or display
-        if ($form->validate()) {            
+        if ($form->validate()) {
             if ($check) {
                 $values = $form->exportValues();
-                //$timeline->update_all_promotion_status_by_career_id($values['id'],$values['status']);               
+                //$timeline->update_all_promotion_status_by_career_id($values['id'],$values['status']);
                 $res    = $timeline->update($values);
-                $message = Display::return_message(sprintf(get_lang('ItemUpdated'), $values['name']), 'confirmation');                
-            }            
+                $message = Display::return_message(sprintf(get_lang('ItemUpdated'), $values['name']), 'confirmation');
+            }
             $timeline->display();
-        } else {            
-            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';            
+        } else {
+            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
             $form->addElement('hidden', 'sec_token');
             $form->setConstants(array('sec_token' => $token));
             $content = $form->return_form();
         }
         break;
     case 'add_item':
-           // Action handling: Editing 
+           // Action handling: Editing
         $url  = api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&parent_id='.intval($_GET['parent_id']);
-        $form = $timeline->return_item_form($url, 'edit');    
-        
+        $form = $timeline->return_item_form($url, 'edit');
+
         // The validation or display
-        if ($form->validate()) {            
+        if ($form->validate()) {
             if ($check) {
                 $values = $form->exportValues();
                 $values['type'] = '';
-                //$timeline->update_all_promotion_status_by_career_id($values['id'],$values['status']);               
+                //$timeline->update_all_promotion_status_by_career_id($values['id'],$values['status']);
                 $res    = $timeline->save_item($values);
-                $message = Display::return_message(sprintf(get_lang('ItemUpdated'), $values['name']), 'confirmation');                
-            }            
+                $message = Display::return_message(sprintf(get_lang('ItemUpdated'), $values['name']), 'confirmation');
+            }
             $timeline->display();
-        } else {            
-            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';            
+        } else {
+            $actions = '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
             $form->addElement('hidden', 'sec_token');
             $form->setConstants(array('sec_token' => $token));
             $content = $form->return_form();
@@ -147,7 +143,7 @@ switch ($action) {
             }
         }
         $content = $timeline->listing();
-        break;    
+        break;
     default:
         $content = $timeline->listing();
         break;

+ 2 - 4
main/timeline/view.php

@@ -1,13 +1,11 @@
 <?php
 /* For licensing terms, see /license.txt */
-/**	
+/**
 	@author Julio Montoya <gugli100@gmail.com> BeezNest 2011
 *	@package chamilo.timeline
 */
 require_once '../inc/global.inc.php';
 
-require_once api_get_path(LIBRARY_PATH).'timeline.lib.php';  
-
 $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
 $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Listing'));
 
@@ -25,7 +23,7 @@ $htmlHeadXtra[] = '
 <script>
 	$(document).ready(function() {
 		var timeline = new VMM.Timeline();
-		timeline.init("'.$url.'");			
+		timeline.init("'.$url.'");
 	});
 </script>';
 $content = '<div class="timeline-example"><div id="timeline"></div></div>';