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


PHP FormValidator::add_header方法代码示例

本文整理汇总了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']];
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:add_courses_to_usergroup.php

示例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');
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:session_user_edit.php

示例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>
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:course_import.php


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