Minor - format code.

1.9.x
Julio Montoya 10 years ago
parent 4bb03e2c6e
commit ac88151e60
  1. 19
      main/coursecopy/classes/Attendance.class.php
  2. 2
      main/coursecopy/classes/Course.class.php
  3. 10
      main/coursecopy/classes/CourseBuilder.class.php
  4. 13
      main/coursecopy/classes/CourseCopyTestCategory.php
  5. 30
      main/coursecopy/classes/CourseRestorer.class.php
  6. 1
      main/coursecopy/classes/CourseSelectForm.class.php
  7. 27
      main/coursecopy/classes/CourseSession.class.php
  8. 11
      main/coursecopy/classes/DummyCourseCreator.class.php
  9. 11
      main/coursecopy/classes/Event.class.php
  10. 17
      main/coursecopy/classes/Forum.class.php
  11. 18
      main/coursecopy/classes/ForumCategory.class.php
  12. 18
      main/coursecopy/classes/ForumPost.class.php
  13. 24
      main/coursecopy/classes/ForumTopic.class.php
  14. 16
      main/coursecopy/classes/Glossary.class.php
  15. 8
      main/coursecopy/classes/LinkCategory.class.php
  16. 1
      main/coursecopy/classes/ScormDocument.class.php
  17. 9
      main/coursecopy/classes/SurveyInvitation.class.php
  18. 11
      main/coursecopy/classes/SurveyQuestion.class.php
  19. 64
      main/coursecopy/classes/Thematic.class.php
  20. 10
      main/coursecopy/classes/ToolIntro.class.php
  21. 11
      main/coursecopy/classes/Work.class.php
  22. 10
      main/coursecopy/classes/wiki.class.php

@ -1,6 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
require_once 'Resource.class.php';
/**
* Attendance backup script
* @package chamilo.backup
@ -8,15 +10,13 @@ require_once 'Resource.class.php';
class Attendance extends Resource
{
public $params = array();
public $attendance_calendar = array();
/**
* Create a new Thematic
*
* @param array parameters
*
* @param array parameters
*/
public function __construct($params)
{
@ -24,14 +24,17 @@ class Attendance extends Resource
$this->params = $params;
}
/**
* @inheritdoc
*/
public function show()
{
parent::show();
echo $this->params['name'];
}
public function add_attendance_calendar($data)
{
$this->attendance_calendar[] = $data;
}
}
}
}

@ -78,7 +78,7 @@ class Course
}
/**
* Show this course resources
* @inheritdoc
*/
public function show()
{ /*

@ -976,11 +976,13 @@ class CourseBuilder
$this->course->add_resource($lp);
}
//save scorm directory (previously build_scorm_documents())
// Save scorm directory (previously build_scorm_documents())
$i = 1;
if ($dir=@opendir($this->course->backup_path.'/scorm')) {
while($file=readdir($dir)) {
if(is_dir($this->course->backup_path.'/scorm/'.$file) && !in_array($file,array('.','..'))) {
if ($dir = @opendir($this->course->backup_path . '/scorm')) {
while ($file = readdir($dir)) {
if (is_dir($this->course->backup_path.'/scorm/'.$file) &&
!in_array($file, array('.','..'))
) {
$doc = new ScormDocument($i++, '/'.$file, $file);
$this->course->add_resource($doc);
}

@ -1,17 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Exercises questions backup script
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**
* An QuizQuestion
* Class CourseCopyTestcategory
* @author Hubert Borderiou <hubert.borderiou@grenet.fr>
* @package chamilo.backup
*/
@ -45,4 +38,4 @@ class CourseCopyTestcategory extends Resource
parent::show();
echo $this->title;
}
}
}

