Actualización

This commit is contained in:
Xes
2025-04-10 12:36:07 +02:00
parent 1da7c3f3b9
commit 4aff98e77b
3147 changed files with 320647 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
Hello world plugin
===
This plugin is a minimal code to serve as example of what a plugin has to contain.
This file will be linked in the plugin settings page through a README button.

View File

@@ -0,0 +1,18 @@
<?php
/**
* @package chamilo.plugin.hello_world
*/
// See also the share_user_info plugin
echo '<div class="well">';
if (!empty($plugin_info['settings']['hello_world_show_type'])) {
echo "<h2>".$plugin_info['settings']['hello_world_show_type']."</h2>";
} else {
echo "<h2>Hello world</h2>";
}
//Using get_lang inside a plugin
echo get_lang('HelloPlugin');
echo '</div>';

View File

@@ -0,0 +1,14 @@
<?php
/* PHP code to install the plugin
* For example:
*
// To query something to the database
$table = Database::get_main_table(TABLE_MAIN_USER); // TABLE_MAIN_USER is a constant check the main/inc/database.constants.inc.php
$sql = "SELECT firstname, lastname FROM $table_users ";
$users = Database::query($sql);
You can also use the Chamilo classes
$users = UserManager::get_user_list();
*/

View File

@@ -0,0 +1,7 @@
<?php
/**
* @copyright (c) 2012 University of Geneva
* @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
* @author Laurent Opprecht <laurent@opprecht.info>
*/
$strings['HelloPlugin'] = "Hello!";

View File

@@ -0,0 +1,3 @@
<?php
$strings['HelloPlugin'] = "Salut!";

View File

@@ -0,0 +1,3 @@
<?php
$strings['HelloPlugin'] = "Hola chaval!";

View File

@@ -0,0 +1,41 @@
<?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 Julio Montoya <gugli100@gmail.com>
*/
/**
* Plugin details (must be present).
*/
/* Plugin config */
//the plugin title
$plugin_info['title'] = 'Hello world';
//the comments that go with the plugin
$plugin_info['comment'] = "Shows a hello world message";
//the plugin version
$plugin_info['version'] = '1.0';
//the plugin author
$plugin_info['author'] = 'Julio Montoya';
/* Plugin optional settings */
/*
* This form will be showed in the plugin settings once the plugin was installed
* in the plugin/hello_world/index.php you can have
* access to the value: $plugin_info['settings']['hello_world_show_type']
*/
$form = new FormValidator('hello_world_form');
//A simple select
$options = ['hello_world' => 'Hello World', 'hello' => 'Hello', 'hi' => 'Hi!'];
$form->addElement('select', 'show_type', 'Hello world types', $options);
$form->addButtonSave(get_lang('Save'), 'submit_button');
$plugin_info['settings_form'] = $form;

View File

@@ -0,0 +1,2 @@
<?php
/* PHP code to uninstall the plugin */