当前位置: 首页>>代码示例>>PHP>>正文


PHP HtmlForm::addSelectBoxFromSql方法代码示例

本文整理汇总了PHP中HtmlForm::addSelectBoxFromSql方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlForm::addSelectBoxFromSql方法的具体用法?PHP HtmlForm::addSelectBoxFromSql怎么用?PHP HtmlForm::addSelectBoxFromSql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HtmlForm的用法示例。


在下文中一共展示了HtmlForm::addSelectBoxFromSql方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$form->openGroupBox('gb_dates_meetings', $gL10n->get('DAT_DATES') . ' / ' . $gL10n->get('ROL_MEETINGS') . '  (' . $gL10n->get('SYS_OPTIONAL') . ')');
$form->addInput('rol_start_date', $gL10n->get('ROL_VALID_FROM'), $role->getValue('rol_start_date'), array('type' => 'date'));
$form->addInput('rol_end_date', $gL10n->get('ROL_VALID_TO'), $role->getValue('rol_end_date'), array('type' => 'date'));
$form->addInput('rol_start_time', $gL10n->get('SYS_TIME_FROM'), $role->getValue('rol_start_time'), array('type' => 'time'));
$form->addInput('rol_end_time', $gL10n->get('SYS_TIME_TO'), $role->getValue('rol_end_time'), array('type' => 'time'));
$form->addSelectBox('rol_weekday', $gL10n->get('ROL_WEEKDAY'), DateTimeExtended::getWeekdays(), array('defaultValue' => $role->getValue('rol_weekday')));
$form->addInput('rol_location', $gL10n->get('SYS_LOCATION'), $role->getValue('rol_location'), array('maxLength' => 100));
$form->closeGroupBox();
$form->openGroupBox('gb_dependencies', $gL10n->get('ROL_DEPENDENCIES') . '  (' . $gL10n->get('SYS_OPTIONAL') . ')');
$rolename_var = $gL10n->get('ROL_NEW_ROLE');
if ($role->getValue('rol_name') !== '') {
    $rolename_var = $gL10n->get('SYS_ROLE') . ' <b>' . $role->getValue('rol_name') . '</b>';
}
$form->addHtml('<p>' . $gL10n->get('ROL_ROLE_DEPENDENCIES', $rolename_var) . '</p>');
//  list all roles that the user is allowed to see
$sqlAllRoles = '
    SELECT rol_id, rol_name, cat_name
      FROM ' . TBL_ROLES . ', ' . TBL_CATEGORIES . '
     WHERE rol_valid   = 1
       AND rol_visible = 1
       AND rol_cat_id  = cat_id
       AND (  cat_org_id  = ' . $gCurrentOrganization->getValue('org_id') . '
           OR cat_org_id IS NULL )
     ORDER BY cat_sequence, rol_name ';
$form->addSelectBoxFromSql('dependent_roles', $gL10n->get('ROL_DEPENDENT'), $gDb, $sqlAllRoles, array('defaultValue' => $childRoles, 'multiselect' => true));
$form->closeGroupBox();
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png'));
$form->addHtml(admFuncShowCreateChangeInfoById($role->getValue('rol_usr_id_create'), $role->getValue('rol_timestamp_create'), $role->getValue('rol_usr_id_change'), $role->getValue('rol_timestamp_change')));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
开发者ID:sistlind,项目名称:admidio,代码行数:31,代码来源:roles_new.php