@ -807,6 +807,7 @@ class CourseRestorer
/**
* Restore scorm documents
* TODO @TODO check that the restore function with renaming doesn't break the scorm structure!
* see #7029
*/
public function restore_scorm_documents()
{
@ -824,14 +825,17 @@ class CourseRestorer
switch ($this->file_option) {
case FILE_OVERWRITE :
rmdirr($path.$document->path);
copyDirTo($this->course->backup_path.'/'.$document->path, $path.dirname($document->path), false);
copyDirTo(
$this->course->backup_path . '/' . $document->path,
$path . dirname($document->path),
false
);
break;
case FILE_SKIP:
break;
case FILE_RENAME:
$i = 1;
$ext = explode('.', basename($document->path));
if (count($ext) > 1) {
$ext = array_pop($ext);
$file_name_no_ext = substr($document->path, 0, - (strlen($ext) + 1));
@ -850,15 +854,29 @@ class CourseRestorer
$file_exists = file_exists($path.$new_file_name);
}
rename($this->course->backup_path.'/'.$document->path,$this->course->backup_path.'/'.$new_file_name);
copyDirTo($this->course->backup_path.'/'.$new_file_name, $path.dirname($new_file_name), false);
rename($this->course->backup_path.'/'.$new_file_name,$this->course->backup_path.'/'.$document->path);
rename(
$this->course->backup_path . '/' . $document->path,
$this->course->backup_path . '/' . $new_file_name
);
copyDirTo(
$this->course->backup_path . '/' . $new_file_name,
$path . dirname($new_file_name),
false
);
rename(
$this->course->backup_path . '/' . $new_file_name,
$this->course->backup_path . '/' . $document->path
);
break;
} // end switch
} else {
// end if file exists
copyDirTo($this->course->backup_path.'/'.$document->path, $path.dirname($document->path), false);
copyDirTo(
$this->course->backup_path . '/' . $document->path,
$path . dirname($document->path),
false
);
}
} // end for each
}

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
require_once 'Course.class.php';
/**

@ -1,30 +1,33 @@
<?php
<?php
/* For licensing terms, see /license.txt */
require_once('Resource.class.php');
/*
* A course session
* @author Jhon Hinojosa <jhon.hinojosa@beeznest.com>
require_once 'Resource.class.php';
/**
* Class CourseSession
* @author Jhon Hinojosa <jhon.hinojosa@beeznest.com>
* @package chamilo.backup
**/
class CourseSession extends Resource {
var $title; // The title session
*/
class CourseSession extends Resource
{
// The title session
public $title;
/*
* Create a new Session
* @param int $id
* @param string $title
*/
*/
function CourseSession($id,$title) {
parent::Resource($id,RESOURCE_SESSION_COURSE);
$this->title = $title;
}
/*
* Show this Event
*/
function show() {
parent::show();
echo $this->title;
echo $this->title;
}
}

@ -1,12 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Dummy course creator
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Course.class.php';
require_once 'Document.class.php';
require_once 'Event.class.php';
@ -19,8 +13,9 @@ require_once 'ForumPost.class.php';
require_once 'CourseDescription.class.php';
require_once 'CourseCopyLearnpath.class.php';
require_once 'CourseRestorer.class.php';
/**
* Class
* Dummy course creator
* @package chamilo.backup
*/
class DummyCourseCreator

@ -1,15 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Event backup script
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**
* An event
* Event backup script
* @author Bart Mollet <bart.mollet@hogent.be>
* @package chamilo.backup
*/

@ -1,22 +1,15 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Forum backup script
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**
* A forum
* Class forum
* @author Bart Mollet <bart.mollet@hogent.be>
* @package chamilo.backup
*/
class Forum extends Resource {
class Forum extends Resource
{
/**
* The title
*/
@ -110,7 +103,7 @@ class Forum extends Resource {
/**
* Create a new Forum
*/
/* function Forum($id, $title, $description, $category_id, $last_post, $topics, $posts, $allow_anonymous, $allow_edit, $approval_direct_post, $allow_attachements,
/* function Forum($id, $title, $description, $category_id, $last_post, $topics, $posts, $allow_anonymous, $allow_edit, $approval_direct_post, $allow_attachements,
$allow_new_topics, $default_view, $of_group, $group_public_private, $order, $locked, $session_id, $image)
{ */
function Forum($obj) {

@ -1,13 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Forum category backup class
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**
@ -15,11 +8,13 @@ require_once 'Resource.class.php';
* @author Bart Mollet <bart.mollet@hogent.be>
* @package chamilo.backup
*/
class ForumCategory extends Resource {
class ForumCategory extends Resource
{
/**
* Create a new ForumCategory
*/
function ForumCategory($obj) {
function ForumCategory($obj)
{
parent::Resource($obj->cat_id, RESOURCE_FORUMCATEGORY);
$this->obj = $obj;
}
@ -27,7 +22,8 @@ class ForumCategory extends Resource {
/**
* Show this resource
*/
function show() {
function show()
{
parent::show();
echo $this->obj->cat_title;
}

@ -1,13 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Forum post backup script
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**
@ -15,12 +8,14 @@ require_once 'Resource.class.php';
* @author Bart Mollet <bart.mollet@hogent.be>
* @package chamilo.backup
*/
class ForumPost extends Resource {
class ForumPost extends Resource
{
/**
* Create a new ForumPost
*/
function ForumPost($obj) {
public function ForumPost($obj)
{
parent::Resource($obj->post_id, RESOURCE_FORUMPOST);
$this->obj = $obj;
}
@ -28,7 +23,8 @@ class ForumPost extends Resource {
/**
* Show this resource
*/
function show() {
public function show()
{
parent::show();
echo $this->obj->title . ' (' . $this->obj->poster_name . ', ' . $this->obj->post_date . ')';
}

@ -1,13 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Forum topic backup script
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**
@ -15,13 +8,15 @@ require_once 'Resource.class.php';
* @author Bart Mollet <bart.mollet@hogent.be>
* @package chamilo.backup
*/
class ForumTopic extends Resource {
class ForumTopic extends Resource
{
/**
* Create a new ForumTopic
*/
/* function ForumTopic($id, $title, $time, $topic_poster_id, $topic_poster_name, $forum_id, $last_post, $replies, $views = 0, $sticky = 0, $locked = 0,
/* function ForumTopic($id, $title, $time, $topic_poster_id, $topic_poster_name, $forum_id, $last_post, $replies, $views = 0, $sticky = 0, $locked = 0,
$time_closed = null, $weight = 0, $title_qualify = null, $qualify_max = 0) */
function ForumTopic($obj) {
function ForumTopic($obj)
{
parent::Resource($obj->thread_id, RESOURCE_FORUMTOPIC);
$this->obj = $obj;
/*
@ -44,13 +39,14 @@ class ForumTopic extends Resource {
/**
* Show this resource
*/
function show() {
function show()
{
parent::show();
$extra = api_convert_and_format_date($this->obj->thread_date);
if ($this->obj->thread_poster_id) {
$user_info = api_get_user_info($this->obj->thread_poster_id);
$extra = $user_info['complete_name'].', '.$extra;
}
}
echo $this->obj->thread_title . ' (' . $extra . ')';
}
}
}

@ -1,12 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Glossary backup script
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**
@ -28,20 +22,20 @@ class Glossary extends Resource
* @param string $description
* @param int $display_order
*/
function Glossary($id,$name,$description,$display_order)
public function Glossary($id,$name,$description,$display_order)
{
parent::Resource($id,RESOURCE_GLOSSARY);
$this->glossary_id = $id;
$this->name = $name;
$this->description = $description;
$this->display_order = $display_order;
}
/**
* Show this glossary
*/
function show() {
public function show()
{
parent::show();
echo $this->name;
}

@ -1,12 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Link category backup script
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**

@ -2,6 +2,7 @@
/* For licensing terms, see /license.txt */
require_once 'Resource.class.php';
/**
* ScormDocument class
* @author Olivier Brouckaert <oli.brouckaert@dokeos.com>

@ -1,13 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Survey invitations backup script
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**
* An SurveyInvitation
* @author Yannick Warnier <yannick.warnier@beeznest.com>

@ -1,13 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Survey questions backup script
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**
* A SurveyQuestion
* @author Yannick Warnier <yannick.warnier@beeznest.com>
@ -94,4 +89,4 @@ class SurveyQuestion extends Resource
parent::show();
echo $this->survey_question;
}
}
}

@ -1,40 +1,42 @@
<?php
/* For licensing terms, see /license.txt */
require_once 'Resource.class.php';
/**
* Thematic backup script
* @package chamilo.backup
*/
class Thematic extends Resource {
/** All params
* */
var $params = array();
var $thematic_advance_list = array();
var $thematic_plan_list = array();
/**
* Create a new Thematic
*
* @param array parameters
*/
public function __construct($params) {
parent::Resource($params['id'], RESOURCE_THEMATIC);
$this->params = $params;
}
class Thematic extends Resource
{
public $params = array();
public $thematic_advance_list = array();
public $thematic_plan_list = array();
/**
* Create a new Thematic
*
* @param array parameters
*/
public function __construct($params)
{
parent::Resource($params['id'], RESOURCE_THEMATIC);
$this->params = $params;
}
public function show()
{
parent::show();
echo $this->params['title'];
}
public function add_thematic_advance($data)
{
$this->thematic_advance_list[] = $data;
}
public function show() {
parent::show();
echo $this->params['title'];
}
public function add_thematic_advance($data) {
$this->thematic_advance_list[] = $data;
}
public function add_thematic_plan($data) {
$this->thematic_plan_list[] = $data;
}
}
public function add_thematic_plan($data)
{
$this->thematic_plan_list[] = $data;
}
}

@ -1,13 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Tool intro backup script
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**
* A WWW-link from the Links-module in a Chamilo-course.
* @author Bart Mollet <bart.mollet@hogent.be>
@ -33,6 +28,7 @@ class ToolIntro extends Resource
$this->id = $id;
$this->intro_text = $intro_text;
}
/**
* Show this resource
*/

@ -1,15 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Work/Assignment/Student publication backup script
* @package chamilo.backup
*/
/**
* Code
*/
require_once 'Resource.class.php';
/**
* An event
* Work/Assignment/Student publication backup script
* @author Yannick Warnier <yannick.warnier@beeznest.com>
* @package chamilo.backup
*/

@ -1,14 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
require_once('Resource.class.php');
/**
* Class for migrating the wiki
* Wiki backup script
* @package chamilo.backup
*/
/**
* Class for migrating the wiki
*
*@author Matthias Crauwels <matthias.crauwels@UGent.be>, Ghent University
* @author Matthias Crauwels <matthias.crauwels@UGent.be>, Ghent University
*/
class Wiki extends Resource
{
@ -19,7 +17,7 @@ class Wiki extends Resource
var $content;
var $user_id;
var $group_id;
var $timestamp;
var $timestamp;
var $progress;
var $version;

Loading…
Cancel
Save