parent
650dff4c20
commit
851ca9c84f
@ -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; |
||||
} |
||||
} |
@ -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. |
@ -0,0 +1,5 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
require_once __DIR__ . '/../../main/inc/global.inc.php'; |
||||
require_once __DIR__.'/CourseBlockPlugin.php'; |
@ -0,0 +1,2 @@ |
||||
<?php |
||||
|
@ -0,0 +1,9 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
|
||||
require_once dirname(__FILE__) . '/config.php'; |
||||
|
||||
if (!api_is_platform_admin()) { |
||||
die ('You must have admin permissions to install plugins'); |
||||
} |
||||
CourseBlockPlugin::create()->install(); |
@ -0,0 +1,11 @@ |
||||
<?php |
||||
|
||||
$strings['plugin_title'] = "Course block"; |
||||
$strings['plugin_comment'] = "Add header and footer in a course"; |
||||
$strings['tool_enable'] = 'Enable plugin'; |
||||
$strings['tool_enable_help'] = 'Once enabled, you will have to configure the plugin inside the course configuration, then from the course homepage (a button will appear there only for the teacher)'; |
||||
|
||||
$strings['course_block_footer_left'] = 'Footer left'; |
||||
$strings['course_block_footer_center'] = 'Footer center'; |
||||
$strings['course_block_footer_right'] = 'Footer right'; |
||||
|
@ -0,0 +1,2 @@ |
||||
<?php |
||||
|
@ -0,0 +1,2 @@ |
||||
<?php |
||||
|
@ -0,0 +1,4 @@ |
||||
<?php |
||||
|
||||
require_once __DIR__ . '/config.php'; |
||||
$plugin_info = CourseBlockPlugin::create()->get_info(); |
Loading…
Reference in new issue