X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxorgpage.php;h=b132fe834adb4be48bd41b8b066f3cb1f7b8d9aa;hb=fda78a6777a5f385537fc9f291afb310e12525e5;hp=83824d898be119f724a8acc603bc92124c94b3ad;hpb=d53c12097f4e82ad4657de86f199699973dee29f;p=platal.git diff --git a/classes/xorgpage.php b/classes/xorgpage.php index 83824d8..b132fe8 100644 --- a/classes/xorgpage.php +++ b/classes/xorgpage.php @@ -1,6 +1,6 @@ changeTpl('platal/index.tpl'); + if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) { + $this->addJsLink('json2.js'); + } $this->addJsLink('jquery.xorg.js'); $this->addJsLink('overlib.js'); $this->addJsLink('core.js'); $this->addJsLink('xorg.js'); + if ($globals->core->sentry_js_dsn) { + $this->addJsLink('raven.min.js'); + } $this->setTitle('le site des élèves et anciens élèves de l\'École polytechnique'); if (S::logged() && S::user()->checkPerms('admin')) { $types = array(S::user()->type); @@ -49,17 +59,40 @@ class XorgPage extends PlPage } } + /** Force the skin to use, bypassing user choice. + * Typically used for the 'register' page. + * @param $skin The skin to use. + */ + public function forceSkin($skin) + { + $this->forced_skin = $skin; + } + + /** Choose another 'default' skin. + * Typically used for the 'Auth Groupe X' login page. + * @param $skin The default skin to use. + */ + public function setDefaultSkin($skin) + { + $this->default_skin = $skin; + } + public function run() { global $globals, $platal; - if (isset($platal) && $platal->path == 'register') { - $skin = $globals->register_skin . ".tpl"; + if ($this->forced_skin !== null) { + $skin = $this->forced_skin . '.tpl'; } else { - $skin = S::v('skin', $globals->skin . ".tpl"); + if ($this->default_skin === null) { + $default_skin = $globals->skin; + } else { + $default_skin = $this->default_skin; + } + $skin = S::v('skin', $default_skin . '.tpl'); } $this->_run('skin/' . $skin); } } -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>