Beispiel #1
0
function print_form_widget($data)
{
    print_form_box($data);
}
Beispiel #2
0
            }
        } else {
            print_warning("Please enter a username!");
        }
    }
    $form = array('type' => 'horizontal', 'id' => 'add_user');
    // top row div
    $form['fieldset']['user'] = array('div' => 'top', 'title' => 'User Properties', 'icon' => 'oicon-user--pencil', 'class' => 'col-md-6');
    $form['fieldset']['info'] = array('div' => 'top', 'title' => 'Optional Information', 'icon' => 'oicon-information', 'class' => 'col-md-6 col-md-pull-0');
    // bottom row div
    $form['fieldset']['submit'] = array('div' => 'bottom', 'style' => 'padding: 0px;', 'class' => 'col-md-12');
    //$form['row'][0]['editing']   = array(
    //                                'type'        => 'hidden',
    //                                'value'       => 'yes');
    // left fieldset
    $form['row'][1]['new_username'] = array('type' => 'text', 'fieldset' => 'user', 'name' => 'Username', 'width' => '250px', 'value' => escape_html($vars['new_username']));
    $form['row'][2]['new_password'] = array('type' => 'password', 'fieldset' => 'user', 'name' => 'Password', 'width' => '250px', 'show_password' => TRUE, 'value' => escape_html($vars['new_password']));
    // FIXME. For passwords we should use filter instead escape!
    $form['row'][3]['can_modify_passwd'] = array('type' => 'checkbox', 'fieldset' => 'user', 'name' => '', 'placeholder' => 'Allow the user to change his password', 'value' => 1);
    $form['row'][4]['new_realname'] = array('type' => 'text', 'fieldset' => 'user', 'name' => 'Real Name', 'width' => '250px', 'value' => escape_html($vars['new_realname']));
    $form['row'][5]['new_level'] = array('type' => 'select', 'fieldset' => 'user', 'name' => 'User Level', 'width' => '250px', 'subtext' => TRUE, 'values' => $GLOBALS['config']['user_level'], 'value' => isset($vars['new_level']) ? escape_html($vars['new_level']) : 1);
    // right fieldset
    $form['row'][15]['new_email'] = array('type' => 'text', 'fieldset' => 'info', 'name' => 'E-mail', 'width' => '250px', 'value' => escape_html($vars['new_email']));
    $form['row'][16]['new_description'] = array('type' => 'text', 'fieldset' => 'info', 'name' => 'Description', 'width' => '250px', 'value' => escape_html($vars['new_description']));
    $form['row'][30]['submit'] = array('type' => 'submit', 'fieldset' => 'submit', 'name' => 'Add User', 'icon' => 'icon-ok icon-white', 'class' => 'btn-primary', 'value' => 'add_user');
    print_form_box($form);
    unset($form);
} else {
    print_error('Auth module does not allow user management!');
}
// EOF