mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 09:59: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
|
||||
* LStemplate:
|
||||
- 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
|
||||
template instead of directly use Smarty methods.
|
||||
* Interface is now responsive
|
||||
|
|
|
@ -161,6 +161,8 @@ grep -Er 'url\(.*\.(png|gif|jpg)' /etc/ldapsaisie/local/css</programlisting></pa
|
|||
</listitem>
|
||||
<listitem><simpara><literal>LSsession :: addJSconfigParam()</literal> devient
|
||||
<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
|
||||
<literal>LStemplate :: addCssFile()</literal>.</para>
|
||||
<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>
|
||||
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\(.*\.\.\/' /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.js');
|
||||
|
||||
LSsession :: addHelpInfos(
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSform',
|
||||
array(
|
||||
'addFieldBtn' => _('Add a field to add another values.'),
|
||||
|
|
|
@ -46,7 +46,7 @@ class LSformElement_boolean extends LSformElement {
|
|||
$return = $this -> getLabelInfos();
|
||||
if (!$this -> isFreeze()) {
|
||||
// Help Infos
|
||||
LSsession :: addHelpInfos(
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_boolean',
|
||||
array(
|
||||
'clear' => _('Reset the choice.')
|
||||
|
|
|
@ -146,7 +146,7 @@ class LSformElement_date extends LSformElement {
|
|||
// value
|
||||
if (!$this -> isFreeze()) {
|
||||
// Help Infos
|
||||
LSsession :: addHelpInfos(
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_date',
|
||||
array(
|
||||
'now' => _('Now.'),
|
||||
|
|
|
@ -47,7 +47,7 @@ class LSformElement_image extends LSformElement {
|
|||
$return = true;
|
||||
$id=$this -> name.'_'.rand();
|
||||
if (!$this -> isFreeze()) {
|
||||
LSsession :: addHelpInfos(
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_date',
|
||||
array(
|
||||
'zoom' => _('Click to enlarge.'),
|
||||
|
|
|
@ -50,7 +50,7 @@ class LSformElement_mail extends LSformElement_text {
|
|||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||
|
||||
public function getDisplay() {
|
||||
LSsession :: addHelpInfos (
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_mail',
|
||||
array(
|
||||
'mail' => _("Send a mail from here.")
|
||||
|
|
|
@ -62,7 +62,7 @@ class LSformElement_maildir extends LSformElement_text {
|
|||
var $fieldTemplate = 'LSformElement_maildir_field.tpl';
|
||||
|
||||
public function getDisplay() {
|
||||
LSsession :: addHelpInfos (
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_maildir',
|
||||
array(
|
||||
'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()) {
|
||||
|
||||
// Help Infos
|
||||
LSsession :: addHelpInfos(
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_password',
|
||||
array(
|
||||
'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)
|
||||
)
|
||||
);
|
||||
LSsession :: addHelpInfos(
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_postaladdress',
|
||||
array(
|
||||
'viewOnMap' => _('View on map')
|
||||
|
|
|
@ -44,7 +44,7 @@ class LSformElement_rss extends LSformElement_text {
|
|||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||
|
||||
public function getDisplay() {
|
||||
LSsession :: addHelpInfos (
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_rss',
|
||||
array(
|
||||
'display' => _("Display RSS stack.")
|
||||
|
|
|
@ -46,7 +46,7 @@ class LSformElement_select extends LSformElement {
|
|||
$return = $this -> getLabelInfos();
|
||||
$params = array();
|
||||
if (!$this -> isFreeze()) {
|
||||
LSsession :: addHelpInfos (
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_select',
|
||||
array(
|
||||
'clear' => _("Reset selection.")
|
||||
|
|
|
@ -77,7 +77,7 @@ class LSformElement_select_object extends LSformElement {
|
|||
)
|
||||
);
|
||||
|
||||
LSsession :: addHelpInfos (
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_select_object',
|
||||
array(
|
||||
'searchAdd' => _("Fast Add"),
|
||||
|
|
|
@ -51,7 +51,7 @@ class LSformElement_ssh_key extends LSformElement {
|
|||
}
|
||||
else {
|
||||
LStemplate :: addJSscript('LSformElement_ssh_key.js');
|
||||
LSsession :: addHelpInfos (
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_ssh_key',
|
||||
array(
|
||||
'display' => _("Display the full key.")
|
||||
|
|
|
@ -51,7 +51,7 @@ class LSformElement_text extends LSformElement {
|
|||
if ($this -> getParam('html_options')) {
|
||||
LStemplate :: addJSconfigParam($this -> name, $this -> getParam('html_options'));
|
||||
}
|
||||
LSsession :: addHelpInfos(
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_text',
|
||||
array(
|
||||
'generate' => _('Generate the value')
|
||||
|
|
|
@ -45,7 +45,7 @@ class LSformElement_textarea extends LSformElement {
|
|||
public function getDisplay(){
|
||||
$return = $this -> getLabelInfos();
|
||||
if (!$this -> isFreeze()) {
|
||||
LSsession :: addHelpInfos(
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_textarea',
|
||||
array(
|
||||
'clear' => _('Clear')
|
||||
|
|
|
@ -45,7 +45,7 @@ class LSformElement_url extends LSformElement_text {
|
|||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||
|
||||
public function getDisplay() {
|
||||
LSsession :: addHelpInfos (
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_url',
|
||||
array(
|
||||
'go' => _("Display this website."),
|
||||
|
|
|
@ -44,7 +44,7 @@ class LSformElement_xmpp extends LSformElement_text {
|
|||
var $fieldTemplate = 'LSformElement_uri_field.tpl';
|
||||
|
||||
public function getDisplay() {
|
||||
LSsession :: addHelpInfos (
|
||||
LStemplate :: addHelpInfo(
|
||||
'LSformElement_xmpp',
|
||||
array(
|
||||
'chat' => _("Chat with this person.")
|
||||
|
|
|
@ -75,9 +75,6 @@ class LSsession {
|
|||
// Libs JS files to load on page
|
||||
private static $LibsJSscripts = array();
|
||||
|
||||
// Les paramètres JS à communiquer dans la page
|
||||
private static $_JSconfigParams = array();
|
||||
|
||||
// Les fichiers CSS à charger dans la page
|
||||
private static $CssFiles = array();
|
||||
|
||||
|
@ -1625,7 +1622,8 @@ class LSsession {
|
|||
return;
|
||||
}
|
||||
|
||||
$data['LSjsConfig'] = self :: $_JSconfigParams;
|
||||
if (class_exists('LStemplate'))
|
||||
$data['LSjsConfig'] = LStemplate :: getJSconfigParam();
|
||||
|
||||
// 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
|
||||
* celle-ci
|
||||
* @param[in] $infos array Tableau array(name => value) des infos
|
||||
* @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 addHelpInfos($group,$infos) {
|
||||
if (is_array($infos)) {
|
||||
if (isset(self :: $_JSconfigParams['helpInfos'][$group]) && is_array(self :: $_JSconfigParams['helpInfos'][$group])) {
|
||||
self :: $_JSconfigParams['helpInfos'][$group] = array_merge(self :: $_JSconfigParams['helpInfos'][$group],$infos);
|
||||
}
|
||||
else {
|
||||
self :: $_JSconfigParams['helpInfos'][$group] = $infos;
|
||||
}
|
||||
}
|
||||
public static function addHelpInfos($group, $info) {
|
||||
LStemplate :: addHelpInfo($group, $info);
|
||||
LSerror :: addErrorCode(
|
||||
'LSsession_27',
|
||||
array(
|
||||
'old' => 'LStemplate :: addHelpInfo()',
|
||||
'new' => 'LStemplate :: addHelpInfo()',
|
||||
'context' => LSlog :: get_debug_backtrace_context(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -566,6 +566,34 @@ class LStemplate extends LSlog_staticLoggerClass {
|
|||
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
|
||||
*
|
||||
|
|
|
@ -240,12 +240,12 @@ var LSdefault = new Class({
|
|||
},
|
||||
|
||||
addHelpInfo: function(el,group,name) {
|
||||
if ($type(this.LSjsConfig['helpInfos'])) {
|
||||
if ($type(this.LSjsConfig['helpInfo'])) {
|
||||
if ($type(el)=='element') {
|
||||
if ($type(this.LSjsConfig['helpInfos'][group])) {
|
||||
if ($type(this.LSjsConfig['helpInfos'][group][name])) {
|
||||
if ($type(this.LSjsConfig['helpInfo'][group])) {
|
||||
if ($type(this.LSjsConfig['helpInfo'][group][name])) {
|
||||
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) {
|
||||
if ($type(this.LSjsConfig['helpInfos'])) {
|
||||
if ($type(this.LSjsConfig['helpInfo'])) {
|
||||
if ($type(el)=='element') {
|
||||
if ($type(this.LSjsConfig['helpInfos'][group])) {
|
||||
if ($type(this.LSjsConfig['helpInfos'][group][name])) {
|
||||
el.store('tip:title',this.LSjsConfig['helpInfos'][group][name]);
|
||||
if ($type(this.LSjsConfig['helpInfo'][group])) {
|
||||
if ($type(this.LSjsConfig['helpInfo'][group][name])) {
|
||||
el.store('tip:title',this.LSjsConfig['helpInfo'][group][name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue