$link->text = $this->image($image);
if (!empty($link->linktext)) {
- $link->text = "$link->title $link->text";
+ $link->text = "$link->title   $link->text";
}
}
$output .= get_string('page') . ':';
if (!empty($pagingbar->previouslink)) {
- $output .= ' (' . $this->link($pagingbar->previouslink) . ') ';
+ $output .= ' (' . $this->link($pagingbar->previouslink) . ') ';
}
if (!empty($pagingbar->firstlink)) {
- $output .= ' ' . $this->link($pagingbar->firstlink) . ' ...';
+ $output .= ' ' . $this->link($pagingbar->firstlink) . ' ...';
}
foreach ($pagingbar->pagelinks as $link) {
if ($link instanceof html_link) {
- $output .= ' ' . $this->link($link);
+ $output .= '  ' . $this->link($link);
} else {
- $output .= " $link";
+ $output .= "  $link";
}
}
if (!empty($pagingbar->lastlink)) {
- $output .= ' ...' . $this->link($pagingbar->lastlink) . ' ';
+ $output .= ' ...' . $this->link($pagingbar->lastlink) . ' ';
}
if (!empty($pagingbar->nextlink)) {
- $output .= ' (' . $this->link($pagingbar->nextlink) . ')';
+ $output .= '  (' . $this->link($pagingbar->nextlink) . ')';
}
}
$this->assert(new ContainsTagWithAttributes('form', array('method' => 'post', 'action' => 'http://www.test.com/index.php')), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'continue', 'value' => 1)), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())), $html);
- $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('yes'), 'class' => 'singlebutton')), $html);
+ $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('continue'), 'class' => 'singlebutton')), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'cancel', 'value' => 1)), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())), $html);
- $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('no'), 'class' => 'singlebutton')), $html);
+ $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('cancel'), 'class' => 'singlebutton')), $html);
// Use html_forms with default values, should produce exactly the same output as above
$formcontinue = new html_form();
$formcancel = new html_form();
$formcontinue->url = new moodle_url($continueurl);
$formcancel->url = new moodle_url($cancelurl);
+ $formcontinue->button->text = get_string('continue');
+ $formcancel->button->text = get_string('cancel');
$html = $this->renderer->confirm($message, $formcontinue, $formcancel);
$this->assert(new ContainsTagWithAttributes('div', array('id' => 'notice', 'class' => 'box generalbox')), $html);
$this->assert(new ContainsTagWithContents('p', $message), $html);
$this->assert(new ContainsTagWithAttributes('form', array('method' => 'post', 'action' => 'http://www.test.com/index.php')), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'continue', 'value' => 1)), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())), $html);
- $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('yes'), 'class' => 'singlebutton')), $html);
+ $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('continue'), 'class' => 'singlebutton')), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'cancel', 'value' => 1)), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())), $html);
- $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('no'), 'class' => 'singlebutton')), $html);
+ $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('cancel'), 'class' => 'singlebutton')), $html);
// Give the buttons some different labels
$formcontinue = new html_form();
// Change the method and add extra variables
$formcontinue = new html_form();
$formcancel = new html_form();
+ $formcontinue->button->text = get_string('continue');
+ $formcancel->button->text = get_string('cancel');
$formcontinue->url = new moodle_url($continueurl, array('var1' => 'val1', 'var2' => 'val2'));
$formcancel->url = new moodle_url($cancelurl, array('var3' => 'val3', 'var4' => 'val4'));
$html = $this->renderer->confirm($message, $formcontinue, $formcancel);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'var1', 'value' => 'val1')), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'var2', 'value' => 'val2')), $html);
- $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('yes'), 'class' => 'singlebutton')), $html);
+ $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('continue'), 'class' => 'singlebutton')), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'cancel', 'value' => 1)), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())), $html);
- $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('no'), 'class' => 'singlebutton')), $html);
+ $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('cancel'), 'class' => 'singlebutton')), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'var3', 'value' => 'val3')), $html);
$this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'var4', 'value' => 'val4')), $html);
}
public function test_paging_bar() {
- global $CFG, $OUTPUT;
+ global $CFG;
$totalcount = 5;
$perpage = 4;
$originalbar = clone($pagingbar);
- $html = $OUTPUT->paging_bar($pagingbar);
+ $html = $this->renderer->paging_bar($pagingbar);
$this->assert(new ContainsTagWithAttribute('div', 'class', 'paging'), $html);
// the 'Previous' link