skala
Julio Montoya 13 years ago
commit b90b6d851b
  1. 3
      plugin/formLogin_hide_unhide/css.css
  2. 13
      plugin/formLogin_hide_unhide/index.php
  3. 36
      plugin/formLogin_hide_unhide/plugin.php
  4. 4
      plugin/formLogin_hide_unhide/readme.txt
  5. 11
      plugin/formLogin_hide_unhide/template.tpl

@ -0,0 +1,3 @@
.formLogin_hide_unhide_div {
cursor:pointer;
}

@ -0,0 +1,13 @@
<?php
$_template['show_message'] = false;
if (api_is_anonymous()) {
$_template['show_message'] = true;
// the default title label
$label = "Connexion hors compte universitaire";
if (!empty($plugin_info['settings']['formLogin_hide_unhide_label'])) {
$label = api_htmlentities($plugin_info['settings']['formLogin_hide_unhide_label']);
}
$_template['label'] = $label;
}

@ -0,0 +1,36 @@
<?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'] = 'Hide/Unhide the Login/Password default form';
//the comments that go with the plugin
$plugin_info['comment'] = "If you use another way of authentication than local, you may want to hide the Login/Password default Form to avoid users mistakes. This plugin replace the Login/Password form with a text that unhide the Login/Password form if you click on it.";
//the plugin version
$plugin_info['version'] = '1.0';
//the plugin author
$plugin_info['author'] = 'Hubert Borderiou';
//the plugin configuration
$form = new FormValidator('add_cas_button_form');
$form->addElement('text', 'label', 'Text label', '');
//get default value
$tab_default_formLogin_hide_unhide_label = api_get_setting('formLogin_hide_unhide_label');
$defaults = array();
$defaults['label'] = $tab_default_formLogin_hide_unhide_label['formLogin_hide_unhide'];
$form->setDefaults($defaults);
//display form
$plugin_info['settings_form'] = $form;
//set the templates that are going to be used
$plugin_info['templates'] = array('template.tpl');

@ -0,0 +1,4 @@
README
<br/><br/>
If you use another way of authentication than local, you may want to hide the Login/Password default Form to avoid users mistakes. This plugin replace the Login/Password form with a text that unhide the Login/Password form if you click on it.<br/><br/>
This plugin has been done to be added in the login_top region.<br/>

@ -0,0 +1,11 @@
{% if formLogin_hide_unhide.show_message %}
<link href="{{ _p.web_plugin }}formLogin_hide_unhide/css.css" rel="stylesheet" type="text/css">
<div class="well">
<a href="#" onclick="$('#formLogin').toggle(500)">{{ formLogin_hide_unhide.label }}</a>
</div>
<script type='text/javascript'>
$(document).ready(function() {
$('#formLogin').hide();
});
</script>
{% endif %}
Loading…
Cancel
Save