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


PHP html_writer::input_hidden_params方法代码示例

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


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

示例1: wrap_html_start

 public function wrap_html_start()
 {
     global $PAGE;
     if ($this->is_downloading() || !$this->candelete) {
         return;
     }
     // Start form
     $url = new moodle_url($this->reporturl, $this->displayoptions);
     $url->param('sesskey', sesskey());
     echo '<div id="tablecontainer">';
     echo '<form id="attemptsform" method="post" action="' . $url->out_omit_querystring() . '>';
     echo html_writer::input_hidden_params($url);
     echo '<div>';
     $PAGE->requires->event_handler('#attemptsform', 'submit', 'M.util.show_confirm_dialog', array('message' => get_string('deleteattemptcheck', 'quiz')));
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:15,代码来源:responses_table.php

示例2: wrap_html_start

 function wrap_html_start(){
     if (!$this->is_downloading()) {
         if ($this->candelete) {
             // Start form
             $url = new moodle_url($this->reporturl, $this->displayoptions);
             echo '<div id="tablecontainer" class="overview-tablecontainer">';
             echo '<form id="attemptsform" method="post" action="' . $this->reporturl->out_omit_querystring() .'">';
             echo '<div style="display: none;">';
             echo html_writer::input_hidden_params($url);
             echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())) . "\n";
             echo '</div>';
             echo '<div>';
         }
     }
 }
开发者ID:nuckey,项目名称:moodle,代码行数:15,代码来源:overview_table.php

示例3: wrap_html_start

 function wrap_html_start()
 {
     if (!$this->is_downloading()) {
         if ($this->candelete) {
             // Start form
             $displayurl = new moodle_url($this->reporturl, $this->displayoptions);
             $strreallydel = addslashes_js(get_string('deleteattemptcheck', 'quiz'));
             echo '<div id="tablecontainer">';
             echo '<form id="attemptsform" method="post" action="' . $displayurl->out_omit_querystring() . '" onsubmit="confirm(\'' . $strreallydel . '\');">';
             echo '<div style="display: none;">';
             echo html_writer::input_hidden_params($displayurl);
             echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())) . "\n";
             echo '</div>';
             echo '<div>';
         }
     }
 }
开发者ID:vuchannguyen,项目名称:web,代码行数:17,代码来源:responses_table.php

