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


PHP Display::select方法代码示例

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


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

示例1: handle_regions

/**
 * This function allows easy activating and inactivating of regions
 * @author Julio Montoya <gugli100@gmail.com> Beeznest 2012
 */
function handle_regions()
{
    if (isset($_POST['submit_plugins'])) {
        store_regions();
        // Add event to the system log.
        $user_id = api_get_user_id();
        $category = $_GET['category'];
        Event::addEvent(LOG_CONFIGURATION_SETTINGS_CHANGE, LOG_CONFIGURATION_SETTINGS_CATEGORY, $category, api_get_utc_datetime(), $user_id);
        Display::display_confirmation_message(get_lang('SettingsStored'));
    }
    $plugin_obj = new AppPlugin();
    $possible_plugins = $plugin_obj->read_plugins_from_path();
    $installed_plugins = $plugin_obj->get_installed_plugins();
    echo '<form name="plugins" method="post" action="' . api_get_self() . '?category=' . Security::remove_XSS($_GET['category']) . '">';
    echo '<table class="data_table">';
    echo '<tr>';
    echo '<th width="400px">';
    echo get_lang('Plugin');
    echo '</th><th>';
    echo get_lang('Regions');
    echo '</th>';
    echo '</th>';
    echo '</tr>';
    /* We display all the possible plugins and the checkboxes */
    $plugin_region_list = array();
    $my_plugin_list = $plugin_obj->get_plugin_regions();
    foreach ($my_plugin_list as $plugin_item) {
        $plugin_region_list[$plugin_item] = $plugin_item;
    }
    // Removing course tool
    unset($plugin_region_list['course_tool_plugin']);
    foreach ($installed_plugins as $plugin) {
        $plugin_info_file = api_get_path(SYS_PLUGIN_PATH) . $plugin . '/plugin.php';
        if (file_exists($plugin_info_file)) {
            $plugin_info = array();
            require $plugin_info_file;
            if (isset($_GET['name']) && $_GET['name'] == $plugin) {
                echo '<tr class="row_selected">';
            } else {
                echo '<tr>';
            }
            echo '<td>';
            echo '<h4>' . $plugin_info['title'] . ' <small>v' . $plugin_info['version'] . '</small></h4>';
            echo '<p>' . $plugin_info['comment'] . '</p>';
            echo '</td><td>';
            $selected_plugins = $plugin_obj->get_areas_by_plugin($plugin);
            if (isset($plugin_info['is_course_plugin']) && $plugin_info['is_course_plugin']) {
                $region_list = array('course_tool_plugin' => 'course_tool_plugin');
            } else {
                $region_list = $plugin_region_list;
            }
            echo Display::select('plugin_' . $plugin . '[]', $region_list, $selected_plugins, array('multiple' => 'multiple', 'style' => 'width:500px'), true, get_lang('None'));
            echo '</td></tr>';
        }
    }
    echo '</table>';
    echo '<br />';
    echo '<button class="btn btn-success" type="submit" name="submit_plugins">' . get_lang('EnablePlugins') . '</button></form>';
}
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:63,代码来源:settings.lib.php

示例2: foreach

    foreach ($question_list as $key => $item) {
        if ($objExercise->feedback_type == EXERCISE_FEEDBACK_TYPE_DIRECT) {
            if (!in_array($key, array(HOT_SPOT_DELINEATION, UNIQUE_ANSWER))) {
                continue;
            }
            $new_question_list[$key] = get_lang($item[1]);
        } else {
            if ($key == HOT_SPOT_DELINEATION) {
                continue;
            }
            $new_question_list[$key] = get_lang($item[1]);
        }
    }
}
// Answer type list
$select_answer_html = Display::select('answerType', $new_question_list, $answerType, array('class' => 'chzn-select', 'onchange' => 'submit_form(this);'), false);
echo Display::form_row(get_lang('AnswerType'), $select_answer_html);
$button = '<button class="save" type="submit" name="name" value="' . get_lang('Filter') . '">' . get_lang('Filter') . '</button>';
echo Display::form_row('', $button);
echo "<input type='hidden' id='course_id_changed' name='course_id_changed' value='0' />";
echo "<input type='hidden' id='exercice_id_changed' name='exercice_id_changed' value='0' />";
?>
</form>
<div class="clear"></div>
<form method="post" action="<?php 
echo $url . '?' . api_get_cidreq() . '&fromExercise=' . $fromExercise;
?>
" >
<?php 
echo '<input type="hidden" name="course_id" value="' . $selected_course . '">';
$mainQuestionList = array();
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:question_pool.php

