Add helpInfo parameter for customActions

This commit is contained in:
Benjamin Renard 2017-01-25 12:05:22 +01:00
parent e76a25b22b
commit 002e83e1ab
4 changed files with 12 additions and 1 deletions

View file

@ -9,6 +9,7 @@
'action1' => array(
'label' => '[label l'action]',
'hideLabel' => '[booléen]',
'helpInfo' => '[label d'aide]',
'icon' => '[nom de l'icône de l'action]',
'function' => '[fonction à exécuter]',
'question_format' => '[LSformat de la question de confirmation]',
@ -42,6 +43,13 @@
</listitem>
</varlistentry>
<varlistentry>
<term>helpInfo</term>
<listitem>
<simpara>Le label du message d'aide qui sera affiché au survole du bouton de l'action.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>icon</term>
<listitem>

View file

@ -131,6 +131,7 @@ if (loadDir(LS_OBJECTS_DIR) && loadDir(LS_LOCAL_DIR.LS_OBJECTS_DIR)) {
if (is_array($conf['customActions'])) {
foreach($conf['customActions'] as $act) {
add($act['label']);
add($act['helpInfo']);
add($act['question_format']);
add($act['onSuccessMsgFormat']);
}

View file

@ -4,7 +4,7 @@
<ul class='LSview-actions'>
{foreach from=$LSview_actions item=item}
{if is_array($item)}
<li class='LSview-actions'><a href="{$item.url}" class="LSview-actions{if $item.class} {$item.class}{/if}" ><img src="{img name=$item.action}" alt="{$item.label}" title="{$item.label}" />{if !isset($item.hideLabel) || !$item.hideLabel} {$item.label}{/if}</a></li>
<li class='LSview-actions'><a href="{$item.url}" class="LSview-actions{if $item.class} {$item.class|escape:"quotes"}{/if}{if $item.helpInfo || ($item.hideLabel && $item.label)} LStips{/if}" {if $item.helpInfo || ($item.hideLabel && $item.label)}title="{if $item.helpInfo}{$item.helpInfo|escape:"quotes"}{else}{$item.label|escape:"quotes"}{/if}"{/if}><img src="{img name=$item.action}" alt="{$item.label|escape:"quotes"}" title="{$item.label|escape:"quotes"}" />{if !isset($item.hideLabel) || !$item.hideLabel} {$item.label}{/if}</a></li>
{/if}
{/foreach}
</ul>

View file

@ -70,6 +70,7 @@ if(LSsession :: startLSsession()) {
$LSview_actions[] = array (
'label' => ((isset($config['label']))?__($config['label']):__($name)),
'hideLabel' => ((isset($config['hideLabel']))?$config['hideLabel']:False),
'helpInfo' => ((isset($config['helpInfo']))?__($config['helpInfo']):False),
'url' => 'custom_action.php?LSobject='.$LSobject.'&amp;dn='.urlencode($dn).'&amp;customAction='.$name,
'action' => ((isset($config['icon']))?$config['icon']:'generate'),
'class' => 'LScustomActions'.(($config['noConfirmation'])?' LScustomActions_noConfirmation':'')
@ -167,6 +168,7 @@ if(LSsession :: startLSsession()) {
$LSview_actions[] = array (
'label' => ((isset($config['label']))?__($config['label']):__($name)),
'hideLabel' => ((isset($config['hideLabel']))?$config['hideLabel']:False),
'helpInfo' => ((isset($config['helpInfo']))?__($config['helpInfo']):False),
'url' => 'custom_search_action.php?LSobject='.$LSobject.'&amp;customAction='.$name,
'action' => ((isset($config['icon']))?$config['icon']:'generate'),
'class' => 'LScustomActions'.(($config['noConfirmation'])?' LScustomActions_noConfirmation':'')