diff --git a/inc/class.page.php b/inc/class.page.php
--- a/inc/class.page.php
+++ b/inc/class.page.php
@@ -82,6 +82,7 @@ class page
private $trackingcode = ''; // Tracking code
private $pagetitle = ''; // Title of page
private $scripts = array(); // Scripts to include on page
+ private $meta;
/* the current school. See get_school(). */
private $school;
@@ -139,6 +140,11 @@ class page
$this->pagetitle = $ntitle;
$this->scripts = $nscripts;
+ $this->meta = array(
+ 'msapplication-starturl' => self::uri_resolve(''),
+ 'msapplication-task' => 'name=Create Schedule; action-uri=' . self::uri_resolve('input.php') . '; icon-uri=' . self::uri_resolve('images/favicon_96.png'),
+ 'msapplication-tooltip' => 'Find the semester schedule which works for you!',
+ );
/* Compliant browsers which care, such as gecko, explicitly request xhtml: */
if(empty($_SERVER['HTTP_ACCEPT']) /* then the browser doesn't care :-) */
@@ -238,6 +244,60 @@ class page
/**
* \brief
+ * Set a meta element value.
+ * \param $name
+ * The name of the meta attribute.
+ * \param $value
+ * The value.
+ */
+ public function meta($name, $value = '')
+ {
+ $this->meta[$name] = $value;
+ }
+
+ /**
+ * \brief
+ * Set the information necessary to create a canonical URI
+ * description.
+ *
+ * For declaring a page's canonical URI, we use both and soft redirects.
+ *
+ * \param $uri
+ * The base URI for the current page.
+ * \param $query
+ * The querystring to canonicalize on.
+ */
+ public function canonize($uri, array $query = array())
+ {
+ $query_string = '';
+ $uri_full = $uri;
+ if (!empty($query))
+ {
+ ksort($query);
+ $query_members = array();
+ foreach ($query as $key => $value)
+ $query_members[] = rawurlencode($key) . '=' . rawurlencode($value);
+ $query_string = implode('&', $query_members);
+ $uri_full .= '?' . $query_string;
+ }
+
+ /* Detect if we are at the canonical location or not... */
+ list($base_request_uri) = explode('?', $_SERVER['REQUEST_URI'], 2);
+ $base_request_uri = substr($_SERVER['REQUEST_URI'], strrpos($base_request_uri, '/') + 1);
+ if ($base_request_uri != $uri_full)
+ /* We are not canonical, redirect. */
+ $this->redirect($uri_full);
+
+ /* Mention that this is a canonical URI with */
+ $this->headcode_add('link_rel_canonical', 'xhtml ? '/>' : '>'),
+ TRUE);
+ }
+
+ /**
+ * \brief
* Output the HTML header for a page, including ,