Skip to content

Commit

Permalink
Update 1.0.1-dev
Browse files Browse the repository at this point in the history
Adding more integreation with Shopify EASDK.
  • Loading branch information
ajquick committed Dec 17, 2016
1 parent 89af7b2 commit 8f62842
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ composer require --prefer-dist multidimensional/cakephp-seaff
Load the plugin by running following command in terminal:

```
bin/cake plugin load Seaff
bin/cake plugin load Multidimensional/Seaff
```

Or by manually adding following line to your app's `config/bootstrap.php`:

```php
Plugin::load('Seaff');
Plugin::load('Multidimensional/Seaff');
```

## Usage
Expand All @@ -37,14 +37,14 @@ Add this in your Controller (requires CakePHP 3.1 or newer):
```php
public function beforeRender(\Cake\Event\Event $event)
{
$this->viewBuilder()->theme('Seaff');
$this->viewBuilder()->theme('Multidimensional/Seaff');
}
```

If using a version prior to 3.1, you can set the Theme using the following in your controller.

```php
public $theme = 'Seaff';
public $theme = 'Multidimensional/Seaff';
```

For more information about Themes, see this [page](http://book.cakephp.org/3.0/en/views/themes.html).
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "multidimensional/cakephp-seaff",
"description": "Shopify Embedded App Frontend Framework (SEAFF) for CakePHP",
"version": "1.0.0",
"version": "1.0.1-dev",
"type": "cakephp-plugin",
"keywords": ["cakephp", "cakephp3", "shopify"],
"homepage": "https://github.com/multidimension-al/cakephp-seaff",
Expand All @@ -15,11 +15,12 @@
"role": "Developer"
}],
"require": {
"cakephp/cakephp": "~3"
"cakephp/cakephp": "~3",
"multidimensional/cakephpify": "*"
},
"autoload": {
"psr-4": {
"Seaff\\": "src"
"Multidimensional\\Seaff\\": "src"
}
}
}
13 changes: 13 additions & 0 deletions src/Template/Element/Flash/default.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

if (!empty($params['class']) && ((is_array($params['class']) && in_array('error', $params['class'])) || (strpos($params['class'], 'error') !== FALSE))) {
$type = "Error";
} else {
$type = "Notice";
}
if (!isset($params['escape']) || $params['escape'] !== false) {
$message = h($message);
}
?>
<script type="text/javascript">ShopifyApp.flash<?= $type ?>("<?= $message ?>");</script>

7 changes: 7 additions & 0 deletions src/Template/Element/Flash/error.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
if (!isset($params['escape']) || $params['escape'] !== false) {
$message = h($message);
}
?>
<script type="text/javascript">ShopifyApp.flashError("<?= $message ?>");</script>

7 changes: 7 additions & 0 deletions src/Template/Element/Flash/success.ctp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
if (!isset($params['escape']) || $params['escape'] !== false) {
$message = h($message);
}
?>
<script type="text/javascript">ShopifyApp.flashNotice("<?= $message ?>");</script>

7 changes: 7 additions & 0 deletions src/Template/Layout/default.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
<?= $this->fetch('meta'); ?>
<?= $this->Html->css('seaff.min.css'); ?>
<?= $this->fetch('css'); ?>
<script src="https://cdn.shopify.com/s/assets/external/app.js?<?= date("YmdH"); ?>"></script>
<script type="text/javascript">
ShopifyApp.init({
apiKey: '<?= h($shopifyAPIkey); ?>',
shopOrigin: 'https://<?= h($shopifyShopDomain); ?>'
});
</script>
<?= $this->fetch('script'); ?>
</head>
<body>
Expand Down
30 changes: 30 additions & 0 deletions src/View/SeaffView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
namespace Multidimensional\Seaff\View;

use Cake\View\View;
use \Cake\Event\Event;

class SeaffView extends View
{

public function initialize()
{
parent::initialize();

}

public function beforeRender(Event $event)
{
parent::beforeRender($event);
$this->set('shopifyAPIkey', '');
$this->set('shopifyShopDomain', '');

}

public function render($view = null, $layout = null)
{



}
}

0 comments on commit 8f62842

Please sign in to comment.