if (!empty($blogheaders['strview']) && $CFG->useblogassociations) {
if ($blogheaders['url']->compare($PAGE->url) == URL_MATCH_EXACT) {
- $menulist[] = html_writer::tag('span', array('class'=>'current'), $blogheaders['strview']);
+ $menulist[] = html_writer::tag('span', $blogheaders['strview'], array('class'=>'current'));
} else {
$menulist[] = html_writer::link($blogheaders['url'], $blogheaders['strview']);
}
if (!$this->canviewhidden and $grade->is_hidden()) {
if (!empty($CFG->grade_hiddenasdate) and $grade->get_datesubmitted() and !$item->is_category_item() and !$item->is_course_item()) {
// the problem here is that we do not have the time when grade value was modified, 'timemodified' is general modification date for grade_grades records
- $itemcell->text = html_writer::tag('span', array('class'=>'datesubmitted'), userdate($grade->get_datesubmitted(),get_string('strftimedatetimeshort')));
+ $itemcell->text = html_writer::tag('span', userdate($grade->get_datesubmitted(),get_string('strftimedatetimeshort')), array('class'=>'datesubmitted'));
} else {
$itemcell->text = '-';
}
}
if ($grade->is_excluded()) {
- $itemcell->text .= html_writer::tag('span', array('class'=>'excludedfloater'), get_string('excluded', 'grades'));
+ $itemcell->text .= html_writer::tag('span', get_string('excluded', 'grades'), array('class'=>'excludedfloater'));
}
// Do not show any icons if no grade (no record in DB to match)
// or a drop down (for scales)
// grades in item of type grade category or course are not directly editable
if ($item->needsupdate) {
- $itemcell->text .= html_writer::tag('span', array('class'=>"gradingerror$hidden"), get_string('error'));
+ $itemcell->text .= html_writer::tag('span', get_string('error'), array('class'=>"gradingerror$hidden"));
} else if ($USER->gradeediting[$this->courseid]) {
// invalid grade if gradeval < 1
if ($gradeval < 1) {
- $itemcell->text .= html_writer::tag('span', array('class'=>"gradevalue$hidden$gradepass"), '-');
+ $itemcell->text .= html_writer::tag('span', '-', array('class'=>"gradevalue$hidden$gradepass"));
} else {
$gradeval = $grade->grade_item->bounded_grade($gradeval); //just in case somebody changes scale
- $itemcell->text .= html_writer::tag('span', array('class'=>"gradevalue$hidden$gradepass"), $scales[$gradeval-1]);
+ $itemcell->text .= html_writer::tag('span', $scales[$gradeval-1], array('class'=>"gradevalue$hidden$gradepass"));
}
} else {
// no such scale, throw error?
. '" type="text" class="text" title="'. $strgrade .'" name="grade_'
.$userid.'_' .$item->id.'" id="grade_'.$userid.'_'.$item->id.'" value="'.$value.'" />';
} else {
- $itemcell->text .= html_writer::tag('span', array('class'=>"gradevalue$hidden$gradepass"), format_float($gradeval, $decimalpoints));
+ $itemcell->text .= html_writer::tag('span', format_float($gradeval, $decimalpoints), array('class'=>"gradevalue$hidden$gradepass"));
}
}
}
if ($item->needsupdate) {
- $itemcell->text .= html_writer::tag('span', array('class'=>"gradingerror$hidden$gradepass"), get_string('error'));
+ $itemcell->text .= html_writer::tag('span', get_string('error'), array('class'=>"gradingerror$hidden$gradepass"));
} else {
- $itemcell->text .= html_writer::tag('span', array('class'=>"gradevalue$hidden$gradepass"), grade_format_gradevalue($gradeval, $item, true, $gradedisplaytype, null));
+ $itemcell->text .= html_writer::tag('span', grade_format_gradevalue($gradeval, $item, true, $gradedisplaytype, null), array('class'=>"gradevalue$hidden$gradepass"));
}
}
if (filter_is_enabled('filter/mediaplugin')) {
// this script is needed by most media filter plugins.
$attributes = array('type'=>'text/javascript', 'src'=>$CFG->httpswwwroot . '/lib/ufo.js');
- $ufo = html_writer::tag('script', $attributes, '') . "\n";
+ $ufo = html_writer::tag('script', '', $attributes) . "\n";
}
preg_match('/\<head\>|\<HEAD\>/', $text, $matches);
$icon = $OUTPUT->render($this->icon);
$content = $icon.$content; // use CSS for spacing of icons
} else if ($this->helpbutton !== null) {
- $content = trim($this->helpbutton).html_writer::tag('span', array('class'=>'clearhelpbutton'), $content);
+ $content = trim($this->helpbutton).html_writer::tag('span', $content, array('class'=>'clearhelpbutton'));
}
if ($content === '') {
if ($this->hidden) {
$attributes['class'] = 'dimmed_text';
}
- $content = html_writer::tag('span', $attributes, $content);
+ $content = html_writer::tag('span', $content, $attributes);
}
return $content;
if ($firstnode===true) {
// If this is the first node add the class first and display the
// navbar properties (normally sitename)
- $output .= html_writer::tag('li', array('class'=>'first'), parent::content(true));
+ $output .= html_writer::tag('li', parent::content(true), array('class'=>'first'));
}
$count = 0;
if (!is_array($navarray)) {
}
if ($child->type !== navigation_node::TYPE_CATEGORY || !isset($CFG->navshowcategories) || !empty($CFG->navshowcategories)) {
// Now display the node
- $output .= html_writer::tag('li', null, $separator.' '.$child->content(true));
+ $output .= html_writer::tag('li', $separator.' '.$child->content(true));
}
if (isset($oldaction)) {
$child->action = $oldaction;
/**
* Outputs a tag with attributes and contents
* @param string $tagname The name of tag ('a', 'img', 'span' etc.)
- * @param array $attributes The tag attributes (array('src' => $url, 'class' => 'class1') etc.)
* @param string $contents What goes between the opening and closing tags
+ * @param array $attributes The tag attributes (array('src' => $url, 'class' => 'class1') etc.)
* @return string HTML fragment
*/
- public static function tag($tagname, array $attributes = null, $contents) {
+ public static function tag($tagname, $contents, array $attributes = null) {
return self::start_tag($tagname, $attributes) . $contents . self::end_tag($tagname);
}
public static function link($url, $text, array $attributes = null) {
$attributes = (array)$attributes;
$attributes['href'] = $url;
- return self::tag('a', $attributes, $text);
+ return self::tag('a', $text, $attributes);
}
/**
$output .= self::empty_tag('input', $attributes);
if ($label !== '' and !is_null($label)) {
- $output .= self::tag('label', array('for'=>$attributes['id']), $label);
+ $output .= self::tag('label', $label, array('for'=>$attributes['id']));
}
return $output;
$output .= self::select_option($label, $value, $selected);
}
}
- return self::tag('select', $attributes, $output);
+ return self::tag('select', $output, $attributes);
}
private static function select_option($label, $value, array $selected) {
$attributes['selected'] = 'selected';
}
$attributes['value'] = $value;
- return self::tag('option', $attributes, $label);
+ return self::tag('option', $label, $attributes);
}
private static function select_optgroup($groupname, $options, array $selected) {
foreach ($options as $value=>$label) {
$output .= self::select_option($label, $value, $selected);
}
- return self::tag('optgroup', $attributes, $output);
+ return self::tag('optgroup', $output, $attributes);
}
/**
$attributes['id'] = self::random_id('ts_');
}
$timerselector = self::select($timeunits, $name, $currentdate[$userdatetype], null, array('id'=>$attributes['id']));
- $label = self::tag('label', array('for'=>$attributes['id'], 'class'=>'accesshide'), get_string(substr($type, 0, -1), 'form'));
+ $label = self::tag('label', get_string(substr($type, 0, -1), 'form'), array('for'=>$attributes['id'], 'class'=>'accesshide'));
return $label.$timerselector;
}
$output .= html_writer::end_tag('li') . "\n";
}
- return html_writer::tag($tag, $attributes, $output);
+ return html_writer::tag($tag, $output, $attributes);
}
/**
public static function script($jscode, $url=null) {
if ($jscode) {
$attributes = array('type'=>'text/javascript');
- return self::tag('script', $attributes, "\n//<![CDATA[\n$jscode\n//]]>\n") . "\n";
+ return self::tag('script', "\n//<![CDATA[\n$jscode\n//]]>\n", $attributes) . "\n";
} else if ($url) {
$attributes = array('type'=>'text/javascript', 'src'=>$url);
- return self::tag('script', $attributes, '') . "\n";
+ return self::tag('script', '', $attributes) . "\n";
} else {
return '';
$controlshtml = array();
foreach ($controls as $control) {
$controlshtml[] = html_writer::tag('a', array('class' => 'icon',
- 'title' => $control['caption'], 'href' => $control['url']),
- html_writer::empty_tag('img', array('src' => $this->pix_url($control['icon'])->out(false),
- 'alt' => $control['caption'])));
+ html_writer::empty_tag('img', array('src' => $this->pix_url($control['icon'])->out(false), 'alt' => $control['caption'])),
+ 'title' => $control['caption'], 'href' => $control['url']));
}
- return html_writer::tag('div', array('class' => 'commands'), implode('', $controlshtml));
+ return html_writer::tag('div', implode('', $controlshtml), array('class' => 'commands'));
}
/**
$output = '';
$skipdest = '';
} else {
- $output = html_writer::tag('a', array('href' => '#sb-' . $bc->skipid, 'class' => 'skip-block'), get_string('skipa', 'access', $skiptitle));
- $skipdest = html_writer::tag('span', array('id' => 'sb-' . $bc->skipid, 'class' => 'skip-block-to'), '');
+ $output = html_writer::tag('a', get_string('skipa', 'access', $skiptitle), array('href' => '#sb-' . $bc->skipid, 'class' => 'skip-block'));
+ $skipdest = html_writer::tag('span', '', array('id' => 'sb-' . $bc->skipid, 'class' => 'skip-block-to'));
}
$output .= html_writer::start_tag('div', $bc->attributes);
$title = '';
if ($bc->title) {
- $title = html_writer::tag('h2', null, $bc->title);
+ $title = html_writer::tag('h2', $bc->title, null);
}
if ($title || $controlshtml) {
- $output .= html_writer::tag('div', array('class' => 'header'),
- html_writer::tag('div', array('class' => 'title'),
- $title . $controlshtml));
+ $output .= html_writer::tag('div', html_writer::tag('div', $title . $controlshtml, array('class' => 'title')), array('class' => 'header'));
}
$output .= html_writer::start_tag('div', array('class' => 'content'));
$output .= $bc->content;
if ($bc->footer) {
- $output .= html_writer::tag('div', array('class' => 'footer'), $bc->footer);
+ $output .= html_writer::tag('div', $bc->footer, array('class' => 'footer'));
}
$output .= html_writer::end_tag('div');
$output .= html_writer::end_tag('div');
if ($bc->annotation) {
- $output .= html_writer::tag('div', array('class' => 'blockannotation'), $bc->annotation);
+ $output .= html_writer::tag('div', $bc->annotation, array('class' => 'blockannotation'));
}
$output .= $skipdest;
foreach ($items as $key => $string) {
$item = html_writer::start_tag('li', array('class' => 'r' . $row));
if (!empty($icons[$key])) { //test if the content has an assigned icon
- $item .= html_writer::tag('div', array('class' => 'icon column c0'), $icons[$key]);
+ $item .= html_writer::tag('div', $icons[$key], array('class' => 'icon column c0'));
}
- $item .= html_writer::tag('div', array('class' => 'column c1'), $string);
+ $item .= html_writer::tag('div', $string, array('class' => 'column c1'));
$item .= html_writer::end_tag('li');
$lis[] = $item;
$row = 1 - $row; // Flip even/odd.
}
- return html_writer::tag('ul', array('class' => 'list'), implode("\n", $lis));
+ return html_writer::tag('ul', implode("\n", $lis), array('class' => 'list'));
}
/**
* @return string the HTML to be output.
*/
public function block_move_target($target) {
- return html_writer::tag('a', array('href' => $target->url, 'class' => 'blockmovetarget'),
- html_writer::tag('span', array('class' => 'accesshide'), $target->text));
+ return html_writer::tag('a', html_writer::tag('span', array('class' => 'accesshide'), $target->text), array('href' => $target->url, 'class' => 'blockmovetarget'));
}
/**
}
}
- return html_writer::tag('a', $attributes, $link->text);
+ return html_writer::tag('a', $link->text, $attributes);
}
}
$output = $this->box_start('generalbox', 'notice');
- $output .= html_writer::tag('p', array(), $message);
- $output .= html_writer::tag('div', array('class' => 'buttons'), $this->render($continue) . $this->render($cancel));
+ $output .= html_writer::tag('p', $message);
+ $output .= html_writer::tag('div', $this->render($continue) . $this->render($cancel), array('class' => 'buttons'));
$output .= $this->box_end();
return $output;
}
}
// then div wrapper for xhtml strictness
- $output = html_writer::tag('div', array(), $output);
+ $output = html_writer::tag('div', $output);
// now the form itself around it
$url = $button->url->out_omit_querystring(); // url without params
$attributes = array('method' => $button->method,
'action' => $url,
'id' => $button->formid);
- $output = html_writer::tag('form', $attributes, $output);
+ $output = html_writer::tag('form', $output, $attributes);
// and finally one more wrapper with class
- return html_writer::tag('div', array('class' => $button->class), $output);
+ return html_writer::tag('div', $output, array('class' => $button->class));
}
/**
}
if ($select->label) {
- $output .= html_writer::tag('label', array('for'=>$select->attributes['id']), $select->label);
+ $output .= html_writer::tag('label', $select->label, array('for'=>$select->attributes['id']));
}
if ($select->helpicon instanceof help_icon) {
$output .= html_writer::select($select->options, $select->name, $select->selected, $select->nothing, $select->attributes);
$go = html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('go')));
- $output .= html_writer::tag('noscript', array('style'=>'inline'), $go);
+ $output .= html_writer::tag('noscript', $go, array('style'=>'inline'));
$nothing = empty($select->nothing) ? false : key($select->nothing);
$this->page->requires->js_init_call('M.util.init_select_autosubmit', array($select->formid, $select->attributes['id'], $nothing));
// then div wrapper for xhtml strictness
- $output = html_writer::tag('div', array(), $output);
+ $output = html_writer::tag('div', $output);
// now the form itself around it
$formattributes = array('method' => $select->method,
'action' => $select->url->out_omit_querystring(),
'id' => $select->formid);
- $output = html_writer::tag('form', $formattributes, $output);
+ $output = html_writer::tag('form', $output, $formattributes);
// and finally one more wrapper with class
- return html_writer::tag('div', array('class' => $select->class), $output);
+ return html_writer::tag('div', $output, array('class' => $select->class));
}
/**
$output = '';
if ($select->label) {
- $output .= html_writer::tag('label', array('for'=>$select->attributes['id']), $select->label);
+ $output .= html_writer::tag('label', $select->label, array('for'=>$select->attributes['id']));
}
if ($select->helpicon instanceof help_icon) {
$output .= html_writer::select($select->urls, 'jump', $select->selected, $select->nothing, $select->attributes);
$go = html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('go')));
- $output .= html_writer::tag('noscript', array('style'=>'inline'), $go);
+ $output .= html_writer::tag('noscript', $go, array('style'=>'inline'));
$nothing = empty($select->nothing) ? false : key($select->nothing);
$output .= $this->page->requires->js_init_call('M.util.init_url_select', array($select->formid, $select->attributes['id'], $nothing));
// then div wrapper for xhtml strictness
- $output = html_writer::tag('div', array(), $output);
+ $output = html_writer::tag('div', $output);
// now the form itself around it
$formattributes = array('method' => 'post',
'action' => new moodle_url('/course/jumpto.php'),
'id' => $select->formid);
- $output = html_writer::tag('form', $formattributes, $output);
+ $output = html_writer::tag('form', $output, $formattributes);
// and finally one more wrapper with class
- return html_writer::tag('div', array('class' => $select->class), $output);
+ return html_writer::tag('div', $output, array('class' => $select->class));
}
/**
$attributes['id'] = $this->add_action_handler(new popup_action('click', $url));
}
- return html_writer::tag('a', $attributes, $icon.$text);
+ return html_writer::tag('a', $icon.$text, $attributes);
}
/**
$id = html_writer::random_id('helpicon');
$attributes['id'] = $id;
$this->add_action_handler(new popup_action('click', $url), $id);
- $output = html_writer::tag('a', $attributes, $output);
+ $output = html_writer::tag('a', $output, $attributes);
// and finally span
- return html_writer::tag('span', array('class' => 'helplink'), $output);
+ return html_writer::tag('span', $output, array('class' => 'helplink'));
}
/**
$link = new moodle_url('/course/scales.php', array('id' => $courseid, 'list' => true, 'scaleid' => $scale->id));
$action = new popup_action('click', $link->url, 'ratingscale');
- return html_writer::tag('span', array('class' => 'helplink'), $this->action_link($link, $icon, $action));
+ return html_writer::tag('span', $this->action_link($link, $icon, $action), array('class' => 'helplink'));
}
/**
$this->add_action_handler(new popup_action('click', $url), $id);
}
- return html_writer::tag('a', $attributes, $output);
+ return html_writer::tag('a', $output, $attributes);
}
/**
if (empty($message)) {
return '';
}
- return html_writer::tag('span', array('class' => 'error'), $message);
+ return html_writer::tag('span', $message, array('class' => 'error'));
}
/**
* @return string the HTML to output.
*/
public function notification($message, $classes = 'notifyproblem') {
- return html_writer::tag('div', array('class' =>
- renderer_base::prepare_classes($classes)), clean_text($message));
+ return html_writer::tag('div', clean_text($message), array('class' => renderer_base::prepare_classes($classes)));
}
/**
}
}
- return html_writer::tag('div', array('class' => 'paging'), $output);
+ return html_writer::tag('div', $output, array('class' => 'paging'));
}
/**
}
if ($table->rotateheaders) {
// we need to wrap the heading content
- $heading->text = html_writer::tag('span', null, $heading->text);
+ $heading->text = html_writer::tag('span', $heading->text);
}
$attributes = array(
if ($heading->header === true) {
$tagtype = 'th';
}
- $output .= html_writer::tag($tagtype, $attributes, $heading->text) . "\n";
+ $output .= html_writer::tag($tagtype, $heading->text, $attributes) . "\n";
}
$output .= html_writer::end_tag('tr') . "\n";
$output .= html_writer::end_tag('thead') . "\n";
// For valid XHTML strict every table must contain either a valid tr
// or a valid tbody... both of which must contain a valid td
$output .= html_writer::start_tag('tbody', array('class' => renderer_base::prepare_classes($table->bodyclasses).' empty'));
- $output .= html_writer::tag('tr', null, html_writer::tag('td', array('colspan'=>count($table->head)), ''));
+ $output .= html_writer::tag('tr', html_writer::tag('td', array('colspan'=>count($table->head)), ''));
$output .= html_writer::end_tag('tbody');
}
}
foreach ($table->data as $key => $row) {
if (($row === 'hr') && ($countcols)) {
- $output .= html_writer::tag('td', array('colspan' => $countcols),
- html_writer::tag('div', array('class' => 'tabledivider'), '')) . "\n";
+ $output .= html_writer::tag('td', html_writer::tag('div', '', array('class' => 'tabledivider')), array('colspan' => $countcols)) . "\n";
} else {
// Convert array rows to html_table_rows and cell strings to html_table_cell objects
if (!($row instanceof html_table_row)) {
if ($cell->header === true) {
$tagtype = 'th';
}
- $output .= html_writer::tag($tagtype, $tdattributes, $cell->text) . "\n";
+ $output .= html_writer::tag($tagtype, $cell->text, $tdattributes) . "\n";
}
}
$output .= html_writer::end_tag('tr') . "\n";
* @return string the HTML to output.
*/
public function skip_link_target($id = null) {
- return html_writer::tag('span', array('id' => $id), '');
+ return html_writer::tag('span', '', array('id' => $id));
}
/**
if ($level < 1 or $level > 6) {
throw new coding_exception('Heading level must be an integer between 1 and 6.');
}
- return html_writer::tag('h' . $level,
- array('id' => $id, 'class' => renderer_base::prepare_classes($classes)), $text);
+ return html_writer::tag('h' . $level, $text, array('id' => $id, 'class' => renderer_base::prepare_classes($classes)));
}
/**
if (!empty($item->id)) {
$divattr['id'] = $item->id;
}
- $content = html_writer::tag('p', $divattr, $content) . $this->tree_block_contents($item->children);
+ $content = html_writer::tag('p', $content, $divattr) . $this->tree_block_contents($item->children);
if (!empty($item->preceedwithhr) && $item->preceedwithhr===true) {
- $content = html_writer::tag('hr', array(), null).$content;
+ $content = html_writer::empty_tag('hr') . $content;
}
- $content = html_writer::tag('li', $liattr, $content);
+ $content = html_writer::tag('li', $content, $liattr);
$lis[] = $content;
}
- return html_writer::tag('ul', $attrs, implode("\n", $lis));
+ return html_writer::tag('ul', implode("\n", $lis), $attrs);
}
/**
$attributes = array('class'=>'skip');
foreach ($this->skiplinks as $url => $text) {
$attributes['href'] = '#' . $url;
- $links .= html_writer::tag('a', $attributes, $text);
+ $links .= html_writer::tag('a', $text, $attributes);
}
- $output = html_writer::tag('div', array('class'=>'skiplinks'), $links) . "\n";
+ $output = html_writer::tag('div', $links, array('class'=>'skiplinks')) . "\n";
// then the clever trick for hiding of things not needed when JS works
$output .= html_writer::script("document.body.className += ' jsenabled';") . "\n";
echo html_writer::start_tag('form', array('action'=>'../empty.php', 'method'=>'post', 'target'=>'empty', 'id'=>'inputForm', 'style'=>'margin:0'));
echo html_writer::empty_tag('input', array('type'=>'text', 'id'=>'input_chat_message', 'name'=>'chat_message', 'size'=>'50', 'value'=>''));
echo html_writer::empty_tag('input', array('type'=>'checkbox', 'id'=>'auto', 'checked'=>'checked', 'value'=>''));
-echo html_writer::tag('label', array('for'=>'auto'), get_string('autoscroll', 'chat'));
+echo html_writer::tag('label', get_string('autoscroll', 'chat'), array('for'=>'auto'));
echo $OUTPUT->help_icon('chatting', get_string('helpchatting', 'chat'), 'chat', true);
echo html_writer::end_tag('form');
$row[1] = html_writer::start_tag('p');
$row[1] .= html_writer::start_tag('font', array('size'=>'1'));
$row[1] .= fullname($chatuser).'<br />';
- $row[1] .= html_writer::tag('span', array('class'=>'dimmed_text'), $stridle . html_writer::tag('span', array('name'=>'uidles', 'id'=>'uidle'.$chatuser->id), $idle)).' ';
- $row[1] .= html_writer::tag('a', array('href'=>new moodle_url('/mod/chat/gui_header_js/users.php', array('chat_sid'=>$chat_sid, 'beep'=>$chatuser->id))), $strbeep);
+ $row[1] .= html_writer::tag('span', $stridle . html_writer::tag('span', $idle, array('name'=>'uidles', 'id'=>'uidle'.$chatuser->id)), array('class'=>'dimmed_text')).' ';
+ $row[1] .= html_writer::tag('a', $strbeep, array('href'=>new moodle_url('/mod/chat/gui_header_js/users.php', array('chat_sid'=>$chat_sid, 'beep'=>$chatuser->id))));
$row[1] .= html_writer::end_tag('font');
$row[1] .= html_writer::end_tag('p');
$table->data[] = $row;
ob_start();
echo $OUTPUT->header();
-echo html_writer::tag('div', array('style'=>'display:none'), html_writer::tag('a', array('href'=>$refreshurl, 'id'=>'refreshLink'), 'Refresh link'));
+echo html_writer::tag('div', html_writer::tag('a', 'Refresh link', array('href'=>$refreshurl, 'id'=>'refreshLink')), array('style'=>'display:none')); //TODO: localize
echo $OUTPUT->table($table);
echo $OUTPUT->footer();
echo '<a href="javascript:select_all_in(\'DIV\',null,\'tablecontainer\');">'.get_string('selectall', 'quiz').'</a> / ';
echo '<a href="javascript:deselect_all_in(\'DIV\',null,\'tablecontainer\');">'.get_string('selectnone', 'quiz').'</a> ';
echo ' ';
- echo html_writer::tag('label', array('for'=>'menuaction'), get_string('withselected', 'quiz'));
+ echo html_writer::tag('label', get_string('withselected', 'quiz'), array('for'=>'menuaction'));
echo html_writer::select(array('delete' => get_string('delete')), 'action', '', array(''=>get_string('moveselectedcoursesto')), array('id'=>'menuaction'));
$PAGE->requires->js_init_call('M.util.init_select_autosubmit', array('attemptsform', 'menuaction', ''));
echo '<noscript id="noscriptmenuaction" style="display:inline">';
*/
public function subscribed_users(user_selector_base $existingusers) {
$output = $this->output->box_start('subscriberdiv boxaligncenter');
- $output .= html_writer::tag('p', array(), get_string('forcessubscribe', 'forum'));
+ $output .= html_writer::tag('p', get_string('forcessubscribe', 'forum'));
$output .= $existingusers->display(true);
$output .= $this->output->box_end();
return $output;
$content .= html_writer::empty_tag('input', array('type'=>'hidden', 'nam'=>'id', 'value'=>$cm->id));
$content .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'pageid', 'value'=>LESSON_EOL));
$content .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'submit', 'value'=>get_string('savechanges', 'lesson')));
- echo html_writer::tag('form', array('method'=>'get', 'target'=>$url), "<div>$content</div>");
+ echo html_writer::tag('form', "<div>$content</div>", array('method'=>'get', 'target'=>$url));
}
// Review button back
$content = html_writer::empty_tag('input', array('type'=>'hidden', 'nam'=>'id', 'value'=>$cm->id));
$content .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'pageid', 'value'=>$page->id));
$content .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'submit', 'value'=>get_string('reviewquestionback', 'lesson')));
- echo html_writer::tag('form', array('method'=>'get', 'target'=>$url), "<div>$content</div>");
+ echo html_writer::tag('form', "<div>$content</div>", array('method'=>'get', 'target'=>$url));
}
$url = new moodle_url('/mod/lesson/view.php', array('id'=>$cm->id, 'pageid'=>$result->newpageid));
$output .= $this->output->box_start('center');
$yeslink = html_writer::link(new moodle_url('/mod/lesson/view.php', array('id'=>$this->page->cm->id, 'pageid'=>$lastpageseenid, 'startlastseen'=>'yes')), get_string('yes'));
- $output .= html_writer::tag('span', array('class'=>'lessonbutton standardbutton'), $yeslink);
+ $output .= html_writer::tag('span', $yeslink, array('class'=>'lessonbutton standardbutton'));
$nolink = html_writer::link(new moodle_url('/mod/lesson/view.php', array('id'=>$this->page->cm->id, 'pageid'=>$lesson->firstpageid, 'startlastseen'=>'no')), get_string('no'));
- $output .= html_writer::tag('span', array('class'=>'lessonbutton standardbutton'), $nolink);
+ $output .= html_writer::tag('span', $nolink, array('class'=>'lessonbutton standardbutton'));
$output .= $this->output->box_end();
return $output;
if ($class !== '') {
$attributes['class'] = $class;
}
- $output = html_writer::tag('p', $attributes, $contents);
+ $output = html_writer::tag('p', $contents, $attributes);
}
/**
* Returns HTML to display add_highscores_form
echo '<a href="javascript:select_all_in(\'DIV\',null,\'scormtablecontainer\');">'.get_string('selectall', 'quiz').'</a> / ';
echo '<a href="javascript:deselect_all_in(\'DIV\',null,\'scormtablecontainer\');">'.get_string('selectnone', 'quiz').'</a> ';
echo ' ';
- echo html_writer::tag('label', array('for'=>'menuaction'), get_string('withselected', 'quiz'));
+ echo html_writer::tag('label', get_string('withselected', 'quiz'), array('for'=>'menuaction'));
echo html_writer::select(array('delete' => get_string('delete')), 'action', '', array(''=>'choosedots'), array('id'=>'menuaction'));
$PAGE->requires->js_init_call('M.util.init_select_autosubmit', array('attemptsform', 'menuaction', ''));
echo '<noscript id="noscriptmenuaction" style="disaply:inline">';
}
$sty = empty($message->sty) ? 'info' : $message->sty;
- $o = html_writer::tag('span', array(), $message->text);
+ $o = html_writer::tag('span', $message->text);
$closer = html_writer::tag('a', array('href' => $this->page->url->out()),
get_string('messageclose', 'workshop'));
$o .= $this->output->container($closer, 'status-message-closer');
// do not display allocation debugging messages
continue;
}
- $o .= html_writer::tag('li', array('class' => $class), $text) . "\n";
+ $o .= html_writer::tag('li', $text, array('class' => $class)) . "\n";
}
$o .= html_writer::end_tag('ul');
$o .= $this->output->continue_button($this->page->url->out());
if ($format == "html") {
// this is the same as the code in the last else-branch
- $outputfiles .= html_writer::tag('li', array('class' => $type), $linkhtml);
+ $outputfiles .= html_writer::tag('li', $linkhtml, array('class' => $type));
} else if ($format == "text") {
$outputfiles .= $linktxt . "\n";
} else {
if (in_array($type, array('image/gif', 'image/jpeg', 'image/png'))) {
$preview = html_writer::empty_tag('img', array('src'=>$fileurl, 'alt'=>'', 'class'=>'preview'));
- $preview = html_writer::tag('a', array('href'=>$fileurl), $preview);
+ $preview = html_writer::tag('a', $preview, array('href'=>$fileurl));
$outputimgs .= $this->output->container($preview);
} else {
// this is the same as the code in html if-branch
- $outputfiles .= html_writer::tag('li', array('class' => $type), $linkhtml);
+ $outputfiles .= html_writer::tag('li', $linkhtml, array('class' => $type));
}
}
}
$outputimgs = $this->output->container($outputimgs, 'images');
}
if ($format !== "text") {
- $outputfiles = html_writer::tag('ul', array('class' => 'files'), $outputfiles);
+ $outputfiles = html_writer::tag('ul', $outputfiles, array('class' => 'files'));
}
return $this->output->container($outputimgs . $outputfiles, 'attachments');
}
$row = new html_table_row();
$row->set_classes('phasetasks');
foreach ($plan as $phasecode => $phase) {
- $title = html_writer::tag('span', array(), $phase->title);
+ $title = html_writer::tag('span', $phase->title);
$actions = '';
foreach ($phase->actions as $action) {
switch ($action->type) {
}
$title = $this->output->container($title, 'title');
$details = $this->output->container($task->details, 'details');
- $out .= html_writer::tag('li', array('class' => $classes), $title . $details);
+ $out .= html_writer::tag('li', $title . $details, array('class' => $classes));
}
if ($out) {
- $out = html_writer::tag('ul', array('class' => 'tasks'), $out);
+ $out = html_writer::tag('ul', $out, array('class' => 'tasks'));
}
return $out;
}
protected function sortable_heading($text, $sortid=null, $sortby=null, $sorthow=null) {
global $PAGE;
- $out = html_writer::tag('span', array('class'=>'text'), $text);
+ $out = html_writer::tag('span', $text, array('class'=>'text'));
if (!is_null($sortid)) {
if ($sortby !== $sortid or $sorthow !== 'ASC') {
protected function grading_report_participant(stdclass $participant, array $userinfo) {
$userid = $participant->userid;
$out = $this->output->user_picture($userinfo[$userid], array('courseid' => $this->page->course->id, 'size' => 35));
- $out .= html_writer::tag('span', array(), fullname($userinfo[$userid]));
+ $out .= html_writer::tag('span', fullname($userinfo[$userid]));
return $out;
}
if ($shownames) {
$userid = $assessment->userid;
$name = $this->output->user_picture($userinfo[$userid], array('courseid' => $this->page->course->id, 'size' => 16));
- $name .= html_writer::tag('span', array('class' => 'fullname'), fullname($userinfo[$userid]));
- $name = $separator . html_writer::tag('span', array('class' => 'user'), $name);
+ $name .= html_writer::tag('span', fullname($userinfo[$userid]), array('class' => 'fullname'));
+ $name = $separator . html_writer::tag('span', $name, array('class' => 'user'));
} else {
$name = '';
}
$output = '';
$skipdest = '';
} else {
- $output = html_writer::tag('a', array('href' => '#sb-' . $bc->skipid, 'class' => 'skip-block'), get_string('skipa', 'access', $skiptitle));
- $skipdest = html_writer::tag('span', array('id' => 'sb-' . $bc->skipid, 'class' => 'skip-block-to'), '');
+ $output = html_writer::tag('a', get_string('skipa', 'access', $skiptitle), array('href' => '#sb-' . $bc->skipid, 'class' => 'skip-block'));
+ $skipdest = html_writer::tag('span', '', array('id' => 'sb-' . $bc->skipid, 'class' => 'skip-block-to'));
}
$output .= html_writer::start_tag('div', $bc->attributes);
$title = '';
if ($bc->title) {
- $title = html_writer::tag('h2', null, $bc->title);
+ $title = html_writer::tag('h2', $bc->title);
}
if ($title || $controlshtml) {
- $output .= html_writer::tag('div', array('class' => 'header'),
- html_writer::tag('div', array('class' => 'title'),
- $title . $controlshtml));
+ $output .= html_writer::tag('div', html_writer::tag('div', $title . $controlshtml, array('class' => 'title')), array('class' => 'header'));
}
$output .= html_writer::start_tag('div', array('class' => 'content'));
$output .= $bc->content;
if ($bc->footer) {
- $output .= html_writer::tag('div', array('class' => 'footer'), $bc->footer);
+ $output .= html_writer::tag('div', $bc->footer, array('class' => 'footer'));
}
$output .= html_writer::end_tag('div');
$output .= html_writer::end_tag('div');
if ($bc->annotation) {
- $output .= html_writer::tag('div', array('class' => 'blockannotation'), $bc->annotation);
+ $output .= html_writer::tag('div', $bc->annotation, array('class' => 'blockannotation'));
}
$output .= $skipdest;
}
echo $OUTPUT->help_icon("participantswithselectedusers", get_string("withselectedusers"));
- echo html_writer::tag('label', array('for'=>'formactionid'), get_string("withselectedusers"));
+ echo html_writer::tag('label', get_string("withselectedusers"), array('for'=>'formactionid'));
echo html_writer::select($displaylist, 'formaction', '', array(''=>'choosedots'), array('id'=>'formactionid'));
echo '<input type="hidden" name="id" value="'.$course->id.'" />';
!$printableformat,
true);
} else {
- $documentationhtml .= html_writer::tag('strong', array(), $functionname);
+ $documentationhtml .= html_writer::tag('strong', $functionname);
$documentationhtml .= $br;
}
$contents .= $br.$br;
$contents .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'submit', 'value'=>get_string('wsdocumentation', 'webservice')));
- $htmlloginpage .= html_writer::tag('form', array('method'=>'post', 'target'=>$target), "<div>$contents</div>");
+ $htmlloginpage .= html_writer::tag('form', "<div>$contents</div>", array('method'=>'post', 'target'=>$target));
$htmlloginpage .= html_writer::end_tag('td');
$htmlloginpage .= html_writer::end_tag('tr');