示例2: HtmlForm

 $page->addJavascript($javascriptCode, true);
 // get module menu
 $membersAssignmentMenu = $page->getMenu();
 $membersAssignmentMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
 if ($gCurrentUser->editUsers()) {
     $membersAssignmentMenu->addItem('menu_item_create_user', $g_root_path . '/adm_program/modules/members/members_new.php', $gL10n->get('MEM_CREATE_USER'), 'add.png');
 }
 $navbarForm = new HtmlForm('navbar_show_all_users_form', '', $page, array('type' => 'navbar', 'setFocus' => false));
 $sql = 'SELECT rol_id, rol_name, cat_name FROM ' . TBL_ROLES . ', ' . TBL_CATEGORIES . '
          WHERE rol_valid   = 1
            AND rol_visible = 1
            AND rol_cat_id  = cat_id
            AND (  cat_org_id  = ' . $gCurrentOrganization->getValue('org_id') . '
                OR cat_org_id IS NULL )
          ORDER BY cat_sequence, rol_name';
 $navbarForm->addSelectBoxFromSql('filter_rol_id', $gL10n->get('SYS_ROLE'), $gDb, $sql, array('defaultValue' => $getFilterRoleId, 'firstEntry' => $gL10n->get('SYS_ALL')));
 $navbarForm->addCheckbox('mem_show_all', $gL10n->get('MEM_SHOW_ALL_USERS'), 0, array('helpTextIdLabel' => 'MEM_SHOW_USERS_DESC'));
 $membersAssignmentMenu->addForm($navbarForm->show(false));
 // create table object
 $table = new HtmlTable('tbl_assign_role_membership', $page, true, true, 'table table-condensed');
 $table->setMessageIfNoRowsFound('SYS_NO_ENTRIES_FOUND');
 // create column header to assign role leaders
 $htmlLeaderColumn = $gL10n->get('SYS_LEADER');
 // show icon that leaders have no additional rights
 if ($role->getValue('rol_leader_rights') == ROLE_LEADER_NO_RIGHTS) {
     $htmlLeaderColumn .= '<img class="admidio-icon-info" src="' . THEME_PATH . '/icons/info.png"
         alt="' . $gL10n->get('ROL_LEADER_NO_ADDITIONAL_RIGHTS') . '" title="' . $gL10n->get('ROL_LEADER_NO_ADDITIONAL_RIGHTS') . '" />';
 }
 // show icon with edit user right if leader has this right
 if ($role->getValue('rol_leader_rights') == ROLE_LEADER_MEMBERS_EDIT || $role->getValue('rol_leader_rights') == ROLE_LEADER_MEMBERS_ASSIGN_EDIT) {
     $htmlLeaderColumn .= '<img class="admidio-icon-info" src="' . THEME_PATH . '/icons/profile_edit.png"
开发者ID:sistlind,项目名称:admidio,代码行数:31,代码来源:members_assignment.php

示例3: HtmlForm

                    </h4>
                </div>
                <div id="collapse_organization" class="panel-collapse collapse">
                    <div class="panel-body">');
// show form
$form = new HtmlForm('organization_preferences_form', $g_root_path . '/adm_program/modules/preferences/preferences_function.php?form=organization', $page, array('class' => 'form-preferences'));
$form->addStaticControl('org_shortname', $gL10n->get('SYS_NAME_ABBREVIATION'), $form_values['org_shortname'], array('class' => 'form-control-small'));
$form->addInput('org_longname', $gL10n->get('SYS_NAME'), $form_values['org_longname'], array('maxLength' => 60, 'property' => FIELD_REQUIRED));
$form->addInput('org_homepage', $gL10n->get('SYS_WEBSITE'), $form_values['org_homepage'], array('maxLength' => 60));
//Falls andere Orgas untergeordnet sind, darf diese Orga keiner anderen Orga untergeordnet werden
if ($gCurrentOrganization->hasChildOrganizations() == false) {
    $sql = 'SELECT org_id, org_longname FROM ' . TBL_ORGANIZATIONS . '
                                     WHERE org_id <> ' . $gCurrentOrganization->getValue('org_id') . '
                                       AND org_org_id_parent is NULL
                                     ORDER BY org_longname ASC, org_shortname ASC';
    $form->addSelectBoxFromSql('org_org_id_parent', $gL10n->get('ORG_PARENT_ORGANIZATION'), $gDb, $sql, array('defaultValue' => $form_values['org_org_id_parent'], 'showContextDependentFirstEntry' => false, 'helpTextIdInline' => 'ORG_PARENT_ORGANIZATION_DESC'));
}
if ($gCurrentOrganization->countAllRecords() > 1) {
    $form->addCheckbox('system_organization_select', $gL10n->get('ORG_SHOW_ORGANIZATION_SELECT'), $form_values['system_organization_select'], array('helpTextIdInline' => 'ORG_SHOW_ORGANIZATION_SELECT_DESC'));
}
$html = '<a id="add_another_organization" class="btn" href="' . $g_root_path . '/adm_program/modules/preferences/preferences_function.php?mode=2"><img
                                    src="' . THEME_PATH . '/icons/add.png" alt="' . $gL10n->get('INS_ADD_ANOTHER_ORGANIZATION') . '" />' . $gL10n->get('INS_ADD_ANOTHER_ORGANIZATION') . '</a>';
$htmlDesc = $gL10n->get('ORG_ADD_ORGANIZATION_DESC') . '<div class="alert alert-warning alert-small" role="alert"><span class="glyphicon glyphicon-warning-sign"></span>' . $gL10n->get('ORG_NOT_SAVED_SETTINGS_LOST') . '</div>';
$form->addCustomContent($gL10n->get('ORG_NEW_ORGANIZATION'), $html, array('helpTextIdInline' => $htmlDesc));
$form->addSubmitButton('btn_save_organization', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png', 'class' => ' col-sm-offset-3'));
$page->addHtml($form->show(false));
$page->addHtml('</div>
                </div>
            </div>
            <div class="panel panel-default" id="panel_regional_settings">
                <div class="panel-heading">
开发者ID:bash-t,项目名称:admidio,代码行数:31,代码来源:preferences.php

示例4: array

} else {
    $form->addButton('btn_save', $gL10n->get('LST_SAVE_CONFIGURATION'), array('icon' => THEME_PATH . '/icons/disk.png'));
}
// your lists could be deleted, webmasters are allowed to delete system configurations
if ($gCurrentUser->isWebmaster() && $list->getValue('lst_global') == 1 || $gCurrentUser->getValue('usr_id') == $list->getValue('lst_usr_id') && strlen($list->getValue('lst_name')) > 0) {
    $form->addButton('btn_delete', $gL10n->get('LST_DELETE_CONFIGURATION'), array('icon' => THEME_PATH . '/icons/delete.png'));
}
// current configuration can be duplicated and saved with another name
if (strlen($list->getValue('lst_name')) > 0) {
    $form->addButton('btn_copy', $gL10n->get('SYS_COPY_VAR', $gL10n->get('LST_CONFIGURATION')), array('icon' => THEME_PATH . '/icons/application_double.png'));
}
$form->closeButtonGroup();
$form->closeGroupBox();
$form->openGroupBox('gb_select_members', $gL10n->get('LST_SELECT_MEMBERS'));
// show all roles where the user has the right to see them
$sql = 'SELECT rol_id, rol_name, cat_name
          FROM ' . TBL_ROLES . ', ' . TBL_CATEGORIES . '
         WHERE rol_valid   = ' . $getActiveRole . '
           AND rol_visible = 1
           AND rol_cat_id  = cat_id
           AND (  cat_org_id  = ' . $gCurrentOrganization->getValue('org_id') . '
               OR cat_org_id IS NULL )
         ORDER BY cat_sequence, rol_name';
$form->addSelectBoxFromSql('sel_roles_ids', $gL10n->get('SYS_ROLE'), $gDb, $sql, array('property' => FIELD_REQUIRED, 'defaultValue' => $formValues['sel_roles_ids'], 'multiselect' => true));
$showMembersSelection = array($gL10n->get('LST_ACTIVE_MEMBERS'), $gL10n->get('LST_FORMER_MEMBERS'), $gL10n->get('LST_ACTIVE_FORMER_MEMBERS'));
$form->addSelectBox('sel_show_members', $gL10n->get('LST_MEMBER_STATUS'), $showMembersSelection, array('property' => FIELD_REQUIRED, 'defaultValue' => $formValues['sel_show_members'], 'showContextDependentFirstEntry' => false));
$form->closeGroupBox();
$form->addButton('btn_show_list', $gL10n->get('LST_SHOW_LIST'), array('icon' => THEME_PATH . '/icons/list.png', 'class' => 'btn-primary'));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
开发者ID:sistlind,项目名称:admidio,代码行数:31,代码来源:mylist.php

示例5: array

    $form->addSelectBox('dat_country', $gL10n->get('SYS_COUNTRY'), $gL10n->getCountries(), array('defaultValue' => $date->getValue('dat_country', 'database')));
} else {
    $form->addInput('dat_location', $gL10n->get('DAT_LOCATION'), $date->getValue('dat_location'), array('maxLength' => 50));
}
// if room selection is activated then show a selectbox with all rooms
if ($gPreferences['dates_show_rooms'] == true) {
    if ($gDbType === 'mysql') {
        $sql = 'SELECT room_id, CONCAT(room_name, \' (\', room_capacity, \'+\', IFNULL(room_overhang, \'0\'), \')\')
                      FROM ' . TBL_ROOMS . '
                  ORDER BY room_name';
    } else {
        $sql = 'SELECT room_id, room_name || \' (\' || room_capacity || \'+\' || COALESCE(room_overhang, \'0\') || \')\'
                      FROM ' . TBL_ROOMS . '
                  ORDER BY room_name';
    }
    $form->addSelectBoxFromSql('dat_room_id', $gL10n->get('SYS_ROOM'), $gDb, $sql, array('defaultValue' => $date->getValue('dat_room_id')));
}
$form->closeGroupBox();
// @ptabaden: changed "&" to "und" and added h3
$form->openGroupBox('gb_period_calendar', '<h3>' . $gL10n->get('SYS_PERIOD') . ' und ' . $gL10n->get('DAT_CALENDAR') . '</h3>');
$form->addCheckbox('dat_all_day', $gL10n->get('DAT_ALL_DAY'), $date->getValue('dat_all_day'));
$form->addInput('date_from', $gL10n->get('SYS_START'), $date->getValue('dat_begin', $gPreferences['system_date'] . ' ' . $gPreferences['system_time']), array('type' => 'datetime', 'property' => FIELD_REQUIRED));
$form->addInput('date_to', $gL10n->get('SYS_END'), $date->getValue('dat_end', $gPreferences['system_date'] . ' ' . $gPreferences['system_time']), array('type' => 'datetime', 'property' => FIELD_REQUIRED));
$form->addSelectBoxForCategories('dat_cat_id', $gL10n->get('DAT_CALENDAR'), $gDb, 'DAT', 'EDIT_CATEGORIES', array('property' => FIELD_REQUIRED, 'defaultValue' => $date->getValue('dat_cat_id')));
$form->closeGroupBox();
// @ptabaden: changed "&" to "und" and added h3
$form->openGroupBox('gb_visibility_registration', '<h3>' . $gL10n->get('DAT_VISIBILITY') . ' und ' . $gL10n->get('SYS_REGISTRATION') . '</h3>');
// add a multiselectbox to the form where the user can choose all roles that should see this event
// first read all relevant roles from database and create an array with them
$sql = 'SELECT *
              FROM ' . TBL_ROLES . '
开发者ID:sxwid,项目名称:admidio3.1_scoutversion,代码行数:31,代码来源:dates_new.php

示例6: HtmlPage

// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$loginMenu = $page->getMenu();
$loginMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// show form
$form = new HtmlForm('login_form', $g_root_path . '/adm_program/system/login_check.php', $page, array('showRequiredFields' => false));
$form->addInput('usr_login_name', $gL10n->get('SYS_USERNAME'), null, array('maxLength' => 35, 'property' => FIELD_REQUIRED, 'class' => 'form-control-small'));
// TODO Future: 'minLength' => 8
$form->addInput('usr_password', $gL10n->get('SYS_PASSWORD'), null, array('type' => 'password', 'property' => FIELD_REQUIRED, 'class' => 'form-control-small'));
// show selectbox with all organizations of database
if ($gPreferences['system_organization_select'] == 1) {
    $sql = 'SELECT org_id, org_longname
              FROM ' . TBL_ORGANIZATIONS . '
          ORDER BY org_longname ASC, org_shortname ASC';
    $form->addSelectBoxFromSql('org_id', $gL10n->get('SYS_ORGANIZATION'), $gDb, $sql, array('property' => FIELD_REQUIRED, 'defaultValue' => $gCurrentOrganization->getValue('org_id')));
}
if ($gPreferences['enable_auto_login'] == 1) {
    $form->addCheckbox('auto_login', $gL10n->get('SYS_REMEMBER_ME'), '0');
}
$form->addSubmitButton('btn_login', $gL10n->get('SYS_LOGIN'), array('icon' => THEME_PATH . '/icons/key.png'));
$page->addHtml($form->show(false));
if ($gPreferences['registration_mode'] > 0) {
    $page->addHtml('
        <div id="login_registration_link">
            <small><a href="' . $g_root_path . '/adm_program/modules/registration/registration.php">' . $gL10n->get('SYS_WANT_REGISTER') . '</a></small>
        </div>');
}
// Link bei Loginproblemen
if ($gPreferences['enable_password_recovery'] == 1 && $gPreferences['enable_system_mails'] == 1) {
    // neues Passwort zusenden
开发者ID:martinbrylski,项目名称:admidio,代码行数:31,代码来源:login.php

示例7: elseif

 // code for different field types
 if ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_type') === 'CHECKBOX') {
     $form->addCheckbox('inf-' . $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_id'), $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name'), $inventory->getValue($field->getValue('inf_name_intern')), $fieldProperty, $helpId, null, $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_icon', 'database'));
 } elseif ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_type') === 'DROPDOWN' || $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name_intern') === 'ROOM_ID') {
     // set array with values and set default value
     if ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name_intern') === 'ROOM_ID') {
         if ($gDbType === 'mysql') {
             $sql = 'SELECT room_id, CONCAT(room_name, \' (\', room_capacity, \'+\', IFNULL(room_overhang, \'0\'), \')\') FROM ' . TBL_ROOMS . ' ORDER BY room_name';
         } else {
             $sql = 'SELECT room_id, room_name || \' (\' || room_capacity || \'+\' || COALESCE(room_overhang, \'0\') || \')\' FROM ' . TBL_ROOMS . ' ORDER BY room_name';
         }
         $defaultValue = '';
         if ($getNewItem == 0) {
             $defaultValue = $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_id');
         }
         $form->addSelectBoxFromSql('inf-' . $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_id'), $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name'), $gDb, $sql, array('property' => $fieldProperty, 'showContextDependentFirstEntry' => true, 'defaultValue' => $defaultValue));
     } else {
         $arrListValues = $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_value_list');
         $defaultValue = $inventory->getValue($field->getValue('inf_name_intern'), 'database');
         $form->addSelectBox('inf-' . $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_id'), $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name'), $arrListValues, $fieldProperty, $defaultValue, true, $helpId, null, $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_icon', 'database'));
     }
 } elseif ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_type') === 'RADIO_BUTTON') {
     $arrListValues = $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_value_list');
     $showDummyRadioButton = false;
     if ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_mandatory') == 0) {
         $showDummyRadioButton = true;
     }
     $form->addRadioButton('inf-' . $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_id'), $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name'), $arrListValues, $fieldProperty, $inventory->getValue($field->getValue('inf_name_intern'), 'database'), $showDummyRadioButton, $helpId, $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_icon', 'database'));
 } elseif ($gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_type') === 'TEXT_BIG') {
     $form->addMultilineTextInput('inf-' . $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_id'), $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_name'), $inventory->getValue($field->getValue('inf_name_intern')), 3, 4000, $fieldProperty, $helpId, $gInventoryFields->getProperty($field->getValue('inf_name_intern'), 'inf_icon', 'database'));
 } else {
开发者ID:sistlind,项目名称:admidio,代码行数:31,代码来源:item_new.php

示例8: elseif

             $fieldProperty = FIELD_DISABLED;
             $fieldHelpId = '';
         } elseif ($getNewUser > 0) {
             $fieldProperty = FIELD_REQUIRED;
         }
         $form->addInput('usr_login_name', $gL10n->get('SYS_USERNAME'), $user->getValue('usr_login_name'), array('maxLength' => 35, 'property' => $fieldProperty, 'helpTextIdLabel' => $fieldHelpId, 'class' => 'form-control-small'));
         if ($getNewUser === 2) {
             // at registration add password and password confirm to form
             $form->addInput('usr_password', $gL10n->get('SYS_PASSWORD'), null, array('type' => 'password', 'property' => FIELD_REQUIRED, 'minLength' => 8, 'helpTextIdLabel' => 'PRO_PASSWORD_DESCRIPTION', 'class' => 'form-control-small'));
             $form->addInput('password_confirm', $gL10n->get('SYS_CONFIRM_PASSWORD'), null, array('type' => 'password', 'property' => FIELD_REQUIRED, 'minLength' => 8, 'class' => 'form-control-small'));
             // show selectbox with all organizations of database
             if ($gPreferences['system_organization_select'] == 1) {
                 $sql = 'SELECT org_id, org_longname
                           FROM ' . TBL_ORGANIZATIONS . '
                       ORDER BY org_longname ASC, org_shortname ASC';
                 $form->addSelectBoxFromSql('reg_org_id', $gL10n->get('SYS_ORGANIZATION'), $gDb, $sql, array('property' => FIELD_REQUIRED, 'defaultValue' => $registrationOrgId));
             }
         } else {
             // only show link if user is member of this organization.
             // Password of own user could be changed.
             // Webmasters are allowed to change password if no login was configured or no email is set to send a generated password.
             if (isMember($user->getValue('usr_id')) && ($gCurrentUser->getValue('usr_id') == $user->getValue('usr_id') || $gCurrentUser->isWebmaster() && (strlen($user->getValue('usr_login_name')) === 0 || strlen($user->getValue('EMAIL')) === 0))) {
                 $form->addCustomContent($gL10n->get('SYS_PASSWORD'), '
                     <a id="password_link" class="btn" data-toggle="modal" data-target="#admidio_modal"
                         href="password.php?usr_id=' . $getUserId . '"><img src="' . THEME_PATH . '/icons/key.png"
                         alt="' . $gL10n->get('SYS_CHANGE_PASSWORD') . '" title="' . $gL10n->get('SYS_CHANGE_PASSWORD') . '" />' . $gL10n->get('SYS_CHANGE_PASSWORD') . '</a>');
             }
         }
         $form->addLine();
     }
 }
