Version Notes
This PEAR package can only be distributed with a valid MageBridge license.
Download this release
Release Info
Developer | Magento Core Team |
Extension | Jira_MageBridge |
Version | 1.0 |
Comparing to | |
See all releases |
Version 1.0
- app/code/community/Jira/MageBridge/Block/License.php +38 -0
- app/code/community/Jira/MageBridge/Block/Menu.php +62 -0
- app/code/community/Jira/MageBridge/Block/Settings.php +79 -0
- app/code/community/Jira/MageBridge/Block/Updates.php +84 -0
- app/code/community/Jira/MageBridge/Helper/Data.php +23 -0
- app/code/community/Jira/MageBridge/Model/Update.php +141 -0
- app/code/community/Jira/MageBridge/controllers/IndexController.php +91 -0
- app/code/community/Jira/MageBridge/etc/config.xml +96 -0
- app/code/community/Jira/MageBridge/etc/system.xml +46 -0
- app/design/adminhtml/default/default/template/magebridge/license.phtml +102 -0
- app/design/adminhtml/default/default/template/magebridge/menu.phtml +21 -0
- app/design/adminhtml/default/default/template/magebridge/settings.phtml +67 -0
- app/design/adminhtml/default/default/template/magebridge/updates.phtml +91 -0
- app/etc/modules/Jira_MageBridge.xml +20 -0
- package.xml +18 -0
app/code/community/Jira/MageBridge/Block/License.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Bridge
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Magento Bridge
|
7 |
+
* @copyright Copyright 2009
|
8 |
+
* @license Yireo EULA (www.yireo.com)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Jira_MageBridge_Block_License extends Mage_Core_Block_Template
|
13 |
+
{
|
14 |
+
/*
|
15 |
+
* Constructor method
|
16 |
+
*/
|
17 |
+
public function _construct()
|
18 |
+
{
|
19 |
+
parent::_construct();
|
20 |
+
$this->setTemplate('magebridge/license.phtml');
|
21 |
+
}
|
22 |
+
|
23 |
+
/*
|
24 |
+
* Helper to return the header of this page
|
25 |
+
*/
|
26 |
+
public function getHeader($title = null)
|
27 |
+
{
|
28 |
+
return 'MageBridge Installer - '.$this->__($title);
|
29 |
+
}
|
30 |
+
|
31 |
+
/*
|
32 |
+
* Helper to return the menu
|
33 |
+
*/
|
34 |
+
public function getMenu()
|
35 |
+
{
|
36 |
+
return $this->getLayout()->createBlock('magebridge/menu')->toHtml();
|
37 |
+
}
|
38 |
+
}
|
app/code/community/Jira/MageBridge/Block/Menu.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Bridge
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Magento Bridge
|
7 |
+
* @copyright Copyright 2009
|
8 |
+
* @license Yireo EULA (www.yireo.com)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Jira_MageBridge_Block_Menu extends Mage_Core_Block_Template
|
13 |
+
{
|
14 |
+
/*
|
15 |
+
* Constructor method
|
16 |
+
*/
|
17 |
+
public function _construct()
|
18 |
+
{
|
19 |
+
parent::_construct();
|
20 |
+
$this->setTemplate('magebridge/menu.phtml');
|
21 |
+
}
|
22 |
+
|
23 |
+
/*
|
24 |
+
* Helper method to get data from the Magento configuration
|
25 |
+
*/
|
26 |
+
public function getMenuItems()
|
27 |
+
{
|
28 |
+
|
29 |
+
$items = array(
|
30 |
+
array(
|
31 |
+
'action' => 'index',
|
32 |
+
'title' => 'Settings',
|
33 |
+
),
|
34 |
+
array(
|
35 |
+
'action' => 'updates',
|
36 |
+
'title' => 'Installation',
|
37 |
+
),
|
38 |
+
array(
|
39 |
+
'action' => 'license',
|
40 |
+
'title' => 'License Agreement',
|
41 |
+
),
|
42 |
+
);
|
43 |
+
|
44 |
+
$url = Mage::getModel('adminhtml/url');
|
45 |
+
$current_action = $this->getRequest()->getActionName();
|
46 |
+
|
47 |
+
foreach($items as $index => $item) {
|
48 |
+
|
49 |
+
if($item['action'] == $current_action) {
|
50 |
+
$item['class'] = 'active';
|
51 |
+
} else {
|
52 |
+
$item['class'] = 'inactive';
|
53 |
+
}
|
54 |
+
|
55 |
+
$item['url'] = $url->getUrl('magebridge/index/'.$item['action']);
|
56 |
+
|
57 |
+
$items[$index] = $item;
|
58 |
+
}
|
59 |
+
|
60 |
+
return $items;
|
61 |
+
}
|
62 |
+
}
|
app/code/community/Jira/MageBridge/Block/Settings.php
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Bridge
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Magento Bridge
|
7 |
+
* @copyright Copyright 2009
|
8 |
+
* @license Yireo EULA (www.yireo.com)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Jira_MageBridge_Block_Settings extends Mage_Core_Block_Template
|
13 |
+
{
|
14 |
+
/*
|
15 |
+
* Constructor method
|
16 |
+
*/
|
17 |
+
public function _construct()
|
18 |
+
{
|
19 |
+
parent::_construct();
|
20 |
+
$this->setTemplate('magebridge/settings.phtml');
|
21 |
+
}
|
22 |
+
|
23 |
+
/*
|
24 |
+
* Helper method to get data from the Magento configuration
|
25 |
+
*/
|
26 |
+
public function getSetting($key = '')
|
27 |
+
{
|
28 |
+
static $data;
|
29 |
+
if(empty($data)) {
|
30 |
+
$data = array(
|
31 |
+
'license_key' => Mage::helper('magebridge')->getLicenseKey(),
|
32 |
+
'enabled' => Mage::helper('magebridge')->enabled(),
|
33 |
+
);
|
34 |
+
}
|
35 |
+
|
36 |
+
if(isset($data[$key])) {
|
37 |
+
return $data[$key];
|
38 |
+
} else {
|
39 |
+
return null;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
/*
|
44 |
+
* Helper method to get list of all the forwarded events and their current status
|
45 |
+
*/
|
46 |
+
public function getEvents()
|
47 |
+
{
|
48 |
+
$events = Mage::getModel('magebridge/listener')->getEvents();
|
49 |
+
$event_list = array();
|
50 |
+
foreach($events as $event) {
|
51 |
+
$event_list[] = array(
|
52 |
+
'name' => $event,
|
53 |
+
'value' => (int)Mage::getModel('magebridge/listener')->isEnabled($event),
|
54 |
+
);
|
55 |
+
}
|
56 |
+
return $event_list;
|
57 |
+
}
|
58 |
+
|
59 |
+
/*
|
60 |
+
* Helper to return the header of this page
|
61 |
+
*/
|
62 |
+
public function getHeader($title = null)
|
63 |
+
{
|
64 |
+
return 'MageBridge Installer - '.$this->__($title);
|
65 |
+
}
|
66 |
+
|
67 |
+
/*
|
68 |
+
* Helper to return the menu
|
69 |
+
*/
|
70 |
+
public function getMenu()
|
71 |
+
{
|
72 |
+
return $this->getLayout()->createBlock('magebridge/menu')->toHtml();
|
73 |
+
}
|
74 |
+
|
75 |
+
public function getSaveUrl()
|
76 |
+
{
|
77 |
+
return Mage::getModel('adminhtml/url')->getUrl('magebridge/index/save');
|
78 |
+
}
|
79 |
+
}
|
app/code/community/Jira/MageBridge/Block/Updates.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Bridge
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Magento Bridge
|
7 |
+
* @copyright Copyright 2009
|
8 |
+
* @license Yireo EULA (www.yireo.com)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Jira_MageBridge_Block_Updates extends Mage_Core_Block_Template
|
13 |
+
{
|
14 |
+
/*
|
15 |
+
* Constructor method
|
16 |
+
*/
|
17 |
+
public function _construct()
|
18 |
+
{
|
19 |
+
parent::_construct();
|
20 |
+
$this->setTemplate('magebridge/updates.phtml');
|
21 |
+
}
|
22 |
+
|
23 |
+
/*
|
24 |
+
* Helper method to get data from the Magento configuration
|
25 |
+
*/
|
26 |
+
public function getSetting($key = '')
|
27 |
+
{
|
28 |
+
static $data;
|
29 |
+
if(empty($data)) {
|
30 |
+
$data = array(
|
31 |
+
'license_key' => Mage::helper('magebridge')->getLicenseKey(),
|
32 |
+
'enabled' => Mage::helper('magebridge')->enabled(),
|
33 |
+
);
|
34 |
+
}
|
35 |
+
|
36 |
+
if(isset($data[$key])) {
|
37 |
+
return $data[$key];
|
38 |
+
} else {
|
39 |
+
return null;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
/*
|
44 |
+
* Helper to return the header of this page
|
45 |
+
*/
|
46 |
+
public function getHeader($title = null)
|
47 |
+
{
|
48 |
+
return 'MageBridge Installer - '.$this->__($title);
|
49 |
+
}
|
50 |
+
|
51 |
+
/*
|
52 |
+
* Helper to return the menu
|
53 |
+
*/
|
54 |
+
public function getMenu()
|
55 |
+
{
|
56 |
+
return $this->getLayout()->createBlock('magebridge/menu')->toHtml();
|
57 |
+
}
|
58 |
+
|
59 |
+
public function getUpdateUrl()
|
60 |
+
{
|
61 |
+
return Mage::getModel('adminhtml/url')->getUrl('magebridge/index/doupdate');
|
62 |
+
}
|
63 |
+
|
64 |
+
public function getThisUrl()
|
65 |
+
{
|
66 |
+
return Mage::getModel('adminhtml/url')->getUrl('magebridge/index/updates');
|
67 |
+
}
|
68 |
+
|
69 |
+
public function getCurrentVersion()
|
70 |
+
{
|
71 |
+
return Mage::getSingleton('magebridge/update')->getCurrentVersion();
|
72 |
+
}
|
73 |
+
|
74 |
+
public function getNewVersion()
|
75 |
+
{
|
76 |
+
$result = Mage::getSingleton('magebridge/update')->getNewVersion();
|
77 |
+
return $result;
|
78 |
+
}
|
79 |
+
|
80 |
+
public function upgradeNeeded()
|
81 |
+
{
|
82 |
+
return Mage::getSingleton('magebridge/update')->upgradeNeeded();
|
83 |
+
}
|
84 |
+
}
|
app/code/community/Jira/MageBridge/Helper/Data.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Bridge
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Magento Bridge
|
7 |
+
* @copyright Copyright 2009
|
8 |
+
* @license Yireo EULA (www.yireo.com)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Jira_MageBridge_Helper_Data extends Mage_Core_Helper_Abstract
|
13 |
+
{
|
14 |
+
public function enabled()
|
15 |
+
{
|
16 |
+
return (bool)Mage::getStoreConfig('magebridge/settings/active');
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getLicenseKey()
|
20 |
+
{
|
21 |
+
return Mage::getStoreConfig('magebridge/settings/license_key');
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Jira/MageBridge/Model/Update.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Bridge
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Magento Bridge
|
7 |
+
* @copyright Copyright 2009
|
8 |
+
* @license Yireo EULA (www.yireo.com)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Jira_MageBridge_Model_Update extends Mage_Core_Model_Abstract
|
13 |
+
{
|
14 |
+
private $_current_version = null;
|
15 |
+
private $_new_version = null;
|
16 |
+
private $_remote_url = 'http://downloader.yireo.com';
|
17 |
+
|
18 |
+
public function getApiLink($arguments = array())
|
19 |
+
{
|
20 |
+
$url = 'http://api.yireo.com/';
|
21 |
+
$arguments = array_merge($this->getApiArguments(), $arguments);
|
22 |
+
|
23 |
+
foreach($arguments as $name => $value) {
|
24 |
+
if($name == 'request') {
|
25 |
+
$arguments[$name] = "$value";
|
26 |
+
} else {
|
27 |
+
$arguments[$name] = "$name,$value";
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
return $url . implode('/', $arguments);
|
32 |
+
}
|
33 |
+
|
34 |
+
public function getApiArguments()
|
35 |
+
{
|
36 |
+
return array(
|
37 |
+
'license' => $this->getLicenseKey(),
|
38 |
+
'domain' => $_SERVER['HTTP_HOST'],
|
39 |
+
);
|
40 |
+
}
|
41 |
+
|
42 |
+
public function upgradeNeeded()
|
43 |
+
{
|
44 |
+
if((int)$this->getNewVersion() > (int)$this->getCurrentVersion()) {
|
45 |
+
return true;
|
46 |
+
}
|
47 |
+
return true;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function doUpgrade()
|
51 |
+
{
|
52 |
+
$download_url = $this->getApiLink(array('resource' => 'download', 'request' => 'Jira_MageBridge.tar.gz'));
|
53 |
+
|
54 |
+
try {
|
55 |
+
ini_set('error_reporting', 0);
|
56 |
+
$paths = explode(':', ini_get('include_path'));
|
57 |
+
array_unshift($paths, './downloader');
|
58 |
+
array_unshift($paths, './downloader/pearlib/php');
|
59 |
+
ini_set('include_path', implode(':', $paths));
|
60 |
+
|
61 |
+
require_once 'PEAR/Frontend.php';
|
62 |
+
require_once 'Maged/Pear/Frontend.php';
|
63 |
+
require_once 'Maged/Pear.php';
|
64 |
+
|
65 |
+
} catch(Exception $e) {
|
66 |
+
return 'Failed to prepare PEAR: '.$e->getMessage();
|
67 |
+
}
|
68 |
+
|
69 |
+
$pear = new Maged_Pear();
|
70 |
+
$params = array(
|
71 |
+
'command' => 'install',
|
72 |
+
'options' => array('force' => 1),
|
73 |
+
'params' => array($download_url),
|
74 |
+
);
|
75 |
+
|
76 |
+
if(is_dir(dirname(__FILE__).DS.'.svn')) {
|
77 |
+
return 'Updating Subversion environments is not allowed';
|
78 |
+
}
|
79 |
+
|
80 |
+
try {
|
81 |
+
$run = new Maged_Model_Pear_Request($params);
|
82 |
+
if($command = $run->get('command')) {
|
83 |
+
$cmd = PEAR_Command::factory($command, $pear->getConfig());
|
84 |
+
$result = $cmd->run($command, $run->get('options'), $run->get('params'));
|
85 |
+
if(is_bool($result)) ($result == true) ? 'ok' : 'failed';
|
86 |
+
|
87 |
+
// Reset the configuration cache
|
88 |
+
Mage::getConfig()->removeCache();
|
89 |
+
|
90 |
+
return 'PEAR result: '.(string)$result;
|
91 |
+
} else {
|
92 |
+
return 'Maged_Model_Pear_Request failed';
|
93 |
+
}
|
94 |
+
} catch(Exception $e) {
|
95 |
+
return 'Failed to initialize PEAR: '.$e->getMessage();
|
96 |
+
}
|
97 |
+
|
98 |
+
return 'Upgrade failed by unknown error';
|
99 |
+
}
|
100 |
+
|
101 |
+
public function getCurrentVersion()
|
102 |
+
{
|
103 |
+
if(empty($this->_current_version)) {
|
104 |
+
$config = Mage::app()->getConfig()->getModuleConfig('Jira_MageBridge');
|
105 |
+
$this->_current_version = (string)$config->version;
|
106 |
+
}
|
107 |
+
return $this->_current_version;
|
108 |
+
}
|
109 |
+
|
110 |
+
public function getNewVersion()
|
111 |
+
{
|
112 |
+
if(empty($this->_new_version)) {
|
113 |
+
$arguments = array('resource' => 'versions', 'request' => 'downloads/magebridge');
|
114 |
+
$url = $this->getApiLink($arguments);
|
115 |
+
$this->_data = $this->_getRemote($url);
|
116 |
+
try {
|
117 |
+
$doc = new SimpleXMLElement($this->_data);
|
118 |
+
} catch(Exception $e) {
|
119 |
+
return 'Update check failed. Is your licensing correct?';
|
120 |
+
//return 'XML-parsing failed in data: '.$this->_data.' :'.$e->getMessage();
|
121 |
+
}
|
122 |
+
$this->_new_version = (string)$doc->magento;
|
123 |
+
}
|
124 |
+
return $this->_new_version;
|
125 |
+
}
|
126 |
+
|
127 |
+
public function getLicenseKey()
|
128 |
+
{
|
129 |
+
return Mage::getStoreConfig('magebridge/settings/license_key');
|
130 |
+
}
|
131 |
+
|
132 |
+
private function _getRemote($url)
|
133 |
+
{
|
134 |
+
$curl = new Varien_Http_Adapter_Curl();
|
135 |
+
$curl->write(Zend_Http_Client::GET, $url, '1.0');
|
136 |
+
$data = $curl->read();
|
137 |
+
$data = preg_split('/^\r?$/m', $data, 2);
|
138 |
+
$data = trim($data[1]);
|
139 |
+
return $data;
|
140 |
+
}
|
141 |
+
}
|
app/code/community/Jira/MageBridge/controllers/IndexController.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Bridge
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Magento Bridge
|
7 |
+
* @copyright Copyright 2009
|
8 |
+
* @license Yireo EULA (www.yireo.com)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
|
12 |
+
/**
|
13 |
+
* MageBridge admin controller
|
14 |
+
*/
|
15 |
+
class Jira_MageBridge_IndexController extends Mage_Adminhtml_Controller_Action
|
16 |
+
{
|
17 |
+
/**
|
18 |
+
* Common method
|
19 |
+
*/
|
20 |
+
protected function _initAction()
|
21 |
+
{
|
22 |
+
$this->loadLayout()
|
23 |
+
->_setActiveMenu('cms/magebridge')
|
24 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('CMS'), Mage::helper('adminhtml')->__('CMS'))
|
25 |
+
->_addBreadcrumb(Mage::helper('adminhtml')->__('MageBridge'), Mage::helper('adminhtml')->__('MageBridge'))
|
26 |
+
;
|
27 |
+
return $this;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Settings page
|
32 |
+
*/
|
33 |
+
public function indexAction()
|
34 |
+
{
|
35 |
+
$this->_initAction()
|
36 |
+
->_addContent($this->getLayout()->createBlock('magebridge/settings'))
|
37 |
+
->renderLayout();
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* License page
|
42 |
+
*/
|
43 |
+
public function licenseAction()
|
44 |
+
{
|
45 |
+
$this->_initAction()
|
46 |
+
->_addContent($this->getLayout()->createBlock('magebridge/license'))
|
47 |
+
->renderLayout();
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Updates page (which calls for AJAX)
|
52 |
+
*/
|
53 |
+
public function updatesAction()
|
54 |
+
{
|
55 |
+
$this->_initAction()
|
56 |
+
->_addContent($this->getLayout()->createBlock('magebridge/updates'))
|
57 |
+
->renderLayout();
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Perform an update through AJAX
|
62 |
+
*/
|
63 |
+
public function doupdateAction()
|
64 |
+
{
|
65 |
+
$update = Mage::getSingleton('magebridge/update');
|
66 |
+
if($update->upgradeNeeded() == true) {
|
67 |
+
$status = $update->doUpgrade();
|
68 |
+
} else {
|
69 |
+
$status = 'No upgrade needed';
|
70 |
+
}
|
71 |
+
|
72 |
+
$response = new Varien_Object();
|
73 |
+
$response->setError(0);
|
74 |
+
$response->setMessage($status);
|
75 |
+
$this->getResponse()->setBody($response->toJson());
|
76 |
+
}
|
77 |
+
|
78 |
+
public function saveAction()
|
79 |
+
{
|
80 |
+
if ($data = $this->getRequest()->getPost()) {
|
81 |
+
|
82 |
+
$data['license_key'] = trim($data['license_key']);
|
83 |
+
Mage::getConfig()->saveConfig('magebridge/settings/license_key', $data['license_key']);
|
84 |
+
Mage::getConfig()->removeCache();
|
85 |
+
|
86 |
+
}
|
87 |
+
|
88 |
+
$url = Mage::getModel('adminhtml/url')->getUrl('magebridge/index/index');
|
89 |
+
$this->getResponse()->setRedirect($url);
|
90 |
+
}
|
91 |
+
}
|
app/code/community/Jira/MageBridge/etc/config.xml
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento Bridge
|
5 |
+
*
|
6 |
+
* @author Yireo
|
7 |
+
* @package Magento Bridge
|
8 |
+
* @copyright Copyright 2009
|
9 |
+
* @license Yireo EULA (www.yireo.com)
|
10 |
+
* @link http://www.yireo.com
|
11 |
+
*/
|
12 |
+
-->
|
13 |
+
<config>
|
14 |
+
|
15 |
+
<modules>
|
16 |
+
<Jira_MageBridge>
|
17 |
+
<version>1.0 build 1</version>
|
18 |
+
</Jira_MageBridge>
|
19 |
+
</modules>
|
20 |
+
|
21 |
+
<global>
|
22 |
+
|
23 |
+
<blocks>
|
24 |
+
<magebridge>
|
25 |
+
<class>Jira_MageBridge_Block</class>
|
26 |
+
</magebridge>
|
27 |
+
</blocks>
|
28 |
+
|
29 |
+
<helpers>
|
30 |
+
<magebridge>
|
31 |
+
<class>Jira_MageBridge_Helper</class>
|
32 |
+
</magebridge>
|
33 |
+
</helpers>
|
34 |
+
|
35 |
+
<models>
|
36 |
+
<magebridge>
|
37 |
+
<class>Jira_MageBridge_Model</class>
|
38 |
+
</magebridge>
|
39 |
+
</models>
|
40 |
+
|
41 |
+
</global>
|
42 |
+
|
43 |
+
<admin>
|
44 |
+
<routers>
|
45 |
+
<magebridge>
|
46 |
+
<use>admin</use>
|
47 |
+
<args>
|
48 |
+
<module>Jira_MageBridge</module>
|
49 |
+
<frontName>magebridge</frontName>
|
50 |
+
</args>
|
51 |
+
</magebridge>
|
52 |
+
</routers>
|
53 |
+
</admin>
|
54 |
+
|
55 |
+
<adminhtml>
|
56 |
+
<translate>
|
57 |
+
<modules>
|
58 |
+
<Jira_MageBridge>
|
59 |
+
<files>
|
60 |
+
<default>Jira_MageBridge.csv</default>
|
61 |
+
</files>
|
62 |
+
</Jira_MageBridge>
|
63 |
+
</modules>
|
64 |
+
</translate>
|
65 |
+
<menu>
|
66 |
+
<cms>
|
67 |
+
<children>
|
68 |
+
<magebridge translate="title" module="magebridge">
|
69 |
+
<title>MageBridge Installer</title>
|
70 |
+
<action>magebridge/index</action>
|
71 |
+
</magebridge>
|
72 |
+
</children>
|
73 |
+
</cms>
|
74 |
+
</menu>
|
75 |
+
<acl>
|
76 |
+
<resources>
|
77 |
+
<admin>
|
78 |
+
<children>
|
79 |
+
<system>
|
80 |
+
<children>
|
81 |
+
<config>
|
82 |
+
<children>
|
83 |
+
<magebridge translate="title" module="magebridge">
|
84 |
+
<title>Jira MageBridge</title>
|
85 |
+
</magebridge>
|
86 |
+
</children>
|
87 |
+
</config>
|
88 |
+
</children>
|
89 |
+
</system>
|
90 |
+
</children>
|
91 |
+
</admin>
|
92 |
+
</resources>
|
93 |
+
</acl>
|
94 |
+
</adminhtml>
|
95 |
+
|
96 |
+
</config>
|
app/code/community/Jira/MageBridge/etc/system.xml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento Bridge
|
5 |
+
*
|
6 |
+
* @author Yireo
|
7 |
+
* @package Magento Bridge
|
8 |
+
* @copyright Copyright 2009
|
9 |
+
* @license Yireo EULA (www.yireo.com)
|
10 |
+
* @link http://www.yireo.com
|
11 |
+
*/
|
12 |
+
-->
|
13 |
+
<config>
|
14 |
+
<sections>
|
15 |
+
<magebridge translate="label" module="magebridge">
|
16 |
+
<label>Jira MageBridge</label>
|
17 |
+
<tab>service</tab>
|
18 |
+
<frontend_type>text</frontend_type>
|
19 |
+
<sort_order>342</sort_order>
|
20 |
+
<show_in_default>1</show_in_default>
|
21 |
+
<show_in_website>1</show_in_website>
|
22 |
+
<show_in_store>1</show_in_store>
|
23 |
+
<groups>
|
24 |
+
<settings translate="label">
|
25 |
+
<label>Settings</label>
|
26 |
+
<frontend_type>text</frontend_type>
|
27 |
+
<sort_order>1</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>1</show_in_store>
|
31 |
+
<fields>
|
32 |
+
<active translate="label">
|
33 |
+
<label>Enabled</label>
|
34 |
+
<frontend_type>select</frontend_type>
|
35 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
36 |
+
<sort_order>1</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>1</show_in_store>
|
40 |
+
</active>
|
41 |
+
</fields>
|
42 |
+
</settings>
|
43 |
+
</groups>
|
44 |
+
</magebridge>
|
45 |
+
</sections>
|
46 |
+
</config>
|
app/design/adminhtml/default/default/template/magebridge/license.phtml
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Bridge
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Magento Bridge
|
7 |
+
* @copyright Copyright 2009
|
8 |
+
* @license Yireo EULA (www.yireo.com)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
?>
|
12 |
+
|
13 |
+
<div class="columns ">
|
14 |
+
|
15 |
+
<div class="side-col" id="page:left">
|
16 |
+
<?php echo $this->getMenu(); ?>
|
17 |
+
</div>
|
18 |
+
|
19 |
+
<div class="main-col" id="content">
|
20 |
+
<div class="main-col-inner">
|
21 |
+
|
22 |
+
<div class="content-header">
|
23 |
+
<table cellspacing="0">
|
24 |
+
<tr>
|
25 |
+
<td style="width:80%;"><h3 class="icon-head head-tag"><?php echo $this->getHeader('License Agreement'); ?></h3></td>
|
26 |
+
</tr>
|
27 |
+
</table>
|
28 |
+
</div>
|
29 |
+
|
30 |
+
<h3><?php echo $this->__( 'MageBridge License Agreement' ); ?></h3>
|
31 |
+
<pre>
|
32 |
+
THIS LICENSE AGREEMENT (HEREINAFTER AGREEMENT) IS AN AGREEMENT BETWEEN YOU (THE
|
33 |
+
PERSON OR COMPANY WHO IS BEING LICENSED TO USE THE SOFTWARE OR DOCUMENTATION)
|
34 |
+
AND JIRA ICT (HEREINAFTER WE/US/OUR). THE AGREEMENT APPLIES TO ALL PRODUCTS
|
35 |
+
(SOFTWARE AND/OR SERVICES) YOU PURCHASE FROM US.
|
36 |
+
|
37 |
+
1. By purchasing the product you acknowledge that you have read this agreement,
|
38 |
+
and that you agree to the content of the agreement and its terms, and agree
|
39 |
+
to use the product in compliance with this agreement.
|
40 |
+
|
41 |
+
2. The agreement comes into legal force at the moment when you order our product
|
42 |
+
from our site or receive it through email or on data medium at our
|
43 |
+
discretion.
|
44 |
+
|
45 |
+
3. We are the copyright holder of the product. The product or a portion of it
|
46 |
+
is a copyrightable matter and is liable to protection by the law. Any
|
47 |
+
activity that infringes terms of this agreement violates copyright law and
|
48 |
+
will be prosecuted according to the current law. We reserve the right to
|
49 |
+
revoke the license of any user who is holding an invalid license.
|
50 |
+
|
51 |
+
4. This agreement gives you the right to use the product on one domain solely
|
52 |
+
for your own personal or business use, subject to all other terms of this
|
53 |
+
agreement. A separate license should be purchased for each other domain the
|
54 |
+
product is deployed on. Any distribution of the product without our consent,
|
55 |
+
including noncommercial distribution is regarded as violation of this
|
56 |
+
agreement and entails liability, according to the current law.
|
57 |
+
|
58 |
+
5. You may not use any part of the code in whole or part in any other software
|
59 |
+
or product or website. Such an action conflicts with this EULA.
|
60 |
+
|
61 |
+
6. You may not give, sell, distribute, sub-license, rent, lease or lend any
|
62 |
+
portion of the product to anyone. You may not place the product on a server
|
63 |
+
so that it is accessible via a public network such as the Internet for
|
64 |
+
distribution purposes.
|
65 |
+
|
66 |
+
7. You are bound to preserve the copyright information intact, this includes the
|
67 |
+
text/link at bottom.
|
68 |
+
|
69 |
+
8. We will not be liable to you for any damages (including any loss of profits
|
70 |
+
or saving, either incidental or consequential) caused to you, your
|
71 |
+
information and your business arising out of the use or inability to use
|
72 |
+
this product.
|
73 |
+
|
74 |
+
9. We are not liable for prosecution arising from use of the product against
|
75 |
+
law or for any illegal use.
|
76 |
+
|
77 |
+
10. If you fail to use the product in accordance with the terms and conditions
|
78 |
+
of this license agreement, it constitutes a breach of the agreement, and
|
79 |
+
your license to use the program is revoked.
|
80 |
+
|
81 |
+
11. We reserve the right to change this license agreement at any time and impose
|
82 |
+
its clauses at any given time.
|
83 |
+
|
84 |
+
12. License agreement remains effective until terminated. We retain the right to
|
85 |
+
terminate your license to use the product at any time, if in its sole
|
86 |
+
discretion, you are not abiding by the terms of the agreement, including,
|
87 |
+
but not limited to, obscuring or removing any link or copyright notice as
|
88 |
+
specified in this agreement. You may terminate it at any time by destroying
|
89 |
+
all copies of the product. Termination of this agreement does not bind us
|
90 |
+
to return you the amount spent for purchase of the product.
|
91 |
+
|
92 |
+
13. If you continue to use the product after we give you notice of termination of
|
93 |
+
your license, you hereby agree to accept an injunction to enjoin you from its
|
94 |
+
further use and to pay all costs (including but not limited to reasonable
|
95 |
+
attorney fees) to enforce our revocation of your license and any damages
|
96 |
+
suffered by us because of your misuse of the product.
|
97 |
+
</pre>
|
98 |
+
|
99 |
+
</div>
|
100 |
+
|
101 |
+
</div>
|
102 |
+
|
app/design/adminhtml/default/default/template/magebridge/menu.phtml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Bridge
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Magento Bridge
|
7 |
+
* @copyright Copyright 2009
|
8 |
+
* @license Yireo EULA (www.yireo.com)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
?>
|
12 |
+
<ul id="system_config_tabs" class="tabs config-tabs">
|
13 |
+
<li>
|
14 |
+
<dl>
|
15 |
+
<dt class="label">Menu</dt>
|
16 |
+
<?php foreach($this->getMenuItems() as $item) { ?>
|
17 |
+
<dd><a href="<?php echo $item['url']; ?>" class="<?php echo $item['class']; ?>"><span><?php echo $item['title']; ?></span></a></dd>
|
18 |
+
<?php } ?>
|
19 |
+
</dl>
|
20 |
+
</li>
|
21 |
+
</ul>
|
app/design/adminhtml/default/default/template/magebridge/settings.phtml
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Bridge
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Magento Bridge
|
7 |
+
* @copyright Copyright 2009
|
8 |
+
* @license Yireo EULA (www.yireo.com)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
?>
|
12 |
+
|
13 |
+
<form action="<?php echo $this->getSaveUrl() ?>" method="post" id="magebridge_edit_form">
|
14 |
+
<div class="columns ">
|
15 |
+
|
16 |
+
<div class="side-col" id="page:left">
|
17 |
+
<?php echo $this->getMenu(); ?>
|
18 |
+
</div>
|
19 |
+
|
20 |
+
<div class="main-col" id="content">
|
21 |
+
<div class="main-col-inner">
|
22 |
+
|
23 |
+
<div class="content-header">
|
24 |
+
<table cellspacing="0">
|
25 |
+
<tr>
|
26 |
+
<td style="width:80%;"><h3 class="icon-head head-tag"><?php echo $this->getHeader('Settings'); ?></h3></td>
|
27 |
+
<td class="formbuttons">
|
28 |
+
<?php echo $this->getSaveButtonHtml(); ?>
|
29 |
+
<button type="button" class="scalable" onclick="doSubmit();"><span><?php echo $this->__('Save'); ?></span></button>
|
30 |
+
</td>
|
31 |
+
</tr>
|
32 |
+
</table>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<div class="entry-edit">
|
36 |
+
|
37 |
+
<div class="entry-edit-head">
|
38 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('General'); ?></h4>
|
39 |
+
</div>
|
40 |
+
|
41 |
+
<div class="fieldset ">
|
42 |
+
|
43 |
+
<table cellspacing="5" class="form-list">
|
44 |
+
<tbody>
|
45 |
+
<tr>
|
46 |
+
<td width="300"><label for="license_key"><?php echo $this->__('License key'); ?></label></td>
|
47 |
+
<td><input type="text" class="input-text" size="40" name="license_key" id="license_key" value="<?php echo $this->getSetting('license_key'); ?>" /></td>
|
48 |
+
</tr>
|
49 |
+
</tbody>
|
50 |
+
</table>
|
51 |
+
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
<?php echo $this->getBlockHtml('formkey'); ?>
|
59 |
+
</form>
|
60 |
+
|
61 |
+
<script type="text/javascript">
|
62 |
+
var magebridgeForm = new varienForm('magebridge_edit_form');
|
63 |
+
function doSubmit() {
|
64 |
+
magebridgeForm.submit();
|
65 |
+
return true;
|
66 |
+
}
|
67 |
+
</script>
|
app/design/adminhtml/default/default/template/magebridge/updates.phtml
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento Bridge
|
4 |
+
*
|
5 |
+
* @author Yireo
|
6 |
+
* @package Magento Bridge
|
7 |
+
* @copyright Copyright 2009
|
8 |
+
* @license Yireo EULA (www.yireo.com)
|
9 |
+
* @link http://www.yireo.com
|
10 |
+
*/
|
11 |
+
?>
|
12 |
+
|
13 |
+
<style type="text/css">
|
14 |
+
div#mbajax-updater {
|
15 |
+
width: 100%;
|
16 |
+
padding: 30px;
|
17 |
+
}
|
18 |
+
</style>
|
19 |
+
|
20 |
+
<div class="columns ">
|
21 |
+
|
22 |
+
<div class="side-col" id="page:left">
|
23 |
+
<?php echo $this->getMenu(); ?>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<div class="main-col" id="content">
|
27 |
+
<div class="main-col-inner">
|
28 |
+
|
29 |
+
<div class="content-header">
|
30 |
+
<table cellspacing="0">
|
31 |
+
<tr>
|
32 |
+
<td style="width:80%;"><h3 class="icon-head head-tag"><?php echo $this->getHeader('Update'); ?></h3></td>
|
33 |
+
</tr>
|
34 |
+
</table>
|
35 |
+
</div>
|
36 |
+
|
37 |
+
<div class="entry-edit">
|
38 |
+
|
39 |
+
<div class="entry-edit-head">
|
40 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Version check'); ?></h4>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<div class="fieldset ">
|
44 |
+
<div id="mbajax-updater" style="display:none;"><h3><?php echo $this->__('Please wait while MageBridge is being installed'); ?></h3></div>
|
45 |
+
<div id="mbajax-table">
|
46 |
+
<table cellspacing="5" class="form-list">
|
47 |
+
<!--<tr>
|
48 |
+
<td width="150"><?php echo $this->__('Current version'); ?></td>
|
49 |
+
<td><?php echo $this->getCurrentVersion(); ?></td>
|
50 |
+
</tr>-->
|
51 |
+
<tr>
|
52 |
+
<td><?php echo $this->__('Full version'); ?></td>
|
53 |
+
<td><span id="mbajax-version"><?php echo $this->getNewVersion(); ?></span></td>
|
54 |
+
</tr>
|
55 |
+
</table>
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
|
60 |
+
<?php if($this->upgradeNeeded() == true) { ?>
|
61 |
+
<button type="button" class="scalable" onclick="doUpdate();"><span><?php echo $this->__('Install'); ?></span></button>
|
62 |
+
<?php } else { ?>
|
63 |
+
<?php echo $this->__('No update needed'); ?>
|
64 |
+
<?php } ?>
|
65 |
+
|
66 |
+
</div>
|
67 |
+
</div>
|
68 |
+
|
69 |
+
<script type="text/javascript">
|
70 |
+
function doUpdate() {
|
71 |
+
|
72 |
+
Effect.toggle('mbajax-table', 'appear', {duration: 0.2});
|
73 |
+
Effect.toggle('mbajax-updater', 'appear', {delay: 0.2});
|
74 |
+
|
75 |
+
new Ajax.Request('<?php echo $this->getUpdateUrl(); ?>', {
|
76 |
+
method:'get',
|
77 |
+
onSuccess: function(transport){
|
78 |
+
var response = transport.responseText;
|
79 |
+
var data = response.evalJSON(true);
|
80 |
+
$('mbajax-version').update(data.message);
|
81 |
+
document.location = '<?php echo $this->getThisUrl(); ?>';
|
82 |
+
},
|
83 |
+
onFailure: function() {
|
84 |
+
$('mbajax-version').update('Failed to fetch update-info');
|
85 |
+
Effect.toggle('mbajax-updater', 'appear', {duration: 0.2});
|
86 |
+
Effect.toggle('mbajax-table', 'appear', {delay: 0.2});
|
87 |
+
}
|
88 |
+
});
|
89 |
+
}
|
90 |
+
</script>
|
91 |
+
|
app/etc/modules/Jira_MageBridge.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* MageBridge-module for Magento
|
5 |
+
*
|
6 |
+
* @category design_default
|
7 |
+
* @package Jira_MageBridge
|
8 |
+
* @author Jisse Reitsma (Jira ICT)
|
9 |
+
* @copyright Copyright (c) 2009 Jira ICT (http://www.jira.nl/)
|
10 |
+
* @license Open Software License
|
11 |
+
*/
|
12 |
+
-->
|
13 |
+
<config>
|
14 |
+
<modules>
|
15 |
+
<Jira_MageBridge>
|
16 |
+
<active>true</active>
|
17 |
+
<codePool>community</codePool>
|
18 |
+
</Jira_MageBridge>
|
19 |
+
</modules>
|
20 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Jira_MageBridge</name>
|
4 |
+
<version>1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.yireo.com/">MageBridge EULA</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>This module integrates Magento with Joomla!</summary>
|
10 |
+
<description>This module integrates Magento with Joomla!</description>
|
11 |
+
<notes>This PEAR package can only be distributed with a valid MageBridge license.</notes>
|
12 |
+
<authors><author><name>Jisse Reitsma</name><user>auto-converted</user><email>info@jira.nl</email></author></authors>
|
13 |
+
<date>2009-05-26</date>
|
14 |
+
<time>10:38:57</time>
|
15 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="magebridge"><file name="license.phtml" hash="7f87df8053557e777a9c6c733eb8aef0"/><file name="menu.phtml" hash="3524d7e9dcc64cc2b17881a5ca9b335c"/><file name="settings.phtml" hash="4daaee62f56eebb827761d895631875a"/><file name="updates.phtml" hash="3b7b1cc50087b0a4cceb4a2ef4b74857"/></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Jira"><dir name="MageBridge"><dir name="controllers"><file name="IndexController.php" hash="5dd7282102589a9950312a1235ff8bd2"/></dir><dir name="Block"><file name="License.php" hash="f7b55c605964dcbaf8fd74c606c9d4e9"/><file name="Menu.php" hash="2f3675cb4f4c2406e97cde577ac855ca"/><file name="Settings.php" hash="d50bfe4a62931764c70747b47c8d234d"/><file name="Updates.php" hash="2e5cfea03dbe0cbc1b08ed09d91fb2f2"/></dir><dir name="etc"><file name="config.xml" hash="b99735780681d7fa0105c184b8575b6f"/><file name="system.xml" hash="fd6013af4f857472a4be5a72ebe6ffc0"/></dir><dir name="Helper"><file name="Data.php" hash="25b3a5b0ff8841c9e655680a7b6eafec"/></dir><dir name="Model"><file name="Update.php" hash="77ffc4c8c400832e604a7fba993f6030"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Jira_MageBridge.xml" hash="c572b0ef802d01dbb221a7a61b5fae21"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies/>
|
18 |
+
</package>
|