示例4: display_question_list

    /**
    * Prints the table of questions in a category with interactions
    *
    * @param object $course   The course object
    * @param int $categoryid  The id of the question category to be displayed
    * @param int $cm      The course module record if we are in the context of a particular module, 0 otherwise
    * @param int $recurse     This is 1 if subcategories should be included, 0 otherwise
    * @param int $page        The number of the page to be displayed
    * @param int $perpage     Number of questions to show per page
    * @param bool $showhidden   True if also hidden questions should be displayed
    * @param bool $showquestiontext whether the text of each question should be shown in the list
    */
    protected function display_question_list($contexts, $pageurl, $categoryandcontext,
            $cm = null, $recurse=1, $page=0, $perpage=100, $showhidden=false,
            $showquestiontext = false, $addcontexts = array()) {
        global $CFG, $DB, $OUTPUT;

        $category = $this->get_current_category($categoryandcontext);

        $cmoptions = new stdClass();
        $cmoptions->hasattempts = !empty($this->quizhasattempts);

        $strselectall = get_string('selectall');
        $strselectnone = get_string('deselectall');
        $strdelete = get_string('delete');

        list($categoryid, $contextid) = explode(',', $categoryandcontext);
        $catcontext = context::instance_by_id($contextid);

        $canadd = has_capability('moodle/question:add', $catcontext);
        $caneditall =has_capability('moodle/question:editall', $catcontext);
        $canuseall =has_capability('moodle/question:useall', $catcontext);
        $canmoveall =has_capability('moodle/question:moveall', $catcontext);

        $this->create_new_question_form($category, $canadd);

        $this->build_query_sql($category, $recurse, $showhidden);
        $totalnumber = $this->get_question_count();
        if ($totalnumber == 0) {
            return;
        }

        $questions = $this->load_page_questions($page, $perpage);

        echo '<div class="categorypagingbarcontainer">';
        $pageing_url = new moodle_url('edit.php');
        $r = $pageing_url->params($pageurl->params());
        $pagingbar = new paging_bar($totalnumber, $page, $perpage, $pageing_url);
        $pagingbar->pagevar = 'qpage';
        echo $OUTPUT->render($pagingbar);
        echo '</div>';

        echo '<form method="post" action="edit.php">';
        echo '<fieldset class="invisiblefieldset" style="display: block;">';
        echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
        echo html_writer::input_hidden_params($pageurl);

        echo '<div class="categoryquestionscontainer">';
        $this->start_table();
        $rowcount = 0;
        foreach ($questions as $question) {
            $this->print_table_row($question, $rowcount);
            $rowcount += 1;
        }
        $this->end_table();
        echo "</div>\n";

        echo '<div class="categorypagingbarcontainer pagingbottom">';
        echo $OUTPUT->render($pagingbar);
        if ($totalnumber > DEFAULT_QUESTIONS_PER_PAGE) {
            if ($perpage == DEFAULT_QUESTIONS_PER_PAGE) {
                $url = new moodle_url('edit.php', array_merge($pageurl->params(), array('qperpage'=>1000)));
                $showall = '<a href="'.$url.'">'.get_string('showall', 'moodle', $totalnumber).'</a>';
            } else {
                $url = new moodle_url('edit.php', array_merge($pageurl->params(), array('qperpage'=>DEFAULT_QUESTIONS_PER_PAGE)));
                $showall = '<a href="'.$url.'">'.get_string('showperpage', 'moodle', DEFAULT_QUESTIONS_PER_PAGE).'</a>';
            }
            echo "<div class='paging'>$showall</div>";
        }
        echo '</div>';

        echo '<div class="modulespecificbuttonscontainer">';
        if ($caneditall || $canmoveall || $canuseall){
            echo '<strong>&nbsp;'.get_string('withselected', 'question').':</strong><br />';

            if (function_exists('module_specific_buttons')) {
                echo module_specific_buttons($this->cm->id,$cmoptions);
            }

            // print delete and move selected question
            if ($caneditall) {
                echo '<input type="submit" name="deleteselected" value="' . $strdelete . "\" />\n";
            }

            if ($canmoveall && count($addcontexts)) {
                echo '<input type="submit" name="move" value="'.get_string('moveto', 'question')."\" />\n";
                question_category_select_menu($addcontexts, false, 0, "$category->id,$category->contextid");
            }

            if (function_exists('module_specific_controls') && $canuseall) {
//.........这里部分代码省略.........
开发者ID:verbazend,项目名称:AWFA,代码行数:101,代码来源:editlib.php

示例5: html_table

    echo $OUTPUT->box(format_module_intro('zoom', $zoom, $cm->id), 'generalbox mod_introbox', 'intro');
}
$table = new html_table();
$table->attributes['class'] = 'generaltable mod_view';
$table->align = array('center', 'left');
$numcolumns = 2;
list($inprogress, $available, $finished) = zoom_get_state($zoom);
if ($available) {
    if ($userishost) {
        $buttonhtml = html_writer::tag('button', $strstart, array('type' => 'submit', 'class' => 'btn btn-success'));
        $aurl = new moodle_url($zoom->start_url);
    } else {
        $buttonhtml = html_writer::tag('button', $strjoin, array('type' => 'submit', 'class' => 'btn btn-primary'));
        $aurl = new moodle_url('/mod/zoom/loadmeeting.php', array('id' => $cm->id));
    }
    $buttonhtml .= html_writer::input_hidden_params($aurl);
    $link = html_writer::tag('form', $buttonhtml, array('action' => $aurl->out_omit_querystring()));
} else {
    $link = html_writer::tag('span', $strunavailable, array('style' => 'font-size:20px'));
}
$title = new html_table_cell($link);
$title->header = true;
$title->colspan = $numcolumns;
$table->data[] = array($title);
$sessionsurl = new moodle_url('/mod/zoom/report.php', array('id' => $cm->id));
$sessionslink = html_writer::link($sessionsurl, get_string('sessions', 'mod_zoom'));
$sessions = new html_table_cell($sessionslink);
$sessions->colspan = $numcolumns;
$table->data[] = array($sessions);
if ($zoom->recurring) {
    $recurringmessage = new html_table_cell(get_string('recurringmeetinglong', 'mod_zoom'));
开发者ID:uofr,项目名称:moodle-mod_zoom,代码行数:31,代码来源:view.php

示例6: array_reverse

        $buttons = $OUTPUT->single_button($url, $caption, 'get');
        $PAGE->set_button($buttons);
    }
    $visiblepathtosection = array_reverse($settingspage->visiblepath);
    $PAGE->set_title("{$SITE->shortname}: " . implode(": ", $visiblepathtosection));
    $PAGE->set_heading($SITE->fullname);
    echo $OUTPUT->header();
    if ($errormsg !== '') {
        echo $OUTPUT->notification($errormsg);
    } else {
        if ($statusmsg !== '') {
            echo $OUTPUT->notification($statusmsg, 'notifysuccess');
        }
    }
    // ---------------------------------------------------------------------------------------------------------------
    echo '<form action="settings.php" method="post" id="adminsettings">';
    echo '<div class="settingsform clearfix">';
    echo html_writer::input_hidden_params($PAGE->url);
    echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
    echo '<input type="hidden" name="return" value="' . $return . '" />';
    echo $OUTPUT->heading($settingspage->visiblename);
    echo $settingspage->output_html();
    if ($settingspage->show_save()) {
        echo '<div class="form-buttons"><input class="form-submit" type="submit" value="' . get_string('savechanges', 'admin') . '" /></div>';
    }
    echo '</div>';
    echo '</form>';
}
$PAGE->requires->yui_module('moodle-core-formchangechecker', 'M.core_formchangechecker.init', array(array('formid' => 'adminsettings')));
$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
echo $OUTPUT->footer();
开发者ID:bobpuffer,项目名称:moodleUCLA-LUTH,代码行数:31,代码来源:settings.php

示例7: display_options

 protected function display_options($recurse, $showhidden, $showquestiontext) {
     echo '<form method="get" action="edit.php" id="displayoptions">';
     echo "<fieldset class='invisiblefieldset'>";
     echo html_writer::input_hidden_params($this->baseurl,
             array('recurse', 'showhidden', 'qbshowtext'));
     $this->display_category_form_checkbox('recurse', $recurse,
             get_string('includesubcategories', 'question'));
     $this->display_category_form_checkbox('showhidden', $showhidden,
             get_string('showhidden', 'question'));
     echo '<noscript><div class="centerpara"><input type="submit" value="' .
             get_string('go') . '" />';
     echo '</div></noscript></fieldset></form>';
 }
开发者ID:nigeli,项目名称:moodle,代码行数:13,代码来源:editlib.php

示例8: addslashes_js

         }
     }
     echo '</div>';
 }
 // Fetch the attempts
 if (!$download) {
     $attempts = $DB->get_records_sql($select . $from . $where . $sort, $params, $table->get_page_start(), $table->get_page_size());
     echo '<div id="scormtablecontainer">';
     if ($candelete) {
         // Start form
         $strreallydel = addslashes_js(get_string('deleteattemptcheck', 'scorm'));
         echo '<form id="attemptsform" method="post" action="' . $reporturlwithdisplayoptions->out(true) . '" onsubmit="return confirm(\'' . $strreallydel . '\');">';
         echo '<input type="hidden" name="action" value="delete"/>';
         echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
         echo '<div style="display: none;">';
         echo html_writer::input_hidden_params($reporturlwithdisplayoptions);
         echo '</div>';
         echo '<div>';
     }
     $table->initialbars($totalinitials > 20);
     // Build table rows
 } else {
     $attempts = $DB->get_records_sql($select . $from . $where . $sort, $params);
 }
 if ($attempts) {
     foreach ($attempts as $scouser) {
         $row = array();
         if (!empty($scouser->attempt)) {
             $timetracks = scorm_get_sco_runtime($scorm->id, false, $scouser->userid, $scouser->attempt);
         }
         if (in_array('checkbox', $columns)) {
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:31,代码来源:report.php

示例9: display_grading_interface

 protected function display_grading_interface($slot, $questionid, $grade, $pagesize, $page, $shownames, $showidnumbers, $order, $counts)
 {
     global $OUTPUT;
     if ($pagesize * $page >= $counts->{$grade}) {
         $page = 0;
     }
     list($qubaids, $count) = $this->get_usage_ids_where_question_in_state($grade, $slot, $questionid, $order, $page, $pagesize);
     $attempts = $this->load_attempts_by_usage_ids($qubaids);
     // Prepare the form.
     $hidden = array('id' => $this->cm->id, 'mode' => 'grading', 'slot' => $slot, 'qid' => $questionid, 'page' => $page);
     if (array_key_exists('includeauto', $this->viewoptions)) {
         $hidden['includeauto'] = $this->viewoptions['includeauto'];
     }
     $mform = new quiz_grading_settings_form($hidden, $counts, $shownames, $showidnumbers);
     // Tell the form the current settings.
     $settings = new stdClass();
     $settings->grade = $grade;
     $settings->pagesize = $pagesize;
     $settings->order = $order;
     $mform->set_data($settings);
     // Print the heading and form.
     echo question_engine::initialise_js();
     $a = new stdClass();
     $a->number = $this->questions[$slot]->number;
     $a->questionname = format_string($counts->name);
     echo $OUTPUT->heading(get_string('gradingquestionx', 'quiz_grading', $a), 3);
     echo html_writer::tag('p', html_writer::link($this->list_questions_url(), get_string('backtothelistofquestions', 'quiz_grading')), array('class' => 'mdl-align'));
     $mform->display();
     // Paging info.
     $a = new stdClass();
     $a->from = $page * $pagesize + 1;
     $a->to = min(($page + 1) * $pagesize, $count);
     $a->of = $count;
     echo $OUTPUT->heading(get_string('gradingattemptsxtoyofz', 'quiz_grading', $a), 3);
     if ($count > $pagesize && $order != 'random') {
         echo $OUTPUT->paging_bar($count, $page, $pagesize, $this->grade_question_url($slot, $questionid, $grade, false));
     }
     // Display the form with one section for each attempt.
     $sesskey = sesskey();
     $qubaidlist = implode(',', $qubaids);
     echo html_writer::start_tag('form', array('method' => 'post', 'action' => $this->grade_question_url($slot, $questionid, $grade, $page), 'class' => 'mform', 'id' => 'manualgradingform')) . html_writer::start_tag('div') . html_writer::input_hidden_params(new moodle_url('', array('qubaids' => $qubaidlist, 'slots' => $slot, 'sesskey' => $sesskey)));
     foreach ($qubaids as $qubaid) {
         $attempt = $attempts[$qubaid];
         $quba = question_engine::load_questions_usage_by_activity($qubaid);
         $displayoptions = quiz_get_review_options($this->quiz, $attempt, $this->context);
         $displayoptions->hide_all_feedback();
         $displayoptions->history = question_display_options::HIDDEN;
         $displayoptions->manualcomment = question_display_options::EDITABLE;
         $heading = $this->get_question_heading($attempt, $shownames, $showidnumbers);
         if ($heading) {
             echo $OUTPUT->heading($heading, 4);
         }
         echo $quba->render_question($slot, $displayoptions, $this->questions[$slot]->number);
     }
     echo html_writer::tag('div', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('saveandnext', 'quiz_grading'))), array('class' => 'mdl-align')) . html_writer::end_tag('div') . html_writer::end_tag('form');
 }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:56,代码来源:report.php

示例10: display


//.........这里部分代码省略.........
             if (!empty($countsql)) {
                 $count = $DB->get_record_sql($countsql, $params);
                 $totalinitials = $count->nbresults;
                 if ($twhere) {
                     $countsql .= ' AND ' . $twhere;
                 }
                 $count = $DB->get_record_sql($countsql, $params);
                 $total = $count->nbresults;
             }
             $table->pagesize($pagesize, $total);
             echo \html_writer::start_div('scormattemptcounts');
             if ($count->nbresults == $count->nbattempts) {
                 echo get_string('reportcountattempts', 'scorm', $count);
             } else {
                 if ($count->nbattempts > 0) {
                     echo get_string('reportcountallattempts', 'scorm', $count);
                 } else {
                     echo $count->nbusers . ' ' . get_string('users');
                 }
             }
             echo \html_writer::end_div();
         }
         // Fetch the attempts.
         if (!$download) {
             $attempts = $DB->get_records_sql($select . $from . $where . $sort, $params, $table->get_page_start(), $table->get_page_size());
             echo \html_writer::start_div('', array('id' => 'scormtablecontainer'));
             if ($candelete) {
                 // Start form.
                 $strreallydel = addslashes_js(get_string('deleteattemptcheck', 'scorm'));
                 echo \html_writer::start_tag('form', array('id' => 'attemptsform', 'method' => 'post', 'action' => $PAGE->url->out(false), 'onsubmit' => 'return confirm("' . $strreallydel . '");'));
                 echo \html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'action', 'value' => 'delete'));
                 echo \html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
                 echo \html_writer::start_div('', array('style' => 'display: none;'));
                 echo \html_writer::input_hidden_params($PAGE->url);
                 echo \html_writer::end_div();
                 echo \html_writer::start_div();
             }
             $table->initialbars($totalinitials > 20);
             // Build table rows.
         } else {
             $attempts = $DB->get_records_sql($select . $from . $where . $sort, $params);
         }
         if ($attempts) {
             foreach ($attempts as $scouser) {
                 $row = array();
                 if (!empty($scouser->attempt)) {
                     $timetracks = scorm_get_sco_runtime($scorm->id, false, $scouser->userid, $scouser->attempt);
                 } else {
                     $timetracks = '';
                 }
                 if (in_array('checkbox', $columns)) {
                     if ($candelete && !empty($timetracks->start)) {
                         $row[] = \html_writer::checkbox('attemptid[]', $scouser->userid . ':' . $scouser->attempt, false);
                     } else {
                         if ($candelete) {
                             $row[] = '';
                         }
                     }
                 }
                 if (in_array('picture', $columns)) {
                     $user = new \stdClass();
                     $additionalfields = explode(',', \user_picture::fields());
                     $user = username_load_fields_from_object($user, $scouser, null, $additionalfields);
                     $user->id = $scouser->userid;
                     $row[] = $OUTPUT->user_picture($user, array('courseid' => $course->id));
                 }
开发者ID:lucaboesch,项目名称:moodle,代码行数:67,代码来源:report.php

示例11: display_question_list

 /**
  * Prints the table of questions in a category with interactions
  *
  * @param array      $contexts    Not used!
  * @param moodle_url $pageurl     The URL to reload this page.
  * @param string     $categoryandcontext 'categoryID,contextID'.
  * @param stdClass   $cm          Not used!
  * @param bool       $recurse     Whether to include subcategories.
  * @param int        $page        The number of the page to be displayed
  * @param int        $perpage     Number of questions to show per page
  * @param bool       $showhidden  whether deleted questions should be displayed.
  * @param bool       $showquestiontext whether the text of each question should be shown in the list. Deprecated.
  * @param array      $addcontexts contexts where the user is allowed to add new questions.
  */
 protected function display_question_list($contexts, $pageurl, $categoryandcontext, $cm = null, $recurse = 1, $page = 0, $perpage = 100, $showhidden = false, $showquestiontext = false, $addcontexts = array())
 {
     global $CFG, $DB, $OUTPUT;
     // This function can be moderately slow with large question counts and may time out.
     // We probably do not want to raise it to unlimited, so randomly picking 5 minutes.
     // Note: We do not call this in the loop because quiz ob_ captures this function (see raise() PHP doc).
     \core_php_time_limit::raise(300);
     $category = $this->get_current_category($categoryandcontext);
     $strselectall = get_string('selectall');
     $strselectnone = get_string('deselectall');
     list($categoryid, $contextid) = explode(',', $categoryandcontext);
     $catcontext = \context::instance_by_id($contextid);
     $canadd = has_capability('moodle/question:add', $catcontext);
     $this->create_new_question_form($category, $canadd);
     $this->build_query();
     $totalnumber = $this->get_question_count();
     if ($totalnumber == 0) {
         return;
     }
     $questions = $this->load_page_questions($page, $perpage);
     echo '<div class="categorypagingbarcontainer">';
     $pageingurl = new \moodle_url('edit.php');
     $r = $pageingurl->params($pageurl->params());
     $pagingbar = new \paging_bar($totalnumber, $page, $perpage, $pageingurl);
     $pagingbar->pagevar = 'qpage';
     echo $OUTPUT->render($pagingbar);
     echo '</div>';
     echo '<form method="post" action="edit.php">';
     echo '<fieldset class="invisiblefieldset" style="display: block;">';
     echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
     echo \html_writer::input_hidden_params($this->baseurl);
     echo '<div class="categoryquestionscontainer">';
     $this->start_table();
     $rowcount = 0;
     foreach ($questions as $question) {
         $this->print_table_row($question, $rowcount);
         $rowcount += 1;
     }
     $this->end_table();
     echo "</div>\n";
     echo '<div class="categorypagingbarcontainer pagingbottom">';
     echo $OUTPUT->render($pagingbar);
     if ($totalnumber > DEFAULT_QUESTIONS_PER_PAGE) {
         if ($perpage == DEFAULT_QUESTIONS_PER_PAGE) {
             $url = new \moodle_url('edit.php', array_merge($pageurl->params(), array('qperpage' => MAXIMUM_QUESTIONS_PER_PAGE)));
             if ($totalnumber > MAXIMUM_QUESTIONS_PER_PAGE) {
                 $showall = '<a href="' . $url . '">' . get_string('showperpage', 'moodle', MAXIMUM_QUESTIONS_PER_PAGE) . '</a>';
             } else {
                 $showall = '<a href="' . $url . '">' . get_string('showall', 'moodle', $totalnumber) . '</a>';
             }
         } else {
             $url = new \moodle_url('edit.php', array_merge($pageurl->params(), array('qperpage' => DEFAULT_QUESTIONS_PER_PAGE)));
             $showall = '<a href="' . $url . '">' . get_string('showperpage', 'moodle', DEFAULT_QUESTIONS_PER_PAGE) . '</a>';
         }
         echo "<div class='paging'>{$showall}</div>";
     }
     echo '</div>';
     $this->display_bottom_controls($totalnumber, $recurse, $category, $catcontext, $addcontexts);
     echo '</fieldset>';
     echo "</form>\n";
 }
开发者ID:Gavinthisisit,项目名称:Moodle,代码行数:75,代码来源:view.php

示例12: subject_review_table

 /**
  * Displays a table containing static data or form for subject reviews
  *
  * Displays a table, with a set of rows for each review.  If $form is true,
  * the rows displayed are generated by each subject review plugin's add_form_rows
  * method.  Otherwise, they are generated by the add_table_rows.
  *
  * If displaying the form, we also add the autosave javascript init call to the page,
  * along with any javascript provided by the plugins.
  *
  * @param array $reviews
  * @param bool $form
  * @param int $displayby A flag passed to the plugins, PROGRESSREVIEW_STUDENT if we're displaying all
  *  subject reviews for a student, or PROGRESSREVIEW_SUBECJT if we're displaying all students' reviews
  *  for a subject
  * @return string HTML for the table
  */
 public function subject_review_table($reviews, $form = true, $displayby = PROGRESSREVIEW_STUDENT)
 {
     $output = '';
     $table = new html_table();
     $table->head = array('', '', get_string('attendance', 'local_progressreview'), get_string('punctuality', 'local_progressreview'), get_string('homework', 'local_progressreview'), get_string('behaviour', 'local_progressreview'), get_string('effort', 'local_progressreview'));
     if ($form) {
         $table->head[] = get_string('minimumgrade', 'local_progressreview');
     }
     $table->head[] = get_string('targetgrade', 'local_progressreview');
     $table->head[] = get_string('performancegrade', 'local_progressreview');
     if (!$form && $displayby == PROGRESSREVIEW_SUBJECT) {
         $table->head[0] = get_string('course');
         $table->head[1] = get_string('teacher', 'local_progressreview');
     }
     $rows = array();
     foreach ($reviews as $review) {
         $student = $review->get_student();
         $session = $review->get_session();
         $plugins = $review->get_plugins();
         if ($form) {
             $idattrs = array('type' => 'hidden', 'id' => 'id_student_' . $review->id, 'value' => $student->id);
             $output .= html_writer::empty_tag('input', $idattrs);
             foreach ($plugins as $pluginnname => $plugin) {
                 $newrows = $plugin->add_form_rows();
                 foreach ($newrows as $newrow) {
                     if (get_class($newrow) != 'html_table_row') {
                         throw new coding_exception('add_form_rows must return an
                             array of html_table_row objects. The ' . $pluginname . ' plugin
                             didn\'t do this.');
                     }
                 }
                 $rows = array_merge($rows, $newrows);
             }
         } else {
             foreach ($plugins as $pluginname => $plugin) {
                 $newrows = $plugin->add_table_rows($displayby);
                 foreach ($newrows as $newrow) {
                     if (get_class($newrow) != 'html_table_row') {
                         throw new coding_exception('add_table_rows must return an
                             array of html_table_row objects. The ' . $pluginname . ' plugin
                             didn\'t do this.');
                     }
                 }
                 $rows = array_merge($rows, $newrows);
             }
         }
     }
     $table->data = $rows;
     $params = array('action' => $this->page->url->out_omit_querystring(), 'method' => 'post');
     if ($form) {
         $output .= html_writer::start_tag('form', $params);
         $output .= html_writer::input_hidden_params($this->page->url);
         $hiddens = array('sessionid' => $review->get_session()->id, 'courseid' => $review->get_course()->originalid, 'teacherid' => $review->get_teacher()->originalid, 'reviewtype' => $review->get_type(), 'editid' => '');
         $hiddenparams = array('type' => 'hidden');
         foreach ($hiddens as $name => $value) {
             $hiddenparams['name'] = $name;
             $hiddenparams['id'] = 'id_' . $name;
             $hiddenparams['value'] = $value;
             $output .= html_writer::empty_tag('input', $hiddenparams);
         }
         $strsave = get_string('savechanges');
         $output .= html_writer::empty_tag('input', array('id' => 'id_save', 'name' => 'submit', 'type' => 'submit', 'value' => $strsave));
         $jsmodule = array('name' => 'local_progressreview', 'fullpath' => '/local/progressreview/module.js', 'requires' => array('base', 'node', 'io', 'io-queue', 'json', 'event-valuechange', 'event-delegate'), 'strings' => array(array('autosaveactive', 'local_progressreview'), array('autosavefailed', 'local_progressreview'), array('autosaving', 'local_progressreview')));
         $this->page->requires->js_init_call('M.local_progressreview.init_autosave', array($strsave), false, $jsmodule);
         foreach ($review->get_plugins() as $plugin) {
             $modulename = 'M.progressreview_' . $plugin->get_name();
             $this->page->requires->js_init_call($modulename . '.init_autosave');
         }
         $output .= $this->progress_indicator();
         $output .= $this->error_indicator();
     }
     $output .= html_writer::table($table);
     if ($form) {
         html_writer::end_tag('form');
     }
     return $output;
 }
开发者ID:rtsfc,项目名称:moodle-local_progressreview,代码行数:94,代码来源:renderer.php

示例13: render_opendesktop_overview

 public function render_opendesktop_overview(opendesktop_overview $data)
 {
     global $USER, $OUTPUT, $PAGE, $CFG;
     $o = '';
     //start own opendesktop
     $formattributes = array('id' => 'opendesktop_sessionlogin', 'class' => 'opendesktopconnect', 'action' => $PAGE->url, 'method' => 'post', 'name' => 'launchopendesktop');
     $formcontent = html_writer::input_hidden_params($data->params['ovdstartlink']['url']);
     $formcontent .= html_writer::select(array('desktopplus' => 'OpenDesktop + Video/Audio', 'portal' => 'Portal (Nur zum Dateiupload)', 'desktop' => 'OpenDesktop ohne Audio/Video'), 'sessionmode', 'desktopplus');
     $formcontent .= html_writer::start_tag('div', array('id' => 'loading_div'));
     $formcontent .= html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('loading', 'opendesktop'), 'alt' => 'Loading...', 'title' => 'Loading...', 'height' => '25', 'width' => '25'));
     $formcontent .= html_writer::end_tag('div');
     $formcontent .= html_writer::start_tag('div', array('class' => 'fail_buttons'));
     $formcontent .= html_writer::empty_tag('input', array('type' => 'button', 'id' => 'failed_button', 'value' => 'ERROR'));
     $formcontent .= html_writer::start_tag('span', array('id' => 'java_download'));
     $formcontent .= html_writer::tag('a', 'Click here to install the free Java-Plugin', array('href' => 'http://www.java.com/download/', 'class' => 'failed', 'target' => '_blank'));
     $formcontent .= html_writer::end_tag('span');
     $formcontent .= html_writer::end_tag('div');
     $formcontent .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'timezone', 'class' => 'timezone', 'value' => ""));
     $formcontent .= html_writer::empty_tag('input', array('type' => 'submit', 'id' => 'launch_button', 'class' => 'launch_button', 'value' => get_string($data->params['ovdstartlink']['buttonmessage'], 'opendesktop')));
     $form = html_writer::tag('form', $formcontent, $formattributes);
     $starthtml = html_writer::tag('h2', get_string('logintoyourdesktop', 'opendesktop'));
     $starthtml .= $data->params['ovdstartlink']['message'];
     $starthtml .= $form;
     $o .= $OUTPUT->box($starthtml);
     //login to opendesktops of other users
     $joinhtml = html_writer::tag('h2', get_string('desktopstojoin', 'opendesktop'));
     if (empty($data->params['availabledesktops'])) {
         $joinhtml .= html_writer::tag('div', get_string('nosession', 'opendesktop'));
         $o .= $OUTPUT->box($joinhtml);
         return $o;
     }
     foreach ($data->params['availabledesktops'] as $username => $desktop) {
         $joinhtml .= html_writer::start_tag('div');
         $joinhtml .= html_writer::tag('h3', get_string('joindesktop', 'opendesktop') . ' ' . $desktop['fullname']);
         if (array_key_exists('active', $desktop)) {
             $joinhtml .= html_writer::tag('a', get_string('joinactive', 'opendesktop'), array('href' => $desktop['active'], 'class' => 'opendesktop_join'));
         }
         if (array_key_exists('passive', $desktop)) {
             $joinhtml .= html_writer::tag('a', get_string('joinviewonly', 'opendesktop'), array('href' => $desktop['passive'], 'class' => 'opendesktop_join'));
         }
         $joinhtml .= html_writer::end_tag('div');
     }
     $data->params['availabledesktops'];
     $o .= $OUTPUT->box($joinhtml);
     return $o;
 }
