Skip to content

Commit e6b00c4

Browse files
committed
Restore Text plugin
1 parent a16eee6 commit e6b00c4

File tree

5 files changed

+57
-0
lines changed

5 files changed

+57
-0
lines changed

plugin/text/index.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
/* See license terms in /license.txt */
3+
4+
/**
5+
* @package chamilo.plugin.text
6+
*/
7+
8+
if (!empty($plugin_info['settings']['text_content'])) {
9+
echo $plugin_info['settings']['text_content'];
10+
}

plugin/text/install.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
/* See license terms in /license.txt */

plugin/text/plugin.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/* See license terms in /license.txt */
3+
4+
/**
5+
* This script is a configuration file for the date plugin.
6+
* You can use it as a master for other platform plugins (course plugins are slightly different).
7+
* These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins)
8+
* @package chamilo.plugin
9+
* @author Julio Montoya <[email protected]>
10+
*/
11+
12+
/* Plugin config */
13+
14+
//the plugin title
15+
$plugin_info['title'] = 'Text';
16+
//the comments that go with the plugin
17+
$plugin_info['comment'] = "Displays a text message";
18+
//the plugin version
19+
$plugin_info['version'] = '1.0';
20+
//the plugin author
21+
$plugin_info['author'] = 'Julio Montoya';
22+
23+
/* Plugin optional settings */
24+
25+
$form = new FormValidator('text_form');
26+
$form->addTextarea('content', get_lang('Content'));
27+
$form->addButtonSave(get_lang('Save'), 'submit_button');
28+
29+
$content = '';
30+
$setting = api_get_setting('text_content');
31+
32+
if (!empty($setting) && is_array($setting)) {
33+
if (isset($setting['text'])) {
34+
$content = $setting['text'];
35+
}
36+
}
37+
38+
$form->setDefaults(array('content' => $content));
39+
40+
$plugin_info['settings_form'] = $form;

plugin/text/readme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
README
2+
3+
Display a text in a region.

plugin/text/uninstall.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
/* See license terms in /license.txt */

0 commit comments

Comments
 (0)