本文整理汇总了PHP中core_text::strtotitle方法的典型用法代码示例。如果您正苦于以下问题:PHP core_text::strtotitle方法的具体用法?PHP core_text::strtotitle怎么用?PHP core_text::strtotitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core_text
的用法示例。
在下文中一共展示了core_text::strtotitle方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: definition
/**
* Defines forms elements
*/
public function definition()
{
global $COURSE, $DB, $CFG;
$criteria = $this->_customdata['criteria'];
$context = $this->_customdata['context'];
$cmid = $this->_customdata['id'];
$emarking = $this->_customdata['emarking'];
$action = $this->_customdata['action'];
$totalpages = $this->_customdata['totalpages'];
$mform = $this->_form;
// Add header.
$mform->addElement('header', 'general', $action === 'addmarkers' ? get_string('assignmarkerstocriteria', 'mod_emarking') : get_string('assignpagestocriteria', 'mod_emarking'));
// Hide course module id.
$mform->addElement('hidden', 'id', $cmid);
$mform->setType('id', PARAM_INT);
// Hide action.
$mform->addElement('hidden', 'action', $action);
$mform->setType('action', PARAM_ALPHA);
$mform->addElement('html', '<table class="addmarkerstable"><tr><td>');
if ($action === "addmarkers") {
// Array of motives for regrading.
$markers = get_enrolled_users($context, 'mod/assign:grade');
$chkmarkers = array();
foreach ($markers as $marker) {
$chkmarkers[$marker->id] = $marker->firstname . " " . $marker->lastname;
}
$select = $mform->addElement('select', 'datamarkers', get_string('markers', 'mod_emarking'), $chkmarkers, null);
$select->setMultiple(true);
} else {
$chkpages = array();
for ($i = 1; $i <= $totalpages; $i++) {
$chkpages[$i] = get_string('page', 'mod_emarking') . " " . $i;
}
$select = $mform->addElement('select', 'datapages', core_text::strtotitle(get_string('pages', 'mod_emarking')), $chkpages, null);
$select->setMultiple(true);
}
$criteriaitems = array();
foreach ($criteria as $criterion) {
$criteriaitems[$criterion['id']] = $criterion['description'];
}
$mform->addElement('html', '</td><td>');
if ($action === "addmarkers") {
$select = $mform->addElement('select', 'criteriamarkers', get_string('criteria', 'mod_emarking'), $criteriaitems, null);
} else {
$select = $mform->addElement('select', 'criteriapages', get_string('criteria', 'mod_emarking'), $criteriaitems, null);
}
$select->setMultiple(true);
$mform->addElement('html', '</td></tr></table>');
// Add action buttons.
$this->add_action_buttons();
}
示例2: count
$nummarkers = count($markers);
$mids = array();
foreach ($markers as $m) {
$mids[] = $m->id;
}
$mids = implode(",", $mids);
$criteriaxdrafts = $numcriteria * $numdrafts;
$sqlnumcomments = "\n\t SELECT\n\t USERS.userid,\n\t cc.totalcomments,\n\t (cc.totalcomments / {$criteriaxdrafts}) * 100 AS percentage\n\t FROM\n\t (SELECT\n\t u.id AS userid\n\t FROM {user} u\n\t WHERE u.id IN ({$mids})) USERS\n\t LEFT JOIN (\n\t\t\t\tSELECT ed.teacher as markerid,\n\t\t\t\t count(ec.id) AS totalcomments\n\t\t\t\tFROM {emarking_comment} ec\n\t\t\t\tINNER JOIN {emarking_draft} ed on (ec.draft=ed.id AND ed.emarkingid=?)\n\t\t\t\tWHERE ec.criterionid > 0 AND ec.levelid > 0\n\t\t\t\tGROUP BY ed.teacher) AS cc\n\t\t ON (USERS.userid=cc.markerid)\n\t\t ORDER BY userid ASC";
if ($numcomments = $DB->get_records_sql($sqlnumcomments, array($emarking->id))) {
$markercount = 0;
$totalprogress = 0;
foreach ($numcomments as $data) {
$markercount++;
$userprogress = "";
if ($USER->id == $data->userid) {
$userprogress = core_text::strtotitle(get_string('yourself'));
$userpercentage = $data->percentage;
} else {
$marker = $DB->get_record("user", array("id" => $data->userid));
$userprogress = $OUTPUT->user_picture($marker, array("size" => 24, "popup" => true));
}
$array[] = $userprogress . " " . floor($data->percentage) . "%";
$totalprogress += $data->totalcomments;
}
$chartstable->data[] = $array;
if (is_siteadmin($USER) || $issupervisor) {
$nummarkers = 1;
}
$generalprogress = floor($totalprogress / ($numcriteria * $nummarkers * $numdrafts) * 100);
if ($generalprogress == 100 && intval($emarking->firststagedate) < time()) {
$urldelphi = new moodle_url('/mod/emarking/marking/delphi.php', array('id' => $cm->id));
示例3: test_strtotitle
/**
* Tests the static strtotitle method.
*/
public function test_strtotitle()
{
$str = "žluťoučký koníček";
$this->assertSame("Žluťoučký Koníček", core_text::strtotitle($str));
}
示例4: get_string
$examstable->rowclasses[$current] = 'examislate';
}
}
$notification = $exam->notified ? $OUTPUT->pix_icon('t/approve', get_string('printnotificationsent', 'mod_emarking')) : '<a href="' . $CFG->wwwroot . '/mod/emarking/print/sendprintnotification.php?id=' . $exam->id . '">' . $OUTPUT->pix_icon('i/email', get_string('printsendnotification', 'mod_emarking')) . '</a>';
$enrolments = html_writer::start_tag("div", array("class" => "printdetails"));
$enrolments .= emarking_enrolments_div($exam);
$enrolments .= html_writer::end_tag("div");
$examstable->data[] = array(date("l jS F g:ia", $exam->examdate), $exam->name, $OUTPUT->action_link($urlcourse, $exam->coursefullname), $exam->category . '<br/>' . $enrolments, $OUTPUT->action_link($urlprofile, $exam->userfullname), '$' . number_format($exam->cost) . $OUTPUT->action_icon($urlcost, new pix_icon("i/edit", get_string("downloadform", "mod_emarking"))), $statusicon == 1 ? emarking_time_ago($exam->timecreated) : emarking_time_ago($exam->printdate), $statusicon == 1 ? $pagestoprint : $actions, $statusicon == 1 ? $actions : $notification);
$current++;
}
echo $OUTPUT->header();
echo $OUTPUT->heading($pagetitle . ' ' . $category->name);
$activetab = $statusicon == 1 ? 'printorders' : 'printordershistory';
echo $OUTPUT->tabtree(emarking_printoders_tabs($category), $activetab);
if (count($exams) > 0) {
echo core_text::strtotitle(get_string("filter")) . " ";
echo html_writer::tag("input", null, array("id" => "searchInput"));
echo html_writer::table($examstable);
// Print the table.
echo $OUTPUT->paging_bar($examscount, $page, $perpage, $CFG->wwwroot . '/mod/emarking/print/printorders.php?category=' . $categoryid . '&status=' . $statusicon . '&page=');
} else {
echo $OUTPUT->notification(get_string('noexamsforprinting', 'mod_emarking'), 'notifyproblem');
}
$downloadurl = new moodle_url('/mod/emarking/print/download.php');
if ($CFG->emarking_usesms) {
$message = get_string('smsinstructions', 'mod_emarking', $USER);
} else {
$message = get_string('emailinstructions', 'mod_emarking', $USER);
}
?>
<script type="text/javascript">
示例5: explode
$pageshtml = "";
if ($d->pages) {
$pages = explode(",", $d->pages);
foreach ($pages as $page) {
$urldeletesingle = new moodle_url('/mod/emarking/marking/pages.php', array('id' => $cm->id, 'criterion' => $d->id, 'page' => $page, 'action' => 'deletepagesingle'));
$pageshtml .= $OUTPUT->box($page . html_writer::link($urldeletesingle, "X", array("class" => "deletewidget")), "pagecriterionbox widget");
}
$pageshtml .= $OUTPUT->action_link($urldelete, get_string("deleterow", "mod_emarking"), null, array("class" => "rowactions"));
}
$row = array();
$row[] = $d->description;
$row[] = $pageshtml;
$data[] = $row;
}
$table = new html_table();
$table->head = array(get_string("criterion", "mod_emarking"), core_text::strtotitle(get_string("pages", "mod_emarking")));
$table->colclasses = array(null, null);
$table->data = $data;
$nummarkerscriteria = $DB->count_records("emarking_marker_criterion", array("emarking" => $emarking->id));
echo $OUTPUT->heading(get_string("currentstatus", "mod_emarking"), 4);
if ($nummarkerscriteria == 0 && $numpagescriteria == 0) {
echo $OUTPUT->box(get_string("markerscanseewholerubric", "mod_emarking"));
echo $OUTPUT->box(get_string("markerscanseeallpages", "mod_emarking"));
} else {
if ($nummarkerscriteria > 0 && $numpagescriteria == 0) {
echo $OUTPUT->box(get_string("markerscanseeselectedcriteria", "mod_emarking"));
echo $OUTPUT->box(get_string("markerscanseeallpages", "mod_emarking"));
} else {
if ($nummarkerscriteria == 0 && $numpagescriteria > 0) {
echo $OUTPUT->notification(get_string("markerscanseenothing", "mod_emarking"), "notifyproblem");
} else {
示例6: make_display_name
/**
* Prepares tag name ready to be displayed
*
* @param stdClass|core_tag_tag $tag record from db table tag, must contain properties name and rawname
* @param bool $ashtml (default true) if true will return htmlspecialchars encoded string
* @return string
*/
public static function make_display_name($tag, $ashtml = true)
{
global $CFG;
if (empty($CFG->keeptagnamecase)) {
// This is the normalized tag name.
$tagname = core_text::strtotitle($tag->name);
} else {
// Original casing of the tag name.
$tagname = $tag->rawname;
}
// Clean up a bit just in case the rules change again.
$tagname = clean_param($tagname, PARAM_TAG);
return $ashtml ? htmlspecialchars($tagname) : $tagname;
}
示例7: stdClass
$row[] = $thisdate->format('M');
if (isset($data[$y][$m])) {
$row[] = $data[$y][$m]['pages'];
$row[] = $data[$y][$m]['exams'];
$row[] = $data[$y][$m]['courses'];
} else {
$row[] = 0;
$row[] = 0;
$row[] = 0;
}
$chartdata[] = $row;
}
$charttitle = new stdClass();
$charttitle->start = $start->format('d M Y');
$charttitle->end = $end->format('d M Y');
list($html, $js) = emarking_get_google_chart("print", array(get_string("range", "mod_emarking"), get_string("exams", "mod_emarking"), core_text::strtotitle(get_string("pages", "mod_emarking")), get_string("courses")), $chartdata, get_string("printordersrange", "mod_emarking", $charttitle), get_string("months"));
// X axis label
echo $html;
echo html_writer::table($statstable);
?>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// TODO: Show friendly message when we couldn't load Google's library
google.load("visualization", "1", {packages:["corechart"]});
<?php
echo $js;
?>
</script>
示例8: tag_display_name
/**
* Function that returns the name that should be displayed for a specific tag
*
* @package core_tag
* @category tag
* @access public
* @param object $tagobject a line out of tag table, as returned by the adobd functions
* @param int $html TAG_RETURN_HTML (default) will return htmlspecialchars encoded string, TAG_RETURN_TEXT will not encode.
* @return string
*/
function tag_display_name($tagobject, $html = TAG_RETURN_HTML)
{
global $CFG;
if (!isset($tagobject->name)) {
return '';
}
if (empty($CFG->keeptagnamecase)) {
//this is the normalized tag name
$tagname = core_text::strtotitle($tagobject->name);
} else {
//original casing of the tag name
$tagname = $tagobject->rawname;
}
// clean up a bit just in case the rules change again
$tagname = clean_param($tagname, PARAM_TAG);
if ($html == TAG_RETURN_TEXT) {
return $tagname;
} else {
// TAG_RETURN_HTML
return htmlspecialchars($tagname);
}
}
示例9: emarking_tabs
/**
* Creates an array with the navigation tabs for emarking
*
* @param unknown $context
* The course context to validate capabilit
* @param unknown $cm
* The course module (emarking activity)
* @return multitype:tabobject
*/
function emarking_tabs($context, $cm, $emarking)
{
global $CFG;
global $USER;
$usercangrade = has_capability("mod/emarking:grade", $context);
$tabs = array();
// Print tab
$printtab = new tabobject("myexams", $CFG->wwwroot . "/mod/emarking/print/exam.php?id={$cm->id}", get_string("print", 'mod_emarking'));
// Scan tab
$scantab = new tabobject("scan", $CFG->wwwroot . "/mod/emarking/view.php?id={$cm->id}&scan=1", get_string('scan', 'mod_emarking'));
$scantab->subtree[] = new tabobject("scanlist", $CFG->wwwroot . "/mod/emarking/view.php?id={$cm->id}&scan=1", get_string("exams", 'mod_emarking'));
if ($usercangrade) {
$scantab->subtree[] = new tabobject("uploadanswers", $CFG->wwwroot . "/mod/emarking/print/uploadanswers.php?id={$cm->id}", get_string('uploadanswers', 'mod_emarking'));
}
// Settings tab
$settingstab = new tabobject("settings", $CFG->wwwroot . "/mod/emarking/marking/settings.php?id={$cm->id}", get_string("settings", 'mod_emarking'));
// Grade tab
$markingtab = new tabobject("grade", $CFG->wwwroot . "/mod/emarking/view.php?id={$cm->id}", get_string('onscreenmarking', 'mod_emarking'));
$markingtab->subtree[] = new tabobject("mark", $CFG->wwwroot . "/mod/emarking/view.php?id={$cm->id}", get_string("marking", 'mod_emarking'));
if (!$usercangrade) {
if ($emarking->peervisibility) {
$markingtab->subtree[] = new tabobject("ranking", $CFG->wwwroot . "/mod/emarking/reports/ranking.php?id={$cm->id}", get_string("ranking", 'mod_emarking'));
$markingtab->subtree[] = new tabobject("viewpeers", $CFG->wwwroot . "/mod/emarking/reports/viewpeers.php?id={$cm->id}", get_string("reviewpeersfeedback", 'mod_emarking'));
}
$markingtab->subtree[] = new tabobject("regrade", $CFG->wwwroot . "/mod/emarking/marking/regrades.php?id={$cm->id}", get_string("regrades", 'mod_emarking'));
} else {
if (has_capability('mod/emarking:regrade', $context) && $emarking->type == EMARKING_TYPE_NORMAL) {
$markingtab->subtree[] = new tabobject("regrades", $CFG->wwwroot . "/mod/emarking/marking/regraderequests.php?id={$cm->id}", get_string("regrades", 'mod_emarking'));
}
}
// Settings for marking
if ($emarking->type == EMARKING_TYPE_NORMAL) {
$settingstab->subtree[] = new tabobject("osmsettings", $CFG->wwwroot . "/mod/emarking/marking/settings.php?id={$cm->id}", get_string("marking", 'mod_emarking'));
$settingstab->subtree[] = new tabobject("comment", $CFG->wwwroot . "/mod/emarking/marking/predefinedcomments.php?id={$cm->id}&action=list", get_string("predefinedcomments", 'mod_emarking'));
if (has_capability('mod/emarking:assignmarkers', $context)) {
$settingstab->subtree[] = new tabobject("markers", $CFG->wwwroot . "/mod/emarking/marking/markers.php?id={$cm->id}", get_string("markerspercriteria", 'mod_emarking'));
$settingstab->subtree[] = new tabobject("pages", $CFG->wwwroot . "/mod/emarking/marking/pages.php?id={$cm->id}", core_text::strtotitle(get_string("pagespercriteria", 'mod_emarking')));
}
}
// Grade report tab
$gradereporttab = new tabobject("gradereport", $CFG->wwwroot . "/mod/emarking/reports/marking.php?id={$cm->id}", get_string("reports", "mod_emarking"));
$gradereporttab->subtree[] = new tabobject("markingreport", $CFG->wwwroot . "/mod/emarking/reports/marking.php?id={$cm->id}", get_string("marking", 'mod_emarking'));
$gradereporttab->subtree[] = new tabobject("report", $CFG->wwwroot . "/mod/emarking/reports/grade.php?id={$cm->id}", get_string("grades", "grades"));
$gradereporttab->subtree[] = new tabobject("ranking", $CFG->wwwroot . "/mod/emarking/reports/ranking.php?id={$cm->id}", get_string("ranking", 'mod_emarking'));
if ($emarking->justiceperception > EMARKING_JUSTICE_DISABLED) {
$gradereporttab->subtree[] = new tabobject("justicereport", $CFG->wwwroot . "/mod/emarking/reports/justice.php?id={$cm->id}", get_string("justice", 'mod_emarking'));
}
$gradereporttab->subtree[] = new tabobject("comparison", $CFG->wwwroot . "/mod/emarking/reports/comparativereport.php?id={$cm->id}", get_string("comparativereport", "mod_emarking"));
// Active types tab
$activatescan = new tabobject("enablescan", $CFG->wwwroot . "/mod/emarking/print/enablefeatures.php?id={$cm->id}&type=" . EMARKING_TYPE_PRINT_SCAN, get_string("enablescan", "mod_emarking"));
// Active types tab
$activateosm = new tabobject("enableosm", $CFG->wwwroot . "/mod/emarking/print/enablefeatures.php?id={$cm->id}&type=" . EMARKING_TYPE_NORMAL, get_string("enableosm", "mod_emarking"));
// Tabs sequence
if ($usercangrade) {
// Print tab goes always except for markers training
if ($emarking->type == EMARKING_TYPE_PRINT_ONLY || $emarking->type == EMARKING_TYPE_PRINT_SCAN || $emarking->type == EMARKING_TYPE_NORMAL) {
if (has_capability('mod/emarking:uploadexam', $context)) {
$tabs[] = $printtab;
}
}
// Scan or enablescan tab
if ($emarking->type == EMARKING_TYPE_PRINT_SCAN || $emarking->type == EMARKING_TYPE_NORMAL) {
$tabs[] = $scantab;
} else {
if ($emarking->type == EMARKING_TYPE_PRINT_ONLY) {
$tabs[] = $activatescan;
}
}
// OSM tabs, either marking, reports and settings or enable osm
if ($emarking->type == EMARKING_TYPE_NORMAL) {
$tabs[] = $markingtab;
$tabs[] = $gradereporttab;
$tabs[] = $settingstab;
} else {
if ($emarking->type == EMARKING_TYPE_PRINT_ONLY || $emarking->type == EMARKING_TYPE_PRINT_SCAN) {
$tabs[] = $activateosm;
}
}
} else {
if ($emarking->type == EMARKING_TYPE_PRINT_SCAN) {
// This case is for students (user can not grade)
$tabs = $scantab->subtree;
} else {
if ($emarking->type == EMARKING_TYPE_PRINT_ONLY) {
// This case is for students (user can not grade)
$tabs = array();
} else {
// This case is for students (user can not grade)
$tabs = $markingtab->subtree;
}
}
//.........这里部分代码省略.........
示例10: uu_process_template_callback
/**
* Internal callback function.
*/
function uu_process_template_callback($username, $firstname, $lastname, $block)
{
switch ($block[3]) {
case 'u':
$repl = $username;
break;
case 'f':
$repl = $firstname;
break;
case 'l':
$repl = $lastname;
break;
default:
return $block[0];
}
switch ($block[1]) {
case '+':
$repl = core_text::strtoupper($repl);
break;
case '-':
$repl = core_text::strtolower($repl);
break;
case '~':
$repl = core_text::strtotitle($repl);
break;
}
if (!empty($block[2])) {
$repl = core_text::substr($repl, 0, $block[2]);
}
return $repl;
}
示例11: emarking_tabs
/**
* Creates an array with the navigation tabs for emarking
*
* @param unknown $context
* The course context to validate capabilit
* @param unknown $cm
* The course module (emarking activity)
* @return multitype:tabobject
*/
function emarking_tabs($context, $cm, $emarking)
{
global $CFG, $USER;
$usercangrade = has_capability("mod/emarking:grade", $context);
$issupervisor = has_capability("mod/emarking:supervisegrading", $context);
$tabs = array();
// Print tab.
$printtab = new tabobject('printscan', $CFG->wwwroot . "/mod/emarking/print/exam.php?id={$cm->id}", $emarking->type == EMARKING_TYPE_PRINT_ONLY ? get_string('print', 'mod_emarking') : get_string('type_print_scan', 'mod_emarking'));
// Print summary tab.
$printtab->subtree[] = new tabobject('myexams', $CFG->wwwroot . "/mod/emarking/print/exam.php?id={$cm->id}", get_string('exam', 'mod_emarking'));
// Scan tab.
$scantab = new tabobject("scan", $CFG->wwwroot . "/mod/emarking/view.php?id={$cm->id}&scan=1", get_string('exams', 'mod_emarking'));
$scanlist = new tabobject("scanlist", $CFG->wwwroot . "/mod/emarking/view.php?id={$cm->id}&scan=1", get_string('view'));
$uploadanswers = new tabobject("uploadanswers", $CFG->wwwroot . "/mod/emarking/print/uploadanswers.php?id={$cm->id}", get_string('uploadanswers', 'mod_emarking'));
$orphanpages = new tabobject('orphanpages', $CFG->wwwroot . "/mod/emarking/print/orphanpages.php?id={$cm->id}", get_string('orphanpages', 'mod_emarking'));
$scantab->subtree[] = $scanlist;
if ($usercangrade && $issupervisor && $emarking->type != EMARKING_TYPE_PRINT_ONLY) {
$printtab->subtree[] = $uploadanswers;
$printtab->subtree[] = $orphanpages;
}
// Grade tab.
$markingtab = new tabobject("grade", $CFG->wwwroot . "/mod/emarking/view.php?id={$cm->id}", get_string('onscreenmarking', 'mod_emarking'));
$markingtab->subtree[] = new tabobject("mark", $CFG->wwwroot . "/mod/emarking/view.php?id={$cm->id}", get_string("marking", 'mod_emarking'));
if (!$usercangrade) {
if ($emarking->peervisibility) {
$markingtab->subtree[] = new tabobject("ranking", $CFG->wwwroot . "/mod/emarking/reports/ranking.php?id={$cm->id}", get_string("ranking", 'mod_emarking'));
$markingtab->subtree[] = new tabobject("viewpeers", $CFG->wwwroot . "/mod/emarking/reports/viewpeers.php?id={$cm->id}", get_string("reviewpeersfeedback", 'mod_emarking'));
}
if ($emarking->type == EMARKING_TYPE_ON_SCREEN_MARKING) {
$markingtab->subtree[] = new tabobject("regrades", $CFG->wwwroot . "/mod/emarking/marking/regraderequests.php?id={$cm->id}", get_string("regrades", 'mod_emarking'));
}
} else {
if (has_capability('mod/emarking:regrade', $context) && $emarking->type == EMARKING_TYPE_ON_SCREEN_MARKING) {
$markingtab->subtree[] = new tabobject("regrades", $CFG->wwwroot . "/mod/emarking/marking/regraderequests.php?id={$cm->id}", get_string("regrades", 'mod_emarking'));
}
}
// Settings tab.
$settingstab = new tabobject("settings", $CFG->wwwroot . "/mod/emarking/marking/settings.php?id={$cm->id}", get_string('settings'));
// Settings for marking.
if ($emarking->type == EMARKING_TYPE_ON_SCREEN_MARKING) {
$settingstab->subtree[] = new tabobject("osmsettings", $CFG->wwwroot . "/mod/emarking/marking/settings.php?id={$cm->id}", get_string("marking", 'mod_emarking'));
$settingstab->subtree[] = new tabobject("comment", $CFG->wwwroot . "/mod/emarking/marking/predefinedcomments.php?id={$cm->id}&action=list", get_string("predefinedcomments", 'mod_emarking'));
if (has_capability('mod/emarking:assignmarkers', $context)) {
$settingstab->subtree[] = new tabobject("markers", $CFG->wwwroot . "/mod/emarking/marking/markers.php?id={$cm->id}", get_string("markerspercriteria", 'mod_emarking'));
$settingstab->subtree[] = new tabobject("pages", $CFG->wwwroot . "/mod/emarking/marking/pages.php?id={$cm->id}", core_text::strtotitle(get_string("pagespercriteria", 'mod_emarking')));
$settingstab->subtree[] = new tabobject("outcomes", $CFG->wwwroot . "/mod/emarking/marking/outcomes.php?id={$cm->id}", core_text::strtotitle(get_string("outcomes", "grades")));
$settingstab->subtree[] = new tabobject("importrubric", $CFG->wwwroot . "/mod/emarking/marking/importrubric.php?id={$cm->id}&action=list", get_string("importrubric", 'mod_emarking'));
$settingstab->subtree[] = new tabobject("export", $CFG->wwwroot . "/mod/emarking/marking/export.php?id={$cm->id}", core_text::strtotitle(get_string("export", "mod_data")));
}
}
// Grade report tab.
$gradereporttab = new tabobject("gradereport", $CFG->wwwroot . "/mod/emarking/reports/marking.php?id={$cm->id}", get_string("reports", "mod_emarking"));
$gradereporttab->subtree[] = new tabobject("markingreport", $CFG->wwwroot . "/mod/emarking/reports/marking.php?id={$cm->id}", get_string("marking", 'mod_emarking'));
$gradereporttab->subtree[] = new tabobject("report", $CFG->wwwroot . "/mod/emarking/reports/grade.php?id={$cm->id}", get_string("grades", "grades"));
$gradereporttab->subtree[] = new tabobject("ranking", $CFG->wwwroot . "/mod/emarking/reports/ranking.php?id={$cm->id}", get_string("ranking", 'mod_emarking'));
if ($emarking->justiceperception > EMARKING_JUSTICE_DISABLED) {
$gradereporttab->subtree[] = new tabobject("justicereport", $CFG->wwwroot . "/mod/emarking/reports/justice.php?id={$cm->id}", get_string("justice", 'mod_emarking'));
}
$gradereporttab->subtree[] = new tabobject("outcomesreport", $CFG->wwwroot . "/mod/emarking/reports/outcomes.php?id={$cm->id}", get_string("outcomes", "grades"));
// Tabs sequence.
if ($usercangrade) {
// Print tab goes always except for markers training.
if ($emarking->type == EMARKING_TYPE_PRINT_ONLY || $emarking->type == EMARKING_TYPE_PRINT_SCAN || $emarking->type == EMARKING_TYPE_ON_SCREEN_MARKING) {
if (has_capability('mod/emarking:addinstance', $context)) {
$tabs[] = $printtab;
}
}
// Scan or enablescan tab.
if ($emarking->type == EMARKING_TYPE_PRINT_SCAN) {
$tabs[] = $scantab;
}
// OSM tabs, either marking, reports and settings or enable osm.
if ($emarking->type == EMARKING_TYPE_ON_SCREEN_MARKING) {
$tabs[] = $markingtab;
$tabs[] = $gradereporttab;
if ($issupervisor) {
$tabs[] = $settingstab;
}
}
} else {
if ($emarking->type == EMARKING_TYPE_PRINT_SCAN) {
// This case is for students (user can not grade).
$tabs = $scantab->subtree;
} else {
if ($emarking->type == EMARKING_TYPE_PRINT_ONLY) {
// This case is for students (user can not grade).
$tabs = array();
} else {
// This case is for students (user can not grade).
$tabs = $markingtab->subtree;
}
//.........这里部分代码省略.........
示例12: cc_process_template_callback
/**
* Internal callback function.
*/
function cc_process_template_callback($name, $description, $idnumber, $block)
{
switch ($block[3]) {
case 's':
$repl = $name;
break;
case 'd':
$repl = $description;
break;
case 'i':
$repl = $idnumber;
break;
default:
return $block[0];
}
switch ($block[1]) {
case '+':
$repl = core_text::strtoupper($repl);
break;
case '-':
$repl = core_text::strtolower($repl);
break;
case '~':
$repl = core_text::strtotitle($repl);
break;
}
if (!empty($block[2])) {
$repl = core_text::substr($repl, 0, $block[2]);
}
return $repl;
}
示例13: generate_shortname_callback
/**
* Callback used when generating a shortname based on a template.
*
* @param string $fullname full name.
* @param string $idnumber ID number.
* @param array $block result from preg_replace_callback.
* @return string
*/
public static function generate_shortname_callback($fullname, $idnumber, $block)
{
switch ($block[3]) {
case 'f':
$repl = $fullname;
break;
case 'i':
$repl = $idnumber;
break;
default:
return $block[0];
}
switch ($block[1]) {
case '+':
$repl = core_text::strtoupper($repl);
break;
case '-':
$repl = core_text::strtolower($repl);
break;
case '~':
$repl = core_text::strtotitle($repl);
break;
}
if (!empty($block[2])) {
$repl = core_text::substr($repl, 0, $block[2]);
}
return $repl;
}