From: x2000habouzit Date: Wed, 28 Jan 2004 11:25:16 +0000 (+0000) Subject: fonction de cache qui crée une arborescence de cache 'human readable' X-Git-Tag: xorg/old~1924 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=0aa378b7657155a64a41466ba2f4705ee0cd8792;p=platal.git fonction de cache qui crée une arborescence de cache 'human readable' --- diff --git a/include/xorg.page.inc.php b/include/xorg.page.inc.php index 27195e0..5cb64e1 100644 --- a/include/xorg.page.inc.php +++ b/include/xorg.page.inc.php @@ -38,7 +38,7 @@ class XorgPage extends DiogenesCorePage { } function display($append_to_id="") { - $id = $this->make_id() . ($append_to_id ? "-$append_to_id" : ""); + $id = $this->make_id($append_to_id); if($this->_page_type == POPUP) parent::display('skin/'.$_SESSION['skin_popup'], $id); else @@ -46,10 +46,17 @@ class XorgPage extends DiogenesCorePage { exit; } - function make_id() { - $auth = (empty($_SESSION['auth']) ? 0 : $_SESSION['auth']); - $perms = (empty($_SESSION['perms']) ? 0 : $_SESSION['perms']); - return $this->_tpl."-$auth-$perms"; + function make_id($append_to_id="") { + $ret = str_replace('/','|',$this->_tpl); + if($append_to_id) + $ret.="|$append_to_id"; + + $auth_trans = Array(AUTH_PUBLIC => 'public', AUTH_COOKIE => 'cookie', AUTH_MDP => 'passwd'); + $ret .= '|A_'.$auth_trans[empty($_SESSION['auth']) ? AUTH_PUBLIC : $_SESSION['auth']]; + + $ret .= '-'.(empty($_SESSION['perms']) ? PERMS_EXT : $_SESSION['perms']); + + return $ret; } function doAuth() { }