本文整理汇总了PHP中FormValidator::add_header方法的典型用法代码示例。如果您正苦于以下问题:PHP FormValidator::add_header方法的具体用法?PHP FormValidator::add_header怎么用?PHP FormValidator::add_header使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormValidator
的用法示例。
在下文中一共展示了FormValidator::add_header方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if (isset($_POST['form_sent']) && $_POST['form_sent']) {
$form_sent = $_POST['form_sent'];
$elements_posted = $_POST['elements_in_name'];
if (!is_array($elements_posted)) {
$elements_posted = array();
}
if ($form_sent == 1) {
$usergroup->subscribe_courses_to_usergroup($id, $elements_posted);
header('Location: usergroups.php');
exit;
}
}
// Filters
$filters = array(array('type' => 'text', 'name' => 'code', 'label' => get_lang('CourseCode')), array('type' => 'text', 'name' => 'title', 'label' => get_lang('Title')));
$searchForm = new FormValidator('search', 'get', api_get_self() . '?id=' . $id);
$searchForm->add_header(get_lang('AdvancedSearch'));
$renderer =& $searchForm->defaultRenderer();
$searchForm->addElement('hidden', 'id', $id);
foreach ($filters as $param) {
$searchForm->addElement($param['type'], $param['name'], $param['label']);
}
$searchForm->addElement('button', 'submit', get_lang('Search'));
$filterData = array();
if ($searchForm->validate()) {
$filterData = $searchForm->getSubmitValues();
}
$conditions = array();
if (!empty($filters) && !empty($filterData)) {
foreach ($filters as $filter) {
if (isset($filter['name']) && isset($filterData[$filter['name']])) {
$value = $filterData[$filter['name']];
示例2: array
api_not_allowed(true);
}
if (!isset($sessionInfo['duration']) || isset($sessionInfo['duration']) && empty($sessionInfo['duration'])) {
api_not_allowed(true);
}
if (!SessionManager::durationPerUserIsEnabled()) {
api_not_allowed(true);
}
if (empty($sessionId) || empty($userId)) {
api_not_allowed(true);
}
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => "resume_session.php?id_session=" . $sessionId, "name" => get_lang('SessionOverview'));
$form = new FormValidator('edit', 'post', api_get_self() . '?session_id=' . $sessionId . '&user_id=' . $userId);
$form->add_header(get_lang('EditUserSessionDuration'));
$data = SessionManager::getUserSession($userId, $sessionId);
$userInfo = api_get_user_info($userId);
// Show current end date for the session for this user, if any
$userAccess = CourseManager::getFirstCourseAccessPerSessionAndUser($sessionId, $userId);
if (count($userAccess) == 0) {
// User never accessed the session. End date is still open
$msg = sprintf(get_lang('UserNeverAccessedSessionDefaultDurationIsX'), $sessionInfo['duration']);
} else {
// The user already accessed the session. Show a clear detail of the days count.
$duration = $sessionInfo['duration'];
if (!empty($data['duration'])) {
$duration = $duration + $data['duration'];
}
$days = SessionManager::getDayLeftInSession($sessionId, $userId, $duration);
$firstAccess = api_strtotime($userAccess['login_course_date'], 'UTC');
示例3: get_lang
}
}
}
}
if (isset($errors) && count($errors) != 0) {
$error_message = '<ul>';
foreach ($errors as $index => $error_course) {
$error_message .= '<li>' . get_lang('Line') . ' ' . $error_course['line'] . ': <strong>' . $error_course['error'] . '</strong>: ';
$error_message .= get_lang('Course') . ': ' . $error_course['Title'] . ' (' . $error_course['Code'] . ')';
$error_message .= '</li>';
}
$error_message .= '</ul>';
Display::display_error_message($error_message, false);
}
$form = new FormValidator('import', 'post', api_get_self(), null, array('enctype' => 'multipart/form-data'));
$form->add_header($tool_name);
$form->addElement('file', 'import_file', get_lang('ImportCSVFileLocation'));
$form->addElement('checkbox', 'add_me_as_teacher', null, get_lang('AddMeAsTeacherInCourses'));
$form->addElement('button', 'save', get_lang('Import'));
$form->addElement('hidden', 'formSent', 1);
//$form->setDefaults(array('add_me_as_teacher' => 0));
$form->display();
?>
<div style="clear: both;"></div>
<p><?php
echo get_lang('CSVMustLookLike') . ' (' . get_lang('MandatoryFields') . ')';
?>
:</p>
<blockquote>
<pre>