Example #1
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 #2
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;
}