开发者ID:youprofit,项目名称:moodle-mod_opendesktop,代码行数:46,代码来源:renderer.php

示例14: view_selfregistration


//.........这里部分代码省略.........
                 } else {
                     require_capability('mod/grouptool:register', $this->context);
                     $action = 'reg';
                     $attr['group'] = $agrpid;
                     // Try only!
                     list($error, $confirmmessage) = $this->register_in_agrp($agrpid, $USER->id, true);
                 }
             }
             $attr['confirm'] = '1';
             $attr['action'] = $action;
             $attr['sesskey'] = sesskey();
             $continue = new moodle_url($PAGE->url, $attr);
             $cancel = new moodle_url($PAGE->url);
             if ($error === true && $action != 'resolvequeues') {
                 $continue->remove_params('confirm', 'group');
                 $continue = new single_button($continue, get_string('continue'), 'get');
                 $cancel = null;
             }
             echo $this->confirm($confirmmessage, $continue, $cancel);
         } else {
             $hideform = 0;
         }
     }
     if (empty($hideform)) {
         /*
          * we need a new moodle_url-Object because
          * $PAGE->url->param('sesskey', sesskey());
          * won't set sesskey param in $PAGE->url?!?
          */
         $url = new moodle_url($PAGE->url, array('sesskey' => sesskey()));
         $formattr = array('method' => 'post', 'action' => $url->out_omit_querystring(), 'id' => 'registration_form', 'class' => 'mform');
         echo html_writer::start_tag('form', $formattr);
         echo html_writer::start_tag('div', array('class' => 'clearfix'));
         echo html_writer::input_hidden_params($url);
         $regstat = $this->get_registration_stats($USER->id);
         if (!empty($this->grouptool->timedue) && time() >= $this->grouptool->timedue && has_capability('mod/grouptool:register_students', $this->context)) {
             if ($regstat->queued_users > 0) {
                 // Insert queue-resolving button!
                 $attr = array('type' => 'submit', 'name' => 'resolve_queues', 'value' => '1');
                 $resolvequeuebutton = html_writer::tag('button', get_string('resolve_queue', 'grouptool'), $attr);
                 $resolvequeue = html_writer::tag('div', get_string('resolve_queue_title', 'grouptool'), array('class' => 'fitemtitle')) . html_writer::tag('div', $resolvequeuebutton, array('class' => 'felement'));
                 $resolvequeue = html_writer::tag('div', $resolvequeue, array('class' => 'fitem'));
                 $resolvequeuelegend = html_writer::tag('legend', get_string('resolve_queue_legend', 'grouptool'));
                 $resolvequeueelement = html_writer::tag('div', $resolvequeue, array('class' => 'fcontainer'));
                 echo html_writer::tag('fieldset', $resolvequeuelegend . $resolvequeueelement, array('class' => 'clearfix'));
             }
         }
         if (!empty($this->grouptool->use_size)) {
             $placestats = $regstat->group_places . '&nbsp;' . get_string('total', 'grouptool');
         } else {
             $placestats = '∞&nbsp;' . get_string('total', 'grouptool');
         }
         if ($regstat->free_places != null && !empty($this->grouptool->use_size)) {
             $placestats .= ' / ' . $regstat->free_places . '&nbsp;' . get_string('free', 'grouptool');
         } else {
             $placestats .= ' / ∞&nbsp;' . get_string('free', 'grouptool');
         }
         if ($regstat->occupied_places != null) {
             $placestats .= ' / ' . $regstat->occupied_places . '&nbsp;' . get_string('occupied', 'grouptool');
         }
         $registrationinfo = html_writer::tag('div', get_string('group_places', 'grouptool') . $OUTPUT->help_icon('group_places', 'grouptool'), array('class' => 'fitemtitle')) . html_writer::tag('div', $placestats, array('class' => 'felement'));
         $generalinfo = html_writer::tag('div', $registrationinfo, array('class' => 'fitem'));
         $registrationinfo = html_writer::tag('div', get_string('number_of_students', 'grouptool'), array('class' => 'fitemtitle')) . html_writer::tag('div', $regstat->users, array('class' => 'felement'));
         $generalinfo .= html_writer::tag('div', $registrationinfo, array('class' => 'fitem'));
         if ($this->grouptool->allow_multiple && count($regstat->registered) < $this->grouptool->choose_min || !$this->grouptool->allow_multiple && !count($regstat->registered)) {
             if ($this->grouptool->allow_multiple) {
开发者ID:rimacher,项目名称:moodle-mod_grouptool,代码行数:67,代码来源:locallib.php

示例15: render_attendance_preferences_data

 protected function render_attendance_preferences_data(attendance_preferences_data $prefdata)
 {
     $this->page->requires->js('/mod/attendance/module.js');
     $table = new html_table();
     $table->width = '100%';
     $table->head = array('#', get_string('acronym', 'attendance'), get_string('description'), get_string('grade'), get_string('action'));
     $table->align = array('center', 'center', 'center', 'center', 'center', 'center');
     $i = 1;
     foreach ($prefdata->statuses as $st) {
         $table->data[$i][] = $i;
         $table->data[$i][] = $this->construct_text_input('acronym[' . $st->id . ']', 2, 2, $st->acronym);
         $table->data[$i][] = $this->construct_text_input('description[' . $st->id . ']', 30, 30, $st->description);
         $table->data[$i][] = $this->construct_text_input('grade[' . $st->id . ']', 4, 4, format_float($st->grade));
         $table->data[$i][] = $this->construct_preferences_actions_icons($st, $prefdata);
         $i++;
     }
     $table->data[$i][] = '*';
     $table->data[$i][] = $this->construct_text_input('newacronym', 2, 2);
     $table->data[$i][] = $this->construct_text_input('newdescription', 30, 30);
     $table->data[$i][] = $this->construct_text_input('newgrade', 4, 4);
     $table->data[$i][] = $this->construct_preferences_button(get_string('add', 'attendance'), att_preferences_page_params::ACTION_ADD);
     $o = html_writer::tag('h1', get_string('myvariables', 'attendance'));
     $o .= html_writer::table($table);
     $o .= html_writer::input_hidden_params($prefdata->url(array(), false));
     $o .= $this->construct_preferences_button(get_string('update', 'attendance'), att_preferences_page_params::ACTION_SAVE);
     $o = html_writer::tag('form', $o, array('id' => 'preferencesform', 'method' => 'post', 'action' => $prefdata->url(array(), false)->out_omit_querystring()));
     $o = $this->output->container($o, 'generalbox attwidth');
     return $o;
 }
开发者ID:amitkawasthi,项目名称:moodle-mod_attendance,代码行数:29,代码来源:renderer.php


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