mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
Fix helpInfo feature by LSsession::addHelpInfos to LStemplate
LSsession :: addHelpInfos() is now deprecated in favor of LStemplate :: addHelpInfo().
This commit is contained in:
parent
e86b20bec0
commit
1b98dbfe80
21 changed files with 72 additions and 43 deletions
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -64,7 +64,8 @@ ldapsaisie (3.0.0-1) UNRELEASED; urgency=medium
|
||||||
* LSselect: Allow multiple type of objects selection
|
* LSselect: Allow multiple type of objects selection
|
||||||
* LStemplate:
|
* LStemplate:
|
||||||
- Now offer some new methods moved from LSsession to handle custom JS & CSS:
|
- Now offer some new methods moved from LSsession to handle custom JS & CSS:
|
||||||
addJSscript(), addLibJSscript(), addJSconfigParam(), addCssFile() and addLibCssFile()
|
addJSscript(), addLibJSscript(), addJSconfigParam(), addHelpInfos() (renamed as
|
||||||
|
addHelpInfo()), addCssFile() and addLibCssFile()
|
||||||
- fatal_error() method now use LStemplate methods to assign variables and display
|
- fatal_error() method now use LStemplate methods to assign variables and display
|
||||||
template instead of directly use Smarty methods.
|
template instead of directly use Smarty methods.
|
||||||
* Interface is now responsive
|
* Interface is now responsive
|
||||||
|
|
|
@ -161,6 +161,8 @@ grep -Er 'url\(.*\.(png|gif|jpg)' /etc/ldapsaisie/local/css</programlisting></pa
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem><simpara><literal>LSsession :: addJSconfigParam()</literal> devient
|
<listitem><simpara><literal>LSsession :: addJSconfigParam()</literal> devient
|
||||||
<literal>LStemplate :: addJSconfigParam()</literal>.</simpara></listitem>
|
<literal>LStemplate :: addJSconfigParam()</literal>.</simpara></listitem>
|
||||||
|
<listitem><simpara><literal>LSsession :: addHelpInfos()</literal> devient
|
||||||
|
<literal>LStemplate :: addHelpInfo()</literal>.</simpara></listitem>
|
||||||
<listitem><para><literal>LSsession :: addCssFile()</literal> devient
|
<listitem><para><literal>LSsession :: addCssFile()</literal> devient
|
||||||
<literal>LStemplate :: addCssFile()</literal>.</para>
|
<literal>LStemplate :: addCssFile()</literal>.</para>
|
||||||
<para>Par ailleurs le paramètre <literal>$path</literal> disparait et la méthode <literal>addLibCssFile</literal>
|
<para>Par ailleurs le paramètre <literal>$path</literal> disparait et la méthode <literal>addLibCssFile</literal>
|
||||||
|
@ -179,7 +181,7 @@ grep -Er 'url\(.*\.(png|gif|jpg)' /etc/ldapsaisie/local/css</programlisting></pa
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Pour identifier les fichiers concernés, vous pouvez utiliser les commandes suivantes :
|
Pour identifier les fichiers concernés, vous pouvez utiliser les commandes suivantes :
|
||||||
<programlisting>grep -Er 'LSsession *:: *(addJSscript|addLibJSscript|addJSconfigParam|addCssFile|addLibCssFile) *\(' /etc/ldapsaisie/local/
|
<programlisting>grep -Er 'LSsession *:: *(addJSscript|addLibJSscript|addJSconfigParam|addHelpInfos|addCssFile|addLibCssFile) *\(' /etc/ldapsaisie/local/
|
||||||
grep -Er '(LSsession|LStemplate) *:: *addJSscript\(.*local' /etc/ldapsaisie/local/
|
grep -Er '(LSsession|LStemplate) *:: *addJSscript\(.*local' /etc/ldapsaisie/local/
|
||||||
grep -Er '(LSsession|LStemplate) *:: *addJSscript\(.*\.\.\/' /etc/ldapsaisie/local/
|
grep -Er '(LSsession|LStemplate) *:: *addJSscript\(.*\.\.\/' /etc/ldapsaisie/local/
|
||||||
grep -Er '(LSsession|LStemplate) *:: *addCssFile\(.*local' /etc/ldapsaisie/local/
|
grep -Er '(LSsession|LStemplate) *:: *addCssFile\(.*local' /etc/ldapsaisie/local/
|
||||||
|
|
|
@ -90,7 +90,7 @@ class LSform {
|
||||||
LStemplate :: addJSscript('LSformElement_field.js');
|
LStemplate :: addJSscript('LSformElement_field.js');
|
||||||
LStemplate :: addJSscript('LSformElement.js');
|
LStemplate :: addJSscript('LSformElement.js');
|
||||||
|
|
||||||
LSsession :: addHelpInfos(
|
LStemplate :: addHelpInfo(
|
||||||
'LSform',
|
'LSform',
|
||||||
array(
|
array(
|
||||||
'addFieldBtn' => _('Add a field to add another values.'),
|
'addFieldBtn' => _('Add a field to add another values.'),
|
||||||
|
|
|
@ -46,7 +46,7 @@ class LSformElement_boolean extends LSformElement {
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
if (!$this -> isFreeze()) {
|
if (!$this -> isFreeze()) {
|
||||||
// Help Infos
|
// Help Infos
|
||||||
LSsession :: addHelpInfos(
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_boolean',
|
'LSformElement_boolean',
|
||||||
array(
|
array(
|
||||||
'clear' => _('Reset the choice.')
|
'clear' => _('Reset the choice.')
|
||||||
|
|
|
@ -146,7 +146,7 @@ class LSformElement_date extends LSformElement {
|
||||||
// value
|
// value
|
||||||
if (!$this -> isFreeze()) {
|
if (!$this -> isFreeze()) {
|
||||||
// Help Infos
|
// Help Infos
|
||||||
LSsession :: addHelpInfos(
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_date',
|
'LSformElement_date',
|
||||||
array(
|
array(
|
||||||
'now' => _('Now.'),
|
'now' => _('Now.'),
|
||||||
|
|
|
@ -47,7 +47,7 @@ class LSformElement_image extends LSformElement {
|
||||||
$return = true;
|
$return = true;
|
||||||
$id=$this -> name.'_'.rand();
|
$id=$this -> name.'_'.rand();
|
||||||
if (!$this -> isFreeze()) {
|
if (!$this -> isFreeze()) {
|
||||||
LSsession :: addHelpInfos(
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_date',
|
'LSformElement_date',
|
||||||
array(
|
array(
|
||||||
'zoom' => _('Click to enlarge.'),
|
'zoom' => _('Click to enlarge.'),
|
||||||
|
|
|
@ -50,7 +50,7 @@ class LSformElement_mail extends LSformElement_text {
|
||||||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||||
|
|
||||||
public function getDisplay() {
|
public function getDisplay() {
|
||||||
LSsession :: addHelpInfos (
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_mail',
|
'LSformElement_mail',
|
||||||
array(
|
array(
|
||||||
'mail' => _("Send a mail from here.")
|
'mail' => _("Send a mail from here.")
|
||||||
|
|
|
@ -62,7 +62,7 @@ class LSformElement_maildir extends LSformElement_text {
|
||||||
var $fieldTemplate = 'LSformElement_maildir_field.tpl';
|
var $fieldTemplate = 'LSformElement_maildir_field.tpl';
|
||||||
|
|
||||||
public function getDisplay() {
|
public function getDisplay() {
|
||||||
LSsession :: addHelpInfos (
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_maildir',
|
'LSformElement_maildir',
|
||||||
array(
|
array(
|
||||||
'do' => _("Maildir creation/modification on user creation/modification is enabled. Click to disable."),
|
'do' => _("Maildir creation/modification on user creation/modification is enabled. Click to disable."),
|
||||||
|
|
|
@ -131,7 +131,7 @@ class LSformElement_password extends LSformElement {
|
||||||
if (!$this -> isFreeze()) {
|
if (!$this -> isFreeze()) {
|
||||||
|
|
||||||
// Help Infos
|
// Help Infos
|
||||||
LSsession :: addHelpInfos(
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_password',
|
'LSformElement_password',
|
||||||
array(
|
array(
|
||||||
'generate' => _('Generate a password.'),
|
'generate' => _('Generate a password.'),
|
||||||
|
|
|
@ -67,7 +67,7 @@ class LSformElement_postaladdress extends LSformElement_textarea {
|
||||||
'map_url' => $this -> attr_html -> attribute -> ldapObject -> getFData($map_url_format)
|
'map_url' => $this -> attr_html -> attribute -> ldapObject -> getFData($map_url_format)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
LSsession :: addHelpInfos(
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_postaladdress',
|
'LSformElement_postaladdress',
|
||||||
array(
|
array(
|
||||||
'viewOnMap' => _('View on map')
|
'viewOnMap' => _('View on map')
|
||||||
|
|
|
@ -44,7 +44,7 @@ class LSformElement_rss extends LSformElement_text {
|
||||||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||||
|
|
||||||
public function getDisplay() {
|
public function getDisplay() {
|
||||||
LSsession :: addHelpInfos (
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_rss',
|
'LSformElement_rss',
|
||||||
array(
|
array(
|
||||||
'display' => _("Display RSS stack.")
|
'display' => _("Display RSS stack.")
|
||||||
|
|
|
@ -46,7 +46,7 @@ class LSformElement_select extends LSformElement {
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
$params = array();
|
$params = array();
|
||||||
if (!$this -> isFreeze()) {
|
if (!$this -> isFreeze()) {
|
||||||
LSsession :: addHelpInfos (
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_select',
|
'LSformElement_select',
|
||||||
array(
|
array(
|
||||||
'clear' => _("Reset selection.")
|
'clear' => _("Reset selection.")
|
||||||
|
|
|
@ -77,7 +77,7 @@ class LSformElement_select_object extends LSformElement {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
LSsession :: addHelpInfos (
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_select_object',
|
'LSformElement_select_object',
|
||||||
array(
|
array(
|
||||||
'searchAdd' => _("Fast Add"),
|
'searchAdd' => _("Fast Add"),
|
||||||
|
|
|
@ -51,7 +51,7 @@ class LSformElement_ssh_key extends LSformElement {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LStemplate :: addJSscript('LSformElement_ssh_key.js');
|
LStemplate :: addJSscript('LSformElement_ssh_key.js');
|
||||||
LSsession :: addHelpInfos (
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_ssh_key',
|
'LSformElement_ssh_key',
|
||||||
array(
|
array(
|
||||||
'display' => _("Display the full key.")
|
'display' => _("Display the full key.")
|
||||||
|
|
|
@ -51,7 +51,7 @@ class LSformElement_text extends LSformElement {
|
||||||
if ($this -> getParam('html_options')) {
|
if ($this -> getParam('html_options')) {
|
||||||
LStemplate :: addJSconfigParam($this -> name, $this -> getParam('html_options'));
|
LStemplate :: addJSconfigParam($this -> name, $this -> getParam('html_options'));
|
||||||
}
|
}
|
||||||
LSsession :: addHelpInfos(
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_text',
|
'LSformElement_text',
|
||||||
array(
|
array(
|
||||||
'generate' => _('Generate the value')
|
'generate' => _('Generate the value')
|
||||||
|
|
|
@ -45,7 +45,7 @@ class LSformElement_textarea extends LSformElement {
|
||||||
public function getDisplay(){
|
public function getDisplay(){
|
||||||
$return = $this -> getLabelInfos();
|
$return = $this -> getLabelInfos();
|
||||||
if (!$this -> isFreeze()) {
|
if (!$this -> isFreeze()) {
|
||||||
LSsession :: addHelpInfos(
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_textarea',
|
'LSformElement_textarea',
|
||||||
array(
|
array(
|
||||||
'clear' => _('Clear')
|
'clear' => _('Clear')
|
||||||
|
|
|
@ -45,7 +45,7 @@ class LSformElement_url extends LSformElement_text {
|
||||||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||||
|
|
||||||
public function getDisplay() {
|
public function getDisplay() {
|
||||||
LSsession :: addHelpInfos (
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_url',
|
'LSformElement_url',
|
||||||
array(
|
array(
|
||||||
'go' => _("Display this website."),
|
'go' => _("Display this website."),
|
||||||
|
|
|
@ -44,7 +44,7 @@ class LSformElement_xmpp extends LSformElement_text {
|
||||||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||||
|
|
||||||
public function getDisplay() {
|
public function getDisplay() {
|
||||||
LSsession :: addHelpInfos (
|
LStemplate :: addHelpInfo(
|
||||||
'LSformElement_xmpp',
|
'LSformElement_xmpp',
|
||||||
array(
|
array(
|
||||||
'chat' => _("Chat with this person.")
|
'chat' => _("Chat with this person.")
|
||||||
|
|
|
@ -75,9 +75,6 @@ class LSsession {
|
||||||
// Libs JS files to load on page
|
// Libs JS files to load on page
|
||||||
private static $LibsJSscripts = array();
|
private static $LibsJSscripts = array();
|
||||||
|
|
||||||
// Les paramètres JS à communiquer dans la page
|
|
||||||
private static $_JSconfigParams = array();
|
|
||||||
|
|
||||||
// Les fichiers CSS à charger dans la page
|
// Les fichiers CSS à charger dans la page
|
||||||
private static $CssFiles = array();
|
private static $CssFiles = array();
|
||||||
|
|
||||||
|
@ -1625,7 +1622,8 @@ class LSsession {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['LSjsConfig'] = self :: $_JSconfigParams;
|
if (class_exists('LStemplate'))
|
||||||
|
$data['LSjsConfig'] = LStemplate :: getJSconfigParam();
|
||||||
|
|
||||||
// Infos
|
// Infos
|
||||||
if((!empty($_SESSION['LSsession_infos']))&&(is_array($_SESSION['LSsession_infos']))) {
|
if((!empty($_SESSION['LSsession_infos']))&&(is_array($_SESSION['LSsession_infos']))) {
|
||||||
|
@ -2630,23 +2628,23 @@ class LSsession {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ajout d'une information d'aide
|
* Add help info
|
||||||
*
|
*
|
||||||
* @param[in] $group string Le nom du groupe d'infos dans lequels ajouter
|
* @param[in] $group string The group name of this information
|
||||||
* celle-ci
|
* @param[in] $info array Array of the information to add (name => value)
|
||||||
* @param[in] $infos array Tableau array(name => value) des infos
|
|
||||||
*
|
*
|
||||||
* @retval void
|
* @retval void
|
||||||
*/
|
*/
|
||||||
public static function addHelpInfos($group,$infos) {
|
public static function addHelpInfos($group, $info) {
|
||||||
if (is_array($infos)) {
|
LStemplate :: addHelpInfo($group, $info);
|
||||||
if (isset(self :: $_JSconfigParams['helpInfos'][$group]) && is_array(self :: $_JSconfigParams['helpInfos'][$group])) {
|
LSerror :: addErrorCode(
|
||||||
self :: $_JSconfigParams['helpInfos'][$group] = array_merge(self :: $_JSconfigParams['helpInfos'][$group],$infos);
|
'LSsession_27',
|
||||||
}
|
array(
|
||||||
else {
|
'old' => 'LStemplate :: addHelpInfo()',
|
||||||
self :: $_JSconfigParams['helpInfos'][$group] = $infos;
|
'new' => 'LStemplate :: addHelpInfo()',
|
||||||
}
|
'context' => LSlog :: get_debug_backtrace_context(),
|
||||||
}
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -566,6 +566,34 @@ class LStemplate extends LSlog_staticLoggerClass {
|
||||||
self :: $JSconfigParams[$name]=$val;
|
self :: $JSconfigParams[$name]=$val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Javascript configuration parameters
|
||||||
|
*
|
||||||
|
* @retval array Javascript configuration parameters
|
||||||
|
*/
|
||||||
|
public static function getJSconfigParam() {
|
||||||
|
return self :: $JSconfigParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add help info
|
||||||
|
*
|
||||||
|
* @param[in] $group string The group name of this information
|
||||||
|
* @param[in] $info array Array of the information to add (name => value)
|
||||||
|
*
|
||||||
|
* @retval void
|
||||||
|
*/
|
||||||
|
public static function addHelpInfo($group, $info) {
|
||||||
|
if (is_array($info)) {
|
||||||
|
if (isset(self :: $JSconfigParams['helpInfo'][$group]) && is_array(self :: $JSconfigParams['helpInfo'][$group])) {
|
||||||
|
self :: $JSconfigParams['helpInfo'][$group] = array_merge(self :: $JSconfigParams['helpInfo'][$group],$info);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
self :: $JSconfigParams['helpInfo'][$group] = $info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a CSS file to load on page
|
* Add a CSS file to load on page
|
||||||
*
|
*
|
||||||
|
|
|
@ -240,12 +240,12 @@ var LSdefault = new Class({
|
||||||
},
|
},
|
||||||
|
|
||||||
addHelpInfo: function(el,group,name) {
|
addHelpInfo: function(el,group,name) {
|
||||||
if ($type(this.LSjsConfig['helpInfos'])) {
|
if ($type(this.LSjsConfig['helpInfo'])) {
|
||||||
if ($type(el)=='element') {
|
if ($type(el)=='element') {
|
||||||
if ($type(this.LSjsConfig['helpInfos'][group])) {
|
if ($type(this.LSjsConfig['helpInfo'][group])) {
|
||||||
if ($type(this.LSjsConfig['helpInfos'][group][name])) {
|
if ($type(this.LSjsConfig['helpInfo'][group][name])) {
|
||||||
this.addTip(el);
|
this.addTip(el);
|
||||||
el.store('tip:title',this.LSjsConfig['helpInfos'][group][name]);
|
el.store('tip:title',this.LSjsConfig['helpInfo'][group][name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -253,11 +253,11 @@ var LSdefault = new Class({
|
||||||
},
|
},
|
||||||
|
|
||||||
setHelpInfo: function(el,group,name) {
|
setHelpInfo: function(el,group,name) {
|
||||||
if ($type(this.LSjsConfig['helpInfos'])) {
|
if ($type(this.LSjsConfig['helpInfo'])) {
|
||||||
if ($type(el)=='element') {
|
if ($type(el)=='element') {
|
||||||
if ($type(this.LSjsConfig['helpInfos'][group])) {
|
if ($type(this.LSjsConfig['helpInfo'][group])) {
|
||||||
if ($type(this.LSjsConfig['helpInfos'][group][name])) {
|
if ($type(this.LSjsConfig['helpInfo'][group][name])) {
|
||||||
el.store('tip:title',this.LSjsConfig['helpInfos'][group][name]);
|
el.store('tip:title',this.LSjsConfig['helpInfo'][group][name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue