本文整理汇总了PHP中HtmlForm::show方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlForm::show方法的具体用法?PHP HtmlForm::show怎么用?PHP HtmlForm::show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlForm
的用法示例。
在下文中一共展示了HtmlForm::show方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HtmlPage
require_once '../../installation/db_scripts/preferences.php';
// set some specific preferences whose values came from user input of the installation wizard
$orga_preferences['email_administrator'] = $_POST['orgaEmail'];
$orga_preferences['system_language'] = $gPreferences['system_language'];
// create all necessary data for this organization
$newOrganization->setPreferences($orga_preferences, false);
$newOrganization->createBasicData($gCurrentUser->getValue('usr_id'));
// if installation of second organization than show organization select at login
if ($gCurrentOrganization->countAllRecords() === 2) {
$sql = 'UPDATE ' . TBL_PREFERENCES . ' SET prf_value = 1
WHERE prf_name = \'system_organization_select\' ';
$gDb->query($sql);
}
$gDb->endTransaction();
// create html page object
$page = new HtmlPage($gL10n->get('INS_SETUP_WAS_SUCCESSFUL'));
$page->addHtml('<p class="lead">' . $gL10n->get('ORG_ORGANIZATION_SUCCESSFULL_ADDED', $_POST['orgaLongName']) . '</p>');
// show form
$form = new HtmlForm('add_new_organization_form', $g_root_path . '/adm_program/modules/preferences/preferences.php', $page);
$form->addSubmitButton('btn_foward', $gL10n->get('SYS_NEXT'), array('icon' => THEME_PATH . '/icons/forward.png'));
// add form to html page and show page
$page->addHtml($form->show(false));
$page->show();
// clean up
unset($_SESSION['add_organization_request']);
break;
case 4:
// show php info page
echo phpinfo();
break;
}
示例2: show
/** This method will create the whole html installation/update code. It will show the headline,
* text and the configured form. If no modus is set the installation modus will be set here.
* @param $directOutput If set to @b true (default) the form html will be directly send
* to the browser. If set to @b false the html will be returned.
* @return If $directOutput is set to @b false this method will return the html code of the form.
*/
public function show($directOutput = true)
{
global $gL10n;
// if no modus set then set installation modus
if (strlen($this->title) === 0) {
$this->setInstallationModus();
}
header('Content-type: text/html; charset=utf-8');
$html = '
<!DOCTYPE html>
<html>
<head>
<!-- (c) 2004 - 2015 The Admidio Team - http://www.admidio.org -->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Admidio Team" />
<meta name="robots" content="noindex" />
<title>Admidio - ' . $this->title . '</title>
<link rel="shortcut icon" type="image/x-icon" href="layout/favicon.png" />
<link rel="stylesheet" type="text/css" href="../libs/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="layout/admidio.css" />
<script type="text/javascript" src="../libs/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../libs/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../system/js/common_functions.js"></script>
</head>
<body>
<div class="admidio-container" id="adm_content">
<img id="admidio-logo" src="layout/logo.png" alt="Logo" />
<h1>' . $this->headline . '</h1>';
// if set then show description
if (strlen($this->descriptionText) > 0) {
if (strlen($this->descriptionTitle) > 0) {
$html .= '<h3>' . $this->descriptionTitle . '</h3>';
}
$html .= '<p>' . $this->descriptionText . '</p>';
}
// now show the configured form
$html .= parent::show(false);
$html .= '</div>
</body>
</html>';
if ($directOutput) {
echo $html;
} else {
return $html;
}
}
示例3: HtmlForm
$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"
alt="' . $gL10n->get('ROL_LEADER_EDIT_MEMBERS') . '" title="' . $gL10n->get('ROL_LEADER_EDIT_MEMBERS') . '" />';
}
示例4:
if (strlen($role->getValue('rol_start_time')) > 0) {
$value = $gL10n->get('LST_FROM_TO', $role->getValue('rol_start_time', $gPreferences['system_time']), $role->getValue('rol_end_time', $gPreferences['system_time']));
}
$form->addStaticControl('infobox_date', $gL10n->get('DAT_DATE'), $value);
}
// Meeting Point
if (strlen($role->getValue('rol_location')) > 0) {
$form->addStaticControl('infobox_location', $gL10n->get('SYS_LOCATION'), $role->getValue('rol_location'));
}
// Member Fee
if (strlen($role->getValue('rol_cost')) > 0) {
$form->addStaticControl('infobox_contribution', $gL10n->get('SYS_CONTRIBUTION'), $role->getValue('rol_cost') . ' ' . $gPreferences['system_currency']);
}
// Fee period
if (strlen($role->getValue('rol_cost_period')) > 0 && $role->getValue('rol_cost_period') != 0) {
$form->addStaticControl('infobox_contribution_period', $gL10n->get('SYS_CONTRIBUTION_PERIOD'), $role->getCostPeriods($role->getValue('rol_cost_period')));
}
// max participants
if (strlen($role->getValue('rol_max_members')) > 0) {
$form->addStaticControl('infobox_max_participants', $gL10n->get('SYS_MAX_PARTICIPANTS'), $role->getValue('rol_max_members'));
}
$htmlBox .= $form->show(false);
$htmlBox .= '</div>
</div>';
}
// end of infobox
$page->addHtml($htmlBox);
}
// show complete html page
$page->show();
}
示例5: elseif
// 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>');
}
if ($datesTotalCount == 0) {
// No events found
if ($getId > 0) {
$page->addHtml('<p>' . $gL10n->get('SYS_NO_ENTRY') . '</p>');
示例6: HtmlForm
$("#admidio_modal").modal("hide");
}, 2000);
} else {
$("#password_form .form-alert").attr("class", "alert alert-danger form-alert");
$("#password_form .form-alert").fadeIn();
$("#password_form .form-alert").html("<span class=\\"glyphicon glyphicon-exclamation-sign\\"></span>"+data);
}
});
});
});
--></script>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">' . $gL10n->get('PRO_EDIT_PASSWORD') . '</h4>
</div>
<div class="modal-body">';
// show form
$form = new HtmlForm('password_form', $g_root_path . '/adm_program/modules/profile/password.php?usr_id=' . $getUserId . '&mode=change');
if ($gCurrentUser->getValue('usr_id') == $getUserId) {
// to change own password user must enter the valid old password for verification
// TODO Future: 'minLength' => 8
$form->addInput('old_password', $gL10n->get('PRO_CURRENT_PASSWORD'), null, array('type' => 'password', 'property' => FIELD_REQUIRED));
$form->addLine();
}
$form->addInput('new_password', $gL10n->get('PRO_NEW_PASSWORD'), null, array('type' => 'password', 'property' => FIELD_REQUIRED, 'minLength' => 8, 'helpTextIdInline' => 'PRO_PASSWORD_DESCRIPTION'));
$form->addInput('new_password_confirm', $gL10n->get('SYS_REPEAT'), null, array('type' => 'password', 'property' => FIELD_REQUIRED, 'minLength' => 8));
$form->addSubmitButton('btn_save', $gL10n->get('SYS_SAVE'), array('icon' => THEME_PATH . '/icons/disk.png', 'class' => ' col-sm-offset-3'));
$form->show();
echo '</div>';
}
示例7: getRoleMemberships
function getRoleMemberships($htmlListId, $user, $result_role, $count_role, $directOutput)
{
global $gDb, $gL10n, $gCurrentUser, $gPreferences, $g_root_path, $gProfileFields;
$countShowRoles = 0;
$member = new TableMembers($gDb);
$role = new TableRoles($gDb);
$roleMemHTML = '<ul class="list-group admidio-list-roles-assign" id="' . $htmlListId . '">';
while ($row = $gDb->fetch_array($result_role)) {
if ($gCurrentUser->hasRightViewRole($row['mem_rol_id']) && $row['rol_visible'] == 1) {
$formerMembership = false;
$futureMembership = false;
$showRoleEndDate = false;
$deleteMode = 'pro_role';
$member->clear();
$member->setArray($row);
$role->clear();
$role->setArray($row);
// if membership will not end, then don't show end date
if (strcmp($member->getValue('mem_end', 'Y-m-d'), '9999-12-31') != 0) {
$showRoleEndDate = true;
}
// check if membership ends in the past
if (strcmp(DATE_NOW, $member->getValue('mem_end', 'Y-m-d')) > 0) {
$formerMembership = true;
$deleteMode = 'pro_former';
}
// check if membership starts in the future
if (strcmp($member->getValue('mem_begin', 'Y-m-d'), DATE_NOW) > 0) {
$futureMembership = true;
$deleteMode = 'pro_future';
}
// create list entry for one role
$roleMemHTML .= '
<li class="list-group-item" id="role_' . $row['mem_rol_id'] . '">
<ul class="list-group admidio-list-roles-assign-pos">
<li class="list-group-item">
<span>' . $role->getValue('cat_name') . ' - ';
if ($gCurrentUser->hasRightViewRole($member->getValue('mem_rol_id'))) {
$roleMemHTML .= '<a href="' . $g_root_path . '/adm_program/modules/lists/lists_show.php?mode=html&rol_id=' . $member->getValue('mem_rol_id') . '" title="' . $role->getValue('rol_description') . '">' . $role->getValue('rol_name') . '</a>';
} else {
echo $role->getValue('rol_name');
}
if ($member->getValue('mem_leader') == 1) {
$roleMemHTML .= ' - ' . $gL10n->get('SYS_LEADER');
}
$roleMemHTML .= '
</span>
<span class="pull-right text-right">';
if ($showRoleEndDate == true) {
$roleMemHTML .= $gL10n->get('SYS_SINCE_TO', $member->getValue('mem_begin', $gPreferences['system_date']), $member->getValue('mem_end', $gPreferences['system_date']));
} elseif ($futureMembership == true) {
$roleMemHTML .= $gL10n->get('SYS_FROM', $member->getValue('mem_begin', $gPreferences['system_date']));
} else {
$roleMemHTML .= $gL10n->get('SYS_SINCE', $member->getValue('mem_begin', $gPreferences['system_date']));
}
if ($role->allowedToAssignMembers($gCurrentUser)) {
// You are not allowed to delete your own webmaster membership, other roles could be deleted
if ($role->getValue('rol_webmaster') == 1 && $gCurrentUser->getValue('usr_id') != $user->getValue('usr_id') || $role->getValue('rol_webmaster') == 0) {
$roleMemHTML .= '
<a class="admidio-icon-link" data-toggle="modal" data-target="#admidio_modal"
href="' . $g_root_path . '/adm_program/system/popup_message.php?type=' . $deleteMode . '&element_id=role_' . $role->getValue('rol_id') . '&database_id=' . $member->getValue('mem_id') . '&name=' . urlencode($role->getValue('rol_name')) . '"><img
src="' . THEME_PATH . '/icons/delete.png" alt="' . $gL10n->get('PRO_CANCEL_MEMBERSHIP') . '" title="' . $gL10n->get('PRO_CANCEL_MEMBERSHIP') . '" /></a>';
} else {
$roleMemHTML .= '
<a class="admidio-icon-link"><img src="' . THEME_PATH . '/icons/dummy.png" alt=""/></a>';
}
// do not edit webmaster role
if ($row['rol_webmaster'] == 0) {
$roleMemHTML .= '<a class="admidio-icon-link" style="cursor:pointer;" onclick="profileJS.toggleDetailsOn(' . $member->getValue('mem_id') . ')"><img
src="' . THEME_PATH . '/icons/edit.png" alt="' . $gL10n->get('PRO_CHANGE_DATE') . '" title="' . $gL10n->get('PRO_CHANGE_DATE') . '" /></a>';
} else {
$roleMemHTML .= '<a class="admidio-icon-link"><img src="' . THEME_PATH . '/icons/dummy.png" alt=""/></a>';
}
}
// only show info if system setting is activated
if ($gPreferences['system_show_create_edit'] > 0) {
$roleMemHTML .= '<a class="admidio-icon-link admMemberInfo" id="member_info_' . $member->getValue('mem_id') . '" href="javascript:"><img src="' . THEME_PATH . '/icons/info.png" alt="' . $gL10n->get('SYS_INFORMATIONS') . '" title="' . $gL10n->get('SYS_INFORMATIONS') . '"/></a>';
}
$roleMemHTML .= '</span>
</li>
<li class="list-group-item" id="membership_period_' . $member->getValue('mem_id') . '" style="visibility: hidden; display: none;"><div class="collapse navbar-collapse">';
$form = new HtmlForm('membership_period_form_' . $member->getValue('mem_id'), $g_root_path . '/adm_program/modules/profile/profile_function.php?mode=7&user_id=' . $user->getValue('usr_id') . '&mem_id=' . $row['mem_id'], null, array('type' => 'navbar', 'setFocus' => false, 'class' => 'admidio-form-membership-period'));
$form->addInput('membership_start_date_' . $member->getValue('mem_id'), $gL10n->get('SYS_START'), $member->getValue('mem_begin', $gPreferences['system_date']), array('type' => 'date', 'maxLength' => 10));
$form->addInput('membership_end_date_' . $member->getValue('mem_id'), $gL10n->get('SYS_END'), $member->getValue('mem_end', $gPreferences['system_date']), array('type' => 'date', 'maxLength' => 10));
$form->addSubmitButton('btn_send_' . $member->getValue('mem_id'), $gL10n->get('SYS_OK'));
$roleMemHTML .= $form->show(false);
$roleMemHTML .= '</div></li>
<li class="list-group-item" id="member_info_' . $member->getValue('mem_id') . '_Content" style="display: none;">';
// show informations about user who creates the recordset and changed it
$roleMemHTML .= admFuncShowCreateChangeInfoById($member->getValue('mem_usr_id_create'), $member->getValue('mem_timestamp_create'), $member->getValue('mem_usr_id_change'), $member->getValue('mem_timestamp_change')) . '
</li>
</ul>
</li>';
$countShowRoles++;
}
}
if ($countShowRoles == 0) {
$roleMemHTML = '<div class="block-padding">' . $gL10n->get('PRO_NO_ROLES_VISIBLE') . '</div>';
} else {
$roleMemHTML .= '</ul>';
//.........这里部分代码省略.........
示例8: elseif
$LinksMenu = $page->getMenu();
if ($gCurrentUser->editWeblinksRight()) {
// show link to create new announcement
$LinksMenu->addItem('menu_item_new_link', $g_root_path . '/adm_program/modules/links/links_new.php?headline=' . $getHeadline, $gL10n->get('LNK_CREATE_LINK'), 'add.png');
}
if ($gCurrentUser->isWebmaster()) {
// show link to system preferences of weblinks
$LinksMenu->addItem('menu_items_links_preferences', $g_root_path . '/adm_program/modules/preferences/preferences.php?show_option=links', $gL10n->get('SYS_MODULE_PREFERENCES'), 'options.png', 'right');
} elseif ($gCurrentUser->editWeblinksRight()) {
// show link to maintain categories
$LinksMenu->addItem('menu_item_maintain_categories', $g_root_path . '/adm_program/modules/categories/categories.php?type=LNK&title=' . $getHeadline, $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/links/links.php?headline=' . $getHeadline, $page, array('type' => 'navbar', 'setFocus' => false));
$navbarForm->addSelectBoxForCategories('cat_id', $gL10n->get('SYS_CATEGORY'), $gDb, 'LNK', 'FILTER_CATEGORIES', array('defaultValue' => $getCatId));
$LinksMenu->addForm($navbarForm->show(false));
}
if ($weblinksCount == 0) {
// no weblink found
if ($weblinks->getId() > 0) {
$page->addHtml('<p>' . $gL10n->get('SYS_NO_ENTRY') . '</p>');
} else {
$page->addHtml('<p>' . $gL10n->get('SYS_NO_ENTRIES') . '</p>');
}
} else {
$getStart = $weblinks->getStartElement();
$weblinksDataSet = $weblinks->getDataSet($getStart);
$weblink = new TableWeblink($gDb);
$j = 0;
// counter for fetchObject
$i = 0;
示例9: HtmlForm
// change mode of users that should be shown
$("#mem_show_all").click(function() {
window.location.replace("' . $g_root_path . '/adm_program/modules/members/members.php?members=' . $flagShowMembers . '");
});', true);
// get module menu
$membersAdministrationMenu = $page->getMenu();
$membersAdministrationMenu->addItem('menu_item_create_user', $g_root_path . '/adm_program/modules/members/members_new.php', $gL10n->get('MEM_CREATE_USER'), 'add.png');
if ($gPreferences['profile_log_edit_fields'] == 1) {
// show link to view profile field change history
$membersAdministrationMenu->addItem('menu_item_change_history', $g_root_path . '/adm_program/modules/members/profile_field_history.php', $gL10n->get('MEM_CHANGE_HISTORY'), 'clock.png');
}
// show checkbox to select all users or only active members
if ($gPreferences['members_show_all_users'] == 1) {
$navbarForm = new HtmlForm('navbar_show_all_users_form', '', $page, array('type' => 'navbar', 'setFocus' => false));
$navbarForm->addCheckbox('mem_show_all', $gL10n->get('MEM_SHOW_ALL_USERS'), $flagShowMembers, array('helpTextIdLabel' => 'MEM_SHOW_USERS_DESC'));
$membersAdministrationMenu->addForm($navbarForm->show(false));
}
$membersAdministrationMenu->addItem('menu_item_extras', null, $gL10n->get('SYS_MORE_FEATURES'), null, 'right');
// show link to import users
$membersAdministrationMenu->addItem('menu_item_import_users', $g_root_path . '/adm_program/modules/members/import.php', $gL10n->get('MEM_IMPORT_USERS'), 'database_in.png', 'right', 'menu_item_extras');
if ($gCurrentUser->isWebmaster()) {
// show link to maintain profile fields
$membersAdministrationMenu->addItem('menu_item_maintain_profile_fields', $g_root_path . '/adm_program/modules/preferences/fields.php', $gL10n->get('PRO_MAINTAIN_PROFILE_FIELDS'), 'application_form_edit.png', 'right', 'menu_item_extras');
// show link to system preferences of weblinks
$membersAdministrationMenu->addItem('menu_item_preferences_links', $g_root_path . '/adm_program/modules/preferences/preferences.php?show_option=user_management', $gL10n->get('SYS_MODULE_PREFERENCES'), 'options.png', 'right', 'menu_item_extras');
}
// Create table object
$membersTable = new HtmlTable('tbl_members', $page, true, true, 'table table-condensed');
// create array with all column heading values
$columnHeading = array($gL10n->get('SYS_ABR_NO'), '<img class="admidio-icon-info" src="' . THEME_PATH . '/icons/profile.png"
alt="' . $gL10n->get('SYS_MEMBER_OF_ORGANIZATION', $gCurrentOrganization->getValue('org_longname')) . '"