Robogento_Product_View - Version 1.0.0

Version Notes

Made by Robogento

Download this release

Release Info

Developer Magento Core Team
Extension Robogento_Product_View
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Robogento/Admin/Block/Adminhtml/Popup.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ */
13
+
14
+ /**
15
+ * Popup block that will generate the actual popup as displayed in the admin
16
+ *
17
+ * @author Rian Orie
18
+ * @license Copyright 2014 Robogento
19
+ * @created 01-05-2014
20
+ * @version 1.0
21
+ */
22
+ class Robogento_Admin_Block_Adminhtml_Popup extends Mage_Core_Block_Template
23
+ {
24
+ /**
25
+ * Class constructor, defines all the bases for the popupp
26
+ */
27
+ public function __construct()
28
+ {
29
+ // This is clunky as hell, but the controller refuses to update the admin/session
30
+ // properly
31
+ if (Mage::app()->getRequest()->getParam('roboadmin', null) == 'close') {
32
+ Mage::getSingleton('admin/session')->setRobogentoPopupShown(true);
33
+
34
+ }
35
+
36
+ if ( Mage::getSingleton('admin/session')->isLoggedIn()
37
+ && ! Mage::getStoreConfigFlag('roboadmin/popup/registered', 0)
38
+ && Mage::getSingleton('admin/session')->getRobogentoPopupShown() !== true) {
39
+
40
+ $this->setTemplate('notification/window.phtml');
41
+
42
+ $html = '</p>
43
+ <form action="'.Mage::getUrl('roboadmin/popup/register').'" id="robogentoregister" method="post"><p>
44
+ <input type="text" name="name" class="required-entry input-text" style="float:left; margin-right: 5px;" value="'.Mage::getSingleton('admin/session')->getUser()->getName().'" />
45
+ <input type="text" name="email" class="required-entry validate-email input-text" style="float:left; margin-right: 5px;" value="'.Mage::getSingleton('admin/session')->getUser()->getEmail().'" />
46
+ <button type="submit" id="register-robogento" style="float: left; padding-top: 1px;" class="form-button">
47
+ <span>'.$this->__('Ok!').'</span>
48
+ </button>
49
+ </p></form>
50
+ <script type="text/javascript">
51
+ var roboForm = new varienForm(\'robogentoregister\');
52
+ </script>
53
+ <p>
54
+ ';
55
+
56
+ $msg = Mage::getStoreConfig('roboadmin/popup/message');
57
+ if (empty($msg)) {
58
+ $msg = 'Click OK to register your e-mail and receive FREE support on your FREE module from Robogento!';
59
+ }
60
+
61
+ $this->setHeaderText( $this->__('Robogento Registration') );
62
+ $this->setCloseText($this->__('Close') );
63
+ $this->setSeverityText('');
64
+ $this->setSeverityIconsUrl('https://robogento.com/skin/frontend/robomanager/robot.png');
65
+ $this->setNoticeMessageText($this->__($msg).$html );
66
+ $this->setNoticeMessageUrl('javascript:stopRobogentoPopup();');
67
+ $this->setReadDetailsText($this->__('no thanks and don\'t show this popup again') );
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Can the popup be shown
73
+ *
74
+ * @return bool
75
+ */
76
+ public function canShow()
77
+ {
78
+ return true;
79
+ }
80
+
81
+ /**
82
+ * Generate HTML output for the block
83
+ *
84
+ * @return string
85
+ */
86
+ public function _toHtml()
87
+ {
88
+ if (Mage::getSingleton('admin/session')->isLoggedIn()) {
89
+ return parent::_toHtml() . $this->getScript();
90
+ }
91
+
92
+ return parent::_toHtml();
93
+ }
94
+
95
+ /**
96
+ * Generate a piece of javascript that we use to adjust the popup
97
+ *
98
+ * @return string
99
+ */
100
+ public function getScript()
101
+ {
102
+ return '<script type="text/javascript">
103
+ var icon = $$("#message-popup-window .message-icon");
104
+ if (icon && icon.length > 0) {
105
+ icon[0].style.backgroundSize = "auto 100%";
106
+ }
107
+
108
+ el = $$("#message-popup-window .message-popup-head a");
109
+ if (el && el.length > 0) {
110
+ el = el[0];
111
+ el.writeAttribute("onclick", "");
112
+ el.href = \''.Mage::getUrl('roboadmin/popup/close').'\';
113
+ el.target = "_self";
114
+ }
115
+
116
+ function stopRobogentoPopup() {
117
+ window.location = \''.Mage::getUrl('roboadmin/popup/end').'\';
118
+ }
119
+ </script>';
120
+ }
121
+ }
app/code/community/Robogento/Admin/Block/Adminhtml/System/Config/Fieldset/Banner.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ */
13
+
14
+ /**
15
+ * Renderer for Robogento header
16
+ *
17
+ * @author Rian Orie
18
+ * @license Copyright 2014 Robogento
19
+ * @created 01-05-2014
20
+ * @version 1.0
21
+ */
22
+ class Robogento_Admin_Block_Adminhtml_System_Config_Fieldset_Banner extends Varien_Data_Form_Element_Fieldset
23
+ implements Varien_Data_Form_Element_Renderer_Interface
24
+ {
25
+ /**
26
+ * Custom renderer for Robogento Admin
27
+ *
28
+ * @param Varien_Data_Form_Element_Abstract $element
29
+ *
30
+ * @return string
31
+ */
32
+ public function render(Varien_Data_Form_Element_Abstract $element)
33
+ {
34
+ return '
35
+ <div class="robogento-notice" style="border: 1px solid #999; height: 110px; background: #4B4B4B;">
36
+ <div style="float: left;height: 110px; margin-left: 5px;">
37
+ <img src="'.Mage::getStoreConfig('roboadmin/urls/log').'?img=logo" alt="Robogento" style="margin: 30px 0 20px 20px;display: block;" />
38
+ <p style="color: #fff;margin-left: 10px;">'.$this->__('Need help? Take a look at %s or get %s', '<a target="_blank" href="http://robogento.com">'.$this->__('our website').'</a>', '<a target="_blank" href="http://robogento.com/contact-us/">'.$this->__('in touch').'</a>').'</p>
39
+ </div>
40
+ <img src="'.Mage::getStoreConfig('roboadmin/urls/log').'?img=robot&info='.Mage::helper('roboadmin/remote')->getSystemInfo().'" alt="Robogento" style="float:left;margin-left: 50px;" height="110" />
41
+ </div>';
42
+ }
43
+
44
+ protected function _getHeaderHtml($element)
45
+ {
46
+ return $this->getId();
47
+ }
48
+ }
app/code/community/Robogento/Admin/Block/Adminhtml/System/Config/Fieldset/Modules.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ */
13
+
14
+ /**
15
+ * Renderer for nested shop in the Magento admin
16
+ *
17
+ * @author Rian Orie
18
+ * @license Copyright 2014 Robogento
19
+ * @created 01-05-2014
20
+ * @version 1.0
21
+ */
22
+ class Robogento_Admin_Block_Adminhtml_System_Config_Fieldset_Modules extends Varien_Data_Form_Element_Fieldset
23
+ implements Varien_Data_Form_Element_Renderer_Interface
24
+ {
25
+ /**
26
+ * Custom renderer for Robogento Admin
27
+ *
28
+ * @param Varien_Data_Form_Element_Abstract $element
29
+ *
30
+ * @return string
31
+ */
32
+ public function render(Varien_Data_Form_Element_Abstract $element)
33
+ {
34
+ $remote = Mage::helper('roboadmin/remote');
35
+ $url = Mage::getStoreConfig('roboadmin/urls/store').'?info='.$remote->getSystemInfo();
36
+
37
+ $data = $remote->load($url);
38
+
39
+ return $data;
40
+ }
41
+ }
app/code/community/Robogento/Admin/Block/Adminhtml/System/Config/Form/Fieldset.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ */
13
+
14
+ /**
15
+ * Custom renderer for the admin configuration area
16
+ *
17
+ * @author Rian Orie
18
+ * @license Copyright 2014 Robogento
19
+ * @created 01-05-2014
20
+ * @version 1.0
21
+ */
22
+ class Robogento_Admin_Block_Adminhtml_System_Config_Form_Fieldset extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
23
+ {
24
+ /**
25
+ * {@inheritdoc}
26
+ */
27
+ public function render(Varien_Data_Form_Element_Abstract $element)
28
+ {
29
+ if (strpos($element->getId(), 'robogentomodules') !== false) {
30
+ return $this->renderModules();
31
+ } elseif (strpos($element->getId(), 'robogentobanner') !== false) {
32
+ return $this->renderBanner();
33
+ }
34
+
35
+ $html = $this->_getHeaderHtml($element);
36
+
37
+ foreach ($element->getSortedElements() as $field) {
38
+ $html.= $field->toHtml();
39
+ }
40
+
41
+ $html .= $this->_getFooterHtml($element);
42
+
43
+ return $html;
44
+ }
45
+
46
+ /**
47
+ * Custom renderer for Robogento Admin
48
+ *
49
+ * @return string
50
+ */
51
+ public function renderBanner()
52
+ {
53
+ return '
54
+ <div class="robogento-notice" style="border: 1px solid #999; height: 110px; background: #4B4B4B;">
55
+ <div style="float: left;height: 110px; margin-left: 5px;">
56
+ <img src="'.Mage::getStoreConfig('roboadmin/urls/log').'?img=logo" alt="Robogento" style="margin: 30px 0 20px 20px;display: block;" />
57
+ <p style="color: #fff;margin-left: 10px;">'.$this->__('Need help? Take a look at %s or get %s', '<a target="_blank" href="http://robogento.com">'.$this->__('our website').'</a>', '<a target="_blank" href="http://robogento.com/contact-us/">'.$this->__('in touch').'</a>').'</p>
58
+ </div>
59
+ <img src="'.Mage::getStoreConfig('roboadmin/urls/log').'?img=robot&info='.Mage::helper('roboadmin/remote')->getSystemInfo().'" alt="Robogento" style="float:left;margin-left: 50px;" height="110" />
60
+ </div>';
61
+ }
62
+
63
+ /**
64
+ * Custom renderer for Robogento Admin
65
+ *
66
+ * @return string
67
+ */
68
+ public function renderModules()
69
+ {
70
+ $remote = Mage::helper('roboadmin/remote');
71
+ $url = Mage::getStoreConfig('roboadmin/urls/store').'?info='.$remote->getSystemInfo();
72
+
73
+ return $remote->load($url);
74
+ }
75
+ }
app/code/community/Robogento/Admin/Helper/Data.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ */
13
+
14
+ /**
15
+ * Base data helper
16
+ *
17
+ * @author Rian Orie
18
+ * @license Copyright 2014 Robogento
19
+ * @created 01-05-2014
20
+ * @version 1.0
21
+ */
22
+ class Robogento_Admin_Helper_Data extends Mage_Core_Helper_Data
23
+ {
24
+ }
app/code/community/Robogento/Admin/Helper/Remote.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ */
13
+
14
+ /**
15
+ * Helper for handling remote interactions with the Robogento system
16
+ *
17
+ * @author Rian Orie
18
+ * @license Copyright 2014 Robogento
19
+ * @created 01-05-2014
20
+ * @version 1.0
21
+ */
22
+ class Robogento_Admin_Helper_Remote extends Mage_Core_Helper_Abstract
23
+ {
24
+ /**
25
+ * Load a remote url and parse its output. Method assumes the remote urls are Robogento URLs.
26
+ *
27
+ * @param string $path
28
+ *
29
+ * @return Zend_Http_Response
30
+ * @throws Zend_Http_Client_Exception
31
+ */
32
+ public function load($path)
33
+ {
34
+ $client = new Zend_Http_Client($path, array('ssltransport' => true,
35
+ 'adapter' => 'Zend_Http_Client_Adapter_Curl',
36
+ 'curloptions' => array(CURLOPT_FOLLOWLOCATION => true)));
37
+ $request = $client->request();
38
+
39
+ return $request->getBody();
40
+ }
41
+
42
+ /**
43
+ * Return the system info in an encoded version
44
+ *
45
+ * @return string
46
+ */
47
+ public function getSystemInfo()
48
+ {
49
+ $info = array('modules' => array(), 'magento' => array());
50
+ $edition = 'Community';
51
+
52
+ $modules = Mage::getConfig()->getNode('modules')->children();
53
+ foreach($modules as $k => $m) {
54
+ if (strpos($k, 'Robogento') !== false) {
55
+ $info['modules'][] = array('module' => $k, 'version' => (string)$m->version);
56
+
57
+ } elseif ($k == 'Enterprise_Enterprise') {
58
+ $edition = 'Enterprise';
59
+ }
60
+ }
61
+
62
+
63
+ if (method_exists('Mage', 'getEdition')) {
64
+ $edition = Mage::getEdition();
65
+ }
66
+
67
+ $info['magento'] = array('site' => Mage::getBaseUrl(), 'edition' => $edition, 'version' => Mage::getVersion());
68
+
69
+ return base64_encode(json_encode($info));
70
+ }
71
+ }
app/code/community/Robogento/Admin/Model/Feed.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ */
13
+
14
+ /**
15
+ * Feed class to import Robogento notifications
16
+ *
17
+ * @author Rian Orie
18
+ * @license Copyright 2014 Robogento
19
+ * @created 01-05-2014
20
+ * @version 1.0
21
+ */
22
+ class Robogento_Admin_Model_Feed extends Mage_AdminNotification_Model_Feed
23
+ {
24
+ /**
25
+ * Grab the feed URL for Robogento
26
+ *
27
+ * @return string
28
+ */
29
+ public function getFeedUrl()
30
+ {
31
+ return Mage::getStoreConfig('roboadmin/urls/notifications');
32
+ }
33
+
34
+ /**
35
+ * {@inheritdoc}
36
+ */
37
+ public function getLastUpdate()
38
+ {
39
+ return Mage::app()->loadCache('roboadmin_notifications_lastcheck');
40
+ }
41
+
42
+ /**
43
+ * {@inheritdoc}
44
+ */
45
+ public function setLastUpdate()
46
+ {
47
+ Mage::app()->saveCache(time(), 'roboadmin_notifications_lastcheck');
48
+ return $this;
49
+ }
50
+ }
app/code/community/Robogento/Admin/Model/Observer.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ */
13
+
14
+ /**
15
+ * Observer to handle admin related features
16
+ *
17
+ * @author Rian Orie
18
+ * @license Copyright 2014 Robogento
19
+ * @created 01-05-2014
20
+ * @version 1.0
21
+ */
22
+ class Robogento_Admin_Model_Observer extends Mage_Core_Model_Abstract
23
+ {
24
+ /**
25
+ * Initiate showing of the Robogento popup
26
+ *
27
+ * @param Varien_Event_Observer $event
28
+ */
29
+ public function popup(Varien_Event_Observer $event)
30
+ {
31
+ /** @var Mage_Adminhtml_Controller_Action $controller */
32
+ $controller = $event->getEvent()->getControllerAction();
33
+
34
+ $notification = $controller->getLayout()->getBlock('notification_window');
35
+ if ($notification && $notification->toHtml() == '') {
36
+
37
+ $block = new Robogento_Admin_Block_Adminhtml_Popup();
38
+
39
+ $body = $controller->getResponse()->getBody();
40
+ $body = str_replace('</body>', $block->toHtml().'</body>', $body);
41
+ $controller->getResponse()->setBody($body);
42
+
43
+ }
44
+ }
45
+ }
app/code/community/Robogento/Admin/controllers/PopupController.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ */
13
+
14
+ /**
15
+ * Popup Controller that manages the popup related actions
16
+ *
17
+ * @author Rian Orie
18
+ * @license Copyright 2014 Robogento
19
+ * @created 01-05-2014
20
+ * @version 1.0
21
+ */
22
+ class Robogento_Admin_PopupController extends Mage_Core_Controller_Front_Action
23
+ {
24
+ /**
25
+ * Forward the registration of an user to the Robogento system
26
+ *
27
+ */
28
+ public function registerAction()
29
+ {
30
+ Mage::getConfig()->saveConfig('roboadmin/popup/registered', 1);
31
+ Mage::getConfig()->reinit();
32
+ Mage::app()->reinitStores();
33
+
34
+ $helper = Mage::helper('roboadmin/remote');
35
+
36
+ $info = $helper->getSystemInfo();
37
+ $url = Mage::getStoreConfig('roboadmin/urls/register');
38
+ $url .= 'info/'.$info.'/name/'.urlencode($this->getRequest()->getParam('name')).'/email/'.urlencode($this->getRequest()->getParam('email'));
39
+
40
+ $helper->load($url);
41
+
42
+ $this->getResponse()->setHeader('location', $this->_getRefererUrl().'roboadmin/done/');
43
+ }
44
+
45
+ /**
46
+ * Close the popup
47
+ */
48
+ public function closeAction()
49
+ {
50
+ $this->getResponse()->setHeader('location', $this->_getRefererUrl().'roboadmin/close/');
51
+ }
52
+
53
+ /**
54
+ * Stop showing the popup without registering
55
+ *
56
+ */
57
+ public function endAction()
58
+ {
59
+ Mage::getConfig()->saveConfig('roboadmin/popup/registered', 1);
60
+ Mage::getConfig()->reinit();
61
+ Mage::app()->reinitStores();
62
+
63
+ $this->_redirectReferer();
64
+ }
65
+ }
app/code/community/Robogento/Admin/etc/adminhtml.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ *
13
+ -->
14
+ <config>
15
+ <acl>
16
+ <resources>
17
+ <admin>
18
+ <children>
19
+ <system>
20
+ <children>
21
+ <config>
22
+ <children>
23
+ <roboadmin>
24
+ <title>Robogento Admin Module</title>
25
+ </roboadmin>
26
+ </children>
27
+ </config>
28
+ </children>
29
+ </system>
30
+ </children>
31
+ </admin>
32
+ </resources>
33
+ </acl>
34
+ <translate>
35
+ <modules>
36
+ <Robogento_Admin>
37
+ <files>
38
+ <default>Robogento_Admin.csv</default>
39
+ </files>
40
+ </Robogento_Admin>
41
+ </modules>
42
+ </translate>
43
+ </config>
app/code/community/Robogento/Admin/etc/config.xml ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ *
13
+ -->
14
+ <config>
15
+ <modules>
16
+ <Robogento_Admin>
17
+ <version>1.0.0</version>
18
+ </Robogento_Admin>
19
+ </modules>
20
+ <global>
21
+ <models>
22
+ <roboadmin>
23
+ <class>Robogento_Admin_Model</class>
24
+ </roboadmin>
25
+ </models>
26
+ <helpers>
27
+ <roboadmin>
28
+ <class>Robogento_Admin_Helper</class>
29
+ </roboadmin>
30
+ </helpers>
31
+ <blocks>
32
+ <roboadmin>
33
+ <class>Robogento_Admin_Block</class>
34
+ </roboadmin>
35
+ <adminhtml>
36
+ <rewrite>
37
+ <system_config_form_fieldset>Robogento_Admin_Block_Adminhtml_System_Config_Form_Fieldset</system_config_form_fieldset>
38
+ </rewrite>
39
+ </adminhtml>
40
+ </blocks>
41
+ </global>
42
+ <admin>
43
+ <routers>
44
+ <roboadmin>
45
+ <use>admin</use>
46
+ <args>
47
+ <module>Robogento_Admin</module>
48
+ <frontName>roboadmin</frontName>
49
+ </args>
50
+ </roboadmin>
51
+ </routers>
52
+ </admin>
53
+ <adminhtml>
54
+ <events>
55
+ <controller_action_predispatch>
56
+ <observers>
57
+ <roboadmin_notification>
58
+ <class>roboadmin/feed</class>
59
+ <method>checkUpdate</method>
60
+ </roboadmin_notification>
61
+ </observers>
62
+ </controller_action_predispatch>
63
+ <controller_action_postdispatch>
64
+ <!--<admin_session_user_login_success>-->
65
+ <observers>
66
+ <roboadmin_emailpopup>
67
+ <class>roboadmin/observer</class>
68
+ <method>popup</method>
69
+ </roboadmin_emailpopup>
70
+ </observers>
71
+ <!--</admin_session_user_login_success>-->
72
+ </controller_action_postdispatch>
73
+
74
+ </events>
75
+ </adminhtml>
76
+ <default>
77
+ <roboadmin>
78
+ <popup>
79
+ <registered>0</registered>
80
+ <message>Enter your e-mail to get FREE support on our module!</message>
81
+ </popup>
82
+ <urls>
83
+ <notifications>https://robogento.com/robomanager/notification/rss/</notifications>
84
+ <register>https://robogento.com/robomanager/register/push/</register>
85
+ <store>https://robogento.com/robomanager/store/get/</store>
86
+ <log>https://robogento.com/robomanager/log/img/</log>
87
+ </urls>
88
+ </roboadmin>
89
+ </default>
90
+ </config>
app/code/community/Robogento/Admin/etc/system.xml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ *
13
+ -->
14
+ <config>
15
+ <tabs>
16
+ <robogento translate="label" module="roboadmin">
17
+ <label>Robogento</label>
18
+ <sort_order>100</sort_order>
19
+ </robogento>
20
+ </tabs>
21
+ <sections>
22
+ <roboadmin translate="label" module="roboadmin">
23
+ <label>Modules &amp; Store</label>
24
+ <tab>robogento</tab>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>50</sort_order>
27
+ <show_in_default>0</show_in_default>
28
+ <show_in_website>0</show_in_website>
29
+ <show_in_store>0</show_in_store>
30
+ <groups>
31
+ <robogentobanner>
32
+ <!--<frontend_model>roboadmin/adminhtml_system_config_fieldset_banner</frontend_model> disabled because mage 1.5 dies over it -->
33
+ <sort_order>0</sort_order>
34
+ <show_in_default>1</show_in_default>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>1</show_in_store>
37
+ </robogentobanner>
38
+ <robogentomodules>
39
+ <!--<frontend_model>roboadmin/adminhtml_system_config_fieldset_modules</frontend_model> disabled because mage 1.5 dies over it -->
40
+ <sort_order>1</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ </robogentomodules>
45
+ </groups>
46
+ </roboadmin>
47
+ </sections>
48
+ </config>
app/code/community/Robogento/ViewProductButton/Block/Product/Edit.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_ViewProductButton
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ */
13
+
14
+ /**
15
+ * Additional button for the product header to be able to quickly open a product
16
+ *
17
+ * @author Rian Orie
18
+ * @license Copyright 2014 Robogento
19
+ * @created 02-05-2014
20
+ * @version 1.0
21
+ */
22
+ class Robogento_ViewProductButton_Block_Product_Edit extends Mage_Adminhtml_Block_Catalog_Product_Edit
23
+ {
24
+
25
+ /**
26
+ * Retrieve the back button and add our own product view button into it
27
+ *
28
+ * @return string
29
+ */
30
+ public function getBackButtonHtml()
31
+ {
32
+ // Load the default back button
33
+ $out = $this->getChildHtml('back_button');
34
+
35
+ // If the module is enabled
36
+ if (Mage::getStoreConfigFlag('roboviewproduct/general/enabled')) {
37
+
38
+ // Initiate our own button
39
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
40
+ ->setLabel(Mage::helper('catalog')->__('View Product'))
41
+ ->setClass('disabled')
42
+ ->setDisabled(true);
43
+
44
+ // If there's a product..
45
+ if ($this->getProduct() != null) {
46
+
47
+ // grab the path, preferably a fancy one
48
+ $urlPath = $this->getProduct()->getProductUrl();
49
+ if ($this->getProduct()->getUrlPath() != '') {
50
+ $urlPath = Mage::getBaseUrl().$this->getProduct()->getUrlPath();
51
+ }
52
+
53
+ // Add the optional query argument
54
+ $query = Mage::getStoreConfig('roboviewproduct/general/query');
55
+ if (!empty($query)) {
56
+ $query = '?'.str_replace(array('%random%', '%time%'), array(md5(time()), time()), ltrim($query, '?'));
57
+ }
58
+
59
+ // Add the onclick to it
60
+ $button->setOnClick("window.open('".$urlPath.$query."','preview');");
61
+
62
+ $errors = array();
63
+
64
+ // If no website is selected
65
+ if (count($this->getProduct()->getWebsiteIds()) == 0) {
66
+ $errors[] = Mage::helper('catalog')->__('No website selected for the product.');
67
+ }
68
+
69
+ // If the visibility is too low
70
+ if ($this->getProduct()->getVisibility() < 2) {
71
+ $errors[] = Mage::helper('catalog')->__('Product visibility is set too low.');
72
+ }
73
+
74
+ // if the status is not enabled
75
+ if ($this->getProduct()->getStatus() != 1) {
76
+ $errors[] = Mage::helper('catalog')->__('The product status needs to be set to enabled.');
77
+ }
78
+
79
+ // If the product is part of a website, the visibility is set and the status
80
+ // is set to enabled, remove the disabling elements
81
+ if (count($errors) == 0) {
82
+ $button->setDisabled(false)->setClass('');
83
+
84
+ } else {
85
+ $button->setTitle( implode(' ', $errors) );
86
+ }
87
+ }
88
+
89
+ // Finally return the original button and the new one, together
90
+ return $out.$button->toHtml();
91
+ }
92
+
93
+ return $out;
94
+ }
95
+ }
app/code/community/Robogento/ViewProductButton/Helper/Data.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_ViewProductButton
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ */
13
+
14
+ /**
15
+ * Base data helper
16
+ *
17
+ * @author Rian Orie
18
+ * @license Copyright 2014 Robogento
19
+ * @created 01-05-2014
20
+ * @version 1.0
21
+ */
22
+ class Robogento_ViewProductButton_Helper_Data extends Mage_Core_Helper_Data
23
+ {
24
+ }
app/code/community/Robogento/ViewProductButton/etc/adminhtml.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_ViewProductButton
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ *
13
+ -->
14
+ <config>
15
+ <acl>
16
+ <resources>
17
+ <admin>
18
+ <children>
19
+ <system>
20
+ <children>
21
+ <config>
22
+ <children>
23
+ <roboviewproduct>
24
+ <title>Robogento Product View Button</title>
25
+ </roboviewproduct>
26
+ </children>
27
+ </config>
28
+ </children>
29
+ </system>
30
+ </children>
31
+ </admin>
32
+ </resources>
33
+ </acl>
34
+ <translate>
35
+ <modules>
36
+ <Robogento_ViewProductButton>
37
+ <files>
38
+ <default>Robogento_ViewProductButton.csv</default>
39
+ </files>
40
+ </Robogento_ViewProductButton>
41
+ </modules>
42
+ </translate>
43
+ </config>
app/code/community/Robogento/ViewProductButton/etc/config.xml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_ViewProductButton
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ *
13
+ -->
14
+ <config>
15
+ <modules>
16
+ <Robogento_ViewProductButton>
17
+ <version>1.0.0</version>
18
+ </Robogento_ViewProductButton>
19
+ </modules>
20
+ <global>
21
+ <helpers>
22
+ <roboviewproduct>
23
+ <class>Robogento_ViewProductButton_Helper</class>
24
+ </roboviewproduct>
25
+ </helpers>
26
+ <blocks>
27
+ <roboviewproduct>
28
+ <class>Robogento_ViewProductButton_Block</class>
29
+ </roboviewproduct>
30
+ <adminhtml>
31
+ <rewrite>
32
+ <catalog_product_edit>Robogento_ViewProductButton_Block_Product_Edit</catalog_product_edit>
33
+ </rewrite>
34
+ </adminhtml>
35
+ </blocks>
36
+ </global>
37
+ <default>
38
+ <roboviewproduct>
39
+ <general>
40
+ <enabled>1</enabled>
41
+ <query>no_cache=1</query>
42
+ </general>
43
+ </roboviewproduct>
44
+ </default>
45
+ </config>
app/code/community/Robogento/ViewProductButton/etc/system.xml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * Robogento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * Unauthorized copying of this file, via any medium is strictly prohibited
8
+ *
9
+ * @category Robogento
10
+ * @package Robogento_Admin
11
+ * @copyright Copyright (c) 2014 Robogento (http://robogento.com)
12
+ *
13
+ -->
14
+ <config>
15
+ <sections>
16
+ <roboviewproduct translate="label" module="roboviewproduct">
17
+ <label>Product View Button</label>
18
+ <tab>robogento</tab>
19
+ <frontend_type>text</frontend_type>
20
+ <sort_order>5</sort_order>
21
+ <show_in_default>1</show_in_default>
22
+ <show_in_website>1</show_in_website>
23
+ <show_in_store>1</show_in_store>
24
+ <groups>
25
+ <robogentobanner>
26
+ <sort_order>0</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </robogentobanner>
31
+ <general translate="label" module="roboviewproduct">
32
+ <label>General</label>
33
+ <sort_order>5</sort_order>
34
+ <show_in_default>1</show_in_default>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>1</show_in_store>
37
+ <fields>
38
+ <enabled translate="label comment">
39
+ <label>Enabled</label>
40
+ <frontend_type>select</frontend_type>
41
+ <source_model>adminhtml/system_config_source_yesno</source_model>
42
+ <sort_order>10</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+ </enabled>
47
+ <query translate="label comment">
48
+ <label>Query elements</label>
49
+ <comment>Query elements are added behind the URL</comment>
50
+ <frontend_type>text</frontend_type>
51
+ <sort_order>20</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ <comment>You can use %random% and %time% to get a random hash or unix timestamp</comment>
56
+ </query>
57
+ </fields>
58
+ </general>
59
+ </groups>
60
+ </roboviewproduct>
61
+ </sections>
62
+ </config>
package.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Robogento_Product_View</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.robogento.com">Free to use, IP (c) Robogento</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>The View Productmodule adds a "View product" button in the top right near where the other product buttons in the Magento admin are located. The button is only clickable when the product is set to be available and viewable in the front-end.</summary>
10
+ <description>If you're like many store owners, you add and edit your products directly through the Magento admin.&#xD;
11
+ Every time you want to preview your newly added or edited product, you have to find its URL key and copy-paste it behind your store's domain.&#xD;
12
+ &#xD;
13
+ Having a button which takes you directly to the product in the front-end of your store would be much easier.&#xD;
14
+ &#xD;
15
+ This is exactly what the Product View module does. It adds a "View product" button in the top right near where the other product buttons in the Magento admin are located. The button is only clickable when the product is set to be available and viewable in the front-end.&#xD;
16
+ &#xD;
17
+ The View Product module also allows you to bypass certain kinds of Full Page Caches like Lesti FPC through its configuration section. That way you do not need to refresh your Full Page Cache just to see changes!&#xD;
18
+ &#xD;
19
+ Check out some of our other popular modules on connect:&#xD;
20
+ &lt;a href="http://www.magentocommerce.com/magento-connect/step-up-high-performance-all-in-one.html"&gt;Step up&lt;/a&gt;, Magento client-side and server-side speed improvement&#xD;
21
+ &lt;a href="http://www.magentocommerce.com/magento-connect/seo-rich-snippets-google-bing-yahoo-schema-org.html"&gt;SEO Rich Snippets&lt;/a&gt;, adds Rich Snippets to your product pages&#xD;
22
+ &lt;a href="http://www.magentocommerce.com/magento-connect/task-manager.html"&gt;TaskManager&lt;/a&gt;, manage your to-do's within the Magento admin in a clever way</description>
23
+ <notes>Made by Robogento</notes>
24
+ <authors><author><name>Robogento Team</name><user>auto-converted</user><email>support@robogento.com</email></author></authors>
25
+ <date>2014-07-10</date>
26
+ <time>09:56:58</time>
27
+ <contents><target name="magecommunity"><dir name="Robogento"><dir name="Admin"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Banner.php" hash="917ea38f1aaa115d2a9c517639cf5c3f"/><file name="Modules.php" hash="431518159af8740ff172d45f5aed38bf"/></dir><dir name="Form"><file name="Fieldset.php" hash="12bb0018a7a78796854be135c540dc5d"/></dir></dir></dir><file name="Popup.php" hash="283ca146ccc048e07c8d8fdb00c2718f"/></dir></dir><dir name="Helper"><file name="Data.php" hash="1dc3c094f9497a40d41a005283fb1fd0"/><file name="Remote.php" hash="68dee3de8cfccebc9aec9b4f1e43025a"/></dir><dir name="Model"><file name="Feed.php" hash="8a6be7ea892489aefd50fbfe9df003cf"/><file name="Observer.php" hash="21ecd0e15590f2d89f4a324754103d69"/></dir><dir name="controllers"><file name="PopupController.php" hash="4a1245f34efeccfe8c36ca7246508a90"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f5efda167dd7cc6e293703f1feff8a53"/><file name="config.xml" hash="29b0484370403f93af8817c05036a3f7"/><file name="system.xml" hash="8cb49e17e6494ad7f2515608002ebdcc"/></dir></dir><dir name="ViewProductButton"><dir name="Block"><dir name="Product"><file name="Edit.php" hash="fa64a1d34d1344425cc42036b4ce5a72"/></dir></dir><dir name="Helper"><file name="Data.php" hash="441a9bfad605d84d14a0ddb009b6d267"/></dir><dir name="etc"><file name="adminhtml.xml" hash="92d50803d589d54c558ca79eee5f15a4"/><file name="config.xml" hash="90a0e8f550976370f63e7bb8fb47133c"/><file name="system.xml" hash="3d1dda95132b8076e18a9cbee7f26dd9"/></dir></dir></dir></target><target name="mageetc"><dir name="."><file name="Robogento_Admin.xml" hash=""/><file name="Robogento_ViewProductButton.xml" hash=""/></dir></target></contents>
28
+ <compatible/>
29
+ <dependencies/>
30
+ </package>