Adding missing files in the show template plugins + adding the very first Chamilo template using smarty it shows a welcome message to the user ... see #4450

skala
Julio Montoya 13 years ago
parent d1d3108ee0
commit 7743980b2f
  1. 8
      plugin/show_template_blocks/index.php
  2. 19
      plugin/show_template_blocks/plugin.php
  3. 3
      plugin/show_template_blocks/readme.txt
  4. 22
      plugin/show_user_info/index.php
  5. 22
      plugin/show_user_info/plugin.php
  6. 3
      plugin/show_user_info/readme.txt
  7. 4
      plugin/show_user_info/template.tpl

@ -0,0 +1,8 @@
<?php
//only show the block information if the admin is logged in
if (api_is_platform_admin()) {
echo '<div style="color:black;height:50px;width:200px;background-color:#FFE378">';
//We can have access to the current block and the block information with the variable $plugin_info (see your plugin.php)
echo $plugin_info['current_block'];
echo '</div>';
}

@ -0,0 +1,19 @@
<?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)
*/
//the plugin title
$plugin_info['title'] = 'Show template blocks';
//the comments that go with the plugin
$plugin_info['comment'] = "This is useful when trying to find the blocks, (<strong>only the admin </strong>can view this plugin). You have to activate all the items in the Plugin area";
//the plugin version
$plugin_info['version'] = '1.0';
//the plugin author
$plugin_info['author'] = 'Julio Montoya';

@ -0,0 +1,3 @@
README
This file will be linked in the plugin settings page

@ -0,0 +1,22 @@
<?php
//A user must be logged in
if (!api_is_anonymous()) {
//Getting the current user id
$user_id = api_get_user_id();
//Getting the current user info
$user_info = api_get_user_info($user_id);
//Showing the complete name (that means the firstname and lastname depending of the language)
echo 'This is a simple echo';
//If you want to see more data you can do a var_dump($user_info);
//You can also change the style
echo '<h4>This is an echo with style :)</h4>';
//You can also use smarty setting variables in the special variable called template
$_template['user_info'] = $user_info;
$_template['user_email'] = $user_info['mail'];
}

@ -0,0 +1,22 @@
<?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)
*/
//the plugin title
$plugin_info['title'] = 'Show user information';
//the comments that go with the plugin
$plugin_info['comment'] = "Shows the user information";
//the plugin version
$plugin_info['version'] = '1.0';
//the plugin author
$plugin_info['author'] = 'Julio Montoya';
//set the smarty templates that are going to be used
$plugin_info['templates'] = array('template.tpl');

@ -0,0 +1,3 @@
README
This plugin show the current user information

@ -0,0 +1,4 @@
This is a chamilo plugin using smarty
<div class="well">
Welcome, {$user_info.complete_name}
</div>
Loading…
Cancel
Save