本文整理汇总了PHP中print_collapsible_region_start函数的典型用法代码示例。如果您正苦于以下问题:PHP print_collapsible_region_start函数的具体用法?PHP print_collapsible_region_start怎么用?PHP print_collapsible_region_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_collapsible_region_start函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
// Use new context id, it could have been changed.
redirect(new moodle_url('/local/batches/index.php'));
}
if ($editform->is_submitted() && !$editform->is_validated())
$collapse = false;
//$batches = new local_batches();
//$PAGE->navbar->add(get_string('pluginname', 'local_batches'));
echo $OUTPUT->header();
//Heading of the page
echo $OUTPUT->heading(get_string('pluginname', 'local_batches'), '2', 'tmhead2');
print_collapsible_region_start('', 'batches-form', '<button>' . $form_heading . '</button>', false, $collapse);
$editform->display();
print_collapsible_region_end();
if (is_siteadmin()) {
$school = $hierarchy->get_school_items();
$sql = "SELECT c.* FROM {cohort} as c
JOIN {local_batch_map} as map on map.batchid=c.id WHERE contextid = :context";
} else {
$schools = $hierarchy->get_assignedschools();
foreach ($schools as $school) {
$school_id[] = $school->id;
}
$schoolids = implode(',', $school_id);
示例2: 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;
}
}
示例3: documentation_html
/**
* This display all the documentation
* @param array $functions contains all decription objects
* @param array $authparam keys contains 'tokenid'
* @param boolean $printableformat true if we want to display the documentation in a printable format
* @param array $activatedprotocol
* @param string $parenturl url of the calling page - needed for the print button url:
* '/admin/documentation.php' or '/webservice/wsdoc.php' (default)
* @return string the html to diplay
*/
public function documentation_html($functions, $printableformat, $activatedprotocol,
$authparams, $parenturl = '/webservice/wsdoc.php') {
$documentationhtml = $this->output->heading(get_string('wsdocapi', 'webservice'));
$br = html_writer::empty_tag('br', array());
$brakeline = <<<EOF
EOF;
/// Some general information
$docinfo = new stdClass();
$docurl = new moodle_url('http://docs.moodle.org/dev/Creating_a_web_service_client');
$docinfo->doclink = html_writer::tag('a',
get_string('wsclientdoc', 'webservice'), array('href' => $docurl));
$documentationhtml .= html_writer::start_tag('table',
array('style' => "margin-left:auto; margin-right:auto;"));
$documentationhtml .= html_writer::start_tag('tr', array());
$documentationhtml .= html_writer::start_tag('td', array());
$documentationhtml .= get_string('wsdocumentationintro', 'webservice', $docinfo);
$documentationhtml .= $br . $br;
/// Print button
$authparams['print'] = true;
//$parameters = array ('token' => $token, 'wsusername' => $username, 'wspassword' => $password, 'print' => true);
$url = new moodle_url($parenturl, $authparams); // Required
$documentationhtml .= $this->output->single_button($url, get_string('print', 'webservice'));
$documentationhtml .= $br;
/// each functions will be displayed into a collapsible region
//(opened if printableformat = true)
foreach ($functions as $functionname => $description) {
if (empty($printableformat)) {
$documentationhtml .= print_collapsible_region_start('',
'aera_' . $functionname,
html_writer::start_tag('strong', array())
. $functionname . html_writer::end_tag('strong'),
false,
!$printableformat,
true);
} else {
$documentationhtml .= html_writer::tag('strong', $functionname);
$documentationhtml .= $br;
}
/// function global description
$documentationhtml .= $br;
$documentationhtml .= html_writer::start_tag('div',
array('style' => 'border:solid 1px #DEDEDE;background:#E2E0E0;
color:#222222;padding:4px;'));
$documentationhtml .= $description->description;
$documentationhtml .= html_writer::end_tag('div');
$documentationhtml .= $br . $br;
/// function arguments documentation
$documentationhtml .= html_writer::start_tag('span', array('style' => 'color:#EA33A6'));
$documentationhtml .= get_string('arguments', 'webservice');
$documentationhtml .= html_writer::end_tag('span');
$documentationhtml .= $br;
foreach ($description->parameters_desc->keys as $paramname => $paramdesc) {
/// a argument documentation
$documentationhtml .= html_writer::start_tag('span', array('style' => 'font-size:80%'));
if ($paramdesc->required == VALUE_REQUIRED) {
$required = get_string('required', 'webservice');
}
if ($paramdesc->required == VALUE_DEFAULT) {
if ($paramdesc->default === null) {
$default = "null";
} else {
$default = print_r($paramdesc->default, true);
}
$required = get_string('default', 'webservice', $default);
}
if ($paramdesc->required == VALUE_OPTIONAL) {
$required = get_string('optional', 'webservice');
}
$documentationhtml .= html_writer::start_tag('b', array());
$documentationhtml .= $paramname;
$documentationhtml .= html_writer::end_tag('b');
$documentationhtml .= " (" . $required . ")"; // argument is required or optional ?
$documentationhtml .= $br;
$documentationhtml .= " "
. $paramdesc->desc; // argument description
$documentationhtml .= $br . $br;
///general structure of the argument
//.........这里部分代码省略.........
示例4: print_collapsible_region_end
print_collapsible_region_end();
}
}
if (has_capability('mod/workshop:submit', $PAGE->context)) {
print_collapsible_region_start('', 'workshop-viewlet-ownsubmission', get_string('yoursubmission', 'workshop'));
echo $output->box_start('generalbox ownsubmission');
if ($submission = $workshop->get_submission_by_author($USER->id)) {
echo $output->render($workshop->prepare_submission_summary($submission, true));
} else {
echo $output->container(get_string('noyoursubmission', 'workshop'));
}
echo $output->box_end();
print_collapsible_region_end();
}
if (has_capability('mod/workshop:viewpublishedsubmissions', $workshop->context)) {
if ($submissions = $workshop->get_published_submissions()) {
print_collapsible_region_start('', 'workshop-viewlet-publicsubmissions', get_string('publishedsubmissions', 'workshop'));
foreach ($submissions as $submission) {
echo $output->box_start('generalbox submission-summary');
echo $output->render($workshop->prepare_submission_summary($submission, true));
echo $output->box_end();
}
print_collapsible_region_end();
}
}
break;
default:
}
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
echo $output->footer();
示例5: array
echo "<h2 class='tmhead2'>".get_string('pluginname', 'local_positions')."</h2>";
//$positions->print_positionstabs('view', $id = NULL);
$editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes' => $CFG->maxbytes, 'trusttext' => false, 'noclean' => true);
$editform = new positions_form($CFG->wwwroot.'/local/positions/positions.php?id='.$id.'', array('id' => $id, 'tool' => $positions_instance, 'editoroptions' => $editoroptions));
$editform->set_data($positions_instance);
$positionslist = $DB->get_records('local_positions');
if (empty($positionslist)and has_capability('local/positions:manage', $systemcontext)) {
$collapse = false;
// print_error('positionsnotcreated', 'local_positions', $CFG->wwwroot . '/local/positions/positions.php');
}
//if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding and has_capability('local/positions:manage', $systemcontext)) {
// echo $output->box(get_string('allowframembedding', 'local_positions'));
//}
print_collapsible_region_start('', 'positions-form', $form_header,false,$collapse);
$editform->display();
print_collapsible_region_end();
echo $output->departments_view();
echo html_writer::script(' $(document).ready(function() {
$("#department-index").dataTable({
searching: true,
"aaSorting": [],
"lengthMenu": [[5, 10, 25,50,100, -1], [5,10,25, 50,100, "All"]],
"aoColumnDefs": [{ \'bSortable\': false, \'aTargets\': [ 0 ] }]
});
});');
echo $output->footer();
示例6: 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";
}
示例7: print_collapsible_region_start
if((!is_null($costcenter) ||!is_null($jobfunction) ||!is_null($designation) || $supervisor!=0 || !empty($zone) || !empty($branch) || !empty($category) || $role!=0 || !empty($level)) && $mform->is_submitted()){
$collapse =0;
}else{
$collapse=1;
}
if((!is_null($agentdesignation) ||!is_null($city) ||!is_null($state) || $agentsupervisor!=0 || $agentbranchcode!=0 || $agentcode!=0) && $agantmform->is_submitted()){
$collapse_agent =0;
}else{
$collapse_agent=1;
}
//if(($costcenterfullname->fullname=='HR-Global'&&$userroleshortname->shortname=='trainers')||is_siteadmin()){
print_collapsible_region_start('', 'department_job_desigantion-filter', get_string('employeesearch','facetoface'),false,$collapse);
$mform->display();
print_collapsible_region_end();
print_collapsible_region_start('', 'agent_job_desigantion-filter', get_string('agentsearch','facetoface'),false,$collapse_agent);
$agantmform->display();
print_collapsible_region_end();
//}
if(!is_null($costcenter) ||!is_null($jobfunction) ||!is_null($designation) ||$supervisor!=0 || !empty($zone) || !empty($branch) || !empty($category) || $role!=0 || !empty($level)){
$select_to_users=select_to_quizusers($quizid,$costcenter,$jobfunction,$designation,$supervisor,$zone,$branch,$role,$category,$level,$USER->id);
$select_from_users=select_from_quizusers($quizid,$costcenter,$jobfunction,$designation,$supervisor,$zone,$branch,$role,$category,$level,$USER->id);
}
else if(!is_null($agentdesignation) ||!is_null($city) ||!is_null($state) || $agentsupervisor!=0 || $agentbranchcode!=0 || $agentcode!=0){
$select_to_users=select_to_agents_quiz($checklist='newusers',$batchid,$agentcode,$agentdesignation,$state,$agentbranchcode,$agentsupervisor,$city);
$select_from_users=select_to_agents_quiz($checklist='enrolledusers',$batchid,$agentcode,$agentdesignation,$state,$agentbranchcode,$agentsupervisor,$city);
}
示例8: array
}
$host = $hosts[$hostid];
$course = $DB->get_record('mnetservice_enrol_courses', array('id' => $courseid, 'hostid' => $host->id), '*', MUST_EXIST);
echo $OUTPUT->header();
// course name
$icon = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/course'), 'alt' => get_string('category')));
echo $OUTPUT->heading($icon . s($course->fullname));
// collapsible course summary
if (!empty($course->summary)) {
unset($options);
$options->trusted = false;
$options->para = false;
$options->filter = false;
$options->noclean = false;
$options->overflowdiv = true;
print_collapsible_region_start('remotecourse summary', 'remotecourse-summary', get_string('coursesummary'), false, true);
echo format_text($course->summary, $course->summaryformat, $options, $course->id);
print_collapsible_region_end();
}
$error = '';
$lastfetchenrolments = get_config('mnetservice_enrol', 'lastfetchenrolments');
if (!$usecache or empty($lastfetchenrolments) or time() - $lastfetchenrolments > 600) {
// fetch fresh data from remote if we just came from the course selection screen
// or every 10 minutes
$usecache = false;
$result = $service->req_course_enrolments($host->id, $course->remoteid, $usecache);
if ($result !== true) {
$error .= $service->format_error_message($result);
}
}
// user selectors
示例9: start_region
/**
* Returns HTML of a collapsible region (start) with beginning content.
*
* @param string $id
* @param string $more
* @param string $content
* @return string
*/
public function start_region($id, $more, $content = '')
{
return "\n" . print_collapsible_region_start('collapsablefiltered', $id, $more, false, true, true) . "\n" . $content;
}
示例10: get_string
<?php
$currentuserselector->display();
?>
</td>
<td id="buttonscell">
<div id="addcontrols">
<input name="add" id="add" type="submit" value="<?php
echo $THEME->larrow . ' ' . get_string('add');
?>
" title="<?php
print_string('add');
?>
" /><br />
<?php
print_collapsible_region_start('', 'assignoptions', get_string('enrolmentoptions', 'role'), 'assignoptionscollapse', true);
?>
<p><input type="checkbox" name="hidden" id="hidden" value="1" <?php
if ($hidden) {
echo 'checked="checked" ';
}
?>
/>
<label for="hidden" title="<?php
print_string('createhiddenassign', 'role');
?>
">
<?php
print_string('hidden', 'role');
?>
<?php
示例11: require_capability
require_capability('mod/teamwork:view', $PAGE->context);
$teamleader_record = $DB->get_record('teamwork_teammembers', array('userid' => $USER->id, 'teamwork' => $w, 'leader' => 1));
if (empty($teamleader_record)) {
redirect("view.php?id={$cm->id}");
}
if (!empty($teamid) && !empty($memberid) && !empty($teamleader_record)) {
if ($teamleader_record->team == $teamid) {
if ($teamleader_record->userid == $memberid) {
$DB->delete_records('teamwork_team', array('leader' => $memberid, 'teamwork' => $w));
$DB->delete_records('teamwork_teammembers', array('team' => $teamid, 'teamwork' => $w));
} else {
$DB->delete_records('teamwork_teammembers', array('userid' => $memberid, 'team' => $teamid, 'teamwork' => $w));
}
}
}
$teamid = $teamleader_record->team;
$PAGE->set_title(get_string('editteaminfo', 'teamwork'));
$PAGE->set_heading($course->fullname);
$output = $PAGE->get_renderer('mod_teamwork');
/// Output starts here
echo $output->header();
print_collapsible_region_start('', 'teamwork-invitedkey', get_string('invitedkey', 'teamwork'));
$renderable = new teamwork_team_invitedkey($w, $teamid);
echo $output->render($renderable);
print_collapsible_region_end();
print_collapsible_region_start('', 'teamwork-editteaminfo', get_string('editteaminfo', 'teamwork'));
$renderable = new teamwork_team_manage($w, $teamid);
echo $output->render($renderable);
print_collapsible_region_end();
echo $output->footer();
}
示例12: moodle_url
echo $OUTPUT->header();
echo html_writer::link(new moodle_url('/local/costcenter/courses.php'),'Back',array('id'=>'back_tp_course'));
echo $OUTPUT->heading($instancename);
echo html_writer::link(new moodle_url('/local/mass_enroll/mass_enroll.php',array('id'=>$instance->courseid)),'Bulk enrollment',array('id'=>'bulk_enrollment'));
$addenabled = $canenrol ? '' : 'disabled="disabled"';
$removeenabled = $canunenrol ? '' : 'disabled="disabled"';
if(!empty($data->batch) || !empty($data->skillset) || !empty($data->sub_skillset) || !empty($data->position))
$collapse = false;
else
$collapse = true;
print_collapsible_region_start('', 'batches-form', get_string('filter'),false,$collapse);
$filter_form->display();
print_collapsible_region_end();
?>
<form id="assignform" method="post" action="<?php echo $PAGE->url ?>"><div>
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
<table summary="" class="roleassigntable generaltable generalbox boxaligncenter" cellspacing="0">
<tr>
<td id="existingcell">
<p><label for="removeselect"><?php print_string('enrolledusers', 'enrol'); ?></label></p>
<input type="button" id="select_remove_all" name="select_remove_all" value="Select all">
<input type="button" id="select_remove_none" name="select_remove_none" value="Select none">
<?php $currentuserselector->display() ?>
</td>
<td id="buttonscell">
示例13: get_user_preferences
$countsubmissions = $teamwork->count_submissions($USER->id);
$perpage = get_user_preferences('teamwork_perpage', 10);
$pagingbar = new paging_bar($countsubmissions, $page, $perpage, $PAGE->url, 'page');
$submissions = $teamwork->get_submissions($USER->id, $phase, 0, $page * $perpage, $perpage);
$shownames = has_capability('mod/teamwork:viewauthornames', $teamwork->context);
echo $output->render($pagingbar);
foreach ($submissions as $submission) {
echo $output->render($teamwork->prepare_submission_summary($submission, $shownames));
}
echo $output->render($pagingbar);
echo $output->perpage_selector($perpage);
echo $output->single_button("submission.php?teamwork={$w}&instance={$instancerecord->id}", get_string('createsubmission', 'teamwork'), 'get');
echo $output->box_end();
print_collapsible_region_end();
}
print_collapsible_region_start('', 'workshop-viewlet-teamforum', get_string('teamforum', 'teamwork'));
echo $output->box_start('generalbox teamforum');
$associate = $DB->get_record('teamwork_associate_twf', array('course' => $course->id, 'teamwork' => $w));
$assessed = $DB->get_record('twf_discussions', array('userid' => $USER->id, 'teamwork' => $w, 'instance' => $instanceid, 'phase' => $instancerecord->currentphase));
if (!$assessed && (!$ismember || has_capability('mod/teamwork:editsettings', $PAGE->context))) {
//Output the button for add discussion
echo '<div class="singlebutton forumaddnew">';
echo "<form id=\"newdiscussionform\" method=\"get\" action=\"{$CFG->wwwroot}/mod/twf/post.php\">";
echo '<div>';
echo "<input type=\"hidden\" name=\"twf\" value=\"{$associate->twf}\" />";
echo "<input type=\"hidden\" name=\"teamwork\" value=\"{$w}\" />";
echo "<input type=\"hidden\" name=\"instance\" value=\"{$instanceid}\" />";
echo "<input type=\"hidden\" name=\"phase\" value=\"{$instancerecord->currentphase}\" />";
switch ($phaseforum->type) {
case 'news':
case 'blog':
示例14: array
//$currentExam .= print_single_button('url', null, 'Start Exam', 'get', '', true, '', false);
//$currentExam .= "<br/>";
//$currentExam .= print_single_button('url', null, 'Practical Instructions', 'get', '', true, '', false);
//$currentExam .= "<br/>";
////$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>";
示例15: 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();
}
}