本文整理汇总了PHP中core_text::strtoupper方法的典型用法代码示例。如果您正苦于以下问题:PHP core_text::strtoupper方法的具体用法?PHP core_text::strtoupper怎么用?PHP core_text::strtoupper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core_text
的用法示例。
在下文中一共展示了core_text::strtoupper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: config_form_criteria
/**
* Add appropriate form elements to the criteria form
*
* @param stdClass $data details of overall criterion
*/
public function config_form_criteria($data)
{
global $OUTPUT;
$prefix = 'criteria-' . $this->id;
if (count($data->criteria) > 2) {
echo $OUTPUT->box_start();
if (!empty($this->description)) {
$badge = new badge($this->badgeid);
echo $OUTPUT->box(format_text($this->description, $this->descriptionformat, array('context' => $badge->get_context())), 'criteria-description');
}
echo $OUTPUT->heading($this->get_title(), 2);
$agg = $data->get_aggregation_methods();
if (!$data->is_locked() && !$data->is_active()) {
$editurl = new moodle_url('/badges/criteria_settings.php', array('badgeid' => $this->badgeid, 'edit' => true, 'type' => $this->criteriatype, 'crit' => $this->id));
$editaction = $OUTPUT->action_icon($editurl, new pix_icon('t/edit', get_string('edit')), null, array('class' => 'criteria-action'));
echo $OUTPUT->box($editaction, array('criteria-header'));
$url = new moodle_url('criteria.php', array('id' => $data->id, 'sesskey' => sesskey()));
echo $OUTPUT->single_select($url, 'update', $agg, $data->get_aggregation_method($this->criteriatype), null, null, array('aria-describedby' => 'overall'));
echo html_writer::span(get_string('overallcrit', 'badges'), '', array('id' => 'overall'));
} else {
echo $OUTPUT->box(get_string('criteria_descr_' . $this->criteriatype, 'badges', core_text::strtoupper($agg[$data->get_aggregation_method()])), 'clearfix');
}
echo $OUTPUT->box_end();
}
}
示例2: check_table
protected function check_table(xmldb_table $xmldb_table, array $metacolumns)
{
global $DB;
$o = '';
$wrong_fields = array();
// Get and process XMLDB fields
if ($xmldb_fields = $xmldb_table->getFields()) {
$o .= '<ul>';
foreach ($xmldb_fields as $xmldb_field) {
// Get the type of the column, we only will process CHAR (VARCHAR2) ones
if ($xmldb_field->getType() != XMLDB_TYPE_CHAR) {
continue;
}
$o .= '<li>' . $this->str['field'] . ': ' . $xmldb_field->getName() . ' ';
// Get current semantic from dictionary, we only will process B (BYTE) ones
// suplying the SQL code to change them to C (CHAR) semantic
$params = array('table_name' => core_text::strtoupper($DB->get_prefix() . $xmldb_table->getName()), 'column_name' => core_text::strtoupper($xmldb_field->getName()), 'data_type' => 'VARCHAR2');
$currentsemantic = $DB->get_field_sql('
SELECT char_used
FROM user_tab_columns
WHERE table_name = :table_name
AND column_name = :column_name
AND data_type = :data_type', $params);
// If using byte semantics, we'll need to change them to char semantics
if ($currentsemantic == 'B') {
$info = '(' . $this->str['expected'] . " 'CHAR', " . $this->str['actual'] . " 'BYTE')";
$o .= '<font color="red">' . $this->str['wrong'] . " {$info}</font>";
// Add the wrong field to the list
$obj = new stdClass();
$obj->table = $xmldb_table;
$obj->field = $xmldb_field;
$wrong_fields[] = $obj;
} else {
$o .= '<font color="green">' . $this->str['ok'] . '</font>';
}
$o .= '</li>';
}
$o .= '</ul>';
}
return array($o, $wrong_fields);
}
示例3: config_form_criteria
/**
* Add appropriate form elements to the criteria form
*
* @param stdClass $data details of overall criterion
*/
public function config_form_criteria($data)
{
global $OUTPUT;
$prefix = 'criteria-' . $this->id;
if (count($data->criteria) > 2) {
echo $OUTPUT->box_start();
echo $OUTPUT->heading($this->get_title(), 2);
$agg = $data->get_aggregation_methods();
if (!$data->is_locked() && !$data->is_active()) {
$url = new moodle_url('criteria.php', array('id' => $data->id, 'sesskey' => sesskey()));
$table = new html_table();
$table->attributes = array('class' => 'clearfix');
$table->colclasses = array('', 'activatebadge');
$table->data[] = array($OUTPUT->single_select($url, 'update', $agg, $data->get_aggregation_method($this->criteriatype), null), get_string('overallcrit', 'badges'));
echo html_writer::table($table);
} else {
echo $OUTPUT->box(get_string('criteria_descr_' . $this->criteriatype, 'badges', core_text::strtoupper($agg[$data->get_aggregation_method()])), 'clearfix');
}
echo $OUTPUT->box_end();
}
}
示例4: strtoupper
/**
* Strtoupper multibyte wrapper function with HTML entities handling.
*
* @param string $str Text to convert
* @return string Converted text
*/
protected function strtoupper($str)
{
return core_text::strtoupper($str);
}
示例5: emarking_draw_header
/**
* Draws the personalized header in a PDF
*
* @param unknown $pdf
* @param unknown $stinfo
* @param unknown $examname
* @param unknown $pagenumber
* @param unknown $fileimgpath
* @param unknown $logofilepath
* @param unknown $course
* @param string $totalpages
* @param string $bottomqr
* @param string $isanswersheet
* @param number $attemptid
*/
function emarking_draw_header($pdf, $stinfo, $examname, $pagenumber, $fileimgpath, $logofilepath, $course, $totalpages = null, $bottomqr = true, $isanswersheet = false, $attemptid = 0)
{
global $CFG;
$pdf->SetAutoPageBreak(false);
// If we have a log, it is drawn on the top left part
if ($CFG->emarking_includelogo && $logofilepath) {
$pdf->Image($logofilepath, 2, 8, 30);
}
// Exam name
$left = 58;
$top = 8;
$pdf->SetFont('Helvetica', '', 12);
$pdf->SetXY($left, $top);
$pdf->Write(1, core_text::strtoupper($examname));
// Student name
$pdf->SetFont('Helvetica', '', 9);
$top += 5;
$pdf->SetXY($left, $top);
$pdf->Write(1, core_text::strtoupper(get_string('name') . ": " . $stinfo->name));
$top += 4;
// Student idnumber
if ($stinfo->idnumber && strlen($stinfo->idnumber) > 0) {
$pdf->SetXY($left, $top);
$pdf->Write(1, get_string('idnumber', 'mod_emarking') . ": " . $stinfo->idnumber);
$top += 4;
}
// Course name
$pdf->SetXY($left, $top);
$pdf->Write(1, core_text::strtoupper(get_string('course') . ": " . $course->fullname));
$top += 4;
if (file_exists($stinfo->picture)) {
$pdf->Image($stinfo->picture, 35, 8, 15, 15, "PNG", null, "T", true);
}
// Page number and total pages
if ($totalpages) {
$totals = new stdClass();
$totals->identified = $pagenumber;
$totals->total = $totalpages;
$pdf->SetXY($left, $top);
$pdf->Write(1, core_text::strtoupper(get_string('page') . ": " . get_string('aofb', 'mod_emarking', $totals)));
}
// Generate the QR images
$qrstring = "{$stinfo->id}-{$course->id}-{$pagenumber}";
// If the page is an answer sheets (has bubbles), add the attemptid
if ($isanswersheet && $attemptid > 0) {
$qrstring .= '-' . $attemptid . '-BB';
}
list($img, $imgrotated) = emarking_create_qr_image($fileimgpath, $qrstring, $stinfo, $pagenumber);
$pdf->Image($img, 176, 3, 34);
if ($bottomqr) {
$pdf->Image($imgrotated, 0, $pdf->getPageHeight() - 35, 34);
}
// Delete QR images
unlink($img);
unlink($imgrotated);
}
示例6: ouwiki_get_page_version
/**
* Returns an object containing the details from 'pages' and 'versions'
* tables for the specified version of the specified (named) page, or false
* if page/version does not exist.
*
* @param object $subwiki Current subwiki object
* @param string $pagename Name of desired page or null for start
* @return object $pageversion Version object
*/
function ouwiki_get_page_version($subwiki, $pagename, $versionid)
{
global $DB;
$userfields = user_picture::fields('u', null, 'userid');
$sql = "SELECT p.id AS pageid, p.subwikiid, p.title, p.currentversionid,\n v.id AS versionid, v.xhtml, v.timecreated, v.userid, v.xhtmlformat,\n v.deletedat, {$userfields},\n v.wordcount\n FROM {ouwiki_pages} p, {ouwiki_versions} v\n LEFT JOIN {user} u ON v.userid = u.id\n WHERE p.subwikiid = ? AND v.id = ? AND UPPER(p.title) = ?";
$pagename = core_text::strtoupper($pagename);
$pageversion = $DB->get_record_sql($sql, array($subwiki->id, $versionid, $pagename));
$pageversion->recentversions = false;
return $pageversion;
}
示例7: print_badge_criteria
public function print_badge_criteria(badge $badge, $short = '')
{
$output = "";
$agg = $badge->get_aggregation_methods();
if (empty($badge->criteria)) {
return get_string('nocriteria', 'badges');
} else {
if (count($badge->criteria) == 2) {
if (!$short) {
$output .= get_string('criteria_descr', 'badges');
}
} else {
$output .= get_string('criteria_descr_' . $short . BADGE_CRITERIA_TYPE_OVERALL, 'badges', core_text::strtoupper($agg[$badge->get_aggregation_method()]));
}
}
$items = array();
unset($badge->criteria[BADGE_CRITERIA_TYPE_OVERALL]);
foreach ($badge->criteria as $type => $c) {
if (count($c->params) == 1) {
$items[] = get_string('criteria_descr_single_' . $short . $type, 'badges') . $c->get_details($short);
} else {
$items[] = get_string('criteria_descr_' . $short . $type, 'badges', core_text::strtoupper($agg[$badge->get_aggregation_method($type)])) . $c->get_details($short);
}
}
$output .= html_writer::alist($items, array(), 'ul');
return $output;
}
示例8: print_badge_criteria
/**
* Returns information about badge criteria in a list form.
*
* @param badge $badge Badge objects
* @param string $short Indicates whether to print full info about this badge
* @return string $output HTML string to output
*/
public function print_badge_criteria(badge $badge, $short = '')
{
$agg = $badge->get_aggregation_methods();
if (empty($badge->criteria)) {
return get_string('nocriteria', 'badges');
}
$overalldescr = '';
$overall = $badge->criteria[BADGE_CRITERIA_TYPE_OVERALL];
if (!$short && !empty($overall->description)) {
$overalldescr = $this->output->box(format_text($overall->description, $overall->descriptionformat, array('context' => $badge->get_context())), 'criteria-description');
}
// Get the condition string.
if (count($badge->criteria) == 2) {
$condition = '';
if (!$short) {
$condition = get_string('criteria_descr', 'badges');
}
} else {
$condition = get_string('criteria_descr_' . $short . BADGE_CRITERIA_TYPE_OVERALL, 'badges', core_text::strtoupper($agg[$badge->get_aggregation_method()]));
}
unset($badge->criteria[BADGE_CRITERIA_TYPE_OVERALL]);
$items = array();
// If only one criterion left, make sure its description goe to the top.
if (count($badge->criteria) == 1) {
$c = reset($badge->criteria);
if (!$short && !empty($c->description)) {
$overalldescr = $this->output->box(format_text($c->description, $c->descriptionformat, array('context' => $badge->get_context())), 'criteria-description');
}
if (count($c->params) == 1) {
$items[] = get_string('criteria_descr_single_' . $short . $c->criteriatype, 'badges') . $c->get_details($short);
} else {
$items[] = get_string('criteria_descr_' . $short . $c->criteriatype, 'badges', core_text::strtoupper($agg[$badge->get_aggregation_method($c->criteriatype)])) . $c->get_details($short);
}
} else {
foreach ($badge->criteria as $type => $c) {
$criteriadescr = '';
if (!$short && !empty($c->description)) {
$criteriadescr = $this->output->box(format_text($c->description, $c->descriptionformat, array('context' => $badge->get_context())), 'criteria-description');
}
if (count($c->params) == 1) {
$items[] = get_string('criteria_descr_single_' . $short . $type, 'badges') . $c->get_details($short) . $criteriadescr;
} else {
$items[] = get_string('criteria_descr_' . $short . $type, 'badges', core_text::strtoupper($agg[$badge->get_aggregation_method($type)])) . $c->get_details($short) . $criteriadescr;
}
}
}
return $overalldescr . $condition . html_writer::alist($items, array(), 'ul');
}
示例9: rating_manager
$ratingoptions->items = $allentries;
$ratingoptions->aggregate = $glossary->assessed;
//the aggregation method
$ratingoptions->scaleid = $glossary->scale;
$ratingoptions->userid = $USER->id;
$ratingoptions->returnurl = $CFG->wwwroot . '/mod/glossary/view.php?id=' . $cm->id;
$ratingoptions->assesstimestart = $glossary->assesstimestart;
$ratingoptions->assesstimefinish = $glossary->assesstimefinish;
$rm = new rating_manager();
$allentries = $rm->get_ratings($ratingoptions);
}
foreach ($allentries as $entry) {
// Setting the pivot for the current entry
$pivot = $entry->glossarypivot;
$upperpivot = core_text::strtoupper($pivot);
$pivottoshow = core_text::strtoupper(format_string($pivot, true, $fmtoptions));
// Reduce pivot to 1cc if necessary
if (!$fullpivot) {
$upperpivot = core_text::substr($upperpivot, 0, 1);
$pivottoshow = core_text::substr($pivottoshow, 0, 1);
}
// if there's a group break
if ($currentpivot != $upperpivot) {
// print the group break if apply
if ($printpivot) {
$currentpivot = $upperpivot;
echo '<div>';
echo '<table cellspacing="0" class="glossarycategoryheader">';
echo '<tr>';
if (isset($entry->userispivot)) {
// printing the user icon if defined (only when browsing authors)
示例10: explode
$where = "AND ({$searchcond})";
}
break;
case 'term':
$params['hook2'] = $hook;
$printpivot = 0;
$sqlfrom .= " LEFT JOIN {glossary_alias} ga on ge.id = ga.entryid";
$where = "AND (ge.concept = :hook OR ga.alias = :hook2) ";
break;
case 'entry':
$printpivot = 0;
$where = "AND ge.id = :hook";
break;
case 'letter':
if ($hook != 'ALL' and $hook != 'SPECIAL' and $hookstrlen = core_text::strlen($hook)) {
$params['hookup'] = core_text::strtoupper($hook);
$where = "AND " . $DB->sql_substr("upper(concept)", 1, $hookstrlen) . " = :hookup";
}
if ($hook == 'SPECIAL') {
//Create appropiate IN contents
$alphabet = explode(",", get_string('alphabet', 'langconfig'));
list($nia, $aparams) = $DB->get_in_or_equal($alphabet, SQL_PARAMS_NAMED, $start = 'a', false);
$params = array_merge($params, $aparams);
$where = "AND " . $DB->sql_substr("upper(concept)", 1, 1) . " {$nia}";
}
break;
}
$sqlwhere = "WHERE (ge.glossaryid = :gid1 or ge.sourceglossaryid = :gid2) AND\n (ge.approved <> 0 {$userid})\n {$where}";
switch ($tab) {
case GLOSSARY_DATE_VIEW:
$sqlorderby = "ORDER BY {$sqlsortkey} {$sqlsortorder}";
示例11: mb_strtoupper
/**
*
* @param string The string being uppercased
* @param string $encoding The encoding parameter is the character encoding.
* If it is omitted, the internal character encoding
* value will be used.
*
* @return string The string with all alphabetic characters converted to uppercase.
*/
function mb_strtoupper($str, $encoding = null)
{
if ($encoding === null) {
$encoding = mb_internal_encoding();
}
return \core_text::strtoupper($str, $encoding);
}
示例12: print_badge_criteria_single
/**
* Dispatch criteria rendering to an appropriate place.
*
* Dispatch to a theme renderer method to output the details if one
* exists -- that way we can make changes to the output.
*/
protected function print_badge_criteria_single($badge, $aggregationmethods, $type, $criteria, $short = '')
{
switch ($type) {
case BADGE_CRITERIA_TYPE_ACTIVITY:
$details = $this->print_badge_criteria_activity($criteria, $short);
break;
case BADGE_CRITERIA_TYPE_COURSE:
$details = $this->print_badge_criteria_course($criteria, $short);
break;
case BADGE_CRITERIA_TYPE_COURSESET:
$details = $this->print_badge_criteria_courseset($criteria, $short);
break;
default:
$details = $criteria->get_details();
}
if (count($criteria->params) === 1) {
$stringname = 'criteria_descr_single_' . $short . $type;
$title = static::string($stringname);
} else {
$stringname = 'criteria_descr_' . $short . $type;
$count = core_text::strtoupper($aggregationmethods[$badge->get_aggregation_method($type)]);
$title = static::string($stringname, $count);
}
return $title . $details;
}
示例13: resolve_field
/**
* Convenience method to transform a field into SQL statement.
*
* @param string $field The field, or *.
* @param string $table The table name, without the prefix 'glossary_'.
* @return string SQL statement.
*/
protected static function resolve_field($field, $table)
{
$prefix = constant(__CLASS__ . '::ALIAS_' . core_text::strtoupper($table));
return sprintf('%s.%s', $prefix, $field);
}
示例14: 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;
}
示例15: 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;
}