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


PHP FormValidator::return_form方法代码示例

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


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

示例1: openid_form

function openid_form()
{
    $form = new FormValidator('openid_login', 'post', null, null, array('class' => 'form-vertical form_login'));
    $form->addElement('text', 'openid_url', array(get_lang('OpenIDURL'), Display::url(get_lang('OpenIDWhatIs'), 'main/auth/openid/whatis.php')), array('class' => 'openid_input'));
    $form->addElement('button', 'submit', get_lang('Login'));
    return $form->return_form();
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:7,代码来源:login.php

示例2: ch_qti2_display_form

/**
 * This function displays the form for import of the zip file with qti2
 */
function ch_qti2_display_form()
{
    $name_tools = get_lang('ImportQtiQuiz');
    $form = '<div class="actions">';
    $form .= '<a href="exercice.php?show=test">' . Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM) . '</a>';
    $form .= '</div>';
    $form_validator = new FormValidator('qti_upload', 'post', api_get_self() . "?" . api_get_cidreq(), null, array('enctype' => 'multipart/form-data'));
    $form_validator->addElement('header', $name_tools);
    $form_validator->addElement('file', 'userFile', get_lang('DownloadFile'));
    $form_validator->addElement('style_submit_button', 'submit', get_lang('Send'), 'class="upload"');
    $form .= $form_validator->return_form();
    echo $form;
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:16,代码来源:qti2.php

示例3: openid_form

function openid_form()
{
    //get_lang('OpenIdAuthentication')
    $form = new FormValidator('openid_login', 'post', null, null, array('class' => 'form-vertical form_login'));
    $form->addElement('text', 'openid_url', array(get_lang('OpenIDURL'), Display::url(get_lang('OpenIDWhatIs'), 'main/auth/openid/whatis.php')), array('class' => 'openid_input'));
    $form->addElement('button', 'submit', get_lang('Login'));
    return $form->return_form();
    /*
     return '<label for="openid_url">'.get_lang('OpenIDURL').' <a href="main/auth/openid/whatis.php" title="'.get_lang('OpenIDWhatIs').'">'.Display::return_icon('info3.gif',get_lang('Info')).'</a></label>
     <input type="text" id="openid_url" name="openid_url" style="background: url(main/img/openid_small_logo.png) no-repeat; background-color: #fff; background-position: 0 50%; padding-left:18px;" value="http://"></input>
    * <input type="submit" name="openid_login" value="'.get_lang('Enter').'" /><br /><br /></form></div>';
    *
    */
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:14,代码来源:login.php

示例4: aiken_display_form

/**
 * This function displays the form for import of the zip file with qti2
 * @param   string  Report message to show in case of error
 */
function aiken_display_form($msg = '')
{
    $name_tools = get_lang('ImportAikenQuiz');
    $form = '<div class="actions">';
    $form .= '<a href="exercice.php?show=test">' . Display::return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM) . '</a>';
    $form .= '</div>';
    $form .= $msg;
    $form_validator = new FormValidator('aiken_upload', 'post', api_get_self() . "?" . api_get_cidreq(), null, array('enctype' => 'multipart/form-data'));
    $form_validator->addElement('header', $name_tools);
    $form_validator->addElement('text', 'total_weight', get_lang('TotalWeight'));
    $form_validator->addElement('file', 'userFile', get_lang('DownloadFile'));
    $form_validator->addElement('style_submit_button', 'submit', get_lang('Send'), 'class="upload"');
    $form .= $form_validator->return_form();
    $form .= '<blockquote>' . get_lang('ImportAikenQuizExplanation') . '<br /><pre>' . get_lang('ImportAikenQuizExplanationExample') . '</pre></blockquote>';
    echo $form;
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:20,代码来源:aiken_import.inc.php

示例5: getWorkCommentForm

/**
 * @param array $work
 * @return string
 */
function getWorkCommentForm($work)
{
    if (ADD_DOCUMENT_TO_WORK == false) {
        return null;
    }
    $form = new FormValidator(
        'work_comment',
        'post',
        api_get_path(WEB_CODE_PATH).'work/view.php?id='.$work['id'].'&action=send_comment&'.api_get_cidreq()
    );

    $form->addElement('file', 'file', get_lang('Attachment'));
    $form->addElement('textarea', 'comment', get_lang('Comment'), array('class' => 'span5', 'rows' => '8'));
    $form->addElement('hidden', 'id', $work['id']);
    if (api_is_allowed_to_edit()) {
        $form->addElement('checkbox', 'send_mail', null, get_lang('SendMail'));
    }
    $form->addElement('button', 'button', get_lang('Send'));

    return $form->return_form();
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:25,代码来源:work.lib.php

示例6: manage_form

function manage_form($default, $select_from_user_list = null, $sent_to = null)
{
    $group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null;
    $message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null;
    $param_f = isset($_GET['f']) ? Security::remove_XSS($_GET['f']) : '';
    $form = new FormValidator('compose_message', null, api_get_self() . '?f=' . $param_f, null, array('enctype' => 'multipart/form-data'));
    if (empty($group_id)) {
        if (isset($select_from_user_list)) {
            $form->add_textfield('id_text_name', get_lang('SendMessageTo'), true, array('class' => 'span4', 'id' => 'id_text_name', 'onkeyup' => 'send_request_and_search()', 'autocomplete' => 'off'));
            $form->addRule('id_text_name', get_lang('ThisFieldIsRequired'), 'required');
            $form->addElement('html', '<div id="id_div_search" style="padding:0px" class="message-select-box" >&nbsp;</div>');
            $form->addElement('hidden', 'user_list', 0, array('id' => 'user_list'));
        } else {
            if (!empty($sent_to)) {
                $form->addElement('html', $sent_to);
            }
            if (empty($default['users'])) {
                //fb select
                $form->addElement('select', 'users', get_lang('SendMessageTo'), array(), array('id' => 'users'));
            } else {
                $form->addElement('hidden', 'hidden_user', $default['users'][0], array('id' => 'hidden_user'));
            }
        }
    } else {
        $usergroup = new UserGroup();
        $group_info = $usergroup->get($group_id);
        $form->addElement('label', get_lang('ToGroup'), api_xml_http_response_encode($group_info['name']));
        $form->addElement('hidden', 'group_id', $group_id);
        $form->addElement('hidden', 'parent_id', $message_id);
    }
    $form->add_textfield('title', get_lang('Subject'), true, array('class' => 'span4'));
    $form->add_html_editor('content', get_lang('Message'), false, false, array('ToolbarSet' => 'Messages', 'Width' => '95%', 'Height' => '250'));
    if (isset($_GET['re_id'])) {
        $message_reply_info = MessageManager::get_message_by_id($_GET['re_id']);
        $default['title'] = get_lang('MailSubjectReplyShort') . " " . $message_reply_info['title'];
        $form->addElement('hidden', 're_id', intval($_GET['re_id']));
        $form->addElement('hidden', 'save_form', 'save_form');
        //adding reply mail
        $user_reply_info = UserManager::get_user_info_by_id($message_reply_info['user_sender_id']);
        $default['content'] = '<br />' . sprintf(get_lang('XWroteY'), api_get_person_name($user_reply_info['firstname'], $user_reply_info['lastname']), Security::filter_terms($message_reply_info['content']));
    }
    if (empty($group_id)) {
        $form->addElement('advanced_settings', get_lang('FilesAttachment') . '<span id="filepaths">
                    <div id="filepath_1">
                        <input type="file" name="attach_1"/><br />
                        ' . get_lang('Description') . '&nbsp;&nbsp;<input type="text" name="legend[]" /><br /><br />
                    </div>
                </span>');
        $form->addElement('advanced_settings', '<span id="link-more-attach"><a href="javascript://" onclick="return add_image_form()">' . get_lang('AddOneMoreFile') . '</a></span>&nbsp;(' . sprintf(get_lang('MaximunFileSizeX'), Text::format_file_size(api_get_setting('message_max_upload_filesize'))) . ')');
    }
    $form->addElement('style_submit_button', 'compose', api_xml_http_response_encode(get_lang('SendMessage')), 'class="save"');
    $form->setRequiredNote('<span class="form_required">*</span> <small>' . get_lang('ThisFieldIsRequired') . '</small>');
    if (!empty($group_id) && !empty($message_id)) {
        $message_info = MessageManager::get_message_by_id($message_id);
        $default['title'] = get_lang('MailSubjectReplyShort') . " " . $message_info['title'];
    }
    $form->setDefaults($default);
    $html = '';
    if ($form->validate()) {
        $check = Security::check_token('post');
        if ($check) {
            $user_list = $default['users'];
            $file_comments = $_POST['legend'];
            $title = $default['title'];
            $content = $default['content'];
            $group_id = isset($default['group_id']) ? $default['group_id'] : null;
            $parent_id = $default['parent_id'];
            if (is_array($user_list) && count($user_list) > 0) {
                //all is well, send the message
                foreach ($user_list as $user) {
                    $res = MessageManager::send_message($user, $title, $content, $_FILES, $file_comments, $group_id, $parent_id, null, null, api_get_user_id());
                    if ($res) {
                        if (is_string($res)) {
                            $html .= Display::return_message($res, 'error');
                        } else {
                            $user_info = api_get_user_info($user);
                            $html .= Display::return_message(get_lang('MessageSentTo') . " &nbsp;<b>" . $user_info['complete_name'] . "</b>", 'confirmation', false);
                        }
                    }
                }
            } else {
                Display::display_error_message('ErrorSendingMessage');
            }
        }
        Security::clear_token();
    } else {
        $token = Security::get_token();
        $form->addElement('hidden', 'sec_token');
        $form->setConstants(array('sec_token' => $token));
        $html .= $form->return_form();
    }
    return $html;
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:93,代码来源:new_message.php

示例7: array

    $form->addElement('button', 'submit', get_lang('Confirm'), array('class' => 'btn btn-primary'));
    $formHtml = $form->return_form();
    if ($form->validate()) {
        $result = $form->getSubmitValues();
        if (isset($result['left']) && $result['left']) {
            $_SESSION['before_login_accepted'] = 1;
            header('Location: ' . $urlOption1);
            exit;
        }
    }
    $form2 = new FormValidator('form');
    if (!empty($option2) && !empty($urlOption2)) {
        $renderer =& $form2->defaultRenderer();
        $renderer->setHeaderTemplate('');
        $renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>');
        $renderer->setCustomElementTemplate('<tr><td>{element}</td></tr>');
        $form2->addElement('html', $option2);
        $form2->addElement('checkbox', 'right', null, get_lang('Yes'));
        $form2->addElement('button', 'submit', get_lang('Send'));
        $formHtml2 = $form2->return_form();
        if ($form2->validate()) {
            $result = $form2->getSubmitValues();
            if (isset($result['right']) && $result['right']) {
                header('Location: ' . $urlOption2);
                exit;
            }
        }
    }
    $_template['form_option1'] = $formHtml;
    $_template['form_option2'] = $formHtml2;
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:index.php

示例8: FormValidator

                }
            });
            $( "#dialog-confirm" ).dialog("open");
            return false;
        });
    });
    </script>';
