Beispiel #1
0
 /**
  * Return the configuration setting for a given path
  *
  * @param string $path    Tokenized path, eg "module class var", dP proof
  * @param mixed  $context The context
  *
  * @return mixed String or array of values depending on the path
  */
 static function conf($path = "", $context = null)
 {
     if ($context) {
         if ($context instanceof CMbObject) {
             $context = $context->_guid;
         }
         return CConfiguration::getValue($context, $path);
     }
     global $dPconfig;
     $conf = $dPconfig;
     if (!$path) {
         return $conf;
     }
     $items = explode(' ', $path);
     foreach ($items as $part) {
         // dP ugly hack
         if (!array_key_exists($part, $conf) && array_key_exists("dP{$part}", $conf)) {
             $part = "dP{$part}";
         }
         $conf = $conf[$part];
     }
     return $conf;
 }