开发者ID:martinbrylski,项目名称:admidio,代码行数:31,代码来源:profile_new.php

示例9: HtmlForm

                </div>
                <div id="collapse_lists" class="panel-collapse collapse">
                    <div class="panel-body">');
// show form
$form = new HtmlForm('lists_preferences_form', $g_root_path . '/adm_program/modules/preferences/preferences_function.php?form=lists', $page, array('class' => 'form-preferences'));
$form->addInput('lists_roles_per_page', $gL10n->get('LST_NUMBER_OF_ROLES_PER_PAGE'), $form_values['lists_roles_per_page'], array('type' => 'number', 'minNumber' => 0, 'maxNumber' => 9999, 'helpTextIdInline' => 'ORG_NUMBER_OF_ENTRIES_PER_PAGE_DESC'));
$selectBoxEntries = array('10' => '10', '25' => '25', '50' => '50', '100' => '100');
$form->addSelectBox('lists_members_per_page', $gL10n->get('LST_MEMBERS_PER_PAGE'), $selectBoxEntries, array('defaultValue' => $form_values['lists_members_per_page'], 'showContextDependentFirstEntry' => false, 'helpTextIdInline' => 'LST_MEMBERS_PER_PAGE_DESC'));
$form->addCheckbox('lists_hide_overview_details', $gL10n->get('LST_HIDE_DETAILS'), $form_values['lists_hide_overview_details'], array('helpTextIdInline' => 'LST_HIDE_DETAILS_DESC'));
// read all global lists
$sql = 'SELECT lst_id, lst_name
                                  FROM ' . TBL_LISTS . '
                                 WHERE lst_org_id = ' . $gCurrentOrganization->getValue('org_id') . '
                                   AND lst_global = 1
                              ORDER BY lst_name ASC, lst_timestamp DESC';
