Version Notes
Initial release of the Arqspin extension.
Download this release
Release Info
Developer | Gregory Segall |
Extension | OnePica_ArqSpin |
Version | 1.1.2 |
Comparing to | |
See all releases |
Version 1.1.2
- app/code/community/OnePica/ArqSpin/.DS_Store +0 -0
- app/code/community/OnePica/ArqSpin/Block/Adminhtml/Tabs.php +43 -0
- app/code/community/OnePica/ArqSpin/Block/Adminhtml/Tabs/ProductEdit.php +34 -0
- app/code/community/OnePica/ArqSpin/Block/Product/Gallery.php +51 -0
- app/code/community/OnePica/ArqSpin/Block/Product/View/Media.php +38 -0
- app/code/community/OnePica/ArqSpin/Helper/Data.php +30 -0
- app/code/community/OnePica/ArqSpin/Model/Observer.php +35 -0
- app/code/community/OnePica/ArqSpin/Model/Product.php +104 -0
- app/code/community/OnePica/ArqSpin/Model/System/Config/General/Displaytype.php +51 -0
- app/code/community/OnePica/ArqSpin/Model/System/Config/General/Embedtype.php +47 -0
- app/code/community/OnePica/ArqSpin/Model/System/Config/General/GalleryPosition.php +47 -0
- app/code/community/OnePica/ArqSpin/Resource/Eav/Mysql4/Setup.php +29 -0
- app/code/community/OnePica/ArqSpin/controllers/Adminhtml/GridController.php +91 -0
- app/code/community/OnePica/ArqSpin/etc/adminhtml.xml +31 -0
- app/code/community/OnePica/ArqSpin/etc/config.xml +180 -0
- app/code/community/OnePica/ArqSpin/etc/system.xml +179 -0
- app/code/community/OnePica/ArqSpin/sql/.DS_Store +0 -0
- app/code/community/OnePica/ArqSpin/sql/arqspin_records_setup/mysql4-install-1.0.0.php +52 -0
- app/design/adminhtml/default/default/layout/arqspin.xml +36 -0
- app/design/adminhtml/default/default/template/arqspin/productEdit.phtml +53 -0
- app/design/frontend/base/default/layout/arqspin.xml +18 -0
- app/design/frontend/base/default/template/arqspin/product/gallery.phtml +76 -0
- app/design/frontend/base/default/template/arqspin/product/view/media.phtml +139 -0
- app/etc/modules/OnePica_ArqSpin.xml +9 -0
- js/ArqSpin/ArqSpin.js +36 -0
- js/ArqSpin/ArqSpinPreview.js +38 -0
- package.xml +18 -0
app/code/community/OnePica/ArqSpin/.DS_Store
ADDED
Binary file
|
app/code/community/OnePica/ArqSpin/Block/Adminhtml/Tabs.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
class OnePica_ArqSpin_Block_Adminhtml_Tabs extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs
|
28 |
+
{
|
29 |
+
private $parent;
|
30 |
+
|
31 |
+
protected function _prepareLayout()
|
32 |
+
{
|
33 |
+
//get all existing tabs
|
34 |
+
$this->parent = parent::_prepareLayout();
|
35 |
+
//add new tab
|
36 |
+
$this->addTab('arqball_spins', array(
|
37 |
+
'label' => Mage::helper('catalog')->__('ArqSpins'),
|
38 |
+
'content' => $this->getLayout()
|
39 |
+
->createBlock('arqspin/adminhtml_tabs_productEdit')->toHtml(),
|
40 |
+
));
|
41 |
+
return $this->parent;
|
42 |
+
}
|
43 |
+
}
|
app/code/community/OnePica/ArqSpin/Block/Adminhtml/Tabs/ProductEdit.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
class OnePica_ArqSpin_Block_Adminhtml_Tabs_ProductEdit extends Mage_Adminhtml_Block_Widget
|
28 |
+
{
|
29 |
+
public function __construct()
|
30 |
+
{
|
31 |
+
parent::__construct();
|
32 |
+
$this->setTemplate('arqspin/productEdit.phtml');
|
33 |
+
}
|
34 |
+
}
|
app/code/community/OnePica/ArqSpin/Block/Product/Gallery.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
class OnePica_ArqSpin_Block_Product_Gallery extends Mage_Catalog_Block_Product_Gallery
|
28 |
+
{
|
29 |
+
/**
|
30 |
+
* Retrieve image width
|
31 |
+
*
|
32 |
+
* @return bool|int
|
33 |
+
*/
|
34 |
+
public function getImageWidth()
|
35 |
+
{
|
36 |
+
$image = $this->getCurrentImage();
|
37 |
+
$file = $image->getPath();
|
38 |
+
if ($image->getIsArqspin() || file_exists($file)) {
|
39 |
+
$size = getimagesize($file);
|
40 |
+
if (isset($size[0])) {
|
41 |
+
if ($size[0] > 600) {
|
42 |
+
return 600;
|
43 |
+
} else {
|
44 |
+
return $size[0];
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
return false;
|
50 |
+
}
|
51 |
+
}
|
app/code/community/OnePica/ArqSpin/Block/Product/View/Media.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
class OnePica_ArqSpin_Block_Product_View_Media extends Mage_Catalog_Block_Product_View_Media
|
28 |
+
{
|
29 |
+
|
30 |
+
public function getThumbnail($image = null)
|
31 |
+
{
|
32 |
+
if ($image) {
|
33 |
+
if ($image->getIsArqspin()) {
|
34 |
+
return $image->getUrl();
|
35 |
+
} else return $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $image->getFile())->resize(48);
|
36 |
+
}
|
37 |
+
}
|
38 |
+
}
|
app/code/community/OnePica/ArqSpin/Helper/Data.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
class OnePica_ArqSpin_Helper_Data extends Mage_Core_Helper_Abstract
|
28 |
+
{
|
29 |
+
|
30 |
+
}
|
app/code/community/OnePica/ArqSpin/Model/Observer.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
class OnePica_ArqSpin_Model_Observer extends Mage_Core_Model_Abstract
|
28 |
+
{
|
29 |
+
public function catalog_product_save_before($observer)
|
30 |
+
{
|
31 |
+
$product = $observer->getProduct();
|
32 |
+
$data=Mage::app()->getRequest()->getParam('product');
|
33 |
+
$product->setArqballspinId(isset($data['arqspin_id']) ? $data['arqspin_id'] : '');
|
34 |
+
}
|
35 |
+
}
|
app/code/community/OnePica/ArqSpin/Model/Product.php
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
class OnePica_ArqSpin_Model_Product extends Mage_Catalog_Model_Product
|
28 |
+
{
|
29 |
+
/**
|
30 |
+
* Retrive media gallery images
|
31 |
+
*
|
32 |
+
* @return Varien_Data_Collection
|
33 |
+
*/
|
34 |
+
public function getMediaGalleryImages()
|
35 |
+
{
|
36 |
+
if(!$this->hasData('media_gallery_images') && is_array($this->getMediaGallery('images'))) {
|
37 |
+
$arqspin=$this->getArqspinImage();
|
38 |
+
$images = new Varien_Data_Collection();
|
39 |
+
if ($arqspin && $arqspin['position'] == 'first') {
|
40 |
+
$images->addItem(new Varien_Object($arqspin));
|
41 |
+
}
|
42 |
+
foreach ($this->getMediaGallery('images') as $image) {
|
43 |
+
if ($image['disabled']) {
|
44 |
+
continue;
|
45 |
+
}
|
46 |
+
$image['url'] = $this->getMediaConfig()->getMediaUrl($image['file']);
|
47 |
+
$image['id'] = (isset($image['value_id']) ? $image['value_id'] : null);
|
48 |
+
$image['path'] = $this->getMediaConfig()->getMediaPath($image['file']);
|
49 |
+
$image['is_arqspin'] = false;
|
50 |
+
$images->addItem(new Varien_Object($image));
|
51 |
+
}
|
52 |
+
if ($arqspin && $arqspin['position'] == 'last') {
|
53 |
+
$images->addItem(new Varien_Object($arqspin));
|
54 |
+
}
|
55 |
+
$this->setData('media_gallery_images', $images);
|
56 |
+
}
|
57 |
+
|
58 |
+
return $this->getData('media_gallery_images');
|
59 |
+
}
|
60 |
+
|
61 |
+
public function getArqspin()
|
62 |
+
{
|
63 |
+
$id = $this->getData('arqspin_id');
|
64 |
+
$config = Mage::getStoreConfig('arqspin/arqspin_general');
|
65 |
+
if (!$id || !isset($config)) return false;
|
66 |
+
$image = array(
|
67 |
+
'id' => $id,
|
68 |
+
'url' => $config['thumbnail_url'].'/'.$id.'/thumbnail.jpg',
|
69 |
+
'spin_url' => 'http://arq.io/'.($config['embed_type'] == 'flash' ? 'f' : 'i').'/?spin='.$id.($config['autoload'] ? '&is=-0.16' : '').($config['autostop'] ? '' : '&ms=0.16&L=1'),
|
70 |
+
'width' => 0,
|
71 |
+
'height' => 0,
|
72 |
+
);
|
73 |
+
$info = getimagesize($image['url']);
|
74 |
+
if (count($info)) {
|
75 |
+
$image['width'] = $info[0];
|
76 |
+
$image['height'] = $info[1];
|
77 |
+
}
|
78 |
+
return array(
|
79 |
+
'config' => $config,
|
80 |
+
'image' => $image
|
81 |
+
);
|
82 |
+
}
|
83 |
+
|
84 |
+
public function getArqspinImage()
|
85 |
+
{
|
86 |
+
$arqspin = $this->getArqspin();
|
87 |
+
if (!$arqspin || $arqspin['config']['display_type'] != 'gallery') return false;
|
88 |
+
return array(
|
89 |
+
'value_id' => $arqspin['image']['id'],
|
90 |
+
'file' => $arqspin['image']['url'],
|
91 |
+
'label' => '',
|
92 |
+
'position' => $arqspin['config']['gallery_position'],
|
93 |
+
'disabled' => 0,
|
94 |
+
'label_default' => '',
|
95 |
+
'position_default' => $arqspin['config']['gallery_position'],
|
96 |
+
'disabled_default' => 0,
|
97 |
+
'url' => $arqspin['image']['url'],
|
98 |
+
'id' => $arqspin['image']['id'],
|
99 |
+
'path' => $arqspin['image']['url'],
|
100 |
+
'spin_url' => $arqspin['image']['spin_url'],
|
101 |
+
'is_arqspin' => true,
|
102 |
+
);
|
103 |
+
}
|
104 |
+
}
|
app/code/community/OnePica/ArqSpin/Model/System/Config/General/Displaytype.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
|
28 |
+
class OnePica_ArqSpin_Model_System_Config_General_Displaytype {
|
29 |
+
/**
|
30 |
+
* Gets the list of cache methods for the admin config dropdown
|
31 |
+
*
|
32 |
+
* @return array
|
33 |
+
*/
|
34 |
+
public function toOptionArray() {
|
35 |
+
return array(
|
36 |
+
array(
|
37 |
+
'value' => 'gallery',
|
38 |
+
'label' => 'Gallery',
|
39 |
+
),
|
40 |
+
array(
|
41 |
+
'value' => 'primary',
|
42 |
+
'label' => 'Primary',
|
43 |
+
),
|
44 |
+
array(
|
45 |
+
'value' => 'separate',
|
46 |
+
'label' => 'Separate',
|
47 |
+
),
|
48 |
+
);
|
49 |
+
}
|
50 |
+
|
51 |
+
}
|
app/code/community/OnePica/ArqSpin/Model/System/Config/General/Embedtype.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
|
28 |
+
class OnePica_ArqSpin_Model_System_Config_General_Embedtype {
|
29 |
+
/**
|
30 |
+
* Gets the list of cache methods for the admin config dropdown
|
31 |
+
*
|
32 |
+
* @return array
|
33 |
+
*/
|
34 |
+
public function toOptionArray() {
|
35 |
+
return array(
|
36 |
+
array(
|
37 |
+
'value' => 'iframe',
|
38 |
+
'label' => 'IFrame',
|
39 |
+
),
|
40 |
+
array(
|
41 |
+
'value' => 'flash',
|
42 |
+
'label' => 'Flash',
|
43 |
+
),
|
44 |
+
);
|
45 |
+
}
|
46 |
+
|
47 |
+
}
|
app/code/community/OnePica/ArqSpin/Model/System/Config/General/GalleryPosition.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
|
28 |
+
class OnePica_ArqSpin_Model_System_Config_General_GalleryPosition {
|
29 |
+
/**
|
30 |
+
* Gets the list of cache methods for the admin config dropdown
|
31 |
+
*
|
32 |
+
* @return array
|
33 |
+
*/
|
34 |
+
public function toOptionArray() {
|
35 |
+
return array(
|
36 |
+
array(
|
37 |
+
'value' => 'first',
|
38 |
+
'label' => 'First',
|
39 |
+
),
|
40 |
+
array(
|
41 |
+
'value' => 'last',
|
42 |
+
'label' => 'Last',
|
43 |
+
),
|
44 |
+
);
|
45 |
+
}
|
46 |
+
|
47 |
+
}
|
app/code/community/OnePica/ArqSpin/Resource/Eav/Mysql4/Setup.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
class OnePica_ArqSpin_Resource_Eav_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup
|
28 |
+
{
|
29 |
+
}
|
app/code/community/OnePica/ArqSpin/controllers/Adminhtml/GridController.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
class OnePica_ArqSpin_Adminhtml_GridController extends Mage_Adminhtml_Controller_Action
|
28 |
+
{
|
29 |
+
|
30 |
+
protected function _construct() {
|
31 |
+
$this->setUsedModuleName('OnePica_ArqSpin');
|
32 |
+
}
|
33 |
+
|
34 |
+
public function indexAction()
|
35 |
+
{
|
36 |
+
$this->loadLayout();
|
37 |
+
$this->renderLayout();
|
38 |
+
}
|
39 |
+
|
40 |
+
public function listAction() {
|
41 |
+
$url = 'https://api.arqspin.com/v2.1/spins/';
|
42 |
+
$searchString = $this->getRequest()->getParam('searchString');
|
43 |
+
$config = Mage::getStoreConfig('arqspin/arqspin_general');
|
44 |
+
$product = Mage::getModel('catalog/product')->load($this->getRequest()->getParam('id'));
|
45 |
+
$preId = $product->getArqballspinId();
|
46 |
+
$res = '';
|
47 |
+
|
48 |
+
if (isset($config)) {
|
49 |
+
$data = file_get_contents($url.$config['username'].(strlen($searchString) ? '?query='.$searchString : ''));
|
50 |
+
$data = json_decode($data, true);
|
51 |
+
if (isset($data['spins'])) {
|
52 |
+
foreach ($data['spins'] as $value) {
|
53 |
+
$res .= '<tr>';
|
54 |
+
$res .= '<td><input type="radio" name="product[arqspin_id]" value="'.$value['shortid'].'"'.($value['shortid'] == $preId ? ' checked' : '').'></td>';
|
55 |
+
$res .= '<td>'.(strlen($value['shortid']) ? $value['shortid'] : ' ').'</td>';
|
56 |
+
$res .= '<td>'.(strlen($value['title']) ? Mage::helper('core/string')->truncate($value['title'], 100) : ' ').'</td>';
|
57 |
+
$res .= '<td><img src="'.$value['thumbnail'].'" width="100" class="arqball_spin_preview" shortid="'.$value['shortid'].'" /></td>';
|
58 |
+
$res .= '</tr>';
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
echo $this->getHeader().$res.$this->getFooter();
|
63 |
+
exit;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function getHeader() {
|
67 |
+
$res = '<table id="media_gallery_content_grid" class="data border" width="100%" cellspacing="0">';
|
68 |
+
$res .= '<thead>';
|
69 |
+
$res .= '<tr class="headings">';
|
70 |
+
$res .= '<th width="20"> </th>';
|
71 |
+
$res .= '<th width="100">ID</th>';
|
72 |
+
$res .= '<th>Title</th>';
|
73 |
+
$res .= '<th width="100">Thumbnail</th>';
|
74 |
+
$res .= '</tr>';
|
75 |
+
$res .= '</thead>';
|
76 |
+
|
77 |
+
$res .= '<tbody id="media_gallery_content_list">';
|
78 |
+
$res .= '<tr>';
|
79 |
+
$res .= '<td width="20"><input type="radio" name="product[arqspin_id]" value="" checked></td>';
|
80 |
+
$res .= '<td width="100"> </td>';
|
81 |
+
$res .= '<td>None</td>';
|
82 |
+
$res .= '<td width="100"> </td>';
|
83 |
+
$res .= '</tr>';
|
84 |
+
$res .= '</tbody>';
|
85 |
+
return $res;
|
86 |
+
}
|
87 |
+
|
88 |
+
public function getFooter() {
|
89 |
+
return '</table>';
|
90 |
+
}
|
91 |
+
}
|
app/code/community/OnePica/ArqSpin/etc/adminhtml.xml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* One Pica
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category OnePica
|
17 |
+
* @package OnePica_ArqSpin
|
18 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
/**
|
22 |
+
* One Pica ArqSpin
|
23 |
+
*
|
24 |
+
* @category OnePica
|
25 |
+
* @package OnePica_ArqSpin
|
26 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
27 |
+
*/
|
28 |
+
-->
|
29 |
+
<config>
|
30 |
+
|
31 |
+
</config>
|
app/code/community/OnePica/ArqSpin/etc/config.xml
ADDED
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* One Pica
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category OnePica
|
17 |
+
* @package OnePica_ArqSpin
|
18 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
/**
|
22 |
+
* One Pica ArqSpin
|
23 |
+
*
|
24 |
+
* @category OnePica
|
25 |
+
* @package OnePica_ArqSpin
|
26 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
27 |
+
*/
|
28 |
+
-->
|
29 |
+
<config>
|
30 |
+
<modules>
|
31 |
+
<OnePica_ArqSpin>
|
32 |
+
<version>1.1.2</version>
|
33 |
+
</OnePica_ArqSpin>
|
34 |
+
</modules>
|
35 |
+
|
36 |
+
<global>
|
37 |
+
<models>
|
38 |
+
<arqspin>
|
39 |
+
<class>OnePica_ArqSpin_Model</class>
|
40 |
+
</arqspin>
|
41 |
+
<catalog>
|
42 |
+
<rewrite>
|
43 |
+
<product>OnePica_ArqSpin_Model_Product</product>
|
44 |
+
</rewrite>
|
45 |
+
</catalog>
|
46 |
+
</models>
|
47 |
+
|
48 |
+
<helpers>
|
49 |
+
<onepica_arqspin>
|
50 |
+
<class>OnePica_ArqSpin_Helper</class>
|
51 |
+
</onepica_arqspin>
|
52 |
+
</helpers>
|
53 |
+
|
54 |
+
<blocks>
|
55 |
+
<arqspin>
|
56 |
+
<class>OnePica_ArqSpin_Block</class>
|
57 |
+
</arqspin>
|
58 |
+
|
59 |
+
<catalog>
|
60 |
+
<rewrite>
|
61 |
+
<product_view_media>OnePica_ArqSpin_Block_Product_View_Media</product_view_media>
|
62 |
+
</rewrite>
|
63 |
+
<rewrite>
|
64 |
+
<product_gallery>OnePica_ArqSpin_Block_Product_Gallery</product_gallery>
|
65 |
+
</rewrite>
|
66 |
+
</catalog>
|
67 |
+
|
68 |
+
<adminhtml>
|
69 |
+
<rewrite>
|
70 |
+
<catalog_product_edit_tabs>OnePica_ArqSpin_Block_Adminhtml_Tabs</catalog_product_edit_tabs>
|
71 |
+
</rewrite>
|
72 |
+
</adminhtml>
|
73 |
+
</blocks>
|
74 |
+
|
75 |
+
<events>
|
76 |
+
<catalog_product_save_before>
|
77 |
+
<observers>
|
78 |
+
<arqspin>
|
79 |
+
<type>singleton</type>
|
80 |
+
<class>arqspin/observer</class>
|
81 |
+
<method>catalog_product_save_before</method>
|
82 |
+
</arqspin>
|
83 |
+
</observers>
|
84 |
+
</catalog_product_save_before>
|
85 |
+
</events>
|
86 |
+
|
87 |
+
<resources>
|
88 |
+
<arqspin_records_setup>
|
89 |
+
<setup>
|
90 |
+
<module>OnePica_ArqSpin</module>
|
91 |
+
<class>OnePica_ArqSpin_Resource_Eav_Mysql4_Setup</class>
|
92 |
+
</setup>
|
93 |
+
|
94 |
+
<connection>
|
95 |
+
<use>core_setup</use>
|
96 |
+
</connection>
|
97 |
+
</arqspin_records_setup>
|
98 |
+
|
99 |
+
<arqspin_records_write>
|
100 |
+
<connection>
|
101 |
+
<use>core_write</use>
|
102 |
+
</connection>
|
103 |
+
</arqspin_records_write>
|
104 |
+
|
105 |
+
<arqspin_records_read>
|
106 |
+
<connection>
|
107 |
+
<use>core_read</use>
|
108 |
+
</connection>
|
109 |
+
</arqspin_records_read>
|
110 |
+
</resources>
|
111 |
+
</global>
|
112 |
+
|
113 |
+
<admin>
|
114 |
+
<routers>
|
115 |
+
<adminhtml>
|
116 |
+
<args>
|
117 |
+
<modules>
|
118 |
+
<arqspin before="Mage_Adminhtml">OnePica_ArqSpin_Adminhtml</arqspin>
|
119 |
+
</modules>
|
120 |
+
</args>
|
121 |
+
</adminhtml>
|
122 |
+
</routers>
|
123 |
+
</admin>
|
124 |
+
|
125 |
+
<adminhtml>
|
126 |
+
<acl>
|
127 |
+
<resources>
|
128 |
+
<admin>
|
129 |
+
<children>
|
130 |
+
<system>
|
131 |
+
<children>
|
132 |
+
<config>
|
133 |
+
<children>
|
134 |
+
<arqspin translate="title">
|
135 |
+
<title>ArqSpin ACL</title>
|
136 |
+
<sort_order>100</sort_order>
|
137 |
+
</arqspin>
|
138 |
+
</children>
|
139 |
+
</config>
|
140 |
+
</children>
|
141 |
+
</system>
|
142 |
+
</children>
|
143 |
+
</admin>
|
144 |
+
</resources>
|
145 |
+
</acl>
|
146 |
+
|
147 |
+
<layout>
|
148 |
+
<updates>
|
149 |
+
<arqspin>
|
150 |
+
<file>arqspin.xml</file>
|
151 |
+
</arqspin>
|
152 |
+
</updates>
|
153 |
+
</layout>
|
154 |
+
</adminhtml>
|
155 |
+
|
156 |
+
<frontend>
|
157 |
+
<layout>
|
158 |
+
<updates>
|
159 |
+
<arqspin>
|
160 |
+
<file>arqspin.xml</file>
|
161 |
+
</arqspin>
|
162 |
+
</updates>
|
163 |
+
</layout>
|
164 |
+
</frontend>
|
165 |
+
|
166 |
+
<default>
|
167 |
+
<arqspin>
|
168 |
+
<arqspin_general>
|
169 |
+
<username></username>
|
170 |
+
<autoload>1</autoload>
|
171 |
+
<autorotate>1</autorotate>
|
172 |
+
<autostop>1</autostop>
|
173 |
+
<embed_type>iframe</embed_type>
|
174 |
+
<display_type>gallery</display_type>
|
175 |
+
<gallery_position>first</gallery_position>
|
176 |
+
<thumbnail_url>http://s3.amazonaws.com/spins.arqspin.com</thumbnail_url>
|
177 |
+
</arqspin_general>
|
178 |
+
</arqspin>
|
179 |
+
</default>
|
180 |
+
</config>
|
app/code/community/OnePica/ArqSpin/etc/system.xml
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* One Pica
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category OnePica
|
17 |
+
* @package OnePica_ArqSpin
|
18 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
/**
|
22 |
+
* One Pica ArqSpin
|
23 |
+
*
|
24 |
+
* @category OnePica
|
25 |
+
* @package OnePica_ArqSpin
|
26 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
27 |
+
*/
|
28 |
+
-->
|
29 |
+
<config>
|
30 |
+
<sections>
|
31 |
+
<arqspin translate="label">
|
32 |
+
<label>ArqSpin</label>
|
33 |
+
<tab>catalog</tab>
|
34 |
+
<frontend_type>text</frontend_type>
|
35 |
+
<sort_order>121</sort_order>
|
36 |
+
<show_in_default>1</show_in_default>
|
37 |
+
<show_in_website>1</show_in_website>
|
38 |
+
<show_in_store>1</show_in_store>
|
39 |
+
<groups>
|
40 |
+
<arqspin_general translate="label">
|
41 |
+
<label>General</label>
|
42 |
+
<frontend_type>text</frontend_type>
|
43 |
+
<sort_order>1</sort_order>
|
44 |
+
<show_in_default>1</show_in_default>
|
45 |
+
<show_in_website>1</show_in_website>
|
46 |
+
<show_in_store>1</show_in_store>
|
47 |
+
<fields>
|
48 |
+
<username translate="label">
|
49 |
+
<label>Account Username</label>
|
50 |
+
<frontend_type>text</frontend_type>
|
51 |
+
<validate>required-entry</validate>
|
52 |
+
<sort_order>0</sort_order>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<show_in_website>1</show_in_website>
|
55 |
+
<show_in_store>1</show_in_store>
|
56 |
+
<comment>
|
57 |
+
<![CDATA[
|
58 |
+
Required.
|
59 |
+
]]>
|
60 |
+
</comment>
|
61 |
+
</username>
|
62 |
+
<autoload translate="label">
|
63 |
+
<label>Auto load</label>
|
64 |
+
<frontend_type>select</frontend_type>
|
65 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
66 |
+
<sort_order>1</sort_order>
|
67 |
+
<show_in_default>1</show_in_default>
|
68 |
+
<show_in_website>1</show_in_website>
|
69 |
+
<show_in_store>1</show_in_store>
|
70 |
+
<comment>
|
71 |
+
<![CDATA[
|
72 |
+
Automatically load the spin on the page to prepare it for spinning.
|
73 |
+
Recommendation: Enabled.
|
74 |
+
]]>
|
75 |
+
</comment>
|
76 |
+
</autoload>
|
77 |
+
<autorotate translate="label">
|
78 |
+
<label>Auto rotate</label>
|
79 |
+
<frontend_type>select</frontend_type>
|
80 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
81 |
+
<sort_order>2</sort_order>
|
82 |
+
<show_in_default>1</show_in_default>
|
83 |
+
<show_in_website>1</show_in_website>
|
84 |
+
<show_in_store>1</show_in_store>
|
85 |
+
<comment>
|
86 |
+
<![CDATA[
|
87 |
+
Automatically start rotating the spin once it's loaded.
|
88 |
+
Recommendation: Enabled.
|
89 |
+
]]>
|
90 |
+
</comment>
|
91 |
+
</autorotate>
|
92 |
+
<autostop translate="label">
|
93 |
+
<label>Auto stop</label>
|
94 |
+
<frontend_type>select</frontend_type>
|
95 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
96 |
+
<sort_order>3</sort_order>
|
97 |
+
<show_in_default>1</show_in_default>
|
98 |
+
<show_in_website>1</show_in_website>
|
99 |
+
<show_in_store>1</show_in_store>
|
100 |
+
<comment>
|
101 |
+
<![CDATA[
|
102 |
+
Automatically stop rotating the spin once it's completed a full rotation.
|
103 |
+
Recommendation: Enabled.
|
104 |
+
]]>
|
105 |
+
</comment>
|
106 |
+
</autostop>
|
107 |
+
<embed_type translate="label">
|
108 |
+
<label>Embed type</label>
|
109 |
+
<frontend_type>select</frontend_type>
|
110 |
+
<source_model>arqspin/system_config_general_embedtype</source_model>
|
111 |
+
<sort_order>4</sort_order>
|
112 |
+
<show_in_default>1</show_in_default>
|
113 |
+
<show_in_website>1</show_in_website>
|
114 |
+
<show_in_store>1</show_in_store>
|
115 |
+
<comment>
|
116 |
+
<![CDATA[
|
117 |
+
Technology used to embed the spin.
|
118 |
+
Recommended: IFrame.
|
119 |
+
]]>
|
120 |
+
</comment>
|
121 |
+
</embed_type>
|
122 |
+
<display_type translate="label">
|
123 |
+
<label>Display type</label>
|
124 |
+
<frontend_type>select</frontend_type>
|
125 |
+
<source_model>arqspin/system_config_general_displaytype</source_model>
|
126 |
+
<sort_order>5</sort_order>
|
127 |
+
<show_in_default>1</show_in_default>
|
128 |
+
<show_in_website>1</show_in_website>
|
129 |
+
<show_in_store>1</show_in_store>
|
130 |
+
<comment>
|
131 |
+
<![CDATA[
|
132 |
+
Location for the spin. <br />
|
133 |
+
Gallery: If a product has a spin, thumbnail is shown first or last in the list of additional images;
|
134 |
+
clicking on the thumbnail brings up the spin in a popup.<br />
|
135 |
+
Primary: Replace the primary image if a product has a spin set on it;
|
136 |
+
user can interact with spin on the product page.<br />
|
137 |
+
Separate: If a product has a spin, spin is embedded below the product image gallery;
|
138 |
+
user can interact with spin on the product page. Recommended: Gallery
|
139 |
+
]]>
|
140 |
+
</comment>
|
141 |
+
</display_type>
|
142 |
+
<gallery_position translate="label">
|
143 |
+
<label>Gallery position</label>
|
144 |
+
<frontend_type>select</frontend_type>
|
145 |
+
<source_model>arqspin/system_config_general_galleryPosition</source_model>
|
146 |
+
<sort_order>6</sort_order>
|
147 |
+
<show_in_default>1</show_in_default>
|
148 |
+
<show_in_website>1</show_in_website>
|
149 |
+
<show_in_store>1</show_in_store>
|
150 |
+
<comment>
|
151 |
+
<![CDATA[
|
152 |
+
If Gallery chosen above, this determines where in the list of additional
|
153 |
+
images the thumbnail for the spin is shown.
|
154 |
+
Recommended: First.
|
155 |
+
]]>
|
156 |
+
</comment>
|
157 |
+
</gallery_position>
|
158 |
+
<thumbnail_url translate="label">
|
159 |
+
<label>Thumbnail URL</label>
|
160 |
+
<frontend_type>text</frontend_type>
|
161 |
+
<validate>required-entry</validate>
|
162 |
+
<sort_order>7</sort_order>
|
163 |
+
<show_in_default>1</show_in_default>
|
164 |
+
<show_in_website>1</show_in_website>
|
165 |
+
<show_in_store>1</show_in_store>
|
166 |
+
<comment>
|
167 |
+
<![CDATA[
|
168 |
+
URL where spin thumbnails are hosted. Can be changed for a more consistent
|
169 |
+
brand experience, but default can be used.
|
170 |
+
Default is http://s3.amazonaws.com/spins.arqspin.com.
|
171 |
+
]]>
|
172 |
+
</comment>
|
173 |
+
</thumbnail_url>
|
174 |
+
</fields>
|
175 |
+
</arqspin_general>
|
176 |
+
</groups>
|
177 |
+
</arqspin>
|
178 |
+
</sections>
|
179 |
+
</config>
|
app/code/community/OnePica/ArqSpin/sql/.DS_Store
ADDED
Binary file
|
app/code/community/OnePica/ArqSpin/sql/arqspin_records_setup/mysql4-install-1.0.0.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
|
28 |
+
$installer = $this;
|
29 |
+
$installer->startSetup();
|
30 |
+
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'arqspin_id', array(
|
31 |
+
'group' => '',
|
32 |
+
'label' => 'ArqSpin Id',
|
33 |
+
'type' => 'varchar',
|
34 |
+
'input' => 'text',
|
35 |
+
'default' => '',
|
36 |
+
'class' => '',
|
37 |
+
'backend' => '',
|
38 |
+
'frontend' => '',
|
39 |
+
'source' => '',
|
40 |
+
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
|
41 |
+
'visible' => false,
|
42 |
+
'required' => false,
|
43 |
+
'user_defined' => false,
|
44 |
+
'searchable' => false,
|
45 |
+
'filterable' => false,
|
46 |
+
'comparable' => false,
|
47 |
+
'visible_on_front' => false,
|
48 |
+
'visible_in_advanced_search' => false,
|
49 |
+
'unique' => false,
|
50 |
+
'is_visible' => false,
|
51 |
+
));
|
52 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/arqspin.xml
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* One Pica
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category OnePica
|
17 |
+
* @package OnePica_ArqSpin
|
18 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
/**
|
22 |
+
* One Pica ArqSpin
|
23 |
+
*
|
24 |
+
* @category OnePica
|
25 |
+
* @package OnePica_ArqSpin
|
26 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
27 |
+
*/
|
28 |
+
-->
|
29 |
+
<layout version="0.1.0">
|
30 |
+
<adminhtml_catalog_product_edit>
|
31 |
+
<reference name="head">
|
32 |
+
<action method="addJs"><script>ArqSpin/ArqSpin.js</script></action>
|
33 |
+
<action method="addJs"><script>ArqSpin/ArqSpinPreview.js</script></action>
|
34 |
+
</reference>
|
35 |
+
</adminhtml_catalog_product_edit>
|
36 |
+
</layout>
|
app/design/adminhtml/default/default/template/arqspin/productEdit.phtml
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
|
28 |
+
$product = Mage::registry('product');
|
29 |
+
$id = $product->getId();
|
30 |
+
?>
|
31 |
+
|
32 |
+
<div class="entry-edit">
|
33 |
+
<div class="entry-edit-head">
|
34 |
+
<h4 class="icon-head head-edit-form fieldset-legend">ArqSpins</h4>
|
35 |
+
</div>
|
36 |
+
<div class="fieldset fieldset-wide">
|
37 |
+
<center>
|
38 |
+
<input type="text" id="arqball_spin_search" value="" />
|
39 |
+
<input type="button" id="arqball_spin_button" value="Search" />
|
40 |
+
<div id="arqball_spin_content">
|
41 |
+
</div>
|
42 |
+
<script language="JavaScript">
|
43 |
+
new ArqSpin({
|
44 |
+
tabId : 'product_info_tabs_arqball_spins',
|
45 |
+
containerId : 'arqball_spin_content',
|
46 |
+
searchFieldId : 'arqball_spin_search',
|
47 |
+
buttonId : 'arqball_spin_button',
|
48 |
+
requestUrl : '<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/grid/list/'.($id ? 'id/'.$id.'/' : '')) ?>'
|
49 |
+
})
|
50 |
+
</script>
|
51 |
+
</center>
|
52 |
+
</div>
|
53 |
+
</div>
|
app/design/frontend/base/default/layout/arqspin.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<catalog_product_view>
|
4 |
+
<reference name="product.info.media">
|
5 |
+
<action method="setTemplate">
|
6 |
+
<template>arqspin/product/view/media.phtml</template>
|
7 |
+
</action>
|
8 |
+
</reference>
|
9 |
+
</catalog_product_view>
|
10 |
+
|
11 |
+
<catalog_product_gallery>
|
12 |
+
<reference name="catalog_product_gallery">
|
13 |
+
<action method="setTemplate">
|
14 |
+
<template>arqspin/product/gallery.phtml</template>
|
15 |
+
</action>
|
16 |
+
</reference>
|
17 |
+
</catalog_product_gallery>
|
18 |
+
</layout>
|
app/design/frontend/base/default/template/arqspin/product/gallery.phtml
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
?>
|
28 |
+
<?php
|
29 |
+
$_image = $this->getCurrentImage();
|
30 |
+
$_width=$this->getImageWidth();
|
31 |
+
?>
|
32 |
+
<div class="product-image-popup" style="width:<?php echo $_width; ?>px;">
|
33 |
+
<div class="buttons-set"><a href="#" onclick="window.close(); return false;" class="button"><span><?php echo $this->__('Close Window') ?></span></a></div>
|
34 |
+
<?php if($this->getPreviusImageUrl() || $this->getNextImageUrl()): ?>
|
35 |
+
<div class="nav">
|
36 |
+
<?php if($_prevUrl = $this->getPreviusImageUrl()): ?>
|
37 |
+
<a href="<?php echo $_prevUrl ?>" class="prev">« <?php echo $this->__('Prev') ?></a>
|
38 |
+
<?php endif; ?>
|
39 |
+
<?php if($_nextUrl = $this->getNextImageUrl()): ?>
|
40 |
+
<a href="<?php echo $_nextUrl ?>" class="next"><?php echo $this->__('Next') ?> »</a>
|
41 |
+
<?php endif; ?>
|
42 |
+
</div>
|
43 |
+
<?php endif; ?>
|
44 |
+
<?php if($_imageTitle = $this->htmlEscape($_image->getLabel())): ?>
|
45 |
+
<h1 class="image-label"><?php echo $_imageTitle ?></h1>
|
46 |
+
<?php endif; ?>
|
47 |
+
<?php if ($_image->getIsArqspin()): ?>
|
48 |
+
<div id="product-gallery-image" class="image">
|
49 |
+
<iframe src="<?php echo $_image->getSpinUrl(); ?>" width="<?php echo $_width; ?>" height="<?php echo $_width; ?>" scrolling="no" frameborder="0"></iframe>
|
50 |
+
</div>
|
51 |
+
<?php else: ?>
|
52 |
+
<img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $this->getImageFile()); ?>"<?php if($_width): ?> width="<?php echo $_width ?>"<?php endif; ?> alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>" id="product-gallery-image" class="image" />
|
53 |
+
<?php endif; ?>
|
54 |
+
<div class="buttons-set"><a href="#" onclick="window.close(); return false;" class="button"><span><?php echo $this->__('Close Window') ?></span></a></div>
|
55 |
+
<?php if($this->getPreviusImageUrl() || $this->getNextImageUrl()): ?>
|
56 |
+
<div class="nav">
|
57 |
+
<?php if($_prevUrl = $this->getPreviusImageUrl()): ?>
|
58 |
+
<a href="<?php echo $_prevUrl ?>" class="prev">« <?php echo $this->__('Prev') ?></a>
|
59 |
+
<?php endif; ?>
|
60 |
+
<?php if($_nextUrl = $this->getNextImageUrl()): ?>
|
61 |
+
<a href="<?php echo $_nextUrl ?>" class="next"><?php echo $this->__('Next') ?> »</a>
|
62 |
+
<?php endif; ?>
|
63 |
+
</div>
|
64 |
+
<?php endif; ?>
|
65 |
+
</div>
|
66 |
+
<script type="text/javascript">
|
67 |
+
//<![CDATA[
|
68 |
+
Event.observe(window, 'load', function(){
|
69 |
+
var demensions = $('product-gallery-image').getDimensions();
|
70 |
+
if (demensions.width < 300) {
|
71 |
+
demensions.width = 300
|
72 |
+
}
|
73 |
+
window.resizeTo(demensions.width+90, demensions.height+210);
|
74 |
+
});
|
75 |
+
//]]>
|
76 |
+
</script>
|
app/design/frontend/base/default/template/arqspin/product/view/media.phtml
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* One Pica
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to codemaster@onepica.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* @category OnePica
|
16 |
+
* @package OnePica_ArqSpin
|
17 |
+
* @copyright Copyright (c) 2013 One Pica, Inc. (http://www.onepica.com)
|
18 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
+
*/
|
20 |
+
/**
|
21 |
+
* One Pica ArqSpin
|
22 |
+
*
|
23 |
+
* @category OnePica
|
24 |
+
* @package OnePica_ArqSpin
|
25 |
+
* @author One Pica Codemaster codemaster@onepica.com
|
26 |
+
*/
|
27 |
+
?>
|
28 |
+
<?php
|
29 |
+
$_product = $this->getProduct();
|
30 |
+
$arqspin = $_product->getArqspin();
|
31 |
+
$_helper = $this->helper('catalog/output');
|
32 |
+
$_nativeZoom = false;
|
33 |
+
?>
|
34 |
+
|
35 |
+
<?php if ($arqspin && $arqspin['config']['display_type'] == 'primary'): ?>
|
36 |
+
<div class="product-image">
|
37 |
+
<iframe src="<?php echo $arqspin['image']['spin_url']; ?>" width="370" height="370" scrolling="no" frameborder="0"></iframe>
|
38 |
+
</div>
|
39 |
+
<?php else: ?>
|
40 |
+
<?php if (!$_nativeZoom): ?>
|
41 |
+
<?php /* --------- jqZoom --------- */ ?>
|
42 |
+
<?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
|
43 |
+
<?php list($_imgWidth, $_imgHeight) = $this->helper('catalog/image')->init($_product, 'image')->getOriginalSizeArray(); ?>
|
44 |
+
<?php if ($_imgWidth > 380 || $_imgHeight > 380):?>
|
45 |
+
<a class="product-image image-zoom" id="main-image" title="<?php echo $this->htmlEscape($_product->getImageLabel()); ?>" href="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>">
|
46 |
+
<?php
|
47 |
+
$_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(370).'" height="370" width="370" alt="'.$this->htmlEscape($_product->getImageLabel()).'" title="'.$this->htmlEscape($_product->getImageLabel()).'" />';
|
48 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
49 |
+
?>
|
50 |
+
</a>
|
51 |
+
<script type="text/javascript">
|
52 |
+
//<![CDATA[
|
53 |
+
jQuery(document).ready(function(){
|
54 |
+
var options = {
|
55 |
+
zoomType: 'reverse',//Values: standard, reverse
|
56 |
+
zoomWidth: 374,
|
57 |
+
zoomHeight: 327,
|
58 |
+
xOffset: 0,
|
59 |
+
yOffset: 50,
|
60 |
+
imageOpacity: 0.6,
|
61 |
+
title : false
|
62 |
+
};
|
63 |
+
jQuery('#main-image').jqzoom(options);
|
64 |
+
});
|
65 |
+
//]]>
|
66 |
+
</script>
|
67 |
+
<p class="notice"><?php echo $this->__('Click on image to zoom'); ?></p>
|
68 |
+
<?php else: ?> <p class="product-image">
|
69 |
+
<?php
|
70 |
+
$_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(370).'" height="370" width="370" alt="'.$this->htmlEscape($_product->getImageLabel()).'" title="'.$this->htmlEscape($_product->getImageLabel()).'" />';
|
71 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
72 |
+
?>
|
73 |
+
</p>
|
74 |
+
<?php endif; ?>
|
75 |
+
|
76 |
+
<?php else: ?>
|
77 |
+
<p class="product-image">
|
78 |
+
<?php
|
79 |
+
$_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(370).'" alt="'.$this->htmlEscape($_product->getImageLabel()).'" title="'.$this->htmlEscape($_product->getImageLabel()).'" />';
|
80 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
81 |
+
?>
|
82 |
+
</p>
|
83 |
+
<?php endif; ?>
|
84 |
+
<?php else: ?>
|
85 |
+
|
86 |
+
<?php /* --------- native magento zoom --------- */ ?>
|
87 |
+
|
88 |
+
<?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
|
89 |
+
<p class="product-image product-image-zoom">
|
90 |
+
<?php
|
91 |
+
$_img = '<img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image').'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
|
92 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
93 |
+
?>
|
94 |
+
</p>
|
95 |
+
<p class="zoom-notice" id="track_hint"><?php echo $this->__('Double click on above image to view full picture') ?></p>
|
96 |
+
<div class="zoom">
|
97 |
+
<img id="zoom_out" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_out.gif') ?>" alt="<?php echo $this->__('Zoom Out') ?>" title="<?php echo $this->__('Zoom Out') ?>" class="btn-zoom-out" />
|
98 |
+
<div id="track">
|
99 |
+
<div id="handle"></div>
|
100 |
+
</div>
|
101 |
+
<img id="zoom_in" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_in.gif') ?>" alt="<?php echo $this->__('Zoom In') ?>" title="<?php echo $this->__('Zoom In') ?>" class="btn-zoom-in" />
|
102 |
+
</div>
|
103 |
+
<script type="text/javascript">
|
104 |
+
//<![CDATA[
|
105 |
+
Event.observe(window, 'load', function() {
|
106 |
+
product_zoom = new Product.Zoom('image', 'track', 'handle', 'zoom_in', 'zoom_out', 'track_hint');
|
107 |
+
});
|
108 |
+
//]]>
|
109 |
+
</script>
|
110 |
+
<?php else: ?>
|
111 |
+
<p class="product-image">
|
112 |
+
<?php
|
113 |
+
$_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(275).'" alt="'.$this->htmlEscape($_product->getImageLabel()).'" title="'.$this->htmlEscape($_product->getImageLabel()).'" />';
|
114 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
115 |
+
?>
|
116 |
+
</p>
|
117 |
+
<?php endif; ?>
|
118 |
+
|
119 |
+
<?php /* --------- /native magento zoom --------- */ ?>
|
120 |
+
<?php endif; ?>
|
121 |
+
<?php endif; ?>
|
122 |
+
|
123 |
+
<?php if (count($this->getGalleryImages()) > 0): ?>
|
124 |
+
<div class="more-views">
|
125 |
+
<h2><?php echo $this->__('More Views') ?></h2>
|
126 |
+
<ul>
|
127 |
+
<?php foreach ($this->getGalleryImages() as $_image): ?>
|
128 |
+
<li>
|
129 |
+
<a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'width=300,height=300,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img src="<?php echo $this->getThumbnail($_image); ?>" width="48" height="48" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
|
130 |
+
</li>
|
131 |
+
<?php endforeach; ?>
|
132 |
+
</ul>
|
133 |
+
</div>
|
134 |
+
<?php endif; ?>
|
135 |
+
<?php if ($arqspin && $arqspin['config']['display_type'] == 'separate'): ?>
|
136 |
+
<div class="product-image">
|
137 |
+
<iframe src="<?php echo $arqspin['image']['spin_url']; ?>" width="370" height="370" scrolling="no" frameborder="0"></iframe>
|
138 |
+
</div>
|
139 |
+
<?php endif; ?>
|
app/etc/modules/OnePica_ArqSpin.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<OnePica_ArqSpin>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</OnePica_ArqSpin>
|
8 |
+
</modules>
|
9 |
+
</config>
|
js/ArqSpin/ArqSpin.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function ArqSpin(param)
|
2 |
+
{
|
3 |
+
var self=this;
|
4 |
+
this.container = document.getElementById(param.containerId);
|
5 |
+
this.searchField = document.getElementById(param.searchFieldId);
|
6 |
+
this.button = document.getElementById(param.buttonId);
|
7 |
+
this.requestUrl = param.requestUrl;
|
8 |
+
|
9 |
+
if (this.container) {
|
10 |
+
if (this.searchField && this.button) {
|
11 |
+
this.button.onclick=function() {
|
12 |
+
self.load(self.searchField.value);
|
13 |
+
}
|
14 |
+
}
|
15 |
+
if (tab=document.getElementById(param.tabId)) {
|
16 |
+
tab.onclick=function() {
|
17 |
+
self.load(self.searchField.value);
|
18 |
+
}
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
ArqSpin.prototype.load = function(searchString)
|
24 |
+
{
|
25 |
+
var self=this;
|
26 |
+
new Ajax.Request(this.requestUrl+(searchString && searchString.length ? 'searchString/'+searchString+'/' : ''), {
|
27 |
+
method : 'post',
|
28 |
+
data : {},
|
29 |
+
onComplete : function(data) {
|
30 |
+
self.container.innerHTML = data.responseText;
|
31 |
+
new ArqSpinPreview({
|
32 |
+
containerId : self.container.getAttribute('id')
|
33 |
+
});
|
34 |
+
}
|
35 |
+
});
|
36 |
+
}
|
js/ArqSpin/ArqSpinPreview.js
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function ArqSpinPreview(param)
|
2 |
+
{
|
3 |
+
this.container = document.getElementById(param.containerId);
|
4 |
+
this.previewUrl = (param.previewUrl ? param.previewUrl : 'http://arq.io/i/?is=-0.16&ms=0.16');
|
5 |
+
this.width = 500;
|
6 |
+
this.height = 500;
|
7 |
+
|
8 |
+
this.update()
|
9 |
+
}
|
10 |
+
|
11 |
+
ArqSpinPreview.prototype.getPreviewUrl = function(spinId) {
|
12 |
+
return this.previewUrl+'&spin='+spinId;
|
13 |
+
}
|
14 |
+
|
15 |
+
ArqSpinPreview.prototype.open = function(spinId) {
|
16 |
+
var win = window.open('', 'ArqSpin Preview', 'width='+this.width+',height='+this.height+',menubar=no,toolbar=no,location=no,resizable=no,scrollbars=no,status=no');
|
17 |
+
var data='<html><head><title>ArqSpin Preview</title></head>';
|
18 |
+
data+='<body style="margin: 0px;">';
|
19 |
+
data+='<iframe src="'+this.getPreviewUrl(spinId)+'" width="'+this.width+'" height="'+this.height+'" scrolling="no" frameborder="0"></iframe>';
|
20 |
+
data+='</body>';
|
21 |
+
data+='</html>';
|
22 |
+
win.document.write(data);
|
23 |
+
win.focus();
|
24 |
+
}
|
25 |
+
|
26 |
+
ArqSpinPreview.prototype.update = function()
|
27 |
+
{
|
28 |
+
var self=this;
|
29 |
+
var list=(this.container ? this.container : document).getElementsByTagName('img');
|
30 |
+
for (var key in list) {
|
31 |
+
if (list[key].className == 'arqball_spin_preview') {
|
32 |
+
list[key].style.cursor = 'pointer';
|
33 |
+
list[key].onclick = function() {
|
34 |
+
self.open(this.getAttribute('shortid'));
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
}
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>OnePica_ArqSpin</name>
|
4 |
+
<version>1.1.2</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>Open Software License (OSL 3.0)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Easily create, edit, manage, and publish interactive 360-degree product photography with Arqspin.</summary>
|
10 |
+
<description>Arqspinn is a 360° photography solution that works right from your phone, tablet, or DSLR camera. Simply place your object on a turntable and use our free iOS or Android app to capture, edit, and share an interactive 360° spin, or use your own camera and our online editor.</description>
|
11 |
+
<notes>Initial release of the Arqspin extension.</notes>
|
12 |
+
<authors><author><name>Gregory Segall</name><user>gsegall</user><email>magento@onepica.com</email></author></authors>
|
13 |
+
<date>2014-08-26</date>
|
14 |
+
<time>15:38:38</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="OnePica"><dir name="ArqSpin"><dir name="Block"><dir name="Adminhtml"><dir name="Tabs"><file name="ProductEdit.php" hash="0f86a2b0284ac95de7461e876cba3244"/></dir><file name="Tabs.php" hash="169be27b5c8991534f6d06dbf93059f9"/></dir><dir name="Product"><file name="Gallery.php" hash="b200fb7638c3e659c65fdda483c22ae1"/><dir name="View"><file name="Media.php" hash="f9de5678253fd488adbb4d6314de0f4a"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="d9327b4ebe393d40d96b1153e237b1d1"/></dir><dir name="Model"><file name="Observer.php" hash="42e22f175e89cdd30de6621166838caf"/><file name="Product.php" hash="0656b67d8052b05983b0553eef2cbcbc"/><dir name="System"><dir name="Config"><dir name="General"><file name="Displaytype.php" hash="dab71acfffa8647073caa496778ebdf9"/><file name="Embedtype.php" hash="4b6c70632d1e24ba554ff986f33c4a40"/><file name="GalleryPosition.php" hash="8ae596bb5fced92889aa593ba41d0611"/></dir></dir></dir></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="998d44cf970973cada818c286aed1d26"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="GridController.php" hash="624ff61f9f205f8b904fcfa52a3e591d"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="8a7ddc5e056d5fc29474b9851a6336e6"/><file name="config.xml" hash="a77a7985645fb69db55b040db0278b62"/><file name="system.xml" hash="bded4ad33bd058e7e2b19f69b7e26096"/></dir><dir name="sql"><dir name="arqspin_records_setup"><file name="mysql4-install-1.0.0.php" hash="0ed4d8178dcfb5b67e44b21be69a7b2b"/></dir><file name=".DS_Store" hash="4a1f7c09bb2bc818ff6dddbf0bff1201"/></dir><file name=".DS_Store" hash="4f12125625ad2e89cfdb7898669fdc50"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="OnePica_ArqSpin.xml" hash="accaf1d439ba64f8d0bbaa69caefb634"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="arqspin.xml" hash="553a0b71a5127206d56de07b3461ae06"/></dir><dir name="template"><dir name="arqspin"><file name="productEdit.phtml" hash="ccfe892bcce0ffd57e12d6467edae059"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="arqspin.xml" hash="a77ffefdf6cc538119e00ce19961c9a8"/></dir><dir name="template"><dir name="arqspin"><dir name="product"><file name="gallery.phtml" hash="3bb00800032d7aa27d4b85f2d6f0071d"/><dir name="view"><file name="media.phtml" hash="54f75bca34899c20de372d1148dfa3cb"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="ArqSpin"><file name="ArqSpin.js" hash="753fb64d5be8703edf4d54a93192af3d"/><file name="ArqSpinPreview.js" hash="1ab085185aff68667602c393eb9c963c"/></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.3</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|