├── src
└── app
│ ├── locale
│ └── de_DE
│ │ └── Sitewards_Webappmanifest.csv
│ ├── etc
│ └── modules
│ │ └── Sitewards_Webappmanifest.xml
│ ├── code
│ └── community
│ │ └── Sitewards
│ │ └── Webappmanifest
│ │ ├── Helper
│ │ └── Data.php
│ │ ├── controllers
│ │ └── IndexController.php
│ │ ├── etc
│ │ ├── adminhtml.xml
│ │ ├── config.xml
│ │ └── system.xml
│ │ └── Model
│ │ ├── System
│ │ └── Config
│ │ │ └── Source
│ │ │ └── Display.php
│ │ ├── Manifest.php
│ │ └── Icons.php
│ └── design
│ └── frontend
│ └── base
│ └── default
│ └── layout
│ └── sitewards
│ └── webappmanifest.xml
├── modman
├── LICENSE
├── composer.json
└── README.md
/src/app/locale/de_DE/Sitewards_Webappmanifest.csv:
--------------------------------------------------------------------------------
1 | "Shortname (property Name equals the Store-Name)","Kurz Name (die Property Name wird anhand des Storenamen gesetzt)"
2 | "Author","Autor"
3 | "Theme color (hex or color name)","Theme-Farbe (Hex-Wert oder Farbname)"
4 | "Background color (hex or color name)","Hintergrund-Farbe (Hex-Wert oder Farbname)"
--------------------------------------------------------------------------------
/modman:
--------------------------------------------------------------------------------
1 | src/app/etc/modules/Sitewards_Webappmanifest.xml app/etc/modules/Sitewards_Webappmanifest.xml
2 | src/app/code/community/Sitewards/Webappmanifest app/code/community/Sitewards/Webappmanifest
3 | src/app/locale/de_DE/Sitewards_Webappmanifest.csv app/locale/de_DE/Sitewards_Webappmanifest.csv
4 | src/app/design/frontend/base/default/layout/sitewards/webappmanifest.xml app/design/frontend/base/default/layout/sitewards/webappmanifest.xml
--------------------------------------------------------------------------------
/src/app/etc/modules/Sitewards_Webappmanifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 | true
14 | community
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/app/code/community/Sitewards/Webappmanifest/Helper/Data.php:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 | manifest
15 | /manifest.json
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/app/code/community/Sitewards/Webappmanifest/controllers/IndexController.php:
--------------------------------------------------------------------------------
1 | getResponse();
20 | $oResponse->setHeader('Content-type', 'text/json');
21 | $oResponse->setBody(json_encode($oManifestModel, JSON_UNESCAPED_SLASHES));
22 | }
23 | }
--------------------------------------------------------------------------------
/src/app/code/community/Sitewards/Webappmanifest/etc/adminhtml.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | Sitewards - PWA Configuration
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017 Sitewards GmbH
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 |
--------------------------------------------------------------------------------
/src/app/code/community/Sitewards/Webappmanifest/Model/System/Config/Source/Display.php:
--------------------------------------------------------------------------------
1 | 'fullscreen',
21 | 'label' => Mage::helper('sitewards_webappmanifest')->__('Full Screen')),
22 | array(
23 | 'value' => 'standalone',
24 | 'label' => Mage::helper('sitewards_webappmanifest')->__('Standalone')),
25 | array(
26 | 'value' => 'minimal-ui',
27 | 'label' => Mage::helper('sitewards_webappmanifest')->__('Minimal UI')),
28 | array(
29 | 'value' => 'browser',
30 | 'label' => Mage::helper('sitewards_webappmanifest')->__('Browser')),
31 | );
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sitewards/magento-webappmanifest",
3 | "description": "Web application manifest implementation for Magento",
4 | "type": "magento-module",
5 | "homepage": "https://github.com/sitewards/magento-webappmanifest.git",
6 | "license": "MIT",
7 | "authors": [
8 | {
9 | "name": "Tobias Hartmann",
10 | "email": "mail@sitewards.com",
11 | "homepage": "https://www.sitewards.com/",
12 | "role": "Developer"
13 | },
14 | {
15 | "name": "Patrick Kubica",
16 | "email": "mail@sitewards.com",
17 | "homepage": "https://www.sitewards.com/",
18 | "role": "Developer"
19 | },
20 | {
21 | "name": "Andrew Howden",
22 | "email": "mail@sitewards.com",
23 | "homepage": "https://www.sitewards.com/",
24 | "role": "Developer"
25 | }
26 | ],
27 | "support": {
28 | "email": "mail@sitewards.com",
29 | "issues": "https://github.com/sitewards/magento-webappmanifest.git/issues",
30 | "wiki": "https://github.com/sitewards/magento-webappmanifest.git/wiki",
31 | "source": "https://github.com/sitewards/magento-webappmanifest.git"
32 | },
33 | "require": {
34 | "php": ">=5.5"
35 | },
36 | "require-dev": {
37 | },
38 | "suggest": {
39 | },
40 | "conflict": {
41 | },
42 | "archive": {
43 | "exclude": [
44 | "test",
45 | "hack",
46 | "hooks",
47 | ".arclint"
48 | ]
49 | },
50 | "config": {
51 | "bin-dir": "bin",
52 | "store-auths": false,
53 | "optimize-autoloader": true,
54 | "sort-packages": true,
55 | "apcu-autoloader": true,
56 | "notify-on-install": false
57 | },
58 | "minimum-stability": "stable"
59 | }
60 |
--------------------------------------------------------------------------------
/src/app/code/community/Sitewards/Webappmanifest/Model/Manifest.php:
--------------------------------------------------------------------------------
1 | aManifestData['name'] = Mage::getStoreConfig('general/store_information/name');
21 | $this->aManifestData['lang'] = Mage::app()->getLocale()->getLocaleCode();
22 | $this->aManifestData['manifest_version'] = '2';
23 | $this->aManifestData['start_url'] = '/';
24 |
25 | /** @var Sitewards_Webappmanifest_Model_Icons $oIconModel */
26 | $oIconModel = Mage::getModel('sitewards_webappmanifest/icons');
27 | $aIcons = $oIconModel->getIconArray();
28 |
29 | if (!empty($aIcons)) {
30 | $this->aManifestData['icons'] = $aIcons;
31 | }
32 |
33 | $this->loadConfigurableOptions();
34 | }
35 |
36 | /**
37 | * @return void
38 | */
39 | private function loadConfigurableOptions()
40 | {
41 | $aSettings = Mage::getStoreConfig('webappmanifest/settings');
42 | foreach ($aSettings as $sKey => $mSetting) {
43 | if (!is_array($mSetting)) {
44 | $this->aManifestData[$sKey] = $mSetting;
45 | continue;
46 | }
47 |
48 | $this->aManifestData[$sKey] = array_values($mSetting);
49 | }
50 | }
51 |
52 | /**
53 | * @return array
54 | */
55 | public function getManifestData()
56 | {
57 | return $this->aManifestData;
58 | }
59 |
60 | /**
61 | * @return string
62 | */
63 | public function jsonSerialize()
64 | {
65 | return $this->getManifestData();
66 | }
67 | }
--------------------------------------------------------------------------------
/src/app/code/community/Sitewards/Webappmanifest/etc/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 | 1.0.0
14 |
15 |
16 |
17 |
18 |
19 | Sitewards_Webappmanifest_Model
20 |
21 |
22 |
23 |
24 | Sitewards_Webappmanifest_Helper
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | sitewards/webappmanifest.xml
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | Sitewards_Webappmanifest
41 | manifest.json
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | Sitewards_Webappmanifest.csv
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | icon.png
61 |
62 |
63 | Magento
64 | Shop
65 | #ffffff
66 | #f46f25
67 | standalone
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/src/app/code/community/Sitewards/Webappmanifest/Model/Icons.php:
--------------------------------------------------------------------------------
1 | getStoragePath($sScope);
46 |
47 | $sBasePath = $sStoragePath . $sFileName;
48 |
49 | $sNewPath = $sStoragePath . $sSize . 'x' . $sSize . '_' . $sFileName;
50 | if (file_exists($sBasePath) && is_file($sBasePath) && !file_exists($sNewPath)) {
51 | $oImageObj = new Varien_Image($sBasePath);
52 | $oImageObj->constrainOnly(true);
53 | $oImageObj->keepAspectRatio(false);
54 | $oImageObj->keepFrame(false);
55 | $oImageObj->resize($sSize, $sSize);
56 | $oImageObj->save($sNewPath);
57 | }
58 |
59 | return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'manifest' . DS . $sScope . DS . $sSize . 'x' . $sSize . '_' . $sFileName;
60 | }
61 |
62 | /**
63 | * @return array
64 | */
65 | public function getIconArray()
66 | {
67 | /**
68 | * @var array $aFilePath scope,filename
69 | */
70 | $aFilePath = explode('/', Mage::getStoreConfig(self::S_ICON_CONFIG_PATH));
71 |
72 | $sScope = $aFilePath[0];
73 | $sFileName = $aFilePath[1];
74 |
75 | $aIcons = [];
76 |
77 | if (empty($sFileName)) {
78 | return $aIcons;
79 | }
80 |
81 | foreach ($this->aManifestIconSizes as $iIconSize) {
82 | $aIcons[] = [
83 | 'src' => $this->getResizedImageUrl($sFileName, $iIconSize, $sScope),
84 | 'sizes' => $iIconSize . 'x' . $iIconSize,
85 | 'type' => self::S_IMAGE_TYPE,
86 | ];
87 | }
88 |
89 | return $aIcons;
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Sitewards_MagentoWebAppManifest
2 | ===============================
3 |
4 | This is an implementation of the web app manifest specification. A detailed review of this manifest may be found at the
5 | following URL:
6 |
7 | https://developer.mozilla.org/en-US/docs/Web/Manifest
8 |
9 | Recently, there has been an increasing interested in a set of technologies broadly known as the "progressive web app",
10 | or "PWA". The ionoic framework describes this as:
11 |
12 | > A Progressive Web App (PWA) is a web app that uses modern web capabilities to deliver an app-like experience to
13 | > users. These apps meet certain requirements (see below), are deployed to servers, accessible through URLs, and
14 | > indexed by search engines.
15 |
16 | One of the technological aspects of this is the manifest specification. The manifest providers additional, site wide
17 | metadata about the application, such as:
18 |
19 | - Its orientation
20 | - Its logo
21 | - Descriptions
22 |
23 | etc.
24 |
25 | Architecture
26 | ------------
27 |
28 | Broadly, the extension is based on the https://github.com/meanbee/magento2-webappmanifest extension. This is an
29 | implementation of the same idea, in Magento 1.x
30 |
31 | Deployment
32 | ----------
33 |
34 | This extension is disabled by default. If it is to be enabled you can do so through the Magento configuration tree,
35 | or through the admin panel.
36 |
37 | Installation instruction
38 | ------------------------
39 |
40 | Installation is managed through Composer. This is the only supported method, and requires the excellent Magento
41 | Composer Installer by Cotya (or another similar tool):
42 |
43 | https://github.com/Cotya/magento-composer-installer
44 |
45 | Once this has been installed, you can undertake the following steps:
46 |
47 | 1. Add the git repository to the "repository" section of composer.json:
48 |
49 | ```
50 | {
51 | // Other composer.json stuff
52 | "repositories": [
53 | {
54 | "type": "vcs",
55 | "url": "git@github.com:sitewards/magento-webappmanifest.git"
56 | }
57 | ]
58 | }
59 | ```
60 |
61 | 2. Once you have completed this, you can require the module:
62 |
63 | ```
64 | composer require sitewards/magento-webappmanifest
65 | ```
66 |
67 | This will install the most recent version. That's it! You're all up to date. Note: At the time of writing, there are
68 | no stable releases. Thus, you might have to use:
69 |
70 | ```
71 | composer require sitewards/magento-webappmanifest dev-master
72 | ```
73 |
74 |
75 | Development Instructions
76 | ------------------------
77 |
78 | All changes should be tracked by an issue / feature request *before they begin*. This allows multiple people to
79 | co-ordinate work. Once you have created an issue, feel free to checkout a copy of the repo and start hacking.
80 |
81 | The above instructions about dev-master will clone a version of the repo you can use for development. When you've got
82 | a change you like, create a PR.
83 |
84 | This is not production ready; when it is, it will be tagged, and you will be able to lock the version in composer.
85 |
86 | contact: mail@sitewards.com
87 | web: http://www.sitewards.com
88 |
89 |
--------------------------------------------------------------------------------
/src/app/code/community/Sitewards/Webappmanifest/etc/system.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 | 1000
15 |
16 |
17 |
18 |
19 |
20 | webappmanifest
21 | 1000
22 | 1
23 | 1
24 | 1
25 |
26 |
27 |
28 | 1
29 | 1
30 | 1
31 |
32 |
33 |
34 |
35 | text
36 | 10
37 | 1
38 | 0
39 | 0
40 |
41 |
42 |
43 |
44 | text
45 | 10
46 | 1
47 | 0
48 | 0
49 |
50 |
51 |
52 |
53 | select
54 | sitewards_webappmanifest/system_config_source_display
55 | 10
56 | 1
57 | 0
58 | 0
59 |
60 |
61 |
62 |
63 | text
64 | 10
65 | 1
66 | 0
67 | 0
68 |
69 |
70 |
71 |
72 | text
73 | 10
74 | 1
75 | 0
76 | 0
77 |
78 |
79 |
80 |
81 |
82 | 1
83 | 1
84 | 1
85 |
86 |
87 |
88 |
89 | image
90 | adminhtml/system_config_backend_image
91 | manifest
92 | manifest
93 | 1
94 | 1
95 | 1
96 | 1
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------