/**
  * Handy wrapper to retrieve a preference from the Wordless::preference()
  * method.
  *
  * If the preference is not set, the returned value will be the one specified
  * using the WordlessPreprocessor::set_preference_default_value() method.
  *
  * @see Wordless:preference()
  * @see Wordless:set_preference_default()
  */
 protected function preference($name)
 {
     $possible_names = array($name);
     if (isset($this->deprecated_preferences[$name])) {
         $possible_names = $this->deprecated_preferences[$name];
         array_unshift($possible_names, $name);
     }
     foreach ($possible_names as $possible_name) {
         $value = Wordless::preference($possible_name, NULL);
         if (isset($value)) {
             return $value;
         }
     }
     return $this->preferences_defaults[$name];
 }
Beispiel #2
0
 /**
  * Return the theme version, based on prederence set in Wordless config file.
  *
  * @return string
  *   The assets version string
  *
  * @ingroup helperfunc
  */
 protected function get_asset_version_string()
 {
     return Wordless::preference('assets.version', NULL);
 }
 /**
  * Handy wrapper to retrieve a preference from the Wordless::preference()
  * method.
  *
  * If the preference is not set, the returned value will be the one specified
  * using the WordlessPreprocessor::set_preference_default_value() method.
  *
  * @see Wordless:preference()
  * @see Wordless:set_preference_default()
  */
 protected function preference($name)
 {
     return Wordless::preference($name, $this->preferences_defaults[$name]);
 }