mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 22:43:47 +01:00
Add LSattr_html::select_box
This commit is contained in:
parent
110f162367
commit
463bf37cf2
3 changed files with 96 additions and 0 deletions
38
public_html/includes/class/class.LSattr_html_select_box.php
Normal file
38
public_html/includes/class/class.LSattr_html_select_box.php
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (C) 2007 Easter-eggs
|
||||||
|
* http://ldapsaisie.labs.libre-entreprise.org
|
||||||
|
*
|
||||||
|
* Author: See AUTHORS file in top-level directory.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
LSsession :: loadLSclass('LSattr_html_select_list');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HTML attribute type select_box
|
||||||
|
*
|
||||||
|
* Same as LSattr_html_select_list but using <input> type checkbox
|
||||||
|
* for multiple values selection and type radio for single value
|
||||||
|
* selection.
|
||||||
|
*
|
||||||
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
|
*/
|
||||||
|
class LSattr_html_select_box extends LSattr_html_select_list {
|
||||||
|
|
||||||
|
var $LSformElement_type = 'select_box';
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (C) 2007 Easter-eggs
|
||||||
|
* http://ldapsaisie.labs.libre-entreprise.org
|
||||||
|
*
|
||||||
|
* Author: See AUTHORS file in top-level directory.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License version 2
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
LSsession :: loadLSclass('LSformElement_select');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select box form element for LdapSaisie
|
||||||
|
*
|
||||||
|
* This class define select box form element.
|
||||||
|
* It's an extention of LSformElement_select class.
|
||||||
|
*
|
||||||
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
class LSformElement_select_box extends LSformElement_select {
|
||||||
|
|
||||||
|
var $template = 'LSformElement_select_box.tpl';
|
||||||
|
var $fieldTemplate = 'LSformElement_select_box.tpl';
|
||||||
|
|
||||||
|
}
|
19
public_html/templates/default/LSformElement_select_box.tpl
Normal file
19
public_html/templates/default/LSformElement_select_box.tpl
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<ul class='LSform' id='{$attr_name}'>
|
||||||
|
{if $freeze}
|
||||||
|
{foreach from=$values item=value}
|
||||||
|
{if array_key_exists($value,$possible_values)}
|
||||||
|
<li>{$possible_values.$value}</li>
|
||||||
|
{else}
|
||||||
|
<li class='LSform-errors'>{getFData format=$unrecognized_value_label_format data=$value}</li>
|
||||||
|
{/if}
|
||||||
|
{foreachelse}
|
||||||
|
<li>{$noValueTxt}</li>
|
||||||
|
{/foreach}
|
||||||
|
{else}
|
||||||
|
{foreach from=$possible_values item=label key=value name=LSformElement_selectbox}
|
||||||
|
<li>
|
||||||
|
<input type='{if $multiple}checkbox{else}radio{/if}' name='{$attr_name}[]' class='LSformElement_selectbox' id='LSformElement_selectbox_{$attr_name}_{$smarty.foreach.LSformElement_selectbox.index}' value="{$value}" {if in_array($value,$values)}checked{/if}/> <label for='LSformElement_selectbox_{$attr_name}_{$smarty.foreach.LSformElement_selectbox.index}'>{tr msg=$label}</label>
|
||||||
|
</li>
|
||||||
|
{/foreach}
|
||||||
|
{/if}
|
||||||
|
</ul>
|
Loading…
Reference in a new issue