コード例 #1
0
 /**
  * A wrapper to get a module specific user preference.
  * this method only applies to admin users.
  *
  * @param string $pref_name The preference name
  * @param string $dflt_value The default value for the preference if not set (or empty)
  * @param bool $allow_empty Wether the default value should be used if the preference exists, but is empty.
  * @return string.
  */
 public function CGGetUserPreference($pref_name, $dflt_value = null, $allow_empty = FALSE)
 {
     $key = '__' . $this->GetName() . '_' . $pref_name;
     $tmp = cms_userprefs::get($key, $dflt_value);
     if (!empty($tmp) || is_numeric($tmp)) {
         return $tmp;
     }
     if ($allow_empty) {
         return $tmp;
     }
     return $dflt_value;
 }
コード例 #2
0
 public static function get_cwd()
 {
     // check the path
     $path = cms_userprefs::get('filemanager_cwd', self::get_default_cwd());
     if (self::test_invalid_path($path)) {
         $path = self::get_default_cwd();
     }
     if ($path == '') {
         $path = '/';
     }
     return $path;
 }