Permalink
Browse files

output MDL-25597 Added three new config settings that allow you to ad…

…d additional HTML to every page.
  • Loading branch information...
1 parent feaddca commit 90e920c7f48f156fbc419f134aa8e27efc0a9a8e Sam Hemelryk committed Dec 7, 2010
Showing with 29 additions and 1 deletion.
  1. +7 −0 admin/settings/appearance.php
  2. +9 −0 lang/en/admin.php
  3. +13 −1 lib/outputrenderers.php
@@ -130,6 +130,13 @@
// link to tag management interface
$ADMIN->add('appearance', new admin_externalpage('managetags', get_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
+
+ $temp = new admin_settingpage('additionalhtml', get_string('additionalhtml', 'admin'));
+ $temp->add(new admin_setting_heading('additionalhtml_heading', get_string('additionalhtml_heading', 'admin'), get_string('additionalhtml_desc', 'admin')));
+ $temp->add(new admin_setting_configtextarea('additionalhtmlhead', get_string('additionalhtmlhead', 'admin'), get_string('additionalhtmlhead_desc', 'admin'), '', PARAM_RAW));
+ $temp->add(new admin_setting_configtextarea('additionalhtmltopofbody', get_string('additionalhtmltopofbody', 'admin'), get_string('additionalhtmltopofbody_desc', 'admin'), '', PARAM_RAW));
+ $temp->add(new admin_setting_configtextarea('additionalhtmlfooter', get_string('additionalhtmlfooter', 'admin'), get_string('additionalhtmlfooter_desc', 'admin'), '', PARAM_RAW));
+ $ADMIN->add('appearance', $temp);
} // end of speedup
View
@@ -25,6 +25,15 @@
$string['accessdenied'] = 'Access denied';
$string['accounts'] = 'Accounts';
+$string['additionalhtml'] = 'Additional HTML';
+$string['additionalhtml_heading'] = 'Additional HTML to be added to every page.';
+$string['additionalhtml_desc'] = 'These settings allow you to specify HTML that you want added to every page. You can set HTML that will be added within the HEAD tag for the page, immediatly after the BODY tag has been opened, or immediatly before the body tag is closed.<br />Doing this allows you add custom headers or footers on every page, or add support for services like Google Analytics very easily and independent of your chosen theme.';
+$string['additionalhtmlhead'] = 'Within HEAD';
+$string['additionalhtmlhead_desc'] = 'Content here will be added to the bottom of the HEAD tag for every page.';
+$string['additionalhtmltopofbody'] = 'When BODY is opened';
+$string['additionalhtmltopofbody_desc'] = 'Content here will be added in to every page immediatly after the opening body tag.';
+$string['additionalhtmlfooter'] = 'Before BODY is closed';
+$string['additionalhtmlfooter_desc'] = 'Content here will be added in to every page right before the body tag is closed.';
$string['adminseesall'] = 'Admins see all';
$string['adminseesallevents'] = 'Administrators see all events';
$string['adminseesownevents'] = 'Administrators are just like other users';
View
@@ -324,6 +324,10 @@ public function standard_head_html() {
$output .= html_writer::empty_tag('link', array('rel' => 'alternate',
'type' => $type, 'title' => $alt->title, 'href' => $alt->url));
}
+
+ if (!empty($CFG->additionalhtmlhead)) {
+ $output .= "\n".$CFG->additionalhtmlhead;
+ }
return $output;
}
@@ -334,7 +338,12 @@ public function standard_head_html() {
* @return string HTML fragment.
*/
public function standard_top_of_body_html() {
- return $this->page->requires->get_top_of_body_code();
+ global $CFG;
+ $output = $this->page->requires->get_top_of_body_code();
+ if (!empty($CFG->additionalhtmltopofbody)) {
+ $output .= "\n".$CFG->additionalhtmltopofbody;
+ }
+ return $output;
}
/**
@@ -367,6 +376,9 @@ public function standard_footer_html() {
<li><a href="http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=0&amp;warnp2n3e=1&amp;url1=' . urlencode(qualified_me()) . '">WCAG 1 (2,3) Check</a></li>
</ul></div>';
}
+ if (!empty($CFG->additionalhtmlfooter)) {
+ $output .= "\n".$CFG->additionalhtmlfooter;
+ }
return $output;
}

0 comments on commit 90e920c

Please sign in to comment.