X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxorgpage.php;h=2bf2062b95e126a53e4170884a6d81c92a736b37;hb=6f9358f44cc8bcbba718c52a1b3e0bb4d70d0f13;hp=852b842c9cb9992af78a386190c5d64a3add3473;hpb=d47dc66aaefe08eb4a8e65888dd499d85a6beb55;p=platal.git diff --git a/classes/xorgpage.php b/classes/xorgpage.php index 852b842..2bf2062 100644 --- a/classes/xorgpage.php +++ b/classes/xorgpage.php @@ -21,6 +21,9 @@ class XorgPage extends PlPage { + protected $forced_skin = null; + protected $default_skin = null; + public function __construct() { parent::__construct(); @@ -52,13 +55,36 @@ 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); }