示例#1
0
 /**
  * Returns the manifest data as an array.
  *
  * @param   AppConfiguration    $configuration      The configuration to create the manifest from.
  *
  * @return  array
  */
 public function get(AppConfiguration $configuration)
 {
     $manifest = [];
     if (($backgroundColor = $configuration->getBackgroundColor()) !== null) {
         $manifest["background_color"] = $backgroundColor;
     }
     if (($description = $configuration->getDescription()) !== null) {
         $manifest["description"] = $description;
     }
     if (($direction = $configuration->getDirection()) !== null) {
         $manifest["dir"] = $direction;
     }
     if (($display = $configuration->getDisplay()) !== null) {
         $manifest["display"] = $display;
     }
     if (count($icons = $configuration->getIcons()) > 0) {
         $manifest["icons"] = [];
         foreach ($icons as $icon) {
             $manifest["icons"][] = $this->getImageData($icon);
         }
     }
     if (($language = $configuration->getLanguage()) !== null) {
         $manifest["lang"] = $language;
     }
     if (($name = $configuration->getName()) !== null) {
         $manifest["name"] = $name;
     }
     if (($orientation = $configuration->getOrientation()) !== null) {
         $manifest["orientation"] = $orientation;
     }
     if (($scope = $configuration->getScope()) !== null) {
         $manifest["scope"] = $scope;
     }
     if (count($screenshots = $configuration->getScreenshots()) > 0) {
         $manifest["screenshots"] = [];
         foreach ($screenshots as $screenshot) {
             $manifest["screenshots"][] = $this->getImageData($screenshot);
         }
     }
     if (($shortName = $configuration->getShortName()) !== null) {
         $manifest["short_name"] = $shortName;
     }
     if (($startUrl = $configuration->getStartUrl()) !== null) {
         $manifest["start_url"] = $startUrl;
     }
     if (($themeColor = $configuration->getThemeColor()) !== null) {
         $manifest["theme_color"] = $themeColor;
     }
     return $manifest;
 }
示例#2
0
 private function getMicrosoftTags(AppConfiguration $configuration)
 {
     $tags = [];
     // Start URL
     // https://msdn.microsoft.com/en-us/library/gg491732(v=vs.85).aspx#msapplication-starturl
     if (($startUrl = $configuration->getStartUrl()) !== null) {
         $tags[] = ["meta", "name" => "msapplication-starturl", "content" => $startUrl];
     }
     // Theme color
     // https://msdn.microsoft.com/en-us/library/gg491732(v=vs.85).aspx#msapplication-navbutton-color
     if (($themeColor = $configuration->getThemeColor()) !== null) {
         $tags[] = ["meta", "name" => "msapplication-navbutton-color", "content" => $themeColor];
     }
     return $tags;
 }