ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilDBUpdate3004.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
9 {
10  static function createPathFromId($a_container_id,$a_name)
11  {
12  $max_exponent = 3;
13  $st_factor = 100;
14 
15  $path = array();
16  $found = false;
17  $num = $a_container_id;
18  for($i = $max_exponent; $i > 0;$i--)
19  {
20  $factor = pow($st_factor, $i);
21  if(($tmp = (int) ($num / $factor)) or $found)
22  {
23  $path[] = $tmp;
24  $num = $num % $factor;
25  $found = true;
26  }
27  }
28 
29  if(count($path))
30  {
31  $path_string = (implode('/',$path).'/');
32  }
33  return $path_string.$a_name.'_'.$a_container_id;
34  }
35 
36 }
37 ?>