Example #1
0
/**
 * Cria um label->input[type=radio]
 * @param string $name
 * @param string $caption
 * @param string|int $value
 * @param array $attributes
 * @return string
 */
function formInputRadio($name, $caption, $value, array $attributes = null)
{
    return formLabel($caption, formInput($name, $value, 'radio', $attributes), array('class' => 'box'));
}
Example #2
0
                ), ''
);
print formHint('Note: leave empty to generate a random password automatically');
print formFieldsetClose();
// -------------------------------------------------------------------------------
print formFieldsetOpen('', array(
  'id' => '-x-field-do_not_email_password'
));

print formCheckbox('do_not_email_password', '1', false);
print formLabel(__('Do not email the password'));
print formHint('Note: by default the password will be emailed, but you can prevent this by unchecking this option');
print formFieldsetClose();
// -------------------------------------------------------------------------------
print formFieldsetOpen('', array(
  'id' => '-x-field-is_enabled'
));

print formCheckbox('is_enabled', '1', true);
print formLabel(__('Activate this user?'));
print formFieldsetClose();
// -------------------------------------------------------------------------------
// Print submit
print formSubmit(array(
                   'class' => '-b-button',
                   'name'  => 'submit',
                   'value' => __('Create user')
                 ));
// Close form
print formClose();
?>
Example #3
0
 /**
  * Adiciona uma label ao formulário
  * @param type $caption
  * @param type $html
  * @param type $colunas
  * @param array $Atributos
  */
 public function label($caption, $html, $colunas = 12, array $Atributos = null)
 {
     $this->addCollun(formLabel($caption, $html, $Atributos));
 }
Example #4
0
            // Form element
            $optionValue = getOption('enclosure', $defaultValue);
            print formElement(formLabel('enclosure', 'CSV enclosure'), formSelect('enclosure', $optionValue, array('"' => 'Double quote (")', "'" => "Single quote (')")));
            // Apply delimiter
            $reader->setOption('enclosure', $optionValue);
            break;
        case 'loadSheet':
            // Available sheets
            $tSheets = $reader->getSheetNames($excelFile);
            $sheets = array();
            foreach ($tSheets as $sheet) {
                $sheets[$sheet] = $sheet;
            }
            // Form element
            $optionValue = getOption('loadSheet', $tSheets[0]);
            print formElement(formLabel('loadSheet', 'Excel sheet'), formSelect('loadSheet', $optionValue, $sheets));
            // Apply sheet
            $loadSheet = $optionValue;
            $reader->setOption('loadSheet', $optionValue);
            break;
    }
}
function getOption($name, $default = null)
{
    global $sessionOptions;
    return array_key_exists($name, $sessionOptions) ? $sessionOptions[$name] : $default;
}
print formElement('', formSubmit('filter', 'Save options'));
print formEnd();
########################################################################################################################
## Print Excel sheet ###################################################################################################
Example #5
0
function eavFormCheckbox(Database_Mapper_Result $attributes)
{
    $output = formFieldsetOpen('', array('id' => '-x-field-' . $attributes->attribute_key));
    $checked = false;
    if (isset($attributes->value) and $attributes->value == true) {
        $checked = true;
    }
    $output .= formCheckbox($attributes->attribute_key, '1', $checked);
    $is_required = (bool) (isset($attributes->is_required) and (bool) $attributes->is_required == true);
    $output .= formLabel(__($attributes->description) . ($is_required ? '<sup>*</sup>' : ''));
    $output .= formFieldsetClose();
    return $output;
}