Poner checkboxes y radiobuttons en horizontal.
git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_FormulariosCalidad/trunk@14 e2c41b2c-0c6f-0149-8b81-50b1a9191bb3
This commit is contained in:
parent
635411b52b
commit
e7bfe401f2
@ -254,8 +254,8 @@ Tipo de campo
|
|||||||
<select class="select full" id="element_type" autocomplete="off" tabindex="12" onchange="set_properties(JJ(this).val(), 'type')">
|
<select class="select full" id="element_type" autocomplete="off" tabindex="12" onchange="set_properties(JJ(this).val(), 'type')">
|
||||||
<option value="text">Línea de texto</option>
|
<option value="text">Línea de texto</option>
|
||||||
<option value="textarea">Párrafo de texto</option>
|
<option value="textarea">Párrafo de texto</option>
|
||||||
<option value="radio">Selección múltiple</option>
|
<option value="radio">Botón de opciones</option>
|
||||||
<option value="checkbox">Cajas de selección</option>
|
<option value="checkbox">Casillas de selección</option>
|
||||||
<option value="select">Lista desplegable</option>
|
<option value="select">Lista desplegable</option>
|
||||||
<option value="number">Número</option>
|
<option value="number">Número</option>
|
||||||
<option value="simple_name">Nombre</option>
|
<option value="simple_name">Nombre</option>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 807 B |
Binary file not shown.
|
Before Width: | Height: | Size: 783 B After Width: | Height: | Size: 751 B |
@ -483,13 +483,8 @@ EOT;
|
|||||||
$guidelines = "<p class=\"guidelines\" id=\"guide_{$element->id}\"><small>{$element->guidelines}</small></p>";
|
$guidelines = "<p class=\"guidelines\" id=\"guide_{$element->id}\"><small>{$element->guidelines}</small></p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$option_markup = '';
|
$option_markup .= '<table width="582px" border="0">';
|
||||||
|
$cell_col = 1;
|
||||||
if($element->constraint == 'random'){
|
|
||||||
$temp = $element->options;
|
|
||||||
shuffle($temp);
|
|
||||||
$element->options = $temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($element->options as $option){
|
foreach ($element->options as $option){
|
||||||
|
|
||||||
@ -502,15 +497,34 @@ EOT;
|
|||||||
//check for populated values
|
//check for populated values
|
||||||
if(!empty($element->populated_value['element_'.$element->id]['default_value'])){
|
if(!empty($element->populated_value['element_'.$element->id]['default_value'])){
|
||||||
$checked = '';
|
$checked = '';
|
||||||
if($element->populated_value['element_'.$element->id]['default_value'] == $option->id){
|
if($element->populated_value['element_'.$element->id]['default_value']
|
||||||
|
== $option->id){
|
||||||
$checked = 'checked="checked"';
|
$checked = 'checked="checked"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$option_markup .= "<input id=\"element_{$element->id}_{$option->id}\" name=\"element_{$element->id}\" class=\"element radio\" type=\"radio\" value=\"{$option->id}\" {$checked} />\n";
|
$option_input = "<input id=\"element_{$element->id}_{$option->id}\"
|
||||||
$option_markup .= "<label class=\"choice\" for=\"element_{$element->id}_{$option->id}\">{$option->option}</label>\n";
|
name=\"element_{$element->id}\" class=\"element radio\"
|
||||||
|
type=\"radio\" value=\"{$option->id}\" {$checked} />";
|
||||||
|
$option_label = "<label class=\"choice\" for=\"element_{$element->id}_{$option->id}\">
|
||||||
|
{$option->option}</label>";
|
||||||
|
|
||||||
|
if ($cell_col == 1) {
|
||||||
|
$option_markup .= '<tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$option_markup .= '<td width="20%">' . $option_input . ' ' . $option_label . '</td>';
|
||||||
|
|
||||||
|
if ($cell_col == 5) {
|
||||||
|
$option_markup .= '</tr>';
|
||||||
|
$cell_col = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$cell_col++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$option_markup .= "</table>";
|
||||||
|
|
||||||
$element_markup = <<<EOT
|
$element_markup = <<<EOT
|
||||||
<li id="li_{$element->id}" {$error_class}>
|
<li id="li_{$element->id}" {$error_class}>
|
||||||
<label class="description">{$element->title} {$span_required}</label>
|
<label class="description">{$element->title} {$span_required}</label>
|
||||||
@ -558,6 +572,9 @@ EOT;
|
|||||||
|
|
||||||
$option_markup = '';
|
$option_markup = '';
|
||||||
|
|
||||||
|
$option_markup .= '<table width="580px" border="0" cellpadding="0">';
|
||||||
|
$cell_col = 1;
|
||||||
|
|
||||||
foreach ($element->options as $option){
|
foreach ($element->options as $option){
|
||||||
if(!$is_populated){
|
if(!$is_populated){
|
||||||
if($option->is_default){
|
if($option->is_default){
|
||||||
@ -567,19 +584,37 @@ EOT;
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
if(!empty($element->populated_value['element_'.$element->id.'_'.$option->id]['default_value'])){
|
if(!empty($element->populated_value['element_'.$element->id.'_'
|
||||||
|
.$option->id]['default_value'])){
|
||||||
$checked = 'checked="checked"';
|
$checked = 'checked="checked"';
|
||||||
}else{
|
}else{
|
||||||
$checked = '';
|
$checked = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$option_input = "<input id=\"element_{$element->id}_{$option->id}\"
|
||||||
|
name=\"element_{$element->id}_{$option->id}\"
|
||||||
|
class=\"element checkbox\" type=\"checkbox\" value=\"1\" {$checked} />";
|
||||||
|
$option_label = "<label class=\"choice\" for=\"element_{$element->id}_{$option->id}\">
|
||||||
|
{$option->option}</label>";
|
||||||
|
|
||||||
|
if ($cell_col == 1) {
|
||||||
|
$option_markup .= '<tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$option_markup .= '<td width="35%">' . $option_input . ' ' . $option_label . '</td>';
|
||||||
|
|
||||||
|
if ($cell_col == 3) {
|
||||||
|
$option_markup .= '</tr>';
|
||||||
|
$cell_col = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$cell_col++;
|
||||||
|
|
||||||
$option_markup .= "<input id=\"element_{$element->id}_{$option->id}\" name=\"element_{$element->id}_{$option->id}\" class=\"element checkbox\" type=\"checkbox\" value=\"1\" {$checked} />\n";
|
|
||||||
$option_markup .= "<label class=\"choice\" for=\"element_{$element->id}_{$option->id}\">{$option->option}</label>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$option_markup .= '</table>';
|
||||||
|
|
||||||
$element_markup = <<<EOT
|
$element_markup = <<<EOT
|
||||||
<li id="li_{$element->id}" {$error_class}>
|
<li id="li_{$element->id}" {$error_class}>
|
||||||
<label class="description">{$element->title} {$span_required}</label>
|
<label class="description">{$element->title} {$span_required}</label>
|
||||||
|
|||||||
@ -3202,10 +3202,10 @@ data_source.prototype = {
|
|||||||
title = "Lista desplegable";
|
title = "Lista desplegable";
|
||||||
break;
|
break;
|
||||||
case "radio":
|
case "radio":
|
||||||
title = "Selección múltiple";
|
title = "Botón de opciones";
|
||||||
break;
|
break;
|
||||||
case "checkbox":
|
case "checkbox":
|
||||||
title = "Cajas de selección";
|
title = "Casillas de selección";
|
||||||
break;
|
break;
|
||||||
case "name":
|
case "name":
|
||||||
title = "Nombre";
|
title = "Nombre";
|
||||||
@ -3266,19 +3266,31 @@ data_source.prototype = {
|
|||||||
default_value: "",
|
default_value: "",
|
||||||
constraint: "",
|
constraint: "",
|
||||||
options: [{
|
options: [{
|
||||||
option: "Primera opción",
|
option: "Primera",
|
||||||
is_default: 0,
|
is_default: 0,
|
||||||
is_db_live: "0",
|
is_db_live: "0",
|
||||||
id: "0"
|
id: "0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
option: "Segunda opción",
|
option: "Segunda",
|
||||||
is_default: 0,
|
is_default: 0,
|
||||||
is_db_live: "0",
|
is_db_live: "0",
|
||||||
id: "0"
|
id: "0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
option: "Tercera opción",
|
option: "Tercera",
|
||||||
|
is_default: 0,
|
||||||
|
is_db_live: "0",
|
||||||
|
id: "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
option: "Cuarta",
|
||||||
|
is_default: 0,
|
||||||
|
is_db_live: "0",
|
||||||
|
id: "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
option: "Quinta",
|
||||||
is_default: 0,
|
is_default: 0,
|
||||||
is_db_live: "0",
|
is_db_live: "0",
|
||||||
id: "0"
|
id: "0"
|
||||||
|
|||||||
@ -465,7 +465,7 @@ EOT;
|
|||||||
<td width="9%"><a href="<?php echo "edit_form.php?id={$data['form_id']}"; ?>"><img src="images/icons/edit_form_32.gif" /></a></td>
|
<td width="9%"><a href="<?php echo "edit_form.php?id={$data['form_id']}"; ?>"><img src="images/icons/edit_form_32.gif" /></a></td>
|
||||||
<td width="9%"><a href="<?php echo "edit_css.php?id={$data['form_id']}"; ?>"><img src="images/icons/colorize_32.gif" /></a></td>
|
<td width="9%"><a href="<?php echo "edit_css.php?id={$data['form_id']}"; ?>"><img src="images/icons/colorize_32.gif" /></a></td>
|
||||||
<td width="9%"><a href="<?php echo "email_settings.php?id={$data['form_id']}"; ?>"><img src="images/icons/mail_forward_32.gif" /></a></td>
|
<td width="9%"><a href="<?php echo "email_settings.php?id={$data['form_id']}"; ?>"><img src="images/icons/mail_forward_32.gif" /></a></td>
|
||||||
<?php /*<td width="9%"><a href=" < ? p h p echo "embed_code.php?id={$data['form_id']}"; ? > "><img src="images/icons/embed_code_32.gif" /></a></td>*/ ?>
|
<td width="9%"><a href="<?php echo "embed_code.php?id={$data['form_id']}"; ?>"><img src="images/icons/embed_code_32.gif" /></a></td>
|
||||||
<td width="9%"> </td>
|
<td width="9%"> </td>
|
||||||
<td width="9%"><a href="view.php?id=<?php echo $data['form_id']; ?>" target="_blank"><img src="images/icons/view_form_32.gif" /></a></td>
|
<td width="9%"><a href="view.php?id=<?php echo $data['form_id']; ?>" target="_blank"><img src="images/icons/view_form_32.gif" /></a></td>
|
||||||
<td width="21%"> </td>
|
<td width="21%"> </td>
|
||||||
@ -477,7 +477,7 @@ EOT;
|
|||||||
<td><a href="<?php echo "edit_form.php?id={$data['form_id']}"; ?>">Editar form.</a></td>
|
<td><a href="<?php echo "edit_form.php?id={$data['form_id']}"; ?>">Editar form.</a></td>
|
||||||
<td nowrap><a href="<?php echo "edit_css.php?id={$data['form_id']}"; ?>">Editar estilo</a></td>
|
<td nowrap><a href="<?php echo "edit_css.php?id={$data['form_id']}"; ?>">Editar estilo</a></td>
|
||||||
<td nowrap><a href="<?php echo "email_settings.php?id={$data['form_id']}"; ?>">Emails</a></td>
|
<td nowrap><a href="<?php echo "email_settings.php?id={$data['form_id']}"; ?>">Emails</a></td>
|
||||||
<?php /*<td nowrap><a href=" < ? p h p echo "embed_code.php?id={$data['form_id']}"; ? > ">Código</a></td> */ ?>
|
<td nowrap><a href="<?php echo "embed_code.php?id={$data['form_id']}"; ?>">Código</a></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td><a href="view.php?id=<?php echo $data['form_id']; ?>" target="_blank">Ver formulario</a></td>
|
<td><a href="view.php?id=<?php echo $data['form_id']; ?>" target="_blank">Ver formulario</a></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user