示例3: toHtml

    /**
     * The ajax call must contain an array of id and text
     * @return string
     */
    function toHtml()
    {
        $html = api_get_asset('select2/dist/js/select2.min.js');
        $iso = api_get_language_isocode(api_get_interface_language());
        $languageCondition = '';
        if (file_exists(api_get_path(SYS_PATH) . "web/assets/select2/dist/js/i18n/{$iso}.js")) {
            $html .= api_get_asset("select2/dist/js/i18n/{$iso}.js");
            $languageCondition = "language: '{$iso}',";
        }
        $html .= api_get_css(api_get_path(WEB_PATH) . 'web/assets/select2/dist/css/select2.min.css');
        $formatResult = $this->getAttribute('formatResult');
        $formatCondition = null;
        if (!empty($formatResult)) {
            $formatCondition = ',
                templateResult : ' . $formatResult . ',
                templateSelection : ' . $formatResult;
        }
        $defaultValues = $this->getAttribute('defaults');
        $defaultValues = empty($defaultValues) ? [] : $defaultValues;
        $width = 'element';
        $givenWidth = $this->getAttribute('width');
        if (!empty($givenWidth)) {
            $width = $givenWidth;
        }
        //Get the minimumInputLength for select2
        $minimumInputLength = $this->getAttribute('minimumInputLength') > 3 ? $this->getAttribute('minimumInputLength') : 3;
        $plHolder = $this->getAttribute('placeholder');
        if (empty($plHolder)) {
            $plHolder = get_lang('SelectAnOption');
        }
        $html .= <<<JS
            <script>
                \$(function(){
                    \$('#{$this->getAttribute('name')}').select2({
                        {$languageCondition}
                        placeholder_: '{$plHolder}',
                        allowClear: true,
                        width: '{$width}',
                        minimumInputLength: '{$minimumInputLength}',
                        // instead of writing the function to execute the request we use Select2s convenient helper
                        ajax: {
                            url: '{$this->getAttribute('url')}',
                            dataType: 'json',
                            data: function(params) {
                                return {
                                    q: params.term, // search term
                                    page_limit: 10,
                                };
                            },
                            processResults: function (data, page) {
                                //parse the results into the format expected by Select2
                                return {
                                    results: data.items
                                };
                            }
                            {$formatCondition}
                        }
                    });
                });
            </script>
JS;
        $html .= Display::select($this->getAttribute('name'), $defaultValues, array_keys($defaultValues), ['id' => $this->getAttribute('name'), 'style' => 'width: 100%;'], false);
        return $html;
    }
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:68,代码来源:SelectAjax.php

示例4: array

    ?>
    <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))">
        <em class="fa fa-arrow-right"></em>
    </button>
    <br /><br />
    <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_in'), document.getElementById('elements_not_in'))" onclick="moveItem(document.getElementById('elements_in'), document.getElementById('elements_not_in'))">
        <em class="fa fa-arrow-left"></em>
    </button>
    <?php 
}
?>
    <br /><br /><br /><br /><br /><br />
  </td>
  <td align="center">
<?php 
echo Display::select('elements_in_name[]', $elements_in, '', array('style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'elements_in', 'size' => '15px'), false);
unset($sessionUsersList);
?>
 </td>
</tr>
<tr>
    <td colspan="3" align="center">
        <br />
        <?php 
echo '<button class="btn btn-primary" type="button" value="" onclick="valide()" >' . get_lang('SubscribeClassToCourses') . '</button>';
?>
    </td>
</tr>
</table>
</form>
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:30,代码来源:add_courses_to_usergroup.php

示例5: array

    ?>
    <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('session_not_in_promotion'), document.getElementById('session_in_promotion'))" onclick="moveItem(document.getElementById('session_not_in_promotion'), document.getElementById('session_in_promotion'))">
        <i class="fa fa-arrow-right"></i>
    </button>
    <br /><br />
    <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('session_in_promotion'), document.getElementById('session_not_in_promotion'))" onclick="moveItem(document.getElementById('session_in_promotion'), document.getElementById('session_not_in_promotion'))">
        <i class="fa fa-arrow-left"></i>
    </button>
    <?php 
}
?>
    <br /><br /><br /><br /><br /><br />
  </td>
  <td align="center">
