本文整理汇总了PHP中HtmlForm::addSelectBoxForCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlForm::addSelectBoxForCategories方法的具体用法?PHP HtmlForm::addSelectBoxForCategories怎么用?PHP HtmlForm::addSelectBoxForCategories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlForm
的用法示例。
在下文中一共展示了HtmlForm::addSelectBoxForCategories方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HtmlPage
}
// Html-Kopf ausgeben
if ($getLinkId > 0) {
$headline = $gL10n->get('SYS_EDIT_VAR', $getHeadline);
} else {
$headline = $gL10n->get('SYS_CREATE_VAR', $getHeadline);
}
// add current url to navigation stack
$gNavigation->addUrl(CURRENT_URL, $headline);
// create html page object
$page = new HtmlPage($headline);
// add back link to module menu
$linksCreateMenu = $page->getMenu();
$linksCreateMenu->addItem('menu_item_back', $gNavigation->getPreviousUrl(), $gL10n->get('SYS_BACK'), 'back.png');
// Html des Modules ausgeben
if ($getLinkId > 0) {
$modeEditOrCreate = '3';
} else {
$modeEditOrCreate = '1';
}
// show form
$form = new HtmlForm('weblinks_edit_form', $g_root_path . '/adm_program/modules/links/links_function.php?lnk_id=' . $getLinkId . '&headline=' . $getHeadline . '&mode=' . $modeEditOrCreate, $page);
$form->addInput('lnk_name', $gL10n->get('LNK_LINK_NAME'), $link->getValue('lnk_name'), array('maxLength' => 250, 'property' => FIELD_REQUIRED));
$form->addInput('lnk_url', $gL10n->get('LNK_LINK_ADDRESS'), $link->getValue('lnk_url'), array('maxLength' => 2000, 'property' => FIELD_REQUIRED));
$form->addSelectBoxForCategories('lnk_cat_id', $gL10n->get('SYS_CATEGORY'), $gDb, 'LNK', 'EDIT_CATEGORIES', array('property' => FIELD_REQUIRED, 'defaultValue' => $link->getValue('lnk_cat_id')));
$form->addEditor('lnk_description', $gL10n->get('SYS_DESCRIPTION'), $link->getValue('lnk_description'), array('height' => '150px'));
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png'));
$form->addHtml(admFuncShowCreateChangeInfoById($link->getValue('lnk_usr_id_create'), $link->getValue('lnk_timestamp_create'), $link->getValue('lnk_usr_id_change'), $link->getValue('lnk_timestamp_change')));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
示例2: elseif
// ical Download
if ($gPreferences['enable_dates_ical'] == 1) {
$DatesMenu->addItem('admMenuItemICal', $g_root_path . '/adm_program/modules/dates/ical_dates.php?headline=' . $getHeadline . '&cat_id=' . $getCatId, $gL10n->get('DAT_EXPORT_ICAL'), 'database_out.png', 'right', 'menu_item_extras');
}
if ($gCurrentUser->isWebmaster()) {
// show link to system preferences of weblinks
$DatesMenu->addItem('admMenuItemPreferencesLinks', $g_root_path . '/adm_program/modules/preferences/preferences.php?show_option=events', $gL10n->get('SYS_MODULE_PREFERENCES'), 'options.png', 'right', 'menu_item_extras');
} elseif ($gCurrentUser->editDates()) {
// if no calendar selectbox is shown, then show link to edit calendars
$DatesMenu->addItem('admMenuItemCategories', '/adm_program/modules/categories/categories.php?type=DAT&title=' . $gL10n->get('DAT_CALENDAR'), $gL10n->get('DAT_MANAGE_CALENDARS'), 'application_view_tile.png', 'right', 'menu_item_extras');
}
}
// create filter menu with elements for calendar and start-/enddate
$FilterNavbar = new HtmlNavbar('menu_dates_filter', null, null, 'filter');
$form = new HtmlForm('navbar_filter_form', $g_root_path . '/adm_program/modules/dates/dates.php?headline=' . $getHeadline . '&view=' . $getView, $page, array('type' => 'navbar', 'setFocus' => false));
$form->addSelectBoxForCategories('cat_id', $gL10n->get('DAT_CALENDAR'), $gDb, 'DAT', 'FILTER_CATEGORIES', array('defaultValue' => $dates->getParameter('cat_id')));
$form->addInput('date_from', $gL10n->get('SYS_START'), $dates->getParameter('dateStartFormatAdmidio'), array('type' => 'date', 'maxLength' => 10));
$form->addInput('date_to', $gL10n->get('SYS_END'), $dates->getParameter('dateEndFormatAdmidio'), array('type' => 'date', 'maxLength' => 10));
$form->addInput('view', '', $getView, array('property' => FIELD_HIDDEN));
$form->addSubmitButton('btn_send', $gL10n->get('SYS_OK'));
$FilterNavbar->addForm($form->show(false));
$page->addHtml($FilterNavbar->show(false));
} elseif ($getViewMode === 'print') {
$datatable = false;
$hoverRows = false;
$classTable = 'table table-condensed table-striped';
// create html page object without the custom theme files
$page->hideThemeHtml();
$page->hideMenu();
$page->setPrintMode();
$page->addHtml('<h3>' . $gL10n->get('DAT_PERIOD_FROM_TO', $dates->getParameter('dateStartFormatAdmidio'), $dates->getParameter('dateEndFormatAdmidio')) . '</h3>');
示例3: HtmlForm
// show form
$form = new HtmlForm('profile_fields_edit_form', $g_root_path . '/adm_program/modules/preferences/fields_function.php?usf_id=' . $getUsfId . '&mode=1', $page);
$form->openGroupBox('gb_designation', $gL10n->get('SYS_DESIGNATION'));
if ($userField->getValue('usf_system') == 1) {
$form->addInput('usf_name', $gL10n->get('SYS_NAME'), $userField->getValue('usf_name', 'database'), array('maxLength' => 100, 'property' => FIELD_DISABLED));
} else {
$form->addInput('usf_name', $gL10n->get('SYS_NAME'), $userField->getValue('usf_name', 'database'), array('maxLength' => 100, 'property' => FIELD_REQUIRED));
}
// show internal field name for information
if ($getUsfId > 0) {
$form->addInput('usf_name_intern', $gL10n->get('SYS_INTERNAL_NAME'), $userField->getValue('usf_name_intern'), array('maxLength' => 100, 'property' => FIELD_DISABLED, 'helpTextIdLabel' => 'SYS_INTERNAL_NAME_DESC'));
}
if ($userField->getValue('usf_system') == 1) {
$form->addInput('usf_cat_id', $gL10n->get('SYS_CATEGORY'), $userField->getValue('cat_name'), array('maxLength' => 100, 'property' => FIELD_DISABLED));
} else {
$form->addSelectBoxForCategories('usf_cat_id', $gL10n->get('SYS_CATEGORY'), $gDb, 'USF', 'EDIT_CATEGORIES', array('property' => FIELD_REQUIRED, 'defaultValue' => $userField->getValue('usf_cat_id')));
}
$form->closeGroupBox();
$form->openGroupBox('gb_presentation', $gL10n->get('SYS_PRESENTATION'));
$userFieldText = array('CHECKBOX' => $gL10n->get('SYS_CHECKBOX'), 'DATE' => $gL10n->get('SYS_DATE'), 'DECIMAL' => $gL10n->get('SYS_DECIMAL_NUMBER'), 'DROPDOWN' => $gL10n->get('SYS_DROPDOWN_LISTBOX'), 'EMAIL' => $gL10n->get('SYS_EMAIL'), 'NUMBER' => $gL10n->get('SYS_NUMBER'), 'PHONE' => $gL10n->get('SYS_PHONE'), 'RADIO_BUTTON' => $gL10n->get('SYS_RADIO_BUTTON'), 'TEXT' => $gL10n->get('SYS_TEXT') . ' (100 ' . $gL10n->get('SYS_CHARACTERS') . ')', 'TEXT_BIG' => $gL10n->get('SYS_TEXT') . ' (4000 ' . $gL10n->get('SYS_CHARACTERS') . ')', 'URL' => $gL10n->get('ORG_URL'));
asort($userFieldText);
if ($userField->getValue('usf_system') == 1) {
// bei Systemfeldern darf der Datentyp nicht mehr veraendert werden
$form->addInput('usf_type', $gL10n->get('ORG_DATATYPE'), $userFieldText[$userField->getValue('usf_type')], array('maxLength' => 30, 'property' => FIELD_DISABLED));
} else {
// fuer jeden Feldtypen einen Eintrag in der Combobox anlegen
$form->addSelectBox('usf_type', $gL10n->get('ORG_DATATYPE'), $userFieldText, array('property' => FIELD_REQUIRED, 'defaultValue' => $userField->getValue('usf_type')));
}
$form->addMultilineTextInput('usf_value_list', $gL10n->get('ORG_VALUE_LIST'), $userField->getValue('usf_value_list', 'database'), 6, array('property' => FIELD_REQUIRED, 'helpTextIdLabel' => 'ORG_VALUE_LIST_DESC'));
$form->addInput('usf_icon', $gL10n->get('SYS_ICON'), $userField->getValue('usf_icon', 'database'), array('maxLength' => 2000));
$form->addInput('usf_url', $gL10n->get('ORG_URL'), $userField->getValue('usf_url'), array('maxLength' => 2000, 'helpTextIdLabel' => 'ORG_FIELD_URL_DESC'));
示例4: HtmlForm
// show form
$form = new HtmlForm('profile_fields_edit_form', $g_root_path . '/adm_program/modules/inventory/fields_function.php?inf_id=' . $getInfId . '&mode=1', $page);
$form->openGroupBox('gb_designation', $gL10n->get('SYS_DESIGNATION'));
if ($itemField->getValue('inf_system') == 1) {
$form->addInput('inf_name', $gL10n->get('SYS_NAME'), $itemField->getValue('inf_name', 'database'), array('maxLength' => 100, 'property' => FIELD_DISABLED));
} else {
$form->addInput('inf_name', $gL10n->get('SYS_NAME'), $itemField->getValue('inf_name', 'database'), array('maxLength' => 100, 'property' => FIELD_REQUIRED));
}
// show internal field name for information
if ($getInfId > 0) {
$form->addInput('inf_name_intern', $gL10n->get('SYS_INTERNAL_NAME'), $itemField->getValue('inf_name_intern'), array('maxLength' => 100, 'property' => FIELD_DISABLED, 'helpTextIdLabel' => 'SYS_INTERNAL_NAME_DESC'));
}
if ($itemField->getValue('inf_system') == 1) {
$form->addInput('inf_cat_id', $gL10n->get('SYS_CATEGORY'), $itemField->getValue('cat_name'), array('maxLength' => 100, 'property' => FIELD_DISABLED));
} else {
$form->addSelectBoxForCategories('inf_cat_id', $gL10n->get('SYS_CATEGORY'), $gDb, 'INF', 'EDIT_CATEGORIES', array('property' => FIELD_REQUIRED, 'defaultValue' => $itemField->getValue('cat_name')));
}
$form->closeGroupBox();
$form->openGroupBox('gb_presentation', $gL10n->get('SYS_PRESENTATION'));
$itemFieldText = array('CHECKBOX' => $gL10n->get('SYS_CHECKBOX'), 'DATE' => $gL10n->get('SYS_DATE'), 'DROPDOWN' => $gL10n->get('SYS_DROPDOWN_LISTBOX'), 'EMAIL' => $gL10n->get('SYS_EMAIL'), 'RADIO_BUTTON' => $gL10n->get('SYS_RADIO_BUTTON'), 'TEXT' => $gL10n->get('SYS_TEXT') . ' (100 ' . $gL10n->get('SYS_CHARACTERS') . ')', 'TEXT_BIG' => $gL10n->get('SYS_TEXT') . ' (4000 ' . $gL10n->get('SYS_CHARACTERS') . ')', 'URL' => $gL10n->get('ORG_URL'), 'NUMBER' => $gL10n->get('SYS_NUMBER'), 'DECIMAL' => $gL10n->get('SYS_DECIMAL_NUMBER'));
if ($itemField->getValue('inf_system') == 1) {
// bei Systemfeldern darf der Datentyp nicht mehr veraendert werden
$form->addInput('inf_type', $gL10n->get('ORG_DATATYPE'), $itemFieldText[$itemField->getValue('inf_type')], array('maxLength' => 30, 'property' => FIELD_DISABLED));
} else {
// fuer jeden Feldtypen einen Eintrag in der Combobox anlegen
$form->addSelectBox('inf_type', $gL10n->get('ORG_DATATYPE'), $itemFieldText, array('property' => FIELD_REQUIRED, 'defaultValue' => $itemField->getValue('inf_type')));
}
$form->addMultilineTextInput('inf_value_list', $gL10n->get('ORG_VALUE_LIST'), $itemField->getValue('inf_value_list', 'database'), 6, array('property' => FIELD_REQUIRED, 'helpTextIdLabel' => 'ORG_VALUE_LIST_DESC'));
$form->closeGroupBox();
$form->openGroupBox('gb_authorization', $gL10n->get('SYS_AUTHORIZATION'));
$form->addCheckbox('inf_hidden', $gL10n->get('ORG_FIELD_NOT_HIDDEN'), $itemField->getValue('inf_hidden'), array('property' => FIELD_DEFAULT, 'helpTextIdLabel' => 'ORG_FIELD_HIDDEN_DESC', 'icon' => 'eye.png'));
示例5: COALESCE
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 . '
INNER JOIN ' . TBL_CATEGORIES . '
ON cat_id = rol_cat_id
WHERE rol_valid = 1
AND rol_visible = 1
AND ( cat_org_id = ' . $gCurrentOrganization->getValue('org_id') . '
OR cat_org_id IS NULL )
ORDER BY cat_sequence, rol_name';
$statement = $gDb->query($sql);
示例6: HtmlForm
});', true);
// add headline and title of module
$page->addHtml('<div id="lists_overview">');
// get module menu
$ListsMenu = $page->getMenu();
if ($gCurrentUser->manageRoles()) {
// show link to create new role
$ListsMenu->addItem('admMenuItemNewRole', $g_root_path . '/adm_program/modules/roles/roles_new.php', $gL10n->get('SYS_CREATE_ROLE'), 'add.png');
}
if ($gCurrentUser->manageRoles() && !$gCurrentUser->isWebmaster()) {
// show link to maintain categories
$ListsMenu->addItem('menu_item_maintain_categories', $g_root_path . '/adm_program/modules/categories/categories.php?type=ROL', $gL10n->get('SYS_MAINTAIN_CATEGORIES'), 'application_view_tile.png');
}
$page->addJavascript('$("#cat_id").change(function() { $("#navbar_cat_id_form").submit(); });', true);
$navbarForm = new HtmlForm('navbar_cat_id_form', $g_root_path . '/adm_program/modules/lists/lists.php?active_role=' . $getActiveRole, $page, array('type' => 'navbar', 'setFocus' => false));
$navbarForm->addSelectBoxForCategories('cat_id', $gL10n->get('SYS_CATEGORY'), $gDb, 'ROL', 'FILTER_CATEGORIES', array('defaultValue' => $getCatId));
$ListsMenu->addForm($navbarForm->show(false));
if ($gCurrentUser->isWebmaster()) {
// show link to system preferences of roles
$ListsMenu->addItem('admMenuItemPreferencesLists', $g_root_path . '/adm_program/modules/preferences/preferences.php?show_option=lists', $gL10n->get('SYS_MODULE_PREFERENCES'), 'options.png', 'right');
}
$previousCategoryId = 0;
// Get Lists
$getStart = $lists->getStartElement();
$listsResult = $lists->getDataSet($getStart);
$numberOfRoles = $lists->getDataSetCount();
if ($numberOfRoles == 0) {
if ($gValidLogin) {
// If login valid, than show message for non available roles
if ($getActiveRole == 0) {
$gMessage->show($gL10n->get('LST_NO_ROLES_REMOVED'));