本文整理汇总了PHP中print_collapsible_region_end函数的典型用法代码示例。如果您正苦于以下问题:PHP print_collapsible_region_end函数的具体用法?PHP print_collapsible_region_end怎么用?PHP print_collapsible_region_end使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_collapsible_region_end函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: documentation_html
//.........这里部分代码省略.........
get_string('generalstructure', 'webservice'),
$this->detailed_description_html($paramdesc),
'FFF1BC');
///xml-rpc structure of the argument in PHP format
if (!empty($activatedprotocol['xmlrpc'])) {
$documentationhtml .= $this->colored_box_with_pre_tag(
get_string('phpparam', 'webservice'),
htmlentities('[' . $paramname . '] =>'
. $this->xmlrpc_param_description_html($paramdesc)),
'DFEEE7');
}
///POST format for the REST protocol for the argument
if (!empty($activatedprotocol['rest'])) {
$documentationhtml .= $this->colored_box_with_pre_tag(
get_string('restparam', 'webservice'),
htmlentities($this->rest_param_description_html(
$paramdesc, $paramname)),
'FEEBE5');
}
$documentationhtml .= html_writer::end_tag('span');
}
$documentationhtml .= $br . $br;
/// function response documentation
$documentationhtml .= html_writer::start_tag('span', array('style' => 'color:#EA33A6'));
$documentationhtml .= get_string('response', 'webservice');
$documentationhtml .= html_writer::end_tag('span');
$documentationhtml .= $br;
/// function response description
$documentationhtml .= html_writer::start_tag('span', array('style' => 'font-size:80%'));
if (!empty($description->returns_desc->desc)) {
$documentationhtml .= $description->returns_desc->desc;
$documentationhtml .= $br . $br;
}
if (!empty($description->returns_desc)) {
///general structure of the response
$documentationhtml .= $this->colored_box_with_pre_tag(
get_string('generalstructure', 'webservice'),
$this->detailed_description_html($description->returns_desc),
'FFF1BC');
///xml-rpc structure of the response in PHP format
if (!empty($activatedprotocol['xmlrpc'])) {
$documentationhtml .= $this->colored_box_with_pre_tag(
get_string('phpresponse', 'webservice'),
htmlentities($this->xmlrpc_param_description_html(
$description->returns_desc)),
'DFEEE7');
}
///XML response for the REST protocol
if (!empty($activatedprotocol['rest'])) {
$restresponse = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
. $brakeline . "<RESPONSE>" . $brakeline;
$restresponse .= $this->description_in_indented_xml_format(
$description->returns_desc);
$restresponse .="</RESPONSE>" . $brakeline;
$documentationhtml .= $this->colored_box_with_pre_tag(
get_string('restcode', 'webservice'),
htmlentities($restresponse),
'FEEBE5');
}
}
$documentationhtml .= html_writer::end_tag('span');
$documentationhtml .= $br . $br;
/// function errors documentation for REST protocol
if (!empty($activatedprotocol['rest'])) {
$documentationhtml .= html_writer::start_tag('span', array('style' => 'color:#EA33A6'));
$documentationhtml .= get_string('errorcodes', 'webservice');
$documentationhtml .= html_writer::end_tag('span');
$documentationhtml .= $br . $br;
$documentationhtml .= html_writer::start_tag('span', array('style' => 'font-size:80%'));
$errormessage = get_string('invalidparameter', 'debug');
$restexceptiontext = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<EXCEPTION class="invalid_parameter_exception">
<MESSAGE>{$errormessage}</MESSAGE>
<DEBUGINFO></DEBUGINFO>
</EXCEPTION>
EOF;
$documentationhtml .= $this->colored_box_with_pre_tag(
get_string('restexception', 'webservice'),
htmlentities($restexceptiontext),
'FEEBE5');
$documentationhtml .= html_writer::end_tag('span');
}
$documentationhtml .= $br . $br;
if (empty($printableformat)) {
$documentationhtml .= print_collapsible_region_end(true);
}
}
/// close the table and return the documentation
$documentationhtml .= html_writer::end_tag('td');
$documentationhtml .= html_writer::end_tag('tr');
$documentationhtml .= html_writer::end_tag('table');
return $documentationhtml;
}
示例2: elseif
} elseif ($ownsubmission) {
$PAGE->navbar->add(get_string('mysubmission', 'workshop'));
} else {
$PAGE->navbar->add(get_string('submission', 'workshop'));
}
// Output starts here
$output = $PAGE->get_renderer('mod_workshop');
echo $output->header();
echo $output->heading(format_string($workshop->name), 2);
// show instructions for submitting as thay may contain some list of questions and we need to know them
// while reading the submitted answer
if (trim($workshop->instructauthors)) {
$instructions = file_rewrite_pluginfile_urls($workshop->instructauthors, 'pluginfile.php', $PAGE->context->id, 'mod_workshop', 'instructauthors', 0, workshop::instruction_editors_options($PAGE->context));
print_collapsible_region_start('', 'workshop-viewlet-instructauthors', get_string('instructauthors', 'workshop'));
echo $output->box(format_text($instructions, $workshop->instructauthorsformat, array('overflowdiv' => true)), array('generalbox', 'instructions'));
print_collapsible_region_end();
}
// if in edit mode, display the form to edit the submission
if ($edit) {
if (!empty($CFG->enableplagiarism)) {
require_once $CFG->libdir . '/plagiarismlib.php';
echo plagiarism_print_disclosure($cm->id);
}
$mform->display();
echo $output->footer();
die;
}
// else display the submission
if ($submission->id) {
if ($seenaspublished) {
$showauthor = has_capability('mod/workshop:viewauthorpublished', $workshop->context);
示例3: display
/**
* Output this user_selector as HTML.
* @param boolean $return if true, return the HTML as a string instead of outputting it.
* @return mixed if $return is true, returns the HTML as a string, otherwise returns nothing.
*/
public function display($return = false)
{
global $PAGE;
// Get the list of requested users.
$search = optional_param($this->name . '_searchtext', '', PARAM_RAW);
if (optional_param($this->name . '_clearbutton', false, PARAM_BOOL)) {
$search = '';
}
$groupedusers = $this->find_users($search);
// Output the select.
$name = $this->name;
$multiselect = '';
if ($this->multiselect) {
$name .= '[]';
$multiselect = 'multiple="multiple" ';
}
$output = '<div class="userselector" id="' . $this->name . '_wrapper">' . "\n" . '<select name="' . $name . '" id="' . $this->name . '" ' . $multiselect . 'size="' . $this->rows . '">' . "\n";
// Populate the select.
$output .= $this->output_options($groupedusers, $search);
// Output the search controls.
$output .= "</select>\n<div>\n";
$output .= '<input type="text" name="' . $this->name . '_searchtext" id="' . $this->name . '_searchtext" size="15" value="' . s($search) . '" />';
$output .= '<input type="submit" name="' . $this->name . '_searchbutton" id="' . $this->name . '_searchbutton" value="' . $this->search_button_caption() . '" />';
$output .= '<input type="submit" name="' . $this->name . '_clearbutton" id="' . $this->name . '_clearbutton" value="' . get_string('clear') . '" />';
// And the search options.
$optionsoutput = false;
if (!user_selector_base::$searchoptionsoutput) {
$output .= print_collapsible_region_start('', 'userselector_options', get_string('searchoptions'), 'userselector_optionscollapsed', true, true);
$output .= $this->option_checkbox('preserveselected', $this->preserveselected, get_string('userselectorpreserveselected'));
$output .= $this->option_checkbox('autoselectunique', $this->autoselectunique, get_string('userselectorautoselectunique'));
$output .= $this->option_checkbox('searchanywhere', $this->searchanywhere, get_string('userselectorsearchanywhere'));
$output .= print_collapsible_region_end(true);
$PAGE->requires->js_init_call('M.core_user.init_user_selector_options_tracker', array(), false, self::$jsmodule);
user_selector_base::$searchoptionsoutput = true;
}
$output .= "</div>\n</div>\n\n";
// Initialise the ajax functionality.
$output .= $this->initialise_javascript($search);
// Return or output it.
if ($return) {
return $output;
} else {
echo $output;
}
}
示例4: print_collapsible_region
/**
* Print (or return) a collapsible region, that has a caption that can
* be clicked to expand or collapse the region.
*
* If JavaScript is off, then the region will always be expanded.
*
* @param string $contents the contents of the box.
* @param string $classes class names added to the div that is output.
* @param string $id id added to the div that is output. Must not be blank.
* @param string $caption text displayed at the top. Clicking on this will cause the region to expand or contract.
* @param string $userpref the name of the user preference that stores the user's preferred default state.
* (May be blank if you do not wish the state to be persisted.
* @param boolean $default Initial collapsed state to use if the user_preference it not set.
* @param boolean $return if true, return the HTML as a string, rather than printing it.
* @return string|void If $return is false, returns nothing, otherwise returns a string of HTML.
*/
function print_collapsible_region($contents, $classes, $id, $caption, $userpref = '', $default = false, $return = false)
{
$output = print_collapsible_region_start($classes, $id, $caption, $userpref, $default, true);
$output .= $contents;
$output .= print_collapsible_region_end(true);
if ($return) {
return $output;
} else {
echo $output;
}
}
示例5: render_workshop_random_examples_helper
protected function render_workshop_random_examples_helper(workshop_random_examples_helper $helper) {
$precision = ini_set('precision',4);
$o = '';
$infos = array();
$problems = array();
$titles = workshop_random_examples_helper::$descriptors[count($helper->slices)];
$helptext = $this->output->heading_with_help("What does this mean?","randomexampleshelp",'workshop');
foreach($helper->slices as $i => $s) {
$o .= "<div class='slice' style='background-color: #$s->colour; width: $s->width; left: $s->min%'></div>";
$o .= "<div class='mean' style='background-color: #$s->meancolour; left: $s->mean%'></div>";
$count = count($s->submissions);
$infos[] = "<div class='info'><h3 style='color:#$s->meancolour'>$titles[$i]</h3>Range $s->min% to $s->max% | Average $s->mean%</div>";
if (isset($s->warnings))
$problems = array_merge($problems, $s->warnings);
foreach($s->submissions as $a) {
$o .= "<div class='submission' style='background-color: #$s->subcolour; left:$a->grade%'></div>";
}
}
$problemstr = "";
if (count($problems)) {
$problemstr = print_collapsible_region_start('random-examples-problems','random_examples_problems','Warnings','',true,true);
$problemstr .= "<ul>";
foreach($problems as $p)
$problemstr .= "<li>$p</li>";
$problemstr .= print_collapsible_region_end(true);
$problemstr .= "</ul>";
}
ini_set('precision',$precision);
return "$helptext<div class='random-examples-helper'>$o</div> <div class='random-examples-info'>" . implode($infos) . "</div>$problemstr";
}
示例6: render_workshop_assessment
/**
* Renders the full assessment
*
* @param workshop_assessment $assessment
* @return string HTML
*/
protected function render_workshop_assessment(workshop_assessment $assessment)
{
$o = '';
// output HTML code
$anonymous = is_null($assessment->reviewer);
$classes = 'assessment-full';
if ($anonymous) {
$classes .= ' anonymous';
}
$o .= $this->output->container_start($classes);
$o .= $this->output->container_start('header');
if (!empty($assessment->title)) {
$title = s($assessment->title);
} else {
$title = get_string('assessment', 'workshop');
}
if ($assessment->url instanceof moodle_url and $this->page->url != $assessment->url) {
$o .= $this->output->container(html_writer::link($assessment->url, $title), 'title');
} else {
$o .= $this->output->container($title, 'title');
}
if (!$anonymous) {
$reviewer = $assessment->reviewer;
$userpic = $this->output->user_picture($reviewer, array('courseid' => $this->page->course->id, 'size' => 32));
$userurl = new moodle_url('/user/view.php', array('id' => $reviewer->id, 'course' => $this->page->course->id));
$a = new stdClass();
$a->name = fullname($reviewer);
$a->url = $userurl->out();
$byfullname = get_string('assessmentby', 'workshop', $a);
$oo = $this->output->container($userpic, 'picture');
$oo .= $this->output->container($byfullname, 'fullname');
$o .= $this->output->container($oo, 'reviewer');
}
if (is_null($assessment->realgrade)) {
$o .= $this->output->container(get_string('notassessed', 'workshop'), 'grade nograde');
} else {
$a = new stdClass();
$a->max = $assessment->maxgrade;
$a->received = $assessment->realgrade;
$o .= $this->output->container(get_string('gradeinfo', 'workshop', $a), 'grade');
if (!is_null($assessment->weight) and $assessment->weight != 1) {
$o .= $this->output->container(get_string('weightinfo', 'workshop', $assessment->weight), 'weight');
}
}
$o .= $this->output->container_start('actions');
foreach ($assessment->actions as $action) {
$o .= $this->output->single_button($action->url, $action->label, $action->method);
}
$o .= $this->output->container_end();
// actions
$o .= $this->output->container_end();
// header
if (!is_null($assessment->form)) {
$o .= print_collapsible_region_start('assessment-form-wrapper', uniqid('workshop-assessment'), get_string('assessmentform', 'workshop'), '', false, true);
$o .= $this->output->container(self::moodleform($assessment->form), 'assessment-form');
$o .= print_collapsible_region_end(true);
if (!$assessment->form->is_editable()) {
$o .= $this->overall_feedback($assessment);
}
}
$o .= $this->output->container_end();
// main wrapper
return $o;
}
示例7: print_single_section_page
//.........这里部分代码省略.........
// Reduce number of sections.
$strremovesection = get_string('reducesections', 'moodle');
$url = new moodle_url('/course/changenumsections.php', array('courseid' => $course->id, 'increase' => false, 'sesskey' => sesskey()));
$icon = $this->output->pix_icon('t/switch_minus', $strremovesection);
$tabs[] = new tabobject("tab_topic_remove", $url, $icon, s($strremovesection));
}
}
$sectiontitle .= $OUTPUT->tabtree($tabs, "tab_topic_" . $displaysection, $inactive_tabs);
//print_tabs($tabs, "tab_topic_" . $displaysection, $inactive_tabs, $active_tabs, true);
}
echo $sectiontitle;
if (!$sections[$displaysection]->uservisible && !$canviewhidden) {
if (!$course->hiddensections) {
//Not used more, is controled in /course/view.php
}
// Can't view this section.
} else {
if ($course->realcoursedisplay != COURSE_DISPLAY_MULTIPAGE || $displaysection !== 0) {
// Now the list of sections..
echo $this->start_section_list();
// The requested section page.
$thissection = $sections[$displaysection];
echo $this->section_header($thissection, $course, true);
// Show completion help icon.
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
echo $this->courserenderer->course_section_cm_list($course, $thissection, $displaysection);
echo $this->courserenderer->course_section_add_cm_control($course, $displaysection, $displaysection);
echo $this->section_footer();
echo $this->end_section_list();
}
}
// Display section bottom navigation.
$sectionbottomnav = '';
$sectionbottomnav .= html_writer::start_tag('div', array('class' => 'section-navigation mdl-bottom'));
$sectionbottomnav .= html_writer::tag('span', $sectionnavlinks['previous'], array('class' => 'mdl-left'));
$sectionbottomnav .= html_writer::tag('span', $sectionnavlinks['next'], array('class' => 'mdl-right'));
$sectionbottomnav .= html_writer::end_tag('div');
echo $sectionbottomnav;
// close single-section div.
echo html_writer::end_tag('div');
if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $context)) {
echo '<br class="utilities-separator" />';
print_collapsible_region_start('move-list-box clearfix collapsible mform', 'course_format_onetopic_config_movesection', get_string('utilities', 'format_onetopic'), '', true);
//Move controls
if ($can_move && !empty($move_list_html)) {
echo html_writer::start_div("form-item clearfix");
echo html_writer::start_div("form-label");
echo html_writer::tag('label', get_string('movesectionto', 'format_onetopic'));
echo html_writer::end_div();
echo html_writer::start_div("form-setting");
echo html_writer::tag('ul', $move_list_html, array('class' => 'move-list'));
echo html_writer::end_div();
echo html_writer::start_div("form-description");
echo html_writer::tag('p', get_string('movesectionto_help', 'format_onetopic'));
echo html_writer::end_div();
echo html_writer::end_div();
}
$baseurl = course_get_url($course, $displaysection);
$baseurl->param('sesskey', sesskey());
$url = clone $baseurl;
global $USER, $OUTPUT;
if (isset($USER->onetopic_da[$course->id]) && $USER->onetopic_da[$course->id]) {
$url->param('onetopic_da', 0);
$text_button_disableajax = get_string('enable', 'format_onetopic');
} else {
$url->param('onetopic_da', 1);
$text_button_disableajax = get_string('disable', 'format_onetopic');
}
echo html_writer::start_div("form-item clearfix");
echo html_writer::start_div("form-label");
echo html_writer::tag('label', get_string('disableajax', 'format_onetopic'));
echo html_writer::end_div();
echo html_writer::start_div("form-setting");
echo html_writer::link($url, $text_button_disableajax);
echo html_writer::end_div();
echo html_writer::start_div("form-description");
echo html_writer::tag('p', get_string('disableajax_help', 'format_onetopic'));
echo html_writer::end_div();
echo html_writer::end_div();
//Duplicate current section option
if (has_capability('moodle/course:manageactivities', $context)) {
$url_duplicate = new moodle_url('/course/format/onetopic/duplicate.php', array('courseid' => $course->id, 'section' => $displaysection, 'sesskey' => sesskey()));
$link = new action_link($url_duplicate, get_string('duplicate', 'format_onetopic'));
$link->add_action(new confirm_action(get_string('duplicate_confirm', 'format_onetopic'), null, get_string('duplicate', 'format_onetopic')));
echo html_writer::start_div("form-item clearfix");
echo html_writer::start_div("form-label");
echo html_writer::tag('label', get_string('duplicatesection', 'format_onetopic'));
echo html_writer::end_div();
echo html_writer::start_div("form-setting");
echo $this->render($link);
echo html_writer::end_div();
echo html_writer::start_div("form-description");
echo html_writer::tag('p', get_string('duplicatesection_help', 'format_onetopic'));
echo html_writer::end_div();
echo html_writer::end_div();
}
print_collapsible_region_end();
}
}
示例8: display_advanced_search_form
/**
* Print the "advanced" UI elements for the form to select which questions. Hidden by default.
*/
protected function display_advanced_search_form()
{
print_collapsible_region_start('', 'advancedsearch', get_string('advancedsearchoptions', 'question'), 'question_bank_advanced_search');
foreach ($this->searchconditions as $searchcondition) {
echo $searchcondition->display_options_adv($this);
}
print_collapsible_region_end();
}
示例9: forum_print_posts_nested
function forum_print_posts_nested($course, &$cm, $forum, $discussion, $parent, $reply, $forumtracked, $posts, $parentid = 0, $count = 1, $flag = 0)
{
global $USER, $CFG, $DB;
$link = false;
$modcontext = context_module::instance($cm->id);
if (!empty($posts[$parent->id]->children)) {
$posts = $posts[$parent->id]->children;
foreach ($posts as $post) {
if ((show_discussion($parentid, $forum) and $post->userid != $USER->id and !$flag) && !has_capability('mod/forum:editanypost', $modcontext)) {
continue;
} else {
$flag = 1;
}
echo '<div class="indent">';
if (!isloggedin()) {
$ownpost = false;
} else {
$ownpost = $USER->id == $post->userid;
}
$post->subject = format_string($post->subject);
$postread = !empty($post->postread);
if ($forum->type == 'collaborate' and $post->parent == $parentid) {
$regionid = 'forum-questionview' . $count;
print_collapsible_region_start('', $regionid, get_string('questionview', 'forum'));
forum_print_post($post, $discussion, $forum, $cm, $course, $ownpost, $reply, false, '', '', $postread, true, $forumtracked, false, $parentid);
} else {
forum_print_post($post, $discussion, $forum, $cm, $course, $ownpost, $reply, false, '', '', $postread, true, $forumtracked, false, $parentid);
}
if ($forum->type == 'collaborate') {
$n = $DB->count_records('forum_posts', array('parent' => $post->id));
if ($n == 0) {
print_collapsible_region_end();
}
}
forum_print_posts_nested($course, $cm, $forum, $discussion, $post, $reply, $forumtracked, $posts, $parentid, $count + 1, $flag);
$flag = 0;
echo "</div>\n";
$count = $count + 1;
}
}
}
示例10: end_region
/**
* Returns HTML of the end of collapsible region with trailing content.
*
* @param string $content_after
* @return string
*/
public function end_region($contentafter = '')
{
return "\n" . print_collapsible_region_end(true) . "\n" . $contentafter;
}
示例11: array
////$currentExam .= print_single_button($link, $options, $label, 'get', '', true, '', $disabled);
//$currentExam .= print_container_end(true);
//$currentExam .= "<div id='info_$record->id'></div><br/>";
//$currentExam .= "<hr>";
} else {
echo "Your Exam is OVER2<br />";
//echo date($format,$currentTime)." is after ".date($format,$record->endtime). "<br />";
$cm = $DB->get_record('course_modules', array('course' => $course->id, 'module' => '12', 'id' => $record->quizid));
$quiz = $DB->get_record('quiz', array('id' => $cm->instance));
$caption = "<i>" . $quiz->name . ":</i>";
$id = "prev_" . $record->id;
$prevExam .= print_collapsible_region_start("", $id, $caption, false, true, true);
//$prevExam .= "<b>Your Previous Grades for: </b><i>".$quiz->name.":</i><br/><br/>";
$prevExam .= $record->grade1 . "/" . $quiz->sumgrades;
$prevExam .= " | <a href='{$CFG->wwwroot}/mod/quiz/summary.php?attempt={$record->attemptid}'>Summary</a>";
$prevExam .= print_collapsible_region_end(true);
}
}
}
}
}
$records->close();
// Counter
//echo "<script language='JavaScript'>";
//echo "var countDownInterval=$timeleft;"; //configure refresh interval (in seconds) 1800 = 30 min
//echo "var c_reloadwidth=200;"; //configure width of displayed text, in px (applicable only in NS4)
//echo "</script>";
//echo "<ilayer id='c_reload' width=&{c_reloadwidth}; ><layer id='c_reload2' width=&{c_reloadwidth}; left=0 top=0></layer></ilayer>";
echo $currentExam;
if (!empty($prevExam)) {
echo "<b>Your Previous Grades for: </b>";