$form->addSelectBoxFromSql('lists_default_configuation', $gL10n->get('LST_DEFAULT_CONFIGURATION'), $gDb, $sql, array('defaultValue' => $form_values['lists_default_configuation'], 'showContextDependentFirstEntry' => false, 'helpTextIdInline' => 'LST_DEFAULT_CONFIGURATION_DESC'));
$html = '<a class="btn" href="' . $g_root_path . '/adm_program/modules/categories/categories.php?type=ROL"><img
                                    src="' . THEME_PATH . '/icons/application_view_tile.png" alt="' . $gL10n->get('SYS_SWITCH_TO_CATEGORIES_ADMINISTRATION') . '" />' . $gL10n->get('SYS_SWITCH_TO_CATEGORIES_ADMINISTRATION') . '</a>';
$htmlDesc = $gL10n->get('DAT_MAINTAIN_CATEGORIES_DESC') . '<div class="alert alert-warning alert-small" role="alert"><span class="glyphicon glyphicon-warning-sign"></span>' . $gL10n->get('ORG_NOT_SAVED_SETTINGS_LOST') . '</div>';
$form->addCustomContent($gL10n->get('SYS_MAINTAIN_CATEGORIES'), $html, array('helpTextIdInline' => $htmlDesc));
$form->addSubmitButton('btn_save_lists', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png', 'class' => ' col-sm-offset-3'));
$page->addHtml($form->show(false));
$page->addHtml('</div>
                </div>
            </div>
            <div class="panel panel-default" id="panel_messages">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion_modules" href="#collapse_messages">
                            <img class="admidio-panel-heading-icon" src="' . THEME_PATH . '/icons/messages.png" alt="' . $gL10n->get('SYS_MESSAGES') . '" />' . $gL10n->get('SYS_MESSAGES') . '
                        </a>
开发者ID:martinbrylski,项目名称:admidio,代码行数:31,代码来源:preferences.php

示例10: array

     $pdoStatement = $gDb->query($sql);
     $possible_emails = $pdoStatement->fetchColumn();
     $form->addInput('name', $gL10n->get('MAI_YOUR_NAME'), $gCurrentUser->getValue('FIRST_NAME') . ' ' . $gCurrentUser->getValue('LAST_NAME'), array('maxLength' => 50, 'property' => FIELD_DISABLED));
     if ($possible_emails > 1) {
         $sql = 'SELECT email.usd_value as ID, email.usd_value as email
                   FROM ' . TBL_USERS . '
             INNER JOIN ' . TBL_USER_DATA . ' as email
                     ON email.usd_usr_id = usr_id
                    AND LENGTH(email.usd_value) > 0
             INNER JOIN ' . TBL_USER_FIELDS . ' as field
                     ON field.usf_id = email.usd_usf_id
                    AND field.usf_type = \'EMAIL\'
                  WHERE usr_id = ' . $gCurrentUser->getValue('usr_id') . '
                    AND usr_valid   = 1
               GROUP BY email.usd_value, email.usd_value';
         $form->addSelectBoxFromSql('mailfromid', $gL10n->get('MAI_YOUR_EMAIL'), $gDb, $sql, array('maxLength' => 50, 'defaultValue' => $gCurrentUser->getValue('EMAIL'), 'showContextDependentFirstEntry' => false));
     } else {
         $form->addInput('mailfrom', $gL10n->get('MAI_YOUR_EMAIL'), $gCurrentUser->getValue('EMAIL'), array('maxLength' => 50, 'property' => FIELD_DISABLED));
     }
 } else {
     $form->addInput('namefrom', $gL10n->get('MAI_YOUR_NAME'), $form_values['namefrom'], array('maxLength' => 50, 'property' => FIELD_REQUIRED));
     $form->addInput('mailfrom', $gL10n->get('MAI_YOUR_EMAIL'), $form_values['mailfrom'], array('type' => 'email', 'maxLength' => 50, 'property' => FIELD_REQUIRED));
 }
 // show option to send a copy to your email address only for registered users because of spam abuse
 if ($gValidLogin) {
     $form->addCheckbox('carbon_copy', $gL10n->get('MAI_SEND_COPY'), $form_values['carbon_copy']);
 }
 // if preference is set then show a checkbox where the user can request a delivery confirmation for the email
 if ($gCurrentUser->getValue('usr_id') > 0 && $gPreferences['mail_delivery_confirmation'] == 2 || $gPreferences['mail_delivery_confirmation'] == 1) {
     $form->addCheckbox('delivery_confirmation', $gL10n->get('MAI_DELIVERY_CONFIRMATION'), $form_values['delivery_confirmation']);
 }
开发者ID:martinbrylski,项目名称:admidio,代码行数:31,代码来源:messages_write.php

示例11: HtmlForm

    echo '</div>';
} else {
    // create and show the login form
    if ($plg_show_icons == 1) {
        $iconCode = THEME_PATH . '/icons/key.png';
    }
    $form = new HtmlForm('plugin-login-form', $g_root_path . '/adm_program/system/login_check.php', null, array('type' => 'vertical', 'setFocus' => false, 'showRequiredFields' => false));
    $form->addInput('plg_usr_login_name', $gL10n->get('SYS_USERNAME'), null, array('property' => FIELD_REQUIRED, 'maxLength' => 35));
    // TODO Future: 'minLength' => 8
    $form->addInput('plg_usr_password', $gL10n->get('SYS_PASSWORD'), null, array('type' => 'password', 'property' => FIELD_REQUIRED));
    // show selectbox with all organizations of database
    if ($gPreferences['system_organization_select'] == 1) {
        $sql = 'SELECT org_id, org_longname
                  FROM ' . TBL_ORGANIZATIONS . '
              ORDER BY org_longname ASC, org_shortname ASC';
        $form->addSelectBoxFromSql('plg_org_id', $gL10n->get('SYS_ORGANIZATION'), $gDb, $sql, array('defaultValue' => $gCurrentOrganization->getValue('org_id'), 'showContextDependentFirstEntry' => false));
    }
    if ($gPreferences['enable_auto_login'] == 1) {
        $form->addCheckbox('plg_auto_login', $gL10n->get('SYS_REMEMBER_ME'), '0');
    }
    $form->addSubmitButton('next_page', $gL10n->get('SYS_LOGIN'), array('icon' => $iconCode));
    $form->show();
    echo '<div class="btn-group-vertical" role="group">';
    // show links for registration and help
    if ($plg_show_register_link && $gPreferences['registration_mode']) {
        if ($plg_show_icons) {
            echo '
            <a class="btn" href="' . $g_root_path . '/adm_program/modules/registration/registration.php"><img
                src="' . THEME_PATH . '/icons/new_registrations.png" alt="' . $gL10n->get('SYS_REGISTRATION') . '" />' . $gL10n->get('SYS_REGISTRATION') . '</a>';
        } else {
            echo '<a href="' . $g_root_path . '/adm_program/modules/registration/registration.php" ' . $plg_link_target . '>' . $gL10n->get('SYS_REGISTRATION') . '</a>';
开发者ID:martinbrylski,项目名称:admidio,代码行数:31,代码来源:login_form.php


注:本文中的HtmlForm::addSelectBoxFromSql方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。