-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Course plugins can now show information in regions see BT#11080
Add course block
- Loading branch information
Showing
14 changed files
with
214 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?php | ||
/* For licensing terms, see /license.txt */ | ||
|
||
/** | ||
* Class CourseBlockPlugin | ||
*/ | ||
class CourseBlockPlugin extends Plugin | ||
{ | ||
public $isCoursePlugin = true; | ||
|
||
// When creating a new course this settings are added to the course | ||
public $course_settings = array( | ||
array( | ||
'name' => 'course_block_footer_left', | ||
'type' => 'textarea' | ||
), | ||
array( | ||
'name' => 'course_block_footer_center', | ||
'type' => 'textarea' | ||
), | ||
array( | ||
'name' => 'course_block_footer_right', | ||
'type' => 'textarea' | ||
) | ||
); | ||
|
||
/** | ||
* @return CourseBlockPlugin | ||
*/ | ||
public static function create() | ||
{ | ||
static $result = null; | ||
return $result ? $result : $result = new self(); | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
protected function __construct() | ||
{ | ||
parent::__construct( | ||
'0.1', | ||
'Julio Montoya', | ||
array( | ||
'tool_enable' => 'boolean' | ||
) | ||
); | ||
} | ||
|
||
///public function | ||
|
||
public function install() | ||
{ | ||
// Installing course settings | ||
$this->install_course_fields_in_all_courses(false); | ||
} | ||
|
||
public function uninstall() | ||
{ | ||
// Deleting course settings | ||
$this->uninstall_course_fields_in_all_courses(); | ||
} | ||
|
||
/** | ||
* @param string $region | ||
* @return string | ||
*/ | ||
public function renderRegion($region) | ||
{ | ||
$content = ''; | ||
switch ($region) { | ||
case 'footer_left': | ||
$content = api_get_course_setting('course_block_footer_left'); | ||
$content = $content === -1 ? '' : $content; | ||
break; | ||
case 'footer_center': | ||
$content = api_get_course_setting('course_block_footer_center'); | ||
$content = $content === -1 ? '' : $content; | ||
break; | ||
case 'footer_right': | ||
$content = api_get_course_setting('course_block_footer_right'); | ||
$content = $content === -1 ? '' : $content; | ||
break; | ||
} | ||
return $content; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
1. Enabled the plugin from the list of plugins. | ||
2. Click "Configure" once the plugin was enabled. | ||
3. Select tool_enable = Yes and save. | ||
4. Go into a *course* (not course session) and enter the Settings tool. | ||
5. In the "Course access" section select "Enable legal terms" and | ||
change the course visibility to "Private" and save. | ||
6. Go to a course or a course in a session a new button "Legal" will appear | ||
in the course home. | ||
7. Click the button "Legal". Fill the form with the content and a file you want | ||
to be shown to the students. There are other options in the form, like: | ||
- Send an email to all users. | ||
- Delete all previous agreements | ||
- Delete the file. | ||
|
||
The file are saved in courses/XX/courselegal/ | ||
|
||
8. Once the form was saved, a new form will appear for the registered users. | ||
The student has to accept the form. | ||
When the form is accepted an email will be sent to the user via email and | ||
then Chamilo message tool | ||
9. The user has to click in the URL. Once the user clicked to the URL the user | ||
will have access to the course. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
/* For licensing terms, see /license.txt */ | ||
|
||
require_once __DIR__ . '/../../main/inc/global.inc.php'; | ||
require_once __DIR__.'/CourseBlockPlugin.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
|
Oops, something went wrong.