Permalink
Browse files

MDL-39839 renderer: new methods for calls appearing in theme layouts

  • Loading branch information...
1 parent 03fa7a2 commit 2d28b03d90de81286cb5d2364deab3d4be083c7e Sam Hemelryk committed Jun 6, 2013
Showing with 69 additions and 0 deletions.
  1. +69 −0 lib/outputrenderers.php
View
@@ -3098,6 +3098,75 @@ public function body_attributes($additionalclasses = array()) {
}
return ' id="'. $this->body_id().'" class="'.$this->body_css_classes($additionalclasses).'"';
}
+
+ /**
+ * Gets HTML for the page heading.
+ *
+ * @since 2.5.1 2.6
+ * @param string $tag The tag to encase the heading in. h1 by default.
+ * @return string HTML.
+ */
+ public function page_heading($tag = 'h1') {
+ return html_writer::tag($tag, $this->page->heading);
+ }
+
+ /**
+ * Gets the HTML for the page heading button.
+ *
+ * @since 2.5.1 2.6
+ * @return string HTML.
+ */
+ public function page_heading_button() {
+ return $this->page->button;
+ }
+
+ /**
+ * Returns the Moodle docs link to use for this page.
+ *
+ * @since 2.5.1 2.6
+ * @param string $text
+ * @return string
+ */
+ public function page_doc_link($text = null) {
+ if ($text === null) {
+ $text = get_string('moodledocslink');
+ }
+ $path = page_get_doc_link_path($this->page);
+ if (!$path) {
+ return '';
+ }
+ return $this->doc_link($path, $text);
+ }
+
+ /**
+ * Returns the page heading menu.
+ *
+ * @since 2.5.1 2.6
+ * @return string HTML.
+ */
+ public function page_heading_menu() {
+ return $this->page->headingmenu;
+ }
+
+ /**
+ * Returns the title to use on the page.
+ *
+ * @since 2.5.1 2.6
+ * @return string
+ */
+ public function page_title() {
+ return $this->page->title;
+ }
+
+ /**
+ * Returns the URL for the favicon.
+ *
+ * @since 2.5.1 2.6
+ * @return string The favicon URL
+ */
+ public function favicon() {
+ return $this->pix_url('favicon', 'theme');
+ }
}
/**

0 comments on commit 2d28b03

Please sign in to comment.