o::hr(0, 12); theme::start_form_section('User Name', true, 3); o::text('username', $record->username); theme::end_form_section(); theme::start_form_section('Email', true, 3); o::text('email', $record->email); theme::end_form_section(); theme::start_form_section('Password', $record->id == -1, 3); o::password('password', ['value' => $record->password]); theme::end_form_section($password_format_copy); theme::start_form_section('Confirm Password', $record->id == -1, 3); o::password('confirm_password', ['value' => $record->confirm_password]); theme::end_form_section(); if ($record->id != 1) { theme::start_form_section('Role', 4); theme::dropdown3('role_id', $record->role_id, o::smart_model_list('o_role_model', 'id', 'name')); theme::end_form_section(); theme::start_form_section('Active'); theme::checkbox('is_active', 1, $record->is_active); theme::end_form_section(); } else { o::hidden('role_id', $record->role_id); o::hidden('is_active', $record->is_active); } if (strtotime($record->last_login) > 1) { theme::start_form_section('Last login'); theme::static_text(date('F j, Y, g:i a', strtotime($record->last_login))); o::hidden('last_login', $record->last_login); theme::end_form_section(); } o::view_event($controller_path, 'form.footer');
<?php theme::form_start($controller_path . '/' . $controller_action, $record->id); theme::header_start(ucfirst($controller_action) . ' ' . $controller_title); theme::header_end(); o::hr(0, 12); theme::start_form_section('Group', true, 3); $sorted = o::smart_model_list('o_access_model', 'group', 'group'); asort($sorted); plugin_combobox::show('group', $record->group, $sorted); theme::end_form_section(); theme::start_form_section('Access', true, 3); o::text('name', $record->name); theme::end_form_section(); theme::start_form_section('Description', 6); o::text('description', $record->description); theme::end_form_section(); o::view_event($controller_path, 'form.footer'); o::hr(0, 12); theme::footer_start(); theme::footer_cancel_button($controller_path); theme::footer_submit_button(); theme::footer_required(); theme::footer_end(); theme::form_end();
/* radios */ $options = json_decode($record->options); theme::radio('value', $record->value, $options); break; case 3: /* input */ o::text('value', $record->value); break; default: $height = $record->options > 1 ? 'height:' . filter_var($record->options, FILTER_SANITIZE_NUMBER_INT) . 'px' : ''; o::textarea('value', $record->value, ['class' => ' js-validate-json', 'style' => $height]); } theme::end_form_section($record->help); theme::start_form_section('Group', true, 5); if ($record->managed == 0 || $controller_action == 'new' || $advanced == true && has_access('Orange::Advanced Settings')) { $sorted = o::smart_model_list('o_setting_model', 'group', 'group'); asort($sorted); plugin_combobox::show('group', $record->group, $sorted); } else { theme::static_text($record->group); o::hidden('group', $record->group); } theme::end_form_section(); if ($advanced == true && has_access('Orange::Advanced Settings')) { theme::start_form_section('Enabled', true); theme::checker('enabled', (int) $record->enabled); theme::end_form_section('Settings which are present are usually considered "enabled" but, this is internally supported for debugging etc...'); theme::start_form_section('Help'); o::text('help', $record->help); theme::end_form_section('Help to display under the Value input element'); theme::start_form_section('Internal');