Beispiel #1
0
 /**
  * Get the customizable variables of a custom theme
  *
  * @param ServiceBase $api
  * @param array $args
  *
  * @return array Collection of objects {"name": varName, "value": value}
  */
 public function getCustomThemeVars(ServiceBase $api, array $args)
 {
     // Validating arguments
     $platform = isset($args['platform']) ? $args['platform'] : 'base';
     $themeName = isset($args['themeName']) ? $args['themeName'] : null;
     $output = array();
     $theme = new SidecarTheme($platform, $themeName);
     $variablesByType = $theme->getThemeVariables();
     foreach ($variablesByType as $type => $variables) {
         foreach ($variables as $lessVar => $lessValue) {
             $output[$type][] = array('name' => $lessVar, 'value' => $lessValue);
         }
     }
     return $output;
 }