Actualización
This commit is contained in:
8
plugin/date/README.md
Normal file
8
plugin/date/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
Date plugin
|
||||
===
|
||||
|
||||
This plugin is more of a demo and a plugin example than a real, functional plugin.
|
||||
|
||||
It will show the current date in an area of your choice.
|
||||
|
||||
The .act.php and .dsp.php files are just remains of a time where we didn't use the Twig templating system.
|
||||
22
plugin/date/index.act.php
Normal file
22
plugin/date/index.act.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Action script for example date plugin.
|
||||
*
|
||||
* @package chamilo.plugin.date
|
||||
*/
|
||||
/**
|
||||
* Initialization.
|
||||
*/
|
||||
$convert_lang_to_code = [
|
||||
"english" => "en_US",
|
||||
"french" => "fr_BE",
|
||||
"dutch" => "nl_NL",
|
||||
"german" => "de_DE",
|
||||
"japanese" => "ja_JP",
|
||||
"danish" => "da_DK",
|
||||
];
|
||||
if (!empty($_SESSION['user_language_choice']) && !empty($convert_lang_to_code[$_SESSION['user_language_choice']])) {
|
||||
$code = $convert_lang_to_code[$_SESSION['user_language_choice']];
|
||||
$locale = setlocale(LC_TIME, $code);
|
||||
}
|
||||
$date = strftime('%c');
|
||||
10
plugin/date/index.dsp.php
Normal file
10
plugin/date/index.dsp.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Display script for example date plugin.
|
||||
*
|
||||
* @package chamilo.plugin.date
|
||||
*/
|
||||
/**
|
||||
* Display.
|
||||
*/
|
||||
echo '<div class="well">'.strip_tags($date).'</div>';
|
||||
11
plugin/date/index.php
Normal file
11
plugin/date/index.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* Controller for example date plugin.
|
||||
*
|
||||
* @package chamilo.plugin.date
|
||||
*/
|
||||
/**
|
||||
* Code.
|
||||
*/
|
||||
require 'index.act.php';
|
||||
require 'index.dsp.php';
|
||||
20
plugin/date/plugin.php
Normal file
20
plugin/date/plugin.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* This script is a configuration file for the date plugin. You can use it as a master for other platform plugins (course plugins are slightly different).
|
||||
* These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins).
|
||||
*
|
||||
* @package chamilo.plugin
|
||||
*
|
||||
* @author Yannick Warnier <ywarnier@beeznest.org>
|
||||
*/
|
||||
/**
|
||||
* Plugin details (must be present).
|
||||
*/
|
||||
//the plugin title
|
||||
$plugin_info['title'] = 'Date';
|
||||
//the comments that go with the plugin
|
||||
$plugin_info['comment'] = "Multinational date display";
|
||||
//the plugin version
|
||||
$plugin_info['version'] = '1.0';
|
||||
//the plugin author
|
||||
$plugin_info['author'] = 'Yannick Warnier';
|
||||
10
plugin/date/start.php
Normal file
10
plugin/date/start.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Controller for example date plugin.
|
||||
*
|
||||
* @package chamilo.plugin.date
|
||||
*/
|
||||
/**
|
||||
* Code.
|
||||
*/
|
||||
require 'index.php';
|
||||
Reference in New Issue
Block a user