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


PHP FormValidator::add_button方法代码示例

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


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

示例1: array

    }
    if ($total_resource_weight != $total_weight) {
        Display::display_warning_message(get_lang('SumOfActivitiesWeightMustBeEqualToTotalWeight'));
    }
}
$filter = api_get_configuration_value('certificate_filter_by_official_code');
$userList = array();
$filterForm = null;
$certificate_list = array();
if ($filter) {
    echo '<br />';
    $options = UserManager::getOfficialCodeGrouped();
    $options = array_merge(array('all' => get_lang('All')), $options);
    $form = new FormValidator('official_code_filter', 'POST', api_get_self() . '?' . api_get_cidreq() . '&cat_id=' . $cat_id);
    $form->addElement('select', 'filter', get_lang('OfficialCode'), $options);
    $form->add_button('submit', get_lang('Submit'));
    $filterForm = '<br />' . $form->return_form();
    if ($form->validate()) {
        $officialCode = $form->getSubmitValue('filter');
        if ($officialCode == 'all') {
            $certificate_list = get_list_users_certificates($cat_id);
        } else {
            $userList = UserManager::getUsersByOfficialCode($officialCode);
            if (!empty($userList)) {
                $certificate_list = get_list_users_certificates($cat_id, $userList);
            }
        }
    } else {
        $certificate_list = get_list_users_certificates($cat_id);
    }
} else {
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:gradebook_display_certificate.php

示例2: getAttendanceBaseInLogin

 /**
  * Gets attendance base in the table:
  * TABLE_STATISTIC_TRACK_E_COURSE_ACCESS
  * @param bool $showForm
  * @throws ViewException
  */
 public function getAttendanceBaseInLogin($showForm = false, $exportToPdf = true)
 {
     $table = null;
     $formToDisplay = null;
     $startDate = null;
     $endDate = null;
     $sessionId = api_get_session_id();
     if ($showForm) {
         $form = new FormValidator('search', 'post', api_get_self() . '?' . api_get_cidreq() . '&action=calendar_logins');
         $form->addDateRangePicker('range', get_lang('Range'));
         $form->add_button('submit', get_lang('submit'));
         if ($form->validate()) {
             $values = $form->getSubmitValues();
             $startDate = api_get_utc_datetime($values['range_start']);
             $endDate = api_get_utc_datetime($values['range_end']);
         }
         $formToDisplay = $form->return_form();
     } else {
         if (!empty($sessionId)) {
             $sessionInfo = api_get_session_info($sessionId);
             $startDate = $sessionInfo['date_start'];
             $endDate = $sessionInfo['date_end'];
         }
     }
     $attendance = new Attendance();
     if ($exportToPdf) {
         $result = $attendance->exportAttendanceLogin($startDate, $endDate);
         if (empty($result)) {
             api_not_allowed(true, get_lang('NoDataAvailable'));
         }
     }
     $table = $attendance->getAttendanceLoginTable($startDate, $endDate);
     $data = array('form' => $formToDisplay, 'table' => $table);
     $this->view->set_data($data);
     $this->view->set_layout('layout');
     $this->view->set_template('calendar_logins');
     $this->view->render();
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:44,代码来源:attendance_controller.php


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