fonction de cache qui crée une arborescence de cache 'human readable'
authorx2000habouzit <x2000habouzit>
Wed, 28 Jan 2004 11:25:16 +0000 (11:25 +0000)
committerx2000habouzit <x2000habouzit>
Wed, 28 Jan 2004 11:25:16 +0000 (11:25 +0000)
include/xorg.page.inc.php

index 27195e0..5cb64e1 100644 (file)
@@ -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() { }