$extra .= '<div id="dialog-confirm" title="' . get_lang("ConfirmYourChoice") . '">';
$form = new FormValidator('report', 'post', null, null, array('class' => 'form-vertical'));
$form->addElement('radio', 'export_format', null, get_lang('ExportAsCSV'), 'csv', array('id' => 'export_format_csv_label'));
$form->addElement('radio', 'export_format', null, get_lang('ExportAsXLS'), 'xls', array('id' => 'export_format_xls_label'));
$form->addElement('checkbox', 'load_extra_data', null, get_lang('LoadExtraData'), '0', array('id' => 'export_format_xls_label'));
$form->addElement('checkbox', 'include_all_users', null, get_lang('IncludeAllUsers'), '0');
$form->addElement('checkbox', 'only_best_attempts', null, get_lang('OnlyBestAttempts'), '0');
$form->setDefaults(array('export_format' => 'csv'));
$extra .= $form->return_form();
$extra .= '</div>';
if ($is_allowedToEdit) {
    echo $extra;
}
echo $actions;
$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_exercise_results&exerciseId=' . $exercise_id . '&filter_by_user=' . $filter_user . '&' . api_get_cidreq();
$action_links = '';
//Generating group list
$group_list = GroupManager::get_group_list();
$group_parameters = array('group_all:' . get_lang('All'), 'group_none:' . get_lang('None'));
foreach ($group_list as $group) {
    $group_parameters[] = $group['id'] . ':' . $group['name'];
}
if (!empty($group_parameters)) {
    $group_parameters = implode(';', $group_parameters);
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:exercise_report.php

示例9: Template

    api_set_firstpage_parameter($firstpage);
    $tpl = new Template(null, 1, 1);
    $action = api_get_self() . '?' . Security::remove_XSS($_SERVER['QUERY_STRING']);
    $action = str_replace('&amp;', '&', $action);
    $form = new FormValidator('formLogin', 'post', $action, null, array('class' => 'form-stacked'));
    $form->addElement('text', 'login', null, array('placeholder' => get_lang('UserName'), 'class' => 'span3 autocapitalize_off'));
    //new
    $form->addElement('password', 'password', null, array('placeholder' => get_lang('Password'), 'class' => 'span3'));
    //new
    $form->addElement('style_submit_button', 'submitAuth', get_lang('LoginEnter'), array('class' => 'btn span3'));
    // see same text in main_api.lib.php function api_not_allowed
    if (api_is_cas_activated()) {
        $msg .= Display::return_message(sprintf(get_lang('YouHaveAnInstitutionalAccount'), api_get_setting("Institution")), '', false);
        $msg .= Display::div("<br/><a href='" . get_cas_direct_URL(api_get_course_id()) . "'>" . getCASLogoHTML() . " " . sprintf(get_lang('LoginWithYourAccount'), api_get_setting("Institution")) . "</a><br/><br/>", array('align' => 'center'));
        $msg .= Display::return_message(get_lang('YouDontHaveAnInstitutionAccount'));
        $msg .= "<p style='text-align:center'><a href='#' onclick='\$(this).parent().next().toggle()'>" . get_lang('LoginWithExternalAccount') . "</a></p>";
        $msg .= "<div style='display:none;'>";
    }
    $msg .= '<div class="well_login">';
    $msg .= $form->return_form();
    $msg .= '</div>';
    if (api_is_cas_activated()) {
        $msg .= "</div>";
    }
    $msg .= '<hr/><p style="text-align:center"><a href="' . api_get_path(WEB_PATH) . '">' . get_lang('ReturnToCourseHomepage') . '</a></p>';
    $tpl->assign('content', '<h4>' . get_lang('LoginToGoToThisCourse') . '</h4>' . $msg);
    $tpl->display_one_col_template();
} else {
    api_delete_firstpage_parameter();
    Header('Location: ' . api_get_path(WEB_PATH) . 'index.php');
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:gotocourse.php

示例10: generate_invitation_form

 /**
  * @param $id
  * @param array $params
  * @param string $display
  * @return string
  */
 public static function generate_invitation_form($id, $params = array())
 {
     $form = new FormValidator('send_invitation');
     $form->addTextarea('content', get_lang('AddPersonalMessage'), ['id' => 'content_invitation_id', 'rows' => 5]);
     return $form->return_form();
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:12,代码来源:message.lib.php

示例11: function

 <script>
 $(function() {
     $("#session_name").on("change", function() {
        var sessionId = $(this).val();
        window.location = "' . $courseListUrl . '?session_id="+sessionId;
     });
 });
 </script>';
 $actions .= '<div class="pull-right">';
 $actions .= '<a href="course_add.php">' . Display::return_icon('new_course.png', get_lang('AddCourse'), '', ICON_SIZE_MEDIUM) . '</a> ';
 if (api_get_setting('course_validation') == 'true') {
     $actions .= '<a href="course_request_review.php">' . Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests'), '', ICON_SIZE_MEDIUM) . '</a>';
 }
 $actions .= '</div>';
 $actions .= '<div class="pull-right">';
 $actions .= $sessionFilter->return_form();
 $actions .= '</div>';
 $actions .= $form->return_form();
 if (isset($_GET['session_id']) && !empty($_GET['session_id'])) {
     // Create a sortable table with the course data filtered by session
     $table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data_by_session', 2);
 } else {
     // Create a sortable table with the course data
     $table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data', 2);
 }
 $parameters = array();
 if (isset($_GET['keyword'])) {
     $parameters = array('keyword' => Security::remove_XSS($_GET['keyword']));
 } elseif (isset($_GET['keyword_code'])) {
     $parameters['keyword_code'] = Security::remove_XSS($_GET['keyword_code']);
     $parameters['keyword_title'] = Security::remove_XSS($_GET['keyword_title']);
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:course_list.php

示例12: api_not_allowed

/**
 * Displays message "You are not allowed here..." and exits the entire script.
 * @param bool   $print_headers    Whether or not to print headers (default = false -> does not print them)
 * @param string $message
 */
function api_not_allowed($print_headers = false, $message = null)
{
    $message = get_lang('NotAllowed');
    throw new Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException($message);
    if (api_get_setting('sso_authentication') === 'true') {
        global $osso;
        if ($osso) {
            $osso->logout();
        }
    }
    $home_url = api_get_path(WEB_PATH);
    $user_id = api_get_user_id();
    $course = api_get_course_id();
    global $this_section;
    if (CustomPages::enabled() && !isset($user_id)) {
        if (empty($user_id)) {
            // Why the CustomPages::enabled() need to be to set the request_uri
            $_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];
        }
        CustomPages::display(CustomPages::INDEX_UNLOGGED);
    }
    $origin = isset($_GET['origin']) ? $_GET['origin'] : '';
    $msg = null;
    if (isset($message)) {
        $msg = $message;
    } else {
        $msg = Display::return_message(get_lang('NotAllowedClickBack') . '<br/><br/><a href="' . $home_url . '">' . get_lang('ReturnToCourseHomepage') . '</a>', 'error', false);
    }
    $msg = Display::div($msg, array('align' => 'center'));
    $show_headers = 0;
    if ($print_headers && $origin != 'learnpath') {
        $show_headers = 1;
    }
    $tpl = new Template(null, $show_headers, $show_headers);
    $tpl->assign('hide_login_link', 1);
    $tpl->assign('content', $msg);
    if ($user_id != 0 && !api_is_anonymous() && (!isset($course) || $course == -1) && empty($_GET['cidReq'])) {
        // if the access is not authorized and there is some login information
        // but the cidReq is not found, assume we are missing course data and send the user
        // to the user_portal
        $tpl->display_one_col_template();
        exit;
    }
    if (!empty($_SERVER['REQUEST_URI']) && (!empty($_GET['cidReq']) || $this_section == SECTION_MYPROFILE || $this_section == SECTION_PLATFORM_ADMIN)) {
        $courseCode = api_get_course_id();
        // Only display form and return to the previous URL if there was a course ID included
        if ($user_id != 0 && !api_is_anonymous()) {
            //if there is a user ID, then the user is not allowed but the session is still there. Say so and exit
            $tpl->assign('content', $msg);
            $tpl->display_one_col_template();
            exit;
        }
        if (!is_null($courseCode)) {
            api_set_firstpage_parameter($courseCode);
        }
        // If the user has no user ID, then his session has expired
        $action = api_get_self() . '?' . Security::remove_XSS($_SERVER['QUERY_STRING']);
        $action = str_replace('&amp;', '&', $action);
        $form = new FormValidator('formLogin', 'post', $action, null, array(), FormValidator::LAYOUT_BOX_NO_LABEL);
        $form->addElement('text', 'login', null, array('placeholder' => get_lang('UserName'), 'class' => 'autocapitalize_off'));
        $form->addElement('password', 'password', null, array('placeholder' => get_lang('Password')));
        $form->addButton('submitAuth', get_lang('LoginEnter'), '', 'primary');
        // see same text in auth/gotocourse.php and main_api.lib.php function api_not_allowed (above)
        $content = Display::return_message(get_lang('NotAllowed'), 'error', false);
        if (!empty($courseCode)) {
            $content .= '<h4>' . get_lang('LoginToGoToThisCourse') . '</h4>';
        }
        if (api_is_cas_activated()) {
            $content .= Display::return_message(sprintf(get_lang('YouHaveAnInstitutionalAccount'), api_get_setting("Institution")), '', false);
            $content .= Display::div("<br/><a href='" . get_cas_direct_URL(api_get_course_id()) . "'>" . sprintf(get_lang('LoginWithYourAccount'), api_get_setting("Institution")) . "</a><br/><br/>", array('align' => 'center'));
            $content .= Display::return_message(get_lang('YouDontHaveAnInstitutionAccount'));
            $content .= "<p style='text-align:center'><a href='#' onclick='\$(this).parent().next().toggle()'>" . get_lang('LoginWithExternalAccount') . "</a></p>";
            $content .= "<div style='display:none;'>";
        }
        $content .= '<div class="well_login">';
        $content .= $form->return_form();
        $content .= '</div>';
        if (api_is_cas_activated()) {
            $content .= "</div>";
        }
        if (!empty($courseCode)) {
            $content .= '<hr/><p style="text-align:center"><a href="' . $home_url . '">' . get_lang('ReturnToCourseHomepage') . '</a></p>';
        } else {
            $content .= '<hr/><p style="text-align:center"><a href="' . $home_url . '">' . get_lang('CampusHomepage') . '</a></p>';
        }
        $tpl->setLoginBodyClass();
        $tpl->assign('content', $content);
        $tpl->display_one_col_template();
        exit;
    }
    if ($user_id != 0 && !api_is_anonymous()) {
        $tpl->display_one_col_template();
        exit;
    }
    $msg = null;
//.........这里部分代码省略.........
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:101,代码来源:api.lib.php

示例13: FormValidator

    /**
     * Adds a form to let users login
     * @version 1.1
     */
    function display_login_form()
    {
        $form = new FormValidator('formLogin', 'POST', null,  null, array('class'=>'form-vertical'));
        $form->addElement('text', 'login', get_lang('UserName'), array('id' => 'login', 'class' => 'span2 user_login_icon autocapitalize_off', 'autofocus' => 'autofocus'));
        $form->addElement('password', 'password', get_lang('Pass'), array('id' => 'password', 'class' => 'span2 user_password_icon'));
        global $_configuration;

        // Captcha
        $allowCaptcha = isset($_configuration['allow_captcha']) ? $_configuration['allow_captcha'] : false;

        if ($allowCaptcha) {

            $useCaptcha = isset($_SESSION['loginFailed']) ? $_SESSION['loginFailed'] : null;

            if ($useCaptcha) {

                $ajax = api_get_path(WEB_AJAX_PATH).'form.ajax.php?a=get_captcha';

                $options = array(
                    'width'        => 250,
                    'height'       => 90,
                    'callback'     => $ajax.'&var='.basename(__FILE__, '.php'),
                    'sessionVar'   => basename(__FILE__, '.php'),
                    'imageOptions' => array(
                        'font_size' => 20,
                        'font_path' => api_get_path(LIBRARY_PATH).'pchart/fonts/',
                        'font_file' => 'tahoma.ttf',
                        //'output' => 'gif'
                    )
                );

                // Minimum options using all defaults (including defaults for Image_Text):
                //$options = array('callback' => 'qfcaptcha_image.php');

                $captcha_question =  $form->addElement('CAPTCHA_Image', 'captcha_question', '', $options);
                $form->addElement('static', null, null, get_lang('ClickOnTheImageForANewOne'));

                $form->addElement('text', 'captcha', get_lang('EnterTheLettersYouSee'));
                $form->addRule('captcha', get_lang('EnterTheCharactersYouReadInTheImage'), 'required', null, 'client');

                $form->addRule('captcha', get_lang('TheTextYouEnteredDoesNotMatchThePicture'), 'CAPTCHA', $captcha_question);
            }
        }

        $form->addElement('style_submit_button','submitAuth', get_lang('LoginEnter'), array('class' => 'btn'));

        $html = $form->return_form();
        // The validation is located in the local.inc
        /*if ($form->validate()) {
            // Prevent re-use of the same CAPTCHA phrase
            $captcha_question->destroy();
        }*/

        if (api_get_setting('openid_authentication') == 'true') {
            include_once 'main/auth/openid/login.php';
            $html .= '<div>'.openid_form().'</div>';
        }
        return $html;
    }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:63,代码来源:userportal.lib.php

示例14: array

                        $form_data['button'] = Display::button('next', get_lang('Go', null, $_user['language']), array('class' => 'btn btn-primary btn-large'));
                    }
                    if (!empty($form_data['action'])) {
                        header('Location: ' . $form_data['action']);
                        exit;
                    }
                }
            }
        }
    }
    $form_register = new FormValidator('form_register', 'post', $form_data['action']);
    if (!empty($form_data['message'])) {
        $form_register->addElement('html', $form_data['message'] . '<br /><br />');
    }
    $form_register->addElement('html', $form_data['button']);
    $text_after_registration .= $form_register->return_form();
    //Just in case
    Session::erase('course_redirect');
    Session::erase('exercise_redirect');
    Display::display_header($tool_name);
    echo Display::page_header($tool_name);
    echo $content;
    echo $text_after_registration;
    if (CustomPages::enabled()) {
        CustomPages::display(CustomPages::REGISTRATION_FEEDBACK, array('info' => $text_after_registration));
    }
} else {
    Display::display_header($tool_name);
    echo Display::page_header($tool_name);
    echo $content;
    // Custom pages
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:inscription.php

示例15: FormValidator

if (count($a_students) > 0) {
    $getLangXDays = get_lang('XDays');
    $form = new FormValidator('reminder_form', 'get', api_get_path(WEB_CODE_PATH) . 'announcements/announcements.php?' . api_get_cidreq(), null, ['style' => 'margin-bottom: 10px'], FormValidator::LAYOUT_INLINE);
    $options = array(2 => sprintf($getLangXDays, 2), 3 => sprintf($getLangXDays, 3), 4 => sprintf($getLangXDays, 4), 5 => sprintf($getLangXDays, 5), 6 => sprintf($getLangXDays, 6), 7 => sprintf($getLangXDays, 7), 15 => sprintf($getLangXDays, 15), 30 => sprintf($getLangXDays, 30), 'never' => get_lang('Never'));
    $el = $form->addSelect('since', Display::returnFontAwesomeIcon('warning') . get_lang('RemindInactivesLearnersSince'), $options, ['class' => 'col-sm-3']);
    $el->setSelected(7);
    $form->addElement('hidden', 'action', 'add');
    $form->addElement('hidden', 'remindallinactives', 'true');
    $form->addElement('hidden', 'cidReq', $courseInfo['code']);
    $form->addElement('hidden', 'id_session', api_get_session_id());
    $form->addButtonSend(get_lang('SendNotification'));
    $extra_field_select = TrackingCourseLog::display_additional_profile_fields();
    if (!empty($extra_field_select)) {
        $html .= $extra_field_select;
    }
    $html .= $form->return_form();
    if ($export_csv) {
        $csv_content = array();
        //override the SortableTable "per page" limit if CSV
        $_GET['users_tracking_per_page'] = 1000000;
    }
    $all_datas = array();
    $course_code = $_course['id'];
    $user_ids = array_keys($a_students);
    $table = new SortableTable('users_tracking', array('TrackingCourseLog', 'get_number_of_users'), array('TrackingCourseLog', 'get_user_data'), (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
    $parameters['cidReq'] = Security::remove_XSS($_GET['cidReq']);
    $parameters['id_session'] = $session_id;
    $parameters['from'] = isset($_GET['myspace']) ? Security::remove_XSS($_GET['myspace']) : null;
    $table->set_additional_parameters($parameters);
    $headers = array();
    // tab of header texts
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:courseLog.php


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