<?php 
echo Display::select('session_in_promotion_name[]', $session_in_promotion, '', array('style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'session_in_promotion', 'size' => '15px'), false);
unset($sessionUsersList);
?>
 </td>
</tr>
<tr>
    <td colspan="3" align="center">
        <br />
        <?php 
echo '<button class="btn btn-primary" type="button" value="" onclick="valide()" >' . get_lang('SubscribeSessionsToPromotion') . '</button>';
?>
    </td>
</tr>
</table>
</form>
<script>
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:add_sessions_to_promotion.php

示例6: showQuestion

    /**
     * Shows a question
     *
     * @param int    $questionId question id
     * @param bool   $only_questions if true only show the questions, no exercise title
     * @param bool   $origin  i.e = learnpath
     * @param string $current_item current item from the list of questions
     * @param bool   $show_title
     * @param bool   $freeze
     * @param array  $user_choice
     * @param bool   $show_comment
     * @param bool   $exercise_feedback
     * @param bool   $show_answers
     * */
    public static function showQuestion($questionId, $only_questions = false, $origin = false, $current_item = '', $show_title = true, $freeze = false, $user_choice = array(), $show_comment = false, $exercise_feedback = null, $show_answers = false)
    {
        $course_id = api_get_course_int_id();
        // Change false to true in the following line to enable answer hinting
        $debug_mark_answer = $show_answers;
        // Reads question information
        if (!($objQuestionTmp = Question::read($questionId))) {
            // Question not found
            return false;
        }
        if ($exercise_feedback != EXERCISE_FEEDBACK_TYPE_END) {
            $show_comment = false;
        }
        $answerType = $objQuestionTmp->selectType();
        $pictureName = $objQuestionTmp->selectPicture();
        $s = '';
        if ($answerType != HOT_SPOT && $answerType != HOT_SPOT_DELINEATION) {
            // Question is not a hotspot
            if (!$only_questions) {
                $questionDescription = $objQuestionTmp->selectDescription();
                if ($show_title) {
                    TestCategory::displayCategoryAndTitle($objQuestionTmp->id);
                    echo Display::div($current_item . '. ' . $objQuestionTmp->selectTitle(), array('class' => 'question_title'));
                }
                if (!empty($questionDescription)) {
                    echo Display::div($questionDescription, array('class' => 'question_description'));
                }
            }
            if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION)) && $freeze) {
                return '';
            }
            echo '<div class="question_options row">';
            // construction of the Answer object (also gets all answers details)
            $objAnswerTmp = new Answer($questionId);
            $nbrAnswers = $objAnswerTmp->selectNbrAnswers();
            $quiz_question_options = Question::readQuestionOption($questionId, $course_id);
            // For "matching" type here, we need something a little bit special
            // because the match between the suggestions and the answers cannot be
            // done easily (suggestions and answers are in the same table), so we
            // have to go through answers first (elems with "correct" value to 0).
            $select_items = array();
            //This will contain the number of answers on the left side. We call them
            // suggestions here, for the sake of comprehensions, while the ones
            // on the right side are called answers
            $num_suggestions = 0;
            if (in_array($answerType, [MATCHING, DRAGGABLE, MATCHING_DRAGGABLE])) {
                if ($answerType == DRAGGABLE) {
                    $s .= '<div class="col-md-12 ui-widget ui-helper-clearfix">
                        <div class="clearfix">
                        <ul class="exercise-draggable-answer ui-helper-reset ui-helper-clearfix">';
                } else {
                    $s .= '<div id="drag' . $questionId . '_question" class="drag_question">
                           <table class="data_table">';
                }
                // Iterate through answers
                $x = 1;
                //mark letters for each answer
                $letter = 'A';
                $answer_matching = array();
                $cpt1 = array();
                for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
                    $answerCorrect = $objAnswerTmp->isCorrect($answerId);
                    $numAnswer = $objAnswerTmp->selectAutoId($answerId);
                    if ($answerCorrect == 0) {
                        // options (A, B, C, ...) that will be put into the list-box
                        // have the "correct" field set to 0 because they are answer
                        $cpt1[$x] = $letter;
                        $answer_matching[$x] = $objAnswerTmp->selectAnswerByAutoId($numAnswer);
                        $x++;
                        $letter++;
                    }
                }
                $i = 1;
                $select_items[0]['id'] = 0;
                $select_items[0]['letter'] = '--';
                $select_items[0]['answer'] = '';
                foreach ($answer_matching as $id => $value) {
                    $select_items[$i]['id'] = $value['id_auto'];
                    $select_items[$i]['letter'] = $cpt1[$id];
                    $select_items[$i]['answer'] = $value['answer'];
                    $i++;
                }
                $user_choice_array_position = array();
                if (!empty($user_choice)) {
                    foreach ($user_choice as $item) {
                        $user_choice_array_position[$item['position']] = $item['answer'];
//.........这里部分代码省略.........
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:101,代码来源:exercise.lib.php

示例7: showQuestion

    /**
     * Shows a question
     *
     * @param int    $questionId question id
     * @param bool   $only_questions if true only show the questions, no exercise title
     * @param bool   $origin  i.e = learnpath
     * @param string $current_item current item from the list of questions
     * @param bool   $show_title
     * @param bool   $freeze
     * @param array  $user_choice
     * @param bool   $show_comment
     * @param bool   $exercise_feedback
     * @param bool   $show_answers
     * */
    public static function showQuestion($questionId, $only_questions = false, $origin = false, $current_item = '', $show_title = true, $freeze = false, $user_choice = array(), $show_comment = false, $exercise_feedback = null, $show_answers = false)
    {
        $course_id = api_get_course_int_id();
        // Change false to true in the following line to enable answer hinting
        $debug_mark_answer = $show_answers;
        // Reads question information
        if (!($objQuestionTmp = Question::read($questionId))) {
            // Question not found
            return false;
        }
        if ($exercise_feedback != EXERCISE_FEEDBACK_TYPE_END) {
            $show_comment = false;
        }
        $answerType = $objQuestionTmp->selectType();
        $pictureName = $objQuestionTmp->selectPicture();
        $s = '';
        if ($answerType != HOT_SPOT && $answerType != HOT_SPOT_DELINEATION) {
            // Question is not a hotspot
            if (!$only_questions) {
                $questionDescription = $objQuestionTmp->selectDescription();
                if ($show_title) {
                    TestCategory::displayCategoryAndTitle($objQuestionTmp->id);
                    echo Display::div($current_item . '. ' . $objQuestionTmp->selectTitle(), array('class' => 'question_title'));
                }
                if (!empty($questionDescription)) {
                    echo Display::div($questionDescription, array('class' => 'question_description'));
                }
            }
            if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION)) && $freeze) {
                return '';
            }
            echo '<div class="question_options row">';
            // construction of the Answer object (also gets all answers details)
            $objAnswerTmp = new Answer($questionId);
            $nbrAnswers = $objAnswerTmp->selectNbrAnswers();
            $quiz_question_options = Question::readQuestionOption($questionId, $course_id);
            // For "matching" type here, we need something a little bit special
            // because the match between the suggestions and the answers cannot be
            // done easily (suggestions and answers are in the same table), so we
            // have to go through answers first (elems with "correct" value to 0).
            $select_items = array();
            //This will contain the number of answers on the left side. We call them
            // suggestions here, for the sake of comprehensions, while the ones
            // on the right side are called answers
            $num_suggestions = 0;
            if (in_array($answerType, [MATCHING, DRAGGABLE, MATCHING_DRAGGABLE])) {
                if ($answerType == DRAGGABLE) {
                    $s .= '<div class="col-md-12 ui-widget ui-helper-clearfix">
                        <div class="clearfix">
                        <ul class="exercise-draggable-answer ui-helper-reset ui-helper-clearfix">';
                } else {
                    $s .= <<<HTML
                        <div id="drag{$questionId}_question" class="drag_question">
                            <table class="data_table">
HTML;
                }
                // Iterate through answers
                $x = 1;
                //mark letters for each answer
                $letter = 'A';
                $answer_matching = array();
                $cpt1 = array();
                for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
                    $answerCorrect = $objAnswerTmp->isCorrect($answerId);
                    $numAnswer = $objAnswerTmp->selectAutoId($answerId);
                    if ($answerCorrect == 0) {
                        // options (A, B, C, ...) that will be put into the list-box
                        // have the "correct" field set to 0 because they are answer
                        $cpt1[$x] = $letter;
                        $answer_matching[$x] = $objAnswerTmp->selectAnswerByAutoId($numAnswer);
                        $x++;
                        $letter++;
                    }
                }
                $i = 1;
                $select_items[0]['id'] = 0;
                $select_items[0]['letter'] = '--';
                $select_items[0]['answer'] = '';
                foreach ($answer_matching as $id => $value) {
                    $select_items[$i]['id'] = $value['id'];
                    $select_items[$i]['letter'] = $cpt1[$id];
                    $select_items[$i]['answer'] = $value['answer'];
                    $i++;
                }
                $user_choice_array_position = array();
                if (!empty($user_choice)) {
//.........这里部分代码省略.........
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:101,代码来源:exercise.lib.php

示例8: get_lang

echo get_lang('Sessions');
?>
 :</b>
            </td>
        </tr>
        <tr>
            <td align="center">
                <?php 
echo Display::select('sessions[]', $sessionList, '', array('style' => 'width:100%', 'multiple' => 'multiple', 'id' => 'sessions', 'size' => '15px'), false);
?>
            </td>
            <td align="center">
            </td>
            <td align="center">
                <?php 
echo Display::select('sessions_destination[]', $sessionList, '', array('style' => 'width:100%', 'id' => 'courses', 'size' => '15px'), false);
?>
            </td>
        </tr>
        <tr>
            <td colspan="3" align="center">
                <br />
                <?php 
echo '<button class="save" type="submit"" >' . get_lang('SubscribeStudentsToSession') . '</button>';
?>
            </td>
        </tr>
    </table>
</form>
<script>
    function moveItem(origin , destination) {
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:add_students_to_session.php

示例9: get_lang

        </button>
        <br /><br />
        <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_in'), document.getElementById('elements_not_in'))" onclick="moveItem(document.getElementById('elements_in'), document.getElementById('elements_not_in'))">
            <i class="fa fa-arrow-left"></i>
        </button>
        </div>
    </div>
    <div class="col-md-5">
        <div class="multiple_select_header">
            <b><?php 
echo get_lang('UsersInGroup');
?>
 :</b>
        </div>
    <?php 
echo Display::select('elements_in_name[]', $elements_in, '', array('class' => 'col-md-7', 'multiple' => 'multiple', 'id' => 'elements_in', 'size' => '15px'), false);
unset($sessionUsersList);
?>
    </div>
</div>

<?php 
echo '<button class="btn btn-primary" type="button" value="" onclick="valide()" ><i class="fa fa-check"></i>' . get_lang('SubscribeUsersToClass') . '</button>';
?>
</form>
<script>
function moveItem(origin , destination) {
    for(var i = 0 ; i<origin.options.length ; i++) {
        if(origin.options[i].selected) {
            destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
            origin.options[i]=null;
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:add_users_to_usergroup.php

示例10: intval

/* For licensing terms, see /license.txt */
/**
 * @package chamilo.plugin.ticket
 */
/**
 * Init section
 */
require_once '../config.php';
$plugin = TicketPlugin::create();
$userId = intval($_GET['user_id']);
$userInfo = api_get_user_info($userId);
$coursesList = CourseManager::get_courses_list_by_user_id($userId, false, true);
$arrCourseList = array(get_lang('Select'));
//Course List
foreach ($coursesList as $key => $course) {
    $courseInfo = CourseManager::get_course_information($course['code']);
    $arrCourseList[$courseInfo['code']] = $courseInfo['title'];
}
//End Course List
$userLabel = Display::tag('label', get_lang('User'), array('class' => 'control-label'));
$personName = api_get_person_name($userInfo['firstname'], $userInfo['lastname']);
$userInput = Display::tag('input', '', array('disabled' => 'disabled', 'type' => 'text', 'value' => $personName));
$userControl = Display::div($userInput, array('class' => 'controls'));
$courseLabel = Display::tag('label', get_lang('Course'), array('class' => 'control-label'));
$courseSelect = Display::select('course_id', $arrCourseList, 0, array(), false);
$courseControl = Display::div($courseSelect, array('class' => 'controls'));
$userDiv = Display::div($userLabel . " " . $userControl, array('class' => 'control-group'));
$courseDiv = Display::div($courseLabel . " " . $courseControl, array('class' => 'control-group'));
echo $userDiv;
echo $courseDiv;
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:30,代码来源:course_user_list.php

示例11: get_lang

echo get_lang('Courses');
?>
 :</b>
        </td>
    </tr>
    <tr>
        <td align="center">
            <?php 
echo Display::select('sessions[]', $sessionList, '', array('style' => 'width:360px', 'multiple' => 'multiple', 'id' => 'sessions', 'size' => '15px'), false);
?>
        </td>
        <td align="center">
        </td>
        <td align="center">
            <?php 
echo Display::select('courses[]', $courseOptions, '', array('style' => 'width:360px', 'id' => 'courses', 'size' => '15px'), false);
?>
        </td>
    </tr>
    <tr>
        <td colspan="3" align="center">
            <br />
            <?php 
echo '<button class="btn btn-success" type="submit">' . get_lang('SubscribeTeachersToSession') . '</button>';
?>
        </td>
    </tr>
</table>
</form>
<?php 
Display::display_footer();
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:add_teachers_to_session.php


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