Modification du Helper adapté pour la structure de donnée.
This commit is contained in:
parent
e1529c549e
commit
465269d60d
@ -11,6 +11,8 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
switch($type){
|
||||
case 'select':
|
||||
return ($this->structureHTML($field['label'], $this->selectHTML($name, $field)));
|
||||
case 'selectMultiple':
|
||||
return ($this->structureHTML($field['label'], $this->selectMultipleHTML($name, $field)));
|
||||
case 'interval':
|
||||
return ($this->structureHTML($field['label'], $this->intervalHTML($name, $field)));
|
||||
case 'date':
|
||||
@ -29,59 +31,84 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
|
||||
private function structureHTML($label, $html)
|
||||
{
|
||||
return ('<div class="fieldgrp">
|
||||
$return ='<div class="fieldgrp">
|
||||
<label>'.$label.'</label>
|
||||
<div class="field">
|
||||
'.$html.'
|
||||
<span></span>
|
||||
<span><a href="">Switch type</a></span>
|
||||
</div>
|
||||
</div>');
|
||||
</div>';
|
||||
|
||||
return ($return);
|
||||
}
|
||||
|
||||
private function selectHTML($name, $field)
|
||||
{
|
||||
/* Select */
|
||||
private function selectMultipleHTML($name, $field)
|
||||
{
|
||||
$i = 0;
|
||||
|
||||
$return = '<select class="criteres" name="'.$name.'">';
|
||||
$return .= '<option value="tous">Tous</option>';
|
||||
foreach($field['fields'][$field['type']]['value'] as $option) {
|
||||
$return .= '<option '.(($field['fields']['selected'] == $option)?'selected':'').' value="'.$option.'">'.$option.'</option>';
|
||||
$return .= '<option '.(($field['fields']['selected'] == $option)?'selected':'').' value="'.$i++.'">'.$option.'</option>';
|
||||
}
|
||||
$return .= '</select>';
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Select Multiple */
|
||||
private function selectHTML($name, $field)
|
||||
{
|
||||
$i = 0;
|
||||
|
||||
$return = '<select class="criteres" name="'.$name.'">';
|
||||
$return .= '<option value="tous">Tous</option>';
|
||||
foreach($field['fields'][$field['type']]['value'] as $option) {
|
||||
$return .= '<option '.(($field['fields']['selected'] == $option)?'selected':'').' value="'.$i++.'">'.$option.'</option>';
|
||||
}
|
||||
$return .= '</select>';
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Interval */
|
||||
private function intervalHTML($name, $field)
|
||||
{
|
||||
$return .= '<div style="text-align:right;height:17px;">';
|
||||
$return .= '<input value="'.$field['fields'][$field['type']]['value'][0].','.$field['fields'][$field['type']]['value'][1].'" name="'.$name.'" class="range slider_Text" type="text" id="'.$name.'" min="'.$field['fields'][$field['type']]['default'][0].'" max="'.$field['fields'][$field['type']]['default'][1].'" style="margin-left:10px;margin-top:3px;float:left;border:0; color:black; font-weight:bold;" />';
|
||||
$return = '<div class="mySlider" style="text-align:right;height:17px;">';
|
||||
$return .= '<input style="display:none;" value="'.$field['fields'][$field['type']]['value'][0].','.$field['fields'][$field['type']]['value'][1].'" name="'.$name.'" class="range slider_Text" type="text" id="'.$name.'" min="0" max="1000" />';
|
||||
$return .= '<div input="'.$name.'" class="slider-range"></div></div>';
|
||||
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Dates */
|
||||
private function dateHTML($name, $field)
|
||||
{
|
||||
$return .= '<input value="" type="text" class="from" name="'.$name.'1" /> a ';
|
||||
$return .= '<input type="text" class="to" name="'.$name.'2" />';
|
||||
$return = '<input value="" type="text" class="datepicker" name="'.$name.'1" /> a ';
|
||||
$return .= '<input type="text" class="datepicker" name="'.$name.'2" />';
|
||||
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Textes */
|
||||
private function textHTML($name, $field)
|
||||
{
|
||||
$return .= '<input style="border:1px inset silver;width:60%" class="criteres" type="text" name="'.$name.'" value="'.$field['fields'][$field['type']]['value'].'" /></div>';
|
||||
$return = '<input style="border:1px inset silver;width:60%" class="criteres" type="text" name="'.$name.'" value="'.$field['fields'][$field['type']]['value'].'" /></div>';
|
||||
|
||||
return ($return);
|
||||
}
|
||||
|
||||
private function textareaHTML($name, $field, $item)
|
||||
/* Textarea */
|
||||
private function textareaHTML($name, $field)
|
||||
{
|
||||
$return .= '<textarea style="border:1px inset silver;width:60%;height:40px;" name="'.$name.'">'.$field['fields'][$field['type']]['value'].'</textarea>';
|
||||
$return = '<textarea style="border:1px inset silver;width:60%;height:40px;" name="'.$name.'">'.$field['fields'][$field['type']]['value'].'</textarea>';
|
||||
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Radios */
|
||||
private function radioHTML($name, $field, $item)
|
||||
{
|
||||
// en cours.
|
||||
$return = '<input type="radio" name="'.$name.'" />';
|
||||
|
||||
return ($return);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user