Orbitvu_Sun - Version 1.0.0

Version Notes

Official release - first stable version.

Download this release

Release Info

Developer Développeurs EnvoiMoinsCher.com
Extension Orbitvu_Sun
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (44) hide show
  1. app/code/community/Orbitvu/Sun/Block/Adminhtml/Catalog/Product/Grid.php +367 -0
  2. app/code/community/Orbitvu/Sun/Block/Adminhtml/Catalog/Product/Gridrenderer.php +105 -0
  3. app/code/community/Orbitvu/Sun/Block/Adminhtml/Tabs.php +35 -0
  4. app/code/community/Orbitvu/Sun/Block/Adminhtml/Tabs/Tabid.php +24 -0
  5. app/code/community/Orbitvu/Sun/Block/Delay.php +55 -0
  6. app/code/community/Orbitvu/Sun/Block/Html5.php +51 -0
  7. app/code/community/Orbitvu/Sun/Block/KeyComment.php +20 -0
  8. app/code/community/Orbitvu/Sun/Block/Orbittour.php +53 -0
  9. app/code/community/Orbitvu/Sun/Block/Product/View/Media.php +13 -0
  10. app/code/community/Orbitvu/Sun/Block/Syncsku.php +52 -0
  11. app/code/community/Orbitvu/Sun/Block/Teaser.php +55 -0
  12. app/code/community/Orbitvu/Sun/Model/Observer.php +190 -0
  13. app/code/community/Orbitvu/Sun/Model/Resource/Setup.php +14 -0
  14. app/code/community/Orbitvu/Sun/Model/Resource/Sun.php +14 -0
  15. app/code/community/Orbitvu/Sun/controllers/OrbitvuAdmin.php +512 -0
  16. app/code/community/Orbitvu/Sun/controllers/OrbitvuConnect.php +544 -0
  17. app/code/community/Orbitvu/Sun/controllers/OrbitvuDatabaseDriver.php +362 -0
  18. app/code/community/Orbitvu/Sun/controllers/OrbitvuDatabaseInterface.php +1421 -0
  19. app/code/community/Orbitvu/Sun/controllers/OrbitvuDebugger.php +42 -0
  20. app/code/community/Orbitvu/Sun/controllers/OrbitvuTests.php +127 -0
  21. app/code/community/Orbitvu/Sun/etc/adminhtml.xml +26 -0
  22. app/code/community/Orbitvu/Sun/etc/config.xml +96 -0
  23. app/code/community/Orbitvu/Sun/etc/local.xml +0 -0
  24. app/code/community/Orbitvu/Sun/etc/system.xml +298 -0
  25. app/code/community/Orbitvu/Sun/etc/translations.xml +9 -0
  26. app/code/community/Orbitvu/Sun/sql/sun_setup/mysql4-install-1.0.0.php +24 -0
  27. app/design/adminhtml/default/default/template/sun/orbitvu.phtml +1336 -0
  28. app/design/frontend/base/default/layout/sun.xml +17 -0
  29. app/design/frontend/base/default/template/orbitvu/product/view/media.phtml +924 -0
  30. app/etc/modules/Orbitvu_Sun.xml +16 -0
  31. app/locale/de_DE/Orbitvu_Sun.csv +138 -0
  32. app/locale/en_US/Orbitvu_Sun.csv +138 -0
  33. app/locale/es_ES/Orbitvu_Sun.csv +138 -0
  34. app/locale/pl_PL/Orbitvu_Sun.csv +138 -0
  35. crossdomain.xml +4 -0
  36. media/orbitvu/black.png +0 -0
  37. media/orbitvu/blue.png +0 -0
  38. media/orbitvu/loader.gif +0 -0
  39. media/orbitvu/logo.png +0 -0
  40. media/orbitvu/orbit.png +0 -0
  41. media/orbitvu/placeholder.png +0 -0
  42. media/orbitvu/thumbnails/index +0 -0
  43. media/orbitvu/white.png +0 -0
  44. package.xml +20 -0
app/code/community/Orbitvu/Sun/Block/Adminhtml/Catalog/Product/Grid.php ADDED
@@ -0,0 +1,367 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @category Orbitvu
5
+ * @package Orbitvu_Sun
6
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
7
+ * @license http://www.orbitvu.com/plugins/license
8
+ * @version 1.0.0
9
+ */
10
+ class Orbitvu_Sun_Block_Adminhtml_Catalog_Product_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid {
11
+
12
+ const XML_SEVERITY_ICONS_URL_PATH = 'system/adminnotification/severity_icons_url';
13
+
14
+ /*
15
+ * Get column "Orbitvu"
16
+ * for products view
17
+ */
18
+ public function setCollection($collection) {
19
+ //------------------------------------------------------------------------------------------------------------------
20
+ $store = $this->_getStore();
21
+ //------------------------------------------------------------------------------------------------------------------
22
+ if ($store->getId() && !isset($this->_joinAttributes['orbitvu_sun'])) {
23
+ $collection->joinAttribute(
24
+ 'orbitvu_sun', 'catalog_product/orbitvu_sun', 'entity_id', null, 'left', $store->getId()
25
+ );
26
+ }
27
+ else {
28
+ $collection->addAttributeToSelect('orbitvu_sun');
29
+ }
30
+ //------------------------------------------------------------------------------------------------------------------
31
+ parent::setCollection($collection);
32
+ //------------------------------------------------------------------------------------------------------------------
33
+ }
34
+
35
+ /*
36
+ * Don't know why Magento links this notification icons to external resources
37
+ * But OK...
38
+ */
39
+ public function getSeverityIconsUrl($icon_type = 'NOTICE') {
40
+ //------------------------------------------------------------------------------------------------------------------
41
+ $url = (Mage::app()->getFrontController()->getRequest()->isSecure() ? 'https://' : 'http://')
42
+ .sprintf(Mage::getStoreConfig(self::XML_SEVERITY_ICONS_URL_PATH), Mage::getVersion(), 'SEVERITY_'.$icon_type);
43
+ //------------------------------------------------------------------------------------------------------------------
44
+ return $url;
45
+ }
46
+
47
+ /*
48
+ * Render columns with our new one
49
+ * Also, add buttons "Link all presentations" and "Configuration"
50
+ */
51
+ protected function _prepareColumns() {
52
+ //------------------------------------------------------------------------------------------------------------------
53
+ $store = $this->_getStore();
54
+ $request = Mage::app()->getRequest();
55
+ $cookies = Mage::getModel('core/cookie');
56
+ //------------------------------------------------------------------------------------------------------------------
57
+ $observer = Mage::getSingleton('sun/observer');
58
+ $observer->ExtendOrbitvu();
59
+
60
+ $orbitvu_connected = $observer->_Orbitvu->IsConnected();
61
+ //------------------------------------------------------------------------------------------------------------------
62
+ $o_configuration_url = explode('/admin/', $this->getUrl('*/system_config/edit/section/orbitvu/'));
63
+ $o_configuration_url = '*/'.$o_configuration_url[1];
64
+
65
+ $o_update_url = explode('/admin/', $this->getUrl('*/catalog_product/index/sun/update'));
66
+ $o_update_url = '*/'.$o_update_url[1];
67
+
68
+ $o_close_url = explode('/admin/', $this->getUrl('*/catalog_product/index/sun/dismiss'));
69
+ $o_close_url = '*/'.$o_close_url[1];
70
+
71
+ $o_close_welcome_url = explode('/admin/', $this->getUrl('*/catalog_product/index/sun/dismiss_welcome'));
72
+ $o_close_welcome_url = '*/'.$o_close_welcome_url[1];
73
+
74
+ $display_first_time = true;
75
+ //------------------------------------------------------------------------------------------------------------------
76
+
77
+ /*
78
+ * Add column Orbitvu
79
+ */
80
+ //------------------------------------------------------------------------------------------------------------------
81
+ $this->addColumnAfter('orbitvu_sun', array(
82
+ 'header' => Mage::helper('catalog')->__('Orbitvu'),
83
+ 'type' => 'text',
84
+ 'width' => '100px',
85
+ 'renderer' => 'Orbitvu_Sun_Block_Adminhtml_Catalog_Product_Gridrenderer',
86
+ 'index' => 'orbitvu_sun',
87
+ ), 'sku'
88
+ );
89
+ //------------------------------------------------------------------------------------------------------------------
90
+
91
+ /*
92
+ * SUN actions
93
+ */
94
+ //------------------------------------------------------------------------------------------------------------------
95
+ if (date('Y-m-d', strtotime($observer->_Orbitvu->GetConfiguration('last_refreshed'))) != date('Y-m-d')) {
96
+ $observer->_Orbitvu->SynchronizePresentationsItems();
97
+ }
98
+ //------------------------------------------------------------------------------------------------------------------
99
+ if ($request->getParam('sun') == 'update') {
100
+ $observer->SynchronizeAllProducts();
101
+ }
102
+ //------------------------------------------------------------------------------------------------------------------
103
+ else if ($request->getParam('sun') == 'register') {
104
+ $email = strip_tags($_GET['orbitvu_register_email']);
105
+
106
+ $response = $observer->_Orbitvu->CreateAccount($email);
107
+
108
+ if ($response->status == 'BAD') {
109
+ //------------------------------------------------------------------------------------------------------------------
110
+ $buttons = '<a href="'.$this->getUrl('*/catalog_product/index/').'" onclick="closeMessagePopup();">'.Mage::helper('catalog')->__('OK').'</a>';
111
+ //------------------------------------------------------------------------------------------------------------------
112
+ $orbitvu_popup = $this->genPopup(
113
+ Mage::helper('catalog')->__('Error!'),
114
+ Mage::helper('catalog')->__($response->error),
115
+ $buttons,
116
+ '*/catalog_product/index/',
117
+ 'MAJOR'
118
+ );
119
+ //------------------------------------------------------------------------------------------------------------------
120
+ $display_first_time = false;
121
+ //------------------------------------------------------------------------------------------------------------------
122
+ }
123
+ else {
124
+ //------------------------------------------------------------------------------------------------------------------
125
+ $buttons = '<a href="'.$this->getUrl('*/catalog_product/index/').'" onclick="closeMessagePopup();">'.Mage::helper('catalog')->__('OK').'</a>';
126
+ //------------------------------------------------------------------------------------------------------------------
127
+ $orbitvu_popup = $this->genPopup(
128
+ Mage::helper('catalog')->__('Your account was created!'),
129
+ Mage::helper('catalog')->__('Now you have your own account on Orbitvu SUN.<br />We sent your an email with details.').' <br /><strong>'.Mage::helper('catalog')->__('Your trial License Key was created and it\'s now in use.').'</strong>.',
130
+ $buttons,
131
+ '*/catalog_product/index/',
132
+ 'NOTICE'
133
+ );
134
+ //------------------------------------------------------------------------------------------------------------------
135
+ /*
136
+ * <br />Your login details:').'<br />'.Mage::helper('catalog')->__('Login:').' <strong>'.$response->email.'</strong><br />'.Mage::helper('catalog')->__('Password: ').' <strong>'.$response->password.'</strong><br />'.Mage::helper('catalog')->__('License key:').'<br /><strong>'.$response->key.'</strong>
137
+ *
138
+ */
139
+ $observer->_Orbitvu->SetConfiguration('first_time', 'false');
140
+ $display_first_time = false;
141
+ //------------------------------------------------------------------------------------------------------------------
142
+ }
143
+ }
144
+ //------------------------------------------------------------------------------------------------------------------
145
+
146
+ /*
147
+ * Orbitvu Pop-up
148
+ */
149
+ //------------------------------------------------------------------------------------------------------------------
150
+ // Disconnected error
151
+ //------------------------------------------------------------------------------------------------------------------
152
+ if (!$orbitvu_connected) {
153
+ //------------------------------------------------------------------------------------------------------------------
154
+ if ($request->getParam('sun') == 'dismiss' || $cookies->get('sun_cookie') == 'dismiss') {
155
+ //------------------------------------------------------------------------------------------------------------------
156
+ $cookies->set('sun_cookie', 'dismiss');
157
+ //------------------------------------------------------------------------------------------------------------------
158
+ }
159
+ else {
160
+ //------------------------------------------------------------------------------------------------------------------
161
+ $buttons = '<a href="'.$this->getUrl($o_configuration_url).'">'.Mage::helper('catalog')->__('Update your key').'</a>
162
+ <a href="mailto:dev@orbitvu.com" onclick="this.target=\'_blank\';">'.Mage::helper('catalog')->__('Contact Orbitvu').'</a>';
163
+ //------------------------------------------------------------------------------------------------------------------
164
+ $orbitvu_popup = $this->genPopup(
165
+ Mage::helper('catalog')->__('License Key is not valid'),
166
+ Mage::helper('catalog')->__('Your Orbitvu extension License Key is not valid. Please update your Key. Orbitvu extension functionality is now limited.'),
167
+ $buttons,
168
+ $o_close_url,
169
+ 'MAJOR'
170
+ );
171
+ //------------------------------------------------------------------------------------------------------------------
172
+ }
173
+ //------------------------------------------------------------------------------------------------------------------
174
+ }
175
+ //------------------------------------------------------------------------------------------------------------------
176
+ // First time
177
+ //------------------------------------------------------------------------------------------------------------------
178
+ if (($observer->_Orbitvu->GetConfiguration('first_time') == 'true' && $display_first_time) || ($request->getParam('sun') == 'show_welcome' && $display_first_time) || $request->getParam('sun') == 'dismiss_welcome') {
179
+ //------------------------------------------------------------------------------------------------------------------
180
+ if ($request->getParam('sun') == 'dismiss_welcome') {
181
+ //------------------------------------------------------------------------------------------------------------------
182
+ $cookies->set('sun_cookie', 'dismiss');
183
+
184
+ $observer->_Orbitvu->SetConfiguration('first_time', 'false');
185
+ $observer->_Orbitvu->SetDemoAccessToken();
186
+
187
+ $orbitvu_popup = '';
188
+ //------------------------------------------------------------------------------------------------------------------
189
+ }
190
+ else {
191
+ //------------------------------------------------------------------------------------------------------------------
192
+ $orbitvu_popup = $this->genPopup(
193
+ Mage::helper('catalog')->__('Orbitvu Extension Wizard'),
194
+ '<strong>'.Mage::helper('catalog')->__('You need a <a href="http://orbitvu.co" target="_blank">Orbitvu SUN</a> account and License Key to use the extension.').'</strong> '.Mage::helper('catalog')->__('Choose an option:'),
195
+ '<a href="'.$this->getUrl($o_configuration_url).'">'.Mage::helper('catalog')->__('Enter License Key').'</a>',
196
+ $o_close_welcome_url,
197
+ 'NOTICE',
198
+ '',
199
+ '2'
200
+ );
201
+ //------------------------------------------------------------------------------------------------------------------
202
+ }
203
+ //------------------------------------------------------------------------------------------------------------------
204
+ }
205
+
206
+ /*
207
+ * Render Orbitvu buttons actions
208
+ * <a href="javascript:if (confirm(\''.Mage::helper('catalog')->__('Do you really want to link Orbitvu SUN presentations to all products matched with SKU or name? This operation will only be applied to not yet linked products.').'\')) { window.location.href = \''.$o_update_url.'\'; }'">
209
+ */
210
+ //------------------------------------------------------------------------------------------------------------------
211
+ $this->addRssList(
212
+ '></a>',
213
+ '<span style="display: inline-block; position: relative; width: 1px; height: 16px; background: white;"><span style="position: absolute; left: -20px; top: 0; width: 20px; background: white; height: 20px; cursor: default;" onclick="return false;"></span></span>'.
214
+ (!$orbitvu_connected ? '<a href="#" style="cursor: default;">' :
215
+
216
+ '<a href="javascript:if (confirm(\''.Mage::helper('catalog')->__('Do you really want to link Orbitvu SUN presentations to all products matched with SKU or name?').' '.Mage::helper('catalog')->__('This operation will only be applied to not yet linked products.').'\')) { window.location.href = \''.$this->getUrl($o_update_url).'\'; }">'
217
+
218
+ ).
219
+
220
+ '<button type="button" '.(!$orbitvu_connected ?
221
+
222
+ ' disabled="disabled" onclick="return false;" style="opacity: 0.5;" class="scalable orbitvu-button disabled disable"'
223
+
224
+ :
225
+
226
+ ' class="scalable orbitvu-button"'
227
+
228
+ ).' title="'.Mage::helper('catalog')->__('Link Orbitvu SUN presentations to all products matched with SKU or name.').' '.Mage::helper('catalog')->__('This operation will only be applied to not yet linked products.').'" id="button_orbitvu_update"><span><span style="float: left; width: 16px; height: 16px; margin: 0 4px 0 0 !important; background-image: url('.Mage::getBaseUrl('media').'orbitvu/white.png) !important; background-repeat: no-repeat; background-position: 0 -108px !important;"></span>'.Mage::helper('catalog')->__('Link Orbitvu SUN presentations').'</span></button>'.(!$orbitvu_connected ? '<a href="#">' : '').'');
229
+ //------------------------------------------------------------------------------------------------------------------
230
+ $this->addRssList($o_configuration_url, '<button type="button" class="scalable orbitvu-button" title="'.Mage::helper('catalog')->__('Orbitvu Configuration').'" id="button_orbitvu_configuration"><span style="float: left; width: 16px !important; height: 16px !important; margin: 0 5px 0 0; padding: 0; background-image: url('.Mage::getBaseUrl('media').'orbitvu/white.png); background-repeat: no-repeat; background-position: -64px -108px;"></span><span>'.$this->__('Configuration').'<span></span></span></button><script>document.getElementById(\'button_orbitvu_configuration\').parentNode.className = \'\';document.getElementById(\'button_orbitvu_update\').parentNode.className = \'\';
231
+ window.onbeforeunload = function() {
232
+ document.getElementById(\'orbitvu_postloader\').style.display = \'block\';
233
+ }
234
+ </script></a>'.$orbitvu_popup.'<div id="orbitvu_postloader">
235
+ <div id="orbitvu_postloader_bg"></div>
236
+ <div id="orbitvu_postloader_fg"><img src="'.Mage::getBaseUrl('media').'orbitvu/loader.gif" style="margin-top: 150px;" alt="" /></div>
237
+ </div><style type="text/css">
238
+ #orbitvu_postloader { display: none; }
239
+ #orbitvu_postloader_bg { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: 999998; background: white; opacity: 0.8; }
240
+ #orbitvu_postloader_fg { position: fixed; width: 100%; top: 0; left: 0; z-index: 999999; text-align: center; }
241
+ .orbitvu-button { border-color: #1191A6; background: #8dd5e0; background: -moz-linear-gradient(top, #8dd5e0 0%, #009cb5 45%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#8dd5e0), color-stop(45%,#009cb5)); background: -webkit-linear-gradient(top, #8dd5e0 0%,#009cb5 45%); background: -o-linear-gradient(top, #8dd5e0 0%,#009cb5 45%); background: -ms-linear-gradient(top, #8dd5e0 0%,#009cb5 45%); background: linear-gradient(to bottom, #8dd5e0 0%,#009cb5 45%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#8dd5e0\', endColorstr=\'#009cb5\',GradientType=0 ); }
242
+ .orbitvu-button:hover { background: #ddfaff; background: -moz-linear-gradient(top, #ddfaff 0%, #15adc6 59%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ddfaff), color-stop(59%,#15adc6)); background: -webkit-linear-gradient(top, #ddfaff 0%,#15adc6 59%); background: -o-linear-gradient(top, #ddfaff 0%,#15adc6 59%);background: -ms-linear-gradient(top, #ddfaff 0%,#15adc6 59%); background: linear-gradient(to bottom, #ddfaff 0%,#15adc6 59%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=\'#ddfaff\', endColorstr=\'#15adc6\',GradientType=0 ); }
243
+ </style><a href="#">');
244
+ //------------------------------------------------------------------------------------------------------------------
245
+ return parent::_prepareColumns();
246
+ //------------------------------------------------------------------------------------------------------------------
247
+ }
248
+
249
+ /*
250
+ * Generate popup to own usage
251
+ * Based on Magento default notification popup template
252
+ * (unfortunately can't be used without this)
253
+ * Not proud of this part of file... but other solution will be waiste of time
254
+ */
255
+ public function genPopup($header, $message, $buttons, $close_url = '#', $level = 'NOTICE', $icon_text = '', $tpl = '1') {
256
+ $out = '
257
+ <script type="text/javascript">
258
+ //<![CDATA[
259
+ var messagePopupClosed = false;
260
+ function openMessagePopup() {
261
+ var height = $(\'html-body\').getHeight();
262
+ $(\'message-popup-window-mask\').setStyle({\'height\':height+\'px\'});
263
+ toggleSelectsUnderBlock($(\'message-popup-window-mask\'), false);
264
+ Element.show(\'message-popup-window-mask\');
265
+ $(\'message-popup-window\').addClassName(\'show\');
266
+ }
267
+
268
+ function closeMessagePopup() {
269
+ toggleSelectsUnderBlock($(\'message-popup-window-mask\'), true);
270
+ Element.hide(\'message-popup-window-mask\');
271
+ $(\'message-popup-window\').removeClassName(\'show\');
272
+ messagePopupClosed = true;
273
+ }
274
+
275
+ Event.observe(window, \'load\', openMessagePopup);
276
+ Event.observe(window, \'keyup\', function(evt) {
277
+ if(messagePopupClosed) return;
278
+ var code;
279
+ if (evt.keyCode) code = evt.keyCode;
280
+ else if (evt.which) code = evt.which;
281
+ if (code == Event.KEY_ESC) {
282
+ closeMessagePopup();
283
+ }
284
+ });
285
+ //]]>
286
+ </script>
287
+ <div id="message-popup-window-mask" style="display:none;"></div>';
288
+
289
+ if ($tpl == '1') {
290
+ $out .= '
291
+ <div id="message-popup-window" class="message-popup">
292
+ <div class="message-popup-head">
293
+ <a href="'.$this->getUrl($close_url).'" onclick="closeMessagePopup();"><span>'.Mage::helper('catalog')->__('close').'</span></a>
294
+ <h2>'.$header.'</h2>
295
+ </div>
296
+ <div class="message-popup-content">
297
+ <div class="message">
298
+ <span class="message-icon message-error" style="background-image:url('.$this->getSeverityIconsUrl($level).');">'.$icon_text.'</span>
299
+ <p class="message-text">'.$message.'</p>
300
+ </div>
301
+ <p class="read-more">
302
+ '.$buttons.'
303
+ </p>
304
+ </div>
305
+ </div>
306
+ ';
307
+ }
308
+ else {
309
+
310
+ $out .= '
311
+ <div id="message-popup-window" class="message-popup">
312
+ <div class="message-popup-head">
313
+ <a href="'.$this->getUrl($close_url).'" onclick="closeMessagePopup();"><span>'.Mage::helper('catalog')->__('close').'</span></a>
314
+ <h2>'.$header.'</h2>
315
+ </div>
316
+ <div class="message-popup-content">
317
+ <div class="message" id="orbitvu_options">
318
+ <p class="message-text" style="float: none; width: auto; min-height: 1px;">'.$message.'</p>
319
+ <div style="clear: both; overflow: hidden; zoom: 1.0;">
320
+ <div style="padding: 10px 0 10px 0; border-bottom: 1px dotted #f3bf8f;">
321
+ <p class="read-more" style="margin: 0; text-align: left;">
322
+ <a href="'.$this->getUrl($close_url).'" onclick="closeMessagePopup();">'.Mage::helper('catalog')->__('Try extension with DEMO account').'</a>
323
+ <br />
324
+ '.Mage::helper('catalog')->__('You get access to predefined set of 360&deg; presentations.').'
325
+ </p>
326
+ </div>
327
+ <div style="padding: 10px 0 10px 0; border-bottom: 1px dotted #f3bf8f;">
328
+ <p class="read-more" style="margin: 0; text-align: left;">
329
+ <a href="#" onclick="document.getElementById(\'orbitvu_options\').style.display = \'none\'; document.getElementById(\'orbitvu_html_register\').style.display = \'block\';">'.Mage::helper('catalog')->__('Register Orbitvu SUN FREE trial account').'</a>
330
+ <br />
331
+ '.Mage::helper('catalog')->__('Create and customize your own presentations.').'
332
+ </p>
333
+ </div>
334
+ <div style="margin: 0 0 10px 0; padding: 10px 0 10px 0; border-bottom: 1px dotted #f3bf8f;">
335
+ <p class="read-more" style="margin: 0; text-align: left;">
336
+ <a href="'.$this->getUrl('*/system_config/edit/section/orbitvu/').'">'.Mage::helper('catalog')->__('Enter License Key').'</a>
337
+ <br />
338
+ '.Mage::helper('catalog')->__('Connect to your Orbitvu SUN account.').'
339
+ </p>
340
+ </div>
341
+ </div>
342
+ <a href="http://orbitvu.co" target="_blank"><img src="'.Mage::getBaseUrl('media').'orbitvu/logo.png" style="float: right;" alt="" /></a>
343
+ </div>
344
+
345
+ <div class="message" id="orbitvu_html_register" style="display: none;">
346
+ <p class="message-text" style="float: none; width: auto; min-height: 1px;">'.
347
+ Mage::helper('catalog')->__('Creating new account is free. Just enter your e-mail address.').'<br />'.Mage::helper('catalog')->__('We will send you the password and generate trial License Key automaticaly.').'</p>
348
+ <form action="'.$this->getUrl('*/catalog_product/index/sun/register').'" method="get">
349
+ <div class="message-text" style="min-height: 1px; padding: 10px 0 10px 0;">
350
+ <input id="orbitvu_register_email" type="text" name="orbitvu_register_email" placeholder="'.Mage::helper('catalog')->__('Enter your e-mail...').'" value="'.Mage::getStoreConfig('trans_email/ident_general/email').'" />
351
+ <button type="submit" class="scalable orbitvu-button">Register</button>
352
+ <button type="button" onclick="document.getElementById(\'orbitvu_options\').style.display = \'block\'; document.getElementById(\'orbitvu_html_register\').style.display = \'none\';" class="scalable back">Cancel</button>
353
+ </div>
354
+ </form>
355
+ </div>
356
+ </div>
357
+ </div>
358
+ ';
359
+ }
360
+ //------------------------------------------------------------------------------------------------------------------
361
+ return $out;
362
+ //------------------------------------------------------------------------------------------------------------------
363
+ }
364
+
365
+ }
366
+
367
+ ?>
app/code/community/Orbitvu/Sun/Block/Adminhtml/Catalog/Product/Gridrenderer.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Block_Adminhtml_Catalog_Product_Gridrenderer extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
11
+
12
+ /*
13
+ * Render cell value for column "Orbitvu"
14
+ * No time and no need for external CSS etc.
15
+ */
16
+ public function render(Varien_Object $row) {
17
+ //------------------------------------------------------------------------------------------------------------------
18
+ $product_id = $row->getId();
19
+ //------------------------------------------------------------------------------------------------------------------
20
+ $request = Mage::app()->getRequest();
21
+ $observer = Mage::getSingleton('sun/observer');
22
+ $_Orbitvu = $observer->ExtendOrbitvu();
23
+ //------------------------------------------------------------------------------------------------------------------
24
+ $presentation = $_Orbitvu->GetProductPresentation($product_id);
25
+ $types = $presentation['types'];
26
+ //------------------------------------------------------------------------------------------------------------------
27
+ $out = '<div style="width: 100px; min-height: 16px; text-align: center; clear: both; overflow: hidden; zoom: 1.0; position: relative;">';
28
+ //------------------------------------------------------------------------------------------------------------------
29
+ $dot = ' display; block; position: absolute; top: 0; left: 0; width: 16px; height: 17px; background-repeat: no-repeat; ';
30
+ //------------------------------------------------------------------------------------------------------------------
31
+ /*
32
+ * Linked icon
33
+ * Presentation thumbnail
34
+ * Presentation types icon
35
+ */
36
+ if ($presentation['id'] > 0) {
37
+ //------------------------------------------------------------------------------------------------------------------
38
+ $thumbnail = $presentation['items'][0]['thumbnail'];
39
+ foreach ($presentation['items'] as $item) {
40
+ if ($item['status'] == 'active') {
41
+ $thumbnail = $item['thumbnail'];
42
+ break;
43
+ }
44
+ }
45
+ //------------------------------------------------------------------------------------------------------------------
46
+ $out .= '<div style="width: 100%; height: 100%; background: white; clear: both; overflow: hidden; zoom: 1.0; border-radius: 5px;"><span style="'.$dot.' background-position: 0 -108px; background-color: rgba(255, 255, 255, 0.5); border-bottom-right-radius: 5px; background-image: url('.Mage::getBaseUrl('media').'orbitvu/blue.png);" title="'.$this->__('Linked').'"></span>
47
+
48
+ <div style="clear: both; overflow: hidden; zoom: 1.0;"><img src="'.$thumbnail.'?max_width=100&max_height=50" style="max-width: 100px; border-radius: 5px; border: 2px solid white;" alt="" /></div>';
49
+
50
+ $out .= '<div style="position: absolute; bottom: 0; right: 0;">';
51
+ //------------------------------------------------------------------------------------------------------------------
52
+ foreach ($types as $type) {
53
+ //------------------------------------------------------------------------------------------------------------------
54
+ switch ($type) {
55
+ case '0':
56
+ $text = $this->__('Orbittour');
57
+ $bg = '0 -92px';
58
+ break;
59
+ case '1':
60
+ $text = $this->__('360&deg;');
61
+ $bg = '-80px -108px';
62
+ break;
63
+ default:
64
+ $text = $this->__('2D');
65
+ $bg = '-16px -92px';
66
+ break;
67
+ }
68
+
69
+ $out .= '
70
+ <span style="float: left; width: 16px; height: 16px; margin: 0 -2px -2px 4px; background-position: '.$bg.'; background-color: rgba(255, 255, 255, 0.5); background-image: url('.Mage::getBaseUrl('media').'orbitvu/blue.png); background-repeat: no-repeat; border-radius: 5px; border: 2px solid white;" class="orbitvu_tooltip" title="'.$text.'"></span>
71
+ ';
72
+ //------------------------------------------------------------------------------------------------------------------
73
+ }
74
+ //------------------------------------------------------------------------------------------------------------------
75
+ $out .= '</div></div>';
76
+ }
77
+ else {
78
+ //------------------------------------------------------------------------------------------------------------------
79
+ /*
80
+ * Unlinked icon
81
+ */
82
+ if ($_Orbitvu->IsProductUnlinked($product_id)) {
83
+ //------------------------------------------------------------------------------------------------------------------
84
+ $out .= '<span style="'.$dot.' background-position: -16px -108px; background-image: url('.Mage::getBaseUrl('media').'orbitvu/black.png);" title="'.$this->__('Unlinked').'"></span>';
85
+ //------------------------------------------------------------------------------------------------------------------
86
+ }
87
+ /*
88
+ * Not linked icon
89
+ */
90
+ else {
91
+ //------------------------------------------------------------------------------------------------------------------
92
+ $out .= '<span style="'.$dot.' background-position: -16px -108px; background-image: url('.Mage::getBaseUrl('media').'orbitvu/black.png);" title="'.$this->__('Not linked').'"></span>';
93
+ //------------------------------------------------------------------------------------------------------------------
94
+ }
95
+ //------------------------------------------------------------------------------------------------------------------
96
+ }
97
+ //------------------------------------------------------------------------------------------------------------------
98
+ $out .= '</div>';
99
+
100
+ return $out;
101
+ //------------------------------------------------------------------------------------------------------------------
102
+ }
103
+
104
+ }
105
+ ?>
app/code/community/Orbitvu/Sun/Block/Adminhtml/Tabs.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Block_Adminhtml_Tabs extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs {
11
+
12
+ private $parent;
13
+
14
+ /*
15
+ * Add new custom tab "Orbitvu" to admin panel
16
+ */
17
+ protected function _prepareLayout() {
18
+ //------------------------------------------------------------------------------------------------------------------
19
+ $this->parent = parent::_prepareLayout();
20
+
21
+ $request = Mage::app()->getRequest();
22
+ $product_id = $request->getParam('id');
23
+
24
+ if ($product_id > 0) {
25
+ $this->addTab('tabid', array(
26
+ 'label' => Mage::helper('catalog')->__('Orbitvu'),
27
+ 'content' => $this->getLayout()->createBlock('sun/adminhtml_tabs_tabid')->toHtml()
28
+ ));
29
+ }
30
+ //------------------------------------------------------------------------------------------------------------------
31
+ return $this->parent;
32
+ //------------------------------------------------------------------------------------------------------------------
33
+ }
34
+ }
35
+ ?>
app/code/community/Orbitvu/Sun/Block/Adminhtml/Tabs/Tabid.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Block_Adminhtml_Tabs_Tabid extends Mage_Adminhtml_Block_Widget {
11
+
12
+ /*
13
+ * Set template "orbitvu.phtml" right ahead!
14
+ */
15
+ public function __construct() {
16
+ //------------------------------------------------------------------------------------------------------------------
17
+ parent::__construct();
18
+
19
+ $this->setTemplate('sun/orbitvu.phtml');
20
+ //------------------------------------------------------------------------------------------------------------------
21
+ }
22
+ }
23
+
24
+ ?>
app/code/community/Orbitvu/Sun/Block/Delay.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Block_Delay
11
+ {
12
+
13
+ /*
14
+ * Options list
15
+ */
16
+ public function OrbitvuDelayOptions() {
17
+ return array(
18
+ '0' => Mage::helper('adminhtml')->__('No delay'),
19
+ '1' => Mage::helper('adminhtml')->__('0,1 second'),
20
+ '2' => Mage::helper('adminhtml')->__('0,2 second'),
21
+ '3' => Mage::helper('adminhtml')->__('0,3 second'),
22
+ '4' => Mage::helper('adminhtml')->__('0,4 second'),
23
+ '5' => Mage::helper('adminhtml')->__('half a second')
24
+ );
25
+ }
26
+
27
+ /**
28
+ * Options getter
29
+ *
30
+ * @return array
31
+ */
32
+ public function toOptionArray() {
33
+ $array = $this->OrbitvuDelayOptions();
34
+
35
+ $ret = array();
36
+ foreach ($array as $key => $value) {
37
+ $ret[] = array(
38
+ 'value' => $key,
39
+ 'label' => $value
40
+ );
41
+ }
42
+
43
+ return $ret;
44
+ }
45
+
46
+ /**
47
+ * Get options in "key-value" format
48
+ *
49
+ * @return array
50
+ */
51
+ public function toArray() {
52
+ return $this->OrbitvuDelayOptions();
53
+ }
54
+ }
55
+ ?>
app/code/community/Orbitvu/Sun/Block/Html5.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Block_Html5
11
+ {
12
+
13
+ /*
14
+ * Options list
15
+ */
16
+ public function OrbitvuHtml5Options() {
17
+ return array(
18
+ 'yes' => Mage::helper('adminhtml')->__('Always use HTML5'),
19
+ 'no' => Mage::helper('adminhtml')->__('Use Flash if available, otherwise use HTML5')
20
+ );
21
+ }
22
+
23
+ /**
24
+ * Options getter
25
+ *
26
+ * @return array
27
+ */
28
+ public function toOptionArray() {
29
+ $array = $this->OrbitvuHtml5Options();
30
+
31
+ $ret = array();
32
+ foreach ($array as $key => $value) {
33
+ $ret[] = array(
34
+ 'value' => $key,
35
+ 'label' => $value
36
+ );
37
+ }
38
+
39
+ return $ret;
40
+ }
41
+
42
+ /**
43
+ * Get options in "key-value" format
44
+ *
45
+ * @return array
46
+ */
47
+ public function toArray() {
48
+ return $this->OrbitvuHtml5Options();
49
+ }
50
+ }
51
+ ?>
app/code/community/Orbitvu/Sun/Block/KeyComment.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Block_KeyComment
11
+ {
12
+ /**
13
+ * Parsed comment text
14
+ * @return type string
15
+ */
16
+ public function getCommentText() {
17
+ return Mage::helper('catalog')->__('You need <a href="http://orbitvu.co" target="_blank">Orbitvu SUN</a> account and License Key to use Orbitvu extension.').'<br />'.'<a href="'.Mage::helper('adminhtml')->getUrl('*/catalog_product/index/sun/show_welcome').'">'.Mage::helper('catalog')->__('Register').'</a> '.Mage::helper('catalog')->__('trial account or').' <a href="'.Mage::helper('adminhtml')->getUrl('*/catalog_product/index/sun/show_welcome').'">'.Mage::helper('catalog')->__('use DEMO License Key').'</a>.';
18
+ }
19
+ }
20
+ ?>
app/code/community/Orbitvu/Sun/Block/Orbittour.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Block_Orbittour
11
+ {
12
+
13
+ /*
14
+ * Options list
15
+ */
16
+ public function OrbitvuOrbittourOptions() {
17
+ return array(
18
+ 'right_views' => Mage::helper('adminhtml')->__('Views to the right'),
19
+ 'default' => Mage::helper('adminhtml')->__('Views at the bottom'),
20
+ 'noviews' => Mage::helper('adminhtml')->__('No views'),
21
+ 'sun' => Mage::helper('adminhtml')->__('Use Orbitvu SUN setting')
22
+ );
23
+ }
24
+
25
+ /**
26
+ * Options getter
27
+ *
28
+ * @return array
29
+ */
30
+ public function toOptionArray() {
31
+ $array = $this->OrbitvuOrbittourOptions();
32
+
33
+ $ret = array();
34
+ foreach ($array as $key => $value) {
35
+ $ret[] = array(
36
+ 'value' => $key,
37
+ 'label' => $value
38
+ );
39
+ }
40
+
41
+ return $ret;
42
+ }
43
+
44
+ /**
45
+ * Get options in "key-value" format
46
+ *
47
+ * @return array
48
+ */
49
+ public function toArray() {
50
+ return $this->OrbitvuOrbittourOptions();
51
+ }
52
+ }
53
+ ?>
app/code/community/Orbitvu/Sun/Block/Product/View/Media.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Block_Product_View_Media extends Mage_Catalog_Block_Product_View_Media {
11
+
12
+ }
13
+ ?>
app/code/community/Orbitvu/Sun/Block/Syncsku.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Block_Syncsku
11
+ {
12
+
13
+ /*
14
+ * Options list
15
+ */
16
+ public function OrbitvuSyncskuOptions() {
17
+ return array(
18
+ 'false' => Mage::helper('adminhtml')->__('Disable'),
19
+ 'true_ifempty' => Mage::helper('adminhtml')->__('Enable, if remote SKU is empty'),
20
+ 'true' => Mage::helper('adminhtml')->__('Enable')
21
+ );
22
+ }
23
+
24
+ /**
25
+ * Options getter
26
+ *
27
+ * @return array
28
+ */
29
+ public function toOptionArray() {
30
+ $array = $this->OrbitvuSyncskuOptions();
31
+
32
+ $ret = array();
33
+ foreach ($array as $key => $value) {
34
+ $ret[] = array(
35
+ 'value' => $key,
36
+ 'label' => $value
37
+ );
38
+ }
39
+
40
+ return $ret;
41
+ }
42
+
43
+ /**
44
+ * Get options in "key-value" format
45
+ *
46
+ * @return array
47
+ */
48
+ public function toArray() {
49
+ return $this->OrbitvuSyncskuOptions();
50
+ }
51
+ }
52
+ ?>
app/code/community/Orbitvu/Sun/Block/Teaser.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Block_Teaser
11
+ {
12
+
13
+ /*
14
+ * Options list
15
+ */
16
+ public function OrbitvuTeaserOptions() {
17
+ return array(
18
+ 'autorotate' => Mage::helper('adminhtml')->__('Auto-rotation'),
19
+ 'play' => Mage::helper('adminhtml')->__('Play button enables rotation'),
20
+ 'static' => Mage::helper('adminhtml')->__('No teaser (static presentation)'),
21
+ 'onerotation' => Mage::helper('adminhtml')->__('Quick single rotation (make sense only if 360 presentation is your first gallery item)'),
22
+ 'onerotationslow' => Mage::helper('adminhtml')->__('Slow single rotation (make sense only if 360 presentation is your first gallery item)'),
23
+ 'sun' => Mage::helper('adminhtml')->__('Use Orbitvu SUN setting')
24
+ );
25
+ }
26
+
27
+ /**
28
+ * Options getter
29
+ *
30
+ * @return array
31
+ */
32
+ public function toOptionArray() {
33
+ $array = $this->OrbitvuTeaserOptions();
34
+
35
+ $ret = array();
36
+ foreach ($array as $key => $value) {
37
+ $ret[] = array(
38
+ 'value' => $key,
39
+ 'label' => $value
40
+ );
41
+ }
42
+
43
+ return $ret;
44
+ }
45
+
46
+ /**
47
+ * Get options in "key-value" format
48
+ *
49
+ * @return array
50
+ */
51
+ public function toArray() {
52
+ return $this->OrbitvuTeaserOptions();
53
+ }
54
+ }
55
+ ?>
app/code/community/Orbitvu/Sun/Model/Observer.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Model_Observer {
11
+ // Mark as Singleton (for Magento)
12
+ static protected $_singletonFlag = false;
13
+
14
+ public $_Orbitvu;
15
+ //-------------------------------------------------------------------------------------------------------
16
+ public function ExtendOrbitvu($return = true) {
17
+ $helpers = __DIR__.'/../controllers/OrbitvuAdmin.php';
18
+ include_once($helpers);
19
+
20
+ $this->_Orbitvu = new OrbitvuAdmin(false);
21
+
22
+ //-------------------------------------------------------------------------------------------------------
23
+ if ($return) {
24
+ return $this->_Orbitvu;
25
+ }
26
+ //-------------------------------------------------------------------------------------------------------
27
+ }
28
+ //-------------------------------------------------------------------------------------------------------
29
+ public function UpdateThumbnails($product_id) {
30
+ //-------------------------------------------------------------------------------------------------------
31
+ $this->ExtendOrbitvu();
32
+ //-------------------------------------------------------------------------------------------------------
33
+ $CurrentProduct = Mage::getModel('catalog/product')->load($product_id);
34
+ $ProductHelper = Mage::helper('catalog/product');
35
+ $medias = $CurrentProduct->getMediaGalleryImages();
36
+ $orbithumbs = $this->_Orbitvu->GetProductThumbnails($product_id);
37
+ //-------------------------------------------------------------------------------------------------------
38
+ $o_thumbs_count = intval(count($orbithumbs)); // = 1 or 0
39
+ $m_thumbs_count = intval(count($medias));
40
+ $n = $m_thumbs_count - $o_thumbs_count;
41
+ //-------------------------------------------------------------------------------------------------------
42
+ if ($o_thumbs_count > 0) {
43
+ $this->DeleteThumbnail($product_id, $orbithumbs[0]);
44
+ $o_thumbs_count = 0;
45
+ }
46
+ //-------------------------------------------------------------------------------------------------------
47
+ if ($m_thumbs_count > 1 && $o_thumbs_count == 0) {
48
+ // magento own images - do nothing
49
+ }
50
+ else if ($o_thumbs_count == 0 && $m_thumbs_count == 0) {
51
+ //-------------------------------------------------------------------------------------------------------
52
+ try {
53
+ $new_thumbnail = $this->AddThumbnail($product_id);
54
+ if (!empty($new_thumbnail)) {
55
+ $this->_Orbitvu->SetProductThumbnail($product_id, $new_thumbnail);
56
+ }
57
+ }
58
+ catch (Exception $e) {}
59
+ //-------------------------------------------------------------------------------------------------------
60
+ }
61
+ //-------------------------------------------------------------------------------------------------------
62
+ return true;
63
+ //-------------------------------------------------------------------------------------------------------
64
+ }
65
+
66
+ public function AddThumbnail($product_id) {
67
+ //-------------------------------------------------------------------------------------------------------
68
+ $presentation = $this->_Orbitvu->GetProductPresentation($product_id, true);
69
+ //-------------------------------------------------------------------------------------------------------
70
+ if (count($presentation['items']) <= 0) {
71
+ return false;
72
+ }
73
+ //-------------------------------------------------------------------------------------------------------
74
+ $file = 'http:'.$presentation['items'][0]['thumbnail'];
75
+
76
+ if (stristr($file, '.png')) {
77
+ $ext = 'png';
78
+ }
79
+ else {
80
+ $ext = 'jpeg';
81
+ }
82
+ //-------------------------------------------------------------------------------------------------------
83
+ $sun = file_get_contents($file);
84
+ //-------------------------------------------------------------------------------------------------------
85
+ $media_api = Mage::getModel('catalog/product_attribute_media_api');
86
+ //-------------------------------------------------------------------------------------------------------
87
+ $newImage = array(
88
+ 'file' => array(
89
+ 'name' => md5(date('H:i:s Y-m-d').'Orbitvu Thumbnail'.mt_rand(0, 999999)),
90
+ 'content' => base64_encode($sun),
91
+ 'mime' => 'image/'.$ext
92
+ ),
93
+ 'label' => 'Orbitvu Thumbnail',
94
+ 'position' => 1,
95
+ 'types' => array('thumbnail', 'small_image', 'image'),
96
+ 'exclude' => 1
97
+ );
98
+ //-------------------------------------------------------------------------------------------------------
99
+ return $media_api->create($product_id, $newImage);
100
+ //-------------------------------------------------------------------------------------------------------
101
+ }
102
+
103
+ public function DeleteThumbnail($product_id, $orbitvu_entry) {
104
+ //-------------------------------------------------------------------------------------------------------
105
+ $mediaApi = Mage::getModel('catalog/product_attribute_media_api');
106
+ $items = $mediaApi->items($product_id);
107
+ $this->_Orbitvu->DeleteProductThumbnail($product_id);
108
+ //-------------------------------------------------------------------------------------------------------
109
+ foreach ($items as $item) {
110
+ if ($item['file'] == $orbitvu_entry['thumbnail']) {
111
+ $mediaApi->remove($product_id, $item['file']);
112
+ $fileName = Mage::getBaseDir('media').'/catalog/product'.$item['file'];
113
+
114
+ if (file_exists($fileName)) {
115
+ unlink($fileName);
116
+ }
117
+ }
118
+ }
119
+ //-------------------------------------------------------------------------------------------------------
120
+ }
121
+
122
+ /*
123
+ * Make synchronization
124
+ */
125
+ public function SynchronizeAllProducts() {
126
+ //-------------------------------------------------------------------------------------------------------
127
+ $products = $this->_Orbitvu->SynchronizeAllProducts();
128
+ foreach ($products as $product) {
129
+ $this->UpdateThumbnails($product['product_id']);
130
+ }
131
+ //-------------------------------------------------------------------------------------------------------
132
+ }
133
+ //-------------------------------------------------------------------------------------------------------
134
+ /*
135
+ * Simple redirect
136
+ */
137
+ public function RedirectAlias($url) {
138
+ //-------------------------------------------------------------------------------------------------------
139
+ $srv = Mage::getUrl($url);
140
+ return Mage::app()->getResponse()->setHeader('Location', $srv)->sendHeaders();
141
+ //-------------------------------------------------------------------------------------------------------
142
+ }
143
+ //-------------------------------------------------------------------------------------------------------
144
+ /*
145
+ * Own templates
146
+ */
147
+ public function UseTemplate($ar, $template) {
148
+ //-------------------------------------------------------------------------------------------------------
149
+ return $this->_Orbitvu->UseTemplate($ar, $template);
150
+ //-------------------------------------------------------------------------------------------------------
151
+ }
152
+ //-------------------------------------------------------------------------------------------------------
153
+ /*
154
+ * Save product
155
+ */
156
+ public function saveProductTabData(Varien_Event_Observer $observer) {
157
+ //-------------------------------------------------------------------------------------------------------
158
+ if (!self::$_singletonFlag) {
159
+ self::$_singletonFlag = true;
160
+
161
+ //-------------------------------------------------------------------------------------------------------
162
+ $this->ExtendOrbitvu();
163
+ //-------------------------------------------------------------------------------------------------------
164
+
165
+ /*
166
+ * Update Orbitvu thumbnails
167
+ */
168
+ //-------------------------------------------------------------------------------------------------------
169
+ if (Mage::app()->getRequest()->getParam('sun') != 'update') {
170
+ $product_id = Mage::registry('product')->getId();
171
+ $this->UpdateThumbnails($product_id);
172
+ }
173
+ //-------------------------------------------------------------------------------------------------------
174
+
175
+ /*
176
+ * Force SUN synchro
177
+ */
178
+ //-------------------------------------------------------------------------------------------------------
179
+ if (Mage::app()->getRequest()->getPost('synchronize_sun') == 'true') {
180
+ //-------------------------------------------------------------------------------------------------------
181
+ $this->SynchronizeAllProducts();
182
+ //-------------------------------------------------------------------------------------------------------
183
+ }
184
+ //-------------------------------------------------------------------------------------------------------
185
+ }
186
+ //-------------------------------------------------------------------------------------------------------
187
+ }
188
+ }
189
+
190
+ ?>
app/code/community/Orbitvu/Sun/Model/Resource/Setup.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup {
11
+
12
+ }
13
+
14
+ ?>
app/code/community/Orbitvu/Sun/Model/Resource/Sun.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ class Orbitvu_Sun_Model_Sun extends Mage_Core_Model_Abstract {
11
+
12
+ }
13
+
14
+ ?>
app/code/community/Orbitvu/Sun/controllers/OrbitvuAdmin.php ADDED
@@ -0,0 +1,512 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Orbitvu PHP Orbitvu eCommerce administration
4
+ * @Copyright: Orbitvu Sp. z o.o. is the owner of full rights to this code
5
+ */
6
+
7
+ class OrbitvuAdmin {
8
+
9
+ /**
10
+ * Database driver instance
11
+ * @var instance
12
+ */
13
+ private $driver;
14
+
15
+ /**
16
+ * Is the extension connected?
17
+ * @var bool
18
+ */
19
+ private $work = true;
20
+
21
+ /**
22
+ * Configuration vars and values
23
+ * @var stdClass
24
+ */
25
+ public $Config;
26
+
27
+ /**
28
+ * SUN API connection instance
29
+ * @var instance
30
+ */
31
+ public $Connect;
32
+
33
+ /**
34
+ * Include all classes
35
+ * @param boolean $debug Debug mode
36
+ * @param boolean $test Unit tests mode
37
+ * @param boolean $testinstance Unit tests instance.
38
+ */
39
+ public function __construct($debug = false, $test = false, $testinstance = false) {
40
+ //-------------------------------------------------------------------------------------------------------
41
+ require_once(__DIR__.'/OrbitvuDebugger.php');
42
+ require_once(__DIR__.'/OrbitvuDatabaseInterface.php');
43
+ require_once(__DIR__.'/OrbitvuConnect.php');
44
+ //-------------------------------------------------------------------------------------------------------
45
+ /*
46
+ * Let's do the magic
47
+ */
48
+ //-------------------------------------------------------------------------------------------------------
49
+ $this->driver = new OrbitvuDatabaseInterface('', $debug, $test, $testinstance);
50
+ $this->Config = $this->driver->GetConfiguration();
51
+ //-------------------------------------------------------------------------------------------------------
52
+ $this->Connect = new Orbitvu($this->Config->access_token, $debug, $test, $testinstance);
53
+ //-------------------------------------------------------------------------------------------------------
54
+ $this->Connect->IntroduceYourself($this->driver->GetVersion());
55
+ if (!$this->Connect->IsConnected()) {
56
+ $this->work = false;
57
+ }
58
+ $this->Connect->ViewerPath = $this->Config->viewers_path;
59
+ $this->Connect->DownloadPath = $this->Config->temp_path;
60
+ //-------------------------------------------------------------------------------------------------------
61
+ $this->driver->SetSUNConnection($this->Connect);
62
+ //-------------------------------------------------------------------------------------------------------
63
+ }
64
+
65
+ /**
66
+ * Own simple, template parser.
67
+ * Usign every store script template engine doesn't make practical sense.
68
+ * Especially most of them doesn't have a template engine.
69
+ * @param array $ar template array to replace in $template
70
+ * @param string $template template
71
+ * @return string
72
+ */
73
+ public function UseTemplate($ar, $template) {
74
+ //-------------------------------------------------------------------------------------------------------
75
+ $keys = array_map(function($str) {
76
+ return '{'.$str.'}';
77
+ }, array_keys($ar));
78
+ //-------------------------------------------------------------------------------------------------------
79
+ return str_replace($keys, array_values($ar), $template);
80
+ //-------------------------------------------------------------------------------------------------------
81
+ }
82
+
83
+ /**
84
+ * Register an account
85
+ * @param string $email Email to register
86
+ * @return stdClass
87
+ */
88
+ public function CreateAccount($email) {
89
+ //-------------------------------------------------------------------------------------------------------
90
+ try {
91
+ //-------------------------------------------------------------------------------------------------------
92
+ $account = $this->Connect->CreateAccount($email);
93
+
94
+ $this->driver->UpdateConfiguration('access_token', $account->key);
95
+ //-------------------------------------------------------------------------------------------------------
96
+ return $account;
97
+ //-------------------------------------------------------------------------------------------------------
98
+ }
99
+ catch (Exception $e) {
100
+ //-------------------------------------------------------------------------------------------------------
101
+ $ret = new stdClass();
102
+ $ret->error = $e->getMessage();
103
+ $ret->status = 'BAD';
104
+ //-------------------------------------------------------------------------------------------------------
105
+ return $ret;
106
+ //-------------------------------------------------------------------------------------------------------
107
+ }
108
+ //-------------------------------------------------------------------------------------------------------
109
+ }
110
+
111
+ /**
112
+ * Set extension access token to default
113
+ * @return boolean
114
+ */
115
+ public function SetDemoAccessToken() {
116
+ //-------------------------------------------------------------------------------------------------------
117
+ return $this->UpdateConfiguration('access_token', $this->Connect->GetDemoAccessToken());
118
+ //-------------------------------------------------------------------------------------------------------
119
+ }
120
+
121
+ /**
122
+ * Get presentation items types
123
+ * @return array
124
+ */
125
+ public function GetPresentationTypes($result) {
126
+ //-------------------------------------------------------------------------------------------------------
127
+ $types = array();
128
+ //-------------------------------------------------------------------------------------------------------
129
+ if ($result->has_orbittour == 1) {
130
+ $types[] = '0';
131
+ }
132
+ //-------------------------------------------------------------------------------------------------------
133
+ for ($k = 0, $m = count($result->presentationcontent_set); $k < $m; $k++) {
134
+ $cur_type = $result->presentationcontent_set[$k]->type;
135
+
136
+ if (!in_array($cur_type, $types)) {
137
+ $types[] = $cur_type;
138
+ }
139
+ }
140
+ //-------------------------------------------------------------------------------------------------------
141
+ rsort($types);
142
+ //-------------------------------------------------------------------------------------------------------
143
+ return $types;
144
+ //-------------------------------------------------------------------------------------------------------
145
+ }
146
+
147
+ /**
148
+ * Get product presentation items
149
+ * @return array
150
+ */
151
+ public function GetProductPresentationItems($orbitvu_id) {
152
+ //-------------------------------------------------------------------------------------------------------
153
+ return $this->driver->GetProductPresentationItems($orbitvu_id);
154
+ //-------------------------------------------------------------------------------------------------------
155
+ }
156
+
157
+ /**
158
+ * Synchronize one product presentation
159
+ * @return array
160
+ */
161
+ public function SynchronizeProductPresentation($product_id, $presentation_id, $presentation_name) {
162
+ //-------------------------------------------------------------------------------------------------------
163
+ $this->SetProductPresentation($product_id, $presentation_id, $presentation_name);
164
+ $p_items = $this->GetProductPresentationItems($presentation_id, $this->GetConfiguration('sync_order'));
165
+ $this->SetProductPresentationItems($product_id, $presentation_id, $presentation_name, $p_items);
166
+ //-------------------------------------------------------------------------------------------------------
167
+ return true;
168
+ //-------------------------------------------------------------------------------------------------------
169
+ }
170
+
171
+ /**
172
+ * Set SUN presentation SKU
173
+ * @param type $presentation_id Presentation ID from database
174
+ * @param type $new_sku Presentation new SKU
175
+ * @param type $current_sku Presentation current SKU to update
176
+ * @param boolean $update Force SKU update
177
+ * @return boolean
178
+ */
179
+ public function SetSunPresentationSku($presentation_id, $new_sku, $current_sku, $update = false) {
180
+ //-------------------------------------------------------------------------------------------------------
181
+ if (!$update && (($this->GetConfiguration('auto_sync_sku') == 'true_ifempty' && empty($current_sku)) || $this->GetConfiguration('auto_sync_sku') == 'true')) {
182
+ $update = true;
183
+ }
184
+ //-------------------------------------------------------------------------------------------------------
185
+ if ($update) {
186
+ return $this->Connect->CallSUN('presentations/'.$presentation_id.'/sku', array('sku' => $new_sku), true, true);
187
+ }
188
+ //-------------------------------------------------------------------------------------------------------
189
+ return false;
190
+ //-------------------------------------------------------------------------------------------------------
191
+ }
192
+
193
+ /**
194
+ * Are we connected to the Orbitvu SUN?
195
+ * @return bool
196
+ */
197
+ public function IsConnected() {
198
+ //-------------------------------------------------------------------------------------------------------
199
+ return $this->work;
200
+ //-------------------------------------------------------------------------------------------------------
201
+ }
202
+
203
+ /**
204
+ * Check for available updates
205
+ * @return stdClass|boolean
206
+ */
207
+ public function CheckForUpdates() {
208
+ //-------------------------------------------------------------------------------------------------------
209
+ return $this->Connect->CheckForUpdates();
210
+ //-------------------------------------------------------------------------------------------------------
211
+ }
212
+
213
+ /**
214
+ * License days counter
215
+ * @return integer
216
+ */
217
+ public function GetSupportDays() {
218
+ //-------------------------------------------------------------------------------------------------------
219
+ return $this->Connect->GetSupportDays();
220
+ //-------------------------------------------------------------------------------------------------------
221
+ }
222
+
223
+ /**
224
+ * Check if license is demo
225
+ * @return boolean
226
+ */
227
+ public function IsDemo() {
228
+ //-------------------------------------------------------------------------------------------------------
229
+ return $this->Connect->IsDemo();
230
+ //-------------------------------------------------------------------------------------------------------
231
+ }
232
+
233
+ //-------------------------------------------------------------------------------------------------------
234
+ //-------------------------------------------------------------------------------------------------------
235
+ //-------------------------------------------------------------------------------------------------------
236
+ // Forward queries to included driver
237
+ //-------------------------------------------------------------------------------------------------------
238
+ //-------------------------------------------------------------------------------------------------------
239
+ //-------------------------------------------------------------------------------------------------------
240
+
241
+ /**
242
+ * Update both extension and store configuration
243
+ * @param string $var Configuration var to update
244
+ * @param string $value New value
245
+ * @return boolean
246
+ */
247
+ public function UpdateConfiguration($var, $value) {
248
+ //-------------------------------------------------------------------------------------------------------
249
+ $this->driver->SetConfiguration($var, $value);
250
+ $this->driver->SetConfigurationParent($var, $value);
251
+ //-------------------------------------------------------------------------------------------------------
252
+ }
253
+
254
+ /**
255
+ * Use UpdateConfiguration if you want to update store configuration too
256
+ * @param string $var Local configuration var to update
257
+ * @param string $value Local new value
258
+ * @return boolean
259
+ */
260
+ public function SetConfiguration($var, $value) {
261
+ //-------------------------------------------------------------------------------------------------------
262
+ return $this->driver->SetConfiguration($var, $value);
263
+ //-------------------------------------------------------------------------------------------------------
264
+ }
265
+
266
+ /**
267
+ * Switch presentation item priority
268
+ * @param integer $product_id Store product ID from database
269
+ * @param integer $item_id Current item ID from database
270
+ * @param integer $item_id2 Item will be putted in order after this item
271
+ * @return boolean
272
+ */
273
+ public function SwitchPresentationItemPriority($product_id, $item_id, $item_id2) {
274
+ //-------------------------------------------------------------------------------------------------------
275
+ return $this->driver->SwitchPresentationItemPriority($product_id, $item_id, $item_id2);
276
+ //-------------------------------------------------------------------------------------------------------
277
+ }
278
+
279
+ /**
280
+ * Get product presentation data
281
+ * Get product presentation items
282
+ * @param integer $product_id Store product ID from database
283
+ * @param boolean $visible_only Return only items marked as visible
284
+ * @return array
285
+ */
286
+ public function GetProductPresentation($product_id, $visible_only = false) {
287
+ //-------------------------------------------------------------------------------------------------------
288
+ return $this->driver->GetProductPresentation($product_id, $visible_only);
289
+ //-------------------------------------------------------------------------------------------------------
290
+ }
291
+
292
+ /**
293
+ * Set new product presentation
294
+ * @param type $product_id Store product ID from database
295
+ * @param type $orbitvu_id Orbitvu SUN presentation ID
296
+ * @param type $orbitvu_name Orbitvu SUN presentation name
297
+ * @return boolean
298
+ */
299
+ public function SetProductPresentation($product_id, $orbitvu_id, $orbitvu_name = '') {
300
+ //-------------------------------------------------------------------------------------------------------
301
+ return $this->driver->SetProductPresentation($product_id, $orbitvu_id, $orbitvu_name);
302
+ //-------------------------------------------------------------------------------------------------------
303
+ }
304
+
305
+ /**
306
+ * Set product presentation items
307
+ * @param type $product_id Store product ID from database
308
+ * @param type $orbitvu_id Orbitvu SUN presentation ID
309
+ * @param type $orbitvu_name Orbitvu SUN presentation name
310
+ * @param type $presentation_items Orbitvu SUN presentation items
311
+ * @return type
312
+ */
313
+ public function SetProductPresentationItems($product_id, $orbitvu_id, $orbitvu_name, $presentation_items) {
314
+ //-------------------------------------------------------------------------------------------------------
315
+ return $this->driver->SetProductPresentationItems($product_id, $orbitvu_id, $orbitvu_name, $presentation_items);
316
+ //-------------------------------------------------------------------------------------------------------
317
+ }
318
+
319
+ /**
320
+ * Synchronize presentations
321
+ * @param array $products_array Products array
322
+ * @return boolean
323
+ */
324
+ public function SynchronizePresentations($products_array) {
325
+ //-------------------------------------------------------------------------------------------------------
326
+ return $this->driver->SynchronizePresentations($products_array);
327
+ //-------------------------------------------------------------------------------------------------------
328
+ }
329
+
330
+ /**
331
+ * Refresh presentations items
332
+ * Delete non-existing on SUN
333
+ * Add new from SUN
334
+ * @return boolean
335
+ */
336
+ public function SynchronizePresentationsItems() {
337
+ //-------------------------------------------------------------------------------------------------------
338
+ return $this->driver->SynchronizePresentationsItems();
339
+ //-------------------------------------------------------------------------------------------------------
340
+ }
341
+
342
+ /**
343
+ * Is presentation unlinked?
344
+ * @param integer $product_id Store product ID from database
345
+ * @param integer $orbitvu_id Orbitvu SUN presentation ID
346
+ * @return boolean
347
+ */
348
+ public function IsPresentationUnlinked($product_id, $orbitvu_id) {
349
+ //-------------------------------------------------------------------------------------------------------
350
+ return $this->driver->IsPresentationUnlinked($product_id, $orbitvu_id);
351
+ //-------------------------------------------------------------------------------------------------------
352
+ }
353
+
354
+ /**
355
+ * Is the product unlinked?
356
+ * @param integer $product_id Store product ID from database
357
+ * @return boolean
358
+ */
359
+ public function IsProductUnlinked($product_id) {
360
+ //-------------------------------------------------------------------------------------------------------
361
+ return $this->driver->IsProductUnlinked($product_id);
362
+ //-------------------------------------------------------------------------------------------------------
363
+ }
364
+
365
+ /**
366
+ * Unlink (free) presentation from product
367
+ * @param integer $product_id Store product ID from database
368
+ * @return boolean
369
+ */
370
+ public function FreeProduct($product_id) {
371
+ //-------------------------------------------------------------------------------------------------------
372
+ return $this->driver->FreeProduct($product_id);
373
+ //-------------------------------------------------------------------------------------------------------
374
+ }
375
+
376
+ /**
377
+ * Get configuration value from var
378
+ * @param string $var Var from configuration
379
+ * @return string
380
+ */
381
+ public function GetConfiguration($var) {
382
+ //-------------------------------------------------------------------------------------------------------
383
+ return $this->Config->$var;
384
+ //-------------------------------------------------------------------------------------------------------
385
+ }
386
+
387
+ /**
388
+ * Update item priority
389
+ * @param integer $item_id Store product item ID from database
390
+ * @param integer $new_priority New priority (order) value
391
+ * @return boolean
392
+ */
393
+ public function UpdatePresentationItemPriority($item_id, $new_priority) {
394
+ //-------------------------------------------------------------------------------------------------------
395
+ return $this->driver->UpdatePresentationItemPriority($item_id, $new_priority);
396
+ //-------------------------------------------------------------------------------------------------------
397
+ }
398
+
399
+ /**
400
+ * Delete presentation item
401
+ * @param integer $item_id Store product item ID from database
402
+ * @return boolean
403
+ */
404
+ public function DeletePresentationItem($item_id) {
405
+ //-------------------------------------------------------------------------------------------------------
406
+ return $this->driver->DeletePresentationItem($item_id);
407
+ //-------------------------------------------------------------------------------------------------------
408
+ }
409
+
410
+ /**
411
+ * Have the product a presentation exists?
412
+ * @param integer $product_id Store product ID from database
413
+ * @return boolean
414
+ */
415
+ public function ExistsProductPresentation($product_id) {
416
+ //-------------------------------------------------------------------------------------------------------
417
+ return $this->driver->ExistsProductPresentation($product_id);
418
+ //-------------------------------------------------------------------------------------------------------
419
+ }
420
+
421
+ /**
422
+ * Search the presentation with name and SKU
423
+ * @param array $product Product array with name and SKU
424
+ * @return array|boolean
425
+ */
426
+ public function MatchPresentation($product) {
427
+ //-------------------------------------------------------------------------------------------------------
428
+ return $this->driver->MatchPresentation($product);
429
+ //-------------------------------------------------------------------------------------------------------
430
+ }
431
+
432
+ /**
433
+ * Update item visibility status
434
+ * @param integer $item_id Store product item ID from database
435
+ * @param string $status New item visibility status [active / inactive]
436
+ * @return boolean
437
+ */
438
+ public function UpdatePresentationItemStatus($item_id, $status = 'inactive') {
439
+ //-------------------------------------------------------------------------------------------------------
440
+ return $this->driver->UpdatePresentationItemStatus($item_id, $status);
441
+ //-------------------------------------------------------------------------------------------------------
442
+ }
443
+
444
+ /**
445
+ * Install database tables
446
+ * @return boolean
447
+ */
448
+ public function Install() {
449
+ //-------------------------------------------------------------------------------------------------------
450
+ return $this->driver->Install();
451
+ //-------------------------------------------------------------------------------------------------------
452
+ }
453
+
454
+ /**
455
+ * Get presentations from Orbitvu SUN
456
+ * @param array $params Params for Orbitvu SUN filtering
457
+ * @return stdClass
458
+ */
459
+ public function GetPresentationsList($params = false) {
460
+ //-------------------------------------------------------------------------------------------------------
461
+ return $this->driver->GetPresentationsList($params);
462
+ //-------------------------------------------------------------------------------------------------------
463
+ }
464
+
465
+ /**
466
+ * Get our store thumbnails
467
+ * @param integer $product_id Store product ID from database
468
+ * @return array
469
+ */
470
+ public function GetProductThumbnails($product_id) {
471
+ //-------------------------------------------------------------------------------------------------------
472
+ return $this->driver->GetProductThumbnails($product_id);
473
+ //-------------------------------------------------------------------------------------------------------
474
+ }
475
+
476
+ /**
477
+ * Set store thumbnail
478
+ * @param integer $product_id Store product ID from database
479
+ * @param string $thumbnail Thumbnail path
480
+ * @return array
481
+ */
482
+ public function SetProductThumbnail($product_id, $thumbnail) {
483
+ //-------------------------------------------------------------------------------------------------------
484
+ return $this->driver->SetProductThumbnail($product_id, $thumbnail);
485
+ //-------------------------------------------------------------------------------------------------------
486
+ }
487
+
488
+ /**
489
+ * Delete store thumbnail
490
+ * @param integer $product_id Store product ID from database
491
+ * @param string $thumbnail Thumbnail path
492
+ * @return array
493
+ */
494
+ public function DeleteProductThumbnail($product_id, $thumbnail = '') {
495
+ //-------------------------------------------------------------------------------------------------------
496
+ return $this->driver->DeleteProductThumbnail($product_id, $thumbnail);
497
+ //-------------------------------------------------------------------------------------------------------
498
+ }
499
+
500
+ /**
501
+ * Synchronization
502
+ * @return boolean
503
+ */
504
+ public function SynchronizeAllProducts() {
505
+ //-------------------------------------------------------------------------------------------------------
506
+ return $this->driver->SynchronizeAllProducts($params);
507
+ //-------------------------------------------------------------------------------------------------------
508
+ }
509
+
510
+ }
511
+
512
+ ?>
app/code/community/Orbitvu/Sun/controllers/OrbitvuConnect.php ADDED
@@ -0,0 +1,544 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Orbitvu PHP Orbitvu eCommerce SUN connection
4
+ * @Copyright: Orbitvu Sp. z o.o. is the owner of full rights to this code
5
+ */
6
+
7
+ class Orbitvu {
8
+
9
+ /**
10
+ * License Key
11
+ * @var string
12
+ */
13
+ private $access_token;
14
+
15
+ /**
16
+ * Debug mode
17
+ * @var boolean
18
+ */
19
+ private $debug = false;
20
+
21
+ /**
22
+ * Unit tests mode
23
+ * @var boolean
24
+ */
25
+ private $test = false;
26
+
27
+ /**
28
+ * Test class instance
29
+ * @var instance
30
+ */
31
+ private $testclass = false;
32
+
33
+ /**
34
+ * Curl version
35
+ * @var string
36
+ */
37
+ private $curl_version;
38
+
39
+ /**
40
+ * New available version of plugin
41
+ * @var string
42
+ */
43
+ private $plugin_available_version;
44
+
45
+ /**
46
+ * License end date
47
+ * @var date Y-m-d
48
+ */
49
+ private $plugin_support;
50
+
51
+ /**
52
+ * Default DEMO access token
53
+ * Available to change (if updated)
54
+ * @var string
55
+ */
56
+ private $demo_access_token = '1567f2b4a02a8bfc5d8aacf0f44b16157e149d29';
57
+
58
+ /**
59
+ * Viewers path
60
+ * @fixme delete if not used
61
+ * @var string
62
+ */
63
+ public $ViewerPath = 'viewers/src/';
64
+
65
+ /**
66
+ * Temporary path for uploads
67
+ * @var string
68
+ */
69
+ public $DownloadPath = 'tmp/';
70
+
71
+ /*
72
+ * The constructor. Set access_token to this instance
73
+ */
74
+ /**
75
+ * Let's do the magic
76
+ * @param string $access_token License Key
77
+ * @param boolean $debug Debug mode
78
+ * @param boolean $test Unit tests mode
79
+ * @param boolean $testinstance Unit tests instance.
80
+ */
81
+ public function __construct($access_token, $debug = false, $test = false, $testinstance = false) {
82
+ //---------------------------------------------------------------------------------------------------
83
+ $this->access_token = $access_token;
84
+ $this->debug = $debug;
85
+ $this->test = $test;
86
+ //---------------------------------------------------------------------------------------------------
87
+
88
+ /*
89
+ * Test instance
90
+ */
91
+ //---------------------------------------------------------------------------------------------------
92
+ if ($this->test) {
93
+ $this->testclass = $testinstance;
94
+
95
+ /*
96
+ * Run test bot!
97
+ */
98
+ $this->run_tests();
99
+ }
100
+ //---------------------------------------------------------------------------------------------------
101
+
102
+ //----------------------------------------------------------
103
+ /**/ if ($this->debug || $this->test) {
104
+ /**/ error_reporting(E_ALL & ~E_NOTICE);
105
+ /**/ ini_set('display_errors', '1');
106
+ /**/ }
107
+ //----------------------------------------------------------
108
+ }
109
+
110
+ /**
111
+ * Set the CURL version
112
+ * @param string $v CURL version
113
+ */
114
+ public function IntroduceYourself($v) {
115
+ //-------------------------------------------------------------------------------------------------------
116
+ $this->curl_version = $v;
117
+ //-------------------------------------------------------------------------------------------------------
118
+ }
119
+
120
+ /**
121
+ * Check if we are connected
122
+ * Also, get updates info if available
123
+ * @return boolean
124
+ */
125
+ public function IsConnected() {
126
+ //---------------------------------------------------------------------------------------------------
127
+ $get = $this->CallSUN('plugins/versions/latest', '', false, true);
128
+ //-------------------------------------------------------------------------------------------------------
129
+ $this->plugin_available_version = $get->version;
130
+ $this->plugin_support = $get->support;
131
+
132
+ if ($get->error) {
133
+ return false;
134
+ }
135
+ //-------------------------------------------------------------------------------------------------------
136
+ return true;
137
+ //---------------------------------------------------------------------------------------------------
138
+ }
139
+
140
+ /**
141
+ * Get the demo access token
142
+ * @return string
143
+ */
144
+ public function GetDemoAccessToken() {
145
+ //-------------------------------------------------------------------------------------------------------
146
+ return $this->demo_access_token;
147
+ //-------------------------------------------------------------------------------------------------------
148
+ }
149
+
150
+ /**
151
+ * Check if current license is demo
152
+ * @return boolean
153
+ */
154
+ public function IsDemo() {
155
+ //-------------------------------------------------------------------------------------------------------
156
+ if ($this->access_token == $this->GetDemoAccessToken()) {
157
+ //-------------------------------------------------------------------------------------------------------
158
+ return true;
159
+ //-------------------------------------------------------------------------------------------------------
160
+ }
161
+ //-------------------------------------------------------------------------------------------------------
162
+ return false;
163
+ //-------------------------------------------------------------------------------------------------------
164
+ }
165
+
166
+ /**
167
+ * Check for available updates
168
+ * @return stdClass|boolean
169
+ */
170
+ public function CheckForUpdates() {
171
+ //-------------------------------------------------------------------------------------------------------
172
+ if ($this->curl_version != $this->plugin_available_version) {
173
+ //-------------------------------------------------------------------------------------------------------
174
+ $ret = new stdClass();
175
+ $ret->version = $this->curl_version;
176
+ $ret->new_version = $this->plugin_available_version;
177
+ //-------------------------------------------------------------------------------------------------------
178
+ return $ret;
179
+ //-------------------------------------------------------------------------------------------------------
180
+ }
181
+ //-------------------------------------------------------------------------------------------------------
182
+ return false;
183
+ //-------------------------------------------------------------------------------------------------------
184
+ }
185
+
186
+ /**
187
+ * License days counter
188
+ * @return integer|string
189
+ */
190
+ public function GetSupportDays() {
191
+ //-------------------------------------------------------------------------------------------------------
192
+ if (!is_null($this->plugin_support)) {
193
+ //-------------------------------------------------------------------------------------------------------
194
+ $ret = new stdClass();
195
+ $ret->days = $this->count_days($this->plugin_support, date('Y-m-d'));
196
+ $ret->date = $this->plugin_support;
197
+ //-------------------------------------------------------------------------------------------------------
198
+ }
199
+ //-------------------------------------------------------------------------------------------------------
200
+ return 'n/a';
201
+ //-------------------------------------------------------------------------------------------------------
202
+ }
203
+
204
+ /**
205
+ * Register an account
206
+ * @param string $email Email to register
207
+ * @return stdClass
208
+ */
209
+ public function CreateAccount($email) {
210
+ //---------------------------------------------------------------------------------------------------
211
+ $reg_token = $this->CallSUN('regtoken', '', true, true, true);
212
+ //---------------------------------------------------------------------------------------------------
213
+ if (is_null($reg_token->token)) {
214
+ //---------------------------------------------------------------------------------------------------
215
+ throw new Exception('Orbitvu: cannot get a token');
216
+ //---------------------------------------------------------------------------------------------------
217
+ }
218
+ //---------------------------------------------------------------------------------------------------
219
+ $reg = $this->CallSUN('reguser', array(
220
+ 'token' => $reg_token->token,
221
+ 'email' => $email
222
+ ), true, true, true);
223
+ //---------------------------------------------------------------------------------------------------
224
+ if ($reg->email[0]) {
225
+ //---------------------------------------------------------------------------------------------------
226
+ throw new Exception($reg->email[0]);
227
+ //---------------------------------------------------------------------------------------------------
228
+ }
229
+ //---------------------------------------------------------------------------------------------------
230
+ $reg->email = $email;
231
+
232
+ //----------------------------------------------------------
233
+ /**/ $this->return_debug(array(
234
+ /**/ 'function' => __FUNCTION__,
235
+ /**/ 'response' => $reg
236
+ /**/ ));
237
+ //----------------------------------------------------------
238
+
239
+ //---------------------------------------------------------------------------------------------------
240
+ return $reg;
241
+ }
242
+
243
+ /**
244
+ * Want to change access_token for current session? No problem
245
+ * @param string $access_token New access token
246
+ */
247
+ public function SetAccessToken($access_token) {
248
+ //---------------------------------------------------------------------------------------------------
249
+ $this->access_token = $access_token;
250
+ //---------------------------------------------------------------------------------------------------
251
+ }
252
+
253
+ /**
254
+ * Unit tests results
255
+ * @return array
256
+ */
257
+ public function GetTestsResults() {
258
+ //---------------------------------------------------------------------------------------------------
259
+ return $this->testclass->GetResults();
260
+ //---------------------------------------------------------------------------------------------------
261
+ }
262
+
263
+ /**
264
+ * Orbitvu SUN API calling function
265
+ * @param string $call API path to call
266
+ * @param array|string $parameters Additional parameters to call
267
+ * @param boolean $method_post Use POST method
268
+ * @param boolean $get_headers Get HTTP headers
269
+ * @param boolean $not_change Disable automatic call formatting
270
+ * @return json|strong
271
+ */
272
+ public function CallAPI($call, $parameters = '', $method_post = false, $get_headers = false, $not_change = false) {
273
+ //---------------------------------------------------------------------------------------------------
274
+ /*
275
+ * Add URL parameters from array to URL
276
+ */
277
+ // presentation url auto status
278
+ if (stristr($call, 'presentations') && !stristr($call, 'status=')) {
279
+ if (!is_array($parameters)) {
280
+ $parameters = array('status' => '1');
281
+ }
282
+ else if (!isset($parameters['status'])) {
283
+ $parameters['status'] = '1';
284
+ }
285
+ }
286
+
287
+ /*
288
+ * POST
289
+ */
290
+ if ($method_post && !$not_change) {
291
+ $parameters['_method'] = 'PATCH';
292
+ }
293
+
294
+ /*
295
+ * Add URL parameters from array to URL
296
+ */
297
+ if (is_array($parameters)) {
298
+ $parameters_array = $parameters;
299
+ //---------------------------------------------------------------------------------------------------
300
+ $keys = array_keys($parameters);
301
+ $vals = array_values($parameters);
302
+
303
+ $parameters = '';
304
+ //---------------------------------------------------------------------------------------------------
305
+ for ($i = 0, $n = count($keys); $i < $n; $i++) {
306
+ if ($i == 0) $parameters .= '?';
307
+ else $parameters .= '&';
308
+
309
+ $parameters .= $keys[$i].'='.$vals[$i];
310
+ }
311
+ //---------------------------------------------------------------------------------------------------
312
+ }
313
+
314
+ //----------------------------------------------------------
315
+ if ($this->test) {
316
+ $this->testclass->AppendTest('api_call['.$call.']', array('type' => 'function_replace'), array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__));
317
+ return $this->testclass->CallAPI($call, $parameters);
318
+ }
319
+ //----------------------------------------------------------
320
+
321
+ /*
322
+ * Make both ways calling option
323
+ * but return json as possible
324
+ */
325
+ if (stristr($call, '//')) {
326
+ $url = $this->clean_url($call);
327
+ }
328
+ else {
329
+ $url = 'https://orbitvu.co/api/ecommerce/'.trim(str_replace(array('.html', '.json'), '', $call), '/').($method_post && !$not_change ? '' : '/').'.json';
330
+ }
331
+
332
+ $url .= $parameters;
333
+
334
+ /*
335
+ * Set the access token
336
+ */
337
+ $header[] = "Authorization: Token ".$this->access_token;
338
+ $header[] = "Accept-User-Agent: 1.0.1";
339
+ $header[] = "Accept-User-Agent-Version: ".$this->curl_version;
340
+
341
+ //----------------------------------------------------------
342
+ /**/ $this->return_debug(array(
343
+ /**/ 'function' => __FUNCTION__,
344
+ /**/ 'url' => $url,
345
+ /**/ 'headers' => $header,
346
+ /**/ 'parameters' => $parameters_array,
347
+ /**/ 'post' => ($method_post ? 'true' : 'false')
348
+ /**/ ));
349
+ //----------------------------------------------------------
350
+
351
+ /*
352
+ * Call SUN with CURL
353
+ * Method: GET
354
+ * + headers
355
+ */
356
+ $c = curl_init();
357
+ curl_setopt($c, CURLOPT_URL, $url);
358
+ curl_setopt($c, CURLOPT_HTTPHEADER, $header);
359
+ curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
360
+ if ($method_post) {
361
+ curl_setopt($c, CURLOPT_POST, count($parameters_array));
362
+ curl_setopt($c, CURLOPT_POSTFIELDS, $parameters_array);
363
+ }
364
+ if ($get_headers) {
365
+ curl_setopt($c, CURLOPT_VERBOSE, 1);
366
+ curl_setopt($c, CURLOPT_HEADER, 1);
367
+ }
368
+ $page = curl_exec($c);
369
+
370
+
371
+ if ($get_headers) {
372
+ //---------------------------------------------------------------------------------------------------
373
+ $header_size = curl_getinfo($c, CURLINFO_HEADER_SIZE);
374
+ $header = substr($page, 0, $header_size);
375
+ $body = substr($page, $header_size);
376
+ //---------------------------------------------------------------------------------------------------
377
+ if (!stristr($header, '200 OK')) {
378
+ $body = json_decode($body);
379
+ $error = explode("\n", $header);
380
+ $error = explode(' ', $error[0]);
381
+ $error = $error[1];
382
+ $body->error = $error;
383
+ $body->header = $header;
384
+ $body = json_encode($body);
385
+ }
386
+ //---------------------------------------------------------------------------------------------------
387
+ $page = $body;
388
+ //---------------------------------------------------------------------------------------------------
389
+ }
390
+
391
+ /*
392
+ * Return SUN original response
393
+ */
394
+ //---------------------------------------------------------------------------------------------------
395
+ curl_close($c);
396
+
397
+ return $page;
398
+ //---------------------------------------------------------------------------------------------------
399
+ }
400
+
401
+ /**
402
+ * Orbitvu SUN API calling alias to CallAPI function.
403
+ * Returns decoded json.
404
+ * @param string $call API path to call
405
+ * @param array|string $parameters Additional parameters to call
406
+ * @param boolean $method_post Use POST method
407
+ * @param boolean $get_headers Get HTTP headers
408
+ * @param boolean $not_change Disable automatic call formatting
409
+ * @return stdClass
410
+ */
411
+ public function CallSUN($call, $parameters = '', $method_post = false, $get_headers = false, $not_change = false) {
412
+ //---------------------------------------------------------------------------------------------------
413
+ $page = json_decode($this->CallAPI($call, $parameters, $method_post, $get_headers, $not_change));
414
+
415
+ //----------------------------------------------------------
416
+ /**/ $this->return_debug(array(
417
+ /**/ 'function' => __FUNCTION__,
418
+ /**/ 'response' => $page
419
+ /**/ ));
420
+ //----------------------------------------------------------
421
+
422
+ //---------------------------------------------------------------------------------------------------
423
+ return $page;
424
+ //---------------------------------------------------------------------------------------------------
425
+ }
426
+
427
+ /**
428
+ * Cleans API URL with http / https dependences
429
+ * @param string $url Url to clean
430
+ * @return string
431
+ */
432
+ private function clean_url($url) {
433
+ //----------------------------------------------------------
434
+ if ($this->test) {
435
+ $this->testclass->AppendTest('clean_url['.$url.']', array('type' => 'function_check'), array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__));
436
+ }
437
+ //---------------------------------------------------------------------------------------------------
438
+ if (stristr($url, 'https://')) {
439
+ return $url;
440
+ }
441
+ else if (stristr($url, 'http://')) {
442
+ return str_ireplace('http://', 'https://', $url);
443
+ }
444
+ else if (stristr($url, '//') && stristr($url, '.')) {
445
+ return str_ireplace('//', 'https://', $url);
446
+ }
447
+ //---------------------------------------------------------------------------------------------------
448
+ return $url;
449
+ //---------------------------------------------------------------------------------------------------
450
+ }
451
+
452
+ /**
453
+ * Count days between two dates
454
+ * @param date $date1 Date
455
+ * @param date $date2 Date
456
+ * @return integer
457
+ */
458
+ private function count_days($date1, $date2) {
459
+ //-------------------------------------------------------------------------------------------------------
460
+ $y1 = date('Y', strtotime($date1));
461
+ $m1 = date('m', strtotime($date1));
462
+ $d1 = date('d', strtotime($date1));
463
+
464
+ $y2 = date('Y', strtotime($date2));
465
+ $m2 = date('m', strtotime($date2));
466
+ $d2 = date('d', strtotime($date2));
467
+
468
+ $date1_set = mktime(0, 0, 0, $m1, $d1, $y1);
469
+ $date2_set = mktime(0, 0, 0, $m2, $d2, $y2);
470
+ //-------------------------------------------------------------------------------------------------------
471
+ return (round(($date2_set - $date1_set) / (60 * 60 * 24)));
472
+ //-------------------------------------------------------------------------------------------------------
473
+ }
474
+
475
+ /**
476
+ * Run unit tests
477
+ */
478
+ private function run_tests() {
479
+ //-----------------------------------------------------------------------------------------------------
480
+ /*
481
+ * Basic functions
482
+ */
483
+ //-----------------------------------------------------------------------------------------------------
484
+ $tests_urls = array(
485
+ 'http://orbitvu.com' => 'https://orbitvu.com',
486
+ 'https://orbitvu.com' => 'https://orbitvu.com',
487
+ '//orbitvu.com' => 'https://orbitvu.com',
488
+ 'orbitvu.com' => 'orbitvu.com',
489
+ 'orbitvu//com' => 'orbitvu//com'
490
+ );
491
+ $keys = array_keys($tests_urls);
492
+ $vals = array_values($tests_urls);
493
+ //-----------------------------------------------------------------------------------------------------
494
+ for ($i = 0, $n = count($tests_urls); $i < $n; $i++) {
495
+
496
+ $clean = $this->clean_url($keys[$i]);
497
+
498
+ $tst = array(
499
+ /**/ 'function' => 'clean_url('.$keys[$i].')',
500
+ /**/ 'given' => $clean,
501
+ /**/ 'expected' => $vals[$i]
502
+ );
503
+
504
+ if ($clean == $vals[$i]) {
505
+ $result = 'ok';
506
+ }
507
+ else {
508
+ $result = 'fail';
509
+ }
510
+
511
+ $this->testclass->UpdateTest('clean_url['.$keys[$i].']', array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__), $result, $tst);
512
+ }
513
+
514
+ //-----------------------------------------------------------------------------------------------------
515
+ /*
516
+ * Presentations display
517
+ */
518
+ //-----------------------------------------------------------------------------------------------------
519
+ $call = 'presentations';
520
+
521
+ $response = $this->CallSUN($call);
522
+
523
+ $status = 'ok';
524
+ $status = 'fail';
525
+ //---------------------------------------------------------------------------------------------------
526
+ $this->UpdateTest('api_call['.$call.']', array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__), 'ok');
527
+ //---------------------------------------------------------------------------------------------------
528
+ }
529
+
530
+ /**
531
+ * Debugger. Returns debug output if debug mode is enabled
532
+ * @param array $params
533
+ * @return string
534
+ */
535
+ private function return_debug($params) {
536
+ //---------------------------------------------------------------------------------------------------
537
+ if ($this->debug) {
538
+ return OrbitvuDebugger::Debug($params);
539
+ }
540
+ //---------------------------------------------------------------------------------------------------
541
+ }
542
+
543
+ }
544
+ ?>
app/code/community/Orbitvu/Sun/controllers/OrbitvuDatabaseDriver.php ADDED
@@ -0,0 +1,362 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Orbitvu PHP eCommerce Orbitvu DB drivers
4
+ * @Copyright: Orbitvu Sp. z o.o. is the owner of full rights to this code
5
+ *
6
+ * @for: Magento
7
+ *
8
+ * This is the only class to modify for your store
9
+ */
10
+
11
+ class OrbitvuDatabaseDriver {
12
+
13
+ /**
14
+ * Database instance
15
+ * @var instance
16
+ */
17
+ private $db_handle;
18
+
19
+ /**
20
+ * Database last insert ID
21
+ * @var integer
22
+ */
23
+ private $db_last_id = 0;
24
+
25
+ /**
26
+ * Connect to database
27
+ */
28
+ public function __construct() {
29
+ //---------------------------------------------------------------------------------------------------
30
+ $this->db_handle = Mage::getSingleton('core/resource')->getConnection('core_write');
31
+ //---------------------------------------------------------------------------------------------------
32
+ }
33
+
34
+ /**
35
+ * Get database prefix
36
+ * @return string
37
+ */
38
+ public function GetPrefix() {
39
+ //---------------------------------------------------------------------------------------------------
40
+ return Mage::getConfig()->getTablePrefix(); // Store tables prefix
41
+ //---------------------------------------------------------------------------------------------------
42
+ }
43
+
44
+ /**
45
+ * Make a SQL query
46
+ * @param string $db_query SQL query
47
+ * @return boolean|Exception
48
+ */
49
+ public function Query($db_query) {
50
+ //---------------------------------------------------------------------------------------------------
51
+ return $this->db_handle->query($db_query); // Store query function
52
+ //---------------------------------------------------------------------------------------------------
53
+ }
54
+
55
+ /**
56
+ * Make a SQL query and return fetched items array
57
+ * @param string $db_query SQL query
58
+ * @return array|Exception
59
+ */
60
+ public function FetchAll($db_query) {
61
+ //---------------------------------------------------------------------------------------------------
62
+ return $this->db_handle->fetchAll($db_query); // Store query & fetch_array function + list results as array
63
+ //---------------------------------------------------------------------------------------------------
64
+ }
65
+
66
+ /**
67
+ * Escape SQL query string
68
+ * @param string $query_string SQL query
69
+ * @return type
70
+ */
71
+ public function Escape($query_string) {
72
+ //---------------------------------------------------------------------------------------------------
73
+ return mysql_escape_string(str_replace("'", "\'", $query_string));
74
+ //---------------------------------------------------------------------------------------------------
75
+ }
76
+
77
+ /**
78
+ * Return store last insert ID
79
+ * @return integer
80
+ */
81
+ private function last_insert_id() {
82
+ //---------------------------------------------------------------------------------------------------
83
+ return $this->db_handle->lastInsertId(); // Store SQL last_insert_id
84
+ //---------------------------------------------------------------------------------------------------
85
+ }
86
+
87
+ /**
88
+ * SQL last insert ID
89
+ * @return integer
90
+ */
91
+ public function GetLastInsertId() {
92
+ //---------------------------------------------------------------------------------------------------
93
+ $last_id = intval($this->last_insert_id()); // Store SQL last_insert_id
94
+ //---------------------------------------------------------------------------------------------------
95
+ if ($last_id > 0 && $last_id != $this->db_last_id) {
96
+ $this->db_last_id = $last_id;
97
+ }
98
+ //---------------------------------------------------------------------------------------------------
99
+ return $this->db_last_id;
100
+ //---------------------------------------------------------------------------------------------------
101
+ }
102
+
103
+ /**
104
+ * Get store configuration
105
+ * @return array
106
+ */
107
+ public function GetConfiguration() {
108
+ //---------------------------------------------------------------------------------------------------
109
+ $config = array(
110
+ 'access_token' => Mage::getStoreConfig('orbitvu/api/access_token'),
111
+ 'auto_sync' => $this->make_boolean(Mage::getStoreConfig('orbitvu/synchro/auto_sync')),
112
+ 'sync_2d' => $this->make_boolean(Mage::getStoreConfig('orbitvu/items/sync_2d')),
113
+ 'sync_360' => $this->make_boolean(Mage::getStoreConfig('orbitvu/items/sync_360')),
114
+ 'language' => $this->make_boolean(Mage::getStoreConfig('orbitvu/advanced/language')),
115
+ 'auto_sync_sku' => Mage::getStoreConfig('orbitvu/synchro/auto_sync_sku'),
116
+ 'width' => Mage::getStoreConfig('orbitvu/layout/width'),
117
+ 'height' => Mage::getStoreConfig('orbitvu/layout/height'),
118
+ 'border_color' => Mage::getStoreConfig('orbitvu/layout/border_color'),
119
+ 'img_width' => Mage::getStoreConfig('orbitvu/layout/img_width'),
120
+ 'img_height' => Mage::getStoreConfig('orbitvu/layout/img_height'),
121
+ 'img_width_zoom' => Mage::getStoreConfig('orbitvu/layout/img_width_zoom'),
122
+ 'img_height_zoom' => Mage::getStoreConfig('orbitvu/layout/img_height_zoom'),
123
+ 'img_width_tn' => Mage::getStoreConfig('orbitvu/layout/img_width_tn'),
124
+ 'img_height_tn' => Mage::getStoreConfig('orbitvu/layout/img_height_tn'),
125
+ 'img_tn_margin' => Mage::getStoreConfig('orbitvu/layout/img_tn_margin'),
126
+ 'button_width' => Mage::getStoreConfig('orbitvu/layout/button_width'),
127
+ 'button_height' => Mage::getStoreConfig('orbitvu/layout/button_height'),
128
+ 'button_opacity' => Mage::getStoreConfig('orbitvu/layout/button_opacity'),
129
+ 'hover_mode' => $this->make_boolean(Mage::getStoreConfig('orbitvu/mode/hover_mode')),
130
+ 'hover_delay' => $this->make_boolean(Mage::getStoreConfig('orbitvu/mode/hover_delay')),
131
+ 'teaser' => $this->make_boolean(Mage::getStoreConfig('orbitvu/mode/teaser')),
132
+ 'html5' => $this->make_boolean(Mage::getStoreConfig('orbitvu/mode/html5')),
133
+ 'orbittour_thumbnails' => Mage::getStoreConfig('orbitvu/mode/orbittour_thumbnails')
134
+ );
135
+ //---------------------------------------------------------------------------------------------------
136
+ return $config;
137
+ //---------------------------------------------------------------------------------------------------
138
+ }
139
+
140
+ /**
141
+ * Set store configuration.
142
+ * Do not append local plugin configuration directly
143
+ * @param string $var Var from configuration
144
+ * @param string $value New vakue
145
+ * @return boolean
146
+ */
147
+ public function SetConfiguration($var, $value) {
148
+ //---------------------------------------------------------------------------------------------------
149
+ $config = new Mage_Core_Model_Config();
150
+ $config->saveConfig('orbitvu/api/'.$var, $value, 'default', 0);
151
+ //---------------------------------------------------------------------------------------------------
152
+ return true;
153
+ //---------------------------------------------------------------------------------------------------
154
+ }
155
+
156
+ /**
157
+ * Get store plugin version
158
+ * @return string
159
+ */
160
+ public function GetVersion() {
161
+ //---------------------------------------------------------------------------------------------------
162
+ return (string) Mage::getConfig()->getNode()->modules->Orbitvu_Sun->version;
163
+ //---------------------------------------------------------------------------------------------------
164
+ }
165
+
166
+ /**
167
+ * Get all products with ORM and prepare to synchronize
168
+ * @return array
169
+ */
170
+ public function SynchronizeAllProducts() {
171
+ //-------------------------------------------------------------------------------------------------------
172
+ $storeId = Mage::app()->getStore()->getId();
173
+ $product = Mage::getModel('catalog/product');
174
+ //-------------------------------------------------------------------------------------------------------
175
+ $products = $product->getCollection()
176
+ ->addAttributeToSelect(array(
177
+ 'name',
178
+ 'sku'
179
+ ))
180
+ ->addAttributeToFilter('status', '1');
181
+ //-------------------------------------------------------------------------------------------------------
182
+ $products_array = array();
183
+ foreach ($products as $q) {
184
+ $products_array[] = array(
185
+ 'product_id' => $q->getId(),
186
+ 'product_name' => $q->getName(),
187
+ 'product_sku' => $q->getSku()
188
+ );
189
+ }
190
+ //-------------------------------------------------------------------------------------------------------
191
+ return $products_array;
192
+ //-------------------------------------------------------------------------------------------------------
193
+ }
194
+
195
+ /**
196
+ * Install database tables
197
+ * @return boolean
198
+ */
199
+ public function Install() {
200
+ //-------------------------------------------------------------------------------------------------------
201
+ $prefix = $this->GetPrefix();
202
+ //---------------------------------------------------------------------------------------------------
203
+ $dump = "
204
+
205
+ INSERT IGNORE INTO `".$prefix."core_config_data`
206
+ (`scope`, `scope_id`, `path`, `value`)
207
+ VALUES
208
+ ('default', 0, 'orbitvu/api/access_token', '1567f2b4a02a8bfc5d8aacf0f44b16157e149d29'),
209
+ ('default', 0, 'orbitvu/mode/orbittour_thumbnails', 'right_views'),
210
+ ('default', 0, 'orbitvu/mode/html5', 'yes'),
211
+ ('default', 0, 'orbitvu/mode/hover_delay', '2'),
212
+ ('default', 0, 'orbitvu/mode/teaser', 'autorotate'),
213
+ ('default', 0, 'orbitvu/mode/hover_mode', '1'),
214
+ ('default', 0, 'orbitvu/layout/button_opacity', '1'),
215
+ ('default', 0, 'orbitvu/layout/button_height', '53px'),
216
+ ('default', 0, 'orbitvu/layout/button_width', '30px'),
217
+ ('default', 0, 'orbitvu/layout/img_tn_margin', '3px'),
218
+ ('default', 0, 'orbitvu/layout/img_height_tn', '50px'),
219
+ ('default', 0, 'orbitvu/layout/img_width_tn', '75px'),
220
+ ('default', 0, 'orbitvu/layout/img_height_zoom', '768px'),
221
+ ('default', 0, 'orbitvu/layout/img_width_zoom', '1024px'),
222
+ ('default', 0, 'orbitvu/layout/img_height', '300px'),
223
+ ('default', 0, 'orbitvu/layout/img_width', '583px'),
224
+ ('default', 0, 'orbitvu/layout/border_color', '#ccc'),
225
+ ('default', 0, 'orbitvu/layout/height', '361px'),
226
+ ('default', 0, 'orbitvu/layout/width', '100%'),
227
+ ('default', 0, 'orbitvu/advanced/language', 'en'),
228
+ ('default', 0, 'orbitvu/synchro/auto_sync_sku', 'false'),
229
+ ('default', 0, 'orbitvu/items/sync_orbittour', '1'),
230
+ ('default', 0, 'orbitvu/items/sync_360', '1'),
231
+ ('default', 0, 'orbitvu/items/sync_2d', '1'),
232
+ ('default', 0, 'orbitvu/synchro/sync_order', '0'),
233
+ ('default', 0, 'orbitvu/synchro/auto_sync', '0');
234
+
235
+ CREATE TABLE IF NOT EXISTS `".$prefix."orbitvu_configuration` (
236
+ `id` int(3) NOT NULL auto_increment,
237
+ `priority` int(2) NOT NULL,
238
+ `var` varchar(20) NOT NULL,
239
+ `value` text NOT NULL,
240
+ `type` varchar(20) NOT NULL,
241
+ `info` varchar(200) NOT NULL,
242
+ PRIMARY KEY (`id`),
243
+ UNIQUE KEY `var` (`var`)
244
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
245
+
246
+ INSERT IGNORE INTO `".$prefix."orbitvu_configuration`
247
+ (`var`, `value`, `type`, `info`)
248
+ VALUES
249
+ ('access_token', '1567f2b4a02a8bfc5d8aacf0f44b16157e149d29', 'api', 'Your Orbitvu SUN Access Token'),
250
+ ('viewers_path', 'viewers/src/', 'main', 'Your viewers upload folder (chmod 777)'),
251
+ ('temp_path', 'tmp/', 'main', 'Your server''s temporary path (chmod 777)'),
252
+ ('using_sun', 'true', 'main', 'Are you using Orbitvu SUN Cloud?'),
253
+ ('last_updated', '2014-07-16 10:29:46', 'main', 'Last Orbitvu SUN Cloud synchronization date'),
254
+ ('last_refreshed', '2014-07-16 10:29:46', 'main', 'Last Orbitvu SUN Cloud refresh date'),
255
+ ('auto_sync', 'false', 'synchro', 'Synchronize presentations automatically?'),
256
+ ('sync_2d', 'true', 'items', 'If 2D photos exists - synchronize them?'),
257
+ ('sync_360', 'true', 'items', 'If 360 exists - synchronize it?'),
258
+ ('sync_orbittour', 'true', 'items', 'If orbittour exists - synchronize it?'),
259
+ ('auto_sync_sku', 'false', 'synchro', 'Automatically sync SKU'),
260
+ ('hover_mode', 'true', 'mode', ''),
261
+ ('width', '100%', 'layout', ''),
262
+ ('height', '361px', 'layout', ''),
263
+ ('border_color', '#ccc', 'layout', ''),
264
+ ('img_width', '583px', 'layout', ''),
265
+ ('img_height', '300px', 'layout', ''),
266
+ ('img_width_zoom', '1024px', 'layout', ''),
267
+ ('img_height_zoom', '768px', 'layout', ''),
268
+ ('img_width_tn', '75px', 'layout', ''),
269
+ ('img_height_tn', '50px', 'layout', ''),
270
+ ('img_tn_margin', '3px', 'layout', ''),
271
+ ('button_width', '30px', 'layout', ''),
272
+ ('button_height', '53px', 'layout', ''),
273
+ ('button_opacity', '1', 'layout', ''),
274
+ ('teaser', 'autorotate', 'mode', ''),
275
+ ('hover_delay', '2', 'mode', ''),
276
+ ('html5', 'yes', 'mode', ''),
277
+ ('orbittour_thumbnails', 'right_views', 'mode', ''),
278
+ ('first_time', 'true', 'main', '');
279
+
280
+ CREATE TABLE IF NOT EXISTS `".$prefix."orbitvu_log` (
281
+ `id` int(11) NOT NULL auto_increment,
282
+ `_item_id` int(11) NOT NULL,
283
+ `_item_table` enum('_presentations','_presentations_items','_viewers') NOT NULL,
284
+ `action` enum('add','delete','info','skip','update') NOT NULL DEFAULT 'info',
285
+ `comment` varchar(150) NOT NULL,
286
+ `date` datetime NOT NULL,
287
+ `ip` varchar(20) NOT NULL,
288
+ PRIMARY KEY (`id`),
289
+ KEY `_item_id` (`_item_id`)
290
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
291
+
292
+ CREATE TABLE IF NOT EXISTS `".$prefix."orbitvu_products_presentations` (
293
+ `id` int(11) NOT NULL auto_increment,
294
+ `product_id` int(11) NOT NULL,
295
+ `orbitvu_id` int(11) NOT NULL,
296
+ `name` varchar(150) NOT NULL,
297
+ `config` text NOT NULL,
298
+ `viewer` int(2) NOT NULL,
299
+ `type` enum('sun','local') NOT NULL,
300
+ PRIMARY KEY (`id`),
301
+ UNIQUE KEY `product_id` (`product_id`),
302
+ KEY `orbitvu_id` (`orbitvu_id`)
303
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
304
+
305
+ CREATE TABLE IF NOT EXISTS `".$prefix."orbitvu_products_presentations_history` (
306
+ `id` int(11) NOT NULL auto_increment,
307
+ `product_id` int(11) NOT NULL,
308
+ `orbitvu_id` int(11) NOT NULL,
309
+ `unlink_date` datetime NOT NULL,
310
+ PRIMARY KEY (`id`),
311
+ KEY `product_id` (`product_id`,`orbitvu_id`),
312
+ KEY `orbitvu_id` (`orbitvu_id`)
313
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
314
+
315
+ CREATE TABLE IF NOT EXISTS `".$prefix."orbitvu_products_presentations_items` (
316
+ `id` int(11) NOT NULL auto_increment,
317
+ `_presentations_id` int(11) NOT NULL,
318
+ `orbitvu_id` int(11) NOT NULL,
319
+ `priority` int(3) NOT NULL,
320
+ `name` varchar(150) NOT NULL,
321
+ `type` tinyint(1) NOT NULL,
322
+ `thumbnail` varchar(200) NOT NULL,
323
+ `path` varchar(200) NOT NULL,
324
+ `config` text NOT NULL,
325
+ `status` enum('active','inactive') NOT NULL DEFAULT 'active',
326
+ PRIMARY KEY (`id`),
327
+ KEY `presentation_id` (`_presentations_id`,`orbitvu_id`)
328
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
329
+
330
+ CREATE TABLE IF NOT EXISTS `".$prefix."orbitvu_products_thumbnails` (
331
+ `product_id` int(11) NOT NULL,
332
+ `thumbnail` varchar(200) NOT NULL,
333
+ PRIMARY KEY (`product_id`)
334
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
335
+ ";
336
+
337
+ $dump = explode(';', $dump);
338
+
339
+ foreach ($dump as $query) {
340
+ try {
341
+ $this->Query($query);
342
+ }
343
+ catch (Exception $e) {}
344
+ }
345
+ //---------------------------------------------------------------------------------------------------
346
+ return true;
347
+ //---------------------------------------------------------------------------------------------------
348
+ }
349
+
350
+ /**
351
+ * Make boolean from integers
352
+ * @param integer $value
353
+ * @return boolean|string
354
+ */
355
+ private function make_boolean($value) {
356
+ //---------------------------------------------------------------------------------------------------
357
+ return str_replace(array('1', '0'), array('true', 'false'), $value);
358
+ //---------------------------------------------------------------------------------------------------
359
+ }
360
+
361
+ }
362
+ ?>
app/code/community/Orbitvu/Sun/controllers/OrbitvuDatabaseInterface.php ADDED
@@ -0,0 +1,1421 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Orbitvu PHP eCommerce Orbitvu DB drivers
4
+ * @Copyright: Orbitvu Sp. z o.o. is the owner of full rights to this code
5
+ */
6
+
7
+ class OrbitvuDatabaseInterface {
8
+
9
+ /**
10
+ * Database driver instance
11
+ * @var instance
12
+ */
13
+ private $database;
14
+
15
+ /**
16
+ * Database tables prefix
17
+ * @var string
18
+ */
19
+ private $db_prefix = '';
20
+
21
+ /**
22
+ * Debug mode
23
+ * @var boolean
24
+ */
25
+ private $debug = false;
26
+
27
+ /**
28
+ * Unit tests mode
29
+ * @var boolean
30
+ */
31
+ private $test = false;
32
+
33
+ /**
34
+ * Test class instance
35
+ * @var instance
36
+ */
37
+ private $testclass = false;
38
+
39
+ /**
40
+ * Configuration vars and values
41
+ * @var stdClass|boolean
42
+ */
43
+ public $Config = false;
44
+
45
+ /**
46
+ * SUN API connection instance
47
+ * @var instance
48
+ */
49
+ public $Connect;
50
+
51
+ /**
52
+ * Manage the database
53
+ * @param string $prefix Database prefix
54
+ * @param boolean $debug Debug mode
55
+ * @param boolean $test Unit tests mode
56
+ * @param boolean $testinstance Unit tests instance.
57
+ */
58
+ public function __construct($prefix = '', $debug = false, $test = false, $testinstance = false) {
59
+ //-------------------------------------------------------------------------------------------------------
60
+ require_once(__DIR__.'/OrbitvuDatabaseDriver.php');
61
+ //-------------------------------------------------------------------------------------------------------
62
+ $this->debug = $debug;
63
+ $this->test = $test;
64
+ //-------------------------------------------------------------------------------------------------------
65
+ $this->database = new OrbitvuDatabaseDriver();
66
+ //---------------------------------------------------------------------------------------------------
67
+ if (!empty($prefix)) $this->db_prefix = $prefix;
68
+ else $this->db_prefix = $this->database->GetPrefix();
69
+ //---------------------------------------------------------------------------------------------------
70
+ $this->Config = $this->GetConfiguration();
71
+ /*
72
+ * Test instance
73
+ */
74
+ if ($this->test) {
75
+ $this->testclass = $testinstance;
76
+
77
+ /*
78
+ * Run test bot!
79
+ */
80
+ $this->run_tests();
81
+ }
82
+ //-------------------------------------------------------------------------------------------------------
83
+ }
84
+
85
+ /**
86
+ * Set Orbitvu SUN connection instance
87
+ * @param instance $connect
88
+ */
89
+ public function SetSUNConnection($connect) {
90
+ //----------------------------------------------------------
91
+ $this->Connect = $connect;
92
+ //----------------------------------------------------------
93
+ }
94
+
95
+ /**
96
+ * Synchronize all products
97
+ * @return boolean
98
+ */
99
+ public function SynchronizeAllProducts() {
100
+ //----------------------------------------------------------
101
+ return $this->SynchronizePresentations($this->database->SynchronizeAllProducts(), $this->Connect);
102
+ //----------------------------------------------------------
103
+ }
104
+
105
+ /**
106
+ * Get all configuration vars and values.
107
+ * Update local values to store values
108
+ * @return stdClass
109
+ */
110
+ public function GetConfiguration() {
111
+ //----------------------------------------------------------
112
+ if ($this->Config != false) return $this->Config;
113
+ //----------------------------------------------------------
114
+ if ($this->test) {
115
+ $this->testclass->AppendTest('GetConfiguration', array('type' => 'function_check'), array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__));
116
+ }
117
+ //----------------------------------------------------------
118
+ $db_query = '
119
+ SELECT *
120
+ FROM `'.$this->db_prefix.'orbitvu_configuration`
121
+ ';
122
+
123
+ //---------------------------------------------------------------------
124
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
125
+ //---------------------------------------------------------------------
126
+
127
+ try {
128
+ $query = $this->database->FetchAll($db_query);
129
+ }
130
+ catch (Exception $e) {
131
+ $this->Install();
132
+
133
+ //----------------------------------------------------------
134
+ /**/ $this->return_debug(array(
135
+ /**/ 'function' => 'Install',
136
+ /**/ 'response' => 'Database installed!'
137
+ /**/ ));
138
+ //----------------------------------------------------------
139
+
140
+ $query = $this->database->FetchAll($db_query);
141
+ }
142
+
143
+ /*
144
+ * Synchronize config with current store configuration
145
+ */
146
+ $store_config = $this->database->GetConfiguration();
147
+
148
+ //-------------------------------------------------------------------------------------------------------
149
+ $conf = new stdClass();
150
+ $i = 0;
151
+ foreach ($query as $q) {
152
+ $conf->$q['var'] = $q['value'];
153
+
154
+ if (isset($store_config[$q['var']]) && $store_config[$q['var']] != $conf->$q['var']) {
155
+ $this->SetConfiguration($q['var'], $store_config[$q['var']]);
156
+ $conf->$q['var'] = $store_config[$q['var']];
157
+ }
158
+ $i++;
159
+ }
160
+
161
+ //----------------------------------------------------------
162
+ /**/ $this->return_debug(array(
163
+ /**/ 'function' => __FUNCTION__,
164
+ /**/ 'configuration' => $conf
165
+ /**/ ));
166
+ //----------------------------------------------------------
167
+
168
+ //-------------------------------------------------------------------------------------------------------
169
+ return $conf;
170
+ //-------------------------------------------------------------------------------------------------------
171
+ }
172
+
173
+ /**
174
+ * Set local configuration value
175
+ * or add new var and value
176
+ * @param string $var
177
+ * @param string $value
178
+ * @return boolean
179
+ */
180
+ public function SetConfiguration($var, $value) {
181
+ //-------------------------------------------------------------------------------------------------------
182
+ $db_query = '
183
+ INSERT INTO
184
+ `'.$this->db_prefix.'orbitvu_configuration`
185
+ (`var`, `value`, `type`)
186
+
187
+ VALUES (
188
+ \''.$var.'\',
189
+ \''.$this->database->Escape($value).'\',
190
+ \'main\'
191
+ )
192
+
193
+ ON DUPLICATE KEY
194
+
195
+ UPDATE
196
+ `value` = \''.($value).'\'
197
+ ';
198
+
199
+ //---------------------------------------------------------------------
200
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
201
+ //---------------------------------------------------------------------
202
+
203
+ $query = $this->database->Query($db_query);
204
+
205
+ //-------------------------------------------------------------------------------------------------------
206
+ $this->Log(0, '_configuration', 'update', $var.'='.$value, 'auto');
207
+ //-------------------------------------------------------------------------------------------------------
208
+ return true;
209
+ //-------------------------------------------------------------------------------------------------------
210
+ }
211
+
212
+ /**
213
+ * Set store configuration
214
+ * @param string $var
215
+ * @param string $value
216
+ * @return boolean
217
+ */
218
+ public function SetConfigurationParent($var, $value) {
219
+ //-------------------------------------------------------------------------------------------------------
220
+ return $this->database->SetConfiguration($var, $value);
221
+ //-------------------------------------------------------------------------------------------------------
222
+ }
223
+
224
+ /**
225
+ * Unlink (free) presentation from product
226
+ * @param integer $product_id Store product ID from database
227
+ * @return boolean
228
+ */
229
+ public function FreeProduct($product_id) {
230
+ //-------------------------------------------------------------------------------------------------------
231
+ $db_query = '
232
+ SELECT *
233
+ FROM `'.$this->db_prefix.'orbitvu_products_presentations`
234
+
235
+ WHERE
236
+ `product_id` = '.intval($product_id).'
237
+
238
+ LIMIT 1
239
+ ';
240
+
241
+ //---------------------------------------------------------------------
242
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
243
+ //---------------------------------------------------------------------
244
+
245
+ $query = $this->database->FetchAll($db_query);
246
+ //-------------------------------------------------------------------------------------------------------
247
+ $product = $query[0];
248
+ //-------------------------------------------------------------------------------------------------------
249
+
250
+ /*
251
+ * Free items
252
+ */
253
+ //-------------------------------------------------------------------------------------------------------
254
+ $db_query = '
255
+ DELETE
256
+ FROM `'.$this->db_prefix.'orbitvu_products_presentations_items`
257
+
258
+ WHERE
259
+ `_presentations_id` = '.intval($product['id']).'
260
+ ';
261
+
262
+ //---------------------------------------------------------------------
263
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
264
+ //---------------------------------------------------------------------
265
+
266
+ $query = $this->database->Query($db_query);
267
+
268
+ /*
269
+ * Add history
270
+ */
271
+ //-------------------------------------------------------------------------------------------------------
272
+ $db_query = '
273
+ INSERT INTO
274
+ `'.$this->db_prefix.'orbitvu_products_presentations_history`
275
+ (`product_id`, `orbitvu_id`, `unlink_date`)
276
+
277
+ VALUES (
278
+ '.intval($product['product_id']).',
279
+ '.intval($product['orbitvu_id']).',
280
+ NOW()
281
+ )
282
+ ';
283
+
284
+ //---------------------------------------------------------------------
285
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
286
+ //---------------------------------------------------------------------
287
+
288
+ $query = $this->database->Query($db_query);
289
+
290
+ /*
291
+ * Free product
292
+ */
293
+ //-------------------------------------------------------------------------------------------------------
294
+ $db_query = '
295
+ DELETE FROM
296
+ `'.$this->db_prefix.'orbitvu_products_presentations`
297
+
298
+ WHERE
299
+ `id` = '.intval($product['id']).'
300
+
301
+ LIMIT 1
302
+ ';
303
+
304
+ //---------------------------------------------------------------------
305
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
306
+ //---------------------------------------------------------------------
307
+
308
+ $query = $this->database->Query($db_query);
309
+
310
+ //-------------------------------------------------------------------------------------------------------
311
+ $this->Log($product['id'], '_presentations', 'delete');
312
+ //-------------------------------------------------------------------------------------------------------
313
+ return true;
314
+ //-------------------------------------------------------------------------------------------------------
315
+ }
316
+
317
+ /**
318
+ * Get our store thumbnails
319
+ * @param integer $product_id Store product ID from database
320
+ * @return array
321
+ */
322
+ public function GetProductThumbnails($product_id) {
323
+ //-------------------------------------------------------------------------------------------------------
324
+ $db_query = '
325
+ SELECT *
326
+ FROM `'.$this->db_prefix.'orbitvu_products_thumbnails`
327
+
328
+ WHERE
329
+ `product_id` = '.intval($product_id).'
330
+ ';
331
+
332
+ //---------------------------------------------------------------------
333
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
334
+ //---------------------------------------------------------------------
335
+
336
+ $query = $this->database->FetchAll($db_query);
337
+
338
+ //-------------------------------------------------------------------------------------------------------
339
+ return $query;
340
+ //-------------------------------------------------------------------------------------------------------
341
+ }
342
+
343
+ /**
344
+ * Set store thumbnail
345
+ * @param integer $product_id Store product ID from database
346
+ * @param string $thumbnail Thumbnail path
347
+ * @return array
348
+ */
349
+ public function SetProductThumbnail($product_id, $thumbnail) {
350
+ //-------------------------------------------------------------------------------------------------------
351
+ $db_query = '
352
+ INSERT INTO
353
+ `'.$this->db_prefix.'orbitvu_products_thumbnails`
354
+ (`product_id`, `thumbnail`)
355
+
356
+ VALUES (
357
+ '.intval($product_id).',
358
+ \''.$thumbnail.'\'
359
+ )
360
+ ';
361
+
362
+ //---------------------------------------------------------------------
363
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
364
+ //---------------------------------------------------------------------
365
+
366
+ try {
367
+ $query = $this->database->Query($db_query);
368
+ }
369
+ catch(Exception $e) {}
370
+
371
+ //-------------------------------------------------------------------------------------------------------
372
+ return $query;
373
+ //-------------------------------------------------------------------------------------------------------
374
+ }
375
+
376
+ /**
377
+ * Delete store thumbnail
378
+ * @param integer $product_id Store product ID from database
379
+ * @param string $thumbnail Thumbnail path
380
+ * @return array
381
+ */
382
+ public function DeleteProductThumbnail($product_id, $thumbnail = '') {
383
+ //-------------------------------------------------------------------------------------------------------
384
+ $db_query = '
385
+ DELETE FROM
386
+ `'.$this->db_prefix.'orbitvu_products_thumbnails`
387
+
388
+ WHERE
389
+ `product_id` = '.intval($product_id).'
390
+ '.(!empty($thumbnail) ? ' AND `thumbnail` = \''.$thumbnail.'\' ' : '').'
391
+
392
+ LIMIT 1
393
+ ';
394
+
395
+ //---------------------------------------------------------------------
396
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
397
+ //---------------------------------------------------------------------
398
+
399
+ $query = $this->database->Query($db_query);
400
+
401
+ //-------------------------------------------------------------------------------------------------------
402
+ return $query;
403
+ //-------------------------------------------------------------------------------------------------------
404
+ }
405
+
406
+ /**
407
+ * Is the product unlinked?
408
+ * @param integer $product_id Store product ID from database
409
+ * @return boolean
410
+ */
411
+ public function IsProductUnlinked($product_id) {
412
+ //-------------------------------------------------------------------------------------------------------
413
+ $db_query = '
414
+ SELECT *
415
+ FROM `'.$this->db_prefix.'orbitvu_products_presentations_history`
416
+
417
+ WHERE
418
+ `product_id` = '.intval($product_id).'
419
+
420
+ LIMIT 1
421
+ ';
422
+
423
+ //---------------------------------------------------------------------
424
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
425
+ //---------------------------------------------------------------------
426
+
427
+ $query = $this->database->FetchAll($db_query);
428
+ $query = $query[0];
429
+
430
+ //-------------------------------------------------------------------------------------------------------
431
+ if ($query['orbitvu_id'] > 0) {
432
+ return true;
433
+ }
434
+ else {
435
+ return false;
436
+ }
437
+ //-------------------------------------------------------------------------------------------------------
438
+ }
439
+
440
+ /**
441
+ * Is presentation unlinked?
442
+ * @param integer $product_id Store product ID from database
443
+ * @param integer $orbitvu_id Orbitvu SUN presentation ID
444
+ * @return boolean
445
+ */
446
+ public function IsPresentationUnlinked($product_id, $orbitvu_id) {
447
+ //-------------------------------------------------------------------------------------------------------
448
+ $db_query = '
449
+ SELECT *
450
+ FROM `'.$this->db_prefix.'orbitvu_products_presentations_history`
451
+
452
+ WHERE
453
+ `product_id` = '.intval($product_id).' AND
454
+ `orbitvu_id` = '.intval($orbitvu_id).'
455
+
456
+ LIMIT 1
457
+ ';
458
+
459
+ //---------------------------------------------------------------------
460
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
461
+ //---------------------------------------------------------------------
462
+
463
+ $query = $this->database->FetchAll($db_query);
464
+ $query = $query[0];
465
+
466
+ //-------------------------------------------------------------------------------------------------------
467
+ if ($query['orbitvu_id'] > 0) {
468
+ return true;
469
+ }
470
+ else {
471
+ return false;
472
+ }
473
+ //-------------------------------------------------------------------------------------------------------
474
+ }
475
+
476
+ /**
477
+ * Product presentation exists?
478
+ * @param integer $product_id Store product ID from database
479
+ * @return boolean
480
+ */
481
+ public function ExistsProductPresentation($product_id) {
482
+ //-------------------------------------------------------------------------------------------------------
483
+ $db_query = '
484
+ SELECT *
485
+ FROM `'.$this->db_prefix.'orbitvu_products_presentations`
486
+
487
+ WHERE
488
+ `product_id` = '.intval($product_id).'
489
+
490
+ LIMIT 1
491
+ ';
492
+
493
+ //---------------------------------------------------------------------
494
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
495
+ //---------------------------------------------------------------------
496
+
497
+ $query = $this->database->FetchAll($db_query);
498
+ $query = $query[0];
499
+ //-------------------------------------------------------------------------------------------------------
500
+ if (isset($query['type'])) {
501
+ return true;
502
+ }
503
+ //-------------------------------------------------------------------------------------------------------
504
+ return false;
505
+ //-------------------------------------------------------------------------------------------------------
506
+ }
507
+
508
+ /**
509
+ * Get product presentation data
510
+ * Get product presentation items
511
+ * @param integer $product_id Store product ID from database
512
+ * @param boolean $visible_only Return only items marked as visible
513
+ * @return array
514
+ */
515
+ public function GetProductPresentation($product_id, $visible_only = false) {
516
+ //-------------------------------------------------------------------------------------------------------
517
+ $db_query = '
518
+ SELECT *
519
+ FROM `'.$this->db_prefix.'orbitvu_products_presentations`
520
+
521
+ WHERE
522
+ `product_id` = '.intval($product_id).'
523
+
524
+ LIMIT 1
525
+ ';
526
+
527
+ //---------------------------------------------------------------------
528
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
529
+ //---------------------------------------------------------------------
530
+
531
+ $query = $this->database->FetchAll($db_query);
532
+ $query = $query[0];
533
+ //-------------------------------------------------------------------------------------------------------
534
+ $ret = array();
535
+ //-------------------------------------------------------------------------------------------------------
536
+ if (isset($query['type'])) {
537
+ //-------------------------------------------------------------------------------------------------------
538
+ $ret = $query;
539
+ $ret['items'] = array();
540
+
541
+ $ret['types'] = array();
542
+
543
+ //-------------------------------------------------------------------------------------------------------
544
+ $db_sub_query = '
545
+ SELECT *
546
+ FROM `'.$this->db_prefix.'orbitvu_products_presentations_items`
547
+
548
+ WHERE
549
+ `_presentations_id` = '.$ret['id'].'
550
+ '.($visible_only ? ' AND `status` = \'active\' ' : '').'
551
+
552
+ ORDER BY
553
+ `priority` DESC
554
+ ';
555
+
556
+ //---------------------------------------------------------------------
557
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_sub_query);
558
+ //---------------------------------------------------------------------
559
+
560
+ $items = $this->database->FetchAll($db_sub_query);
561
+ //-------------------------------------------------------------------------------------------------------
562
+ foreach ($items as $qi) {
563
+ $ret['items'][] = $qi;
564
+
565
+ if (!in_array($qi['type'], $ret['types'])) {
566
+ $ret['types'][] = $qi['type'];
567
+ }
568
+ }
569
+ //rsort($ret['items']);
570
+ rsort($ret['types']);
571
+ //-------------------------------------------------------------------------------------------------------
572
+ return $ret;
573
+ //-------------------------------------------------------------------------------------------------------
574
+ }
575
+ //-------------------------------------------------------------------------------------------------------
576
+ return false;
577
+ //-------------------------------------------------------------------------------------------------------
578
+ }
579
+
580
+ /**
581
+ * Set new product presentation
582
+ * @param type $product_id Store product ID from database
583
+ * @param type $orbitvu_id Orbitvu SUN presentation ID
584
+ * @param type $orbitvu_name Orbitvu SUN presentation name
585
+ * @return boolean
586
+ */
587
+ public function SetProductPresentation($product_id, $orbitvu_id, $presentation_name = '', $comment = 'manual') {
588
+ //-------------------------------------------------------------------------------------------------------
589
+ $db_query = '
590
+ SELECT `id`
591
+ FROM `'.$this->db_prefix.'orbitvu_products_presentations`
592
+
593
+ WHERE
594
+ `product_id` = '.intval($product_id).'
595
+
596
+ LIMIT 1
597
+ ';
598
+
599
+ //---------------------------------------------------------------------
600
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
601
+ //---------------------------------------------------------------------
602
+
603
+ $check = $this->database->FetchAll($db_query);
604
+ $check = $check[0];
605
+ //-------------------------------------------------------------------------------------------------------
606
+
607
+ $db_query = '
608
+ INSERT INTO
609
+ `'.$this->db_prefix.'orbitvu_products_presentations`
610
+ (`product_id`, `orbitvu_id`, `name`, `type`)
611
+
612
+ VALUES (
613
+ '.intval($product_id).',
614
+ '.intval($orbitvu_id).',
615
+ \''.$this->database->Escape($presentation_name).'\',
616
+ \'sun\'
617
+ )
618
+
619
+ ON DUPLICATE KEY
620
+
621
+ UPDATE
622
+ `name` = \''.$this->database->Escape($presentation_name).'\',
623
+ `type` = \'sun\'
624
+ ';
625
+
626
+ //---------------------------------------------------------------------
627
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
628
+ //---------------------------------------------------------------------
629
+
630
+ $query = $this->database->Query($db_query);
631
+ //-------------------------------------------------------------------------------------------------------
632
+ if (!isset($check['id'])) {
633
+ //-------------------------------------------------------------------------------------------------------
634
+ $this->Log($this->database->GetLastInsertId(), '_presentations', 'add', $comment);
635
+ //-------------------------------------------------------------------------------------------------------
636
+ return $this->database->GetLastInsertId();
637
+ //-------------------------------------------------------------------------------------------------------
638
+ }
639
+ else {
640
+ //-------------------------------------------------------------------------------------------------------
641
+ $this->Log($check['id'], '_presentations', 'skip', $comment);
642
+ //-------------------------------------------------------------------------------------------------------
643
+ return $check['id'];
644
+ //-------------------------------------------------------------------------------------------------------
645
+ }
646
+ }
647
+
648
+ /**
649
+ * Set product presentation items
650
+ * @param type $product_id Store product ID from database
651
+ * @param type $orbitvu_id Orbitvu SUN presentation ID
652
+ * @param type $orbitvu_name Orbitvu SUN presentation name
653
+ * @param type $presentation_items Orbitvu SUN presentation items
654
+ * @return type
655
+ */
656
+ public function SetProductPresentationItems($product_id, $orbitvu_id, $orbitvu_name, $presentation_items, $comment = 'manual') {
657
+ //-------------------------------------------------------------------------------------------------------
658
+ /**
659
+ * Updating presentation id
660
+ */
661
+ //-------------------------------------------------------------------------------------------------------
662
+ $presentation_id = $this->SetProductPresentation($product_id, $orbitvu_id, $orbitvu_name, 'auto');
663
+ //-------------------------------------------------------------------------------------------------------
664
+ /**
665
+ * Inserting new items
666
+ */
667
+ $priority = 10;
668
+ //-------------------------------------------------------------------------------------------------------
669
+ for ($i = 0, $n = count($presentation_items); $i < $n; $i++) {
670
+ //-------------------------------------------------------------------------------------------------------
671
+ $item = $presentation_items[$i];
672
+ //-------------------------------------------------------------------------------------------------------
673
+ $db_query = '
674
+ SELECT `id`
675
+ FROM `'.$this->db_prefix.'orbitvu_products_presentations_items`
676
+
677
+ WHERE
678
+ `orbitvu_id` = '.intval($item['orbitvu_id']).' AND
679
+ `_presentations_id` = '.intval($presentation_id).'
680
+
681
+ LIMIT 1
682
+ ';
683
+
684
+ //---------------------------------------------------------------------
685
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
686
+ //---------------------------------------------------------------------
687
+
688
+ $check = $this->database->FetchAll($db_query);
689
+ $check = $check[0];
690
+ //-------------------------------------------------------------------------------------------------------
691
+ if (!isset($check['id'])) {
692
+ //-------------------------------------------------------------------------------------------------------
693
+ $priority += 10;
694
+
695
+ $db_query = '
696
+ INSERT INTO
697
+ `'.$this->db_prefix.'orbitvu_products_presentations_items`
698
+ (`_presentations_id`, `orbitvu_id`, `priority`, `name`, `type`, `thumbnail`, `path`, `config`)
699
+
700
+ VALUES (
701
+ '.intval($presentation_id).',
702
+ '.intval($item['orbitvu_id']).',
703
+ '.($priority).',
704
+ \''.$this->database->Escape($item['name']).'\',
705
+ '.intval($item['type']).',
706
+ \''.($item['thumbnail']).'\',
707
+ \''.($item['path']).'\',
708
+ \''.$this->database->Escape($item['config']).'\'
709
+ )
710
+ ';
711
+
712
+ //---------------------------------------------------------------------
713
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
714
+ //---------------------------------------------------------------------
715
+
716
+ $this->database->Query($db_query);
717
+
718
+ //-------------------------------------------------------------------------------------------------------
719
+ $this->Log($this->database->GetLastInsertId(), '_presentations_items', 'add', $comment);
720
+ //-------------------------------------------------------------------------------------------------------
721
+ }
722
+ else {
723
+ //-------------------------------------------------------------------------------------------------------
724
+ $this->Log($check['id'], '_presentations_items', 'skip', 'auto');
725
+ //-------------------------------------------------------------------------------------------------------
726
+ }
727
+ //-------------------------------------------------------------------------------------------------------
728
+ }
729
+ //-------------------------------------------------------------------------------------------------------
730
+ return true;
731
+ //-------------------------------------------------------------------------------------------------------
732
+ }
733
+
734
+ /**
735
+ * Search the presentation with name and SKU
736
+ * @param array $product Product array with name and SKU
737
+ * @return array|boolean
738
+ */
739
+ public function MatchPresentation($product) {
740
+ //-------------------------------------------------------------------------------------------------------
741
+ $product_name = $product['product_name'];
742
+ $product_sku = $product['product_sku'];
743
+ //-------------------------------------------------------------------------------------------------------
744
+ $count = 0;
745
+ //-------------------------------------------------------------------------------------------------------
746
+ if (!empty($product_sku)) {
747
+ $presentations_choose = $this->GetPresentationsList(array(
748
+ 'page_size' => 1,
749
+ 'name' => $product_sku
750
+ ));
751
+
752
+ $count = $presentations_choose->count;
753
+
754
+ if ($count == 0) {
755
+ $presentations_choose = $this->GetPresentationsList(array(
756
+ 'page_size' => 1,
757
+ 'sku' => $product_sku
758
+ ));
759
+
760
+ $count = $presentations_choose->count;
761
+ }
762
+ }
763
+ //-------------------------------------------------------------------------------------------------------
764
+ if (!empty($product_name) && $count == 0) {
765
+ $presentations_choose = $this->GetPresentationsList(array(
766
+ 'page_size' => 1,
767
+ 'name' => $product_name
768
+ ));
769
+
770
+ $count = $presentations_choose->count;
771
+
772
+ if ($count == 0) {
773
+ $presentations_choose = $this->GetPresentationsList(array(
774
+ 'page_size' => 1,
775
+ 'sku' => $product_name
776
+ ));
777
+
778
+ $count = $presentations_choose->count;
779
+ }
780
+ }
781
+ //-------------------------------------------------------------------------------------------------------
782
+ if ($count == 0) return false;
783
+ else {
784
+ return $presentations_choose;
785
+ }
786
+ //-------------------------------------------------------------------------------------------------------
787
+ }
788
+
789
+ /**
790
+ * Synchronize presentations
791
+ * @param array $products_array Products array
792
+ * @return array
793
+ */
794
+ public function SynchronizePresentations($products_array) {
795
+ //-------------------------------------------------------------------------------------------------------
796
+ /**
797
+ * Match products with SUN
798
+ */
799
+ //-------------------------------------------------------------------------------------------------------
800
+ for ($i = 0, $n = count($products_array); $i < $n; $i++) {
801
+ //-------------------------------------------------------------------------------------------------------
802
+ $current = $products_array[$i];
803
+ //-------------------------------------------------------------------------------------------------------
804
+ if (empty($current['product_id']) || empty($current['product_name'])) {
805
+ //-------------------------------------------------------------------------------------------------------
806
+ throw new Exception('$product_id or $product_name not provided (both arguments are required).');
807
+ //-------------------------------------------------------------------------------------------------------
808
+ }
809
+ //-------------------------------------------------------------------------------------------------------
810
+ $comment = '';
811
+ //-------------------------------------------------------------------------------------------------------
812
+ /*
813
+ * Presentation exists?
814
+ */
815
+ if ($try = $this->GetProductPresentation($current['product_id'])) {
816
+ $comment = 'auto';
817
+
818
+ $this->Log($current['product_id'], '_presentations', 'skip', $comment);
819
+ //-------------------------------------------------------------------------------------------------------
820
+ continue;
821
+ //-------------------------------------------------------------------------------------------------------
822
+ }
823
+ //-------------------------------------------------------------------------------------------------------
824
+ $product_search = array(
825
+ 'product_sku' => $current['product_sku'],
826
+ 'product_name' => $current['product_name']
827
+ );
828
+
829
+ $response = $this->MatchPresentation($product_search);
830
+ $comment = ' auto - "'.$current['product_sku'].'"';
831
+ //-------------------------------------------------------------------------------------------------------
832
+ /*
833
+ * Found match? Update DB
834
+ */
835
+ //-------------------------------------------------------------------------------------------------------
836
+ if ($response->count > 0) {
837
+ //-------------------------------------------------------------------------------------------------------
838
+ $result = $response->results[0];
839
+ //-------------------------------------------------------------------------------------------------------
840
+ /*
841
+ * Update presentation if wasn't unlinked before
842
+ */
843
+ //-------------------------------------------------------------------------------------------------------
844
+ if (!$this->IsPresentationUnlinked($current['product_id'], $result->id)) {
845
+ //-------------------------------------------------------------------------------------------------------
846
+ $presentation_id = $this->SetProductPresentation($current['product_id'], $result->id, $result->name, $comment);
847
+ //-------------------------------------------------------------------------------------------------------
848
+ $p_items = $this->GetProductPresentationItems($response);
849
+
850
+ //----------------------------------------------------------
851
+ /**/ $this->return_debug(array(
852
+ /**/ 'function' => __FUNCTION__,
853
+ /**/ 'items' => $p_items
854
+ /**/ ));
855
+ //----------------------------------------------------------
856
+
857
+ //-------------------------------------------------------------------------------------------------------
858
+ /*
859
+ * Final items update
860
+ */
861
+ if (count($p_items) >= 1) {
862
+ //-------------------------------------------------------------------------------------------------------
863
+ $this->SetProductPresentationItems($current['product_id'], $result->id, $result->name, $p_items, 'auto');
864
+ //-------------------------------------------------------------------------------------------------------
865
+ }
866
+ //-------------------------------------------------------------------------------------------------------
867
+ }
868
+ //-------------------------------------------------------------------------------------------------------
869
+ }
870
+ }
871
+ //-------------------------------------------------------------------------------------------------------
872
+ $this->SetConfiguration('last_updated', date('Y-m-d H:i:s'));
873
+ //-------------------------------------------------------------------------------------------------------
874
+
875
+ return $products_array;
876
+ //-------------------------------------------------------------------------------------------------------
877
+ }
878
+
879
+ /**
880
+ * Refresh presentations items
881
+ * Delete non-existing on SUN
882
+ * Add new from SUN
883
+ * @return boolean
884
+ */
885
+ public function SynchronizePresentationsItems() {
886
+ //-------------------------------------------------------------------------------------------------------
887
+ $db_query = '
888
+ SELECT *
889
+ FROM `'.$this->db_prefix.'orbitvu_products_presentations`
890
+ ';
891
+
892
+ //---------------------------------------------------------------------
893
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
894
+ //---------------------------------------------------------------------
895
+
896
+ $query = $this->database->FetchAll($db_query);
897
+
898
+ foreach ($query as $q) {
899
+ //-------------------------------------------------------------------------------------------------------
900
+ $items_sun = $this->GetProductPresentationItems($q['orbitvu_id']);
901
+
902
+ $items_sun_ids = array();
903
+
904
+ foreach ($items_sun as $item) {
905
+ $items_sun_ids[] = $item['orbitvu_id'];
906
+ }
907
+
908
+ //-------------------------------------------------------------------------------------------------------
909
+ if (count($items_sun_ids) <= 0) {
910
+ continue; // nothing to update
911
+ }
912
+ //-------------------------------------------------------------------------------------------------------
913
+
914
+ $db_query_items = '
915
+ SELECT *
916
+ FROM `'.$this->db_prefix.'orbitvu_products_presentations_items`
917
+
918
+ WHERE
919
+ `_presentations_id` = '.intval($q['id']).'
920
+ ';
921
+
922
+ //---------------------------------------------------------------------
923
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
924
+ //---------------------------------------------------------------------
925
+
926
+ $items_current = $this->database->FetchAll($db_query_items);
927
+
928
+ $items_current_ids = array();
929
+
930
+ /**
931
+ * Deleting items not existing on SUN anymore
932
+ */
933
+ //-------------------------------------------------------------------------------------------------------
934
+ foreach ($items_current as $item) {
935
+ if (!in_array($item['orbitvu_id'], $items_sun_ids)) {
936
+ $this->DeletePresentationItem($item['id']);
937
+ }
938
+
939
+ $items_current_ids[] = $item['orbitvu_id'];
940
+ }
941
+ //-------------------------------------------------------------------------------------------------------
942
+
943
+ /**
944
+ * New items adding
945
+ */
946
+ //-------------------------------------------------------------------------------------------------------
947
+ foreach ($items_sun as $item) {
948
+ if (!in_array($item['orbitvu_id'], $items_current_ids)) {
949
+ $this->SetProductPresentationItems($q['product_id'], $q['orbitvu_id'], $q['name'], array($item));
950
+ }
951
+ }
952
+ //-------------------------------------------------------------------------------------------------------
953
+ }
954
+
955
+ //-------------------------------------------------------------------------------------------------------
956
+ $this->SetConfiguration('last_refreshed', date('Y-m-d H:i:s'));
957
+ //-------------------------------------------------------------------------------------------------------
958
+
959
+ return true;
960
+ //-------------------------------------------------------------------------------------------------------
961
+ }
962
+
963
+ /**
964
+ * Get presentations from Orbitvu SUN
965
+ * @param array $params Params for Orbitvu SUN filtering
966
+ * @return stdClass
967
+ */
968
+ public function GetPresentationsList($params = false) {
969
+ //-------------------------------------------------------------------------------------------------------
970
+ if (is_array($params)) {
971
+ //-------------------------------------------------------------------------------------------------------
972
+ return $this->Connect->CallSUN('presentations', $params);
973
+ //-------------------------------------------------------------------------------------------------------
974
+ }
975
+ else {
976
+ //-------------------------------------------------------------------------------------------------------
977
+ $results = array();
978
+ $response_results = $stdClass;
979
+ $j = 0;
980
+ //-------------------------------------------------------------------------------------------------------
981
+ do {
982
+ //-------------------------------------------------------------------------------------------------------
983
+ if ($j == 0) {
984
+ $response = $this->Connect->CallSUN('presentations');
985
+ $response_results = $response;
986
+ }
987
+ else {
988
+ $response = $this->Connect->CallSUN($response->next);
989
+ }
990
+ //-------------------------------------------------------------------------------------------------------
991
+ for ($i = 0, $n = count($response->results); $i < $n; $i++) {
992
+ //-------------------------------------------------------------------------------------------------------
993
+ $results[] = $response->results[$i];
994
+ //-------------------------------------------------------------------------------------------------------
995
+ }
996
+ //-------------------------------------------------------------------------------------------------------
997
+ $j++;
998
+ }
999
+ //-------------------------------------------------------------------------------------------------------
1000
+ while (!empty($response->next));
1001
+ //-------------------------------------------------------------------------------------------------------
1002
+ }
1003
+ //-------------------------------------------------------------------------------------------------------
1004
+ $response_results->count = count($results);
1005
+ $response_results->next = '';
1006
+ $response_results->prev = '';
1007
+ $response_results->results = $results;
1008
+ //-------------------------------------------------------------------------------------------------------
1009
+ return $response_results;
1010
+ //-------------------------------------------------------------------------------------------------------
1011
+ }
1012
+
1013
+ /**
1014
+ * Get presentation items
1015
+ * @param integer $orbitvu_id Orbitvu SUN presentation ID
1016
+ * @return array
1017
+ */
1018
+ public function GetProductPresentationItems($orbitvu_id) {
1019
+ //-------------------------------------------------------------------------------------------------------
1020
+ if (is_array($orbitvu_id) || is_object($orbitvu_id)) {
1021
+ $response = $orbitvu_id;
1022
+ unset($orbitvu_id);
1023
+ }
1024
+ else {
1025
+ $response = $this->GetPresentationsList(array('id' => $orbitvu_id));
1026
+ }
1027
+ //-------------------------------------------------------------------------------------------------------
1028
+ $results = $response->results[0];
1029
+ $uid = $results->uid;
1030
+
1031
+ $p_items = array();
1032
+ //-------------------------------------------------------------------------------------------------------
1033
+ $sync_order = array(
1034
+ 'sync_2d' => true,
1035
+ 'sync_360' => true,
1036
+ 'sync_orbittour' => true
1037
+ );
1038
+ //-------------------------------------------------------------------------------------------------------
1039
+ foreach ($sync_order as $key => $value) {
1040
+ $sync_order[$key] = $this->Config->$key;
1041
+ }
1042
+ //-------------------------------------------------------------------------------------------------------
1043
+ /*
1044
+ * Get OrbitTour
1045
+ */
1046
+ //-------------------------------------------------------------------------------------------------------
1047
+ if ($results->has_orbittour == '1') {
1048
+ $p_items[] = array(
1049
+ 'orbitvu_id' => intval($results->orbittour_set[0]->id),
1050
+ 'name' => 'OrbitTour',
1051
+ 'type' => 0,
1052
+ 'thumbnail' => $results->thumbnail_url,
1053
+ 'path' => $results->orbittour_set[0]->script_url,
1054
+ 'config' => json_encode(array('uid' => $uid)),
1055
+ 'status' => ($sync_order['sync_orbittour'] == 'true' ? 'active' : 'inactive')
1056
+ );
1057
+ }
1058
+ //-------------------------------------------------------------------------------------------------------
1059
+
1060
+ /*
1061
+ * Get other items
1062
+ */
1063
+ //-------------------------------------------------------------------------------------------------------
1064
+ $results = $results->presentationcontent_set;
1065
+ for ($i = 0, $n = count($results); $i < $n; $i++) {
1066
+ $cur = $results[$i];
1067
+ //-------------------------------------------------------------------------------------------------------
1068
+ if (($sync_order['sync_360'] == 'true' && $cur->type == '1') || ($sync_order['sync_2d'] == 'true' && $cur->type == '3')) {
1069
+ $status = 'active';
1070
+ }
1071
+ else {
1072
+ $status = 'inactive';
1073
+ }
1074
+ //-------------------------------------------------------------------------------------------------------
1075
+ $p_items[] = array(
1076
+ 'orbitvu_id' => intval($cur->id),
1077
+ 'name' => $cur->name,
1078
+ 'type' => $cur->type,
1079
+ 'thumbnail' => $cur->thumbnail_url,
1080
+ 'path' => (!empty($cur->script_url) ? $cur->script_url : $cur->view_url),
1081
+ 'config' => json_encode(array('uid' => $uid)),
1082
+ 'status' => $status
1083
+ );
1084
+ }
1085
+ //-------------------------------------------------------------------------------------------------------
1086
+ return $p_items;
1087
+ //-------------------------------------------------------------------------------------------------------
1088
+ }
1089
+
1090
+ /**
1091
+ * Switch presentation item priority
1092
+ * @param integer $product_id Store product ID from database
1093
+ * @param integer $item_id Current item ID from database
1094
+ * @param integer $item_id2 Item will be putted in order after this item
1095
+ * @return boolean
1096
+ */
1097
+ public function SwitchPresentationItemPriority($product_id, $item_id, $before_item_id) {
1098
+ if ($item_id > 0 && $before_item_id > 0) {
1099
+ //-------------------------------------------------------------------------------------------------------
1100
+ $presentation = $this->GetProductPresentation($product_id);
1101
+ $items = $presentation['items'];
1102
+ //-------------------------------------------------------------------------------------------------------
1103
+ $item_to_move = 0;
1104
+ $before_item = 0;
1105
+ //-------------------------------------------------------------------------------------------------------
1106
+ $i = 0;
1107
+ //-------------------------------------------------------------------------------------------------------
1108
+ foreach ($items as $item) {
1109
+ //-------------------------------------------------------------------------------------------------------
1110
+ if ($item_id == $item['id']) {
1111
+ $item_to_move = $i;
1112
+ }
1113
+ //-------------------------------------------------------------------------------------------------------
1114
+ if ($before_item_id == $item['id']) {
1115
+ $before_item = $i;
1116
+ }
1117
+ //-------------------------------------------------------------------------------------------------------
1118
+ $i++;
1119
+ }
1120
+ //-------------------------------------------------------------------------------------------------------
1121
+ $new_item = array($items[$item_to_move]);
1122
+ unset($items[$item_to_move]);
1123
+ array_splice($items, $before_item, 0, $new_item);
1124
+
1125
+ $priority = count($items) * 10;
1126
+ foreach ($items as $item) {
1127
+ $this->UpdatePresentationItemPriority($item['id'], $priority);
1128
+
1129
+ $priority -= 10;
1130
+ }
1131
+ //-------------------------------------------------------------------------------------------------------
1132
+ return true;
1133
+ //-------------------------------------------------------------------------------------------------------
1134
+ }
1135
+ //-------------------------------------------------------------------------------------------------------
1136
+ return false;
1137
+ //-------------------------------------------------------------------------------------------------------
1138
+ }
1139
+
1140
+ /**
1141
+ * Update item priority
1142
+ * @param integer $item_id Store product item ID from database
1143
+ * @param integer $new_priority New priority (order) value
1144
+ * @return boolean
1145
+ */
1146
+ public function UpdatePresentationItemPriority($item_id, $new_priority = 0) {
1147
+ //-------------------------------------------------------------------------------------------------------
1148
+ $db_query = '
1149
+ UPDATE
1150
+ `'.$this->db_prefix.'orbitvu_products_presentations_items`
1151
+
1152
+ SET
1153
+ `priority` = '.intval($new_priority).'
1154
+
1155
+ WHERE
1156
+ `id` = '.intval($item_id).'
1157
+
1158
+ LIMIT 1
1159
+ ';
1160
+
1161
+ //---------------------------------------------------------------------
1162
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
1163
+ //---------------------------------------------------------------------
1164
+
1165
+ //-------------------------------------------------------------------------------------------------------
1166
+ if ($query = $this->database->Query($db_query)) {
1167
+ //-------------------------------------------------------------------------------------------------------
1168
+ $this->Log($item_id, '_presentations_items', 'update');
1169
+ //-------------------------------------------------------------------------------------------------------
1170
+ return true;
1171
+ //-------------------------------------------------------------------------------------------------------
1172
+ }
1173
+ else {
1174
+ //-------------------------------------------------------------------------------------------------------
1175
+ return false;
1176
+ //-------------------------------------------------------------------------------------------------------
1177
+ }
1178
+ //-------------------------------------------------------------------------------------------------------
1179
+ }
1180
+
1181
+ /**
1182
+ * Update item visibility status
1183
+ * @param integer $item_id Store product item ID from database
1184
+ * @param string $status New item visibility status [active / inactive]
1185
+ * @return boolean
1186
+ */
1187
+ public function UpdatePresentationItemStatus($item_id, $status = 'inactive') {
1188
+ //-------------------------------------------------------------------------------------------------------
1189
+ $db_query = '
1190
+ UPDATE
1191
+ `'.$this->db_prefix.'orbitvu_products_presentations_items`
1192
+
1193
+ SET
1194
+ `status` = \''.$status.'\'
1195
+
1196
+ WHERE
1197
+ `id` = '.intval($item_id).'
1198
+
1199
+ LIMIT 1
1200
+ ';
1201
+
1202
+ //---------------------------------------------------------------------
1203
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
1204
+ //---------------------------------------------------------------------
1205
+
1206
+ //-------------------------------------------------------------------------------------------------------
1207
+ if ($query = $this->database->Query($db_query)) {
1208
+ //-------------------------------------------------------------------------------------------------------
1209
+ $this->Log($item_id, '_presentations_items', 'update');
1210
+ //-------------------------------------------------------------------------------------------------------
1211
+ return true;
1212
+ //-------------------------------------------------------------------------------------------------------
1213
+ }
1214
+ else {
1215
+ //-------------------------------------------------------------------------------------------------------
1216
+ return false;
1217
+ //-------------------------------------------------------------------------------------------------------
1218
+ }
1219
+ //-------------------------------------------------------------------------------------------------------
1220
+ }
1221
+
1222
+ /**
1223
+ * Delete presentation item
1224
+ * @param integer $item_id Store product item ID from database
1225
+ * @return boolean
1226
+ */
1227
+ public function DeletePresentationItem($item_id) {
1228
+ //-------------------------------------------------------------------------------------------------------
1229
+ $db_query = '
1230
+ DELETE FROM
1231
+ `'.$this->db_prefix.'orbitvu_products_presentations_items`
1232
+
1233
+ WHERE
1234
+ `id` = '.intval($item_id).'
1235
+
1236
+ LIMIT 1
1237
+ ';
1238
+
1239
+ //---------------------------------------------------------------------
1240
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
1241
+ //---------------------------------------------------------------------
1242
+
1243
+ //-------------------------------------------------------------------------------------------------------
1244
+ if ($query = $this->database->Query($db_query)) {
1245
+ //-------------------------------------------------------------------------------------------------------
1246
+ $this->Log($item_id, '_presentations_items', 'delete');
1247
+ //-------------------------------------------------------------------------------------------------------
1248
+ return true;
1249
+ //-------------------------------------------------------------------------------------------------------
1250
+ }
1251
+ else {
1252
+ //-------------------------------------------------------------------------------------------------------
1253
+ return false;
1254
+ //-------------------------------------------------------------------------------------------------------
1255
+ }
1256
+ //-------------------------------------------------------------------------------------------------------
1257
+ }
1258
+
1259
+ /**
1260
+ * Get store plugin version
1261
+ * @return string
1262
+ */
1263
+ public function GetVersion() {
1264
+ //----------------------------------------------------------
1265
+ return $this->database->GetVersion();
1266
+ //----------------------------------------------------------
1267
+ }
1268
+
1269
+ /**
1270
+ * Install database tables
1271
+ * @return boolean
1272
+ */
1273
+ public function Install() {
1274
+ //---------------------------------------------------------------------------------------------------
1275
+ return $this->database->Install();
1276
+ //---------------------------------------------------------------------------------------------------
1277
+ }
1278
+
1279
+ /**
1280
+ * Save actions log
1281
+ * @param integer $item_id Item ID
1282
+ * @param integer $item_table Item table
1283
+ * @param string $action Action to log [add/delete/info/skip/update]
1284
+ * @param string $comment
1285
+ * @return boolean
1286
+ */
1287
+ public function Log($item_id, $item_table = '_presentations', $action = 'info', $comment = 'manual') {
1288
+ //-------------------------------------------------------------------------------------------------------
1289
+
1290
+ $db_query = '
1291
+ INSERT INTO
1292
+ `'.$this->db_prefix.'orbitvu_log`
1293
+ (`_item_id`, `_item_table`, `action`, `comment`, `date`, `ip`)
1294
+
1295
+ VALUES (
1296
+ '.intval($item_id).',
1297
+ \''.$item_table.'\',
1298
+ \''.$action.'\',
1299
+ \''.$this->database->Escape($comment).'\',
1300
+ NOW(),
1301
+ \''.$_SERVER['REMOTE_ADDR'].'\'
1302
+ )
1303
+ ';
1304
+
1305
+ //---------------------------------------------------------------------
1306
+ /**/ $this->return_sql_debug(__FUNCTION__, $db_query);
1307
+ //---------------------------------------------------------------------
1308
+
1309
+ $query = $this->database->Query($db_query);
1310
+ //-------------------------------------------------------------------------------------------------------
1311
+ return true;
1312
+ //-------------------------------------------------------------------------------------------------------
1313
+ }
1314
+
1315
+ /**
1316
+ * Debugger
1317
+ * @param array $params
1318
+ * @return string
1319
+ */
1320
+ private function return_debug($params) {
1321
+ //---------------------------------------------------------------------------------------------------
1322
+ if ($this->debug) {
1323
+ //---------------------------------------------------------------------------------------------------
1324
+ return OrbitvuDebugger::Debug($params);
1325
+ //---------------------------------------------------------------------------------------------------
1326
+ }
1327
+ //---------------------------------------------------------------------------------------------------
1328
+ }
1329
+
1330
+ /**
1331
+ * SQL Debugger
1332
+ * @param string $function
1333
+ * @param string $db_query
1334
+ * @return string
1335
+ */
1336
+ private function return_sql_debug($function, $db_query) {
1337
+ //---------------------------------------------------------------------------------------------------
1338
+ if ($this->debug) {
1339
+ //---------------------------------------------------------------------------------------------------
1340
+ return OrbitvuDebugger::DebugSQL($function, $db_query);
1341
+ //---------------------------------------------------------------------------------------------------
1342
+ }
1343
+ //---------------------------------------------------------------------------------------------------
1344
+ }
1345
+
1346
+ /**
1347
+ * Unit tests
1348
+ */
1349
+ private function run_tests() {
1350
+ //-----------------------------------------------------------------------------------------------------
1351
+ /*
1352
+ * Basic functions
1353
+ */
1354
+ //-----------------------------------------------------------------------------------------------------
1355
+ $tests_vars = array(
1356
+ 'access_token',
1357
+ 'viewers_path',
1358
+ 'temp_path'
1359
+ );
1360
+
1361
+ $configuration = $this->GetConfiguration();
1362
+ $tst = array();
1363
+ //-----------------------------------------------------------------------------------------------------
1364
+ for ($i = 0, $n = count($tests_vars); $i < $n; $i++) {
1365
+
1366
+ $tst[] = array(
1367
+ /**/ 'function' => 'GetConfiguration()',
1368
+ /**/ 'given' => $configuration->$tests_vars[$i],
1369
+ /**/ 'expected' => '->'.$tests_vars[$i]
1370
+ );
1371
+
1372
+ if (!empty($configuration->$tests_vars[$i])) {
1373
+ $result = 'ok';
1374
+ }
1375
+ else {
1376
+ $result = 'fail';
1377
+ }
1378
+
1379
+ }
1380
+
1381
+ $this->testclass->UpdateTest('GetConfiguration', array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__), $result, $tst);
1382
+ $this->testclass->UpdateTest('GetConfiguration', array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__), $result, $tst);
1383
+ //-----------------------------------------------------------------------------------------------------
1384
+ /*
1385
+ * Paths writables
1386
+ */
1387
+ //-----------------------------------------------------------------------------------------------------
1388
+ $this->testclass->AppendTest('is_writable(paths)', array('type' => 'function_check'), array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__));
1389
+
1390
+ $tests_vars = array(
1391
+ 'viewers_path',
1392
+ 'temp_path'
1393
+ );
1394
+
1395
+ $tst = array();
1396
+ //-----------------------------------------------------------------------------------------------------
1397
+ for ($i = 0, $n = count($tests_vars); $i < $n; $i++) {
1398
+
1399
+ $bool = is_writable($configuration->$tests_vars[$i]);
1400
+
1401
+ $tst[] = array(
1402
+ /**/ 'function' => 'is_writable('.$configuration->$tests_vars[$i].')',
1403
+ /**/ 'given' => ($bool ? 'true' : 'false'),
1404
+ /**/ 'expected' => 'true'
1405
+ );
1406
+
1407
+ if ($bool) {
1408
+ $result = 'ok';
1409
+ }
1410
+ else {
1411
+ $result = 'fail';
1412
+ }
1413
+
1414
+ }
1415
+ //-----------------------------------------------------------------------------------------------------
1416
+ $this->testclass->UpdateTest('is_writable(paths)', array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__), $result, $tst);
1417
+ //-----------------------------------------------------------------------------------------------------
1418
+ }
1419
+
1420
+ }
1421
+ ?>
app/code/community/Orbitvu/Sun/controllers/OrbitvuDebugger.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Orbitvu PHP Orbitvu eCommerce debugger
4
+ * @Copyright: Orbitvu Sp. z o.o. is the owner of full rights to this code
5
+ */
6
+
7
+ class OrbitvuDebugger {
8
+
9
+ /**
10
+ * Debugger
11
+ * @param array $params
12
+ * @return string
13
+ */
14
+ public static function Debug($params) {
15
+ //---------------------------------------------------------------------------------------------------
16
+ $out = 'debug: ['.print_r($params, true).']'."\n";
17
+ //---------------------------------------------------------------------------------------------------
18
+ return print '<pre class="debug" onDblClick="this.style.display=\'none\';">'.$out.'</pre>';
19
+ //---------------------------------------------------------------------------------------------------
20
+ }
21
+
22
+ /**
23
+ * SQL Debugger
24
+ * @param string $function
25
+ * @param string $db_query
26
+ * @return string
27
+ */
28
+ public static function DebugSQL($function, $db_query) {
29
+ //---------------------------------------------------------------------------------------------------
30
+ $params = array(
31
+ 'function' => $function,
32
+ 'sql' => $db_query,
33
+ 'sql-info' => (empty($error) ? 'success' : $error)
34
+ );
35
+ //---------------------------------------------------------------------------------------------------
36
+ return self::Debug($params);
37
+ //---------------------------------------------------------------------------------------------------
38
+ }
39
+
40
+ }
41
+
42
+ ?>
app/code/community/Orbitvu/Sun/controllers/OrbitvuTests.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Orbitvu PHP System Unit Tests
4
+ * @Copyright: Orbitvu Sp. z o.o. is the owner of full rights to this code
5
+ */
6
+
7
+ class OrbitvuTests {
8
+
9
+ /**
10
+ * Temp array per instance with test results
11
+ * @var array
12
+ */
13
+ private $tests = array();
14
+
15
+ /**
16
+ * Update unit tests file
17
+ * @return boolean
18
+ */
19
+ public function SaveTest() {
20
+ //----------------------------------------------------------
21
+ $ar = json_encode($this->tests);
22
+
23
+ if (file_put_contents('orbitvu_tests.txt', $ar)) {
24
+ //---------------------------------------------------------
25
+ return true;
26
+ //---------------------------------------------------------
27
+ }
28
+ //---------------------------------------------------------
29
+ return false;
30
+ //---------------------------------------------------------
31
+ }
32
+
33
+ /**
34
+ * Append a new test
35
+ * @param string $name Name
36
+ * @param array $test Data
37
+ * @param array $params Additional params
38
+ */
39
+ public function AppendTest($name, $test, $params) {
40
+ //----------------------------------------------------------
41
+ $this->tests[] = array(
42
+ $name,
43
+ $test,
44
+ $params,
45
+ date('Y-m-d H:i:s'),
46
+ 'result' => 'running'
47
+ );
48
+ //----------------------------------------------------------
49
+ $this->SaveTest();
50
+ //----------------------------------------------------------
51
+ }
52
+
53
+ /**
54
+ * Update test status
55
+ * @param string $name Test name
56
+ * @param array $params Test params
57
+ * @param string $result Test result [running/ok/failed]
58
+ * @param string|null $debug
59
+ */
60
+ public function UpdateTest($name, $params, $result = 'ok', $debug = null) {
61
+ //----------------------------------------------------------
62
+ $this->tests[] = array(
63
+ $name,
64
+ $params,
65
+ date('Y-m-d H:i:s'),
66
+ 'result' => $result,
67
+ $debug
68
+ );
69
+ //----------------------------------------------------------
70
+ $this->SaveTest();
71
+ //----------------------------------------------------------
72
+ }
73
+
74
+ /**
75
+ * Orbitvu SUN API calling alias
76
+ * @param string $call Orbitvu SUN API Call path
77
+ * @param type $parameters Orbitvu SUN API Call parameters
78
+ * @return string
79
+ */
80
+ public function CallAPI($call, $parameters) {
81
+ //----------------------------------------------------------
82
+ if ($call == 'viewers/licenses') {
83
+ //----------------------------------------------------------
84
+ $res = '[{"url": "https://orbitvu.co/api/viewers/licenses/362.json", "type": "STANDARD", "support": "2015-05-19", "domains": "", "licensed_for": "Orbitvu", "licensed_for_url": "http://orbitvu.com/", "available_version": "2.3.10", "latest_version": "2.3.10", "download": "https://orbitvu.co/api/viewers/licenses/362/download/.html"}, {"url": "https://orbitvu.co/api/viewers/licenses/365.json", "type": "ROYALTY FREE", "support": "2015-05-23", "domains": "", "licensed_for": "Orbitvu", "licensed_for_url": "http://orbitvu.com/", "available_version": "2.3.10", "latest_version": "2.3.10", "download": "https://orbitvu.co/api/viewers/licenses/365/download/.html"}]';
85
+
86
+ //----------------------------------------------------------
87
+ $this->UpdateTest('api_call['.$call.']', array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__), 'ok');
88
+ //----------------------------------------------------------
89
+ return $res;
90
+ //----------------------------------------------------------
91
+ }
92
+ else if (stristr($call, 'download/')) {
93
+ //----------------------------------------------------------
94
+ $res = file_get_contents('empty.zip');
95
+
96
+ //----------------------------------------------------------
97
+ $this->UpdateTest('api_call['.$call.']', array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__), 'ok');
98
+ //----------------------------------------------------------
99
+ return $res;
100
+ //----------------------------------------------------------
101
+ }
102
+ else if (stristr($call, 'presentations')) {
103
+ //----------------------------------------------------------
104
+ $res = '[
105
+ {"count": 8, "next": null, "previous": null, "results": [{"id": 25180, "uid": "dw8tWSSPwV5GC4TXgaZmmG", "name": "Coffee machine", "category_1": "", "category_2": "", "create_date": "2014-05-26T11:15:04", "presentation_status_display": "Aktywny", "presentation_status": 1, "presentation_size": 221683161, "has_orbittour": true, "tags": [], "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/img01.png", "orbittour_set": [{"id": 2699, "script_url": "//orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/2/orbittour/2699/script", "view_url": "//orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/2/orbittour/2699/view"}], "presentationcontent_set": [{"id": 178575, "name": "ov3601", "type": 1, "type_display": "ORBITVU 360", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/img01.png", "script_url": "//orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/ov3601/3/script", "view_url": "//orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/ov3601/3/view", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178577, "name": "img_0001.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178577/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178577/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178578, "name": "img_0002.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178578/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178578/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178579, "name": "img_0003.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178579/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178579/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178580, "name": "img_0004.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178580/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178580/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178581, "name": "img_0005.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178581/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178581/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178582, "name": "img_0006.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178582/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178582/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178583, "name": "img_0007.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178583/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178583/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178584, "name": "img_0008.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178584/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178584/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178585, "name": "img_0009.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178585/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178585/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178586, "name": "img_0010.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178586/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178586/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178587, "name": "img_0011.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178587/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178587/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178588, "name": "img_0012.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178588/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178588/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178589, "name": "img_0013.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178589/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178589/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178590, "name": "img_0014.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178590/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178590/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178591, "name": "img_0015.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178591/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178591/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178592, "name": "img_0016.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178592/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178592/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178593, "name": "img_0017.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178593/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178593/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178594, "name": "img_0018.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178594/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178594/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178595, "name": "img_0019.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178595/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178595/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178596, "name": "img_0020.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178596/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178596/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178597, "name": "img_0021.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178597/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178597/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178598, "name": "img_0022.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178598/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178598/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178599, "name": "img_0023.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178599/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178599/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178600, "name": "img_0024.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178600/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178600/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178601, "name": "img_0025.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178601/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178601/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178602, "name": "img_0026.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178602/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178602/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178603, "name": "img_0027.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178603/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178603/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178604, "name": "img_0028.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178604/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178604/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178605, "name": "img_0029.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178605/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178605/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178606, "name": "img_0030.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178606/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178606/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178607, "name": "img_0031.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178607/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178607/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178608, "name": "img_0032.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178608/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178608/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178609, "name": "img_0033.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178609/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178609/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178610, "name": "img_0034.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178610/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178610/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178611, "name": "img_0035.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178611/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178611/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178612, "name": "img_0036.png", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25180.json", "thumbnail_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178612/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/dw8tWSSPwV5GC4TXgaZmmG/iproc/2d/178612/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}]}, {"id": 25181, "uid": "LbAPq78zoBXaPQ68Q6ai4E", "name": "Gold earrings", "category_1": "Not Specified", "category_2": "Not Specified", "create_date": "2014-05-26T11:15:08", "presentation_status_display": "Aktywny", "presentation_status": 1, "presentation_size": 606911, "has_orbittour": false, "tags": [], "thumbnail_url": "//static.orbitvu.co/001/LbAPq78zoBXaPQ68Q6ai4E/iproc/img01.png", "orbittour_set": [{"id": 2700, "script_url": "//orbitvu.co/001/LbAPq78zoBXaPQ68Q6ai4E/2/orbittour/2700/script", "view_url": "//orbitvu.co/001/LbAPq78zoBXaPQ68Q6ai4E/2/orbittour/2700/view"}], "presentationcontent_set": [{"id": 178613, "name": "ov3601", "type": 1, "type_display": "ORBITVU 360", "presentation": "http://orbitvu.co/api/presentations/25181.json", "thumbnail_url": "//static.orbitvu.co/001/LbAPq78zoBXaPQ68Q6ai4E/iproc/img01.png", "script_url": "//orbitvu.co/001/LbAPq78zoBXaPQ68Q6ai4E/ov3601/3/script", "view_url": "//orbitvu.co/001/LbAPq78zoBXaPQ68Q6ai4E/ov3601/3/view", "max_width": 5021, "max_height": 3342, "content2_xml": true}]}, {"id": 25182, "uid": "pXBLcTYvn6ankyEC3b6iJX", "name": "watch", "category_1": "Not Specified", "category_2": "Not Specified", "create_date": "2014-05-26T11:15:10", "presentation_status_display": "Aktywny", "presentation_status": 1, "presentation_size": 7611244, "has_orbittour": false, "tags": [], "thumbnail_url": "//static.orbitvu.co/001/pXBLcTYvn6ankyEC3b6iJX/iproc/img01.png", "orbittour_set": [], "presentationcontent_set": [{"id": 178615, "name": "ov3601", "type": 1, "type_display": "ORBITVU 360", "presentation": "http://orbitvu.co/api/presentations/25182.json", "thumbnail_url": "//static.orbitvu.co/001/pXBLcTYvn6ankyEC3b6iJX/iproc/img01.png", "script_url": "//orbitvu.co/001/pXBLcTYvn6ankyEC3b6iJX/ov3601/3/script", "view_url": "//orbitvu.co/001/pXBLcTYvn6ankyEC3b6iJX/ov3601/3/view", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178617, "name": "img_2D_0001.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25182.json", "thumbnail_url": "//static.orbitvu.co/001/pXBLcTYvn6ankyEC3b6iJX/iproc/2d/178617/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/pXBLcTYvn6ankyEC3b6iJX/iproc/2d/178617/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178618, "name": "img_2D_0001_large.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25182.json", "thumbnail_url": "//static.orbitvu.co/001/pXBLcTYvn6ankyEC3b6iJX/iproc/2d/178618/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/pXBLcTYvn6ankyEC3b6iJX/iproc/2d/178618/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}, {"id": 178619, "name": "img_2D_0001_small.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25182.json", "thumbnail_url": "//static.orbitvu.co/001/pXBLcTYvn6ankyEC3b6iJX/iproc/2d/178619/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/pXBLcTYvn6ankyEC3b6iJX/iproc/2d/178619/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}]}, {"id": 25183, "uid": "kEe8tjEWkbMmrBsX8skyXD", "name": "Golden ring with diamond", "category_1": "Not Specified", "category_2": "Not Specified", "create_date": "2014-05-26T11:15:13", "presentation_status_display": "Aktywny", "presentation_status": 1, "presentation_size": 511239, "has_orbittour": false, "tags": [], "thumbnail_url": "//static.orbitvu.co/001/kEe8tjEWkbMmrBsX8skyXD/iproc/img01.png", "orbittour_set": [], "presentationcontent_set": [{"id": 178620, "name": "img_2D_0001.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25183.json", "thumbnail_url": "//static.orbitvu.co/001/kEe8tjEWkbMmrBsX8skyXD/iproc/2d/178620/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/kEe8tjEWkbMmrBsX8skyXD/iproc/2d/178620/img01.png", "max_width": 0, "max_height": 0, "content2_xml": true}]}, {"id": 25184, "uid": "LANSnsaeKeUP9ua7ZDFFA3", "name": "BUTY_D_GOTOWE", "category_1": "Brak Wpisu", "category_2": "Brak Wpisu", "create_date": "2014-05-26T11:15:20", "presentation_status_display": "Aktywny", "presentation_status": 1, "presentation_size": 1234232, "has_orbittour": false, "tags": [], "thumbnail_url": "//static.orbitvu.co/001/LANSnsaeKeUP9ua7ZDFFA3/iproc/img01.png", "orbittour_set": [], "presentationcontent_set": [{"id": 178622, "name": "ov3601", "type": 1, "type_display": "ORBITVU 360", "presentation": "http://orbitvu.co/api/presentations/25184.json", "thumbnail_url": "//static.orbitvu.co/001/LANSnsaeKeUP9ua7ZDFFA3/iproc/img01.png", "script_url": "//orbitvu.co/001/LANSnsaeKeUP9ua7ZDFFA3/ov3601/3/script", "view_url": "//orbitvu.co/001/LANSnsaeKeUP9ua7ZDFFA3/ov3601/3/view", "max_width": 0, "max_height": 0, "content2_xml": true}]}, {"id": 25185, "uid": "WEWjYXumxfmufCuCynJ86g", "name": "YDP-142", "category_1": "", "category_2": "", "create_date": "2014-05-26T11:15:34", "presentation_status_display": "Aktywny", "presentation_status": 1, "presentation_size": 50316772, "has_orbittour": true, "tags": [], "thumbnail_url": "//static.orbitvu.co/001/WEWjYXumxfmufCuCynJ86g/iproc/img01.png", "orbittour_set": [{"id": 2701, "script_url": "//orbitvu.co/001/WEWjYXumxfmufCuCynJ86g/2/orbittour/2701/script", "view_url": "//orbitvu.co/001/WEWjYXumxfmufCuCynJ86g/2/orbittour/2701/view"}], "presentationcontent_set": [{"id": 178624, "name": "ov3601", "type": 1, "type_display": "ORBITVU 360", "presentation": "http://orbitvu.co/api/presentations/25185.json", "thumbnail_url": "//static.orbitvu.co/001/WEWjYXumxfmufCuCynJ86g/iproc/img01.png", "script_url": "//orbitvu.co/001/WEWjYXumxfmufCuCynJ86g/ov3601/3/script", "view_url": "//orbitvu.co/001/WEWjYXumxfmufCuCynJ86g/ov3601/3/view", "max_width": 0, "max_height": 0, "content2_xml": false}, {"id": 178626, "name": "img75418.jpeg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25185.json", "thumbnail_url": "//static.orbitvu.co/001/WEWjYXumxfmufCuCynJ86g/iproc/2d/178626/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/WEWjYXumxfmufCuCynJ86g/iproc/2d/178626/img01.png", "max_width": 0, "max_height": 0, "content2_xml": false}, {"id": 178627, "name": "img75419.jpeg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25185.json", "thumbnail_url": "//static.orbitvu.co/001/WEWjYXumxfmufCuCynJ86g/iproc/2d/178627/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/WEWjYXumxfmufCuCynJ86g/iproc/2d/178627/img01.png", "max_width": 0, "max_height": 0, "content2_xml": false}]}, {"id": 25186, "uid": "DyKUxA29VPbCFiRiJrKb9N", "name": "Monitor z instrukcj\u0105 obs\u0142ugi", "category_1": "sprz\u0119t komputerowy", "category_2": "sprz\u0119t elektroniczny", "create_date": "2014-05-26T11:17:18", "presentation_status_display": "Aktywny", "presentation_status": 1, "presentation_size": 64320387, "has_orbittour": false, "tags": [], "thumbnail_url": "//static.orbitvu.co/001/DyKUxA29VPbCFiRiJrKb9N/iproc/img01.png", "orbittour_set": [], "presentationcontent_set": [{"id": 178628, "name": "ov3601", "type": 1, "type_display": "ORBITVU 360", "presentation": "http://orbitvu.co/api/presentations/25186.json", "thumbnail_url": "//static.orbitvu.co/001/DyKUxA29VPbCFiRiJrKb9N/iproc/img01.png", "script_url": "//orbitvu.co/001/DyKUxA29VPbCFiRiJrKb9N/ov3601/3/script", "view_url": "//orbitvu.co/001/DyKUxA29VPbCFiRiJrKb9N/ov3601/3/view", "max_width": 0, "max_height": 0, "content2_xml": true}]}, {"id": 25233, "uid": "BPo2ZYb2ShuVPjxppkn2mh", "name": "test3", "category_1": "Brak Wpisu", "category_2": "Brak Wpisu", "create_date": "2014-05-28T10:30:44", "presentation_status_display": "Aktywny", "presentation_status": 1, "presentation_size": 47027475, "has_orbittour": false, "tags": [], "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/img01.png", "orbittour_set": [{"id": 2715, "script_url": "//orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/2/orbittour/2715/script", "view_url": "//orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/2/orbittour/2715/view"}], "presentationcontent_set": [{"id": 179181, "name": "ov3601", "type": 1, "type_display": "ORBITVU 360", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/img01.png", "script_url": "//orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/ov3601/3/script", "view_url": "//orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/ov3601/3/view", "max_width": 1500, "max_height": 1500, "content2_xml": true}, {"id": 179183, "name": "img_2D_0001.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179183/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179183/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179184, "name": "img_2D_0002.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179184/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179184/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179185, "name": "img_2D_0003.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179185/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179185/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179186, "name": "img_2D_0004.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179186/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179186/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179187, "name": "img_2D_0005.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179187/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179187/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179188, "name": "img_2D_0006.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179188/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179188/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179189, "name": "img_2D_0007.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179189/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179189/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179190, "name": "img_2D_0008.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179190/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179190/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179191, "name": "img_2D_0009.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179191/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179191/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179192, "name": "img_2D_0010.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179192/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179192/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179193, "name": "img_2D_0011.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179193/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179193/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179194, "name": "img_2D_0012.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179194/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179194/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179195, "name": "img_2D_0013.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179195/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179195/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179196, "name": "img_2D_0014.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179196/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179196/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179197, "name": "img_2D_0015.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179197/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179197/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179198, "name": "img_2D_0016.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179198/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179198/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}, {"id": 179199, "name": "img_2D_0017.jpg", "type": 3, "type_display": "image2d", "presentation": "http://orbitvu.co/api/presentations/25233.json", "thumbnail_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179199/img01.png", "script_url": "", "view_url": "//static.orbitvu.co/001/BPo2ZYb2ShuVPjxppkn2mh/iproc/2d/179199/img01.png", "max_width": 2000, "max_height": 2000, "content2_xml": true}]}]}]';
106
+
107
+ //----------------------------------------------------------
108
+ $this->UpdateTest('api_call['.$call.']', array('file' => __FILE__, 'line' => __LINE__, 'function' => __FUNCTION__), 'ok');
109
+ //----------------------------------------------------------
110
+ return $res;
111
+ //----------------------------------------------------------
112
+ }
113
+ }
114
+
115
+ /**
116
+ * Get tests results
117
+ * @return array
118
+ */
119
+ public function GetResults() {
120
+ //----------------------------------------------------------
121
+ return $this->tests;
122
+ //----------------------------------------------------------
123
+ }
124
+
125
+ }
126
+
127
+ ?>
app/code/community/Orbitvu/Sun/etc/adminhtml.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <all>
6
+ <title>Allow Everything</title>
7
+ </all>
8
+ <admin>
9
+ <children>
10
+ <system>
11
+ <children>
12
+ <config>
13
+ <children>
14
+ <orbitvu translate="title" module="orbitvu">
15
+ <title>Orbitvu SUN Synchronization</title>
16
+ <sort_order>100</sort_order>
17
+ </orbitvu>
18
+ </children>
19
+ </config>
20
+ </children>
21
+ </system>
22
+ </children>
23
+ </admin>
24
+ </resources>
25
+ </acl>
26
+ </config>
app/code/community/Orbitvu/Sun/etc/config.xml ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Orbitvu
5
+ * @package Orbitvu_Sun
6
+ * @copyright Copyright (c) 2014 Orbitvu (http://www.orbitvu.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <Orbitvu_Sun>
12
+ <version>1.0.0</version>
13
+ </Orbitvu_Sun>
14
+ </modules>
15
+ <global>
16
+ <models>
17
+ <sun>
18
+ <class>Orbitvu_Sun_Model</class>
19
+ <resourceModel>sun_resource</resourceModel>
20
+ </sun>
21
+ </models>
22
+ <resources>
23
+ <sun_setup>
24
+ <setup>
25
+ <module>Orbitvu_Sun</module>
26
+ <class>Orbitvu_Sun_Model_Resource_Setup</class>
27
+ </setup>
28
+ </sun_setup>
29
+ </resources>
30
+ <blocks>
31
+ <sun>
32
+ <class>Orbitvu_Sun_Block</class>
33
+ </sun>
34
+ <adminhtml>
35
+ <rewrite>
36
+ <catalog_product_edit_tabs>Orbitvu_Sun_Block_Adminhtml_Tabs</catalog_product_edit_tabs>
37
+ <catalog_product_grid>Orbitvu_Sun_Block_Adminhtml_Catalog_Product_Grid</catalog_product_grid>
38
+ </rewrite>
39
+ </adminhtml>
40
+ <catalog>
41
+ <rewrite>
42
+ <product_view_media>Orbitvu_Sun_Block_Product_View_Media</product_view_media>
43
+ </rewrite>
44
+ </catalog>
45
+ </blocks>
46
+ <events>
47
+ <catalog_product_save_after>
48
+ <observers>
49
+ <sun_save_product_data>
50
+ <type>singleton</type>
51
+ <class>sun/observer</class>
52
+ <method>saveProductTabData</method>
53
+ </sun_save_product_data>
54
+ </observers>
55
+ </catalog_product_save_after>
56
+ </events>
57
+ </global>
58
+ <frontend>
59
+ <routers>
60
+ <sun>
61
+ <use>standard</use>
62
+ <args>
63
+ <module>Orbitvu_Sun</module>
64
+ <frontName>sun</frontName>
65
+ </args>
66
+ </sun>
67
+ </routers>
68
+ <layout>
69
+ <updates>
70
+ <sun>
71
+ <file>sun.xml</file>
72
+ </sun>
73
+ </updates>
74
+ </layout>
75
+ <translate>
76
+ <modules>
77
+ <Orbitvu_Sun>
78
+ <files>
79
+ <default>Orbitvu_Sun.csv</default>
80
+ </files>
81
+ </Orbitvu_Sun>
82
+ </modules>
83
+ </translate>
84
+ </frontend>
85
+ <adminhtml>
86
+ <translate>
87
+ <modules>
88
+ <Orbitvu_Sun>
89
+ <files>
90
+ <default>Orbitvu_Sun.csv</default>
91
+ </files>
92
+ </Orbitvu_Sun>
93
+ </modules>
94
+ </translate>
95
+ </adminhtml>
96
+ </config>
app/code/community/Orbitvu/Sun/etc/local.xml ADDED
File without changes
app/code/community/Orbitvu/Sun/etc/system.xml ADDED
@@ -0,0 +1,298 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <orbitvu translate="label">
5
+ <label>Orbitvu</label>
6
+ <tab>catalog</tab>
7
+ <frontend_type>text</frontend_type>
8
+ <sort_order>30</sort_order>
9
+ <show_in_default>1</show_in_default>
10
+ <show_in_website>1</show_in_website>
11
+ <show_in_store>1</show_in_store>
12
+ <groups>
13
+ <api translate="label">
14
+ <label>Orbitvu SUN connection settings</label>
15
+ <frontend_type>text</frontend_type>
16
+ <sort_order>100</sort_order>
17
+ <show_in_default>1</show_in_default>
18
+ <show_in_website>0</show_in_website>
19
+ <show_in_store>0</show_in_store>
20
+ <expanded>1</expanded>
21
+ <fields>
22
+ <access_token translate="label comment">
23
+ <label>License Key</label>
24
+ <comment>
25
+ <model>Orbitvu_Sun_Block_KeyComment</model>
26
+ </comment>
27
+ <frontend_type>text</frontend_type>
28
+ <sort_order>10</sort_order>
29
+ <show_in_default>1</show_in_default>
30
+ <show_in_website>0</show_in_website>
31
+ <show_in_store>0</show_in_store>
32
+ </access_token>
33
+ </fields>
34
+ </api>
35
+ <synchro>
36
+ <label>Orbitvu SUN integration</label>
37
+ <frontend_type>text</frontend_type>
38
+ <sort_order>200</sort_order>
39
+ <show_in_default>1</show_in_default>
40
+ <show_in_website>0</show_in_website>
41
+ <show_in_store>0</show_in_store>
42
+ <expanded>1</expanded>
43
+ <fields>
44
+
45
+ <auto_sync translate="label comment">
46
+ <label>Link Orbitvu SUN presentations to products automatically</label>
47
+ <comment><![CDATA[Matching (by SKU or name) Orbitvu SUN presentation will be linked to new products immediately. Once a day we will check for changes at Orbitvu SUN and link matching presentations to products.]]></comment>
48
+ <frontend_type>select</frontend_type>
49
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
50
+ <sort_order>10</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>0</show_in_website>
53
+ <show_in_store>0</show_in_store>
54
+ </auto_sync>
55
+ <auto_sync_sku translate="label comment">
56
+ <label>Update presentation SKU on Orbitvu SUN automatically</label>
57
+ <comment><![CDATA[Automatically update empty Presentation's SKU on Orbitvu SUN server when such Presentation is linked to Product.]]></comment>
58
+ <frontend_type>select</frontend_type>
59
+ <source_model>Orbitvu_Sun_Block_Syncsku</source_model>
60
+ <sort_order>20</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>0</show_in_website>
63
+ <show_in_store>0</show_in_store>
64
+ </auto_sync_sku>
65
+
66
+ </fields>
67
+ </synchro>
68
+
69
+ <items>
70
+ <label>Select what type of presentation content will be visible in store by default</label>
71
+ <frontend_type>text</frontend_type>
72
+ <sort_order>300</sort_order>
73
+ <show_in_default>1</show_in_default>
74
+ <show_in_website>0</show_in_website>
75
+ <show_in_store>0</show_in_store>
76
+ <expanded>1</expanded>
77
+ <fields>
78
+
79
+ <sync_orbittour translate="label comment">
80
+ <label>Orbittour</label>
81
+ <frontend_type>select</frontend_type>
82
+ <source_model>adminhtml/system_config_source_yesno</source_model>
83
+ <sort_order>10</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>0</show_in_website>
86
+ <show_in_store>0</show_in_store>
87
+ </sync_orbittour>
88
+ <sync_360 translate="label comment">
89
+ <label>360°</label>
90
+ <frontend_type>select</frontend_type>
91
+ <source_model>adminhtml/system_config_source_yesno</source_model>
92
+ <sort_order>20</sort_order>
93
+ <show_in_default>1</show_in_default>
94
+ <show_in_website>0</show_in_website>
95
+ <show_in_store>0</show_in_store>
96
+ </sync_360>
97
+ <sync_2d translate="label comment">
98
+ <label>2D</label>
99
+ <frontend_type>select</frontend_type>
100
+ <source_model>adminhtml/system_config_source_yesno</source_model>
101
+ <sort_order>30</sort_order>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>0</show_in_website>
104
+ <show_in_store>0</show_in_store>
105
+ </sync_2d>
106
+
107
+ </fields>
108
+ </items>
109
+
110
+ <mode>
111
+ <label>Product view - gallery behavior</label>
112
+ <frontend_type>text</frontend_type>
113
+ <sort_order>400</sort_order>
114
+ <show_in_default>1</show_in_default>
115
+ <show_in_website>0</show_in_website>
116
+ <show_in_store>0</show_in_store>
117
+ <expanded>1</expanded>
118
+ <fields>
119
+
120
+ <hover_mode translate="label comment">
121
+ <label>Mouse over mode</label>
122
+ <comment><![CDATA[Change presentation items in gallery with just mouse over instead of click.]]></comment>
123
+ <frontend_type>select</frontend_type>
124
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
125
+ <sort_order>10</sort_order>
126
+ <show_in_default>1</show_in_default>
127
+ <show_in_website>0</show_in_website>
128
+ <show_in_store>0</show_in_store>
129
+ </hover_mode>
130
+ <hover_delay translate="label comment">
131
+ <label>Mouse over delay</label>
132
+ <comment><![CDATA[Delay time before current photo will be changed.]]></comment>
133
+ <frontend_type>select</frontend_type>
134
+ <source_model>Orbitvu_Sun_Block_Delay</source_model>
135
+ <sort_order>10</sort_order>
136
+ <show_in_default>1</show_in_default>
137
+ <show_in_website>0</show_in_website>
138
+ <show_in_store>0</show_in_store>
139
+ </hover_delay>
140
+ <teaser translate="label comment">
141
+ <label>360° Presentation teaser</label>
142
+ <frontend_type>select</frontend_type>
143
+ <source_model>Orbitvu_Sun_Block_Teaser</source_model>
144
+ <sort_order>20</sort_order>
145
+ <show_in_default>1</show_in_default>
146
+ <show_in_website>0</show_in_website>
147
+ <show_in_store>0</show_in_store>
148
+ </teaser>
149
+ <html5 translate="label comment">
150
+ <label>HTML5 or Flash mode</label>
151
+ <frontend_type>select</frontend_type>
152
+ <source_model>Orbitvu_Sun_Block_Html5</source_model>
153
+ <sort_order>30</sort_order>
154
+ <show_in_default>1</show_in_default>
155
+ <show_in_website>0</show_in_website>
156
+ <show_in_store>0</show_in_store>
157
+ </html5>
158
+ <orbittour_thumbnails translate="label comment">
159
+ <label>Orbittour views visibility</label>
160
+ <frontend_type>select</frontend_type>
161
+ <source_model>Orbitvu_Sun_Block_Orbittour</source_model>
162
+ <sort_order>40</sort_order>
163
+ <show_in_default>1</show_in_default>
164
+ <show_in_website>0</show_in_website>
165
+ <show_in_store>0</show_in_store>
166
+ </orbittour_thumbnails>
167
+
168
+ </fields>
169
+ </mode>
170
+
171
+ <layout>
172
+ <label>Product view - gallery layout (edit only if you know what are you doing!)</label>
173
+ <frontend_type>text</frontend_type>
174
+ <sort_order>500</sort_order>
175
+ <show_in_default>1</show_in_default>
176
+ <show_in_website>0</show_in_website>
177
+ <show_in_store>0</show_in_store>
178
+ <expanded>0</expanded>
179
+ <fields>
180
+
181
+ <width translate="label comment">
182
+ <label>Gallery width</label>
183
+ <comment><![CDATA[Enter <strong>100%</strong> if you wan't to have responsive gallery layout (recommended)]]></comment>
184
+ <frontend_type>text</frontend_type>
185
+ <sort_order>10</sort_order>
186
+ <show_in_default>1</show_in_default>
187
+ <show_in_website>0</show_in_website>
188
+ <show_in_store>0</show_in_store>
189
+ </width>
190
+ <img_width translate="label comment">
191
+ <label>Gallery preview maximum width</label>
192
+ <comment><![CDATA[Recommended: Your layout proportion to gallery preview maximum height eg. <strong>600px</strong>]]></comment>
193
+ <frontend_type>text</frontend_type>
194
+ <sort_order>20</sort_order>
195
+ <show_in_default>1</show_in_default>
196
+ <show_in_website>0</show_in_website>
197
+ <show_in_store>0</show_in_store>
198
+ </img_width>
199
+ <img_height translate="label comment">
200
+ <label>Gallery preview maximum height</label>
201
+ <comment><![CDATA[Recommended: <strong>300px</strong>]]></comment>
202
+ <frontend_type>text</frontend_type>
203
+ <sort_order>25</sort_order>
204
+ <show_in_default>1</show_in_default>
205
+ <show_in_website>0</show_in_website>
206
+ <show_in_store>0</show_in_store>
207
+ </img_height>
208
+ <border_color translate="label comment">
209
+ <label>Gallery border color</label>
210
+ <comment><![CDATA[Recommended: <strong>#ccc</strong><br />Enter <strong>transparent</strong> if you don't want borders]]></comment>
211
+ <frontend_type>text</frontend_type>
212
+ <sort_order>30</sort_order>
213
+ <show_in_default>1</show_in_default>
214
+ <show_in_website>0</show_in_website>
215
+ <show_in_store>0</show_in_store>
216
+ </border_color>
217
+
218
+ <img_width_zoom translate="label comment">
219
+ <label>Internal zoom image width</label>
220
+ <comment><![CDATA[Recommended: <strong>1024px</strong>]]></comment>
221
+ <frontend_type>text</frontend_type>
222
+ <sort_order>60</sort_order>
223
+ <show_in_default>1</show_in_default>
224
+ <show_in_website>0</show_in_website>
225
+ <show_in_store>0</show_in_store>
226
+ </img_width_zoom>
227
+ <img_height_zoom translate="label comment">
228
+ <label>Internal zoom image height</label>
229
+ <comment><![CDATA[Recommended: <strong>768px</strong>]]></comment>
230
+ <frontend_type>text</frontend_type>
231
+ <sort_order>70</sort_order>
232
+ <show_in_default>1</show_in_default>
233
+ <show_in_website>0</show_in_website>
234
+ <show_in_store>0</show_in_store>
235
+ </img_height_zoom>
236
+
237
+ <img_width_tn translate="label comment">
238
+ <label>Thumbnail width</label>
239
+ <comment><![CDATA[Recommended: <strong>75px</strong>]]></comment>
240
+ <frontend_type>text</frontend_type>
241
+ <sort_order>80</sort_order>
242
+ <show_in_default>1</show_in_default>
243
+ <show_in_website>0</show_in_website>
244
+ <show_in_store>0</show_in_store>
245
+ </img_width_tn>
246
+ <img_height_tn translate="label comment">
247
+ <label>Thumbnail height</label>
248
+ <comment><![CDATA[Recommended: <strong>50px</strong>]]></comment>
249
+ <frontend_type>text</frontend_type>
250
+ <sort_order>90</sort_order>
251
+ <show_in_default>1</show_in_default>
252
+ <show_in_website>0</show_in_website>
253
+ <show_in_store>0</show_in_store>
254
+ </img_height_tn>
255
+ <img_tn_margin translate="label comment">
256
+ <label>Thumbnail margin</label>
257
+ <comment><![CDATA[Recommended: <strong>3px</strong>]]></comment>
258
+ <frontend_type>text</frontend_type>
259
+ <sort_order>100</sort_order>
260
+ <show_in_default>1</show_in_default>
261
+ <show_in_website>0</show_in_website>
262
+ <show_in_store>0</show_in_store>
263
+ </img_tn_margin>
264
+
265
+ <button_width translate="label comment">
266
+ <label>Button prev/next width</label>
267
+ <comment><![CDATA[Recommended: <strong>30px</strong>]]></comment>
268
+ <frontend_type>text</frontend_type>
269
+ <sort_order>110</sort_order>
270
+ <show_in_default>1</show_in_default>
271
+ <show_in_website>0</show_in_website>
272
+ <show_in_store>0</show_in_store>
273
+ </button_width>
274
+ <button_height translate="label comment">
275
+ <label>Button prev/next height</label>
276
+ <comment><![CDATA[Recommended: <strong>53px</strong>]]></comment>
277
+ <frontend_type>text</frontend_type>
278
+ <sort_order>120</sort_order>
279
+ <show_in_default>1</show_in_default>
280
+ <show_in_website>0</show_in_website>
281
+ <show_in_store>0</show_in_store>
282
+ </button_height>
283
+ <button_opacity translate="label comment">
284
+ <label>Button prev/next opacity</label>
285
+ <comment><![CDATA[1 = 100% (recommended), 0.5 = 50%, 0 = 0%]]></comment>
286
+ <frontend_type>text</frontend_type>
287
+ <sort_order>130</sort_order>
288
+ <show_in_default>1</show_in_default>
289
+ <show_in_website>0</show_in_website>
290
+ <show_in_store>0</show_in_store>
291
+ </button_opacity>
292
+ </fields>
293
+
294
+ </layout>
295
+ </groups>
296
+ </orbitvu>
297
+ </sections>
298
+ </config>
app/code/community/Orbitvu/Sun/etc/translations.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <translations>
5
+ <active>true</active>
6
+ <codepool>local</codepool>
7
+ </translations>
8
+ </modules>
9
+ </config>
app/code/community/Orbitvu/Sun/sql/sun_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Orbitvu PHP eCommerce Orbitvu DB drivers
4
+ * @Copyright: Orbitvu Sp. z o.o. is the owner of full rights to this code
5
+ *
6
+ * @For: Magento
7
+ */
8
+
9
+ /*
10
+ * Start installation
11
+ */
12
+ //$prefix = Mage::getConfig()->getTablePrefix();
13
+
14
+ $installer = $this;
15
+ $installer->startSetup();
16
+
17
+ $inc = Mage::getBaseDir('app').'/code/community/Orbitvu/Sun/controllers/OrbitvuAdmin.php';
18
+ include_once($inc);
19
+
20
+ $_Orbitvu = new OrbitvuAdmin(false);
21
+ $_Orbitvu->Install();
22
+
23
+ $installer->endSetup();
24
+ ?>
app/design/adminhtml/default/default/template/sun/orbitvu.phtml ADDED
@@ -0,0 +1,1336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ *
9
+ * From file author: I don't know is there any better way to create a layout.
10
+ * Every Magento layout is mixed with PHP code, so I will do the same.
11
+ */
12
+
13
+ $__templates = array(
14
+ //-------------------------------------------------------------------------------------------------------
15
+ 'presentation_item' =>
16
+ //-------------------------------------------------------------------------------------------------------
17
+ '
18
+ <div class="orbitvu_sun_presentation"{parameters}>
19
+ <img src="{image_path}?width=100&amp;height=80&amp;action=crop" alt="">
20
+ <div class="presentation_data">
21
+ <strong>{name}</strong><br>
22
+ '.$this->__('SKU').': <strong>{sku}</strong><br>
23
+ <div class="presentation_types">
24
+ <strong>{types}</strong>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ ',
29
+ //-------------------------------------------------------------------------------------------------------
30
+ 'magento_section_start' =>
31
+ //-------------------------------------------------------------------------------------------------------
32
+ '
33
+ <div class="entry-edit">
34
+ <div class="entry-edit-head">
35
+ <h4 class="icon-head head-edit-form fieldset-legend">{name}</h4>
36
+ </div>
37
+ <fieldset>
38
+ <legend>{name}</legend>
39
+ <div class="hor-scroll">
40
+ ',
41
+ //-------------------------------------------------------------------------------------------------------
42
+ 'magento_section_end' =>
43
+ //-------------------------------------------------------------------------------------------------------
44
+ '
45
+ </div>
46
+ </fieldset>
47
+ </div>
48
+ '
49
+
50
+ );
51
+
52
+ /*
53
+ * Get the SUN class
54
+ */
55
+ //-------------------------------------------------------------------------------------------------------
56
+ $observer = Mage::getSingleton('sun/observer');
57
+ $_Orbitvu = $observer->ExtendOrbitvu();
58
+ $orbitvu_connected = $_Orbitvu->IsConnected();
59
+ $orbitvu_demo = $_Orbitvu->IsDemo();
60
+ //-------------------------------------------------------------------------------------------------------
61
+
62
+ /*
63
+ * Get Mage requests
64
+ */
65
+ //-------------------------------------------------------------------------------------------------------
66
+ $request = Mage::app()->getRequest();
67
+ $product_id = $request->getParam('id');
68
+ //-------------------------------------------------------------------------------------------------------
69
+
70
+ /*
71
+ * Display nothing when product is not add yet
72
+ */
73
+ //-------------------------------------------------------------------------------------------------------
74
+ if (empty($product_id)) {
75
+ return '';
76
+ }
77
+ //-------------------------------------------------------------------------------------------------------
78
+
79
+ /*
80
+ * Declarations
81
+ */
82
+ //-------------------------------------------------------------------------------------------------------
83
+ $_action = $request->getParam('sun');
84
+ $_messages = array();
85
+ $cookie = Mage::getSingleton('core/cookie');
86
+ //-------------------------------------------------------------------------------------------------------
87
+ $CurrentProduct = Mage::registry('current_product');
88
+ $product_name = $CurrentProduct->getName();
89
+ $product_sku = $CurrentProduct->getSku();
90
+ //-------------------------------------------------------------------------------------------------------
91
+
92
+ /*
93
+ * Pagination
94
+ */
95
+ //-------------------------------------------------------------------------------------------------------
96
+ $OrbitvuCurrentPage = intval($request->getParam('pager_start')) > 0 ? intval($request->getParam('pager_start')) : 0;
97
+ //-------------------------------------------------------------------------------------------------------
98
+ if ($request->getParam('page_size') > 0) {
99
+ $cookie->set('page_size', $request->getParam('page_size'), time()+3600*24*7);
100
+ $OrbitvuPagerPageSize = intval($request->getParam('page_size'));
101
+ }
102
+ else if ($cookie->get('page_size') > 0) {
103
+ $OrbitvuPagerPageSize = intval($cookie->get('page_size'));
104
+ }
105
+ else {
106
+ $OrbitvuPagerPageSize = 50;
107
+ }
108
+ //-------------------------------------------------------------------------------------------------------
109
+ if ($request->getParam('sun_ordering') != '') {
110
+ $cookie->set('sun_ordering', $request->getParam('sun_ordering'), time()+3600*24*7);
111
+ $OrbitvuOrdering = $request->getParam('sun_ordering');
112
+ }
113
+ else if ($cookie->get('sun_ordering') > 0) {
114
+ $OrbitvuOrdering = $cookie->get('sun_ordering');
115
+ }
116
+ else {
117
+ $OrbitvuOrdering = '-create_date';
118
+ }
119
+ //-------------------------------------------------------------------------------------------------------
120
+ if ($request->getParam('sun_keyword')) {
121
+ $cookie->set('sun_keyword', $request->getParam('sun_keyword'), time()+3600);
122
+ $OrbitvuKeyword = $request->getParam('sun_keyword');
123
+ }
124
+ else if ($cookie->get('sun_keyword') != '') {
125
+ $OrbitvuKeyword = $cookie->get('sun_keyword');
126
+ }
127
+ else {
128
+ $OrbitvuKeyword = '';
129
+ }
130
+ //-------------------------------------------------------------------------------------------------------
131
+ if ($request->getParam('sun_keyword_reset')) {
132
+ $cookie->delete('sun_keyword');
133
+ $OrbitvuKeyword = '';
134
+ }
135
+ //-------------------------------------------------------------------------------------------------------
136
+
137
+ /*
138
+ * Actions switcher
139
+ */
140
+ //-------------------------------------------------------------------------------------------------------
141
+ if ($_action == 'set_presentation' && $request->getParam('presentation_id') > 0) {
142
+ $cur_pres = $_Orbitvu->GetPresentationsList(array('id' => intval($request->getParam('presentation_id'))));
143
+ $_Orbitvu->SynchronizeProductPresentation($product_id, intval($request->getParam('presentation_id')), $cur_pres->results[0]->name);
144
+ $_Orbitvu->SetSunPresentationSku(intval($request->getParam('presentation_id')), $product_sku, $cur_pres->results[0]->sku);
145
+ //$observer->UpdateThumbnails($product_id);
146
+
147
+ $observer->RedirectAlias('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/');
148
+ }
149
+ else if ($_action == 'unlink') {
150
+ $_Orbitvu->FreeProduct($product_id);
151
+ $observer->UpdateThumbnails($product_id);
152
+ $observer->RedirectAlias('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/message/unlinked/');
153
+ }
154
+ else if ($_action == 'update_priority' && $request->getParam('sun_item_id') > 0 && $request->getParam('sun_priority')) {
155
+ $_Orbitvu->UpdatePresentationItemPriority(
156
+ intval($request->getParam('sun_item_id')),
157
+ intval($request->getParam('sun_priority'))
158
+ );
159
+ //$observer->UpdateThumbnails($product_id);
160
+ $observer->RedirectAlias('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/');
161
+ }
162
+ else if ($_action == 'set_sku' && $request->getParam('presentation_id') > 0 && $request->getParam('sun_new_sku') != '') {
163
+ $sun_response = $_Orbitvu->SetSunPresentationSku(intval($request->getParam('presentation_id')), $request->getParam('sun_new_sku'), '', true);
164
+ if ($sun_response->error == '400') {
165
+ $_messages[] = array('error', $this->__('One of your presentations already has this SKU assigned. SKU need to be unique. Modify SKU on your SUN Server and try again.'));
166
+ }
167
+ else {
168
+ $observer->RedirectAlias('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/');
169
+ }
170
+ }
171
+ /*
172
+ * Ajax actions
173
+ */
174
+ else if ($_action == 'update_status' && $request->getParam('sun_item_id') > 0) {
175
+ if ($request->getParam('sun_status') == 'active') $sun_status = 'active';
176
+ else $sun_status = 'inactive';
177
+
178
+ $_Orbitvu->UpdatePresentationItemStatus(intval($request->getParam('sun_item_id')), $sun_status);
179
+ //$observer->UpdateThumbnails($product_id);
180
+ echo '200 OK';
181
+ exit();
182
+ //$observer->RedirectAlias('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/');
183
+ }
184
+ else if ($_action == 'update_order' && $request->getParam('sun_item_id') > 0 && $request->getParam('sun_before_item_id') > 0) {
185
+ $_Orbitvu->SwitchPresentationItemPriority(
186
+ $product_id,
187
+ intval($request->getParam('sun_item_id')),
188
+ intval($request->getParam('sun_before_item_id'))
189
+ );
190
+ //$observer->UpdateThumbnails($product_id);
191
+ echo '200 OK';
192
+ exit();
193
+ //$observer->RedirectAlias('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/');
194
+ }
195
+ //-------------------------------------------------------------------------------------------------------
196
+
197
+ /*
198
+ * Scheduled actions
199
+ */
200
+ //-------------------------------------------------------------------------------------------------------
201
+ if (date('Y-m-d', strtotime($_Orbitvu->GetConfiguration('last_refreshed'))) != date('Y-m-d') || $_action == 'synchronize_items') {
202
+ $_Orbitvu->SynchronizePresentationsItems();
203
+ }
204
+ //-------------------------------------------------------------------------------------------------------
205
+
206
+ /*
207
+ * User is connected?
208
+ */
209
+ //-------------------------------------------------------------------------------------------------------
210
+ if (!$orbitvu_connected) {
211
+ $_messages[] = array('error', $this->__('Your Orbitvu extension License Key is not valid. Please update your Key. Orbitvu extension functionality is now limited.').' <button type="button" class="orbitvu-button scalable"><a href="'.$this->getUrl('*/system_config/edit/section/orbitvu/').'" target="_blank" style="color: white; text-decoration: none;"><span style="float: left; width: 16px !important; height: 16px !important; margin: 0 5px 0 0; padding: 0; background-image: url('.Mage::getBaseUrl('media').'orbitvu/white.png'.'); background-repeat: no-repeat; background-position: -64px -108px;"></span><span>'.$this->__('Update your key').'</span></span></span></a></button>');
212
+ }
213
+ //-------------------------------------------------------------------------------------------------------
214
+
215
+ /*
216
+ * User is demo?
217
+ */
218
+ //-------------------------------------------------------------------------------------------------------
219
+ if ($orbitvu_demo) {
220
+ $_messages[] = array('error', $this->__('Orbitvu extension is connected to DEMO account. Register Orbitvu SUN FREE trial account to create your own presentations.').' <button type="button" class="orbitvu-button scalable"><a href="'.Mage::helper('adminhtml')->getUrl('*/catalog_product/index/sun/show_welcome').'" style="color: white; text-decoration: none;"><span style="float: left; width: 16px !important; height: 16px !important; margin: 0 5px 0 0; padding: 0; background-image: url('.Mage::getBaseUrl('media').'orbitvu/white.png'.'); background-repeat: no-repeat; background-position: -64px -108px;"></span><span>'.$this->__('Get free trial').'</span></span></span></a></button>');
221
+ }
222
+ //-------------------------------------------------------------------------------------------------------
223
+
224
+ /*
225
+ * User is demo?
226
+ */
227
+ //-------------------------------------------------------------------------------------------------------
228
+ if ($up = $_Orbitvu->CheckForUpdates()) {
229
+ $_messages[] = array('notice', $this->__('Version').' '.$up->new_version.' '.$this->__('of Orbitvu extension is out!').' <button type="button" class="orbitvu-button scalable"><a href="http://orbitvu.co" target="_blank" style="color: white; text-decoration: none;"><span style="float: left; width: 16px !important; height: 16px !important; margin: 0 5px 0 0; padding: 0; background-image: url('.Mage::getBaseUrl('media').'orbitvu/white.png'.'); background-repeat: no-repeat; background-position: -64px -108px;"></span><span>'.$this->__('Upgrade now from').' '.$up->version.' '.$this->__('to').' '.$up->new_version.'</span></span></span></a></button>');
230
+ }
231
+ //-------------------------------------------------
232
+
233
+ /*
234
+ * Check if product has a presentation set
235
+ */
236
+ //-------------------------------------------------------------------------------------------------------
237
+ $presentations = $_Orbitvu->GetProductPresentation($product_id);
238
+ //-------------------------------------------------------------------------------------------------------
239
+ $items_count = count($presentations['items']);
240
+ $found_match = false;
241
+ //-------------------------------------------------------------------------------------------------------
242
+
243
+ /*
244
+ * No? Find one!
245
+ */
246
+ //-------------------------------------------------------------------------------------------------------
247
+ if ($items_count == 0) {
248
+ //-------------------------------------------------------------------------------------------------------
249
+ $auto_sync = $_Orbitvu->GetConfiguration('auto_sync');
250
+ $unlinked_before = false;
251
+ //-------------------------------------------------------------------------------------------------------
252
+
253
+ /*
254
+ * Find match
255
+ */
256
+ //-------------------------------------------------------------------------------------------------------
257
+ if ($_action != 'set_show_all') {
258
+ $presentations_choose = $_Orbitvu->MatchPresentation(array(
259
+ 'product_name' => $product_name,
260
+ 'product_sku' => $product_sku
261
+ ));
262
+
263
+ /*
264
+ * Do not link again, if auto_sync
265
+ */
266
+ //-------------------------------------------------------------------------------------------------------
267
+ if ($presentations_choose->count > 0) {
268
+ //-------------------------------------------------------------------------------------------------------
269
+ $presentation_id = intval($presentations_choose->results[0]->id);
270
+ //-------------------------------------------------------------------------------------------------------
271
+ if ($_Orbitvu->IsPresentationUnlinked($product_id, $presentation_id)) {
272
+ $presentations_choose->count = 0;
273
+ $auto_sync = 'false';
274
+ $found_match = false;
275
+ $unlinked_before = true;
276
+ }
277
+ }
278
+ //-------------------------------------------------------------------------------------------------------
279
+ }
280
+ //-------------------------------------------------------------------------------------------------------
281
+
282
+ /*
283
+ * Not found? Show all
284
+ */
285
+ //-------------------------------------------------------------------------------------------------------
286
+ if ($presentations_choose->count == 0 || $_action == 'set_show_all') {
287
+ if ($_action != 'set_show_all') {
288
+ if ($unlinked_before) {
289
+ //$_messages[] = array('error', $this->__('We matched the presentation, but it was unlinked before and we don\'t link it automatically. You have to select a presentation on your own.'));
290
+ }
291
+ else {
292
+ //$_messages[] = array('error', $this->__('We did not match this product to any of your Orbitvu SUN presentations. Make sure you have identical presentation name or SKU as your product or choose one of presentations displayed below.'));
293
+ }
294
+ }
295
+ if ($request->getParam('message') == 'unlinked') {
296
+ $_messages[] = array('success', $this->__('Your presentation has been unlinked. You can select a new one below.'));
297
+ }
298
+
299
+ $sun_params = array(
300
+ 'page_size' => $OrbitvuPagerPageSize,
301
+ 'page' => $OrbitvuCurrentPage + 1,
302
+ 'ordering' => $OrbitvuOrdering
303
+ );
304
+
305
+ if (!empty($OrbitvuKeyword)) {
306
+ $sun_params['search'] = $OrbitvuKeyword;
307
+ $sun_params['page'] = 1;
308
+ }
309
+
310
+ $presentations_choose = $_Orbitvu->GetPresentationsList($sun_params);
311
+ }
312
+ //-------------------------------------------------------------------------------------------------------
313
+ /*
314
+ * Found match? Display info
315
+ */
316
+ //-------------------------------------------------------------------------------------------------------
317
+ else {
318
+ //-------------------------------------------------------------------------------------------------------
319
+ $found_match = true;
320
+ $presentation_unlinked = false;
321
+ //-------------------------------------------------------------------------------------------------------
322
+ $presentation_id = intval($presentations_choose->results[0]->id);
323
+
324
+ /*if ($_Orbitvu->IsPresentationUnlinked($product_id, $presentation_id)) {
325
+ $_messages[] = array('error', $this->__('We matched the presentation, but it was unlinked before and we don\'t set it automatically. You have to select a presentation on your own.'));
326
+ }*/
327
+ //-------------------------------------------------------------------------------------------------------
328
+
329
+ if ($auto_sync == 'true') {
330
+ //-------------------------------------------------------------------------------------------------------
331
+ if (!$_Orbitvu->IsPresentationUnlinked($product_id, $presentation_id)) {
332
+ $_Orbitvu->SynchronizeProductPresentation($product_id, $presentation_id, $presentations_choose->results[0]->name);
333
+ $_Orbitvu->SetSunPresentationSku($presentation_id, $product_sku, $presentations_choose->results[0]->sku);
334
+ //$observer->UpdateThumbnails($product_id);
335
+
336
+ $observer->RedirectAlias('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_group_tab/');
337
+ }
338
+ //-------------------------------------------------------------------------------------------------------
339
+ }
340
+ else {
341
+ //-------------------------------------------------------------------------------------------------------
342
+ $types = $_Orbitvu->GetPresentationTypes($presentations_choose->results[0]);
343
+ $new_types = array();
344
+ foreach ($types as $type) {
345
+ switch ($type) {
346
+ case '0':
347
+ $new_types[] = '<span class="orbitvu-type orbitvu-icon orbitvu-icon-type-0" title="'.$this->__('Orbittour').'"></span>';
348
+ break;
349
+ case '1':
350
+ $new_types[] = '<span class="orbitvu-type orbitvu-icon orbitvu-icon-type-1" title="'.$this->__('360&deg;').'"></span>';
351
+ break;
352
+ default:
353
+ $new_types[] = '<span class="orbitvu-type orbitvu-icon orbitvu-icon-type-3" title="'.$this->__('2D').'"></span>';
354
+ break;
355
+ }
356
+ }
357
+ $types = $new_types;
358
+ //-------------------------------------------------------------------------------------------------------
359
+ $str = $presentations_choose->results[0]->name;
360
+ if (strlen($str) > 15 ) $str = '<span title="'.Sstr.'">'.mb_substr($str, 0, 15, 'utf-8').'...</span>';
361
+ //-------------------------------------------------------------------------------------------------------
362
+ $sku = $presentations_choose->results[0]->sku;
363
+ //-------------------------------------------------------------------------------------------------------
364
+ if (!empty($sku)) {
365
+ if (strlen($sku) > 10 ) {
366
+ $sku = '<span title="'.$sku.'">'.mb_substr($sku, 0, 10, 'utf-8').'...</span>';
367
+ }
368
+ }
369
+ else {
370
+ $sku = '-';
371
+ }
372
+ //-------------------------------------------------------------------------------------------------------
373
+ $_messages[] = array('success', '<div style="clear: both; overflow: hidden; zoom: 1.0;">
374
+
375
+ '.$this->__('We used your product\'s SKU:').' "'.$product_sku.'" '.$this->__('and name:').' "'.$product_name.'" '.$this->__('to match one of your SUN presentations.').'
376
+ </div>
377
+ <div class="orbitvu_clearfix">
378
+ '.$observer->UseTemplate(array(
379
+ 'parameters' => 'onclick="OrbitvuSetAction(\'sun/set_presentation/presentation_id/'.$presentations_choose->results[0]->id.'/\');"',
380
+ 'image_path' => $presentations_choose->results[0]->thumbnail_url,
381
+ 'name' => $str,
382
+ 'sku' => $sku,
383
+ 'types' => implode('', $types)
384
+
385
+ ), $__templates['presentation_item']).'
386
+
387
+ <div style="float: left; margin: 35px 0 0 10px;">
388
+ <button type="button" class="orbitvu-button orbitvu-button-link scalable" onclick="OrbitvuSetAction(\'sun/set_presentation/presentation_id/'.$presentations_choose->results[0]->id.'/\');" style=""><span><span></span>'.$this->__('Link this presentation').'</span></button>
389
+ <div style="clear: both; overflow: hidden; zoom: 1.0; margin-top: 10px;">
390
+ <button type="button" class="orbitvu-button-ok scalable back" onclick="OrbitvuSetAction(\'sun/set_show_all/\');" style=""><span style="background-image: none; padding: 0;"><span></span>'.$this->__('Select another one').'</span></button>
391
+ </div>
392
+ </div>
393
+ </div>
394
+ ');
395
+ //-------------------------------------------------------------------------------------------------------
396
+ }
397
+ }
398
+ //-------------------------------------------------------------------------------------------------------
399
+ }
400
+ //--------------------------------------------------------------------------------------------------------------------------------------
401
+ ?>
402
+ <style type="text/css">
403
+ .orbitvu_sun_presentation, .orbitvu_sun_presentation_full { float: left; width: 250px; background: white; border: 1px solid #dedede; border-radius: 5px; margin: 10px 10px 0 0; padding: 10px; cursor: pointer; }
404
+ .orbitvu_sun_presentation_full { float: none; width: 100%; clear: both; overflow: hidden; zoom: 1.0; cursor: default; box-sizing: border-box; }
405
+ .orbitvu_sun_presentation { border: 2px solid #1CA0B3; }
406
+
407
+ .orbitvu_sun_presentation_full table { width: 100%; margin: 0; padding: 0; border: 0; }
408
+ .orbitvu_sun_presentation_full table td { padding: 0; vertical-align: top; border: 0; background: white; }
409
+ .orbitvu_sun_presentation:hover { box-shadow: 0 0 15px black; }
410
+ .orbitvu_sun_presentation.orbitvu_nohover, .orbitvu_nohover { margin: 0 0 20px 0; border-color: #dedede; box-shadow: none; cursor: default; }
411
+ .orbitvu_sun_presentation img { float: left; width: 100px; height: 80px; margin: 0 10px 0 0; border-radius: 5px; }
412
+ .orbitvu_sun_presentation .presentation_data { float: left; min-height: 80px; color: black; font-weight: normal; position: relative; }
413
+ .orbitvu_clearfix { clear: both; overflow: hidden; zoom: 1.0; }
414
+
415
+ .orbitvu-button, .orbitvu-button-disabled { border-color: #1191A6; background: #8dd5e0; background: -moz-linear-gradient(top, #8dd5e0 0%, #009cb5 45%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#8dd5e0), color-stop(45%,#009cb5)); background: -webkit-linear-gradient(top, #8dd5e0 0%,#009cb5 45%); background: -o-linear-gradient(top, #8dd5e0 0%,#009cb5 45%); background: -ms-linear-gradient(top, #8dd5e0 0%,#009cb5 45%); background: linear-gradient(to bottom, #8dd5e0 0%,#009cb5 45%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#8dd5e0', endColorstr='#009cb5',GradientType=0 ); }
416
+ .orbitvu-button:hover { background: #ddfaff; background: -moz-linear-gradient(top, #ddfaff 0%, #15adc6 59%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ddfaff), color-stop(59%,#15adc6)); background: -webkit-linear-gradient(top, #ddfaff 0%,#15adc6 59%); background: -o-linear-gradient(top, #ddfaff 0%,#15adc6 59%);background: -ms-linear-gradient(top, #ddfaff 0%,#15adc6 59%); background: linear-gradient(to bottom, #ddfaff 0%,#15adc6 59%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ddfaff', endColorstr='#15adc6',GradientType=0 ); }
417
+ .orbitvu-icon { background-image: url(<?=Mage::getBaseUrl('media')?>orbitvu/blue.png); background-repeat: no-repeat; }
418
+ .orbitvu-icon-visibility { background-position: 0 -54px; }
419
+ .orbitvu-icon-visibility.disabled { background-position: -22px -54px; }
420
+ .orbitvu-icon-type-0 { background-position: 0 -92px; }
421
+ .orbitvu-icon-type-1 { background-position: -80px -108px; }
422
+ .orbitvu-icon-type-3 { background-position: -16px -92px; }
423
+ .orbitvu-drag-container { clear: both; overflow: hidden; zoom: 1.0; padding: 10px; }
424
+ .orbitvu-drag-box { float: left; margin: 0 10px 10px 0; width: 100px; height: 100px; position: relative; border: 2px solid #1CA0B3; font-size: 10px; cursor: default; font-family: verdana, tahoma, arial; background-color: #eee; border-radius: 5px; }
425
+ #orbitvu-drag-container .orbitvu-drag-box { cursor: pointer; }
426
+ .orbitvu-drag-box.hidden { border-color: #F1D6DA; opacity: 0.7; }
427
+ .orbitvu-drag-box.drag { opacity: 0.2; }
428
+ #orbitvu-drag-container .orbitvu-drag-box:hover { border-style: dashed; }
429
+ .orbitvu-drag-box span.orbitvu-text { padding: 2px 0 2px 0; position: absolute; bottom: 0; left: 0; width: 100%; text-align: center; color: white; background: #1CA0B3; font-size: 10px; }
430
+
431
+ .orbitvu-drag-box span.orbitvu-drag-text { display: none; }
432
+ #orbitvu-drag-container .orbitvu-drag-box:hover span.orbitvu-drag-text { display: block; }
433
+ .orbitvu-drag-box span.orbitvu-hide-text { display: none; }
434
+ .orbitvu-drag-box span.orbitvu-hide-text.active { display: block; }
435
+ .orbitvu-drag-box span.orbitvu-show-text { display: none; }
436
+ .orbitvu-drag-box span.orbitvu-show-text.active { display: block; }
437
+ .orbitvu-drag-box span.orbitvu-visibility { display: block; width: 22px; height: 22px; position: absolute; top: -7px; right: -7px; background-color: white; border-radius: 8px; cursor: pointer; }
438
+ .orbitvu-drag-box span.orbitvu-visibility:hover { box-shadow: 0 0 5px black; }
439
+
440
+ .orbitvu-drag-box span.orbitvu-type { display: block; width: 16px; height: 16px; position: absolute; bottom: 2px; right: 2px; }
441
+
442
+ .orbitvu-button-sku { border-color: #CA6875; background: #e0b3b8; background: -moz-linear-gradient(top, #e0b3b8 0%, #ca4759 45%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e0b3b8), color-stop(45%,#ca4759)); background: -webkit-linear-gradient(top, #e0b3b8 0%,#ca4759 45%); background: -o-linear-gradient(top, #e0b3b8 0%,#ca4759 45%); background: -ms-linear-gradient(top, #e0b3b8 0%,#ca4759 45%); background: linear-gradient(to bottom, #e0b3b8 0%,#ca4759 45%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e0b3b8', endColorstr='#ca4759',GradientType=0 ); }
443
+ .orbitvu-button-sku:hover { background: #ffced3;background: -moz-linear-gradient(top, #ffced3 0%, #e8475d 45%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffced3), color-stop(45%,#e8475d)); background: -webkit-linear-gradient(top, #ffced3 0%,#e8475d 45%); background: -o-linear-gradient(top, #ffced3 0%,#e8475d 45%); background: -ms-linear-gradient(top, #ffced3 0%,#e8475d 45%); background: linear-gradient(to bottom, #ffced3 0%,#e8475d 45%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffced3', endColorstr='#e8475d',GradientType=0 ); }
444
+ button.orbitvu-button-sku span span,
445
+ button.orbitvu-button-edit span span,
446
+ button.orbitvu-button-sync span span,
447
+ button.orbitvu-button-unlink span span,
448
+ button.orbitvu-button-link span span,
449
+ button.orbitvu-button-ok span span,
450
+ button.orbitvu-button-cancel span span { float: left; width: 16px; height: 16px; margin: 0 4px 0 0 !important; background-image: url(<?=Mage::getBaseUrl('media')?>orbitvu/white.png) !important; background-repeat: no-repeat; }
451
+
452
+ button.orbitvu-button-sku span span { background-position: -32px -108px !important; }
453
+ button.orbitvu-button-edit span span { background-position: -48px -108px !important; }
454
+ button.orbitvu-button-sync span span { background-position: -64px -108px !important; }
455
+ button.orbitvu-button-unlink span span { background-position: -16px -108px !important; }
456
+ button.orbitvu-button-link span span { background-position: 0 -108px !important; }
457
+ button.orbitvu-button-ok span span { background-position: -32px -76px !important; background-image: url(<?=Mage::getBaseUrl('media')?>orbitvu/black.png) !important; }
458
+ button.orbitvu-button-cancel span span { background-position: -48px -76px !important; background-image: url(<?=Mage::getBaseUrl('media')?>orbitvu/black.png) !important; }
459
+ button.orbitvu-button-disabled { opacity: 0.5; cursor: default; }
460
+ button.orbitvu-button-disabled:hover, button.orbitvu-button-disabled.active { background: url("http://dev.magento.orbitvu.com/skin/adminhtml/default/default/images/btn_bg-disabled.gif") 0px 0px repeat-x #919191 !important; opacity: 0.5 !important; }
461
+ .dragstate span.orbitvu-visibility { display: none !important; }
462
+
463
+ .presentation_types { width: 80px; position: absolute; bottom: 5px; left: 0; }
464
+ .orbitvu-type { float: left; width: 16px; height: 16px; margin: 0 5px 0 0; }
465
+
466
+ .orbitvu-icon-bg { background-color: white; border: 2px solid white; border-radius: 5px; }
467
+ #orbitvu_postloader { display: none; }
468
+ #orbitvu_postloader_bg { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: 999998; background: white; opacity: 0.8; }
469
+ #orbitvu_postloader_fg { position: fixed; width: 100%; top: 0; left: 0; z-index: 999999; text-align: center; }
470
+ </style>
471
+ <div id="orbitvu_postloader">
472
+ <div id="orbitvu_postloader_bg"></div>
473
+ <div id="orbitvu_postloader_fg"><img src="<?=Mage::getBaseUrl('media')?>orbitvu/loader.gif" style="margin-top: 150px;" alt="" /></div>
474
+ </div>
475
+ <script>
476
+ window.onbeforeunload = function() {
477
+ document.getElementById('orbitvu_postloader').style.display = 'block';
478
+ }
479
+ </script>
480
+ <div class="entry-edit orbitvu_clearfix">
481
+
482
+ <?php if ($_action != 'set_show_all' && $found_match) {
483
+ echo $observer->UseTemplate(array(
484
+ 'name' => $this->__('Confirm linking matched presentation')
485
+
486
+ ), $__templates['magento_section_start']);
487
+
488
+ ?>
489
+
490
+ <?php } ?>
491
+ <input type="hidden" name="synchronize_sun" value="false" id="synchronize_sun" />
492
+ <div id="orbitvu_sun_content">
493
+ <ul class="messages">
494
+ <?php for ($i = 0, $n = count($_messages); $i < $n; $i++) { ?>
495
+ <li class="<?=$_messages[$i][0]?>-msg">
496
+ <ul>
497
+ <li>
498
+ <?=$_messages[$i][1]?>
499
+ </li>
500
+ </ul>
501
+ </li>
502
+ <?php } ?>
503
+ </ul>
504
+ </div>
505
+
506
+ </div>
507
+ <?php
508
+ //--------------------------------------------------------------------------------------------------------------------------------------
509
+ /*
510
+ * Show tabs if match not found
511
+ */
512
+ //-------------------------------------------------------------------------------------------------------------------------------------
513
+ if (!$found_match) {
514
+ ?>
515
+ <div class="grid" id="local_magento">
516
+ <?php
517
+ }
518
+ else {
519
+ ?>
520
+ <div style="display: none;">
521
+ <?php
522
+ }
523
+ //--------------------------------------------------------------------------------------------------------------------------------------
524
+ /*
525
+ * First time presentation setting
526
+ */
527
+ //--------------------------------------------------------------------------------------------------------------------------------------
528
+ if ($items_count == 0 && !$found_match) {
529
+ //--------------------------------------------------------------------------------------------------------------------------------------
530
+
531
+ if ($orbitvu_connected) {
532
+ $results = $presentations_choose->results;
533
+
534
+ $OrbitvuPager = array(
535
+ 'start' => $OrbitvuCurrentPage,
536
+ 'size' => $OrbitvuPagerPageSize,
537
+ 'all' => intval(round($presentations_choose->count / $OrbitvuPagerPageSize))
538
+ );
539
+
540
+ $OrbitvuPager['url_next'] = $this->getUrl('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/sun/set_show_all/pager_start/'.($OrbitvuPager['start'] + 1));
541
+ $OrbitvuPager['url_prev'] = $this->getUrl('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/sun/set_show_all/pager_start/'.($OrbitvuPager['start'] - 1));
542
+
543
+ //--------------------------------------------------------------------------------------------------------------------------------------
544
+ echo $observer->UseTemplate(array(
545
+ 'name' => $this->__('Select presentation from your Orbitvu SUN account to link with product').' '.$product_name
546
+ ), $__templates['magento_section_start']);
547
+ //--------------------------------------------------------------------------------------------------------------------------------------
548
+ ?>
549
+ <table cellspacing="0" class="actions" style="width: 98%; margin: 0 0 0 10px;">
550
+ <tbody>
551
+ <tr>
552
+ <td class="pager" style="width: 350px;">
553
+ <?=$this->__('Page:')?>
554
+
555
+ <?php if ($OrbitvuPager['all'] > 1 && $OrbitvuPager['start']-1 >= 0) { ?>
556
+ <a href="<?=$OrbitvuPager['url_prev']?>"><img src="/skin/adminhtml/default/default/images/pager_arrow_left.gif" alt="" class="arrow"></a>
557
+ <?php } else { ?>
558
+ <img src="/skin/adminhtml/default/default/images/pager_arrow_left_off.gif" alt="" class="arrow">
559
+ <?php } ?>
560
+
561
+ <strong><?=($OrbitvuPager['start']+1)?></strong>
562
+
563
+ <?php if ($OrbitvuPager['all'] > 1 && $OrbitvuPager['start']+1 < $OrbitvuPager['all']) { ?>
564
+ <a href="<?=$OrbitvuPager['url_next']?>"><img src="/skin/adminhtml/default/default/images/pager_arrow_right.gif" alt="" class="arrow"></a>
565
+ <?php } else { ?>
566
+ <img src="/skin/adminhtml/default/default/images/pager_arrow_right_off.gif" alt="" class="arrow">
567
+ <?php } ?>
568
+
569
+ <?=$this->__('of')?> <?=$OrbitvuPager['all']?>
570
+ <span class="separator">|</span>
571
+ <?=$this->__('Per page:')?>
572
+ <select name="pager_size" onchange="window.location.href = '<?=$this->getUrl('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/sun/set_show_all/')?>page_size/' + this.value + '/';">
573
+ <option value="20"<?=($OrbitvuPager['size'] == '20' ? ' selected="selected"' : '')?>>20</option>
574
+ <option value="30"<?=($OrbitvuPager['size'] == '30' ? ' selected="selected"' : '')?>>30</option>
575
+ <option value="50"<?=($OrbitvuPager['size'] == '50' ? ' selected="selected"' : '')?>>50</option>
576
+ <option value="100"<?=($OrbitvuPager['size'] == '100' ? ' selected="selected"' : '')?>>100</option>
577
+ <option value="200"<?=($OrbitvuPager['size'] == '200' ? ' selected="selected"' : '')?>>200</option>
578
+ </select>
579
+ <span class="separator">|</span>
580
+ <?=$this->__('Total:')?> <?=intval($presentations_choose->count)?>
581
+ </td>
582
+ <td class="filter-actions">
583
+ <div class="orbitvu_filters">
584
+ <select name="sun_ordering" style="width: 70px;" onchange="window.location.href = '<?=$this->getUrl('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/sun/set_show_all/')?>sun_ordering/' + this.value + '/';">
585
+ <option value="create_date"<?=($OrbitvuOrdering == 'create_date' ? ' selected="selected"' : '')?>><?=$this->__('Date')?> &uArr;</option>
586
+ <option value="-create_date"<?=($OrbitvuOrdering == '-create_date' ? ' selected="selected"' : '')?>><?=$this->__('Date')?> &dArr;</option>
587
+ <option value="sku"<?=($OrbitvuOrdering == 'sku' ? ' selected="selected"' : '')?>><?=$this->__('SKU')?> &uArr;</option>
588
+ <option value="-sku"<?=($OrbitvuOrdering == '-sku' ? ' selected="selected"' : '')?>><?=$this->__('SKU')?> &dArr;</option>
589
+ <option value="name"<?=($OrbitvuOrdering == 'name' ? ' selected="selected"' : '')?>><?=$this->__('Name')?> &uArr;</option>
590
+ <option value="-name"<?=($OrbitvuOrdering == '-name' ? ' selected="selected"' : '')?>><?=$this->__('Name')?> &dArr;</option>
591
+ </select>
592
+ <input type="text" name="sun_search" id="orbitvu_sun_search" placeholder="<?=$this->__('Enter presentation name or SKU...')?>"<?php
593
+ if (!empty($OrbitvuKeyword)) { echo ' value="'.$OrbitvuKeyword.'"'; }
594
+ ?> size="30" />
595
+ <button type="button" class="orbitvu-button scalable task" onclick="window.location.href = '<?=$this->getUrl('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/sun/set_show_all/')?>sun_keyword/' + document.getElementById('orbitvu_sun_search').value + '/';"><span><span><span><?=$this->__('Search')?></span></span></span></button>
596
+ <?php if (!empty($OrbitvuKeyword)) { ?>
597
+ <button type="button" class="orbitvu-button scalable task" onclick="window.location.href = '<?=$this->getUrl('*/catalog_product/edit/id/'.$product_id.'/back/edit/tab/product_info_tabs_tabid/sun/set_show_all/')?>sun_keyword_reset/true/';"><span><span><span><?=$this->__('Reset')?></span></span></span></button>
598
+ <?php } ?>
599
+ </div>
600
+ </td>
601
+ </tr>
602
+ </tbody>
603
+ </table>
604
+
605
+
606
+ <div class="orbitvu_clearfix" style="padding: 10px;">
607
+ <?php
608
+ /*
609
+ * Presentations final display
610
+ */
611
+ for ($i = 0, $n = count($results); $i < $n; $i++) {
612
+ $cur = $results[$i];
613
+
614
+ $types = $_Orbitvu->GetPresentationTypes($cur);
615
+ $new_types = array();
616
+ foreach ($types as $type) {
617
+ switch ($type) {
618
+ case '0':
619
+ $new_types[] = '<span class="orbitvu-type orbitvu-icon orbitvu-icon-type-0" title="'.$this->__('Orbittour').'"></span>';
620
+ break;
621
+ case '1':
622
+ $new_types[] = '<span class="orbitvu-type orbitvu-icon orbitvu-icon-type-1" title="'.$this->__('360&deg;').'"></span>';
623
+ break;
624
+ default:
625
+ $new_types[] = '<span class="orbitvu-type orbitvu-icon orbitvu-icon-type-3" title="'.$this->__('2D').'"></span>';
626
+ break;
627
+ }
628
+ }
629
+ $types = $new_types;
630
+
631
+ $sku = $cur->sku;
632
+ //-------------------------------------------------------------------------------------------------------
633
+ if (!empty($sku)) {
634
+ if (strlen($sku) > 10) {
635
+ $sku = '<span title="'.$sku.'">'.mb_substr($sku, 0, 10, 'utf-8').'...</span>';
636
+ }
637
+ }
638
+ else {
639
+ $sku = '-';
640
+ }
641
+ //-------------------------------------------------------------------------------------------------------
642
+ $str = $cur->name;
643
+ if (strlen($str) > 15 ) $str = mb_substr($str, 0, 15, 'utf-8').'...';
644
+ //-------------------------------------------------------------------------------------------------------
645
+ echo $observer->UseTemplate(array(
646
+ 'parameters' => 'onclick="if (confirm(\''.$this->__('Do you really want to link this presentation with current product?').'\')) { OrbitvuSetAction(\'sun/set_presentation/presentation_id/'.$cur->id.'/\'); }"',
647
+ 'image_path' => $cur->thumbnail_url,
648
+ 'name' => $str,
649
+ 'sku' => $sku,
650
+ 'types' => implode('', $types)
651
+ ), $__templates['presentation_item']);
652
+ }
653
+ ?>
654
+ </div>
655
+ <?php
656
+ }
657
+ else {
658
+ //--------------------------------------------------------------------------------------------------------------------------------------
659
+ echo $observer->UseTemplate(array(
660
+ 'name' => $product_name
661
+ ), $__templates['magento_section_start']);
662
+ //--------------------------------------------------------------------------------------------------------------------------------------
663
+ }
664
+ }
665
+ else {
666
+ /*************************************************************************************************************************************************
667
+ * Item edit
668
+ ************************************************************************************************************************************************/
669
+
670
+ $presentation_sun = $_Orbitvu->GetPresentationsList(array('id' => $presentations['orbitvu_id']));
671
+ $presentation_sun = $presentation_sun->results[0];
672
+
673
+ $sku = $presentation_sun->sku;
674
+ //-------------------------------------------------------------------------------------------------------
675
+ if (!empty($sku)) {
676
+ $sku = '<span title="'.$sku.'">'.$sku.'</span>';
677
+ }
678
+ else {
679
+ $sku = '-';
680
+ }
681
+ //--------------------------------------------------------------------------------------------------------------------------------------
682
+ echo $observer->UseTemplate(array(
683
+ 'name' => $this->__('Orbitvu SUN presentation linked to current product')
684
+ ), $__templates['magento_section_start']);
685
+ //--------------------------------------------------------------------------------------------------------------------------------------
686
+ $add_buttons = '';
687
+
688
+ $thumbnail = $presentations['items'][0]['thumbnail'];
689
+ foreach ($presentations['items'] as $item) {
690
+ if ($item['status'] == 'active') {
691
+ $thumbnail = $item['thumbnail'];
692
+ break;
693
+ }
694
+ }
695
+ ?>
696
+ <div class="orbitvu_sun_presentation_full">
697
+ <table><td><td style="width: 1%;">
698
+ <div style="position: relative;">
699
+ <img src="<?=$thumbnail?>?height=200" style="margin: 0; padding: 0; border: 1px solid #dedede; border-radius: 5px;" alt="">
700
+ <div style="position: absolute; bottom: 10px; right: 5px;">
701
+ <?php
702
+
703
+ $types = $presentations['types'];
704
+ $new_types = array();
705
+ foreach ($types as $type) {
706
+ switch ($type) {
707
+ case '0':
708
+ $new_types[] = '<span class="orbitvu-type orbitvu-icon orbitvu-icon-type-0 orbitvu-icon-bg" title="'.$this->__('Orbittour').'"></span>';
709
+ break;
710
+ case '1':
711
+ $new_types[] = '<span class="orbitvu-type orbitvu-icon orbitvu-icon-type-1 orbitvu-icon-bg" title="'.$this->__('360&deg;').'"></span>';
712
+ break;
713
+ default:
714
+ $new_types[] = '<span class="orbitvu-type orbitvu-icon orbitvu-icon-type-3 orbitvu-icon-bg" title="'.$this->__('2D').'"></span>';
715
+ break;
716
+ }
717
+ }
718
+ $types = $new_types;
719
+
720
+ print implode('', $types);
721
+ ?>
722
+ </div>
723
+ </div>
724
+ </td><td style="padding-left: 20px;">
725
+
726
+ <div class="presentation_data">
727
+ <strong style="font-size: 1.5em;"><?=$presentations['name']?></strong><br>
728
+
729
+ <?php if ($presentation_sun->sku != $product_sku) {
730
+ $update_sku = $_Orbitvu->SetSunPresentationSku($presentations['orbitvu_id'], $product_sku, $presentation_sun->sku);
731
+
732
+ if (!$update_sku && $orbitvu_connected) {
733
+
734
+ $add_buttons .= '<button type="button" class="orbitvu-button-sku scalable" onclick="if (confirm(\''.$this->__('Do you really want to update this presentation SKU on your Orbitvu SUN account?').'\')) { OrbitvuSetAction(\'sun/set_sku/presentation_id/'.$presentations['orbitvu_id'].'/sun_new_sku/'.$product_sku.'\'); }"><span><span></span>'.$this->__('Update SKU on SUN').'</span></button> ';
735
+ ?>
736
+ <strong><?=$this->__('SKU')?>:</strong> <?=$sku?><br>
737
+ <ul class="messages" style="float: left; max-width: 680px;">
738
+ <li class="error-msg">
739
+ <ul>
740
+ <li>
741
+
742
+ <?=$this->__('Product\'s SKU:')?> "<?=$product_sku?>" <?=$this->__('. Presentation\'s SKU from Orbitvu SUN:')?> <?=($sku == '-' ? '""' : '"'.$sku.'"')?>. <br /> <?=$this->__('Click "Update SKU on SUN" button below to update your presentation\'s SKU from Orbitvu SUN with:')?> "<?=$product_sku?>".
743
+ </li>
744
+ </ul>
745
+ </li>
746
+ </ul>
747
+ <?php } else if ($update_sku->error == '400') {
748
+ ?>
749
+ <strong><?=$this->__('SKU')?>:</strong> <?=$sku?><br>
750
+ <ul class="messages">
751
+
752
+ <li class="error-msg">
753
+ <ul>
754
+ <li>
755
+ <?=$this->__('We can\'t change your SUN Presentation SKU. One of your presentations already has this product SKU assigned. SKU need to be unique. Modify SKU on your SUN Server.')?>
756
+ </li>
757
+ </ul>
758
+ </li>
759
+
760
+ </ul>
761
+
762
+
763
+ <?php
764
+
765
+ }
766
+
767
+ else { ?>
768
+ <strong><?=$this->__('SKU')?>:</strong> <?=$product_sku?><br>
769
+ <?php
770
+ }
771
+ }
772
+ else { ?>
773
+ <strong><?=$this->__('SKU')?>:</strong> <?=$sku?><br>
774
+ <?php } ?>
775
+ <div class="orbitvu_clearfix" style="padding-top: 10px;">
776
+ <?=$add_buttons?>
777
+ <button type="button" class="orbitvu-button orbitvu-button-unlink scalable" onclick="if (confirm('<?=$this->__('Do you really want to unlink this presentation?')?>')) { OrbitvuSetAction('sun/unlink/'); }"><span><span></span><?=$this->__('Unlink this presentation')?></span></button>
778
+
779
+ <button type="button" class="orbitvu-button orbitvu-button-sync scalable" onclick="SynchronizeSunItems();"><span><span></span><?=$this->__('Synchronize with SUN')?></span></button>
780
+
781
+ <?php if ($orbitvu_connected && !$orbitvu_demo) { ?><button type="button" class="orbitvu-button orbitvu-button-edit scalable"><span><span></span><a href="<?=$presentation_sun->edit_url?>" target="_blank" style="color: white; text-decoration: none;"><?=$this->__('Edit on SUN')?></a></span></button> <?php } else { ?><button type="button" class="orbitvu-button-edit scalable disabled orbitvu-button-disabled" disabled="disabled"><span style="padding-left: 0; background: none;"><span></span><?=$this->__('Edit on SUN')?></span></button>
782
+ <?php } ?> </div>
783
+ </div>
784
+
785
+ </td></tr></table>
786
+
787
+ <div id="<?=($items_count > 1 ? 'orbitvu-drag-container' : '')?>" class="orbitvu-drag-container" history="History1" style="border-top: 1px solid #dedede;">
788
+ <?php
789
+ for ($i = 0; $i < $items_count; $i++) {
790
+ $items = $presentations['items'][$i];
791
+
792
+ $display_id = $items['id'];
793
+ ?>
794
+ <div class="orbitvu-drag-box<?=($items['status'] == 'inactive' ? ' hidden' : '')?>" id="orbitvu-gallery-item-<?=$display_id?>" style="background: white url(<?=$items['thumbnail']?>?width=100) center center no-repeat;">
795
+
796
+ <span class="orbitvu-icon orbitvu-type orbitvu-icon-type-<?=$items['type']?>" title="<?php
797
+ switch ($items['type']) {
798
+ case '0': echo $this->__('Orbittour'); break;
799
+ case '1': echo $this->__('360&deg;'); break;
800
+ default: echo $this->__('2D'); break;
801
+ }
802
+ ?>"></span>
803
+
804
+ <span class="orbitvu-text orbitvu-drag-text">
805
+ <?=$this->__('Drag &amp; move item')?>
806
+ </span>
807
+
808
+ <span class="orbitvu-text orbitvu-hide-text" id="orbitvu-text-hide-<?=$display_id?>">
809
+ <?=$this->__('Hide item')?>
810
+ </span>
811
+
812
+ <span class="orbitvu-text orbitvu-show-text" id="orbitvu-text-show-<?=$display_id?>">
813
+ <?=$this->__('Show item')?>
814
+ </span>
815
+
816
+
817
+
818
+ <span class="orbitvu-visibility orbitvu-icon orbitvu-icon-visibility<?=($items['status'] == 'inactive' ? ' disabled' : '')?>" id="orbitvu-visibility-trigger-<?=$display_id?>"></span>
819
+ </div>
820
+ <?php } ?>
821
+ </div>
822
+
823
+ </div>
824
+ <script>
825
+ function orbitvu_ajax(file, func) {
826
+ var obj = null;
827
+ if (window.XMLHttpRequest) obj = new XMLHttpRequest();
828
+ else if (window.ActiveXObject) obj = new ActiveXObject('Microsoft.XMLHTTP');
829
+ else return false;
830
+
831
+ obj.onreadystatechange = function() {
832
+ if (this.readyState == 4) func(this.responseText);
833
+ };
834
+ obj.open('GET', file, true);
835
+ obj.send(null);
836
+ }
837
+
838
+ function orbitvu_drag_start() {
839
+ var elems = document.getElementsByClassName('orbitvu-drag-box');
840
+
841
+ for (var i = 0, n = elems.length; i < n; i++) {
842
+ elems[i].className += ' drag';
843
+ }
844
+ }
845
+
846
+ function orbitvu_drag_end() {
847
+ var elems = document.getElementsByClassName('orbitvu-drag-box');
848
+
849
+ for (var i = 0, n = elems.length; i < n; i++) {
850
+ elems[i].className = elems[i].className.replace(' drag', '');
851
+ }
852
+ }
853
+
854
+ var elems = document.getElementsByClassName('orbitvu-visibility');
855
+
856
+ for (var i = 0, n = elems.length; i < n; i++) {
857
+ elems[i].onmouseover = function() {
858
+ var this_id = parseInt(this.id.replace('orbitvu-visibility-trigger-', ''));
859
+
860
+ if (this.className.replace(' disabled', '') != this.className) {
861
+ document.getElementById('orbitvu-text-show-' + this_id).className += ' active';
862
+ document.getElementById('orbitvu-text-hide-' + this_id).className = document.getElementById('orbitvu-text-hide-' + this_id).className.replace(' active', '');
863
+ }
864
+ else {
865
+ document.getElementById('orbitvu-text-hide-' + this_id).className += ' active';
866
+ document.getElementById('orbitvu-text-show-' + this_id).className = document.getElementById('orbitvu-text-show-' + this_id).className.replace(' active', '');
867
+ }
868
+ }
869
+
870
+ elems[i].onmouseout = function() {
871
+ var this_id = parseInt(this.id.replace('orbitvu-visibility-trigger-', ''));
872
+
873
+ document.getElementById('orbitvu-text-hide-' + this_id).className = document.getElementById('orbitvu-text-hide-' + this_id).className.replace(' active', '');
874
+ document.getElementById('orbitvu-text-show-' + this_id).className = document.getElementById('orbitvu-text-show-' + this_id).className.replace(' active', '');
875
+ }
876
+
877
+ elems[i].onclick = function() {
878
+ var this_id = parseInt(this.id.replace('orbitvu-visibility-trigger-', ''));
879
+
880
+ if (this.className.replace(' disabled', '') != this.className) {
881
+ this.className = this.className.replace(' disabled', '');
882
+ document.getElementById('orbitvu-gallery-item-' + this_id).className = document.getElementById('orbitvu-gallery-item-' + this_id).className.replace(' hidden', '');
883
+
884
+ orbitvu_ajax('<?=$this->getUrl('*/catalog_product/edit/')?>id/<?=$product_id?>/back/edit/sun/update_status/sun_item_id/' + this_id + '/sun_status/active', function(odp){});
885
+ }
886
+ else {
887
+ this.className += ' disabled';
888
+ document.getElementById('orbitvu-gallery-item-' + this_id).className += ' hidden';
889
+
890
+ orbitvu_ajax('<?=$this->getUrl('*/catalog_product/edit/')?>id/<?=$product_id?>/back/edit/sun/update_status/sun_item_id/' + this_id, function(odp){});
891
+ }
892
+ }
893
+ }
894
+ var orbitvu_mouse_offset = null;
895
+ var orbitvu_i_mouse_down = false;
896
+ var orbitvu_l_mouse_state = false;
897
+ var orbitvu_drag_object = null;
898
+ var orbitvu_drag_drops = [];
899
+ var OrbitvuCurrentTarget = null;
900
+ var OrbitvuLastTarget = null;
901
+ var OrbitvuDragTemp = null;
902
+ var OrbitvuTempDiv = null;
903
+ var OrbitvuRootParent = null;
904
+ var OrbitvuRootSibling = null;
905
+ var orbitvu_final_node, orbitvu_final_item_id;
906
+ var OrbitvuD1Target = null;
907
+
908
+ Number.prototype.NaN0 = function() {
909
+ return isNaN(this) ? 0 : this;
910
+ }
911
+
912
+ function orbitvu_create_drag_container() {
913
+
914
+ var cDrag = orbitvu_drag_drops.length;
915
+ orbitvu_drag_drops[cDrag] = [];
916
+
917
+
918
+ for (var i = 0; i < arguments.length; i++) {
919
+ var cObj = arguments[i];
920
+ orbitvu_drag_drops[cDrag].push(cObj);
921
+ cObj.setAttribute('DropObj', cDrag);
922
+
923
+
924
+ for (var j = 0; j < cObj.childNodes.length; j++) {
925
+
926
+
927
+ if (cObj.childNodes[j].nodeName == '#text')
928
+ continue;
929
+
930
+ cObj.childNodes[j].setAttribute('DragObj', cDrag);
931
+ }
932
+ }
933
+ }
934
+
935
+ function orbitvu_get_position(e) {
936
+ var left = 0;
937
+ var top = 0;
938
+ while (e.offsetParent) {
939
+ left += e.offsetLeft + (e.currentStyle ? (parseInt(e.currentStyle.borderLeftWidth)).NaN0() : 0);
940
+ top += e.offsetTop + (e.currentStyle ? (parseInt(e.currentStyle.borderTopWidth)).NaN0() : 0);
941
+ e = e.offsetParent;
942
+ }
943
+
944
+
945
+ left += e.offsetLeft + (e.currentStyle ? (parseInt(e.currentStyle.borderLeftWidth)).NaN0() : 0);
946
+ top += e.offsetTop + (e.currentStyle ? (parseInt(e.currentStyle.borderTopWidth)).NaN0() : 0);
947
+
948
+ return {x: left, y: top};
949
+
950
+ }
951
+
952
+ function orbitvu_mouse_coords(ev) {
953
+ if (ev.pageX || ev.pageY) {
954
+ return {x: ev.pageX, y: ev.pageY};
955
+ }
956
+ return {
957
+ x: ev.clientX + document.body.scrollLeft - document.body.clientLeft,
958
+ y: ev.clientY + document.body.scrollTop - document.body.clientTop
959
+ };
960
+ }
961
+
962
+ function orbitvu_log(object, message) {
963
+ if (!object || !object.parentNode || !object.parentNode.getAttribute)
964
+ return;
965
+ //console.log(object.id + ': ' + message);
966
+ }
967
+
968
+ function orbitvu_get_mouse_offset(target, ev) {
969
+ ev = ev || window.event;
970
+
971
+ var docPos = orbitvu_get_position(target);
972
+ var mousePos = orbitvu_mouse_coords(ev);
973
+ return {x: mousePos.x - docPos.x, y: mousePos.y - docPos.y};
974
+ }
975
+
976
+ function orbitvu_mouse_move(ev) {
977
+ ev = ev || window.event;
978
+
979
+
980
+ var target = ev.target || ev.srcElement;
981
+ var mousePos = orbitvu_mouse_coords(ev);
982
+
983
+
984
+
985
+ if (OrbitvuLastTarget && (target !== OrbitvuLastTarget)) {
986
+ orbitvu_log(OrbitvuLastTarget, 'Mouse Out Fired');
987
+
988
+
989
+ var origClass = OrbitvuLastTarget.getAttribute('origClass');
990
+ if (origClass)
991
+ OrbitvuLastTarget.className = origClass;
992
+ }
993
+
994
+
995
+ var dragObj = target.getAttribute('DragObj');
996
+
997
+
998
+ if (dragObj != null) {
999
+
1000
+
1001
+ if (target != OrbitvuLastTarget) {
1002
+ orbitvu_log(target, 'Mouse Over Fired');
1003
+
1004
+ var oClass = target.getAttribute('overClass');
1005
+ if (oClass) {
1006
+ target.setAttribute('origClass', target.className);
1007
+ target.className = oClass;
1008
+ }
1009
+ }
1010
+
1011
+
1012
+ if (orbitvu_i_mouse_down && !orbitvu_l_mouse_state) {
1013
+ orbitvu_log(target, 'Start Dragging');
1014
+
1015
+
1016
+ OrbitvuCurrentTarget = target;
1017
+
1018
+
1019
+ OrbitvuRootParent = OrbitvuCurrentTarget.parentNode;
1020
+ OrbitvuRootSibling = OrbitvuCurrentTarget.nextSibling;
1021
+
1022
+ orbitvu_mouse_offset = orbitvu_get_mouse_offset(target, ev);
1023
+
1024
+
1025
+ for (var i = 0; i < OrbitvuDragTemp.childNodes.length; i++)
1026
+ OrbitvuDragTemp.removeChild(OrbitvuDragTemp.childNodes[i]);
1027
+
1028
+
1029
+ OrbitvuDragTemp.appendChild(OrbitvuCurrentTarget.cloneNode(true));
1030
+ //OrbitvuDragTemp.style.display = 'block';
1031
+
1032
+
1033
+ var dragClass = OrbitvuCurrentTarget.getAttribute('dragClass');
1034
+ if (dragClass) {
1035
+ OrbitvuDragTemp.firstChild.className = dragClass;
1036
+ }
1037
+
1038
+
1039
+ OrbitvuDragTemp.firstChild.removeAttribute('DragObj');
1040
+
1041
+
1042
+ var dragConts = orbitvu_drag_drops[dragObj];
1043
+
1044
+
1045
+ OrbitvuCurrentTarget.setAttribute('startWidth', parseInt(OrbitvuCurrentTarget.offsetWidth));
1046
+ OrbitvuCurrentTarget.setAttribute('startHeight', parseInt(OrbitvuCurrentTarget.offsetHeight));
1047
+ OrbitvuCurrentTarget.style.display = 'none';
1048
+
1049
+ for (var i = 0; i < dragConts.length; i++) {
1050
+ with (dragConts[i]) {
1051
+ var pos = orbitvu_get_position(dragConts[i]);
1052
+
1053
+
1054
+ setAttribute('startWidth', parseInt(offsetWidth));
1055
+ setAttribute('startHeight', parseInt(offsetHeight));
1056
+ setAttribute('startLeft', pos.x);
1057
+ setAttribute('startTop', pos.y);
1058
+ }
1059
+
1060
+
1061
+ for (var j = 0; j < dragConts[i].childNodes.length; j++) {
1062
+ with (dragConts[i].childNodes[j]) {
1063
+ if ((nodeName == '#text') || (dragConts[i].childNodes[j] == OrbitvuCurrentTarget))
1064
+ continue;
1065
+
1066
+ var pos = orbitvu_get_position(dragConts[i].childNodes[j]);
1067
+
1068
+
1069
+ setAttribute('startWidth', parseInt(offsetWidth));
1070
+ setAttribute('startHeight', parseInt(offsetHeight));
1071
+ setAttribute('startLeft', pos.x);
1072
+ setAttribute('startTop', pos.y);
1073
+ }
1074
+ }
1075
+ }
1076
+ }
1077
+ }
1078
+
1079
+
1080
+ if (OrbitvuCurrentTarget) {
1081
+
1082
+ OrbitvuDragTemp.style.top = mousePos.y - orbitvu_mouse_offset.y;
1083
+ OrbitvuDragTemp.style.left = mousePos.x - orbitvu_mouse_offset.x;
1084
+
1085
+ var dragConts = orbitvu_drag_drops[OrbitvuCurrentTarget.getAttribute('DragObj')];
1086
+ var activeCont = null;
1087
+
1088
+ var xPos = mousePos.x - orbitvu_mouse_offset.x + (parseInt(OrbitvuCurrentTarget.getAttribute('startWidth')) / 2);
1089
+ var yPos = mousePos.y - orbitvu_mouse_offset.y + (parseInt(OrbitvuCurrentTarget.getAttribute('startHeight')) / 2);
1090
+
1091
+
1092
+ for (var i = 0; i < dragConts.length; i++) {
1093
+ with (dragConts[i]) {
1094
+ if ((parseInt(getAttribute('startLeft')) < xPos) &&
1095
+ (parseInt(getAttribute('startTop')) < yPos) &&
1096
+ ((parseInt(getAttribute('startLeft')) + parseInt(getAttribute('startWidth'))) > xPos) &&
1097
+ ((parseInt(getAttribute('startTop')) + parseInt(getAttribute('startHeight'))) > yPos)) {
1098
+
1099
+
1100
+ activeCont = dragConts[i];
1101
+
1102
+
1103
+ break;
1104
+ }
1105
+ }
1106
+ }
1107
+
1108
+
1109
+ if (activeCont) {
1110
+ if (activeCont != OrbitvuCurrentTarget.parentNode) {
1111
+ orbitvu_log(OrbitvuCurrentTarget, 'Moved into ' + activeCont.id);
1112
+ }
1113
+
1114
+
1115
+ var beforeNode = null;
1116
+
1117
+
1118
+ for (var i = activeCont.childNodes.length - 1; i >= 0; i--) {
1119
+ with (activeCont.childNodes[i]) {
1120
+ if (nodeName == '#text')
1121
+ continue;
1122
+
1123
+
1124
+ if (OrbitvuCurrentTarget != activeCont.childNodes[i] &&
1125
+ ((parseInt(getAttribute('startLeft')) + parseInt(getAttribute('startWidth'))) > xPos) &&
1126
+ ((parseInt(getAttribute('startTop')) + parseInt(getAttribute('startHeight'))) > yPos)) {
1127
+ beforeNode = activeCont.childNodes[i];
1128
+ }
1129
+ }
1130
+ }
1131
+
1132
+
1133
+ if (beforeNode) {
1134
+ if (beforeNode != OrbitvuCurrentTarget.nextSibling) {
1135
+ orbitvu_log(OrbitvuCurrentTarget, 'Ajax action -> Insert before ' + beforeNode.id);
1136
+ orbitvu_final_item_id = OrbitvuCurrentTarget.id;
1137
+ orbitvu_final_node = beforeNode.id;
1138
+ activeCont.insertBefore(OrbitvuCurrentTarget, beforeNode);
1139
+ }
1140
+
1141
+
1142
+ } else {
1143
+ if ((OrbitvuCurrentTarget.nextSibling) || (OrbitvuCurrentTarget.parentNode != activeCont)) {
1144
+ orbitvu_log(OrbitvuCurrentTarget, 'Inserted at end of ' + activeCont.id);
1145
+
1146
+ activeCont.appendChild(OrbitvuCurrentTarget);
1147
+ }
1148
+ }
1149
+
1150
+
1151
+ setTimeout(function() {
1152
+ var contPos = orbitvu_get_position(activeCont);
1153
+ activeCont.setAttribute('startWidth', parseInt(activeCont.offsetWidth));
1154
+ activeCont.setAttribute('startHeight', parseInt(activeCont.offsetHeight));
1155
+ activeCont.setAttribute('startLeft', contPos.x);
1156
+ activeCont.setAttribute('startTop', contPos.y);
1157
+ }, 5);
1158
+
1159
+
1160
+ if (OrbitvuCurrentTarget.style.display != '') {
1161
+ orbitvu_log(OrbitvuCurrentTarget, 'Made Visible');
1162
+ orbitvu_drag_start();
1163
+ OrbitvuCurrentTarget.style.display = '';
1164
+ OrbitvuCurrentTarget.className += ' dragstate';
1165
+ OrbitvuCurrentTarget.style.opacity = '1';
1166
+ OrbitvuCurrentTarget.style.cursor = 'move';
1167
+ OrbitvuCurrentTarget.style.borderStyle = 'dashed';
1168
+ OrbitvuCurrentTarget.style.boxShadow = '0 0 15px black';
1169
+ }
1170
+ } else {
1171
+
1172
+
1173
+ if (OrbitvuCurrentTarget.style.display != 'none') {
1174
+ orbitvu_log(OrbitvuCurrentTarget, 'Hidden');
1175
+ OrbitvuCurrentTarget.style.display = 'none';
1176
+ }
1177
+ }
1178
+ }
1179
+
1180
+
1181
+ orbitvu_l_mouse_state = orbitvu_i_mouse_down;
1182
+
1183
+
1184
+ OrbitvuLastTarget = target;
1185
+
1186
+
1187
+ if (orbitvu_drag_object) {
1188
+ orbitvu_drag_object.style.position = 'absolute';
1189
+ orbitvu_drag_object.style.top = mousePos.y - orbitvu_mouse_offset.y;
1190
+ orbitvu_drag_object.style.left = mousePos.x - orbitvu_mouse_offset.x;
1191
+ }
1192
+
1193
+
1194
+ orbitvu_l_mouse_state = orbitvu_i_mouse_down;
1195
+
1196
+
1197
+ if (OrbitvuCurrentTarget || orbitvu_drag_object)
1198
+ return false;
1199
+ }
1200
+
1201
+ function orbitvu_mouse_up(ev) {
1202
+
1203
+
1204
+ if (OrbitvuCurrentTarget) {
1205
+ orbitvu_log(OrbitvuCurrentTarget, 'Mouse Up Fired');
1206
+ orbitvu_log(OrbitvuCurrentTarget, 'orbitvu_final_item_id: ' + orbitvu_final_item_id + ' / orbitvu_final_node: ' + orbitvu_final_node + ' / final_target: ' + OrbitvuLastTarget.id);
1207
+
1208
+ orbitvu_ajax('<?=$this->getUrl('*/catalog_product/edit/')?>id/<?=$product_id?>/back/edit/sun/update_order/sun_item_id/' + parseInt(orbitvu_final_item_id.replace('orbitvu-gallery-item-', '')) + '/sun_before_item_id/' + parseInt(orbitvu_final_node.replace('orbitvu-gallery-item-', '')), function(odp){});
1209
+
1210
+ OrbitvuDragTemp.style.display = 'none';
1211
+ if (OrbitvuCurrentTarget.style.display == 'block') {
1212
+ if (OrbitvuRootSibling) {
1213
+ OrbitvuRootParent.insertBefore(OrbitvuCurrentTarget, OrbitvuRootSibling);
1214
+ } else {
1215
+ OrbitvuRootParent.appendChild(OrbitvuCurrentTarget);
1216
+ }
1217
+ }
1218
+ orbitvu_drag_end();
1219
+ OrbitvuCurrentTarget.style.display = '';
1220
+ OrbitvuCurrentTarget.style.opacity = '';
1221
+ OrbitvuCurrentTarget.style.cursor = '';
1222
+ OrbitvuCurrentTarget.style.borderStyle = '';
1223
+ OrbitvuCurrentTarget.style.boxShadow = '';
1224
+ OrbitvuCurrentTarget.className = OrbitvuCurrentTarget.className.replace(' dragstate','');
1225
+ }
1226
+ OrbitvuCurrentTarget = null;
1227
+
1228
+
1229
+ orbitvu_drag_object = null;
1230
+
1231
+ orbitvu_i_mouse_down = false;
1232
+ }
1233
+
1234
+ function orbitvu_mouse_down(ev) {
1235
+ ev = ev || window.event;
1236
+ var target = ev.target || ev.srcElement;
1237
+
1238
+ orbitvu_i_mouse_down = true;
1239
+
1240
+ if (OrbitvuLastTarget) {
1241
+ orbitvu_log(OrbitvuLastTarget, 'Mouse Down Fired');
1242
+ }
1243
+
1244
+ if (target.onmousedown || target.getAttribute('DragObj')) {
1245
+ return false;
1246
+ }
1247
+ }
1248
+
1249
+ function orbitvu_make_draggable(item) {
1250
+ if (!item)
1251
+ return;
1252
+ item.onmousedown = function(ev) {
1253
+ orbitvu_drag_object = this;
1254
+ orbitvu_mouse_offset = orbitvu_get_mouse_offset(this, ev);
1255
+ return false;
1256
+ }
1257
+ }
1258
+
1259
+ function orbitvu_make_clickable(item) {
1260
+ if (!item)
1261
+ return;
1262
+ item.onmousedown = function(ev) {
1263
+ document.getElementById('ClickImage').value = this.name;
1264
+ }
1265
+ }
1266
+
1267
+ function orbitvu_add_drop_target(item, target) {
1268
+ item.setAttribute('droptarget', target);
1269
+ }
1270
+
1271
+ if (document.getElementById('orbitvu-drag-container')) {
1272
+ document.onmousemove = orbitvu_mouse_move;
1273
+ document.onmousedown = orbitvu_mouse_down;
1274
+ document.onmouseup = orbitvu_mouse_up;
1275
+
1276
+ orbitvu_create_drag_container(document.getElementById('orbitvu-drag-container'));
1277
+
1278
+ OrbitvuDragTemp = document.createElement('DIV');
1279
+ OrbitvuDragTemp.style.cssText = 'position:absolute;display:none;';
1280
+
1281
+ document.body.appendChild(OrbitvuDragTemp);
1282
+ }
1283
+ </script>
1284
+
1285
+
1286
+
1287
+
1288
+ </div>
1289
+
1290
+
1291
+ <?php } ?>
1292
+
1293
+ <?php
1294
+
1295
+ //--------------------------------------------------------------------------------------------------------------------------------------
1296
+ echo $observer->UseTemplate(array(), $__templates['magento_section_end']);
1297
+ //--------------------------------------------------------------------------------------------------------------------------------------
1298
+
1299
+ ?>
1300
+
1301
+ <div style="text-align: right;">
1302
+ <button type="button" class="orbitvu-button scalable"><a href="<?=$this->getUrl('*/system_config/edit/section/orbitvu/')?>" target="_blank" style="color: white; text-decoration: none;"><span style="float: left; width: 16px !important; height: 16px !important; margin: 0 5px 0 0; padding: 0; background-image: url(<?=Mage::getBaseUrl('media').'orbitvu/white.png'?>); background-repeat: no-repeat; background-position: -64px -108px;"></span><span><?=$this->__('Orbitvu Configuration')?></span></span></span></a></button>
1303
+ </div>
1304
+
1305
+ <script>
1306
+ function SynchronizeSun() {
1307
+ document.getElementById('synchronize_sun').value = 'true';
1308
+ productForm.submit();
1309
+ }
1310
+ <?php
1311
+ $ex = explode('index.php', $_SERVER['REQUEST_URI']);
1312
+ $http_host = str_replace('//', '/', $ex[0]);
1313
+ ?>
1314
+ function RefreshSun() {
1315
+ saveAndContinueEdit('<?=$this->getUrl('*/catalog_product/save/back/edit/')?>tab/{{tab_id}}/id/<?=$product_id?>/');
1316
+ }
1317
+
1318
+ function SynchronizeSunItems() {
1319
+ saveAndContinueEdit('<?=$this->getUrl('*/catalog_product/save/back/edit/sun/synchronize_items/')?>tab/{{tab_id}}/id/<?=$product_id?>/');
1320
+ }
1321
+
1322
+ function OrbitvuSetAction(act) {
1323
+ window.location.href = '<?=$this->getUrl('*/catalog_product/edit/')?>id/<?=$product_id?>/back/edit/tab/' + product_info_tabsJsTabs.activeTab.id + '/' + act;
1324
+ }
1325
+ </script>
1326
+ <?php
1327
+ /*************************************************************************************************************************************************
1328
+ * Scheduled actions
1329
+ *************************************************************************************************************************************************/
1330
+ if ($_Orbitvu->GetConfiguration('auto_sync') == 'true') {
1331
+ if (date('Y-m-d', strtotime($_Orbitvu->GetConfiguration('last_updated'))) != date('Y-m-d')) {
1332
+ $observer->SynchronizeAllProducts();
1333
+ }
1334
+ }
1335
+
1336
+ ?>
app/design/frontend/base/default/layout/sun.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Orbitvu
5
+ * @package Orbitvu_Sun
6
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
7
+ * @license http://www.orbitvu.com/plugins/license
8
+ * @version 1.0.0
9
+ */
10
+ -->
11
+ <layout version="1.0">
12
+ <catalog_product_view>
13
+ <reference name="product.info.media">
14
+ <action method="setTemplate"><name>orbitvu/product/view/media.phtml</name></action>
15
+ </reference>
16
+ </catalog_product_view>
17
+ </layout>
app/design/frontend/base/default/template/orbitvu/product/view/media.phtml ADDED
@@ -0,0 +1,924 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Orbitvu
4
+ * @package Orbitvu_Sun
5
+ * @copyright Copyright (C) 2014 Orbitvu (http://www.orbitvu.com)
6
+ * @license http://www.orbitvu.com/plugins/license
7
+ * @version 1.0.0
8
+ */
9
+
10
+ //-------------------------------------------------------------------------------------------------------
11
+ $_product = $this->getProduct();
12
+ $_helper = $this->helper('catalog/output');
13
+ //-------------------------------------------------------------------------------------------------------
14
+ $jspreloader = array();
15
+ $jspreloader_tn = array();
16
+ $thumbs_list = array();
17
+ $images_list = array();
18
+ //-------------------------------------------------------------------------------------------------------
19
+ $observer = \Mage::getSingleton('sun/observer');
20
+ $_Orbitvu = $observer->ExtendOrbitvu();
21
+ //-------------------------------------------------------------------------------------------------------
22
+ /*
23
+ * Gallery theme
24
+ */
25
+ $_orbitvu_gallery = array(
26
+ 'width' => $_Orbitvu->GetConfiguration('width'),
27
+ 'img_height' => $_Orbitvu->GetConfiguration('img_height'),
28
+ 'border_color' => $_Orbitvu->GetConfiguration('border_color'),
29
+ 'img_width_zoom' => $_Orbitvu->GetConfiguration('img_width_zoom'),
30
+ 'img_height_zoom' => $_Orbitvu->GetConfiguration('img_height_zoom'),
31
+ 'img_width_tn' => $_Orbitvu->GetConfiguration('img_width_tn'),
32
+ 'img_height_tn' => $_Orbitvu->GetConfiguration('img_height_tn'),
33
+ 'img_tn_margin' => $_Orbitvu->GetConfiguration('img_tn_margin'),
34
+ 'button_width' => $_Orbitvu->GetConfiguration('button_width'),
35
+ 'button_height' => $_Orbitvu->GetConfiguration('button_height'),
36
+ 'button_opacity' => $_Orbitvu->GetConfiguration('button_opacity'),
37
+ 'img_width' => $_Orbitvu->GetConfiguration('img_width'),
38
+ );
39
+ $_orbitvu_gallery['height'] = (str_replace('px', '', $_orbitvu_gallery['img_height']) + str_replace('px', '', $_orbitvu_gallery['img_height_tn'] + 2) + (3 * str_replace('px', '', $_orbitvu_gallery['img_tn_margin']))).'px';
40
+ $_orbitvu_gallery['img_width_tn_marg'] = (str_replace('px', '', $_orbitvu_gallery['img_width_tn']) + str_replace('px', '', $_orbitvu_gallery['img_tn_margin'])).'px';
41
+ $_orbitvu_gallery['img_height_tn_marg'] = (str_replace('px', '', $_orbitvu_gallery['img_height_tn']) + str_replace('px', '', $_orbitvu_gallery['img_tn_margin'])).'px';
42
+ //-------------------------------------------------------------------------------------------------------
43
+ /*
44
+ * Get original product images
45
+ */
46
+ foreach ($this->getGalleryImages() as $_image) {
47
+ $current_array = array();
48
+ // original image
49
+ //-------------------------------------------------------------------------------------------------------
50
+ $this_url = $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile());
51
+ $thumbs_list[] = (string)$this_url;
52
+ $jspreloader[] = '\''.((string)$this_url).'\'';
53
+ $current_array['path'] = (string)$this_url;
54
+ //-------------------------------------------------------------------------------------------------------
55
+ // thumbnail 538x300
56
+ //-------------------------------------------------------------------------------------------------------
57
+ $this_url_tn = $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(str_replace('px', '', $_orbitvu_gallery['img_width']), str_replace('px', '', $_orbitvu_gallery['img_height']));
58
+ $jspreloader_tn[] = '\''.((string)$this_url_tn).'\'';
59
+ $current_array['path_tn'] = (string)$this_url_tn;
60
+ //-------------------------------------------------------------------------------------------------------
61
+ // thumbnail 75x75
62
+ //-------------------------------------------------------------------------------------------------------
63
+ $this_url_tn2 = $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(str_replace('px', '', $_orbitvu_gallery['img_width_tn']), str_replace('px', '', $_orbitvu_gallery['img_height_tn']));
64
+ $current_array['path_tn2'] = (string)$this_url_tn2;
65
+ //-------------------------------------------------------------------------------------------------------
66
+
67
+ //-------------------------------------------------------------------------------------------------------
68
+ $images_list[] = $current_array;
69
+ //-------------------------------------------------------------------------------------------------------
70
+ }
71
+ //-------------------------------------------------------------------------------------------------------
72
+ /*
73
+ * Item template
74
+ */
75
+ $_media_item_tpl = '
76
+ <li class="orbitvu-gallery-item{class}">
77
+ <a class="orbitvu-gallery-item-link" id="orbitvu-{id}" href="{path}" target="_blank">
78
+ <img src="{path_tn2}" alt="" />
79
+ </a>
80
+ </li>
81
+ ';
82
+
83
+ $_presentation_item_tpl = '
84
+ <li class="orbitvu-gallery-item{class}">
85
+ <a class="orbitvu-gallery-item-link" id="orbitvu-{id}" rel="presentation-360" href="{path}" target="_blank">
86
+ <img src="{path_tn2}" alt="" /><span class="orbitvu-gallery-item-desc"><span class="orbitvu-icon orbitvu-icon-type-1"></span></span>
87
+ </a>
88
+ </li>
89
+ ';
90
+
91
+ $_orbittour_item_tpl = '
92
+ <li class="orbitvu-gallery-item{class}">
93
+ <a class="orbitvu-gallery-item-link" id="orbitvu-{id}" rel="presentation-tour" href="{path}" target="_blank">
94
+ <img src="{path_tn2}" alt="" /><span class="orbitvu-gallery-item-desc"><span class="orbitvu-icon orbitvu-icon-type-0"></span></span>
95
+ </a>
96
+ </li>
97
+ ';
98
+ //-------------------------------------------------------------------------------------------------------
99
+ $all_items = 0;
100
+ $_out_items = '';
101
+ $i = 0;
102
+ $first_image = '';
103
+ /*
104
+ * Magento images
105
+ */
106
+ //-------------------------------------------------------------------------------------------------------
107
+ foreach ($images_list as $item) {
108
+ if ($i == 0) $item['class'] = ' orbitvu_active';
109
+ else $item['class'] = '';
110
+
111
+ $item['id'] = $all_items;
112
+
113
+ $_out_items .= $observer->UseTemplate($item, $_media_item_tpl);
114
+
115
+ $i++;
116
+ $all_items++;
117
+ }
118
+ //-------------------------------------------------------------------------------------------------------
119
+ if (isset($images_list[0]['path_tn'])) {
120
+ $first_image = array(
121
+ 'path_tn' => $images_list[0]['path_tn'],
122
+ 'path' => $images_list[0]['path']
123
+ );
124
+ }
125
+ //-------------------------------------------------------------------------------------------------------
126
+ $presentation = $_Orbitvu->GetProductPresentation($_product->getId(), true);
127
+
128
+ $view_360 = array();
129
+ $orbittour = array();
130
+ $i = 0;
131
+ if (count($presentation['items']) > 0) {
132
+ foreach ($presentation['items'] as $item) {
133
+ /*
134
+ * Orbitvu 2D Images
135
+ */
136
+ if ($item['type'] == '3') {
137
+ //-------------------------------------------------------------------------------------------------------
138
+ $current_path = 'http:'.$item['path'].'?max_width='.str_replace('px', '', $_orbitvu_gallery['img_width_zoom']).'&height='.str_replace('px', '', $_orbitvu_gallery['img_height_zoom']);
139
+ $current_path_tn = 'http:'.$item['path'].'?max_width='.str_replace('px', '', $_orbitvu_gallery['img_width']).'&height='.str_replace('px', '', $_orbitvu_gallery['img_height']);
140
+
141
+ $_out_items .= $observer->UseTemplate(array(
142
+ 'path' => $current_path,
143
+ 'path_tn' => $current_path_tn,
144
+ 'path_tn2' => 'http:'.$item['thumbnail'].'?width='.str_replace('px', '', $_orbitvu_gallery['img_width_tn']).'&max_height='.str_replace('px', '', $_orbitvu_gallery['img_height_tn']),
145
+ 'class' => '',
146
+ 'id' => $all_items
147
+ ), $_media_item_tpl);
148
+ //-------------------------------------------------------------------------------------------------------
149
+ $jspreloader_tn[] = '\''.$current_path_tn.'\'';
150
+ $jspreloader[] = '\''.$current_path.'\'';
151
+
152
+ if ($i == 0 && empty($first_image)) {
153
+ $first_image = array(
154
+ 'path_tn' => $current_path_tn,
155
+ 'path' => $current_path
156
+ );
157
+ }
158
+
159
+ $all_items++;
160
+ }
161
+ /*
162
+ * Orbitvu 360 Presentations
163
+ */
164
+ else if ($item['type'] == '1') {
165
+ //-------------------------------------------------------------------------------------------------------
166
+ $current_path = 'http:'.$item['thumbnail'].'?max_width='.str_replace('px', '', $_orbitvu_gallery['img_width_zoom']).'&height='.str_replace('px', '', $_orbitvu_gallery['img_height_zoom']);
167
+ $current_path_tn = 'http:'.$item['thumbnail'].'?max_width='.str_replace('px', '', $_orbitvu_gallery['img_width']).'&height='.str_replace('px', '', $_orbitvu_gallery['img_height']);
168
+
169
+ $_out_items .= $observer->UseTemplate(array(
170
+ 'path' => $current_path,
171
+ 'path_tn' => $current_path_tn,
172
+ 'path_tn2' => 'http:'.$item['thumbnail'].'?width='.str_replace('px', '', $_orbitvu_gallery['img_width_tn']).'&max_height='.str_replace('px', '', $_orbitvu_gallery['img_height_tn']),
173
+ 'class' => '',
174
+ 'id' => $all_items
175
+ ), $_presentation_item_tpl);
176
+
177
+ $item_config = json_decode($item['config']);
178
+ $item_uid = $item_config->uid;
179
+ $view_360 = array(
180
+ 'path' => $item['path'],
181
+ 'path_tn' => $current_path_tn,
182
+ 'uid' => $item_uid,
183
+ 'thumbnail' => $item['thumbnail']
184
+ );
185
+ //-------------------------------------------------------------------------------------------------------
186
+ $jspreloader_tn[] = '\''.$current_path_tn.'\'';
187
+ $jspreloader[] = '\''.$current_path.'\'';
188
+
189
+ if ($i == 0 && empty($first_image)) {
190
+ $first_image = array(
191
+ 'path_tn' => $current_path_tn,
192
+ 'path' => $current_path
193
+ );
194
+ }
195
+
196
+ $all_items++;
197
+ }
198
+ /*
199
+ * Orbittour presentation
200
+ */
201
+ else if ($item['type'] == '0') {
202
+ //-------------------------------------------------------------------------------------------------------
203
+ $current_path = 'http:'.$item['thumbnail'].'?max_width='.str_replace('px', '', $_orbitvu_gallery['img_width_zoom']).'&height='.str_replace('px', '', $_orbitvu_gallery['img_height_zoom']);
204
+ $current_path_tn = 'http:'.$item['thumbnail'].'?max_width='.str_replace('px', '', $_orbitvu_gallery['img_width']).'&height='.str_replace('px', '', $_orbitvu_gallery['img_height']);
205
+
206
+ $_out_items .= $observer->UseTemplate(array(
207
+ 'path' => $current_path,
208
+ 'path_tn' => $current_path_tn,
209
+ 'path_tn2' => 'http:'.$item['thumbnail'].'?width='.str_replace('px', '', $_orbitvu_gallery['img_width_tn']).'&max_height='.str_replace('px', '', $_orbitvu_gallery['img_height_tn']),
210
+ 'class' => '',
211
+ 'id' => $all_items
212
+ ), $_orbittour_item_tpl);
213
+
214
+ $item_config = json_decode($item['config']);
215
+ $item_uid = $item_config->uid;
216
+ $orbittour = array(
217
+ 'path' => $item['path'],
218
+ 'path_tn' => $current_path_tn,
219
+ 'uid' => $item_uid
220
+ );
221
+ //-------------------------------------------------------------------------------------------------------
222
+ $jspreloader_tn[] = '\''.$current_path_tn.'\'';
223
+ $jspreloader[] = '\''.$current_path.'\'';
224
+
225
+ if ($i == 0 && empty($first_image)) {
226
+ $first_image = array(
227
+ 'path_tn' => $current_path_tn,
228
+ 'path' => $current_path
229
+ );
230
+ }
231
+
232
+ $all_items++;
233
+ }
234
+ //-------------------------------------------------------------------------------------------------------
235
+ $i++;
236
+ }
237
+ }
238
+
239
+ //-------------------------------------------------------------------------------------------------------
240
+ /*
241
+ * Display output
242
+ */
243
+ if ($all_items <= 0) {
244
+ ?>
245
+ <div class="orbitvu-gallery" id="orbitvu-gallery-placeholder" style="width: <?=$_orbitvu_gallery['width']?>; height: <?=$_orbitvu_gallery['height']?>; margin: 0; padding: 0; position: relative; border: 1px solid <?=$_orbitvu_gallery['border_color']?>; background-image: url(<?=Mage::getBaseUrl('media')?>orbitvu/placeholder.png); background-position: center; center; background-repeat: no-repeat;"></div>
246
+ <script>
247
+ window.onresize = function() {
248
+ if (window.innerWidth < 770) document.getElementById('orbitvu-gallery-placeholder').style.display = 'none';
249
+ else document.getElementById('orbitvu-gallery-placeholder').style.display = 'block';
250
+ }
251
+ window.onresize();
252
+ </script>
253
+ <?php
254
+ }
255
+ else if ($all_items > 0) {
256
+ ?>
257
+ <div class="orbitvu-gallery" id="orbitvu-gallery">
258
+ <div id="orbitvu-gallery-product-image" class="orbitvu-gallery-product-image">
259
+ <div id="orbitvu-gallery-view-image">
260
+ <img id="orbitvu-gallery-main-image" style="display: inline;" alt="orbitvu-0" src="<?=$first_image['path_tn']?>" />
261
+ </div>
262
+ <div id="orbitvu-gallery-view-360" class="orbitvu-presentation"<?php if (!empty($view_360['path'])) {
263
+ echo ' style="background-image: url('.$view_360['thumbnail'].'?max_height='.str_replace('px', '', $_orbitvu_gallery['img_height']).');"';
264
+ }?>><?php
265
+ if (!empty($view_360['path'])) {
266
+ ?>
267
+ <script type="text/javascript" src="<?=$view_360['path']?>?content2=yes&force_html5=<?=$_Orbitvu->GetConfiguration('html5')?><?php
268
+ $orbitvu_teaser = $_Orbitvu->GetConfiguration('teaser');
269
+ if ($orbitvu_teaser != 'sun') {
270
+ print '&teaser='.$orbitvu_teaser;
271
+ }
272
+ ?>&width=auto&height=auto&viewer_delayed=yes" id="orbitvu-viewer-script"></script>
273
+ <div id="ovContent-<?=$view_360['uid']?>" class="orbitvu-container" style="width: 100%; height: 100%; background-repeat: no-repeat; background-position: center center; background-size: contain; background-image: url(<?=$view_360['thumbnail']?>?max_height=<?=str_replace('px', '', $_orbitvu_gallery['img_height'])?>);"></div>
274
+ <?php
275
+ }
276
+ ?></div>
277
+ <div id="orbitvu-gallery-view-tour" class="orbitvu-presentation"><?php
278
+ if (!empty($orbittour['path'])) {
279
+ ?>
280
+ <div id="orbittour-<?=$orbittour['uid']?>" class="orbittour-container"></div>
281
+ <script type="text/javascript" src="<?=$orbittour['path']?>?orbittour_delayed=yes&onready=no&force_html5=<?=$_Orbitvu->GetConfiguration('html5')?><?php
282
+ $otn = $_Orbitvu->GetConfiguration('orbittour_thumbnails');
283
+
284
+ if ($otn != 'sun') {
285
+ print '&style='.$otn;
286
+ }
287
+
288
+ ?>"></script>
289
+ <?php } ?></div>
290
+ </div>
291
+ <div id="orbitvu-gallery-product-image-zoom" style="background-image: url(<?=$first_image['path']?>);"></div>
292
+ <div class="orbitvu-gallery-product-views" id="orbitvu-gallery-product-views">
293
+ <ul class="orbitvu-image-thumbs" id="orbitvu-image-thumbs" style="margin-left: 0;">
294
+ <?=$_out_items?>
295
+ </ul>
296
+ <em id="orbitvu_go_next" class="orbitvu-gallery-button"><span>&raquo;</span></em>
297
+ <em id="orbitvu_go_back" class="orbitvu-gallery-button"><span>&laquo;</span></em>
298
+ </div>
299
+ <div id="orbitvu-gallery-preloader"></div>
300
+ </div>
301
+ <style type="text/css">
302
+ .orbitvu-gallery { width: <?=$_orbitvu_gallery['width']?>; height: <?=$_orbitvu_gallery['height']?>; margin: 0; padding: 0; position: relative; border: 1px solid <?=$_orbitvu_gallery['border_color']?>; }
303
+ .orbitvu-gallery-product-image { clear: both; overflow: hidden; zoom: 1.0; max-height: <?=$_orbitvu_gallery['img_height']?>; position: relative; text-align: center; }
304
+ .orbitvu-gallery-product-image img#orbitvu-gallery-main-image { display: inline; margin: 0; padding: 0; border: 0; max-width: 100%; max-height: 100%; cursor: crosshair; }
305
+ #orbitvu-gallery-product-image-zoom { display: none; height: auto; box-sizing: content-box; position: absolute; top: -1px; bottom: -1px; right: -100%; width: 100%; border: 1px solid <?=$_orbitvu_gallery['border_color']?>; background-color: white; background-repeat: no-repeat; cursor: crosshair; }
306
+ .orbitvu-gallery-product-views { width: 100%; position: absolute; bottom: 0; left: 0; clear: both; overflow: hidden; zoom: 1.0; }
307
+ .orbitvu-gallery-product-views ul.orbitvu-image-thumbs { margin: 0; padding: 0; width: 99999px; }
308
+ .orbitvu-gallery-product-views ul.orbitvu-image-thumbs li.orbitvu-gallery-item { float: left; display: table-row; overflow: hidden; width: <?=$_orbitvu_gallery['img_width_tn_marg']?>; height: <?=$_orbitvu_gallery['img_height_tn_marg']?>; margin: <?=$_orbitvu_gallery['img_tn_margin']?>; position: relative; border: 1px solid transparent; }
309
+ .orbitvu-gallery-product-views ul.orbitvu-image-thumbs li.orbitvu-gallery-item:hover, .orbitvu-gallery-product-views ul.orbitvu-image-thumbs li.orbitvu-gallery-item.orbitvu_active { border: 1px solid <?=$_orbitvu_gallery['border_color']?>; }
310
+ .orbitvu-gallery-product-views ul.orbitvu-image-thumbs li.orbitvu-gallery-item a.orbitvu-gallery-item-link { display: table-cell; vertical-align: middle; width: <?=$_orbitvu_gallery['img_width_tn_marg']?>; height: <?=$_orbitvu_gallery['img_height_tn_marg']?>; text-align: center; }
311
+ .orbitvu-gallery-product-views ul.orbitvu-image-thumbs li.orbitvu-gallery-item a.orbitvu-gallery-item-link img { display: block; margin: 0 auto; max-width: <?=$_orbitvu_gallery['img_width_tn']?>; max-height: <?=$_orbitvu_gallery['img_height_tn']?>; }
312
+ .orbitvu-gallery-item-desc { display: block; padding: 2px; position: absolute; bottom: 0; left: 0; background: rgba(255, 255, 255, 0.5); color: black; font-weight: bold; font-size: 0.8em; }
313
+ .orbitvu-gallery-button { display: table-row; position: absolute; bottom: <?=$_orbitvu_gallery['img_tn_margin']?>; width: <?=$_orbitvu_gallery['button_width']?>; height: <?=$_orbitvu_gallery['button_height']?>; background: white; border: 1px solid <?=$_orbitvu_gallery['border_color']?>; font-weight: bold; text-align: center; opacity: <?=$_orbitvu_gallery['button_opacity']?>; color: black; font-size: 24px; text-decoration: none; font-style: normal; cursor: pointer; }
314
+ .orbitvu-gallery-button:hover { background: black; color: white; text-decoration: none; border-color: black; }
315
+ .orbitvu-gallery-button span { display: table-cell; vertical-align: middle; width: <?=$_orbitvu_gallery['button_width']?>; height: <?=$_orbitvu_gallery['button_height']?>; }
316
+ #orbitvu_go_next { right: -1px; }
317
+ #orbitvu_go_back { display: none; left: -1px; }
318
+ #orbitvu-gallery-preloader { position: absolute; top: -10000px; left: -10000px; }
319
+ .orbitvu-presentation { display: block; width: 100%; height: <?=$_orbitvu_gallery['img_height']?>; top: -10000px; background-repeat: no-repeat; background-position: center center; background-size: contain; }
320
+ .orbitvu-icon { display: block; width: 22px; height: 22px; background-image: url(<?=Mage::getBaseUrl('media')?>orbitvu/black.png); background-repeat: no-repeat; }
321
+ .orbitvu-icon-type-3 { background-position: 0 -32px; }
322
+ .orbitvu-icon-type-1 { background-position: -22px -32px; }
323
+ .orbitvu-icon-type-0 { background-position: -44px -32px; }
324
+ </style>
325
+ <script>
326
+ /*
327
+ * Orbitvu Public Declarations
328
+ */
329
+ var orbitvu_timer, orbitvu_rectangle, orbitvu_current_image, orbitvu_init_interval, orbitvu_box_width, orbitvu_box_height, orbitvu_switch_timer, orbitvu_360_interval, orbitvu_tour_interval;
330
+ var orbitvu_image_thumbs = Orb$('orbitvu-image-thumbs');
331
+ var orbitvu_speed = 24;
332
+ var orbitvu_xAll = 0;
333
+ var orbitvu_xAllReal = 0;
334
+ var orbitvu_xMax = 0;
335
+ var orbitvu_gallery_inner;
336
+ var orbitvu_pos = 0;
337
+ var orbitvu_dir = 1;
338
+ var orbitvu_fps = 30;
339
+ var orbitvu_interval = 1000 / orbitvu_fps;
340
+ var orbitvu_lastV = 0;
341
+ var orbitvu_img_preloader_tn = new Array(<?=implode(',', $jspreloader_tn)?>);
342
+ var orbitvu_img_preloader = new Array(<?=implode(',', $jspreloader)?>);
343
+ var orbitvu_buttons = false;
344
+ var orbitvu_max_counter = 3;
345
+ var orbitvu_ready = false;
346
+ var orbitvu_window_before = window.innerWidth;
347
+ var orbitvu_window_growing = false;
348
+ var orbitvu_smallest_height = '<?=$_orbitvu_gallery['img_height']?>';
349
+ var orbitvu_window_onresize_enabled = true;
350
+ var orbitvu_zoom_responsive = false;
351
+
352
+ /*
353
+ * Orbitvu Objects
354
+ */
355
+ function OrbitvuOffsetRectangle(elem){
356
+ var box = elem.getBoundingClientRect();
357
+ var clientTop = document.documentElement.clientTop || document.body.clientTop||0;
358
+ var clientLeft = document.documentElement.clientLeft || document.body.clientLeft||0;
359
+ var top = box.top - clientTop;
360
+ var left = box.left - clientLeft;
361
+
362
+ return {
363
+ top: Math.round(top),
364
+ left: Math.round(left)
365
+ };
366
+ }
367
+
368
+ function OrbitvuImage(id) {
369
+ id = parseInt(String(id).replace('orbitvu-', ''));
370
+
371
+ var temp = orbitvu_get_image_dimensions(Orb$('orbitvu-img-tn-' + id));
372
+ var temp_zoom = orbitvu_get_image_dimensions(Orb$('orbitvu-img-' + id));
373
+
374
+ return {
375
+ orbitvu_id: 'orbitvu-' + id,
376
+ path: orbitvu_img_preloader[id],
377
+ path_tn: orbitvu_img_preloader_tn[id],
378
+ width: temp.width,
379
+ height: temp.height,
380
+ width_zoom: temp_zoom.width,
381
+ height_zoom: temp_zoom.height
382
+ };
383
+ }
384
+
385
+ /*
386
+ * Orbitvu Funtions Pure JS
387
+ */
388
+ function Orb$(el) {
389
+ return document.getElementById(el);
390
+ }
391
+
392
+ function orbitvu_stristr(haystack, needle, bool) {
393
+ var pos = 0;
394
+
395
+ haystack += '';
396
+ pos = haystack.toLowerCase().indexOf((needle + '').toLowerCase());
397
+ if (pos == -1) {
398
+ return false;
399
+ }
400
+ else {
401
+ if (bool) {
402
+ return haystack.substr(0, pos);
403
+ }
404
+ else {
405
+ return haystack.slice(pos);
406
+ }
407
+ }
408
+ }
409
+
410
+ /*
411
+ * Inject 360
412
+ */
413
+ function orbitvu_inject_tour_now() {
414
+ inject_orbittour_<?=$orbittour['uid']?>();
415
+ }
416
+
417
+ function orbitvu_inject_tour() {
418
+ <?php
419
+ if (!empty($orbittour['path'])) {
420
+ ?>
421
+ if (orbitvu_ready) {
422
+ clearInterval(orbitvu_tour_interval);
423
+ orbitvu_inject_tour_now();
424
+ console.log('OrbitTour loaded.');
425
+ }
426
+ <?php
427
+ }
428
+ ?>
429
+ }
430
+
431
+ function orbitvu_remove_bg_360() {
432
+ Orb$('orbitvu-gallery-view-360').style.backgroundImage = '';
433
+ }
434
+
435
+ function orbitvu_inject_360_now() {
436
+ <?php
437
+ if (!empty($view_360['path'])) {
438
+ ?>
439
+ inject_viewer_<?=$view_360['uid']?>();
440
+ setTimeout('orbitvu_remove_bg_360()', 500);
441
+ <?php
442
+ }
443
+ ?>
444
+ }
445
+
446
+ function orbitvu_inject_360() {
447
+ <?php
448
+ if (!empty($view_360['path'])) {
449
+ ?>
450
+ if (orbitvu_ready) {
451
+ clearInterval(orbitvu_360_interval);
452
+ orbitvu_inject_360_now();
453
+ console.log('360 loaded.');
454
+ }
455
+ <?php
456
+ }
457
+ ?>
458
+ }
459
+
460
+ /*
461
+ * Get real image dimensions from preloaded 1x1
462
+ * @returns {integer width, integer height}
463
+ */
464
+ function orbitvu_get_image_dimensions(temp) {
465
+ temp.style.width = 'auto';
466
+ temp.style.height = 'auto';
467
+ var img_width = parseInt(temp.offsetWidth);
468
+ var img_height = parseInt(temp.offsetHeight);
469
+ temp.style.width = '1px';
470
+ temp.style.height = '1px';
471
+
472
+ return {
473
+ width: img_width,
474
+ height: img_height
475
+ };
476
+ }
477
+
478
+ function orbitvu_get_maxHeight() {
479
+ return parseInt(Orb$('orbitvu-gallery').offsetHeight - Orb$('orbitvu-gallery-product-views').offsetHeight) - 2;
480
+ }
481
+
482
+ function orbitvu_init_gallery() {
483
+ orbitvu_gallery_inner = Orb$('orbitvu-gallery').clientWidth;
484
+
485
+ orbitvu_xMax = 0;
486
+ orbitvu_xAll = 0;
487
+
488
+ var i = 0;
489
+
490
+ for (n = orbitvu_image_thumbs.children.length, orbitvu_current = 0; i < n; i++) {
491
+ orbitvu_current = orbitvu_image_thumbs.children[i].clientWidth + <?=(str_replace('px', '', $_orbitvu_gallery['img_tn_margin']) * 2)?> + 2;
492
+ if (i == 0) orbitvu_xMax += orbitvu_current;
493
+ orbitvu_xAll += orbitvu_current;
494
+ }
495
+
496
+ if (i == 1) {
497
+ Orb$('orbitvu-gallery-product-views').style.height = '1px';
498
+ }
499
+
500
+ orbitvu_xAllReal = orbitvu_xAll;
501
+ orbitvu_xAll -= orbitvu_gallery_inner;
502
+ }
503
+
504
+
505
+ function orbitvu_reset_classes() {
506
+ for (var i = 0, n = Orb$('orbitvu-image-thumbs').children.length; i < n; i++) {
507
+ Orb$('orbitvu-image-thumbs').children[i].className = Orb$('orbitvu-image-thumbs').children[i].className.replace('orbitvu_active', '');
508
+ }
509
+ }
510
+
511
+ /*
512
+ * To delete if not used
513
+ * @returns {undefined} */
514
+ function orbitvu_presentations_resize() {
515
+ orbitvu_window_onresize_enabled = false;
516
+ window.dispatchEvent(new Event('resize'));
517
+ orbitvu_window_onresize_enabled = true;
518
+ }
519
+
520
+ function orbitvu_switch_now(el) {
521
+ orbitvu_reset_classes();
522
+ el.parentNode.className += ' orbitvu_active';
523
+
524
+ orbitvu_current_image = OrbitvuImage(el.id);
525
+
526
+ Orb$('orbitvu-gallery-main-image').src = orbitvu_current_image.path_tn;
527
+ Orb$('orbitvu-gallery-main-image').alt = el.id;
528
+
529
+ if (el.rel == 'presentation-360') {
530
+ Orb$('orbitvu-gallery-view-image').style.display = 'none';
531
+ Orb$('orbitvu-gallery-view-tour').style.position = 'absolute';
532
+ Orb$('orbitvu-gallery-view-360').style.position = '';
533
+ //orbitvu_presentations_resize();
534
+ }
535
+ else if (el.rel == 'presentation-tour') {
536
+ Orb$('orbitvu-gallery-view-image').style.display = 'none';
537
+ Orb$('orbitvu-gallery-view-tour').style.position = '';
538
+ Orb$('orbitvu-gallery-view-360').style.position = 'absolute';
539
+ //orbitvu_presentations_resize();
540
+ }
541
+ else {
542
+ Orb$('orbitvu-gallery-view-image').style.display = 'block';
543
+ Orb$('orbitvu-gallery-view-360').style.position = 'absolute'; // workaround display: block/none
544
+ Orb$('orbitvu-gallery-view-tour').style.position = 'absolute'; // workaround display: block/none
545
+ }
546
+ }
547
+
548
+ function orbitvu_switch(el, delay) {
549
+ if (delay > 0) {
550
+ clearTimeout(orbitvu_switch_timer);
551
+
552
+ orbitvu_switch_timer = setTimeout(function () {
553
+ orbitvu_switch_now(el);
554
+ }, delay);
555
+ }
556
+ else {
557
+ orbitvu_switch_now(el);
558
+ }
559
+ }
560
+
561
+ function orbitvu_hide_zoom() {
562
+ Orb$('orbitvu-gallery-product-image-zoom').style.display = 'none';
563
+ }
564
+
565
+ function orbitvu_show_zoom() {
566
+ if (!orbitvu_ready) return false;
567
+
568
+ Orb$('orbitvu-gallery-product-image-zoom').style.backgroundImage = 'url(' + orbitvu_current_image.path + ')';
569
+ Orb$('orbitvu-gallery-product-image-zoom').style.display = 'block';
570
+
571
+ if (((Orb$('orbitvu-gallery-product-image-zoom').offsetLeft + Orb$('orbitvu-gallery-product-image-zoom').offsetWidth) > document.body.offsetWidth) || window.innerWidth < 770 || document.body.offsetWidth < 770) {
572
+ Orb$('orbitvu-gallery-product-image-zoom').style.right = '-1px';
573
+ Orb$('orbitvu-gallery-product-image-zoom').style.left = '-1px';
574
+ Orb$('orbitvu-gallery-product-image-zoom').style.height = parseInt(Orb$('orbitvu-gallery').offsetHeight - Orb$('orbitvu-gallery-product-views').offsetHeight - 2) + 'px';
575
+ orbitvu_rectangle = OrbitvuOffsetRectangle(Orb$('orbitvu-gallery-product-image-zoom'));
576
+ orbitvu_zoom_responsive = true;
577
+ }
578
+ else {
579
+ Orb$('orbitvu-gallery-product-image-zoom').style.right = '-100%';
580
+ Orb$('orbitvu-gallery-product-image-zoom').style.left = 'auto';
581
+ Orb$('orbitvu-gallery-product-image-zoom').style.height = 'auto';
582
+ orbitvu_zoom_responsive = false;
583
+ orbitvu_rectangle = OrbitvuOffsetRectangle(Orb$('orbitvu-gallery-main-image'));
584
+ }
585
+ }
586
+
587
+ function orbitvu_manage_zoom(obj, event) {
588
+ if (!orbitvu_ready) return false;
589
+ if (!orbitvu_rectangle) {
590
+ orbitvu_rectangle = OrbitvuOffsetRectangle(obj);
591
+ }
592
+
593
+ var mx = event.clientX - orbitvu_rectangle.left;
594
+ var my = event.clientY - orbitvu_rectangle.top;
595
+
596
+ if (Orb$('orbitvu-gallery-product-image-zoom').style.display == 'none') orbitvu_show_zoom();
597
+
598
+ if (orbitvu_current_image) {
599
+ //console.log('w: ' + obj.offsetWidth + ', h: ' + obj.offsetHeight + ', nw: ' + orbitvu_current_image.width_zoom + ', nh: ' + orbitvu_current_image.height_zoom);
600
+ var interpolate_x = Math.round(mx * (orbitvu_current_image.width_zoom / obj.offsetWidth));
601
+ var interpolate_y = Math.round(my * (orbitvu_current_image.height_zoom / obj.offsetHeight));
602
+
603
+ interpolate_x = interpolate_x - (orbitvu_box_width/2);
604
+ interpolate_y = interpolate_y - (orbitvu_box_height/2);
605
+
606
+ var orb_box_w = orbitvu_current_image.width_zoom - orbitvu_box_width;
607
+ var orb_box_h = orbitvu_current_image.height_zoom - orbitvu_box_height;
608
+
609
+ if (interpolate_x >= orb_box_w) interpolate_x = orb_box_w;
610
+ if (interpolate_y >= orb_box_h) interpolate_y = orb_box_h;
611
+
612
+ interpolate_x *= -1;
613
+ interpolate_y *= -1;
614
+
615
+ if (interpolate_x >= 0) interpolate_x = 0;
616
+ if (interpolate_y >= 0) interpolate_y = 0;
617
+
618
+ //console.log('x: ' + mx + ', y: ' + my + ', new_x: ' + interpolate_x + ', new_y: ' + interpolate_y + ', orbw: ' + orb_box_w + ', orbh: ' + orb_box_h);
619
+ Orb$('orbitvu-gallery-product-image-zoom').style.backgroundPosition = Math.round(interpolate_x) + 'px ' + Math.round(interpolate_y) + 'px';
620
+ }
621
+ }
622
+
623
+ function orbitvu_preload_images() {
624
+
625
+ var i = 0;
626
+
627
+ Orb$('orbitvu-gallery-preloader').innerHTML += '<img id="orbitvu-img-tn-' + i + '" src="' + orbitvu_img_preloader_tn[i] + '" style="width: 1px; height: 1px;" alt="" /> ';
628
+ Orb$('orbitvu-gallery-preloader').innerHTML += '<img id="orbitvu-img-' + i + '" src="' + orbitvu_img_preloader[i] + '" style="width: 1px; height: 1px;" alt="" /> ';
629
+
630
+ Orb$('orbitvu-img-0').onload = function() {
631
+ orbitvu_current_image = OrbitvuImage('orbitvu-0');
632
+ console.log('Image preloader continues...');
633
+
634
+ for (var i = 1, n = orbitvu_img_preloader_tn.length; i < n; i++) {
635
+ Orb$('orbitvu-gallery-preloader').innerHTML += '<img id="orbitvu-img-tn-' + i + '" src="' + orbitvu_img_preloader_tn[i] + '" style="width: 1px; height: 1px;" alt="" /> ';
636
+ Orb$('orbitvu-gallery-preloader').innerHTML += '<img id="orbitvu-img-' + i + '" src="' + orbitvu_img_preloader[i] + '" style="width: 1px; height: 1px;" alt="" /> ';
637
+ }
638
+
639
+ console.log('Done.');
640
+
641
+ }
642
+
643
+ }
644
+
645
+ (function() {
646
+ var lastTime = 0;
647
+ var vendors = ['ms', 'moz', 'webkit', 'o'];
648
+ for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
649
+ window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
650
+ window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
651
+ || window[vendors[x]+'CancelRequestAnimationFrame'];
652
+ }
653
+
654
+ if (!window.requestAnimationFrame)
655
+ window.requestAnimationFrame = function(callback, element) {
656
+ var currTime = new Date().getTime();
657
+ var timeToCall = Math.max(0, 16 - (currTime - lastTime));
658
+ var id = window.setTimeout(function() { callback(currTime + timeToCall); },
659
+ timeToCall);
660
+ lastTime = currTime + timeToCall;
661
+ return id;
662
+ };
663
+
664
+ if (!window.cancelAnimationFrame)
665
+ window.cancelAnimationFrame = function(id) {
666
+ clearTimeout(id);
667
+ };
668
+ }());
669
+
670
+ function orbitvu_get_pos() {
671
+ return parseInt(orbitvu_image_thumbs.style.marginLeft.replace('px', ''));
672
+ }
673
+
674
+ function orbitvu_go() {
675
+ /*
676
+ * Do the math
677
+ */
678
+ current_val = (orbitvu_dir * orbitvu_speed);
679
+ orbitvu_pos = orbitvu_get_pos();
680
+
681
+ /*
682
+ * Check if animation can rewind
683
+ */
684
+ if ((orbitvu_dir == -1 && (orbitvu_pos * -1) > orbitvu_xAll) || (orbitvu_dir == 1 && (orbitvu_pos * -1) <= 0)) return false;
685
+
686
+ /*
687
+ * Start animation
688
+ */
689
+ orbitvu_lastV += current_val;
690
+ orbitvu_animation = window.requestAnimationFrame(orbitvu_go);
691
+ orbitvu_image_thumbs.style.marginLeft = (current_val + orbitvu_pos) + 'px';
692
+
693
+ if ((orbitvu_dir == 1 && orbitvu_lastV >= (orbitvu_xMax * orbitvu_max_counter)) || (orbitvu_dir == -1 && (-1 * orbitvu_lastV) >= (orbitvu_xMax * orbitvu_max_counter))) {
694
+ window.cancelAnimationFrame(orbitvu_animation);
695
+ orbitvu_lastV = 0;
696
+ orbitvu_max_counter = 1;
697
+ }
698
+
699
+ /*
700
+ * Hide or show buttons
701
+ */
702
+ if (orbitvu_buttons) {
703
+ new_pos = orbitvu_get_pos();
704
+ if ((orbitvu_dir == -1 && (new_pos * -1) > orbitvu_xAll)) {
705
+ Orb$('orbitvu_go_next').style.display = 'none';
706
+ }
707
+ else {
708
+ Orb$('orbitvu_go_next').style.display = 'block';
709
+ }
710
+ if ((orbitvu_dir == 1 && (new_pos * -1) <= 0)) {
711
+ Orb$('orbitvu_go_back').style.display = 'none';
712
+ }
713
+ else {
714
+ Orb$('orbitvu_go_back').style.display = 'block';
715
+ }
716
+ }
717
+ }
718
+
719
+ function orbitvu_goNext() {
720
+ orbitvu_dir = -1;
721
+ orbitvu_max_counter = 3;
722
+ orbitvu_go();
723
+ }
724
+
725
+ function orbitvu_goBack() {
726
+ orbitvu_dir = 1;
727
+ orbitvu_max_counter = 3;
728
+ orbitvu_go();
729
+ }
730
+
731
+ function orbitvu_rewind() {
732
+ orbitvu_dir = 1;
733
+ orbitvu_max_counter = 100;
734
+ orbitvu_go();
735
+ }
736
+
737
+ function orbitvu_get_param(element) {
738
+ var main_prev_visibility, main_prev_display, prev_visibility, prev_display;
739
+ var main_cont = Orb$('orbitvu-gallery-view-image');
740
+
741
+ if (element.style.visibility == '') prev_visibility = 'visible';
742
+ else prev_visibility = element.style.visibility;
743
+
744
+ if (element.style.display == '') prev_display = 'block';
745
+ else prev_display = element.style.display;
746
+
747
+ if (main_cont.style.visibility == '') main_prev_display = 'visible';
748
+ else main_prev_display = main_cont.style.visibility;
749
+ if (main_cont.style.display == '') main_prev_display = 'block';
750
+ else main_prev_display = main_cont.style.display;
751
+
752
+ main_cont.style.visibility = 'visible';
753
+ main_cont.style.display = 'block';
754
+ element.style.visibility = 'visible';
755
+ element.style.display = 'block';
756
+
757
+ my_height = parseInt(element.offsetHeight);
758
+ my_width = parseInt(element.offsetWidth);
759
+
760
+ element.style.visibility = prev_visibility;
761
+ element.style.display = prev_display;
762
+ main_cont.style.visibility = main_prev_visibility;
763
+ main_cont.style.display = main_prev_display;
764
+
765
+ return {
766
+ width: my_width,
767
+ height: my_height
768
+ };
769
+ }
770
+
771
+ function orbitvu_maxHeight_fix() {
772
+ Orb$('orbitvu-gallery-product-image').style.maxHeight = '<?=$_orbitvu_gallery['img_height']?>';
773
+
774
+ var orbitvu_gallery_dim = orbitvu_get_param(Orb$('orbitvu-gallery'));
775
+ var orbitvu_gallery_main_image_dim = orbitvu_get_param(Orb$('orbitvu-gallery-main-image'));
776
+ var orbitvu_gallery_product_views_dim = { height: parseInt(Orb$('orbitvu-gallery-product-views').offsetHeight) };
777
+ var new_height = orbitvu_gallery_dim.height - (orbitvu_gallery_dim.height - orbitvu_gallery_main_image_dim.height - orbitvu_gallery_product_views_dim.height);
778
+
779
+ Orb$('orbitvu-gallery').style.height = parseInt(new_height + 2) + 'px';
780
+
781
+ orbitvu_smallest_height = orbitvu_get_maxHeight();
782
+ Orb$('orbitvu-gallery-product-image').style.maxHeight = orbitvu_smallest_height + 'px';
783
+
784
+ if (orbitvu_img_preloader.length <= 1) {
785
+ var new_sm_height = orbitvu_smallest_height + 2;
786
+ }
787
+ else {
788
+ var new_sm_height = orbitvu_smallest_height - 2;
789
+ }
790
+
791
+ Orb$('orbitvu-gallery-view-360').style.height = new_sm_height + 'px';
792
+ Orb$('orbitvu-gallery-view-tour').style.height = new_sm_height + 'px';
793
+ }
794
+
795
+ function orbitvu_refresh() {
796
+ var current_id = 'orbitvu-0';
797
+
798
+ if (typeof orbitvu_current_image != 'undefined') {
799
+ if ('orbitvu_id' in orbitvu_current_image) {
800
+ current_id = orbitvu_current_image.orbitvu_id;
801
+ }
802
+ }
803
+ orbitvu_switch(Orb$(current_id));
804
+
805
+ if (orbitvu_current_image.width_zoom > 0) {
806
+
807
+ orbitvu_maxHeight_fix();
808
+
809
+ clearInterval(orbitvu_init_interval);
810
+ console.log('Ready.');
811
+ orbitvu_ready = true;
812
+
813
+ orbitvu_calculate_zoom();
814
+ }
815
+ }
816
+
817
+ function orbitvu_calculate_zoom() {
818
+ orbitvu_show_zoom();
819
+ var image_zoom = orbitvu_get_param(Orb$('orbitvu-gallery-product-image-zoom'));
820
+ orbitvu_hide_zoom();
821
+ orbitvu_box_width = image_zoom.width;
822
+ orbitvu_box_height = image_zoom.height;
823
+ }
824
+
825
+ function orbitvu_recalculate() {
826
+ orbitvu_calculate_zoom();
827
+ orbitvu_refresh();
828
+ }
829
+
830
+ /*
831
+ * Starting function
832
+ */
833
+ function OrbitvuInit() {
834
+ /*
835
+ * Init gallery and images
836
+ */
837
+ orbitvu_init_gallery();
838
+
839
+ console.log('Waiting for image preloader...');
840
+ orbitvu_preload_images();
841
+
842
+ /*
843
+ * Buttons starting visibility
844
+ */
845
+ if ((orbitvu_xAllReal - (<?=(str_replace('px', '', $_orbitvu_gallery['img_tn_margin'])*2)?>)) < orbitvu_gallery_inner) Orb$('orbitvu_go_next').style.display = 'none';
846
+ else orbitvu_buttons = true;
847
+
848
+ /*
849
+ * Attach events to thumbnails
850
+ */
851
+ var thumbnails = document.getElementsByClassName('orbitvu-gallery-item-link');
852
+
853
+ for (var i = 0, n = thumbnails.length; i < n; i++) {
854
+ <?php if ($_Orbitvu->GetConfiguration('hover_mode') == 'true') { ?>
855
+ thumbnails[i].onmouseover = function() { orbitvu_switch(this, <?=($_Orbitvu->GetConfiguration('hover_delay')*100)?>); }
856
+ thumbnails[i].onmouseout = function() { clearTimeout(orbitvu_switch_timer); }
857
+ <?php } ?>
858
+ thumbnails[i].onclick = function() { orbitvu_switch(this); return false; }
859
+ }
860
+
861
+ /*
862
+ * Attach Events
863
+ */
864
+ Orb$('orbitvu-gallery-main-image').onmousemove = function(event) { orbitvu_manage_zoom(this, event); }
865
+ Orb$('orbitvu-gallery-main-image').onmouseover = function() { orbitvu_show_zoom(); }
866
+ Orb$('orbitvu-gallery-main-image').onmouseout = function() { orbitvu_hide_zoom(); }
867
+ Orb$('orbitvu-gallery-product-image-zoom').onmousemove = function(event) { if (orbitvu_zoom_responsive) { orbitvu_manage_zoom(this, event); } }
868
+ Orb$('orbitvu-gallery-product-image-zoom').onmouseover = function() { if (orbitvu_zoom_responsive) { orbitvu_show_zoom(); } }
869
+ Orb$('orbitvu-gallery-product-image-zoom').onmouseout = function() { orbitvu_hide_zoom(); }
870
+ Orb$('orbitvu_go_next').onclick = function() { orbitvu_goNext(); }
871
+ Orb$('orbitvu_go_back').onclick = function() { orbitvu_goBack(); }
872
+
873
+ /*
874
+ * Calculate gallery dimensions
875
+ */
876
+ orbitvu_init_interval = setInterval('orbitvu_refresh()', 500);
877
+ orbitvu_recalculate();
878
+
879
+ /*
880
+ * Load 360 presentation and/or tour
881
+ */
882
+ <?php
883
+ if (!empty($view_360['path'])) {
884
+ ?>
885
+ orbitvu_360_interval = setInterval('orbitvu_inject_360()', 500);
886
+ <?php
887
+ }
888
+ ?>
889
+
890
+ <?php
891
+ if (!empty($orbittour['path'])) {
892
+ ?>
893
+ orbitvu_tour_interval = setInterval('orbitvu_inject_tour()', 500);
894
+ <?php
895
+ }
896
+ ?>
897
+ }
898
+
899
+ /*
900
+ * Synchronized actions
901
+ */
902
+ OrbitvuInit();
903
+
904
+ /*
905
+ * Window events
906
+ */
907
+ window.onresize = function() {
908
+ if (orbitvu_window_onresize_enabled) {
909
+ if (window.innerWidth > orbitvu_window_before) orbitvu_window_growing = true;
910
+ else orbitvu_window_growing = false;
911
+
912
+ orbitvu_init_gallery();
913
+ orbitvu_recalculate();
914
+ orbitvu_rewind();
915
+ orbitvu_max_counter = 1;
916
+
917
+ orbitvu_window_before = window.innerWidth;
918
+ }
919
+ }
920
+ window.onorientationchange = function() { window.onresize(); }
921
+ </script>
922
+ <?php
923
+ }
924
+ ?>
app/etc/modules/Orbitvu_Sun.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Orbitvu
5
+ * @package Orbitvu_Sun
6
+ * @copyright Copyright (c) 2014 Orbitvu (http://www.orbitvu.com)
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <Orbitvu_Sun>
12
+ <active>true</active>
13
+ <codePool>community</codePool>
14
+ </Orbitvu_Sun>
15
+ </modules>
16
+ </config>
app/locale/de_DE/Orbitvu_Sun.csv ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Orbitvu,Orbitvu
2
+ Error!,Error!
3
+ OK,OK
4
+ Your account was created!,Your account was created!
5
+ Now you have your own account on Orbitvu SUN.<br />We sent your an email with details.,Orbitvu SUN account has been created for you.<br />Shortly you\'ll receive confirmation email.
6
+ Your trial License Key was created and it\'s now in use.,Your trial License Key was created and it\'s now in use.
7
+ Update your key,Update your key
8
+ Contact Orbitvu,Contact Orbitvu
9
+ License Key is not valid,License Key is not valid
10
+ Your Orbitvu extension License Key is not valid. Please update your Key. Orbitvu extension functionality is now limited.,Your Orbitvu extension License Key is not valid. Please enter valid License Key. Orbitvu extension functionality is now limited.
11
+ Orbitvu Extension Wizard,Orbitvu SUN Product Teleporting Extension Wizard
12
+ "You need a <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use the extension.","You need a <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use the extension."
13
+ Choose an option:,Choose an option:
14
+ Enter License Key,Enter License Key
15
+ Link Orbitvu SUN presentations to all products matched with SKU or name.,Link Orbitvu SUN presentations to all products matched with SKU or name.
16
+ Link Orbitvu SUN presentations,Link Orbitvu SUN presentations
17
+ Do you really want to link Orbitvu SUN presentations to all products matched with SKU or name?,Do you really want to link Orbitvu SUN presentations to all products matched with SKU or name?
18
+ This operation will only be applied to not yet linked products.,This operation will only be applied to not yet linked products.
19
+ Orbitvu Configuration,Orbitvu Configuration
20
+ close,close
21
+ Try extension with DEMO account,Try extension with DEMO account
22
+ You get access to predefined set of 360&deg; presentations.,You get access to predefined set of 360&deg; presentations.
23
+ Register Orbitvu SUN FREE trial account,Register Orbitvu SUN FREE trial account
24
+ Create and customize your own presentations.,Create and customize your own presentations.
25
+ Enter License Key,Enter License Key
26
+ Connect to your Orbitvu SUN account.,Connect to your Orbitvu SUN account.
27
+ Creating new account is free. Just enter your e-mail address,Creating new account is free. Just enter your e-mail address
28
+ We will send you the password and generate trial License Key automaticaly.,We will send you the password and generate trial License Key automaticaly.
29
+ Linked,Linked
30
+ Orbittour,Orbittour
31
+ 360&deg;,360&deg;
32
+ 360°,360°
33
+ 2D,2D
34
+ Unlinked,Unlinked
35
+ Not linked,Not linked
36
+ No delay,No delay
37
+ "0,1 second","0,1 second"
38
+ "0,2 second","0,2 second"
39
+ "0,3 second","0,3 second"
40
+ "0,4 second","0,4 second"
41
+ half a second,half a second
42
+ Always use HTML5,Always use HTML5
43
+ "Use Flash if available, otherwise use HTML5","Use Flash if available, otherwise use HTML5"
44
+ "You need <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use Orbitvu extension.","You need <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use Orbitvu extension."
45
+ Register,Register
46
+ trial account or,trial account or
47
+ use DEMO License Key,use DEMO License Key
48
+ Views to the right,Views to the right
49
+ Views at the bottom,Views at the bottom
50
+ No views,No views
51
+ Use Orbitvu SUN setting,Use Orbitvu SUN setting
52
+ "Enable, if remote SKU is empty","Enable, if remote SKU is empty"
53
+ Auto-rotation,Auto-rotation
54
+ Play button enables rotation,Play button enables rotation
55
+ No teaser (static presentation),No teaser (static presentation)
56
+ Quick single rotation (make sense only if 360 presentation is your first gallery item),Quick single rotation (makes sense only if 360 presentation is your first gallery item)
57
+ Slow single rotation (make sense only if 360 presentation is your first gallery item),Slow single rotation (makes sense only if 360 presentation is your first gallery item)
58
+ Use Orbitvu SUN setting,Use Orbitvu SUN setting
59
+ Orbitvu SUN Synchronization,Orbitvu SUN Synchronization
60
+ Orbitvu SUN connection settings,Orbitvu SUN connection settings
61
+ License Key,License Key
62
+ Orbitvu SUN integration,Orbitvu SUN integration
63
+ Link Orbitvu SUN presentations to products automatically,Link Orbitvu SUN presentations to products automatically
64
+ Matching (by SKU or name) Orbitvu SUN presentation will be linked to new products immediately. Once a day we will check for changes at Orbitvu SUN and link matching presentations to products.,Matching (by SKU or name) Orbitvu SUN presentation will be linked to new products immediately. Once a day we will check for changes at Orbitvu SUN and link matching presentations to products.
65
+ Update presentation SKU on Orbitvu SUN automatically,Automatically update presentation SKU on Orbitvu SUN
66
+ Automatically update empty Presentation's SKU on Orbitvu SUN server when such Presentation is linked to Product.,Automatically update empty Presentation's SKU on Orbitvu SUN server when such Presentation is linked to Product.
67
+ Select what type of presentation content will be visible in store by default,Select what type of presentation content will be visible in store by default
68
+ Product view - gallery behavior,Product view - gallery behavior
69
+ Mouse over mode,Mouse over mode
70
+ Change presentation items in gallery with just mouse over instead of click.,Change presentation items in gallery with just mouse over instead of click.
71
+ 360° Presentation teaser,360° Presentation teaser
72
+ HTML5 or Flash mode,HTML5 or Flash mode
73
+ Orbittour views visibility,Orbittour views visibility
74
+ Product view - gallery layout (edit only if you know what are you doing!),Product view - gallery layout (edit only if you know what you are doing!)
75
+ Gallery width,Gallery width
76
+ Enter <strong>100%</strong> if you wan't to have responsive gallery layout (recommended),Enter <strong>100%</strong> if you want to have responsive gallery layout (recommended)
77
+ Gallery preview maximum width,Gallery maximum width
78
+ Recommended: Your layout proportion to gallery preview maximum height eg. <strong>600px</strong>,Recommended: Your layout proportion to gallery maximum height eg. <strong>600px</strong>
79
+ Gallery preview maximum height,Gallery maximum height
80
+ Recommended: <strong>300px</strong>,Recommended: <strong>300px</strong>
81
+ Gallery border color,Gallery border color
82
+ Recommended: <strong>#ccc</strong><br />Enter <strong>transparent</strong> if you don't want borders,Recommended: <strong>#ccc</strong><br />Enter <strong>transparent</strong> if you don't want borders
83
+ Internal zoom image width,Internal zoom image width
84
+ Recommended: <strong>1024px</strong>,Recommended: <strong>1024px</strong>
85
+ Internal zoom image height,Internal zoom image height
86
+ Recommended: <strong>768px</strong>,Recommended: <strong>768px</strong>
87
+ Thumbnail width,Thumbnail width
88
+ Recommended: <strong>75px</strong>,Recommended: <strong>75px</strong>
89
+ Thumbnail height,Thumbnail height
90
+ Recommended: <strong>50px</strong>,Recommended: <strong>50px</strong>
91
+ Thumbnail margin,Thumbnail margin
92
+ Recommended: <strong>3px</strong>,Recommended: <strong>3px</strong>
93
+ Button prev/next width,Button prev/next width
94
+ Recommended: <strong>30px</strong>,Recommended: <strong>30px</strong>
95
+ Button prev/next height,Button prev/next height
96
+ Recommended: <strong>53px</strong>,Recommended: <strong>53px</strong>
97
+ Button prev/next opacity,Button prev/next opacity
98
+ "1 = 100% (recommended), 0.5 = 50%, 0 = 0%","1 = 100% (recommended), 0.5 = 50%, 0 = 0%"
99
+ SKU,SKU
100
+ One of your presentations already has this SKU assigned. SKU need to be unique. Modify SKU on your SUN Server and try again.,This SKU is already in use by one of Orbitvu SUN presentations. Modify SKU on Orbitvu SUN and try again.
101
+ Your Orbitvu extension License Key is not valid. Please update your Key. Orbitvu extension functionality is now limited.,Your Orbitvu extension License Key is not valid. Please enter valid License Key. Orbitvu extension functionality is now limited.
102
+ Update your key,Update your License Key
103
+ Orbitvu extension is connected to DEMO account. Register Orbitvu SUN FREE trial account to create your own presentations.,Orbitvu extension uses DEMO account License Key. Register Orbitvu SUN FREE trial account to create your own presentations.
104
+ Get free trial,Get free trial
105
+ Version,Version
106
+ of Orbitvu extension is out!,of Orbitvu extension is out!
107
+ Upgrade now from,Upgrade now from
108
+ to,to
109
+ Your presentation has been unlinked. You can select a new one below.,Your presentation has been unlinked. You can select a new one below.
110
+ We used your product\'s SKU:,We used your product\'s SKU:
111
+ and name:,and name:
112
+ to match one of your SUN presentations.,to match one of your Orbitvu SUN presentations.
113
+ Link this presentation,Link this presentation
114
+ Select another one,Select another one
115
+ Confirm linking matched presentation,Confirm linking matched presentation
116
+ Select presentation from your Orbitvu SUN account to link with product,Select presentation from your Orbitvu SUN account to link with product
117
+ Page:,Page:
118
+ of,of
119
+ Per page:,Per page:
120
+ Total:,Total:
121
+ Date,Date
122
+ Name,Name
123
+ Enter presentation name or SKU...,Enter presentation name or SKU...
124
+ Search,Search
125
+ Reset,Reset
126
+ Do you really want to link this presentation with current product?,Do you really want to link this presentation with current product?
127
+ Orbitvu SUN presentation linked to current product,Orbitvu SUN presentation linked to current product
128
+ o you really want to update this presentation SKU on your Orbitvu SUN account?,Do you really want to update this presentation SKU on Orbitvu SUN?
129
+ Product\'s SKU:,Product\'s SKU:
130
+ . Presentation\'s SKU from Orbitvu SUN:,. Presentation\'s SKU from Orbitvu SUN:
131
+ "Click ""Update SKU on SUN"" button below to update your presentation\'s SKU on Orbitvu SUN with:","Click ""Update SKU on SUN"" button below to update your presentation\'s SKU on Orbitvu SUN with:"
132
+ We can\'t change your SUN Presentation SKU. One of your presentations already has this product SKU assigned. SKU need to be unique. Modify SKU on your SUN Server.,We can\'t change your Orbitvu SUN Presentation SKU because it is already in use by another presentation. SKU needs to be unique. Modify Presentation SKU on Orbitvu SUN Server to resolve the problem.
133
+ Do you really want to unlink this presentation?,Do you really want to unlink this presentation?
134
+ Unlink this presentation,Unlink this presentation
135
+ Edit on SUN,Edit on SUN
136
+ Drag &amp; move item,Drag &amp; move item
137
+ Hide item,Hide item
138
+ Show item,Show item
app/locale/en_US/Orbitvu_Sun.csv ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Orbitvu,Orbitvu
2
+ Error!,Error!
3
+ OK,OK
4
+ Your account was created!,Your account was created!
5
+ Now you have your own account on Orbitvu SUN.<br />We sent your an email with details.,Orbitvu SUN account has been created for you.<br />Shortly you\'ll receive confirmation email.
6
+ Your trial License Key was created and it\'s now in use.,Your trial License Key was created and it\'s now in use.
7
+ Update your key,Update your key
8
+ Contact Orbitvu,Contact Orbitvu
9
+ License Key is not valid,License Key is not valid
10
+ Your Orbitvu extension License Key is not valid. Please update your Key. Orbitvu extension functionality is now limited.,Your Orbitvu extension License Key is not valid. Please enter valid License Key. Orbitvu extension functionality is now limited.
11
+ Orbitvu Extension Wizard,Orbitvu SUN Product Teleporting Extension Wizard
12
+ "You need a <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use the extension.","You need a <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use the extension."
13
+ Choose an option:,Choose an option:
14
+ Enter License Key,Enter License Key
15
+ Link Orbitvu SUN presentations to all products matched with SKU or name.,Link Orbitvu SUN presentations to all products matched with SKU or name.
16
+ Link Orbitvu SUN presentations,Link Orbitvu SUN presentations
17
+ Do you really want to link Orbitvu SUN presentations to all products matched with SKU or name?,Do you really want to link Orbitvu SUN presentations to all products matched with SKU or name?
18
+ This operation will only be applied to not yet linked products.,This operation will only be applied to not yet linked products.
19
+ Orbitvu Configuration,Orbitvu Configuration
20
+ close,close
21
+ Try extension with DEMO account,Try extension with DEMO account
22
+ You get access to predefined set of 360&deg; presentations.,You get access to predefined set of 360&deg; presentations.
23
+ Register Orbitvu SUN FREE trial account,Register Orbitvu SUN FREE trial account
24
+ Create and customize your own presentations.,Create and customize your own presentations.
25
+ Enter License Key,Enter License Key
26
+ Connect to your Orbitvu SUN account.,Connect to your Orbitvu SUN account.
27
+ Creating new account is free. Just enter your e-mail address,Creating new account is free. Just enter your e-mail address
28
+ We will send you the password and generate trial License Key automaticaly.,We will send you the password and generate trial License Key automaticaly.
29
+ Linked,Linked
30
+ Orbittour,Orbittour
31
+ 360&deg;,360&deg;
32
+ 360°,360°
33
+ 2D,2D
34
+ Unlinked,Unlinked
35
+ Not linked,Not linked
36
+ No delay,No delay
37
+ "0,1 second","0,1 second"
38
+ "0,2 second","0,2 second"
39
+ "0,3 second","0,3 second"
40
+ "0,4 second","0,4 second"
41
+ half a second,half a second
42
+ Always use HTML5,Always use HTML5
43
+ "Use Flash if available, otherwise use HTML5","Use Flash if available, otherwise use HTML5"
44
+ "You need <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use Orbitvu extension.","You need <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use Orbitvu extension."
45
+ Register,Register
46
+ trial account or,trial account or
47
+ use DEMO License Key,use DEMO License Key
48
+ Views to the right,Views to the right
49
+ Views at the bottom,Views at the bottom
50
+ No views,No views
51
+ Use Orbitvu SUN setting,Use Orbitvu SUN setting
52
+ "Enable, if remote SKU is empty","Enable, if remote SKU is empty"
53
+ Auto-rotation,Auto-rotation
54
+ Play button enables rotation,Play button enables rotation
55
+ No teaser (static presentation),No teaser (static presentation)
56
+ Quick single rotation (make sense only if 360 presentation is your first gallery item),Quick single rotation (makes sense only if 360 presentation is your first gallery item)
57
+ Slow single rotation (make sense only if 360 presentation is your first gallery item),Slow single rotation (makes sense only if 360 presentation is your first gallery item)
58
+ Use Orbitvu SUN setting,Use Orbitvu SUN setting
59
+ Orbitvu SUN Synchronization,Orbitvu SUN Synchronization
60
+ Orbitvu SUN connection settings,Orbitvu SUN connection settings
61
+ License Key,License Key
62
+ Orbitvu SUN integration,Orbitvu SUN integration
63
+ Link Orbitvu SUN presentations to products automatically,Link Orbitvu SUN presentations to products automatically
64
+ Matching (by SKU or name) Orbitvu SUN presentation will be linked to new products immediately. Once a day we will check for changes at Orbitvu SUN and link matching presentations to products.,Matching (by SKU or name) Orbitvu SUN presentation will be linked to new products immediately. Once a day we will check for changes at Orbitvu SUN and link matching presentations to products.
65
+ Update presentation SKU on Orbitvu SUN automatically,Automatically update presentation SKU on Orbitvu SUN
66
+ Automatically update empty Presentation's SKU on Orbitvu SUN server when such Presentation is linked to Product.,Automatically update empty Presentation's SKU on Orbitvu SUN server when such Presentation is linked to Product.
67
+ Select what type of presentation content will be visible in store by default,Select what type of presentation content will be visible in store by default
68
+ Product view - gallery behavior,Product view - gallery behavior
69
+ Mouse over mode,Mouse over mode
70
+ Change presentation items in gallery with just mouse over instead of click.,Change presentation items in gallery with just mouse over instead of click.
71
+ 360° Presentation teaser,360° Presentation teaser
72
+ HTML5 or Flash mode,HTML5 or Flash mode
73
+ Orbittour views visibility,Orbittour views visibility
74
+ Product view - gallery layout (edit only if you know what are you doing!),Product view - gallery layout (edit only if you know what you are doing!)
75
+ Gallery width,Gallery width
76
+ Enter <strong>100%</strong> if you wan't to have responsive gallery layout (recommended),Enter <strong>100%</strong> if you want to have responsive gallery layout (recommended)
77
+ Gallery preview maximum width,Gallery maximum width
78
+ Recommended: Your layout proportion to gallery preview maximum height eg. <strong>600px</strong>,Recommended: Your layout proportion to gallery maximum height eg. <strong>600px</strong>
79
+ Gallery preview maximum height,Gallery maximum height
80
+ Recommended: <strong>300px</strong>,Recommended: <strong>300px</strong>
81
+ Gallery border color,Gallery border color
82
+ Recommended: <strong>#ccc</strong><br />Enter <strong>transparent</strong> if you don't want borders,Recommended: <strong>#ccc</strong><br />Enter <strong>transparent</strong> if you don't want borders
83
+ Internal zoom image width,Internal zoom image width
84
+ Recommended: <strong>1024px</strong>,Recommended: <strong>1024px</strong>
85
+ Internal zoom image height,Internal zoom image height
86
+ Recommended: <strong>768px</strong>,Recommended: <strong>768px</strong>
87
+ Thumbnail width,Thumbnail width
88
+ Recommended: <strong>75px</strong>,Recommended: <strong>75px</strong>
89
+ Thumbnail height,Thumbnail height
90
+ Recommended: <strong>50px</strong>,Recommended: <strong>50px</strong>
91
+ Thumbnail margin,Thumbnail margin
92
+ Recommended: <strong>3px</strong>,Recommended: <strong>3px</strong>
93
+ Button prev/next width,Button prev/next width
94
+ Recommended: <strong>30px</strong>,Recommended: <strong>30px</strong>
95
+ Button prev/next height,Button prev/next height
96
+ Recommended: <strong>53px</strong>,Recommended: <strong>53px</strong>
97
+ Button prev/next opacity,Button prev/next opacity
98
+ "1 = 100% (recommended), 0.5 = 50%, 0 = 0%","1 = 100% (recommended), 0.5 = 50%, 0 = 0%"
99
+ SKU,SKU
100
+ One of your presentations already has this SKU assigned. SKU need to be unique. Modify SKU on your SUN Server and try again.,This SKU is already in use by one of Orbitvu SUN presentations. Modify SKU on Orbitvu SUN and try again.
101
+ Your Orbitvu extension License Key is not valid. Please update your Key. Orbitvu extension functionality is now limited.,Your Orbitvu extension License Key is not valid. Please enter valid License Key. Orbitvu extension functionality is now limited.
102
+ Update your key,Update your License Key
103
+ Orbitvu extension is connected to DEMO account. Register Orbitvu SUN FREE trial account to create your own presentations.,Orbitvu extension uses DEMO account License Key. Register Orbitvu SUN FREE trial account to create your own presentations.
104
+ Get free trial,Get free trial
105
+ Version,Version
106
+ of Orbitvu extension is out!,of Orbitvu extension is out!
107
+ Upgrade now from,Upgrade now from
108
+ to,to
109
+ Your presentation has been unlinked. You can select a new one below.,Your presentation has been unlinked. You can select a new one below.
110
+ We used your product\'s SKU:,We used your product\'s SKU:
111
+ and name:,and name:
112
+ to match one of your SUN presentations.,to match one of your Orbitvu SUN presentations.
113
+ Link this presentation,Link this presentation
114
+ Select another one,Select another one
115
+ Confirm linking matched presentation,Confirm linking matched presentation
116
+ Select presentation from your Orbitvu SUN account to link with product,Select presentation from your Orbitvu SUN account to link with product
117
+ Page:,Page:
118
+ of,of
119
+ Per page:,Per page:
120
+ Total:,Total:
121
+ Date,Date
122
+ Name,Name
123
+ Enter presentation name or SKU...,Enter presentation name or SKU...
124
+ Search,Search
125
+ Reset,Reset
126
+ Do you really want to link this presentation with current product?,Do you really want to link this presentation with current product?
127
+ Orbitvu SUN presentation linked to current product,Orbitvu SUN presentation linked to current product
128
+ o you really want to update this presentation SKU on your Orbitvu SUN account?,Do you really want to update this presentation SKU on Orbitvu SUN?
129
+ Product\'s SKU:,Product\'s SKU:
130
+ . Presentation\'s SKU from Orbitvu SUN:,. Presentation\'s SKU from Orbitvu SUN:
131
+ "Click ""Update SKU on SUN"" button below to update your presentation\'s SKU on Orbitvu SUN with:","Click ""Update SKU on SUN"" button below to update your presentation\'s SKU on Orbitvu SUN with:"
132
+ We can\'t change your SUN Presentation SKU. One of your presentations already has this product SKU assigned. SKU need to be unique. Modify SKU on your SUN Server.,We can\'t change your Orbitvu SUN Presentation SKU because it is already in use by another presentation. SKU needs to be unique. Modify Presentation SKU on Orbitvu SUN Server to resolve the problem.
133
+ Do you really want to unlink this presentation?,Do you really want to unlink this presentation?
134
+ Unlink this presentation,Unlink this presentation
135
+ Edit on SUN,Edit on SUN
136
+ Drag &amp; move item,Drag &amp; move item
137
+ Hide item,Hide item
138
+ Show item,Show item
app/locale/es_ES/Orbitvu_Sun.csv ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Orbitvu,Orbitvu
2
+ Error!,Error!
3
+ OK,OK
4
+ Your account was created!,Your account was created!
5
+ Now you have your own account on Orbitvu SUN.<br />We sent your an email with details.,Orbitvu SUN account has been created for you.<br />Shortly you\'ll receive confirmation email.
6
+ Your trial License Key was created and it\'s now in use.,Your trial License Key was created and it\'s now in use.
7
+ Update your key,Update your key
8
+ Contact Orbitvu,Contact Orbitvu
9
+ License Key is not valid,License Key is not valid
10
+ Your Orbitvu extension License Key is not valid. Please update your Key. Orbitvu extension functionality is now limited.,Your Orbitvu extension License Key is not valid. Please enter valid License Key. Orbitvu extension functionality is now limited.
11
+ Orbitvu Extension Wizard,Orbitvu SUN Product Teleporting Extension Wizard
12
+ "You need a <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use the extension.","You need a <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use the extension."
13
+ Choose an option:,Choose an option:
14
+ Enter License Key,Enter License Key
15
+ Link Orbitvu SUN presentations to all products matched with SKU or name.,Link Orbitvu SUN presentations to all products matched with SKU or name.
16
+ Link Orbitvu SUN presentations,Link Orbitvu SUN presentations
17
+ Do you really want to link Orbitvu SUN presentations to all products matched with SKU or name?,Do you really want to link Orbitvu SUN presentations to all products matched with SKU or name?
18
+ This operation will only be applied to not yet linked products.,This operation will only be applied to not yet linked products.
19
+ Orbitvu Configuration,Orbitvu Configuration
20
+ close,close
21
+ Try extension with DEMO account,Try extension with DEMO account
22
+ You get access to predefined set of 360&deg; presentations.,You get access to predefined set of 360&deg; presentations.
23
+ Register Orbitvu SUN FREE trial account,Register Orbitvu SUN FREE trial account
24
+ Create and customize your own presentations.,Create and customize your own presentations.
25
+ Enter License Key,Enter License Key
26
+ Connect to your Orbitvu SUN account.,Connect to your Orbitvu SUN account.
27
+ Creating new account is free. Just enter your e-mail address,Creating new account is free. Just enter your e-mail address
28
+ We will send you the password and generate trial License Key automaticaly.,We will send you the password and generate trial License Key automaticaly.
29
+ Linked,Linked
30
+ Orbittour,Orbittour
31
+ 360&deg;,360&deg;
32
+ 360°,360°
33
+ 2D,2D
34
+ Unlinked,Unlinked
35
+ Not linked,Not linked
36
+ No delay,No delay
37
+ "0,1 second","0,1 second"
38
+ "0,2 second","0,2 second"
39
+ "0,3 second","0,3 second"
40
+ "0,4 second","0,4 second"
41
+ half a second,half a second
42
+ Always use HTML5,Always use HTML5
43
+ "Use Flash if available, otherwise use HTML5","Use Flash if available, otherwise use HTML5"
44
+ "You need <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use Orbitvu extension.","You need <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use Orbitvu extension."
45
+ Register,Register
46
+ trial account or,trial account or
47
+ use DEMO License Key,use DEMO License Key
48
+ Views to the right,Views to the right
49
+ Views at the bottom,Views at the bottom
50
+ No views,No views
51
+ Use Orbitvu SUN setting,Use Orbitvu SUN setting
52
+ "Enable, if remote SKU is empty","Enable, if remote SKU is empty"
53
+ Auto-rotation,Auto-rotation
54
+ Play button enables rotation,Play button enables rotation
55
+ No teaser (static presentation),No teaser (static presentation)
56
+ Quick single rotation (make sense only if 360 presentation is your first gallery item),Quick single rotation (makes sense only if 360 presentation is your first gallery item)
57
+ Slow single rotation (make sense only if 360 presentation is your first gallery item),Slow single rotation (makes sense only if 360 presentation is your first gallery item)
58
+ Use Orbitvu SUN setting,Use Orbitvu SUN setting
59
+ Orbitvu SUN Synchronization,Orbitvu SUN Synchronization
60
+ Orbitvu SUN connection settings,Orbitvu SUN connection settings
61
+ License Key,License Key
62
+ Orbitvu SUN integration,Orbitvu SUN integration
63
+ Link Orbitvu SUN presentations to products automatically,Link Orbitvu SUN presentations to products automatically
64
+ Matching (by SKU or name) Orbitvu SUN presentation will be linked to new products immediately. Once a day we will check for changes at Orbitvu SUN and link matching presentations to products.,Matching (by SKU or name) Orbitvu SUN presentation will be linked to new products immediately. Once a day we will check for changes at Orbitvu SUN and link matching presentations to products.
65
+ Update presentation SKU on Orbitvu SUN automatically,Automatically update presentation SKU on Orbitvu SUN
66
+ Automatically update empty Presentation's SKU on Orbitvu SUN server when such Presentation is linked to Product.,Automatically update empty Presentation's SKU on Orbitvu SUN server when such Presentation is linked to Product.
67
+ Select what type of presentation content will be visible in store by default,Select what type of presentation content will be visible in store by default
68
+ Product view - gallery behavior,Product view - gallery behavior
69
+ Mouse over mode,Mouse over mode
70
+ Change presentation items in gallery with just mouse over instead of click.,Change presentation items in gallery with just mouse over instead of click.
71
+ 360° Presentation teaser,360° Presentation teaser
72
+ HTML5 or Flash mode,HTML5 or Flash mode
73
+ Orbittour views visibility,Orbittour views visibility
74
+ Product view - gallery layout (edit only if you know what are you doing!),Product view - gallery layout (edit only if you know what you are doing!)
75
+ Gallery width,Gallery width
76
+ Enter <strong>100%</strong> if you wan't to have responsive gallery layout (recommended),Enter <strong>100%</strong> if you want to have responsive gallery layout (recommended)
77
+ Gallery preview maximum width,Gallery maximum width
78
+ Recommended: Your layout proportion to gallery preview maximum height eg. <strong>600px</strong>,Recommended: Your layout proportion to gallery maximum height eg. <strong>600px</strong>
79
+ Gallery preview maximum height,Gallery maximum height
80
+ Recommended: <strong>300px</strong>,Recommended: <strong>300px</strong>
81
+ Gallery border color,Gallery border color
82
+ Recommended: <strong>#ccc</strong><br />Enter <strong>transparent</strong> if you don't want borders,Recommended: <strong>#ccc</strong><br />Enter <strong>transparent</strong> if you don't want borders
83
+ Internal zoom image width,Internal zoom image width
84
+ Recommended: <strong>1024px</strong>,Recommended: <strong>1024px</strong>
85
+ Internal zoom image height,Internal zoom image height
86
+ Recommended: <strong>768px</strong>,Recommended: <strong>768px</strong>
87
+ Thumbnail width,Thumbnail width
88
+ Recommended: <strong>75px</strong>,Recommended: <strong>75px</strong>
89
+ Thumbnail height,Thumbnail height
90
+ Recommended: <strong>50px</strong>,Recommended: <strong>50px</strong>
91
+ Thumbnail margin,Thumbnail margin
92
+ Recommended: <strong>3px</strong>,Recommended: <strong>3px</strong>
93
+ Button prev/next width,Button prev/next width
94
+ Recommended: <strong>30px</strong>,Recommended: <strong>30px</strong>
95
+ Button prev/next height,Button prev/next height
96
+ Recommended: <strong>53px</strong>,Recommended: <strong>53px</strong>
97
+ Button prev/next opacity,Button prev/next opacity
98
+ "1 = 100% (recommended), 0.5 = 50%, 0 = 0%","1 = 100% (recommended), 0.5 = 50%, 0 = 0%"
99
+ SKU,SKU
100
+ One of your presentations already has this SKU assigned. SKU need to be unique. Modify SKU on your SUN Server and try again.,This SKU is already in use by one of Orbitvu SUN presentations. Modify SKU on Orbitvu SUN and try again.
101
+ Your Orbitvu extension License Key is not valid. Please update your Key. Orbitvu extension functionality is now limited.,Your Orbitvu extension License Key is not valid. Please enter valid License Key. Orbitvu extension functionality is now limited.
102
+ Update your key,Update your License Key
103
+ Orbitvu extension is connected to DEMO account. Register Orbitvu SUN FREE trial account to create your own presentations.,Orbitvu extension uses DEMO account License Key. Register Orbitvu SUN FREE trial account to create your own presentations.
104
+ Get free trial,Get free trial
105
+ Version,Version
106
+ of Orbitvu extension is out!,of Orbitvu extension is out!
107
+ Upgrade now from,Upgrade now from
108
+ to,to
109
+ Your presentation has been unlinked. You can select a new one below.,Your presentation has been unlinked. You can select a new one below.
110
+ We used your product\'s SKU:,We used your product\'s SKU:
111
+ and name:,and name:
112
+ to match one of your SUN presentations.,to match one of your Orbitvu SUN presentations.
113
+ Link this presentation,Link this presentation
114
+ Select another one,Select another one
115
+ Confirm linking matched presentation,Confirm linking matched presentation
116
+ Select presentation from your Orbitvu SUN account to link with product,Select presentation from your Orbitvu SUN account to link with product
117
+ Page:,Page:
118
+ of,of
119
+ Per page:,Per page:
120
+ Total:,Total:
121
+ Date,Date
122
+ Name,Name
123
+ Enter presentation name or SKU...,Enter presentation name or SKU...
124
+ Search,Search
125
+ Reset,Reset
126
+ Do you really want to link this presentation with current product?,Do you really want to link this presentation with current product?
127
+ Orbitvu SUN presentation linked to current product,Orbitvu SUN presentation linked to current product
128
+ o you really want to update this presentation SKU on your Orbitvu SUN account?,Do you really want to update this presentation SKU on Orbitvu SUN?
129
+ Product\'s SKU:,Product\'s SKU:
130
+ . Presentation\'s SKU from Orbitvu SUN:,. Presentation\'s SKU from Orbitvu SUN:
131
+ "Click ""Update SKU on SUN"" button below to update your presentation\'s SKU on Orbitvu SUN with:","Click ""Update SKU on SUN"" button below to update your presentation\'s SKU on Orbitvu SUN with:"
132
+ We can\'t change your SUN Presentation SKU. One of your presentations already has this product SKU assigned. SKU need to be unique. Modify SKU on your SUN Server.,We can\'t change your Orbitvu SUN Presentation SKU because it is already in use by another presentation. SKU needs to be unique. Modify Presentation SKU on Orbitvu SUN Server to resolve the problem.
133
+ Do you really want to unlink this presentation?,Do you really want to unlink this presentation?
134
+ Unlink this presentation,Unlink this presentation
135
+ Edit on SUN,Edit on SUN
136
+ Drag &amp; move item,Drag &amp; move item
137
+ Hide item,Hide item
138
+ Show item,Show item
app/locale/pl_PL/Orbitvu_Sun.csv ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Orbitvu,Orbitvu
2
+ Error!,Error!
3
+ OK,OK
4
+ Your account was created!,Your account was created!
5
+ Now you have your own account on Orbitvu SUN.<br />We sent your an email with details.,Orbitvu SUN account has been created for you.<br />Shortly you\'ll receive confirmation email.
6
+ Your trial License Key was created and it\'s now in use.,Your trial License Key was created and it\'s now in use.
7
+ Update your key,Update your key
8
+ Contact Orbitvu,Contact Orbitvu
9
+ License Key is not valid,License Key is not valid
10
+ Your Orbitvu extension License Key is not valid. Please update your Key. Orbitvu extension functionality is now limited.,Your Orbitvu extension License Key is not valid. Please enter valid License Key. Orbitvu extension functionality is now limited.
11
+ Orbitvu Extension Wizard,Orbitvu SUN Product Teleporting Extension Wizard
12
+ "You need a <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use the extension.","You need a <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use the extension."
13
+ Choose an option:,Choose an option:
14
+ Enter License Key,Enter License Key
15
+ Link Orbitvu SUN presentations to all products matched with SKU or name.,Link Orbitvu SUN presentations to all products matched with SKU or name.
16
+ Link Orbitvu SUN presentations,Link Orbitvu SUN presentations
17
+ Do you really want to link Orbitvu SUN presentations to all products matched with SKU or name?,Do you really want to link Orbitvu SUN presentations to all products matched with SKU or name?
18
+ This operation will only be applied to not yet linked products.,This operation will only be applied to not yet linked products.
19
+ Orbitvu Configuration,Orbitvu Configuration
20
+ close,close
21
+ Try extension with DEMO account,Try extension with DEMO account
22
+ You get access to predefined set of 360&deg; presentations.,You get access to predefined set of 360&deg; presentations.
23
+ Register Orbitvu SUN FREE trial account,Register Orbitvu SUN FREE trial account
24
+ Create and customize your own presentations.,Create and customize your own presentations.
25
+ Enter License Key,Enter License Key
26
+ Connect to your Orbitvu SUN account.,Connect to your Orbitvu SUN account.
27
+ Creating new account is free. Just enter your e-mail address,Creating new account is free. Just enter your e-mail address
28
+ We will send you the password and generate trial License Key automaticaly.,We will send you the password and generate trial License Key automaticaly.
29
+ Linked,Linked
30
+ Orbittour,Orbittour
31
+ 360&deg;,360&deg;
32
+ 360°,360°
33
+ 2D,2D
34
+ Unlinked,Unlinked
35
+ Not linked,Not linked
36
+ No delay,No delay
37
+ "0,1 second","0,1 second"
38
+ "0,2 second","0,2 second"
39
+ "0,3 second","0,3 second"
40
+ "0,4 second","0,4 second"
41
+ half a second,half a second
42
+ Always use HTML5,Always use HTML5
43
+ "Use Flash if available, otherwise use HTML5","Use Flash if available, otherwise use HTML5"
44
+ "You need <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use Orbitvu extension.","You need <a href=""http://orbitvu.co"" target=""_blank"">Orbitvu SUN</a> account and License Key to use Orbitvu extension."
45
+ Register,Register
46
+ trial account or,trial account or
47
+ use DEMO License Key,use DEMO License Key
48
+ Views to the right,Views to the right
49
+ Views at the bottom,Views at the bottom
50
+ No views,No views
51
+ Use Orbitvu SUN setting,Use Orbitvu SUN setting
52
+ "Enable, if remote SKU is empty","Enable, if remote SKU is empty"
53
+ Auto-rotation,Auto-rotation
54
+ Play button enables rotation,Play button enables rotation
55
+ No teaser (static presentation),No teaser (static presentation)
56
+ Quick single rotation (make sense only if 360 presentation is your first gallery item),Quick single rotation (makes sense only if 360 presentation is your first gallery item)
57
+ Slow single rotation (make sense only if 360 presentation is your first gallery item),Slow single rotation (makes sense only if 360 presentation is your first gallery item)
58
+ Use Orbitvu SUN setting,Use Orbitvu SUN setting
59
+ Orbitvu SUN Synchronization,Orbitvu SUN Synchronization
60
+ Orbitvu SUN connection settings,Orbitvu SUN connection settings
61
+ License Key,License Key
62
+ Orbitvu SUN integration,Orbitvu SUN integration
63
+ Link Orbitvu SUN presentations to products automatically,Link Orbitvu SUN presentations to products automatically
64
+ Matching (by SKU or name) Orbitvu SUN presentation will be linked to new products immediately. Once a day we will check for changes at Orbitvu SUN and link matching presentations to products.,Matching (by SKU or name) Orbitvu SUN presentation will be linked to new products immediately. Once a day we will check for changes at Orbitvu SUN and link matching presentations to products.
65
+ Update presentation SKU on Orbitvu SUN automatically,Automatically update presentation SKU on Orbitvu SUN
66
+ Automatically update empty Presentation's SKU on Orbitvu SUN server when such Presentation is linked to Product.,Automatically update empty Presentation's SKU on Orbitvu SUN server when such Presentation is linked to Product.
67
+ Select what type of presentation content will be visible in store by default,Select what type of presentation content will be visible in store by default
68
+ Product view - gallery behavior,Product view - gallery behavior
69
+ Mouse over mode,Mouse over mode
70
+ Change presentation items in gallery with just mouse over instead of click.,Change presentation items in gallery with just mouse over instead of click.
71
+ 360° Presentation teaser,360° Presentation teaser
72
+ HTML5 or Flash mode,HTML5 or Flash mode
73
+ Orbittour views visibility,Orbittour views visibility
74
+ Product view - gallery layout (edit only if you know what are you doing!),Product view - gallery layout (edit only if you know what you are doing!)
75
+ Gallery width,Gallery width
76
+ Enter <strong>100%</strong> if you wan't to have responsive gallery layout (recommended),Enter <strong>100%</strong> if you want to have responsive gallery layout (recommended)
77
+ Gallery preview maximum width,Gallery maximum width
78
+ Recommended: Your layout proportion to gallery preview maximum height eg. <strong>600px</strong>,Recommended: Your layout proportion to gallery maximum height eg. <strong>600px</strong>
79
+ Gallery preview maximum height,Gallery maximum height
80
+ Recommended: <strong>300px</strong>,Recommended: <strong>300px</strong>
81
+ Gallery border color,Gallery border color
82
+ Recommended: <strong>#ccc</strong><br />Enter <strong>transparent</strong> if you don't want borders,Recommended: <strong>#ccc</strong><br />Enter <strong>transparent</strong> if you don't want borders
83
+ Internal zoom image width,Internal zoom image width
84
+ Recommended: <strong>1024px</strong>,Recommended: <strong>1024px</strong>
85
+ Internal zoom image height,Internal zoom image height
86
+ Recommended: <strong>768px</strong>,Recommended: <strong>768px</strong>
87
+ Thumbnail width,Thumbnail width
88
+ Recommended: <strong>75px</strong>,Recommended: <strong>75px</strong>
89
+ Thumbnail height,Thumbnail height
90
+ Recommended: <strong>50px</strong>,Recommended: <strong>50px</strong>
91
+ Thumbnail margin,Thumbnail margin
92
+ Recommended: <strong>3px</strong>,Recommended: <strong>3px</strong>
93
+ Button prev/next width,Button prev/next width
94
+ Recommended: <strong>30px</strong>,Recommended: <strong>30px</strong>
95
+ Button prev/next height,Button prev/next height
96
+ Recommended: <strong>53px</strong>,Recommended: <strong>53px</strong>
97
+ Button prev/next opacity,Button prev/next opacity
98
+ "1 = 100% (recommended), 0.5 = 50%, 0 = 0%","1 = 100% (recommended), 0.5 = 50%, 0 = 0%"
99
+ SKU,SKU
100
+ One of your presentations already has this SKU assigned. SKU need to be unique. Modify SKU on your SUN Server and try again.,This SKU is already in use by one of Orbitvu SUN presentations. Modify SKU on Orbitvu SUN and try again.
101
+ Your Orbitvu extension License Key is not valid. Please update your Key. Orbitvu extension functionality is now limited.,Your Orbitvu extension License Key is not valid. Please enter valid License Key. Orbitvu extension functionality is now limited.
102
+ Update your key,Update your License Key
103
+ Orbitvu extension is connected to DEMO account. Register Orbitvu SUN FREE trial account to create your own presentations.,Orbitvu extension uses DEMO account License Key. Register Orbitvu SUN FREE trial account to create your own presentations.
104
+ Get free trial,Get free trial
105
+ Version,Version
106
+ of Orbitvu extension is out!,of Orbitvu extension is out!
107
+ Upgrade now from,Upgrade now from
108
+ to,to
109
+ Your presentation has been unlinked. You can select a new one below.,Your presentation has been unlinked. You can select a new one below.
110
+ We used your product\'s SKU:,We used your product\'s SKU:
111
+ and name:,and name:
112
+ to match one of your SUN presentations.,to match one of your Orbitvu SUN presentations.
113
+ Link this presentation,Link this presentation
114
+ Select another one,Select another one
115
+ Confirm linking matched presentation,Confirm linking matched presentation
116
+ Select presentation from your Orbitvu SUN account to link with product,Select presentation from your Orbitvu SUN account to link with product
117
+ Page:,Page:
118
+ of,of
119
+ Per page:,Per page:
120
+ Total:,Total:
121
+ Date,Date
122
+ Name,Name
123
+ Enter presentation name or SKU...,Enter presentation name or SKU...
124
+ Search,Search
125
+ Reset,Reset
126
+ Do you really want to link this presentation with current product?,Do you really want to link this presentation with current product?
127
+ Orbitvu SUN presentation linked to current product,Orbitvu SUN presentation linked to current product
128
+ o you really want to update this presentation SKU on your Orbitvu SUN account?,Do you really want to update this presentation SKU on Orbitvu SUN?
129
+ Product\'s SKU:,Product\'s SKU:
130
+ . Presentation\'s SKU from Orbitvu SUN:,. Presentation\'s SKU from Orbitvu SUN:
131
+ "Click ""Update SKU on SUN"" button below to update your presentation\'s SKU on Orbitvu SUN with:","Click ""Update SKU on SUN"" button below to update your presentation\'s SKU on Orbitvu SUN with:"
132
+ We can\'t change your SUN Presentation SKU. One of your presentations already has this product SKU assigned. SKU need to be unique. Modify SKU on your SUN Server.,We can\'t change your Orbitvu SUN Presentation SKU because it is already in use by another presentation. SKU needs to be unique. Modify Presentation SKU on Orbitvu SUN Server to resolve the problem.
133
+ Do you really want to unlink this presentation?,Do you really want to unlink this presentation?
134
+ Unlink this presentation,Unlink this presentation
135
+ Edit on SUN,Edit on SUN
136
+ Drag &amp; move item,Drag &amp; move item
137
+ Hide item,Hide item
138
+ Show item,Show item
crossdomain.xml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
2
+ <cross-domain-policy>
3
+ <allow-access-from domain="*" secure="false"/>
4
+ </cross-domain-policy>
media/orbitvu/black.png ADDED
Binary file
media/orbitvu/blue.png ADDED
Binary file
media/orbitvu/loader.gif ADDED
Binary file
media/orbitvu/logo.png ADDED
Binary file
media/orbitvu/orbit.png ADDED
Binary file
media/orbitvu/placeholder.png ADDED
Binary file
media/orbitvu/thumbnails/index ADDED
File without changes
media/orbitvu/white.png ADDED
Binary file
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Orbitvu_Sun</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>Commercial</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Automate and improve your customer's expierience with dynamic zoom, 360&#xB0;/3D spins, product tours using ORBITVU imaging solution.</summary>
10
+ <description>Orbitvu SUN Product Teleporting extension will improve your store product experience with interactive product tours, 360&#xB0;/3D image spins and dynamic zoom on desktop and mobile. It will automate and facilitate your imaging workflow as never before.&#xD;
11
+ &#xD;
12
+ This extension is provided by ORBITVU &#x2013; the global leader for automated imaging solutions. It is a part of ORBITVU end to end imaging solutions and requires ORBITVU SUN account to function (DEMO available without registration).</description>
13
+ <notes>Official release - first stable version.</notes>
14
+ <authors><author><name>Orbitvu</name><user>dev</user><email>dev@orbitvu.com</email></author></authors>
15
+ <date>2014-08-11</date>
16
+ <time>13:14:44</time>
17
+ <contents><target name="magecommunity"><dir name="Orbitvu"><dir><dir name="Sun"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><file name="Grid.php" hash="0e87f8f32e40791c842e5fb70ebc3599"/><file name="Gridrenderer.php" hash="b86affaf935201508bb02e4b8975c988"/></dir></dir><dir name="Tabs"><file name="Tabid.php" hash="b90c1cac87797ebf579b7ebe694e53d3"/></dir><file name="Tabs.php" hash="7ff73221277099c0c1124061ccbe7132"/></dir><file name="Delay.php" hash="570f327292c20cfc3e2ec5faf0687116"/><file name="Html5.php" hash="b7a6020751d85af690eed068a0f5eaf8"/><file name="KeyComment.php" hash="3a832bb181f1e709d5cf4bba4f55338f"/><file name="Orbittour.php" hash="f9d6c22b7c37b58771119dc2af3f0b00"/><dir name="Product"><dir name="View"><file name="Media.php" hash="d6c5268510a19afcd3ef273634913373"/></dir></dir><file name="Syncsku.php" hash="dd57437599190a466d9ccf3ec8d47890"/><file name="Teaser.php" hash="f67f531671bcad679b433d7635236a35"/></dir><dir name="Model"><file name="Observer.php" hash="0f559cd3e5a9940326e8da10480cc22f"/><dir name="Resource"><file name="Setup.php" hash="2cfd8dccd322e056cb4816e697bd9efd"/><file name="Sun.php" hash="8322d1a43b6aee941dc297bf31253504"/></dir></dir><dir name="controllers"><file name="OrbitvuAdmin.php" hash="b4cd5fb862f69998f0c34b432a9d9140"/><file name="OrbitvuConnect.php" hash="bcab024255d32278eeee51d74d825b28"/><file name="OrbitvuDatabaseDriver.php" hash="a5b6ce6f9745d6b65d2bad253ec5f575"/><file name="OrbitvuDatabaseInterface.php" hash="5c2875ec7b3e04604e017112760fd3fd"/><file name="OrbitvuDebugger.php" hash="719168e8e40cecd69a0e0ef0a45978ad"/><file name="OrbitvuTests.php" hash="dde56bcf50d16cf7613a4e3ae4093a30"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a591f49aaf7da8e8d22f545f3904bb95"/><file name="config.xml" hash="3f37a1982913fb1e786a89a98527f001"/><file name="local.xml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="system.xml" hash="0f72d5d05fb23362ccd869af21447e71"/><file name="translations.xml" hash="47ff4445ef63971e669c5f34cd2376fb"/></dir><dir name="sql"><dir name="sun_setup"><file name="mysql4-install-1.0.0.php" hash="41fce1506739a3d09142984c51524bcb"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="sun"><file name="orbitvu.phtml" hash="4862b34ed4be2d5d6eee8c0adede7297"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="sun.xml" hash="08f04468f5e883345cad2e6f5f9c4666"/></dir><dir name="template"><dir name="orbitvu"><dir name="product"><dir name="view"><file name="media.phtml" hash="f89d15e4a917b25e291e1ad0baacfaad"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="orbitvu"><file name="black.png" hash="64dcb45b20e5e2e0cc07c62a843f8f68"/><file name="blue.png" hash="fa8b00e52ec0bf7cb9937b1d5789740c"/><file name="loader.gif" hash="875eec6b429c57e0eff9ba7c182072cd"/><file name="logo.png" hash="622ada057aadbe23af717431e85ef94f"/><file name="orbit.png" hash="c390d8598792d9cc86b19e9afef0ea4a"/><file name="placeholder.png" hash="43b6e81dc733e7d8fb279e54b5f39b3f"/><dir><dir name="thumbnails"><file name="index" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir><file name="white.png" hash="ff7713f7b45a4b7a4b5d8304eb3c655c"/></dir></target><target name="mage"><dir name="."><file name="crossdomain.xml" hash="6960cde6dd98feb5406c6b185521b041"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Orbitvu_Sun.csv" hash="7c5ea48271819e56b9253d2660012728"/></dir><dir name="en_US"><file name="Orbitvu_Sun.csv" hash="7c5ea48271819e56b9253d2660012728"/><file name="Orbitvu_Sun.csv" hash="7c5ea48271819e56b9253d2660012728"/></dir><dir name="es_ES"><file name="Orbitvu_Sun.csv" hash="7c5ea48271819e56b9253d2660012728"/></dir><dir name="pl_PL"><file name="Orbitvu_Sun.csv" hash="7c5ea48271819e56b9253d2660012728"/></dir></target><target name="mageetc"><dir name="modules"><file name="Orbitvu_Sun.xml" hash="76f32cd06e5fb1aa4eda72a34c010d99"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
20
+ </package>