+ */
class Mage_XmlConnect_Block_Adminhtml_Mobile extends Mage_Adminhtml_Block_Widget_Grid_Container
{
/**
@@ -35,10 +40,9 @@ public function __construct()
{
$this->_controller = 'adminhtml_mobile';
$this->_blockGroup = 'xmlconnect';
- $this->_headerText = Mage::helper('xmlconnect')->__('Manage Apps');
- $this->_addButtonLabel = Mage::helper('xmlconnect')->__('Add App');
+ $this->_headerText = $this->__('Manage Apps');
+ $this->_addButtonLabel = $this->__('Add App');
parent::__construct();
}
-
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php
index ce2041d0ca..ab0a062769 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php
@@ -23,7 +23,6 @@
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
/**
@@ -35,39 +34,54 @@ public function __construct()
$this->_controller = 'adminhtml_mobile';
$this->_blockGroup = 'xmlconnect';
parent::__construct();
- $model = Mage::registry('current_app');
+ $app = $this->getApplication();
- $this->_updateButton('save', 'label', Mage::helper('xmlconnect')->__('Save'));
- $this->_updateButton('save', 'onclick', 'if (editForm.submit()) {disableElements(\'save\')}');
+ if ((bool)!Mage::getSingleton('adminhtml/session')->getNewApplication()) {
+ $this->_updateButton('save', 'label', $this->__('Save'));
+ $this->_updateButton('save', 'onclick', 'if (editForm.submit()) {disableElements(\'save\')}');
- $this->_addButton('save_and_continue', array(
- 'label' => Mage::helper('xmlconnect')->__('Save and Continue Edit'),
- 'onclick' => 'saveAndContinueEdit()',
- 'class' => 'save',
- ), -5);
+ $this->_addButton('save_and_continue', array(
+ 'label' => $this->__('Save and Continue Edit'),
+ 'onclick' => 'saveAndContinueEdit()',
+ 'class' => 'save',
+ ), -5);
- if (Mage::registry('current_app')->getId()) {
- $this->_addButton('submit_application_button', array(
- 'label' => Mage::helper('xmlconnect')->__('Save and Submit App'),
- 'onclick' => 'saveAndSubmitApp()',
- 'class' => 'save'
- ), -10);
- }
+ if ($app->getId()) {
+ $this->_addButton('submit_application_button', array(
+ 'label' => $this->__('Save and Submit App'),
+ 'onclick' => 'saveAndSubmitApp()',
+ 'class' => 'save'
+ ), -10);
+ }
- $this->_formScripts[] = 'function saveAndContinueEdit() {'
- .'if (editForm.submit($(\'edit_form\').action + \'back/edit/\')) {disableElements(\'save\')};}';
- if ($model->getId()) {
- $this->_formScripts[] = 'function saveAndSubmitApp() {'
- .'if (editForm.submit($(\'edit_form\').action+\'submitapp/' . $model->getId() . '\')) {'
- .'disableElements(\'save\')};}';
+ $this->_formScripts[] = 'function saveAndContinueEdit() {'
+ .'if (editForm.submit($(\'edit_form\').action + \'back/edit/\')) {disableElements(\'save\')};}';
+ if ($app->getId()) {
+ $this->_formScripts[] = 'function saveAndSubmitApp() {'
+ .'if (editForm.submit($(\'edit_form\').action+\'submitapp/' . $app->getId() . '\')) {'
+ .'disableElements(\'save\')};}';
+ }
+ } else {
+ $this->removeButton('save');
+ $this->removeButton('delete');
}
- if (Mage::registry('current_app')->getIsSubmitted()) {
+ if (isset($app) && $app->getIsSubmitted()) {
$this->removeButton('delete');
}
$this->removeButton('reset');
}
+ /**
+ * Retrieve currently edited application object
+ *
+ * @return Mage_XmlConnect_Model_Application
+ */
+ public function getApplication()
+ {
+ return Mage::registry('current_app');
+ }
+
/**
* Adding JS scripts to block
*
@@ -87,11 +101,11 @@ protected function _prepareLayout()
*/
public function getHeaderText()
{
- $app = Mage::registry('current_app');
+ $app = $this->getApplication();
if ($app && $app->getId()) {
- return Mage::helper('xmlconnect')->__('Edit App "%s"', $this->htmlEscape($app->getName()));
+ return $this->__('Edit App "%s"', $this->htmlEscape($app->getName()));
} else {
- return Mage::helper('xmlconnect')->__('New App');
+ return $this->__('New App');
}
}
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php
index 4af1501076..03a4f7d415 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php
@@ -25,7 +25,6 @@
*/
class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
{
-
/**
* Prepare form before rendering HTML
* Setting Form Fieldsets and fields
@@ -34,7 +33,12 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Form extends Mage_Adminhtml_Bl
*/
protected function _prepareForm()
{
- $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('*/mobile/save'), 'method' => 'post', 'enctype' => 'multipart/form-data'));
+ $form = new Varien_Data_Form(array('id' => 'edit_form',
+ 'action' => Mage::getSingleton('adminhtml/session')->getNewApplication()
+ ? $this->getUrl('*/mobile/edit', array('_current' => true)) : $this->getUrl('*/mobile/save'),
+ 'method' => 'post',
+ 'enctype' => 'multipart/form-data'
+ ));
$form->setUseContainer(true);
$this->setForm($form);
return parent::_prepareForm();
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php
index 5813c679e3..928847adbc 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php
@@ -37,5 +37,4 @@ public function __construct()
$this->setId('mobile_app_submit');
$this->setDestElementId('content');
}
-
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php
index 7d8e63dad9..2c13ef5611 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php
@@ -73,15 +73,15 @@ protected function _prepareForm()
$dummy = array(array( 'value' => '', 'label' => '' ));
$this->_pages = array_merge($dummy, $pages);
- $fieldset = $form->addFieldset('cms_pages', array('legend' => Mage::helper('xmlconnect')->__('Pages')));
+ $fieldset = $form->addFieldset('cms_pages', array('legend' => $this->__('Pages')));
$this->_addElementTypes($fieldset);
$fieldset->addField('page_row_add', 'addrow', array(
'onclick' => 'insertNewTableRow(this)',
'options' => $this->_pages,
'class' => ' scalable save ',
- 'label' => Mage::helper('xmlconnect')->__('Label'),
- 'before_element_html' => Mage::helper('xmlconnect')->__('Get Content from CMS Page').'',
+ 'label' => $this->__('Label'),
+ 'before_element_html' => $this->__('Get Content from CMS Page').' ',
));
if (isset($conf['native']['pages'])) {
@@ -91,7 +91,7 @@ protected function _prepareForm()
}
$data = $model->getFormData();
- $data['page_row_add'] = Mage::helper('xmlconnect')->__('Add Page');
+ $data['page_row_add'] = $this->__('Add Page');
$form->setValues($data);
return parent::_prepareForm();
}
@@ -103,7 +103,7 @@ protected function _prepareForm()
*/
public function getTabLabel()
{
- return Mage::helper('xmlconnect')->__('Content');
+ return $this->__('Content');
}
/**
@@ -113,7 +113,7 @@ public function getTabLabel()
*/
public function getTabTitle()
{
- return Mage::helper('xmlconnect')->__('Content');
+ return $this->__('Content');
}
/**
@@ -123,7 +123,7 @@ public function getTabTitle()
*/
public function canShowTab()
{
- return true;
+ return (bool) !Mage::getSingleton('adminhtml/session')->getNewApplication();
}
/**
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php
index 4d43ea3b5a..866f00b1cc 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php
@@ -44,7 +44,7 @@ public function __construct()
*/
public function getTabLabel()
{
- return Mage::helper('xmlconnect')->__('Design');
+ return $this->__('Design');
}
/**
@@ -54,7 +54,7 @@ public function getTabLabel()
*/
public function getTabTitle()
{
- return Mage::helper('xmlconnect')->__('Design');
+ return $this->__('Design');
}
/**
@@ -64,7 +64,7 @@ public function getTabTitle()
*/
public function canShowTab()
{
- return true;
+ return (bool) !Mage::getSingleton('adminhtml/session')->getNewApplication();
}
/**
@@ -76,4 +76,14 @@ public function isHidden()
{
return false;
}
+
+ /**
+ * Check if we have to show Preview Block
+ *
+ * @return bool
+ */
+ public function canShowPreview()
+ {
+ return true;
+ }
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php
index 4af6291d69..bc94a6e918 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php
@@ -32,7 +32,7 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Accordion_Images ex
*/
public function getTitle()
{
- return Mage::helper('xmlconnect')->__('Images');
+ return $this->__('Images');
}
/**
@@ -48,6 +48,7 @@ public function getIsOpen()
/**
* Prepare form
*
+ * @throws Mage_Core_Exception
* @return Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form
*/
protected function _prepareForm()
@@ -58,25 +59,73 @@ protected function _prepareForm()
$this->_addElementTypes($fieldset);
$this->addImage($fieldset,
'conf[native][navigationBar][icon]',
- Mage::helper('xmlconnect')->__('Logo in Header'),
- Mage::helper('xmlconnect')->__('Recommended size 35px x 35px.'),
+ $this->__('Logo in Header'),
+ $this->__('Recommended size 35px x 35px.'),
$this->_getDesignPreviewImageUrl(Mage::helper('xmlconnect/image')->getInterfaceImagesPaths('conf/native/navigationBar/icon')),
true
);
- $this->addImage($fieldset,
- 'conf[native][body][bannerImage]',
- Mage::helper('xmlconnect')->__('Banner on Home Screen'),
- Mage::helper('xmlconnect')->__('Recommended size 320px x 230px. Note: Image size affects the performance of your app. Keep your image size below 50 KB for optimal performance.'),
- $this->_getDesignPreviewImageUrl(Mage::helper('xmlconnect/image')->getInterfaceImagesPaths('conf/native/body/bannerImage')),
- true
- );
- $this->addImage($fieldset,
- 'conf[native][body][backgroundImage]',
- Mage::helper('xmlconnect')->__('App Background'),
- Mage::helper('xmlconnect')->__('Recommended size 320px x 367px. Note: Image size affects the performance of your app. Keep your image size below 75 KB for optimal performance.'),
- $this->_getDesignPreviewImageUrl(Mage::helper('xmlconnect/image')->getInterfaceImagesPaths('conf/native/body/backgroundImage')),
- true
- );
+
+ $deviceType = Mage::helper('xmlconnect')->getApplication()->getType();
+ switch ($deviceType) {
+ case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE:
+ $this->addImage($fieldset,
+ 'conf[native][body][bannerImage]',
+ $this->__('Banner on Home Screen'),
+ $this->__('Recommended size 320px x 230px. Note: Image size affects the performance of your app. Keep your image size below 50 KB for optimal performance.'),
+ $this->_getDesignPreviewImageUrl(Mage::helper('xmlconnect/image')->getInterfaceImagesPaths('conf/native/body/bannerImage')),
+ true
+ );
+ $this->addImage($fieldset,
+ 'conf[native][body][backgroundImage]',
+ $this->__('App Background'),
+ $this->__('Recommended size 320px x 367px. Note: Image size affects the performance of your app. Keep your image size below 75 KB for optimal performance.'),
+ $this->_getDesignPreviewImageUrl(Mage::helper('xmlconnect/image')->getInterfaceImagesPaths('conf/native/body/backgroundImage')),
+ true
+ );
+ break;
+ case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPAD:
+ $this->addImage($fieldset,
+ 'conf[native][body][bannerImageIpad]',
+ $this->__('Banner on Home Screen'),
+ $this->__('Recommended size 768px x 294px. Note: Image size affects the performance of your app.'),
+ $this->_getDesignPreviewImageUrl(Mage::helper('xmlconnect/image')->getInterfaceImagesPaths('conf/native/body/bannerImageIpad')),
+ true
+ );
+ $this->addImage($fieldset,
+ 'conf[native][body][backgroundImageIpadLandscape]',
+ $this->__('App Background (landscape mode)'),
+ $this->__('Recommended size 1024px x 704px. Note: Image size affects the performance of your app.'),
+ $this->_getDesignPreviewImageUrl(Mage::helper('xmlconnect/image')->getInterfaceImagesPaths('conf/native/body/backgroundImageIpadLandscape')),
+ true
+ );
+ $this->addImage($fieldset,
+ 'conf[native][body][backgroundImageIpadPortret]',
+ $this->__('App Background (portrait mode)'),
+ $this->__('Recommended size 768px x 960px. Note: Image size affects the performance of your app.'),
+ $this->_getDesignPreviewImageUrl(Mage::helper('xmlconnect/image')->getInterfaceImagesPaths('conf/native/body/backgroundImageIpadPortret')),
+ true
+ );
+ break;
+ case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID:
+ $this->addImage($fieldset,
+ 'conf[native][body][bannerImageAndroid]',
+ $this->__('Banner on Home Screen'),
+ $this->__('Recommended size 320px x 258px. Note: Image size affects the performance of your app. Keep your image size below 50 KB for optimal performance.'),
+ $this->_getDesignPreviewImageUrl(Mage::helper('xmlconnect/image')->getInterfaceImagesPaths('conf/native/body/bannerImageAndroid')),
+ true
+ );
+ $this->addImage($fieldset,
+ 'conf[native][body][backgroundImageAndroid]',
+ $this->__('App Background'),
+ $this->__('Recommended size 320px x 455px. Note: Image size affects the performance of your app. Keep your image size below 75 KB for optimal performance.'),
+ $this->_getDesignPreviewImageUrl(Mage::helper('xmlconnect/image')->getInterfaceImagesPaths('conf/native/body/backgroundImageAndroid')),
+ true
+ );
+ break;
+ default:
+ Mage::throwException($this->__('Device doesn\'t recognized: "%s". Unable to load a helper.', $deviceType));
+ break;
+ }
$form->setValues($this->getApplication()->getFormData());
$this->setForm($form);
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php
index 19dc140666..0970b2cbfe 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php
@@ -32,7 +32,12 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Accordion_Tabs exte
*/
public function getTitle()
{
- return Mage::helper('xmlconnect')->__('Tabs');
+ if (Mage::helper('xmlconnect')->getApplication()->getType() == Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPAD) {
+ $title = $this->__('Extensions');
+ } else {
+ $title = $this->__('Tabs');
+ }
+ return $title;
}
/**
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php
index 3e307e1106..36c3eb76f7 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php
@@ -32,7 +32,7 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Accordion_Themes ex
*/
public function getTitle()
{
- return Mage::helper('xmlconnect')->__('Color Themes');
+ return $this->__('Color Themes');
}
/**
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php
index 88b768a51c..34079a0e48 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php
@@ -31,7 +31,15 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Preview extends Mag
public function __construct()
{
parent::__construct();
- $this->setTemplate('xmlconnect/edit/tab/design/preview.phtml');
+
+ $device = Mage::helper('xmlconnect')->getApplication()->getType();
+ if (array_key_exists($device, Mage::helper('xmlconnect')->getSupportedDevices())) {
+ $template = 'xmlconnect/edit/tab/design/preview_' . strtolower($device) . '.phtml';
+ } else {
+ Mage::throwException($this->__('Device doesn\'t recognized. Unable to load a template.'));
+ }
+
+ $this->setTemplate($template);
}
/**
@@ -42,6 +50,16 @@ public function __construct()
*/
public function getPreviewActionUrl($page = 'home')
{
- return $this->getUrl('*/*/preview' . $page, array('application_id' => Mage::registry('current_app')->getId()));
+ $params = array();
+ $model = Mage::registry('current_app');
+ if ($model !== null) {
+ if ($model->getId() !== null) {
+ $params = array('application_id' => $model->getId());
+ } else {
+ $params = array('devtype' => $model->getDevtype());
+ }
+
+ }
+ return $this->getUrl('*/*/preview' . $page, $params);
}
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php
index 9724ca5279..010d21b343 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php
@@ -38,23 +38,23 @@ public function __construct()
$data = $model->getFormData();
$this->setColorFieldset (array (
- array ( 'id' => 'field_colors', 'label' => Mage::helper('xmlconnect')->__('Colors'), 'fields' => array (
- $this->_addColorBox('conf[native][navigationBar][tintColor]', Mage::helper('xmlconnect')->__('Header Background Color'), $data),
- $this->_addColorBox('conf[native][body][primaryColor]', Mage::helper('xmlconnect')->__('Primary Color'), $data),
- $this->_addColorBox('conf[native][body][secondaryColor]', Mage::helper('xmlconnect')->__('Secondary Color'), $data),
- $this->_addColorBox('conf[native][categoryItem][backgroundColor]', Mage::helper('xmlconnect')->__('Category Item Background Color'), $data),
- $this->_addColorBox('conf[native][categoryItem][tintColor]', Mage::helper('xmlconnect')->__('Category Button Color'), $data),
+ array ( 'id' => 'field_colors', 'label' => $this->__('Colors'), 'fields' => array (
+ $this->_addColorBox('conf[native][navigationBar][tintColor]', $this->__('Header Background Color'), $data),
+ $this->_addColorBox('conf[native][body][primaryColor]', $this->__('Primary Color'), $data),
+ $this->_addColorBox('conf[native][body][secondaryColor]', $this->__('Secondary Color'), $data),
+ $this->_addColorBox('conf[native][categoryItem][backgroundColor]', $this->__('Category Item Background Color'), $data),
+ $this->_addColorBox('conf[native][categoryItem][tintColor]', $this->__('Category Button Color'), $data),
)),
- array ( 'id' => 'field_fonts', 'label' => Mage::helper('xmlconnect')->__('Fonts'), 'fields' => array (
- $this->_addColorBox('conf[extra][fontColors][header]', Mage::helper('xmlconnect')->__('Header Font Color'), $data),
- $this->_addColorBox('conf[extra][fontColors][primary]', Mage::helper('xmlconnect')->__('Primary Font Color'), $data),
- $this->_addColorBox('conf[extra][fontColors][secondary]', Mage::helper('xmlconnect')->__('Secondary Font Color'), $data),
- $this->_addColorBox('conf[extra][fontColors][price]', Mage::helper('xmlconnect')->__('Price Font Color'), $data),
+ array ( 'id' => 'field_fonts', 'label' => $this->__('Fonts'), 'fields' => array (
+ $this->_addColorBox('conf[extra][fontColors][header]', $this->__('Header Font Color'), $data),
+ $this->_addColorBox('conf[extra][fontColors][primary]', $this->__('Primary Font Color'), $data),
+ $this->_addColorBox('conf[extra][fontColors][secondary]', $this->__('Secondary Font Color'), $data),
+ $this->_addColorBox('conf[extra][fontColors][price]', $this->__('Price Font Color'), $data),
)),
- array ( 'id' => 'field_advanced', 'label' => Mage::helper('xmlconnect')->__('Advanced Settings'), 'fields' => array (
- $this->_addColorBox('conf[native][body][backgroundColor]', Mage::helper('xmlconnect')->__('Background Color'), $data),
- $this->_addColorBox('conf[native][body][scrollBackgroundColor]', Mage::helper('xmlconnect')->__('Scroll Background Color'), $data),
- $this->_addColorBox('conf[native][itemActions][relatedProductBackgroundColor]', Mage::helper('xmlconnect')->__('Related Product Background Color'), $data),
+ array ( 'id' => 'field_advanced', 'label' => $this->__('Advanced Settings'), 'fields' => array (
+ $this->_addColorBox('conf[native][body][backgroundColor]', $this->__('Background Color'), $data),
+ $this->_addColorBox('conf[native][body][scrollBackgroundColor]', $this->__('Scroll Background Color'), $data),
+ $this->_addColorBox('conf[native][itemActions][relatedProductBackgroundColor]', $this->__('Related Product Background Color'), $data),
)),
));
}
@@ -140,7 +140,7 @@ public function getApplication()
{
$model = Mage::registry('current_app');
if (!($model instanceof Mage_XmlConnect_Model_Application)) {
- Mage::throwException(Mage::helper('xmlconnect')->__('App model not loaded.'));
+ Mage::throwException($this->__('App model not loaded.'));
}
return $model;
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Flurryanalytics.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Flurryanalytics.php
new file mode 100755
index 0000000000..9d940a6034
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Flurryanalytics.php
@@ -0,0 +1,140 @@
+setShowGlobalIcon(true);
+ }
+
+ /**
+ * Prepare form before rendering HTML
+ * Setting Form Fieldsets and fields
+ *
+ * @return Mage_Adminhtml_Block_Widget_Form
+ */
+ protected function _prepareForm()
+ {
+ $form = new Varien_Data_Form();
+
+ $this->setForm($form);
+
+ $data = $this->getApplication()->getFormData();
+ $yesNoValues = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
+
+ $fieldset = $form->addFieldset('flurryAnalytics', array('legend' => $this->__('Flurry Analytics')));
+
+ $enabled = $fieldset->addField('conf/native/merchantFlurryTracking/isActive', 'select', array(
+ 'label' => $this->__('Enable Flurry Analytics'),
+ 'name' => 'conf[native][merchantFlurryTracking][isActive]',
+ 'values' => $yesNoValues,
+ 'note' => $this->__('Enable Flurry Analytics for the merchant.'),
+ 'value' => (isset($data['conf[native][merchantFlurryTracking][isActive]']) ? $data['conf[native][merchantFlurryTracking][isActive]'] : '0')
+ ));
+
+ $flurryAnalyticsUrl = $this->escapeHtml(Mage::getStoreConfig('xmlconnect/flurry_analytics/statistics_url'));
+
+ $flurryLink = $fieldset->addField('flurry_analytics_link', 'link', array(
+ 'title' => $this->__('Flurry Analytics Site'),
+ 'label' => $this->__('Flurry Analytics Site'),
+ 'value' => $flurryAnalyticsUrl,
+ 'href' => $flurryAnalyticsUrl,
+ 'target' => '__blank',
+ 'note' => $this->__('You can watch statistics here.'),
+ ));
+
+ $flurryApiCode = $fieldset->addField('conf/native/merchantFlurryTracking/accountId', 'text', array(
+ 'label' => $this->__('Flurry Api Code'),
+ 'name' => 'conf[native][merchantFlurryTracking][accountId]',
+ 'enabled' => true,
+ 'required' => true,
+ 'value' => (isset($data['conf[native][merchantFlurryTracking][accountId]']) ? $data['conf[native][merchantFlurryTracking][accountId]'] : '')
+ ));
+
+ // field dependencies
+ $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')
+ ->addFieldMap($flurryApiCode->getHtmlId(), $flurryApiCode->getName())
+ ->addFieldMap($enabled->getHtmlId(), $enabled->getName())
+ ->addFieldDependence(
+ $flurryApiCode->getName(),
+ $enabled->getName(),
+ 1)
+ );
+
+ return parent::_prepareForm();
+ }
+
+ /**
+ * Tab label getter
+ *
+ * @return string
+ */
+ public function getTabLabel()
+ {
+ return $this->__('Analytics');
+ }
+
+ /**
+ * Tab title getter
+ *
+ * @return string
+ */
+ public function getTabTitle()
+ {
+ return $this->__('Flurry Analytics');
+ }
+
+ /**
+ * Check if tab can be shown
+ *
+ * @return bool
+ */
+ public function canShowTab()
+ {
+ return (bool) !Mage::getSingleton('adminhtml/session')->getNewApplication()
+ && $this->getApplication()->getType() == Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE;
+ }
+
+ /**
+ * Check if tab hidden
+ *
+ * @return bool
+ */
+ public function isHidden()
+ {
+ return false;
+ }
+}
+
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php
index 3a7e3f83ae..2a1ca9b40f 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php
@@ -38,7 +38,7 @@ protected function _prepareForm()
$form = new Varien_Data_Form();
$form->setHtmlIdPrefix('app_');
- $fieldset = $form->addFieldset('base_fieldset', array('legend' => Mage::helper('xmlconnect')->__('App Information')));
+ $fieldset = $form->addFieldset('base_fieldset', array('legend' => $this->__('App Information')));
if ($model->getId()) {
$fieldset->addField('application_id', 'hidden', array(
@@ -48,15 +48,16 @@ protected function _prepareForm()
$fieldset->addField('name', 'text', array(
'name' => 'name',
- 'label' => Mage::helper('xmlconnect')->__('App Name'),
- 'title' => Mage::helper('xmlconnect')->__('App Name'),
+ 'label' => $this->__('App Name'),
+ 'title' => $this->__('App Name'),
+ 'maxlength' => '250',
'required' => true,
));
if ($model->getId()) {
$field = $fieldset->addField('code', 'label', array(
- 'label' => Mage::helper('xmlconnect')->__('App Code'),
- 'title' => Mage::helper('xmlconnect')->__('App Code'),
+ 'label' => $this->__('App Code'),
+ 'title' => $this->__('App Code'),
));
}
@@ -66,8 +67,8 @@ protected function _prepareForm()
if (!Mage::app()->isSingleStoreMode()) {
$storeElement = $fieldset->addField('store_id', 'select', array(
'name' => 'store_id',
- 'label' => Mage::helper('xmlconnect')->__('Store View'),
- 'title' => Mage::helper('xmlconnect')->__('Store View'),
+ 'label' => $this->__('Store View'),
+ 'title' => $this->__('Store View'),
'required' => true,
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(true, false),
));
@@ -83,21 +84,26 @@ protected function _prepareForm()
$storeElement->setDisabled(true);
}
- $fieldset->addField('type', 'select', array(
- 'name' => 'type',
- 'label' => Mage::helper('xmlconnect')->__('Device Type'),
- 'title' => Mage::helper('xmlconnect')->__('Device Type'),
- 'disabled' => $model->getId() ? true : false,
- 'values' => Mage::helper('xmlconnect')->getDeviceTypeOptions(),
+ $fieldset->addField('showdev', 'select', array(
+ 'name' => 'showdev',
+ 'label' => $this->__('Device Type'),
+ 'title' => $this->__('Device Type'),
+ 'values' => array($model->getType() => $model->getDevtype()),
+ 'disabled' => true,
+ ));
+
+ $fieldset->addField('devtype', 'hidden', array(
+ 'name' => 'devtype',
+ 'value' => $model->getDevtype(),
));
$yesNoValues = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
$fieldset->addField('browsing_mode', 'select', array(
- 'label' => Mage::helper('xmlconnect')->__('Catalog Only App?'),
+ 'label' => $this->__('Catalog Only App?'),
'name' => 'browsing_mode',
- 'note' => Mage::helper('xmlconnect')->__('A Catalog Only App will not support functions such as add to cart, add to wishlist, or login.'),
- 'values' => $yesNoValues
+ 'note' => $this->__('A Catalog Only App will not support functions such as add to cart, add to wishlist, or login.'),
+ 'values' => $yesNoValues
));
$form->setValues($model->getFormData());
@@ -112,7 +118,7 @@ protected function _prepareForm()
*/
public function getTabLabel()
{
- return Mage::helper('xmlconnect')->__('General');
+ return $this->__('General');
}
/**
@@ -122,7 +128,7 @@ public function getTabLabel()
*/
public function getTabTitle()
{
- return Mage::helper('xmlconnect')->__('General');
+ return $this->__('General');
}
/**
@@ -132,7 +138,7 @@ public function getTabTitle()
*/
public function canShowTab()
{
- return true;
+ return (bool) !Mage::getSingleton('adminhtml/session')->getNewApplication();
}
/**
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Notification.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Notification.php
new file mode 100755
index 0000000000..e87cbc9871
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Notification.php
@@ -0,0 +1,177 @@
+setShowGlobalIcon(true);
+ }
+
+ /**
+ * Prepare form before rendering HTML
+ * Setting Form Fieldsets and fields
+ *
+ * @return Mage_Adminhtml_Block_Widget_Form
+ */
+ protected function _prepareForm()
+ {
+ $form = new Varien_Data_Form();
+
+ $this->setForm($form);
+
+ $data = $this->getApplication()->getFormData();
+
+ $yesNoValues = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
+
+ $fieldset = $form->addFieldset('notifications', array(
+ 'legend' => $this->__('Urban Airship Push Notification'),
+ ));
+
+ $notificationEnabled = $fieldset->addField('conf/native/notifisations/isActive', 'select', array(
+ 'label' => $this->__('Enable AirMail Message Push notification'),
+ 'name' => 'conf[native][notifications][isActive]',
+ 'values' => $yesNoValues,
+ 'value' => (isset($data['conf[native][notifications][isActive]']) ? $data['conf[native][notifications][isActive]'] : '0'),
+ ));
+
+ $applicationKey = $fieldset->addField('conf/native/notifications/applicationKey', 'text', array(
+ 'label' => $this->__('Application Key'),
+ 'name' => 'conf[native][notifications][applicationKey]',
+ 'value' => (isset($data['conf[native][notifications][applicationKey]']) ? $data['conf[native][notifications][applicationKey]'] : ''),
+ 'required' => true
+ ));
+
+ $applicationSecret = $fieldset->addField('conf/native/notifications/applicationSecret', 'text', array(
+ 'label' => $this->__('Application Secret'),
+ 'name' => 'conf[native][notifications][applicationSecret]',
+ 'value' => (isset($data['conf[native][notifications][applicationSecret]']) ? $data['conf[native][notifications][applicationSecret]'] : ''),
+ 'required' => true
+ ));
+
+
+ $applicationMasterSecret = $fieldset->addField('conf/native/notifications/applicationMasterSecret', 'text', array(
+ 'label' => $this->__('Application Master Secret'),
+ 'name' => 'conf[native][notifications][applicationMasterSecret]',
+ 'value' => (isset($data['conf[native][notifications][applicationMasterSecret]']) ? $data['conf[native][notifications][applicationMasterSecret]'] : ''),
+ 'required' => true
+ ));
+
+ $mailboxTitle = $fieldset->addField('conf/native/notifications/mailboxTitle', 'text', array(
+ 'label' => $this->__('Mailbox title'),
+ 'name' => 'conf[native][notifications][mailboxTitle]',
+ 'value' => (isset($data['conf[native][notifications][mailboxTitle]']) ? $data['conf[native][notifications][mailboxTitle]'] : ''),
+ 'required' => true,
+ 'note' => $this->__('The Mailbox title will be shown in the More Info tab. To understand more about the title, please click here ')
+ ));
+
+ // field dependencies
+ $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')
+ ->addFieldMap($applicationKey->getHtmlId(), $applicationKey->getName())
+ ->addFieldMap($applicationSecret->getHtmlId(), $applicationSecret->getName())
+ ->addFieldMap($applicationMasterSecret->getHtmlId(), $applicationMasterSecret->getName())
+ ->addFieldMap($mailboxTitle->getHtmlId(), $mailboxTitle->getName())
+ ->addFieldMap($notificationEnabled->getHtmlId(), $notificationEnabled->getName())
+ ->addFieldDependence(
+ $applicationKey->getName(),
+ $notificationEnabled->getName(),
+ 1)
+ ->addFieldDependence(
+ $applicationSecret->getName(),
+ $notificationEnabled->getName(),
+ 1)
+ ->addFieldDependence(
+ $applicationMasterSecret->getName(),
+ $notificationEnabled->getName(),
+ 1)
+ ->addFieldDependence(
+ $mailboxTitle->getName(),
+ $notificationEnabled->getName(),
+ 1)
+ );
+
+ return parent::_prepareForm();
+ }
+
+ /**
+ * Tab label getter
+ *
+ * @return string
+ */
+ public function getTabLabel()
+ {
+ return $this->__('Push Notification');
+ }
+
+ /**
+ * Tab title getter
+ *
+ * @return string
+ */
+ public function getTabTitle()
+ {
+ return $this->__('Push Notification');
+ }
+
+ /**
+ * Check if tab can be shown
+ *
+ * @return bool
+ */
+ public function canShowTab()
+ {
+ return (bool) !Mage::getSingleton('adminhtml/session')->getNewApplication()
+ && $this->getApplication()->getType() == Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE;
+ }
+
+ /**
+ * Check if tab hidden
+ *
+ * @return bool
+ */
+ public function isHidden()
+ {
+ if (!$this->getData('conf/special/notifications_submitted')) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * Append helper above form
+ * @return string
+ */
+ protected function _toHtml()
+ {
+ return $this->getChildHtml('app_notification_helper') . parent::_toHtml();
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php
index 6068cfb4a0..0320858cec 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php
@@ -47,7 +47,6 @@ public function __construct()
*/
protected function _prepareForm()
{
-
$form = new Varien_Data_Form();
$this->setForm($form);
@@ -55,13 +54,13 @@ protected function _prepareForm()
$data = $this->getApplication()->getFormData();
$yesNoValues = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
- $fieldset = $form->addFieldset('onepage_checkout', array('legend' => Mage::helper('xmlconnect')->__('Standard Checkout')));
+ $fieldset = $form->addFieldset('onepage_checkout', array('legend' => $this->__('Standard Checkout')));
$fieldset->addField('conf/native/defaultCheckout/isActive', 'select', array(
- 'label' => Mage::helper('xmlconnect')->__('Enable Standard Checkout'),
+ 'label' => $this->__('Enable Standard Checkout'),
'name' => 'conf[native][defaultCheckout][isActive]',
'values' => $yesNoValues,
- 'note' => Mage::helper('xmlconnect')->__('Standard Checkout uses the checkout methods provided by Magento. Only inline payment methods are supported. (e.g PayPal Direct, Authorize.Net, etc.)'),
+ 'note' => $this->__('Standard Checkout uses the checkout methods provided by Magento. Only inline payment methods are supported. (e.g PayPal Direct, Authorize.Net, etc.)'),
'value' => (isset($data['conf[native][defaultCheckout][isActive]']) ? $data['conf[native][defaultCheckout][isActive]'] : '1')
));
@@ -69,20 +68,20 @@ protected function _prepareForm()
/**
* PayPal MEP management
*/
- $isExpressCheckoutAvaliable = Mage::getModel('xmlconnect/payment_method_paypal_mep')->isAvailable();
+ $isExpressCheckoutAvaliable = Mage::getModel('xmlconnect/payment_method_paypal_mep')->isAvailable(null);
$paypalActive = 0;
if (isset($data['conf[native][paypal][isActive]'])) {
$paypalActive = (int)($data['conf[native][paypal][isActive]'] && $isExpressCheckoutAvaliable);
}
- $fieldsetPaypal = $form->addFieldset('paypal_mep_checkout', array('legend' => Mage::helper('xmlconnect')->__('PayPal Mobile Embedded Payment (MEP)')));
+ $fieldsetPaypal = $form->addFieldset('paypal_mep_checkout', array('legend' => $this->__('PayPal Mobile Embedded Payment (MEP)')));
- $activateMepMethodNote = Mage::helper('xmlconnect')->__('To activate PayPal MEP payment method activate Express checkout first. ');
+ $activateMepMethodNote = $this->__('To activate PayPal MEP payment method activate Express checkout first. ');
$paypalConfigurationUrl = $this->escapeHtml($this->getUrl('adminhtml/system_config/edit', array('section' => 'paypal')));
- $businessAccountNote = Mage::helper('xmlconnect')->__('MEP is PayPal`s native checkout experience for the iPhone. You can choose to use MEP alongside standard checkout, or use it as your only checkout method for Magento mobile. PayPal MEP requires a PayPal business account ', $paypalConfigurationUrl);
+ $businessAccountNote = $this->__('MEP is PayPal`s native checkout experience for the iPhone. You can choose to use MEP alongside standard checkout, or use it as your only checkout method for Magento mobile. PayPal MEP requires a PayPal business account ', $paypalConfigurationUrl);
$paypalActiveField = $fieldsetPaypal->addField('conf/native/paypal/isActive', 'select', array(
- 'label' => Mage::helper('xmlconnect')->__('Activate PayPal Checkout'),
+ 'label' => $this->__('Activate PayPal Checkout'),
'name' => 'conf[native][paypal][isActive]',
'note' => (!$isExpressCheckoutAvaliable ? $activateMepMethodNote : $businessAccountNote),
'values' => $yesNoValues,
@@ -92,8 +91,8 @@ protected function _prepareForm()
$merchantlabelField = $fieldsetPaypal->addField('conf/special/merchantLabel', 'text', array(
'name' => 'conf[special][merchantLabel]',
- 'label' => Mage::helper('xmlconnect')->__('Merchant Label'),
- 'title' => Mage::helper('xmlconnect')->__('Merchant Label'),
+ 'label' => $this->__('Merchant Label'),
+ 'title' => $this->__('Merchant Label'),
'required' => true,
'value' => (isset($data['conf[special][merchantLabel]']) ? $data['conf[special][merchantLabel]'] : '')
));
@@ -118,7 +117,7 @@ protected function _prepareForm()
*/
public function getTabLabel()
{
- return Mage::helper('xmlconnect')->__('Payment Methods');
+ return $this->__('Payment Methods');
}
/**
@@ -128,7 +127,7 @@ public function getTabLabel()
*/
public function getTabTitle()
{
- return Mage::helper('xmlconnect')->__('Payment Methods');
+ return $this->__('Payment Methods');
}
/**
@@ -138,7 +137,7 @@ public function getTabTitle()
*/
public function canShowTab()
{
- return true;
+ return (bool) !Mage::getSingleton('adminhtml/session')->getNewApplication();
}
/**
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Settings.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Settings.php
new file mode 100755
index 0000000000..9d299b2eab
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Settings.php
@@ -0,0 +1,110 @@
+setChild('continue_button',
+ $this->getLayout()->createBlock('adminhtml/widget_button')
+ ->setData(array(
+ 'label' => Mage::helper('catalog')->__('Continue'),
+ 'onclick' => "if (editForm.submit()) { return false }",
+ 'class' => 'save'
+ ))
+ );
+ return parent::_prepareLayout();
+ }
+
+ /**
+ * Prepare form before rendering HTML
+ * Setting Form Fieldsets and fields
+ *
+ * @return Mage_Adminhtml_Block_Widget_Form
+ */
+ protected function _prepareForm()
+ {
+
+ $form = new Varien_Data_Form();
+ $form->setHtmlIdPrefix('app_');
+ $fieldset = $form->addFieldset('base_fieldset', array('legend' => $this->__('Device Information')));
+
+ $fieldset->addField('type', 'select', array(
+ 'name' => 'type',
+ 'label' => $this->__('Device Type'),
+ 'title' => $this->__('Device Type'),
+ 'values' => Mage::helper('xmlconnect')->getDeviceTypeOptions(),
+ 'required' => true
+ ));
+
+ $fieldset->addField('continue_button', 'note', array(
+ 'text' => $this->getChildHtml('continue_button'),
+ ));
+
+ $this->setForm($form);
+ return parent::_prepareForm();
+ }
+
+ /**
+ * Tab label getter
+ *
+ * @return string
+ */
+ public function getTabLabel()
+ {
+ return $this->__('Settings');
+ }
+
+ /**
+ * Tab title getter
+ *
+ * @return string
+ */
+ public function getTabTitle()
+ {
+ return $this->__('Settings');
+ }
+
+ /**
+ * Check if tab can be shown
+ *
+ * @return bool
+ */
+ public function canShowTab()
+ {
+ return (bool) Mage::getSingleton('adminhtml/session')->getNewApplication();
+ }
+
+ /**
+ * Check if tab hidden
+ *
+ * @return bool
+ */
+ public function isHidden()
+ {
+ return false;
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php
index 1980e1a9da..0bfe1f7f3d 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php
@@ -34,7 +34,6 @@
class Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Submission_History extends Mage_Adminhtml_Block_Widget_Grid
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
-
/**
* Set order by column and order direction
* Set grid ID
@@ -59,7 +58,7 @@ public function __construct()
*/
public function getTabLabel()
{
- return Mage::helper('xmlconnect')->__('Submission History');
+ return $this->__('Submission History');
}
/**
@@ -69,7 +68,7 @@ public function getTabLabel()
*/
public function getTabTitle()
{
- return Mage::helper('xmlconnect')->__('Submission History');
+ return $this->__('Submission History');
}
/**
@@ -79,7 +78,7 @@ public function getTabTitle()
*/
public function canShowTab()
{
- return true;
+ return (bool) !Mage::getSingleton('adminhtml/session')->getNewApplication();
}
/**
@@ -114,14 +113,14 @@ protected function _prepareCollection()
protected function _prepareColumns()
{
$this->addColumn('activation_key', array(
- 'header' => Mage::helper('xmlconnect')->__('Activation Key'),
+ 'header' => $this->__('Activation Key'),
'align' => 'left',
'index' => 'activation_key',
'type' => 'text'
));
$this->addColumn('created_at', array(
- 'header' => Mage::helper('xmlconnect')->__('Date Submitted'),
+ 'header' => $this->__('Date Submitted'),
'align' => 'left',
'index' => 'created_at',
'type' => 'datetime'
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php
index 1acec8fcc1..450df57027 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php
@@ -36,6 +36,25 @@ public function __construct()
parent::__construct();
$this->setId('mobile_app_tabs');
$this->setDestElementId('edit_form');
- $this->setTitle(Mage::helper('xmlconnect')->__('Manage Mobile App'));
+ $this->setTitle($this->__('Manage Mobile App'));
+ }
+
+ /**
+ * Preparing global layout
+ *
+ * @return Mage_Core_Block_Abstract
+ */
+ protected function _prepareLayout()
+ {
+ $model = Mage::registry('current_app');
+
+ if (Mage::getSingleton('adminhtml/session')->getNewApplication()) {
+ $this->addTab('set', array(
+ 'label' => $this->__('Settings'),
+ 'content' => $this->getLayout()->createBlock('xmlconnect/adminhtml_mobile_edit_tab_settings')->toHtml(),
+ 'active' => true
+ ));
+ }
+ return parent::_prepareLayout();
}
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Datetime.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Datetime.php
new file mode 100755
index 0000000000..2664be796f
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Datetime.php
@@ -0,0 +1,194 @@
+
+ */
+class Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Datetime extends Varien_Data_Form_Element_Abstract
+{
+ /**
+ * @var Zend_Date
+ */
+ protected $_value;
+
+ public function __construct($attributes=array())
+ {
+ parent::__construct($attributes);
+ $this->setType('text');
+ $this->setExtType('textfield');
+ if (isset($attributes['value'])) {
+ $this->setValue($attributes['value']);
+ }
+ }
+
+ /**
+ * If script executes on x64 system, converts large
+ * numeric values to timestamp limit
+ *
+ * @param int $value
+ * @return int
+ */
+ protected function _toTimestamp($value)
+ {
+ $value = (int)$value;
+ if ($value > 3155760000) {
+ $value = 0;
+ }
+ return $value;
+ }
+
+ /**
+ * Set date value
+ * If Zend_Date instance is provided instead of value, other params will be ignored.
+ * Format and locale must be compatible with Zend_Date
+ *
+ * @param mixed $value
+ * @param string $format
+ * @param string $locale
+ * @return Varien_Data_Form_Element_Date
+ */
+ public function setValue($value, $format = null, $locale = null)
+ {
+ if (empty($value)) {
+ $this->_value = '';
+ return $this;
+ }
+ if ($value instanceof Zend_Date) {
+ $this->_value = $value;
+ return $this;
+ }
+ if (preg_match('/^[0-9]+$/', $value)) {
+ $this->_value = new Zend_Date($this->_toTimestamp($value));
+ //$this->_value = new Zend_Date((int)value);
+ return $this;
+ }
+ // last check, if input format was set
+ if (null === $format) {
+ $format = Varien_Date::DATETIME_INTERNAL_FORMAT;
+ if ($this->getInputFormat()) {
+ $format = $this->getInputFormat();
+ }
+ }
+ // last check, if locale was set
+ if (null === $locale) {
+ if (!$locale = $this->getLocale()) {
+ $locale = null;
+ }
+ }
+ try {
+ $this->_value = new Zend_Date($value, $format, $locale);
+ } catch (Exception $e) {
+ $this->_value = '';
+ }
+ return $this;
+ }
+
+ /**
+ * Get date value as string.
+ * Format can be specified, or it will be taken from $this->getFormat()
+ *
+ * @param string $format (compatible with Zend_Date)
+ * @return string
+ */
+ public function getValue($format = null)
+ {
+ if (empty($this->_value)) {
+ return '';
+ }
+ if (null === $format) {
+ $format = $this->getFormat() . " " . $this->getFormatT();
+ }
+ return $this->_value->toString($format);
+ }
+
+ /**
+ * Get value instance, if any
+ *
+ * @return Zend_Date
+ */
+ public function getValueInstance()
+ {
+ if (empty($this->_value)) {
+ return null;
+ }
+ return $this->_value;
+ }
+
+ /**
+ * Output the input field and assign calendar instance to it.
+ * In order to output the date:
+ * - the value must be instantiated (Zend_Date)
+ * - output format must be set (compatible with Zend_Date)
+ *
+ * @return string
+ */
+ public function getElementHtml()
+ {
+ $this->addClass('input-text');
+
+ $html = sprintf(
+ ' '
+ .' ',
+ $this->getName(), $this->getHtmlId(), $this->_escape($this->getValue()), $this->serialize($this->getHtmlAttributes()),
+ $this->getImage(), $this->getHtmlId(), 'Select Date', ($this->getDisabled() ? 'display:none;' : '')
+ );
+ $outputFormat = $this->getFormat();
+ $outputTimeFormat = $this->getFormatT();
+ if (empty($outputFormat)) {
+ throw new Exception('Output format is not specified. Please, specify "format" key in constructor, or set it using setFormat().');
+ }
+ $displayFormat = Varien_Date::convertZendToStrFtime($outputFormat, true, false);
+ $displayTimeFormat = Varien_Date::convertZendToStrFtime($outputTimeFormat, false, true);
+
+
+
+ $html .= sprintf('
+ ',
+ $this->getHtmlId(), $displayFormat . " " . $displayTimeFormat,
+ $this->getTime() ? 'true' : 'false', $this->getHtmlId()
+ );
+
+ $html .= $this->getAfterElementHtml();
+
+ return $html;
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php
index d333b4ce22..1150df3d25 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php
@@ -72,7 +72,7 @@ public function addElement(Varien_Data_Form_Element_Abstract $element, $after=fa
* Getter for Label field
* fetching first element as label
*
- * @param string $idSuffix
+ * @param string $idSuffix
* @return string
*/
public function getLabelHtml($idSuffix = '')
@@ -82,8 +82,7 @@ public function getLabelHtml($idSuffix = '')
}
/**
- * Enter description here...
- * gettter for second part of rendered field ("selectbox" and "delete button")
+ * Gettter for second part of rendered field ("selectbox" and "delete button")
* fetching second element as
*
* @return string
@@ -91,8 +90,8 @@ public function getLabelHtml($idSuffix = '')
public function getElementHtml()
{
list($label, $element) = $this->getElements();
- return $element->toHtml() . ' ' .
- ''
+ return $element->toHtml() . ' '
+ . ''
. Mage::helper('xmlconnect')->__('Delete') . ' ';
}
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php
index edeaae8d18..8266b6ea76 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php
@@ -33,9 +33,20 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Tabs extends Varien_Da
*/
public function getHtml()
{
+ if ((bool)Mage::getSingleton('adminhtml/session')->getNewApplication()) {
+ return '';
+ }
+
$blockClassName = Mage::getConfig()->getBlockClassName('adminhtml/template');
$block = new $blockClassName;
- $block->setTemplate('xmlconnect/form/element/app_tabs.phtml');
+ $device = Mage::helper('xmlconnect')->getApplication()->getType();
+ if (array_key_exists($device, Mage::helper('xmlconnect')->getSupportedDevices())) {
+ $template = 'xmlconnect/form/element/app_tabs_' . strtolower($device) . '.phtml';
+ } else {
+ Mage::throwException($this->__('Device doesn\'t recognized. Unable to load a template.'));
+ }
+
+ $block->setTemplate($template);
$tabs = Mage::getModel('xmlconnect/tabs', $this->getValue());
$block->setTabs($tabs);
$block->setName($this->getName());
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php
index 2b6a26c24a..ec1bde70a5 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php
@@ -56,13 +56,13 @@ protected function _prepareCollection()
protected function _prepareColumns()
{
$this->addColumn('name', array(
- 'header' => Mage::helper('xmlconnect')->__('App Name'),
+ 'header' => $this->__('App Name'),
'align' => 'left',
'index' => 'name',
));
$this->addColumn('code', array(
- 'header' => Mage::helper('xmlconnect')->__('Code'),
+ 'header' => $this->__('App Code'),
'align' => 'left',
'index' => 'code',
'width' => '200',
@@ -70,7 +70,7 @@ protected function _prepareColumns()
if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn('store_id', array(
- 'header' => Mage::helper('xmlconnect')->__('Store View'),
+ 'header' => $this->__('Store View'),
'index' => 'store_id',
'type' => 'store',
'store_view' => true,
@@ -80,7 +80,7 @@ protected function _prepareColumns()
}
$this->addColumn('type', array(
- 'header' => Mage::helper('xmlconnect')->__('Device'),
+ 'header' => $this->__('Device'),
'type' => 'text',
'index' => 'type',
'align' => 'center',
@@ -90,7 +90,7 @@ protected function _prepareColumns()
));
$this->addColumn('status', array(
- 'header' => Mage::helper('xmlconnect')->__('Status'),
+ 'header' => $this->__('Status'),
'index' => 'status',
'renderer' => 'xmlconnect/adminhtml_mobile_grid_renderer_bool',
'align' => 'center',
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php
index 4966b47f5e..c23f219466 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php
@@ -25,6 +25,31 @@
*/
class Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Content extends Mage_Adminhtml_Block_Template
{
+ /**
+ * Category item tint color styles
+ *
+ * @var string
+ */
+ protected $categoryItemTintColor = '';
+
+ /**
+ * Set path to template used for generating block's output.
+ *
+ * @param string $templateType
+ * @return Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Content
+ */
+ public function setTemplate($templateType)
+ {
+ $deviceType = Mage::helper('xmlconnect')->getApplication()->getType();
+
+ if ($deviceType == Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE) {
+ parent::setTemplate('xmlconnect/edit/tab/design/preview/' . $templateType . '.phtml');
+ } else {
+ parent::setTemplate('xmlconnect/edit/tab/design/preview/' . $templateType . '_' . $deviceType . '.phtml');
+ }
+ return $this;
+ }
+
/**
* Prepare config data
* Implement set "conf" data as magic method
@@ -39,9 +64,10 @@ public function setConf($conf)
$tabs = isset($conf['tabBar']) && isset($conf['tabBar']['tabs']) ? $conf['tabBar']['tabs'] : false;
if ($tabs !== false) {
foreach ($tabs->getEnabledTabs() as $tab) {
- $conf['tabBar'][$tab->action]['label'] = $tab->label;
- $conf['tabBar'][$tab->action]['image'] =
- Mage::helper('xmlconnect/image')->getSkinImagesUrl('mobile_preview/' . $tab->image);
+ $tab = (array) $tab;
+ $conf['tabBar'][$tab['action']]['label'] = $tab['label'];
+ $conf['tabBar'][$tab['action']]['image'] =
+ Mage::helper('xmlconnect/image')->getSkinImagesUrl('mobile_preview/' . $tab['image']);
}
}
$this->setData('conf', $conf);
@@ -70,6 +96,137 @@ public function getDesignPreviewImageUrl($name)
return Mage::helper('xmlconnect/image')->getSkinImagesUrl('design_default/' . $name);
}
+ /**
+ * Get application banner image url
+ *
+ * @throws Mage_Core_Exception
+ * @return string
+ */
+ public function getBannerImage()
+ {
+ $deviceType = Mage::helper('xmlconnect')->getApplication()->getType();
+ switch ($deviceType) {
+ case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE:
+
+ if ($this->getData('conf/body/bannerImage')) {
+ $bannerImage = $this->getData('conf/body/bannerImage');
+ } else {
+ $bannerImage = $this->getDesignPreviewImageUrl(
+ $this->getInterfaceImagesPaths('conf/body/bannerImage')
+ );
+ }
+ break;
+
+ case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPAD:
+
+ $configPath = 'conf/body/bannerImageIpad';
+ if ($this->getData($configPath)) {
+ $width = Mage_XmlConnect_Helper_Ipad::PREVIEW_BANNER_WIDTH;
+ $height = Mage_XmlConnect_Helper_Ipad::PREVIEW_BANNER_HEIGHT;
+ $bannerImage = Mage::helper('xmlconnect/image')
+ ->getCustomSizeImageUrl($this->_replaceConfig($configPath), $width, $height);
+ } else {
+ $bannerImage = $this->getPreviewImagesUrl('ipad/banner_image.png');
+ }
+ break;
+
+ case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID:
+
+ $configPath = 'conf/body/bannerImageAndroid';
+ if ($this->getData($configPath)) {
+ $bannerImage = Mage::getBaseUrl('media') . 'xmlconnect/'
+ . $this->getData($configPath);
+ } else {
+ $bannerImage = $this->getDesignPreviewImageUrl(
+ $this->getInterfaceImagesPaths($configPath)
+ );
+ }
+ break;
+
+ default:
+ Mage::throwException($this->__('Device doesn\'t recognized: "%s". Unable to load a helper.', $deviceType));
+ break;
+ }
+ return $bannerImage;
+ }
+
+ /**
+ * Get Ipad background image url
+ *
+ * @param string $param type of orientation
+ * @throws Mage_Core_Exception
+ * @return string
+ */
+ public function getIpadBackgroundImage($param)
+ {
+ $backgroundImage = '';
+ switch ($param) {
+ case Mage_XmlConnect_Helper_Ipad::ORIENTATION_LANDSCAPE:
+ $configPath = 'conf/native/body/backgroundImageIpadLandscape';
+ if ($this->getData($configPath)) {
+ $width = Mage_XmlConnect_Helper_Ipad::PREVIEW_LANDSCAPE_BACKGROUND_WIDTH;
+ $height = Mage_XmlConnect_Helper_Ipad::PREVIEW_LANDSCAPE_BACKGROUND_HEIGHT;
+ $backgroundImage = Mage::helper('xmlconnect/image')
+ ->getCustomSizeImageUrl($this->_replaceConfig($configPath), $width, $height);
+ } else {
+ $backgroundImage =
+ $this->getPreviewImagesUrl('ipad/background_home_landscape.jpg');
+ }
+ break;
+ case Mage_XmlConnect_Helper_Ipad::ORIENTATION_PORTRAIT:
+ $configPath = 'conf/native/body/backgroundImageIpadPortret';
+ $width = Mage_XmlConnect_Helper_Ipad::PREVIEW_PORTRAIT_BACKGROUND_WIDTH;
+ $height = Mage_XmlConnect_Helper_Ipad::PREVIEW_PORTRAIT_BACKGROUND_HEIGHT;
+ if ($this->getData($configPath)) {
+ $backgroundImage = Mage::helper('xmlconnect/image')
+ ->getCustomSizeImageUrl($this->_replaceConfig($configPath), $width, $height);
+ } else {
+ $backgroundImage = $this->getPreviewImagesUrl('ipad/background_portrait.jpg');
+ }
+ break;
+ default:
+ Mage::throwException($this->__('Wrong Ipad background image orientation has been specified: "%s".', $param));
+ }
+ return $backgroundImage;
+ }
+
+ /**
+ * Get font info from config
+ *
+ * @param string $path
+ * @return string
+ */
+ public function getConfigFontInfo($path)
+ {
+ return $this->getData('conf/fonts/' . $path);
+ }
+
+ /**
+ * Get icon logo url
+ *
+ * @return string
+ */
+ public function getLogoUrl()
+ {
+ $configPath = 'conf/navigationBar/icon';
+ if ($this->getData($configPath)) {
+ return $this->getData($configPath);
+ } else {
+ return $this->getDesignPreviewImageUrl($this->getInterfaceImagesPaths($configPath));
+ }
+ }
+
+ /**
+ * Converts Data path(conf/submision/zzzz) to config path (conf/native/submission/zzzzz)
+ *
+ * @param string $configPath
+ * @return string
+ */
+ protected function _replaceConfig($configPath)
+ {
+ return $configPath = preg_replace('/^conf\/(.*)$/', 'conf/native/${1}', $configPath);
+ }
+
/**
* Expose function getInterfaceImagesPaths from xmlconnect/images
* Converts Data path(conf/submision/zzzz) to config path (conf/native/submission/zzzzz)
@@ -79,7 +236,7 @@ public function getDesignPreviewImageUrl($name)
*/
public function getInterfaceImagesPaths($path)
{
- $path = preg_replace('/^conf\/(.*)$/', 'conf/native/${1}', $path);
+ $path = $this->_replaceConfig($path);
return Mage::helper('xmlconnect/image')->getInterfaceImagesPaths($path);
}
@@ -93,4 +250,54 @@ public function getPreviewCssUrl($name = '')
{
return Mage::getDesign()->getSkinUrl('xmlconnect/' . $name);
}
+
+ /**
+ * Get category item tint color styles
+ *
+ * @return string
+ */
+ public function getCategoryItemTintColor()
+ {
+ if (!strlen($this->categoryItemTintColor)) {
+ $percent = .4;
+ $mask = 255;
+
+ $hex = str_replace('#','',$this->getData('conf/categoryItem/tintColor'));
+ $hex2 = '';
+ $_rgb = array();
+
+ $d = '[a-fA-F0-9]';
+
+ if (preg_match("/^($d$d)($d$d)($d$d)\$/", $hex, $rgb)) {
+ $_rgb = array(hexdec($rgb[1]), hexdec($rgb[2]), hexdec($rgb[3]));
+ }
+ if (preg_match("/^($d)($d)($d)$/", $hex, $rgb)) {
+ $_rgb = array(hexdec($rgb[1] . $rgb[1]), hexdec($rgb[2] . $rgb[2]), hexdec($rgb[3] . $rgb[3]));
+ }
+
+ for ($i=0; $i<3; $i++) {
+ $_rgb[$i] = round($_rgb[$i] * $percent) + round($mask * (1-$percent));
+ if ($_rgb[$i] > 255) {
+ $_rgb[$i] = 255;
+ }
+ }
+
+ for($i=0; $i < 3; $i++) {
+ $hex_digit = dechex($_rgb[$i]);
+ if(strlen($hex_digit) == 1) {
+ $hex_digit = "0" . $hex_digit;
+ }
+ $hex2 .= $hex_digit;
+ }
+ if($hex && $hex2){
+ // for IE
+ $this->categoryItemTintColor .= "filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#".$hex2."', endColorstr='#".$hex."');";
+ // for webkit browsers
+ $this->categoryItemTintColor .= "background:-webkit-gradient(linear, left top, left bottom, from(#".$hex2."), to(#".$hex."));";
+ // for firefox
+ $this->categoryItemTintColor .= "background:-moz-linear-gradient(top, #".$hex2.", #".$hex.");";
+ }
+ }
+ return $this->categoryItemTintColor;
+ }
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php
index 489e96487c..48abca7efd 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php
@@ -25,13 +25,27 @@
*/
class Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Tabitems extends Mage_Adminhtml_Block_Template
{
+ /**
+ * Current active tab according preview action
+ *
+ * @var bool|string
+ */
+ private $activeTab = false;
+
/**
* Set preview tab items template
*/
public function __construct()
{
parent::__construct();
- $this->setTemplate('xmlconnect/edit/tab/design/preview/tab_items.phtml');
+
+ $deviceType = Mage::helper('xmlconnect')->getApplication()->getType();
+
+ if ($deviceType == Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE) {
+ $this->setTemplate('xmlconnect/edit/tab/design/preview/tab_items.phtml');
+ } else {
+ $this->setTemplate('xmlconnect/edit/tab/design/preview/tab_items_' . $deviceType . '.phtml');
+ }
}
/**
@@ -44,7 +58,6 @@ public function getTabItems()
$items = array();
$model = Mage::registry('current_app');
$tabs = $model->getEnabledTabsArray();
-
$tabLimit = (int) Mage::getStoreConfig('xmlconnect/devices/'.strtolower($model->getType()).'/tab_limit');
$showedTabs = 0;
foreach ($tabs as $tab) {
@@ -53,8 +66,23 @@ public function getTabItems()
}
$items[] = array(
'label' => Mage::helper('xmlconnect')->getTabLabel($tab->action),
- 'image' => $tab->image);
+ 'image' => $tab->image,
+ 'action' => $tab->action,
+ 'active' => strtolower($tab->action) == strtolower($this->activeTab),
+ );
}
return $items;
}
+
+ /**
+ * Set active tab
+ *
+ * @param string $tab
+ * @return Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Tabitems
+ */
+ public function setActiveTab($tab)
+ {
+ $this->activeTab = $tab;
+ return $this;
+ }
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php
index 4d5f37a4d4..ac50416bcb 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php
@@ -23,7 +23,6 @@
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
class Mage_XmlConnect_Block_Adminhtml_Mobile_Submission extends Mage_Adminhtml_Block_Widget_Form_Container
{
/**
@@ -33,7 +32,6 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Submission extends Mage_Adminhtml_B
*/
public function __construct()
{
-
$this->_objectId = 'application_id';
$this->_controller = 'adminhtml_mobile';
$this->_blockGroup = 'xmlconnect';
@@ -46,9 +44,9 @@ public function __construct()
$app = Mage::registry('current_app');
if ($app && $app->getIsResubmitAction()) {
- $label = Mage::helper('xmlconnect')->__('Resubmit App');
+ $label = $this->__('Resubmit App');
} else {
- $label = Mage::helper('xmlconnect')->__('Submit App');
+ $label = $this->__('Submit App');
}
$this->_addButton('submission_post', array(
@@ -57,10 +55,9 @@ public function __construct()
'onclick' => "submitApplication()",
));
- $this->_updateButton('back', 'label', Mage::helper('xmlconnect')->__('Back to App Edit'));
+ $this->_updateButton('back', 'label', $this->__('Back to App Edit'));
$this->_updateButton('back', 'onclick', 'setLocation(\''. $this->getUrl('*/*/edit',
array('application_id' => Mage::registry('current_app')->getId())) . '\')');
-
}
/**
@@ -72,7 +69,7 @@ public function getHeaderText()
{
$app = Mage::registry('current_app');
if ($app && $app->getId()) {
- return Mage::helper('xmlconnect')->__('Submit App "%s"', $this->htmlEscape($app->getName()));
+ return $this->__('Submit App "%s"', $this->htmlEscape($app->getName()));
}
return '';
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php
index a53484c75d..d25dc57337 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php
@@ -44,7 +44,7 @@ public function __construct()
*/
public function getTabLabel()
{
- return Mage::helper('xmlconnect')->__('Submission');
+ return $this->__('Submission');
}
/**
@@ -54,7 +54,7 @@ public function getTabLabel()
*/
public function getTabTitle()
{
- return Mage::helper('xmlconnect')->__('Submission');
+ return $this->__('Submission');
}
/**
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php
index 45e7e4aac0..661e252fd5 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php
@@ -88,11 +88,11 @@ protected function _prepareForm()
$formData = $this->getApplication()->getFormData();
$url = Mage::getStoreConfig('xmlconnect/mobile_application/activation_key_url');
- $afterElementHtml = Mage::helper('xmlconnect')->__('In order to submit your app, you need to first purchase a %s from MagentoCommerce', $url, Mage::helper('xmlconnect')->__('Activation Key'));
- $fieldset = $form->addFieldset('submit_keys', array('legend' => Mage::helper('xmlconnect')->__('Key')));
+ $afterElementHtml = $this->__('In order to submit your app, you need to first purchase a %s from MagentoCommerce', $url, $this->__('Activation Key'));
+ $fieldset = $form->addFieldset('submit_keys', array('legend' => $this->__('Key')));
$field = $fieldset->addField('conf[submit_text][key]', 'text', array(
'name' => 'conf[submit_text][key]',
- 'label' => Mage::helper('xmlconnect')->__('Activation Key'),
+ 'label' => $this->__('Activation Key'),
'value' => isset($formData['conf[submit_text][key]']) ? $formData['conf[submit_text][key]'] : null,
'after_element_html' => $afterElementHtml,
));
@@ -108,59 +108,60 @@ protected function _prepareForm()
if ($isResubmit) {
$url = Mage::getStoreConfig('xmlconnect/mobile_application/resubmission_key_url');
- $afterElementHtml = Mage::helper('xmlconnect')->__('In order to resubmit your app, you need to first purchase a %s from MagentoCommerce', $url, Mage::helper('xmlconnect')->__('Resubmission Key'));
+ $afterElementHtml = $this->__('In order to resubmit your app, you need to first purchase a %s from MagentoCommerce', $url, $this->__('Resubmission Key'));
$fieldset->addField('conf[submit_text][resubmission_activation_key]', 'text', array(
'name' => 'conf[submit_text][resubmission_activation_key]',
- 'label' => Mage::helper('xmlconnect')->__('Resubmission Key'),
+ 'label' => $this->__('Resubmission Key'),
'value' => isset($formData['conf[submit_text][resubmission_activation_key]']) ? $formData['conf[submit_text][resubmission_activation_key]'] : null,
'required' => true,
'after_element_html' => $afterElementHtml,
));
}
- $fieldset = $form->addFieldset('submit_general', array('legend' => Mage::helper('xmlconnect')->__('Submission Fields')));
+ $fieldset = $form->addFieldset('submit_general', array('legend' => $this->__('Submission Fields')));
$fieldset->addField('submission_action', 'hidden', array(
'name' => 'submission_action',
'value' => '1',
));
+
$fieldset->addField('conf/submit_text/title', 'text', array(
'name' => 'conf[submit_text][title]',
- 'label' => Mage::helper('xmlconnect')->__('Title'),
- 'maxlength' => '200',
+ 'label' => $this->__('Title'),
+ 'maxlength' => $formData['type'] == Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE ? '12' : '200',
'value' => isset($formData['conf[submit_text][title]']) ? $formData['conf[submit_text][title]'] : null,
- 'note' => Mage::helper('xmlconnect')->__('Name that appears beneath your app when users install it to their device. We recommend choosing a name that is 10-12 characters and that your customers will recognize.'),
+ 'note' => $this->__('Name that appears beneath your app when users install it to their device. We recommend choosing a name that is 10-12 characters and that your customers will recognize.'),
'required' => true,
));
$field = $fieldset->addField('conf/submit_text/description', 'textarea', array(
'name' => 'conf[submit_text][description]',
- 'label' => Mage::helper('xmlconnect')->__('Description'),
+ 'label' => $this->__('Description'),
'maxlength' => '500',
'value' => isset($formData['conf[submit_text][description]']) ? $formData['conf[submit_text][description]'] : null,
- 'note' => Mage::helper('xmlconnect')->__('Description that appears in the iTunes App Store. 4000 chars maximum. '),
+ 'note' => $this->__('Description that appears in the iTunes App Store. 4000 chars maximum. '),
'required' => true,
));
$field->setRows(15);
$fieldset->addField('conf/submit_text/contact_email', 'text', array(
'name' => 'conf[submit_text][email]',
- 'label' => Mage::helper('xmlconnect')->__('Contact Email'),
+ 'label' => $this->__('Contact Email'),
'class' => 'email',
'maxlength' => '40',
'value' => isset($formData['conf[submit_text][email]']) ? $formData['conf[submit_text][email]'] : null,
- 'note' => Mage::helper('xmlconnect')->__('Administrative contact for this app and for app submission issues.'),
+ 'note' => $this->__('Administrative contact for this app and for app submission issues.'),
'required' => true,
));
$fieldset->addField('conf/submit_text/price_free_label', 'label', array(
'name' => 'conf[submit_text][price_free_label]',
- 'label' => Mage::helper('xmlconnect')->__('Price'),
- 'value' => Mage::helper('xmlconnect')->__('Free'),
+ 'label' => $this->__('Price'),
+ 'value' => $this->__('Free'),
'maxlength' => '40',
'checked' => 'checked',
- 'note' => Mage::helper('xmlconnect')->__('Only free apps are allowed in this version.'),
+ 'note' => $this->__('Only free apps are allowed in this version.'),
));
$fieldset->addField('conf/submit_text/price_free', 'hidden', array(
@@ -171,40 +172,40 @@ protected function _prepareForm()
$selected = isset($formData['conf[submit_text][country]']) ? explode(',', $formData['conf[submit_text][country]']) : null;
$fieldset->addField('conf/submit_text/country', 'multiselect', array(
'name' => 'conf[submit_text][country][]',
- 'label' => Mage::helper('xmlconnect')->__('Country'),
+ 'label' => $this->__('Country'),
'values' => Mage::helper('xmlconnect')->getCountryOptionsArray(),
'value' => $selected,
- 'note' => Mage::helper('xmlconnect')->__('Make this app available in the following territories'),
+ 'note' => $this->__('Make this app available in the following territories'),
'required' => true,
));
$fieldset->addField('conf/submit_text/copyright', 'text', array(
'name' => 'conf[submit_text][copyright]',
- 'label' => Mage::helper('xmlconnect')->__('Copyright'),
+ 'label' => $this->__('Copyright'),
'maxlength' => '200',
'value' => isset($formData['conf[submit_text][copyright]']) ? $formData['conf[submit_text][copyright]'] : null,
- 'note' => Mage::helper('xmlconnect')->__('Appears in the info section of your app (example: Copyright 2010 – Your Company, Inc.)'),
+ 'note' => $this->__('Appears in the info section of your app (example: Copyright 2010 – Your Company, Inc.)'),
'required' => true,
));
$fieldset->addField('conf/submit_text/keywords', 'text', array(
'name' => 'conf[submit_text][keywords]',
- 'label' => Mage::helper('xmlconnect')->__('Keywords'),
+ 'label' => $this->__('Keywords'),
'maxlength' => '100',
'value' => isset($formData['conf[submit_text][keywords]']) ? $formData['conf[submit_text][keywords]'] : null,
- 'note' => Mage::helper('xmlconnect')->__('One or more keywords that describe your app. Keywords are matched to users` searches in the App Store and help return accurate search results. Separate multiple keywords with commas. 100 chars is maximum.'),
+ 'note' => $this->__('One or more keywords that describe your app. Keywords are matched to users` searches in the App Store and help return accurate search results. Separate multiple keywords with commas. 100 chars is maximum.'),
));
- $fieldset = $form->addFieldset('submit_icons', array('legend' => Mage::helper('xmlconnect')->__('Icons')));
- $this->addImage($fieldset, 'conf/submit/icon', Mage::helper('xmlconnect')->__('Large iTunes Icon'),
- Mage::helper('xmlconnect')->__('Large icon that appears in the iTunes App Store. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Required size: 512px x 512px.'), '', true);
- $this->addImage($fieldset, 'conf/submit/loader_image', Mage::helper('xmlconnect')->__('Loader Splash Screen'),
- Mage::helper('xmlconnect')->__('Image that appears on first screen while your app is loading. Required size: 320px x 460px.'), '', true);
+ $fieldset = $form->addFieldset('submit_icons', array('legend' => $this->__('Icons')));
+ $this->addImage($fieldset, 'conf/submit/icon', $this->__('Large iTunes Icon'),
+ $this->__('Large icon that appears in the iTunes App Store. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Required size: 512px x 512px.'), '', true);
+ $this->addImage($fieldset, 'conf/submit/loader_image', $this->__('Loader Splash Screen'),
+ $this->__('Image that appears on first screen while your app is loading. Required size: 320px x 460px.'), '', true);
- $this->addImage($fieldset, 'conf/submit/logo', Mage::helper('xmlconnect')->__('Custom App Icon'),
- Mage::helper('xmlconnect')->__('Icon that will appear on the user’s phone after they download your app. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Recommended size: 57px x 57px at 72 dpi.'), '', true);
- $this->addImage($fieldset, 'conf/submit/big_logo', Mage::helper('xmlconnect')->__('Copyright Page Logo'),
- Mage::helper('xmlconnect')->__('Store logo that is displayed on copyright page of app. Preferred size: 100px x 100px.'), '', true);
+ $this->addImage($fieldset, 'conf/submit/logo', $this->__('Custom App Icon'),
+ $this->__('Icon that will appear on the user’s phone after they download your app. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Recommended size: 57px x 57px at 72 dpi.'), '', true);
+ $this->addImage($fieldset, 'conf/submit/big_logo', $this->__('Copyright Page Logo'),
+ $this->__('Store logo that is displayed on copyright page of app. Preferred size: 100px x 100px.'), '', true);
return parent::_prepareForm();
}
@@ -216,7 +217,7 @@ protected function _prepareForm()
*/
public function getTabLabel()
{
- return Mage::helper('xmlconnect')->__('Submission');
+ return $this->__('Submission');
}
/**
@@ -226,7 +227,7 @@ public function getTabLabel()
*/
public function getTabTitle()
{
- return Mage::helper('xmlconnect')->__('Submission');
+ return $this->__('Submission');
}
/**
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php
index d3961b8545..1a1b03ac2b 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php
@@ -35,6 +35,6 @@ public function __construct()
$this->setId('mobile_app_tabs');
$this->setDestElementId('edit_form');
- $this->setTitle(Mage::helper('xmlconnect')->__('Manage Mobile App'));
+ $this->setTitle($this->__('Manage Mobile App'));
}
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php
index a6103b351a..a1782da08b 100644
--- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php
@@ -74,10 +74,11 @@ public function addFont($fieldset, $fieldPrefix, $title)
'name' => $fieldPrefix,
'label' => $title,
));
+
$el->initFields(array(
'name' => $fieldPrefix,
- 'fontNames' => Mage::helper('xmlconnect/iphone')->getFontList(),
- 'fontSizes' => Mage::helper('xmlconnect/iphone')->getFontSizes(),
+ 'fontNames' => Mage::helper('xmlconnect')->getDeviceHelper()->getFontList(),
+ 'fontSizes' => Mage::helper('xmlconnect')->getDeviceHelper()->getFontSizes(),
));
}
@@ -97,6 +98,7 @@ protected function _getAdditionalElementTypes()
'theme' => $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_theme'),
'page' => $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_page'),
'addrow'=> $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_addrow'),
+ 'datetime' => $config->getBlockClassName('xmlconnect/adminhtml_mobile_form_element_datetime'),
);
}
@@ -109,7 +111,7 @@ public function getApplication()
{
$model = Mage::registry('current_app');
if (!($model instanceof Mage_XmlConnect_Model_Application)) {
- Mage::throwException(Mage::helper('xmlconnect')->__('App model not loaded.'));
+ Mage::throwException($this->__('App model not loaded.'));
}
return $model;
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue.php
new file mode 100755
index 0000000000..547b53c3c7
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue.php
@@ -0,0 +1,48 @@
+
+ */
+ class Mage_XmlConnect_Block_Adminhtml_Queue extends Mage_Adminhtml_Block_Widget_Grid_Container
+ {
+ /**
+ * Class constructor
+ */
+ public function __construct()
+ {
+ $this->_blockGroup = 'xmlconnect';
+ $this->_controller = 'adminhtml_queue';
+ $this->_headerText = $this->__('AirMail Messages Queue');
+
+ parent::__construct();
+ $this->removeButton('add');
+ }
+ }
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php
new file mode 100755
index 0000000000..483a924755
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php
@@ -0,0 +1,80 @@
+_objectId = 'id';
+ $this->_controller = 'adminhtml_queue';
+ $this->_blockGroup = 'xmlconnect';
+ parent::__construct();
+
+ $message = Mage::registry('current_message');
+ if ($message && $message->getStatus() != Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE) {
+ $this->_removeButton('reset');
+ $this->_removeButton('save');
+ } else {
+ $this->_updateButton('save', 'label', $this->__('Queue Message'));
+ $this->_updateButton('save', 'onclick', 'if (editForm.submit()) {disableElements(\'save\')}');
+ }
+ $this->_removeButton('delete');
+
+ $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getBackUrl() . '\')');
+ }
+
+ /**
+ * Get URL for back (reset) button
+ *
+ * @return string
+ */
+ public function getBackUrl()
+ {
+ $template = Mage::registry('current_template');
+ $message = Mage::registry('current_message');
+ return $message && !$message->getId() && $template && $template->getId()
+ ? $this->getUrl('*/*/template')
+ : $this->getUrl('*/*/queue');
+ }
+
+ /**
+ * Get header text
+ *
+ * @return string
+ */
+ public function getHeaderText()
+ {
+ $message = Mage::registry('current_message');
+ if ($message && $message->getId()) {
+ return $this->__('Edit AirMail Message Queue #%s', $this->htmlEscape($message->getId()));
+ } else {
+ return $this->__('New AirMail Message Queue');
+ }
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit/Form.php
new file mode 100755
index 0000000000..a64b90e440
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit/Form.php
@@ -0,0 +1,137 @@
+_fieldsEnabled = $model->getStatus() == Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE ? true : false;
+
+ parent::_prepareForm();
+
+ if (null !== Mage::registry('current_template')) {
+ $templateModel = Mage::registry('current_template');
+ } else {
+ $templateModel = Mage::getModel('xmlconnect/template')->load($model->getTemplateId());
+ }
+
+ $fieldset = $this->getForm()->addFieldset("message_settings", array('legend' => $this->__('Message Settings')), '^');
+
+ if ($model->getId()) {
+ $fieldset->addField('message_id', 'hidden', array(
+ 'name' => 'message_id'
+ ));
+ }
+
+ // set exec_time for showing accordingly to locale datetime settings
+ $model->setExecTime(Mage::getSingleton('core/date')->date(null, $model->getExecTime()));
+
+ /*@var $sovereignField Varien_Data_Form_Element_Abstract */
+ $sovereignField = $fieldset->addField('type', 'select', array(
+ 'name' => 'type',
+ 'values' => Mage::helper('xmlconnect')->getMessageTypeOptions(),
+ 'label' => $this->__('Message Type'),
+ 'title' => $this->__('Message Type'),
+ 'disabled' => !$this->_fieldsEnabled,
+ 'required' => true,
+ ));
+
+ $fieldset->addField('exec_time', 'date', array(
+ 'name' => 'exec_time',
+ 'format' => Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT),
+ 'label' => $this->__('Start Date'),
+ 'time' => true,
+ 'title' => $this->__('Start Date'),
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
+ 'note' => $this->__('If leave this field empty, the message will be sent immediately'),
+ 'disabled' => !$this->_fieldsEnabled,
+ 'required' => false,
+ ));
+
+ $this->_addElementTypes($fieldset);
+
+ // field dependencies
+ // i don't know how to not hardcoded this dependence (I mean 'airmail' message type is now used for set these dependences)
+ if (isset($this->_dependentFields['message_title']) || isset($this->_dependentFields['content'])) {
+ $dependenceBlock = $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence');
+
+ $dependenceBlock->addFieldMap($this->_dependentFields['message_title']->getHtmlId(), $this->_dependentFields['message_title']->getName())
+ ->addFieldMap($this->_dependentFields['content']->getHtmlId(), $this->_dependentFields['content']->getName())
+ ->addFieldMap($sovereignField->getHtmlId(), $sovereignField->getName());
+
+ if (isset($this->_dependentFields['message_title']) && $this->_dependentFields['message_title']) {
+ $dependenceBlock->addFieldDependence(
+ $this->_dependentFields['message_title']->getName(),
+ $sovereignField->getName(),
+ Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL);
+
+ if (!$this->_fieldsEnabled) {
+ $this->_dependentFields['message_title']->setReadonly(true, true);
+ }
+ }
+
+ if (isset($this->_dependentFields['content']) && $this->_dependentFields['content']) {
+ $dependenceBlock->addFieldDependence(
+ $this->_dependentFields['content']->getName(),
+ $sovereignField->getName(),
+ Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL);
+
+ if (!$this->_fieldsEnabled) {
+ $this->_dependentFields['content']->setReadonly(true, true);
+ }
+ }
+ $this->setChild('form_after', $dependenceBlock);
+ }
+
+ if (!$model->getName()) {
+ $model->setName($templateModel->getName());
+ }
+ if (!$model->getPushTitle()) {
+ $model->setPushTitle($templateModel->getPushTitle());
+ }
+ if (!$model->getMessageTitle()) {
+ $model->setMessageTitle($templateModel->getMessageTitle());
+ }
+ if (!$model->getContent()) {
+ $model->setContent($templateModel->getContent());
+ }
+ if (!$model->getTemplateId()) {
+ $model->setTemplateId($templateModel->getId());
+ }
+ $model->setMessageId($model->getId());
+
+ $this->getForm()->setAction($this->getUrl('*/*/saveMessage'));
+ $this->getForm()->setValues($model->getData());
+
+ $this->setForm($this->getForm());
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php
new file mode 100755
index 0000000000..3a847290b8
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php
@@ -0,0 +1,183 @@
+
+ */
+class Mage_XmlConnect_Block_Adminhtml_Queue_Grid extends Mage_Adminhtml_Block_Widget_Grid
+{
+
+ /**
+ * Constructor
+ *
+ * Setting grid_id, sort order and sort direction
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setId('app_queue_grid');
+ $this->setDefaultSort('exec_time');
+ $this->setDefaultDir('DESC');
+ $this->setSaveParametersInSession(true);
+ }
+
+ /**
+ * Setting collection to show
+ *
+ * @return Mage_Adminhtml_Block_Widget_Grid
+ */
+ protected function _prepareCollection()
+ {
+ $collection = Mage::getModel('xmlconnect/queue')->getCollection();
+
+ $collection->addFieldToFilter('main_table.status', array('neq' => Mage_XmlConnect_Model_Queue::STATUS_DELETED));
+ $this->setCollection($collection);
+ return parent::_prepareCollection();
+ }
+
+ /**
+ * Configuration of grid
+ *
+ * @return Mage_Adminhtml_Block_Widget_Grid
+ */
+ protected function _prepareColumns()
+ {
+ $this->addColumn('id', array(
+ 'header' => $this->__('ID'),
+ 'align' => 'center',
+ 'index' => 'main_table.id',
+ 'width' => '40px',
+ 'renderer' => 'xmlconnect/adminhtml_queue_grid_renderer_id'
+ ));
+
+ $this->addColumn('exec_time', array(
+ 'header' => $this->__('Queue Date'),
+ 'index' => 'exec_time',
+ 'type' => 'datetime',
+ 'gmtoffset' => false,
+ 'default' => ' ---- '
+ ));
+
+ $this->addColumn('app_code', array(
+ 'header' => $this->__('Application Name'),
+ 'align' => 'left',
+ 'index' => 'main_table.app_code',
+ 'type' => 'options',
+ 'options' => Mage::helper('xmlconnect')->getApplications(),
+ 'renderer' => 'xmlconnect/adminhtml_queue_grid_renderer_application'
+ ));
+
+ $this->addColumn('name', array(
+ 'header' => $this->__('Template Name'),
+ 'align' => 'left',
+ 'index' => 't.name',
+ 'type' => 'text',
+ 'default' => '--- Parent template has been deleted ---',
+ 'renderer' => 'xmlconnect/adminhtml_queue_grid_renderer_template'
+ ));
+
+ $this->addColumn('push_title', array(
+ 'header' => $this->__('Push Title'),
+ 'align' => 'left',
+ 'index' => 'main_table.push_title',
+ 'type' => 'text',
+ 'renderer' => 'xmlconnect/adminhtml_queue_grid_renderer_pushtitle'
+ ));
+
+ $this->addColumn('message_title', array(
+ 'header' => $this->__('Message Title'),
+ 'align' => 'left',
+ 'index' => 'main_table.message_title',
+ 'type' => 'text',
+ 'renderer' => 'xmlconnect/adminhtml_queue_grid_renderer_msgtitle'
+ ));
+
+ $this->addColumn('status', array(
+ 'header' => $this->__('Status'),
+ 'align' => 'left',
+ 'index' => 'main_table.status',
+ 'type' => 'options',
+ 'width' => '50px',
+ 'options' => array(
+ Mage_XmlConnect_Model_Queue::STATUS_CANCELED => $this->__('Canceled'),
+ Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE => $this->__('In Queue'),
+ Mage_XmlConnect_Model_Queue::STATUS_COMPLETED => $this->__('Completed'),
+ ),
+ 'renderer' => 'xmlconnect/adminhtml_queue_grid_renderer_status',
+ ));
+
+ $this->addColumn('action', array(
+ 'header' => $this->__('Action'),
+ 'type' => 'action',
+ 'getter' => 'getId',
+ 'renderer' => 'xmlconnect/adminhtml_queue_grid_renderer_action',
+
+ 'filter' => false,
+ 'sortable' => false,
+ ));
+
+ return parent::_prepareColumns();
+ }
+
+ /**
+ * Prepare mass actions
+ *
+ * @return Mage_XmlConnect_Block_Adminhtml_Queue_Grid
+ */
+ protected function _prepareMassaction()
+ {
+ $this->setMassactionIdField('id');
+ $this->getMassactionBlock()->setFormFieldName('queue');
+
+ $this->getMassactionBlock()->addItem('delete', array(
+ 'label' => $this->__('Delete'),
+ 'url' => $this->getUrl('*/*/massDeleteQueue'),
+ 'confirm' => $this->__('Are you sure you what to delete selected records?')
+ ));
+
+ $this->getMassactionBlock()->addItem('cancel', array(
+ 'label' => $this->__('Cancel'),
+ 'url' => $this->getUrl('*/*/massCancelQueue'),
+ 'confirm' => $this->__('Are you sure you what to cancel selected records?')
+ ));
+ return $this;
+ }
+
+ /**
+ * Configure row click url
+ *
+ * @param Mage_Catalog_Model_Queue|Varien_Object $row
+ * @return string
+ */
+ public function getRowUrl($row)
+ {
+ return $this->getUrl('*/*/editQueue', array('id' => $row->getId()));
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Action.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Action.php
new file mode 100755
index 0000000000..dfdbb039b9
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Action.php
@@ -0,0 +1,73 @@
+
+ */
+class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
+{
+ /**
+ * Render grid row
+ *
+ * @param Varien_Object $row
+ * @return string
+ */
+ public function render(Varien_Object $row)
+ {
+ $actions = array(
+ array(
+ 'caption' => $this->__('Preview'),
+ 'url' => $this->getUrl('*/*/previewQueue', array('id' => $row->getId())),
+ 'popup' => true,
+ ),
+ );
+
+ if ($row->getStatus() == Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE) {
+ $actions[] = array(
+ 'caption' => $this->__('Edit'),
+ 'url' => $this->getUrl('*/*/editQueue', array('id' => $row->getId())),
+ );
+ $actions[] = array(
+ 'caption' => $this->__('Cancel'),
+ 'url' => $this->getUrl('*/*/cancelQueue', array('id' => $row->getId())),
+ 'confirm' => $this->__('Are you sure you whant to cancel a message?')
+ );
+ }
+
+ $actions[] = array(
+ 'caption' => $this->__('Delete'),
+ 'url' => $this->getUrl('*/*/deleteQueue', array('id' => $row->getId())),
+ 'confirm' => $this->__('Are you sure you whant to delete a message?')
+ );
+
+ $this->getColumn()->setActions($actions);
+ return parent::render($row);
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php
new file mode 100755
index 0000000000..1b27368e2c
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php
@@ -0,0 +1,50 @@
+
+ */
+class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Application extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
+{
+ /**
+ * Render grid row
+ *
+ * @param Varien_Object $row
+ * @return string
+ */
+ public function render(Varien_Object $row)
+ {
+ $str = htmlspecialchars($row->getAppName());
+ if ($str == '') {
+ $str = ' --- ';
+ }
+ return $str;
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Id.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Id.php
new file mode 100755
index 0000000000..11ae295acc
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Id.php
@@ -0,0 +1,46 @@
+
+ */
+class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Id extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
+{
+ /**
+ * Render grid row
+ *
+ * @param Varien_Object $row
+ * @return string
+ */
+ public function render(Varien_Object $row)
+ {
+ return $row->getId();
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php
new file mode 100755
index 0000000000..f27cfbe5fa
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php
@@ -0,0 +1,50 @@
+
+ */
+class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Msgtitle extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
+{
+ /**
+ * Render grid row
+ *
+ * @param Varien_Object $row
+ * @return string
+ */
+ public function render(Varien_Object $row)
+ {
+ $msgTitle = $row->getMessageTitle();
+ if (strlen($msgTitle) > 50) {
+ $msgTitle = substr($msgTitle, 0, 50) . '...';
+ }
+ return htmlspecialchars($msgTitle);
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php
new file mode 100755
index 0000000000..a5d2b09b91
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php
@@ -0,0 +1,47 @@
+
+ */
+
+class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Pushtitle extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
+{
+ /**
+ * Render grid row
+ *
+ * @param Varien_Object $row
+ * @return string
+ */
+ public function render(Varien_Object $row)
+ {
+ return htmlspecialchars($row->getPushTitle());
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php
new file mode 100755
index 0000000000..b0ac6794c1
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php
@@ -0,0 +1,69 @@
+
+ */
+
+class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Status extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
+{
+ /**
+ * Render grid row
+ *
+ * @param Varien_Object $row
+ * @return string
+ */
+ public function render(Varien_Object $row)
+ {
+ $str = '';
+ if (is_numeric($row->getStatus())) {
+ switch ($row->getStatus()) {
+ case Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE:
+ $str = $this->__('In Queue');
+ break;
+ case Mage_XmlConnect_Model_Queue::STATUS_CANCELED:
+ $str = $this->__('Cancelled');
+ break;
+ case Mage_XmlConnect_Model_Queue::STATUS_COMPLETED:
+ $str = $this->__('Completed');
+ break;
+ case Mage_XmlConnect_Model_Queue::STATUS_DELETED:
+ $str = $this->__('Deleted');
+ break;
+ }
+ }
+
+ if ($str === '') {
+ $str = $this->__('Undefined');
+ }
+
+ return htmlspecialchars($str);
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php
new file mode 100755
index 0000000000..920c371858
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php
@@ -0,0 +1,51 @@
+
+ */
+
+class Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Template extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
+{
+ /**
+ * Render grid row
+ *
+ * @param Varien_Object $row
+ * @return string
+ */
+ public function render(Varien_Object $row)
+ {
+ $str = htmlspecialchars($row->getTplName());
+ if ($str == '') {
+ $str .= '---';
+ }
+ return $str;
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template.php
new file mode 100755
index 0000000000..ec5a184d1e
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template.php
@@ -0,0 +1,65 @@
+
+ */
+ class Mage_XmlConnect_Block_Adminhtml_Template extends Mage_Adminhtml_Block_Widget_Grid_Container
+ {
+ /**
+ * Class constructor
+ */
+ public function __construct()
+ {
+ $this->_blockGroup = 'xmlconnect';
+ $this->_controller = 'adminhtml_template';
+ $this->_headerText = $this->__('AirMail templates');
+
+ parent::__construct();
+ $this->removeButton('add');
+ }
+
+ /**
+ * Prepare layout
+ * Add new button
+ *
+ * @return Mage_Adminhtml_Block_Widget_Grid_Container
+ */
+ protected function _prepareLayout()
+ {
+ $this->_addButton('add_new', array(
+ 'label' => $this->__('Add New Template'),
+ 'onclick' => "setLocation('{$this->getUrl('*/*/newTemplate')}')",
+ 'class' => 'add'
+ ));
+
+ return parent::_prepareLayout();
+ }
+ }
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php
new file mode 100755
index 0000000000..229fd9a12e
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php
@@ -0,0 +1,71 @@
+_objectId = 'id';
+ $this->_controller = 'adminhtml_template';
+ $this->_blockGroup = 'xmlconnect';
+ parent::__construct();
+
+ $this->_updateButton('delete', 'onclick', 'deleteConfirm(\''
+ . Mage::helper('adminhtml')->__('Warning: All related AirMail messages will be deteted!\n Are you sure you want to do this?')
+ .'\', \'' . $this->getDeleteUrl() . '\')');
+ $this->_updateButton('save', 'label', $this->__('Save'));
+ $this->_updateButton('save', 'onclick', 'if (editForm.submit()) {disableElements(\'save\')}');
+ $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('*/*/template') . '\')');
+ }
+
+ /**
+ * Return delete url for customer group
+ *
+ * @return string
+ */
+ public function getDeleteUrl()
+ {
+ return $this->getUrl('*/*/deletetemplate', array($this->_objectId => $this->getRequest()->getParam($this->_objectId)));
+ }
+
+ /**
+ * Get text for header
+ *
+ * @return string
+ */
+ public function getHeaderText()
+ {
+ $template = Mage::registry('current_template');
+ if ($template && $template->getId()) {
+ return $this->__('Edit Template "%s"', $this->htmlEscape($template->getName()));
+ } else {
+ return $this->__('New Template');
+ }
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php
new file mode 100755
index 0000000000..ce3080bb1d
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php
@@ -0,0 +1,136 @@
+isEnabled()) {
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
+ }
+ }
+
+ /**
+ * Prepare form
+ *
+ * @return Mage_Adminhtml_Block_Widget_Form
+ */
+ protected function _prepareForm()
+ {
+ $model = Mage::registry('current_template');
+
+ if (!$model) {
+ $model = new Varien_Object();
+ }
+
+ $action = $this->getUrl('*/*/saveTemplate');
+
+ $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $action, 'method' => 'post', 'enctype' => 'multipart/form-data'));
+ $form->setHtmlIdPrefix('template_');
+
+ $fieldset = $form->addFieldset('edit_template', array('legend' => $this->__('Template')));
+ $this->_addElementTypes($fieldset);
+
+ if ($model->getId()) {
+ $fieldset->addField('id', 'hidden', array(
+ 'name' => 'id',
+ ));
+ $fieldset->addField('template_id', 'hidden', array(
+ 'name' => 'template_id',
+ ));
+ }
+
+ $fieldset->addField('app_code', 'select', array(
+ 'name' => 'app_code',
+ 'label' => $this->__('Application'),
+ 'title' => $this->__('Application'),
+ 'disabled' => $model->getId() || !$this->_fieldsEnabled ? true : false,
+ 'values' => Mage::helper('xmlconnect')->getApplicationOptions(),
+ 'note' => $this->__('Creating a Template is allowed only for applications which have device type iPhone.'),
+ 'required' => true,
+ ));
+
+ $fieldset->addField('name', 'text', array(
+ 'name' => 'name',
+ 'label' => $this->__('Template Name'),
+ 'title' => $this->__('Template Name'),
+ 'required' => true,
+ 'disabled' => $model->getId() || !$this->_fieldsEnabled ? true : false,
+ 'note' => $this->__('Maximum length is 255'),
+ 'maxlength' => 255
+ ));
+
+ $fieldset->addField('push_title', 'text', array(
+ 'name' => 'push_title',
+ 'label' => $this->__('Push Title'),
+ 'title' => $this->__('Push Title'),
+ 'required' => true,
+ 'disabled' => !$this->_fieldsEnabled ? true : false,
+ 'note' => $this->__('Maximum length is 140'),
+ 'maxlength' => 140
+ ));
+
+ $this->_dependentFields['message_title'] = $fieldset->addField('message_title', 'text', array(
+ 'name' => 'message_title',
+ 'label' => $this->__('Message Title'),
+ 'title' => $this->__('Message Title'),
+ 'required' => true,
+ 'disabled' => !$this->_fieldsEnabled ? true : false,
+ 'note' => $this->__('Maximum length is 255'),
+ 'maxlength' => 255
+ ));
+
+ $widgetFilters = array('is_email_compatible' => 1);
+ $wysiwygConfig = Mage::getSingleton('cms/wysiwyg_config')->getConfig(array(
+// 'add_widgets' => true,
+// 'add_variables' => true,
+ 'widget_filters' => $widgetFilters
+ ));
+
+ $this->_dependentFields['content'] = $fieldset->addField('content', 'editor', array(
+ 'label' => $this->__('Template Content'),
+ 'title' => $this->__('Template Content'),
+ 'name' => 'content',
+ 'style' => 'height:30em;',
+ 'state' => 'html',
+ 'required' => true,
+// 'disabled' => false,
+ 'disabled' => !$this->_fieldsEnabled ? true : false,
+ 'config' => $wysiwygConfig
+ ));
+
+ $form->setValues($model->getData());
+ $form->setUseContainer(true);
+ $this->setForm($form);
+ return parent::_prepareForm();
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php
new file mode 100755
index 0000000000..5b885ac17f
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php
@@ -0,0 +1,158 @@
+
+ */
+class Mage_XmlConnect_Block_Adminhtml_Template_Grid extends Mage_Adminhtml_Block_Widget_Grid
+{
+
+ /**
+ * Constructor
+ *
+ * Setting grid_id, sort order and sort direction
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setId('app_template_grid');
+ $this->setDefaultSort('created_at');
+ $this->setDefaultDir('ASC');
+ $this->setSaveParametersInSession(true);
+ }
+
+ /**
+ * Setting collection to show
+ *
+ * @return Mage_Adminhtml_Block_Widget_Grid
+ */
+ protected function _prepareCollection()
+ {
+ $collection = Mage::getModel('xmlconnect/template')->getCollection();
+ $this->setCollection($collection);
+ return parent::_prepareCollection();
+ }
+
+ /**
+ * Configuration of grid
+ *
+ * @return Mage_Adminhtml_Block_Widget_Grid
+ */
+ protected function _prepareColumns()
+ {
+ $this->addColumn('id', array(
+ 'header' => $this->__('ID'),
+ 'align' => 'center',
+ 'index' => 'id',
+ 'width' => '40px'
+ ));
+
+ $this->addColumn('name', array(
+ 'header' => $this->__('Template Name'),
+ 'align' => 'left',
+ 'index' => 'name'
+ ));
+
+ $this->addColumn('created_at', array(
+ 'header' => $this->__('Date Created'),
+ 'align' => 'left',
+ 'index' => 'created_at',
+ 'type' => 'datetime'
+ ));
+
+ $this->addColumn('modified_at', array(
+ 'header' => $this->__('Date Updated'),
+ 'align' => 'left',
+ 'index' => 'modified_at',
+ 'type' => 'datetime'
+ ));
+
+ $this->addColumn('app_code', array(
+ 'header' => $this->__('Application'),
+ 'index' => 'app_code',
+ 'type' => 'options',
+ 'align' => 'left',
+ 'options' => Mage::helper('xmlconnect')->getApplications(),
+ 'renderer' => 'xmlconnect/adminhtml_template_grid_renderer_application',
+ ));
+
+ $this->addColumn('push_title', array(
+ 'header' => $this->__('Push Title'),
+ 'type' => 'text',
+ 'align' => 'left',
+ 'index' => 'push_title'
+ ));
+
+ $this->addColumn('message_title', array(
+ 'header' => $this->__('Message Title'),
+ 'type' => 'text',
+ 'align' => 'left',
+ 'index' => 'message_title'
+ ));
+
+ $this->addColumn('action', array(
+ 'header' => $this->__('Action'),
+ 'type' => 'action',
+ 'getter' => 'getId',
+ 'actions' => array(
+ array(
+ 'caption' => $this->__('Preview'),
+ 'url' => array(
+ 'base' => '*/*/previewTemplate'
+ ),
+ 'popup' => true,
+ 'field' => 'id'
+ ),
+ array(
+ 'caption' => $this->__('Queue Message'),
+ 'url' => array(
+ 'base' => '*/*/queueMessage',
+ ),
+ 'field' => 'template_id'
+ ),
+ ),
+ 'filter' => false,
+ 'sortable' => false,
+ ));
+
+ return parent::_prepareColumns();
+ }
+
+ /**
+ * Configure row click url
+ *
+ * @param Mage_Catalog_Model_Template|Varien_Object $row
+ * @return string
+ */
+ public function getRowUrl($row)
+ {
+ return $this->getUrl('*/*/editTemplate', array('id' => $row->getId()));
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php
new file mode 100755
index 0000000000..86ee846a02
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php
@@ -0,0 +1,50 @@
+
+ */
+class Mage_XmlConnect_Block_Adminhtml_Template_Grid_Renderer_Application extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
+{
+ /**
+ * Render grid row
+ *
+ * @param Varien_Object $row
+ * @return string
+ */
+ public function render(Varien_Object $row)
+ {
+ $str = htmlspecialchars($row->getAppName());
+ if ($str == '') {
+ $str = ' --- ';
+ }
+ return $str;
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview.php
new file mode 100755
index 0000000000..883460115a
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview.php
@@ -0,0 +1,69 @@
+
+ */
+class Mage_XmlConnect_Block_Adminhtml_Template_Preview extends Mage_Adminhtml_Block_Widget
+{
+ /**
+ * Retrieve processed template
+ *
+ * @return string
+ */
+ protected function _toHtml()
+ {
+ if ((int)$this->getRequest()->getParam('queue_preview')) {
+ $id = $this->getRequest()->getParam('queue_preview');
+ /* @var $template Mage_XmlConnect_Model_Queue */
+ $template = Mage::getModel('xmlconnect/queue');
+ } else {
+ $id = (int)$this->getRequest()->getParam('id');
+ /* @var $template Mage_XmlConnect_Model_Template */
+ $template = Mage::getModel('xmlconnect/template');
+ }
+
+ if ($id) {
+ $template->load($id);
+ }
+
+ $storeId = (int)$this->getRequest()->getParam('store_id');
+
+ if (!$storeId) {
+ $storeId = Mage::app()->getDefaultStoreView()->getId();
+ }
+
+ $template->emulateDesign($storeId);
+ $templateProcessed = $template->getProcessedTemplate(array(), true);
+ $template->revertDesign();
+
+ return $templateProcessed;
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview/Form.php
new file mode 100755
index 0000000000..884e772f92
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview/Form.php
@@ -0,0 +1,70 @@
+
+ */
+class Mage_XmlConnect_Block_Adminhtml_Template_Preview_Form extends Mage_Adminhtml_Block_Widget_Form
+{
+
+ /**
+ * Preparing from for revision page
+ *
+ * @return Mage_XmlConnect_Block_Adminhtml_Template_Preview_Form
+ */
+ protected function _prepareForm()
+ {
+ $form = new Varien_Data_Form(array(
+ 'id' => 'preview_form',
+ 'action' => $this->getUrl('*/*/drop', array('_current' => true)),
+ 'method' => 'post'
+ ));
+
+ if ($data = $this->getFormData()) {
+
+ $mapper = array('preview_store_id' => 'store_id');
+
+ foreach ($data as $key => $value) {
+ if(array_key_exists($key, $mapper)) {
+ $name = $mapper[$key];
+ } else {
+ $name = $key;
+ }
+ $form->addField($key, 'hidden', array('name' => $name));
+ }
+ $form->setValues($data);
+ }
+
+ $form->setUseContainer(true);
+ $this->setForm($form);
+ return parent::_prepareForm();
+ }
+}
+
diff --git a/app/code/core/Mage/XmlConnect/Block/Cart.php b/app/code/core/Mage/XmlConnect/Block/Cart.php
index 5b08d67d99..366e64b85b 100644
--- a/app/code/core/Mage/XmlConnect/Block/Cart.php
+++ b/app/code/core/Mage/XmlConnect/Block/Cart.php
@@ -69,9 +69,7 @@ protected function _toHtml()
$iconXml = $itemXml->addChild('icon', $icon);
- $baseUrl = Mage::getBaseUrl('media');
- $path = str_replace($baseUrl, '', $icon);
- $file = Mage::getBaseDir('media') . DS . str_replace('/', DS, $path);
+ $file = Mage::helper('xmlconnect')->urlToPath($icon);
$iconXml->addAttribute('modification_time', filemtime($file));
diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php b/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php
index 29bf967e48..cbd5c55c85 100644
--- a/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php
+++ b/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php
@@ -53,10 +53,7 @@ protected function _toHtml()
$iconXml = $itemXmlObj->addChild('icon', $icon);
- $baseUrl = Mage::getBaseUrl('media');
- $path = str_replace($baseUrl, '', $icon);
- $file = Mage::getBaseDir('media') . DS . str_replace('/', DS, $path);
-
+ $file = Mage::helper('xmlconnect')->urlToPath($icon);
$iconXml->addAttribute('modification_time', filemtime($file));
$itemXmlObj->addChild('entity_id', $_item->getId());
diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php
index 59dc468cab..836f8a91f6 100644
--- a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php
+++ b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php
@@ -33,18 +33,24 @@
*/
class Mage_XmlConnect_Block_Cart_Paypal_Mep_Totals extends Mage_Checkout_Block_Cart_Totals
{
- /**
+ /**
* Render cart totals xml
*
* @return string
*/
protected function _toHtml()
{
- $paypalCart = Mage::getModel('paypal/cart', array($this->getQuote()));
+ $quote = $this->getQuote();
$totalsXmlObj = new Mage_XmlConnect_Model_Simplexml_Element(' ');
- foreach ($paypalCart->getTotals(true) as $code => $amount) {
- $currencyAmount = $this->helper('core')->currency($amount, false, false);
- $totalsXmlObj->addChild($code, Mage::helper('xmlconnect')->formatPriceForXml($currencyAmount));
+ list($items, $totals) = Mage::helper('paypal')->prepareLineItems($quote);
+
+ if (Mage::helper('paypal')->areCartLineItemsValid($items, $totals, $quote->getBaseGrandTotal())) {
+ foreach ($totals as $code => $amount) {
+ $currencyAmount = $this->helper('core')->currency($amount, false, false);
+ $totalsXmlObj->addChild($code, Mage::helper('xmlconnect')->formatPriceForXml($currencyAmount));
+ }
+ } else {
+ Mage::throwException($this->__('Cart line items are not eligible for exporting to PayPal API'));
}
return $totalsXmlObj->asNiceXml();
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog.php b/app/code/core/Mage/XmlConnect/Block/Catalog.php
index 72c3920046..05cc7e47f2 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog.php
@@ -50,11 +50,17 @@ class Mage_XmlConnect_Block_Catalog extends Mage_Core_Block_Template
*/
public function getProductSortFeildsXmlObject()
{
- $ordersXmlObject = new Mage_XmlConnect_Model_Simplexml_Element(' ');
- $sortOptions = Mage::getModel('catalog/category')->getAvailableSortByOptions();
- $sortOptions = array_slice($sortOptions, 0, self::PRODUCT_SORT_FIELDS_NUMBER);
+ $ordersXmlObject = new Mage_XmlConnect_Model_Simplexml_Element(' ');
+ /* @var $category Mage_Catalog_Model_Category */
+ $category = Mage::getModel('catalog/category');
+ $sortOptions = $category->getAvailableSortByOptions();
+ $sortOptions = array_slice($sortOptions, 0, self::PRODUCT_SORT_FIELDS_NUMBER);
+ $defaultSort = $category->getDefaultSortBy();
foreach ($sortOptions as $code => $name) {
$item = $ordersXmlObject->addChild('item');
+ if ($code == $defaultSort) {
+ $item->addAttribute('isDefault', 1);
+ }
$item->addChild('code', $code);
$item->addChild('name', $ordersXmlObject->xmlentities(strip_tags($name)));
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php
index af9e9010d6..91f1134ad4 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php
@@ -46,22 +46,19 @@ protected function _toHtml()
if ($categoryId === null) {
$categoryId = Mage::app()->getStore()->getRootCategoryId();
}
+
+ $productsXmlObj = $productListBlock = false;
+
$categoryModel = Mage::getModel('catalog/category')->load($categoryId);
if ($categoryModel->getId()) {
$hasMoreProductItems = 0;
- $productsXmlObj = $productListBlock = null;
- /**
- * Return products list if there are no child categories
- */
- if (!$categoryModel->hasChildren()) {
- $productListBlock = $this->getChild('product_list');
- if ($productListBlock) {
- $layer = Mage::getSingleton('catalog/layer');
- $productsXmlObj = $productListBlock->setCategory($categoryModel)
- ->setLayer($layer)
- ->getProductsXmlObject();
- $hasMoreProductItems = (int)$productListBlock->getHasProductItems();
- }
+ $productListBlock = $this->getChild('product_list');
+ if ($productListBlock && $categoryModel->getLevel() > 1) {
+ $layer = Mage::getSingleton('catalog/layer');
+ $productsXmlObj = $productListBlock->setCategory($categoryModel)
+ ->setLayer($layer)
+ ->getProductsXmlObject();
+ $hasMoreProductItems = (int)$productListBlock->getHasProductItems();
}
$infoBlock = $this->getChild('category_info');
@@ -71,11 +68,6 @@ protected function _toHtml()
$categoryInfoXmlObj->addChild('has_more_items', $hasMoreProductItems);
$categoryXmlObj->appendChild($categoryInfoXmlObj);
}
-
- if ($productListBlock && $productsXmlObj) {
- $categoryXmlObj->appendChild($productsXmlObj);
- }
-
}
$categoryCollection = Mage::getResourceModel('xmlconnect/category_collection');
@@ -83,28 +75,30 @@ protected function _toHtml()
->setOrder('position', 'ASC')
->addParentIdFilter($categoryId);
+ // subcategories are exists
if (sizeof($categoryCollection)) {
$itemsXmlObj = $categoryXmlObj->addChild('items');
- }
- foreach ($categoryCollection->getItems() as $item) {
- $itemXmlObj = $itemsXmlObj->addChild('item');
- $itemXmlObj->addChild('label', $categoryXmlObj->xmlentities(strip_tags($item->getName())));
- $itemXmlObj->addChild('entity_id', $item->getEntityId());
- $itemXmlObj->addChild('content_type', $item->hasChildren() ? 'categories' : 'products');
- if (!is_null($categoryId)) {
- $itemXmlObj->addChild('parent_id', $item->getParentId());
- }
- $icon = Mage::helper('xmlconnect/catalog_category_image')->initialize($item, 'thumbnail')
- ->resize(Mage::helper('xmlconnect/image')->getImageSizeForContent('category'));
+ foreach ($categoryCollection->getItems() as $item) {
+ $itemXmlObj = $itemsXmlObj->addChild('item');
+ $itemXmlObj->addChild('label', $categoryXmlObj->xmlentities(strip_tags($item->getName())));
+ $itemXmlObj->addChild('entity_id', $item->getEntityId());
+ $itemXmlObj->addChild('content_type', $item->hasChildren() ? 'categories' : 'products');
+ if (!is_null($categoryId)) {
+ $itemXmlObj->addChild('parent_id', $item->getParentId());
+ }
+ $icon = Mage::helper('xmlconnect/catalog_category_image')->initialize($item, 'thumbnail')
+ ->resize(Mage::helper('xmlconnect/image')->getImageSizeForContent('category'));
- $iconXml = $itemXmlObj->addChild('icon', $icon);
+ $iconXml = $itemXmlObj->addChild('icon', $icon);
- $baseUrl = Mage::getBaseUrl('media');
- $path = str_replace($baseUrl, '', $icon);
- $file = Mage::getBaseDir('media') . DS . str_replace('/', DS, $path);
+ $file = Mage::helper('xmlconnect')->urlToPath($icon);
+ $iconXml->addAttribute('modification_time', filemtime($file));
+ }
+ }
- $iconXml->addAttribute('modification_time', filemtime($file));
+ if ($productListBlock && $productsXmlObj) {
+ $categoryXmlObj->appendChild($productsXmlObj);
}
return $categoryXmlObj->asNiceXml();
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php
index 50395a53a0..9782ebea06 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php
@@ -45,20 +45,20 @@ public function getCategoryInfoXmlObject()
$infoXmlObj = new Mage_XmlConnect_Model_Simplexml_Element(' ');
$category = $this->getCategory();
if ($category && is_object($category) && $category->getId()) {
- $title = $infoXmlObj->xmlentities(strip_tags($category->getParentCategory()->getName()));
- if ($category->getParentCategory()->getLevel() == 1) {
- /**
- * @var string $title
- *
- * Copied data from "getDefaultApplicationDesignTabs()" method in "Mage_XmlConnect_Helper_Data"
- */
- $title = Mage::helper('xmlconnect')->__('Shop');
+ /**
+ * @var string $title
+ *
+ * Copied data from "getDefaultApplicationDesignTabs()" method in "Mage_XmlConnect_Helper_Data"
+ */
+ $title = $this->__('Shop');
+ if ($category->getParentCategory()->getLevel() > 1) {
+ $title = $infoXmlObj->xmlentities(strip_tags($category->getParentCategory()->getName()));
}
$infoXmlObj->addChild('parent_title', $title);
- $pId = $category->getParentId();
- if ($category->getLevel() == 1) {
- $pId = 0;
+ $pId = 0;
+ if ($category->getLevel() > 1) {
+ $pId = $category->getParentId();
}
$infoXmlObj->addChild('parent_id', $pId);
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php
index 77a8eb9d9d..071081ac57 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php
@@ -61,16 +61,12 @@ public function productToXmlObject(Mage_Catalog_Model_Product $product, $itemNod
$propertyToResizeName = 'image';
}
-
$icon = clone Mage::helper('catalog/image')->init($product, $propertyToResizeName)
->resize($imageToResize);
$iconXml = $item->addChild('icon', $icon);
- $baseUrl = Mage::getBaseUrl('media');
- $path = str_replace($baseUrl, '', $icon);
- $file = Mage::getBaseDir('media') . DS . str_replace('/', DS, $path);
-
+ $file = Mage::helper('xmlconnect')->urlToPath($icon);
$iconXml->addAttribute('modification_time', filemtime($file));
$item->addChild('in_stock', (int)$product->isSalable());
@@ -119,9 +115,9 @@ public function productToXmlObject(Mage_Catalog_Model_Product $product, $itemNod
/**
* Get MinSaleQty for product
- *
+ *
* @param Mage_Catalog_Model_Product $product
- * @return int|null
+ * @return int|null
*/
protected function _getMinimalQty($product)
{
@@ -142,7 +138,7 @@ protected function _toHtml()
->load($this->getRequest()->getParam('id', 0));
if (!$product) {
- throw new Mage_Core_Exception(Mage::helper('xmlconnect')->__('Selected product is unavailable.'));
+ throw new Mage_Core_Exception($this->__('Selected product is unavailable.'));
} else {
$this->setProduct($product);
$productXmlObj = $this->productToXmlObject($product, 'product');
@@ -153,7 +149,11 @@ protected function _toHtml()
$productXmlObj->appendChild($relatedXmlObj);
}
}
+
+ $productXmlObj->appendChild($this->getChild('xmlconnect.catalog.product.options')
+ ->getProductOptionsXmlObject($product)
+ );
+
return $productXmlObj->asNiceXml();
}
-
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php
index ec1d5c17a2..046764ff70 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php
@@ -51,7 +51,7 @@ public function addAdditionalData(Mage_Catalog_Model_Product $product, Mage_XmlC
$attributesXmlObj = $productXmlObject->addChild('additional_attributes');
foreach ($additionalData as $data) {
$_attrXmlObject = $attributesXmlObj->addChild('item');
- $_attrXmlObject->addChild('label', $this->htmlEscape(Mage::helper('xmlconnect')->__($data['label'])));
+ $_attrXmlObject->addChild('label', $this->htmlEscape($data['label']));
$_attrXmlObject->addChild('value', Mage::helper('catalog/output')->productAttribute($product, $data['value'], $data['code']));
}
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php
index 09d083baae..070d976648 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php
@@ -64,9 +64,7 @@ protected function _toHtml()
$fileNode->addAttribute('type', 'big');
$fileNode->addAttribute('url', $bigImage);
- $baseUrl = Mage::getBaseUrl('media');
- $path = str_replace($baseUrl, '', $bigImage);
- $file = Mage::getBaseDir('media') . DS . str_replace('/', DS, $path);
+ $file = Mage::helper('xmlconnect')->urlToPath($bigImage);
$fileNode->addAttribute('id', ($id = $item->getId()) ? (int) $id : 0);
$fileNode->addAttribute('modification_time', filemtime($file));
@@ -81,9 +79,7 @@ protected function _toHtml()
$fileNode->addAttribute('type', 'small');
$fileNode->addAttribute('url', $smallImage);
- $path = str_replace($baseUrl, '', $smallImage);
- $file = Mage::getBaseDir('media') . DS . str_replace('/', DS, $path);
-
+ $file = Mage::helper('xmlconnect')->urlToPath($smallImage);
$fileNode->addAttribute('modification_time', filemtime($file));
}
return $imagesNode->asNiceXml();
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php
index 14071ebbfb..d37663bcda 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php
@@ -59,7 +59,7 @@ public function getProductsXmlObject()
$collection = $this->_getProductCollection();
if (!$collection) {
- return $productsXmlObj;
+ return false;
}
foreach ($collection->getItems() as $product) {
$productXmlObj = $this->productToXmlObject($product);
@@ -160,7 +160,7 @@ protected function _getProductCollection()
$collection->getSelect()->limit($count, $offset);
$collection->setFlag('require_stock_items', true);
-
+
$this->_productCollection = $collection;
}
return $this->_productCollection;
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php
index 18c2edf39d..e71bf3e0f5 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php
@@ -80,7 +80,6 @@ public function getProductCustomOptionsXmlObject(Mage_Catalog_Model_Product $pro
return $xmlModel;
}
-
foreach ($product->getOptions() as $option) {
$optionNode = $optionsNode->addChild('option');
$type = $this->_getOptionTypeForXmlByRealType($option->getType());
@@ -171,6 +170,26 @@ protected function _getOptionTypeForXmlByRealType($realType)
return $type;
}
+ /**
+ * Create product custom options Mage_XmlConnect_Model_Simplexml_Element object
+ *
+ * @param Mage_Catalog_Model_Product $product
+ * @return Mage_XmlConnect_Model_Simplexml_Element | false
+ */
+ public function getProductOptionsXmlObject(Mage_Catalog_Model_Product $product)
+ {
+ if ($product->getId()) {
+ $type = $product->getTypeId();
+ if (isset($this->_renderers[$type])) {
+ $renderer = $this->getLayout()->createBlock($this->_renderers[$type]);
+ if ($renderer) {
+ return $renderer->getProductOptionsXml($product, true);
+ }
+ }
+ }
+ return false;
+ }
+
/**
* Generate product options xml
*
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php
index 8f40ecdc50..528d77de16 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php
@@ -38,17 +38,17 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne
* Generate bundle product options xml
*
* @param Mage_Catalog_Model_Product $product
- * @return string
+ * @param bool $isObject
+ * @return string | Mage_XmlConnect_Model_Simplexml_Element
*/
- public function getProductOptionsXml(Mage_Catalog_Model_Product $product)
+ public function getProductOptionsXml(Mage_Catalog_Model_Product $product, $isObject = false)
{
$xmlModel = $this->getProductCustomOptionsXmlObject($product);
$optionsXmlObj = $xmlModel->options;
- $options = array();
if (!$product->isSaleable()) {
- return $xmlModel->asNiceXml();
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
/**
@@ -62,7 +62,7 @@ public function getProductOptionsXml(Mage_Catalog_Model_Product $product)
);
$bundleOptions = $optionCollection->appendSelections($selectionCollection, false, false);
if (!sizeof($bundleOptions)) {
- return $xmlModel->asNiceXml();
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
foreach ($bundleOptions as $_option) {
@@ -117,6 +117,6 @@ public function getProductOptionsXml(Mage_Catalog_Model_Product $product)
}
}
- return $xmlModel->asNiceXml();
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php
index 012dd6102b..e2c67b01c6 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php
@@ -38,16 +38,17 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm
* Generate bundle product options xml
*
* @param Mage_Catalog_Model_Product $product
- * @return string
+ * @param bool $isObject
+ * @return string | Mage_XmlConnect_Model_Simplexml_Element
*/
- public function getProductOptionsXml(Mage_Catalog_Model_Product $product)
+ public function getProductOptionsXml(Mage_Catalog_Model_Product $product, $isObject = false)
{
$xmlModel = $this->getProductCustomOptionsXmlObject($product);
$optionsXmlObj = $xmlModel->options;
$options = array();
if (!$product->isSaleable()) {
- return $xmlModel->asNiceXml();
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
/**
@@ -55,7 +56,7 @@ public function getProductOptionsXml(Mage_Catalog_Model_Product $product)
*/
$_attributes = $product->getTypeInstance(true)->getConfigurableAttributes($product);
if (!sizeof($_attributes)) {
- return $xmlModel->asNiceXml();
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
$_allowProducts = array();
@@ -144,7 +145,7 @@ public function getProductOptionsXml(Mage_Catalog_Model_Product $product)
}
}
- return $xmlModel->asNiceXml();
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
/**
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php
index fed7957b6d..8a85721d76 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php
@@ -38,26 +38,27 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Grouped extends Mage_XmlConn
* Generate bundle product options xml
*
* @param Mage_Catalog_Model_Product $product
- * @return string
+ * @param bool $isObject
+ * @return string | Mage_XmlConnect_Model_Simplexml_Element
*/
- public function getProductOptionsXml(Mage_Catalog_Model_Product $product)
+ public function getProductOptionsXml(Mage_Catalog_Model_Product $product, $isObject = false)
{
$xmlModel = new Mage_XmlConnect_Model_Simplexml_Element(' ');
$optionsNode = $xmlModel->addChild('options');
if (!$product->getId()) {
- return $xmlModel->asNiceXml();
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
$xmlModel->addAttribute('id', $product->getId());
if (!$product->isSaleable()) {
- return $xmlModel->asNiceXml();
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
/**
* Grouped (associated) products
*/
$_associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
if (!sizeof($_associatedProducts)) {
- return $xmlModel->asNiceXml();
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
foreach ($_associatedProducts as $_item) {
if (!$_item->isSaleable()) {
@@ -87,6 +88,6 @@ public function getProductOptionsXml(Mage_Catalog_Model_Product $product)
}
}
- return $xmlModel->asNiceXml();
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php
index abda11053c..0e5d900f1e 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php
@@ -38,10 +38,12 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Simple extends Mage_XmlConne
* Generate simple product options xml
*
* @param Mage_Catalog_Model_Product $product
- * @return string
+ * @param bool $isObject
+ * @return string | Mage_XmlConnect_Model_Simplexml_Element
*/
- public function getProductOptionsXml(Mage_Catalog_Model_Product $product)
+ public function getProductOptionsXml(Mage_Catalog_Model_Product $product, $isObject = false)
{
- return $this->getProductCustomOptionsXmlObject($product)->asNiceXml();
+ $xmlModel = $this->getProductCustomOptionsXmlObject($product);
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php
index 208ad60a71..177528118d 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php
@@ -38,10 +38,12 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Virtual extends Mage_XmlConn
* Generate virtual product options xml
*
* @param Mage_Catalog_Model_Product $product
- * @return string
+ * @param bool $isObject
+ * @return string | Mage_XmlConnect_Model_Simplexml_Element
*/
- public function getProductOptionsXml(Mage_Catalog_Model_Product $product)
+ public function getProductOptionsXml(Mage_Catalog_Model_Product $product, $isObject = false)
{
- return $this->getProductCustomOptionsXmlObject($product)->asNiceXml();
+ $xmlModel = $this->getProductCustomOptionsXmlObject($product);
+ return $isObject ? $xmlModel : $xmlModel->asNiceXml();
}
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php
index c26d593ee1..f8493c9184 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php
@@ -58,8 +58,11 @@ public function reviewToXmlObject(Mage_Review_Model_Review $review, $itemNodeNam
$detail = $item->xmlentities($review->getDetail());
if ($itemNodeName == 'item') {
$remainder = '';
- $detail = Mage::helper('core/string')
- ->truncate($detail, self::REVIEW_DETAIL_TRUNCATE_LEN, '', $remainder, false);
+ $deviceType = Mage::helper('xmlconnect')->getApplication()->getType();
+ if ($deviceType != Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPAD) {
+ $detail = Mage::helper('core/string')
+ ->truncate($detail, self::REVIEW_DETAIL_TRUNCATE_LEN, '', $remainder, false);
+ }
}
$item->addChild('detail', $detail);
diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php
index 89a7601c03..3f115ac50e 100644
--- a/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php
+++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php
@@ -76,7 +76,7 @@ protected function _toHtml()
/**
* Filters
*/
- $showFiltersAndOrders = true;
+ $showFiltersAndOrders = (bool) count($productsXmlObj);
$reguest = $this->getRequest();
foreach ($reguest->getParams() as $key => $value) {
if (0 === strpos($key, parent::REQUEST_SORT_ORDER_PARAM_REFIX) ||
diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php
index 9ce3451bfd..8546a3a658 100644
--- a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php
+++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php
@@ -112,28 +112,32 @@ protected function _toHtml()
$xml = <<
-
-
-
+
+
+
EOT;
- if ($isAllowedGuestCheckout) {
+ if ($isAllowedGuestCheckout && !Mage::getSingleton('customer/session')->isLoggedIn() && $addressType == 'billing') {
$xml .= <<
+
+
+
+
+
EOT;
}
$xml .= <<
-
-
-
+
+
+
+
$countryOptionsXml
-
-
-
-
-
-
+
+
+
+
+
+
EOT;
return $xml;
diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php
index f34a2ca85c..e63056a0ee 100644
--- a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php
+++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php
@@ -62,10 +62,7 @@ protected function _toHtml()
$iconXml = $itemXml->addChild('icon', $icon);
- $baseUrl = Mage::getBaseUrl('media');
- $path = str_replace($baseUrl, '', $icon);
- $file = Mage::getBaseDir('media') . DS . str_replace('/', DS, $path);
-
+ $file = Mage::helper('xmlconnect')->urlToPath($icon);
$iconXml->addAttribute('modification_time', filemtime($file));
/**
diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php
index fa8ee71d30..85ef7418e8 100644
--- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php
+++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php
@@ -59,6 +59,7 @@ public function getQuote()
* Render payment methods xml
*
* @return string
+ * @throw Mage_Core_Exception
*/
protected function _toHtml()
{
@@ -151,7 +152,9 @@ protected function _toHtml()
}
$renderer->addPaymentFormToXmlObj($methodItemXmlObj);
}
-
+ if (!count($usedMethods)) {
+ Mage::throwException($this->__('Sorry, no payment options are available for this order at this time.'));
+ }
return $methodsXmlObj->asNiceXml();
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Avaliable.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Avaliable.php
index de1ac3a9fb..c3ec5f4b79 100644
--- a/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Avaliable.php
+++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Avaliable.php
@@ -58,7 +58,7 @@ protected function _toHtml()
if ($_rate->getErrorMessage()) {
$rateXmlObj->addChild('error_message', $methodsXmlObj->xmlentities(strip_tags($_rate->getErrorMessage())));
} else {
- $price = Mage::helper('tax')->getShippingPrice($_rate->getPrice(), false, $this->getAddress());
+ $price = Mage::helper('tax')->getShippingPrice($_rate->getPrice(), Mage::helper('tax')->displayShippingPriceIncludingTax(), $this->getAddress());
$formattedPrice = $store->convertPrice($price, true, false);
$rateXmlObj->addAttribute('price', Mage::helper('xmlconnect')->formatPriceForXml($store->convertPrice($price, false, false)));
$rateXmlObj->addAttribute('formated_price', $formattedPrice);
@@ -66,7 +66,7 @@ protected function _toHtml()
}
}
} else {
- Mage::throwException(Mage::helper('xmlconnect')->__('Sorry, no quotes are available for this order at this time.'));
+ Mage::throwException($this->__('Sorry, no quotes are available for this order at this time.'));
}
return $methodsXmlObj->asNiceXml();
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Configuration.php b/app/code/core/Mage/XmlConnect/Block/Configuration.php
index 14623f747e..bf310fb953 100644
--- a/app/code/core/Mage/XmlConnect/Block/Configuration.php
+++ b/app/code/core/Mage/XmlConnect/Block/Configuration.php
@@ -93,7 +93,7 @@ protected function _buildRecursive($section, $subtree)
} else {
$value = (string)$value;
if ($value != '') {
- $section->addChild($key, $value);
+ $section->addChild($key, Mage::helper('core')->htmlEscape($value));
}
}
}
@@ -107,7 +107,7 @@ protected function _buildRecursive($section, $subtree)
protected function _toHtml()
{
$xml = new Mage_XmlConnect_Model_Simplexml_Element(' ');
- $this->_buildRecursive($xml, $this->_app->getRenderConf());
+ $this->_buildRecursive($xml, Mage::helper('xmlconnect')->excludeXmlConfigKeys($this->_app->getRenderConf()));
return $xml->asNiceXml();
}
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php b/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php
index c485389f65..d5adffe20c 100644
--- a/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php
+++ b/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php
@@ -107,25 +107,25 @@ protected function _toHtml()
$xml = <<
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
$countryOptionsXml
-
-
-
-
-
+
+
+
+
+
EOT;
diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php b/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php
index 16be94dd51..e3ff77ff71 100644
--- a/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php
+++ b/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php
@@ -50,13 +50,13 @@ protected function _toHtml()
if ($billingAddress && $billingAddress->getId()) {
$item = $addressXmlObj->addChild('item');
- $item->addAttribute('label', Mage::helper('xmlconnect')->__('Default Billing Address'));
+ $item->addAttribute('label', $this->__('Default Billing Address'));
$item->addAttribute('default_billing', 1);
$this->prepareAddressData($billingAddress, $item);
}
if ($shippingAddress && $shippingAddress->getId()) {
$item = $addressXmlObj->addChild('item');
- $item->addAttribute('label', Mage::helper('xmlconnect')->__('Default Shipping Address'));
+ $item->addAttribute('label', $this->__('Default Shipping Address'));
$item->addAttribute('default_shipping', 1);
$this->prepareAddressData($shippingAddress, $item);
}
@@ -64,7 +64,7 @@ protected function _toHtml()
if ($_additionalAddresses) {
foreach ($_additionalAddresses as $_address) {
$item = $addressXmlObj->addChild('item');
- $item->addAttribute('label', Mage::helper('xmlconnect')->__('Additional Address'));
+ $item->addAttribute('label', $this->__('Additional Address'));
$item->addAttribute('additional', 1);
$this->prepareAddressData($_address, $item);
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form.php
index fc95df38f7..fb1f94ef94 100644
--- a/app/code/core/Mage/XmlConnect/Block/Customer/Form.php
+++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form.php
@@ -54,23 +54,23 @@ protected function _toHtml()
if ($editFlag) {
$passwordManageXml = '
-
+
-
-
-
+
+
+
- password
+ password
';
} else {
$passwordManageXml = '
-
-
+
+
- password
+ password
';
@@ -79,11 +79,11 @@ protected function _toHtml()
$xml = <<
-
-
-
+
+
+
-
+
$passwordManageXml
diff --git a/app/code/core/Mage/XmlConnect/Block/Home.php b/app/code/core/Mage/XmlConnect/Block/Home.php
index 2368baa0a6..dfa4180be2 100644
--- a/app/code/core/Mage/XmlConnect/Block/Home.php
+++ b/app/code/core/Mage/XmlConnect/Block/Home.php
@@ -69,9 +69,8 @@ protected function _toHtml()
$iconXml = $itemXmlObj->addChild('icon', $icon);
- $baseUrl = Mage::getBaseUrl('media');
- $path = str_replace($baseUrl, '', $icon);
- $file = Mage::getBaseDir('media') . DS . str_replace('/', DS, $path);
+ $file = Mage::helper('xmlconnect')->urlToPath($icon);
+
$iconXml->addAttribute('modification_time', filemtime($file));
}
diff --git a/app/code/core/Mage/XmlConnect/Block/Wishlist.php b/app/code/core/Mage/XmlConnect/Block/Wishlist.php
index 70ea51dddb..5d487f3b61 100644
--- a/app/code/core/Mage/XmlConnect/Block/Wishlist.php
+++ b/app/code/core/Mage/XmlConnect/Block/Wishlist.php
@@ -82,10 +82,7 @@ protected function _toHtml()
$iconXml = $itemXmlObj->addChild('icon', $icon);
- $baseUrl = Mage::getBaseUrl('media');
- $path = str_replace($baseUrl, '', $icon);
- $file = Mage::getBaseDir('media') . DS . str_replace('/', DS, $path);
-
+ $file = Mage::helper('xmlconnect')->urlToPath($icon);
$iconXml->addAttribute('modification_time', filemtime($file));
diff --git a/app/code/core/Mage/XmlConnect/Controller/Action.php b/app/code/core/Mage/XmlConnect/Controller/Action.php
index 73211c4eb3..3b8eb87340 100644
--- a/app/code/core/Mage/XmlConnect/Controller/Action.php
+++ b/app/code/core/Mage/XmlConnect/Controller/Action.php
@@ -24,19 +24,48 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
abstract class Mage_XmlConnect_Controller_Action extends Mage_Core_Controller_Front_Action
{
+ /**
+ * Message status `error`
+ *
+ * @var string
+ */
const MESSAGE_STATUS_ERROR = 'error';
+
+ /**
+ * Message status `warning`
+ *
+ * @var string
+ */
const MESSAGE_STATUS_WARNING = 'warning';
+
+ /**
+ * Message status `success`
+ *
+ * @var string
+ */
const MESSAGE_STATUS_SUCCESS = 'success';
+ /**
+ * Message type `alert`
+ *
+ * @var string
+ */
const MESSAGE_TYPE_ALERT = 'alert';
+
+ /**
+ * Message type `prompt`
+ *
+ * @var string
+ */
const MESSAGE_TYPE_PROMPT = 'prompt';
/**
* Declare content type header
* Validate current application
+ *
+ * @return void
*/
public function preDispatch()
{
@@ -56,6 +85,14 @@ public function preDispatch()
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
return;
}
+ /**
+ * Check is website offline
+ */
+ if ((int)Mage::getStoreConfig('general/restriction/is_active') && (int)Mage::getStoreConfig('general/restriction/mode') == 0) {
+ $this->_message(Mage::helper('xmlconnect')->__('Website is offline.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->setFlag('', self::FLAG_NO_DISPATCH, true);
+ return;
+ }
$appModel = Mage::getModel('xmlconnect/application')->loadByCode($appCode);
$appModel->setScreenSize($screenSize);
if ($appModel && $appModel->getId()) {
@@ -71,6 +108,8 @@ public function preDispatch()
/**
* Validate response body
+ *
+ * @return void
*/
public function postDispatch()
{
@@ -91,6 +130,7 @@ public function postDispatch()
* @param string $status
* @param string $type
* @param string $action
+ * @return void
*/
protected function _message($text, $status, $type='', $action='')
{
diff --git a/app/code/core/Mage/XmlConnect/Helper/Android.php b/app/code/core/Mage/XmlConnect/Helper/Android.php
new file mode 100755
index 0000000000..e70d94742c
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Helper/Android.php
@@ -0,0 +1,406 @@
+_tabs)) {
+ $this->_tabs = array(
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Home'),
+ 'image' => 'tab_home_android.png',
+ 'action' => 'Home',
+ 'menu' => self::TAGS_ID_FOR_TITLE_BAR,
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Search'),
+ 'image' => 'tab_search_android.png',
+ 'action' => 'Search',
+ 'menu' => self::TAGS_ID_FOR_TITLE_BAR,
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Account'),
+ 'image' => 'tab_account_android.png',
+ 'action' => 'Account',
+ 'menu' => self::TAGS_ID_FOR_TITLE_BAR,
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Shop'),
+ 'image' => 'tab_shop_android.png',
+ 'action' => 'Shop',
+ 'menu' => self::TAGS_ID_FOR_OPTION_MENU,
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Cart'),
+ 'image' => 'tab_cart_android.png',
+ 'action' => 'Cart',
+ 'menu' => self::TAGS_ID_FOR_OPTION_MENU,
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('More Info'),
+ 'image' => 'tab_info_android.png',
+ 'action' => 'AboutUs',
+ 'menu' => self::TAGS_ID_FOR_OPTION_MENU,
+ ),
+ );
+ }
+ return $this->_tabs;
+ }
+
+ /**
+ * Default application configuration
+ *
+ * @return array
+ */
+ public function getDefaultConfiguration()
+ {
+ return array(
+ 'native' => array(
+ 'body' => array(
+ 'backgroundColor' => '#ABABAB',
+ 'scrollBackgroundColor' => '#EDEDED',
+ ),
+ 'itemActions' => array(
+ 'relatedProductBackgroundColor' => '#404040',
+ ),
+ 'fonts' => array(
+ 'Title1' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '14',
+ 'color' => '#FEFEFE',
+ ),
+ 'Title2' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '12',
+ 'color' => '#222222',
+ ),
+ 'Title3' => array(
+ 'name' => 'HelveticaNeue',
+ 'size' => '13',
+ 'color' => '#000000',
+ ),
+ 'Title4' => array(
+ 'name' => 'HelveticaNeue',
+ 'size' => '12',
+ 'color' => '#FFFFFF',
+ ),
+ 'Title5' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '13',
+ 'color' => '#dc5f02',
+ ),
+ 'Title6' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '16',
+ 'color' => '#222222',
+ ),
+ 'Title7' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '13',
+ 'color' => '#000000',
+ ),
+ 'Title8' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '11',
+ 'color' => '#FFFFFF',
+ ),
+ 'Title9' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '12',
+ 'color' => '#FFFFFF',
+ ),
+ 'Text1' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '12',
+ 'color' => '#777777',
+ ),
+ 'Text2' => array(
+ 'name' => 'HelveticaNeue',
+ 'size' => '10',
+ 'color' => '#555555',
+ ),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * List of allowed fonts for Android application
+ *
+ * @return array
+ */
+ public function getFontList()
+ {
+ return array(
+ array(
+ 'value' => 'HiraKakuProN-W3',
+ 'label' => 'HiraKakuProN-W3',
+ ),
+ array(
+ 'value' => 'Courier',
+ 'label' => 'Courier',
+ ),
+ array(
+ 'value' => 'Courier-BoldOblique',
+ 'label' => 'Courier-BoldOblique',
+ ),
+ array(
+ 'value' => 'Courier-Oblique',
+ 'label' => 'Courier-Oblique',
+ ),
+ array(
+ 'value' => 'Courier-Bold',
+ 'label' => 'Courier-Bold',
+ ),
+ array(
+ 'value' => 'ArialMT',
+ 'label' => 'ArialMT',
+ ),
+ array(
+ 'value' => 'Arial-BoldMT',
+ 'label' => 'Arial-BoldMT',
+ ),
+ array(
+ 'value' => 'Arial-BoldItalicMT',
+ 'label' => 'Arial-BoldItalicMT',
+ ),
+ array(
+ 'value' => 'Arial-ItalicMT',
+ 'label' => 'Arial-ItalicMT',
+ ),
+ array(
+ 'value' => 'STHeitiTC-Light',
+ 'label' => 'STHeitiTC-Light',
+ ),
+ array(
+ 'value' => 'STHeitiTC-Medium',
+ 'label' => 'STHeitiTC-Medium',
+ ),
+ array(
+ 'value' => 'AppleGothic',
+ 'label' => 'AppleGothic',
+ ),
+ array(
+ 'value' => 'CourierNewPS-BoldMT',
+ 'label' => 'CourierNewPS-BoldMT',
+ ),
+ array(
+ 'value' => 'CourierNewPS-ItalicMT',
+ 'label' => 'CourierNewPS-ItalicMT',
+ ),
+ array(
+ 'value' => 'CourierNewPS-BoldItalicMT',
+ 'label' => 'CourierNewPS-BoldItalicMT',
+ ),
+ array(
+ 'value' => 'CourierNewPSMT',
+ 'label' => 'CourierNewPSMT',
+ ),
+ array(
+ 'value' => 'Zapfino',
+ 'label' => 'Zapfino',
+ ),
+ array(
+ 'value' => 'HiraKakuProN-W6',
+ 'label' => 'HiraKakuProN-W6',
+ ),
+ array(
+ 'value' => 'ArialUnicodeMS',
+ 'label' => 'ArialUnicodeMS',
+ ),
+ array(
+ 'value' => 'STHeitiSC-Medium',
+ 'label' => 'STHeitiSC-Medium',
+ ),
+ array(
+ 'value' => 'STHeitiSC-Light',
+ 'label' => 'STHeitiSC-Light',
+ ),
+ array(
+ 'value' => 'AmericanTypewriter',
+ 'label' => 'AmericanTypewriter',
+ ),
+ array(
+ 'value' => 'AmericanTypewriter-Bold',
+ 'label' => 'AmericanTypewriter-Bold',
+ ),
+ array(
+ 'value' => 'Helvetica-Oblique',
+ 'label' => 'Helvetica-Oblique',
+ ),
+ array(
+ 'value' => 'Helvetica-BoldOblique',
+ 'label' => 'Helvetica-BoldOblique',
+ ),
+ array(
+ 'value' => 'Helvetica',
+ 'label' => 'Helvetica',
+ ),
+ array(
+ 'value' => 'Helvetica-Bold',
+ 'label' => 'Helvetica-Bold',
+ ),
+ array(
+ 'value' => 'MarkerFelt-Thin',
+ 'label' => 'MarkerFelt-Thin',
+ ),
+ array(
+ 'value' => 'HelveticaNeue',
+ 'label' => 'HelveticaNeue',
+ ),
+ array(
+ 'value' => 'HelveticaNeue-Bold',
+ 'label' => 'HelveticaNeue-Bold',
+ ),
+ array(
+ 'value' => 'DBLCDTempBlack',
+ 'label' => 'DBLCDTempBlack',
+ ),
+ array(
+ 'value' => 'Verdana-Bold',
+ 'label' => 'Verdana-Bold',
+ ),
+ array(
+ 'value' => 'Verdana-BoldItalic',
+ 'label' => 'Verdana-BoldItalic',
+ ),
+ array(
+ 'value' => 'Verdana',
+ 'label' => 'Verdana',
+ ),
+ array(
+ 'value' => 'Verdana-Italic',
+ 'label' => 'Verdana-Italic',
+ ),
+ array(
+ 'value' => 'TimesNewRomanPSMT',
+ 'label' => 'TimesNewRomanPSMT',
+ ),
+ array(
+ 'value' => 'TimesNewRomanPS-BoldMT',
+ 'label' => 'TimesNewRomanPS-BoldMT',
+ ),
+ array(
+ 'value' => 'TimesNewRomanPS-BoldItalicMT',
+ 'label' => 'TimesNewRomanPS-BoldItalicMT',
+ ),
+ array(
+ 'value' => 'TimesNewRomanPS-ItalicMT',
+ 'label' => 'TimesNewRomanPS-ItalicMT',
+ ),
+ array(
+ 'value' => 'Georgia-Bold',
+ 'label' => 'Georgia-Bold',
+ ),
+ array(
+ 'value' => 'Georgia',
+ 'label' => 'Georgia',
+ ),
+ array(
+ 'value' => 'Georgia-BoldItalic',
+ 'label' => 'Georgia-BoldItalic',
+ ),
+ array(
+ 'value' => 'Georgia-Italic',
+ 'label' => 'Georgia-Italic',
+ ),
+ array(
+ 'value' => 'STHeitiJ-Medium',
+ 'label' => 'STHeitiJ-Medium',
+ ),
+ array(
+ 'value' => 'STHeitiJ-Light',
+ 'label' => 'STHeitiJ-Light',
+ ),
+ array(
+ 'value' => 'ArialRoundedMTBold',
+ 'label' => 'ArialRoundedMTBold',
+ ),
+ array(
+ 'value' => 'TrebuchetMS-Italic',
+ 'label' => 'TrebuchetMS-Italic',
+ ),
+ array(
+ 'value' => 'TrebuchetMS',
+ 'label' => 'TrebuchetMS',
+ ),
+ array(
+ 'value' => 'Trebuchet-BoldItalic',
+ 'label' => 'Trebuchet-BoldItalic',
+ ),
+ array(
+ 'value' => 'TrebuchetMS-Bold',
+ 'label' => 'TrebuchetMS-Bold',
+ ),
+ array(
+ 'value' => 'STHeitiK-Medium',
+ 'label' => 'STHeitiK-Medium',
+ ),
+ array(
+ 'value' => 'STHeitiK-Light',
+ 'label' => 'STHeitiK-Light',
+ ),
+ );
+ }
+
+ /**
+ * List of allowed font sizes for Android application
+ *
+ * @return array
+ */
+ public function getFontSizes()
+ {
+ $result = array( );
+ for ($i = 6; $i < 32; $i++) {
+ $result[] = array(
+ 'value' => $i,
+ 'label' => $i . ' pt',
+ );
+ }
+ return $result;
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php b/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php
index 0ff82fcd65..193d20de8b 100644
--- a/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php
+++ b/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php
@@ -27,11 +27,10 @@
/**
* Catalog image helper
*
- * @author Magento Core Team
+ * @author Magento Core Team
*/
class Mage_XmlConnect_Helper_Catalog_Category_Image extends Mage_Catalog_Helper_Image
{
-
/**
* Init
*
@@ -90,6 +89,4 @@ public function getPlaceholder()
}
return $this->_placeholder;
}
-
-
}
diff --git a/app/code/core/Mage/XmlConnect/Helper/Data.php b/app/code/core/Mage/XmlConnect/Helper/Data.php
index 43099e1779..d51172d1da 100644
--- a/app/code/core/Mage/XmlConnect/Helper/Data.php
+++ b/app/code/core/Mage/XmlConnect/Helper/Data.php
@@ -26,6 +26,120 @@
class Mage_XmlConnect_Helper_Data extends Mage_Core_Helper_Abstract
{
+ /**
+ * Push title length
+ *
+ * @var int
+ */
+ const PUSH_TITLE_LENGTH = 140;
+
+ /**
+ * Message title length
+ *
+ * @var int
+ */
+ const MESSAGE_TITLE_LENGTH = 255;
+
+ protected $_excludedXmlConfigKeys = array(
+ 'notifications/applicationMasterSecret',
+ );
+
+ /**
+ * Application names array
+ *
+ * @var array
+ */
+ protected $_appNames = array();
+
+ /**
+ * Template names array
+ *
+ * @var array
+ */
+ protected $_tplNames = array();
+
+ /**
+ * XML path to nodes to be excluded
+ *
+ * @var string
+ */
+ const XML_NODE_CONFIG_EXCLUDE_FROM_XML = 'xmlconnect/mobile_application/nodes_excluded_from_config_xml';
+
+ /**
+ * Default device type
+ *
+ * @var string
+ */
+ const DEVICE_TYPE_DEFAULT = 'unknown';
+
+ /**
+ * iPhone device identifier
+ *
+ * @var string
+ */
+ const DEVICE_TYPE_IPHONE = 'iphone';
+
+ /**
+ * iPad device identifier
+ *
+ * @var string
+ */
+ const DEVICE_TYPE_IPAD = 'ipad';
+
+ /**
+ * Android device identifier
+ *
+ * @var string
+ */
+ const DEVICE_TYPE_ANDROID = 'android';
+
+ /**
+ * Get device helper
+ *
+ * @throws Mage_Core_Exception
+ * @param Mage_XmlConnect_Model_Application $application
+ * @return Mage_Core_Helper_Abstract
+ */
+ public function getDeviceHelper($application = null)
+ {
+ $deviceType = null;
+ if (empty($application)) {
+ $deviceType = (string) $this->getApplication()->getType();
+ } elseif ($application instanceof Mage_XmlConnect_Model_Application) {
+ $deviceType = (string) $application->getType();
+ }
+ if (empty($deviceType)) {
+ $deviceType = self::DEVICE_TYPE_DEFAULT;
+ }
+ switch ($deviceType) {
+ case self::DEVICE_TYPE_IPHONE:
+ case self::DEVICE_TYPE_IPAD:
+ case self::DEVICE_TYPE_ANDROID:
+ $helper = Mage::helper('xmlconnect/' . $deviceType);
+ break;
+ default:
+ Mage::throwException(Mage::helper('xmlconnect')->__('Device doesn\'t recognized: "%s". Unable to load a helper.', $deviceType));
+ break;
+ }
+ return $helper;
+ }
+
+ /**
+ * Getter for current loaded application model
+ *
+ * @throws Mage_Core_Exception
+ * @return Mage_XmlConnect_Model_Application
+ */
+ public function getApplication()
+ {
+ $model = Mage::registry('current_app');
+ if (!($model instanceof Mage_XmlConnect_Model_Application)) {
+ Mage::throwException(Mage::helper('xmlconnect')->__('App model not loaded.'));
+ }
+
+ return $model;
+ }
+
/**
* Create filter object by key
*
@@ -97,7 +211,9 @@ public function getCountryOptionsArray()
static public function getSupportedDevices()
{
$devices = array (
- 'iphone' => Mage::helper('xmlconnect')->__('iPhone')
+ self::DEVICE_TYPE_IPAD => Mage::helper('xmlconnect')->__('iPad'),
+ self::DEVICE_TYPE_IPHONE => Mage::helper('xmlconnect')->__('iPhone'),
+ self::DEVICE_TYPE_ANDROID => Mage::helper('xmlconnect')->__('Android')
);
return $devices;
@@ -138,55 +254,17 @@ public function getDeviceTypeOptions()
/**
* Get default application tabs
*
+ * @param string
* @return array
*/
public function getDefaultApplicationDesignTabs()
{
- if (!isset($this->_tabs)) {
- $this->_tabs = array(
- array(
- 'label' => Mage::helper('xmlconnect')->__('Home'),
- 'image' => 'tab_home.png',
- 'action' => 'Home',
- ),
- array(
- 'label' => Mage::helper('xmlconnect')->__('Shop'),
- 'image' => 'tab_shop.png',
- 'action' => 'Shop',
- ),
- array(
- 'label' => Mage::helper('xmlconnect')->__('Search'),
- 'image' => 'tab_search.png',
- 'action' => 'Search',
- ),
- array(
- 'label' => Mage::helper('xmlconnect')->__('Cart'),
- 'image' => 'tab_cart.png',
- 'action' => 'Cart',
- ),
- array(
- 'label' => Mage::helper('xmlconnect')->__('More'),
- 'image' => 'tab_more.png',
- 'action' => 'More',
- ),
- array(
- 'label' => Mage::helper('xmlconnect')->__('Account'),
- 'image' => 'tab_account.png',
- 'action' => 'Account',
- ),
- array(
- 'label' => Mage::helper('xmlconnect')->__('More Info'),
- 'image' => 'tab_page.png',
- 'action' => 'AboutUs',
- ),
- );
- }
- return $this->_tabs;
+ return $this->getDeviceHelper()->getDefaultDesignTabs();
}
/**
* Return array for tabs like label -> action array
- *
+ *
* @return array
*/
protected function _getTabLabelActionArray()
@@ -202,7 +280,7 @@ protected function _getTabLabelActionArray()
/**
* Return Translated tab label for given $action
- *
+ *
* @param string $action
* @return string|bool
*/
@@ -215,7 +293,7 @@ public function getTabLabel($action)
/**
* Merges $changes array to $target array recursive, overwriting existing key, and adding new one
- *
+ *
* @param mixed $target
* @param mixed $changes
* @return array
@@ -256,6 +334,7 @@ static public function arrayMergeRecursive($target, $changes)
public function htmlize($body)
{
return << Mage::helper('xmlconnect')->__('Push message'),
+ Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL => Mage::helper('xmlconnect')->__('AirMail message'),
+ );
+
+ return $messages;
+ }
+
+ /**
+ * Retrieve supported message types as "html select options"
+ *
+ * @return array
+ */
+ public function getMessageTypeOptions()
+ {
+ $options = array();
+ $messages = self::getSupportedMessageTypes();
+ foreach ($messages as $type => $label) {
+ $options[] = array('value' => $type, 'label' => $label);
+ }
+ return $options;
+ }
+
+ /**
+ * Get push title length
+ *
+ * @return int
+ */
+ public function getPushTitleLength()
+ {
+ return self::PUSH_TITLE_LENGTH;
+ }
+
+ /**
+ * Get message title length
+ *
+ * @return int
+ */
+ public function getMessageTitleLength()
+ {
+ return self::MESSAGE_TITLE_LENGTH;
+ }
+
+ /**
+ * Retrieve applications as "html select options"
+ *
+ * @return array
+ */
+ public function getApplicationOptions()
+ {
+ $options = array();
+ foreach (Mage::getModel('xmlconnect/application')->getCollection() as $app) {
+ if (self::isTemplateAllowedForApplication($app)) {
+ $options[] = array('value' => $app->getCode(), 'label' => $app->getName());
+ }
+ }
+ if (count($options) > 1) {
+ $options[] = array('value' => '', 'label' => Mage::helper('xmlconnect')->__('Please Select Application'));
+ }
+ return $options;
+ }
+
+ /**
+ * Get applications array like `code` as `name`
+ *
+ * @param
+ * @staticvar array $apps
+ * @return array
+ */
+ public function getApplications()
+ {
+ static $apps = array();
+
+ if (empty($apps)) {
+ foreach (Mage::getModel('xmlconnect/application')->getCollection() as $app) {
+ $apps[$app->getCode()] = $app->getName();
+ }
+ }
+ return $apps;
+ }
+
+ /**
+ * Check if creating AirMail template for the application is allowed
+ *
+ * @param Mage_XmlConnect_Model_Application $application
+ * @return boolean
+ */
+ public static function isTemplateAllowedForApplication($application = null)
+ {
+ return $application instanceof Mage_XmlConnect_Model_Application ?
+ in_array($application->getType(), array(self::DEVICE_TYPE_IPHONE)) :
+ false;
+ }
+
+ /**
+ * Send broadcast message
+ *
+ * @param Mage_XmlConnect_Model_Queue $queue
+ */
+ public function sendBroadcastMessage(Mage_XmlConnect_Model_Queue $queue)
+ {
+ if ($queue->getStatus() != Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE) {
+ return;
+ }
+
+ try {
+ $appCode = $queue->getAppCode();
+ $app = Mage::getModel('xmlconnect/application')->load($appCode, 'code');
+
+ if (!$app->getId()) {
+ Mage::throwException(Mage::helper('xmlconnect')->__('Can\'t load application with code "%s"', $appCode));
+ }
+
+ $userpwd = $app->getUserpwd();
+
+ $sendType = $queue->getData('type');
+ switch ($sendType) {
+ case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL:
+ $broadcastUrl = Mage::getStoreConfig('xmlconnect/' . Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL . '/broadcast_url');
+ $params = $queue->getAirmailBroadcastParams();
+ break;
+
+ case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_PUSH:
+ default:
+ $broadcastUrl = Mage::getStoreConfig('xmlconnect/' . Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_PUSH . '/broadcast_url');
+ $params = $queue->getPushBroadcastParams();
+ break;
+ }
+
+ $ch = curl_init($broadcastUrl);
+
+ $httpHeaders = $this->getHttpHeaders();
+
+ curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeaders);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_USERPWD, $userpwd);
+ curl_setopt($ch, CURLOPT_TIMEOUT, 60);
+
+ // Execute the request.
+ $result = curl_exec($ch);
+ $succeeded = curl_errno($ch) == 0 ? true : false;
+
+ // close cURL resource, and free up system resources
+ curl_close($ch);
+
+ if ($succeeded && (is_null($result) || strtolower($result) == 'null')) {
+ $queue->setStatus(Mage_XmlConnect_Model_Queue::STATUS_COMPLETED);
+ }
+ $queue->setIsSent(true);
+
+ return;
+ } catch (Exception $e) {
+ Mage::logException($e);
+ throw $e;
+ }
+ }
+
+ /**
+ * Get headers for broadcast message
+ *
+ * @return string
+ */
+ public function getHttpHeaders()
+ {
+ $httpHeaders = array('Content-Type: application/json');
+ return $httpHeaders;
+ }
+
+ /**
+ * Remove from array the unnecessary parameters by given keys
+ *
+ * @param array $data Source array
+ * @param array $excludedKeys Keys to be excluded from array. Keys must be in xPath notation
+ * @return array
+ */
+ public function excludeXmlConfigKeys($data, $excludedKeys = array())
+ {
+ $excludedKeys = $this->getExcludedXmlConfigKeys();
+ if (!empty($excludedKeys)) {
+ foreach ($excludedKeys as $keyToExclude) {
+ if (strpos($keyToExclude, '/')) {
+ $keys = array();
+ foreach (explode('/', $keyToExclude) as $key) {
+ $key = trim($key);
+ if (!empty($key)) {
+ $keys[] = $key;
+ }
+ }
+ if (!empty($keys)) {
+ $keys = '$data["' . implode('"]["', $keys) . '"]';
+ eval('if (isset(' . $keys . ')) unset(' . $keys . ');');
+ }
+ } elseif (!empty($keyToExclude) && isset($data[$keyToExclude])) {
+ unset($data[$keyToExclude]);
+ }
+ }
+ }
+ return $data;
+ }
+
+ /**
+ * Get excluded keys as array
+ *
+ * @return array
+ */
+ public function getExcludedXmlConfigKeys()
+ {
+ $toExclude = Mage::getStoreConfig(self::XML_NODE_CONFIG_EXCLUDE_FROM_XML);
+ $nodes = array();
+ foreach ($toExclude as $value) {
+ $nodes[] = trim($value, '/');
+ }
+
+ return $nodes;
+ }
+
+ /**
+ * Returns Application name by it's code
+ * @param string $appCode
+ * @return string
+ */
+ public function getApplicationName($appCode = null)
+ {
+ if (empty($appCode)) {
+ return '';
+ }
+ if (!isset($this->_appNames[$appCode])) {
+ $app = Mage::getModel('xmlconnect/application')->loadByCode($appCode);
+ if ($app->getId()) {
+ $this->_appNames[$appCode] = $app->getName();
+ } else {
+ return '';
+ }
+ }
+ return $this->_appNames[$appCode];
+ }
+
+ /**
+ * Returns Application name by it's code
+ * @param string $appCode
+ * @return string
+ */
+ public function getTemplateName($templateId = null)
+ {
+ if (empty($templateId)) {
+ return '';
+ }
+ if (!isset($this->_tplNames[$templateId])) {
+ $template = Mage::getModel('xmlconnect/template')->load($templateId);
+ if ($template->getId()) {
+ $this->_tplNames[$templateId] = $template->getName();
+ } else {
+ return '';
+ }
+ }
+ return $this->_tplNames[$templateId];
+ }
+
+ /**
+ * Set value into multidimensional array 'conf/native/navigationBar/icon'
+ *
+ * @param &array $target // pointer to target array
+ * @param string $fieldPath // 'conf/native/navigationBar/icon'
+ * @param mixed $fieldValue // 'Some Value' || 12345 || array(1=>3, 'aa'=>43)
+ * @param string $delimiter // path delimiter
+ * @return null
+ */
+ public function _injectFieldToArray(&$target, $fieldPath, $fieldValue, $delimiter = '/')
+ {
+ $nameParts = explode($delimiter, $fieldPath);
+ foreach ($nameParts as $next) {
+ if (!isset($target[$next])) {
+ $target[$next] = array();
+ }
+ $target =& $target[$next];
+ }
+ $target = $fieldValue;
+ return null;
+ }
+
+ /**
+ * Convert Url link to file path for images
+ *
+ * @param string $icon
+ * @return string
+ */
+ public function urlToPath($icon)
+ {
+ $baseUrl = Mage::getBaseUrl('media');
+ $path = str_replace($baseUrl, '', $icon);
+ $filePath = Mage::getBaseDir('media') . DS . str_replace('/', DS, $path);
+ return $filePath;
+
+ }
+
+ /**
+ * Validate config body field is not empty
+ *
+ * @param string $field
+ * @param array $native
+ * @return bool
+ */
+ public function validateConfFieldNotEmpty($field, $native)
+ {
+ if ( ($native === false)
+ || (!isset($native['body']) || !is_array($native['body'])
+ || !isset($native['body'][$field])
+ || !Zend_Validate::is($native['body'][$field], 'NotEmpty'))) {
+ return false;
+ }
+ return true;
+ }
}
diff --git a/app/code/core/Mage/XmlConnect/Helper/Image.php b/app/code/core/Mage/XmlConnect/Helper/Image.php
index f182f4c19f..71a5c34636 100644
--- a/app/code/core/Mage/XmlConnect/Helper/Image.php
+++ b/app/code/core/Mage/XmlConnect/Helper/Image.php
@@ -105,7 +105,7 @@ public function handleUpload($field, &$target)
*/
protected function _getScreenSize()
{
- return Mage::registry('current_app')->getScreenSize();
+ return Mage::registry('current_app')->getScreenSize();
}
/**
@@ -201,7 +201,6 @@ protected function _handleResize($fieldPath, $file)
$image->keepFrame(true);
$image->keepAspectRatio(true);
$image->backgroundColor(array(255, 255, 255));
-// $image->keepAspectRatio(false);
$image->resize($width, $height);
$image->save(null, basename($file));
}
@@ -216,7 +215,7 @@ protected function _forcedConvertPng($field)
{
$file =& $_FILES[$field];
- $file['name'] = preg_replace('/\.(gif|jp[e]g)$/i', '.png', $file['name']);
+ $file['name'] = preg_replace('/\.(gif|jpeg|jpg)$/i', '.png', $file['name']);
list($x, $x, $fileType) = getimagesize($file['tmp_name']);
if ($fileType != IMAGETYPE_PNG ) {
@@ -283,11 +282,11 @@ public function getFileCustomDirSuffixAsUrl($confPath, $fileName)
/**
* Return correct size for given $imageName and device screen_size
- *
+ *
* @param string $imageName
* @return int
*/
- public function getImageSizeForContent($imageName)
+ public function getImageSizeForContent($imageName)
{
$size = 0;
if (!isset($this->_content)) {
@@ -303,13 +302,13 @@ public function getImageSizeForContent($imageName)
}
}
}
- $size = isset($this->_content[$imageName]) ? (int) $this->_content[$imageName] : 0;
+ $size = isset($this->_content[$imageName]) ? (int) $this->_content[$imageName] : 0;
return $size;
}
/**
* Return setting for interface images (image size limits)
- *
+ *
* @return array
*/
public function getInterfaceImageLimits()
@@ -344,6 +343,45 @@ public function getImageSizeForInterface($imagePath)
return $size;
}
+ /**
+ * Retrieve thumbnail image url
+ *
+ * @param int $width
+ * @return string|null
+ */
+ public function getCustomSizeImageUrl($imagePath, $width = 100, $height = 100)
+ {
+ $customDirRoot = Mage::getBaseDir('media') . DS . 'xmlconnect' . DS . 'custom';
+ $screenSize = $width . 'x' . $height;
+ $customDir = $customDirRoot . DS . $screenSize;
+ $this->_verifyDirExist($customDir);
+ $file = Mage::helper('xmlconnect')->getApplication()->getData($imagePath);
+
+ if (!file_exists($customDir . basename($file))) {
+ $image = new Varien_Image($file);
+ $widthOriginal = $image->getOriginalWidth();
+ $heightOriginal = $image->getOriginalHeight();
+
+ if ($width != $widthOriginal) {
+ $widthOriginal = $width;
+ }
+
+ if ($height != $heightOriginal) {
+ $heightOriginal = $height;
+ }
+
+ if (($widthOriginal != $image->getOriginalWidth()) ||
+ ($heightOriginal != $image->getOriginalHeight()) ) {
+ $image->keepTransparency(true);
+ $image->keepFrame(true);
+ $image->keepAspectRatio(true);
+ $image->backgroundColor(array(255, 255, 255));
+ $image->resize($widthOriginal, $heightOriginal);
+ $image->save($customDir, basename($file));
+ }
+ }
+ return Mage::getBaseUrl('media') . "xmlconnect/custom/{$screenSize}/" . basename($file);
+ }
/**
* Ensure correct $screenSize value
@@ -353,7 +391,6 @@ public function getImageSizeForInterface($imagePath)
*/
public function filterScreenSize($screenSize)
{
-
$screenSize = preg_replace('/[^0-9A-z_]/', '', $screenSize);
if (isset($this->_imageLimits[$screenSize])) {
return $screenSize;
@@ -379,14 +416,14 @@ public function filterScreenSize($screenSize)
if (!empty($source)) {
$screenSize = $resolution . (empty($version) ? '' : self::XMLCONNECT_GLUE.$version);
} else {
- $screenSize = Mage_XmlConnect_Model_Application::APP_SCREEN_SIZE_DEFAULT;
+ $screenSize = Mage_XmlConnect_Model_Application::APP_SCREEN_SIZE_DEFAULT;
}
return $screenSize;
}
/**
* Return correct size array for given device screen_size(320x480/640x960_a)
- *
+ *
* @param string $screenSize
* @return array
*/
@@ -473,13 +510,13 @@ public function getImageLimits($screenSize = Mage_XmlConnect_Model_Application::
$imageLimits = array();
}
- $this->_imageLimits[$screenSize] = $imageLimits;
+ $this->_imageLimits[$screenSize] = $imageLimits;
return $imageLimits;
}
/**
* Return reference to the $path in $array
- *
+ *
* @param array $array
* @param string $path
* @return &mixed //(reference)
@@ -546,7 +583,7 @@ public function getCustomSizeUploadDir($screenSize)
/**
* Return originalSizeUploadDir path
- *
+ *
* @return string
*/
public function getOriginalSizeUploadDir()
@@ -558,7 +595,7 @@ public function getOriginalSizeUploadDir()
/**
* Return oldUpload dir path (media/xmlconnect)
- *
+ *
* @return string
*/
public function getOldUploadDir()
@@ -570,7 +607,7 @@ public function getOldUploadDir()
/**
* Return default size upload dir path
- *
+ *
* @return string
*/
public function getDefaultSizeUploadDir()
@@ -608,7 +645,12 @@ public function getInterfaceImagesPaths($imagePath = null)
$paths = array (
'conf/native/navigationBar/icon' => 'smallIcon_1_6.png',
'conf/native/body/bannerImage' => 'banner_1_2.png',
+ 'conf/native/body/bannerImageIpad' => 'banner_ipad.png',
+ 'conf/native/body/bannerImageAndroid' => 'banner_android.png',
'conf/native/body/backgroundImage' => 'accordion_open.png',
+ 'conf/native/body/backgroundImageIpadLandscape' => 'accordion_open_ipad_l.png',
+ 'conf/native/body/backgroundImageIpadPortret' => 'accordion_open_ipad_p.png',
+ 'conf/native/body/backgroundImageAndroid' => 'accordion_open_android.png',
);
if ($imagePath == null) {
return $paths;
@@ -618,5 +660,4 @@ public function getInterfaceImagesPaths($imagePath = null)
return null;
}
}
-
}
diff --git a/app/code/core/Mage/XmlConnect/Helper/Ipad.php b/app/code/core/Mage/XmlConnect/Helper/Ipad.php
new file mode 100755
index 0000000000..fbe46b1d4b
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Helper/Ipad.php
@@ -0,0 +1,442 @@
+_tabs)) {
+ $this->_tabs = array(
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Home'),
+ 'image' => 'tab_home.png',
+ 'action' => 'Home',
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Shop'),
+ 'image' => 'tab_shop.png',
+ 'action' => 'Shop',
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Search'),
+ 'image' => 'tab_search.png',
+ 'action' => 'Search',
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Cart'),
+ 'image' => 'tab_cart.png',
+ 'action' => 'Cart',
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Account'),
+ 'image' => 'tab_account_ipad.png',
+ 'action' => 'Account',
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('More Info'),
+ 'image' => 'tab_page.png',
+ 'action' => 'AboutUs',
+ ),
+ );
+ }
+ return $this->_tabs;
+ }
+
+ /**
+ * Default application configuration
+ *
+ * @return array
+ */
+ public function getDefaultConfiguration()
+ {
+ return array(
+ 'native' => array(
+ 'body' => array(
+ 'backgroundColor' => '#ABABAB',
+ 'scrollBackgroundColor' => '#EDEDED',
+ ),
+ 'itemActions' => array(
+ 'relatedProductBackgroundColor' => '#404040',
+ ),
+ 'fonts' => array(
+ 'Title1' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '14',
+ 'color' => '#FEFEFE',
+ ),
+ 'Title2' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '12',
+ 'color' => '#222222',
+ ),
+ 'Title3' => array(
+ 'name' => 'HelveticaNeue',
+ 'size' => '23',
+ 'color' => '#000000',
+ ),
+ 'Title4' => array(
+ 'name' => 'HelveticaNeue',
+ 'size' => '12',
+ 'color' => '#FFFFFF',
+ ),
+ 'Title5' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '13',
+ 'color' => '#dc5f02',
+ ),
+ 'Title6' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '16',
+ 'color' => '#222222',
+ ),
+ 'Title7' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '13',
+ 'color' => '#000000',
+ ),
+ 'Title8' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '11',
+ 'color' => '#FFFFFF',
+ ),
+ 'Title9' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '12',
+ 'color' => '#FFFFFF',
+ ),
+ 'Text1' => array(
+ 'name' => 'HelveticaNeue-Bold',
+ 'size' => '12',
+ 'color' => '#777777',
+ ),
+ 'Text2' => array(
+ 'name' => 'HelveticaNeue',
+ 'size' => '10',
+ 'color' => '#555555',
+ ),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * List of allowed fonts for iPad application
+ *
+ * @return array
+ */
+ public function getFontList()
+ {
+ return array(
+ array(
+ 'value' => 'HiraKakuProN-W3',
+ 'label' => 'HiraKakuProN-W3',
+ ),
+ array(
+ 'value' => 'Courier',
+ 'label' => 'Courier',
+ ),
+ array(
+ 'value' => 'Courier-BoldOblique',
+ 'label' => 'Courier-BoldOblique',
+ ),
+ array(
+ 'value' => 'Courier-Oblique',
+ 'label' => 'Courier-Oblique',
+ ),
+ array(
+ 'value' => 'Courier-Bold',
+ 'label' => 'Courier-Bold',
+ ),
+ array(
+ 'value' => 'ArialMT',
+ 'label' => 'ArialMT',
+ ),
+ array(
+ 'value' => 'Arial-BoldMT',
+ 'label' => 'Arial-BoldMT',
+ ),
+ array(
+ 'value' => 'Arial-BoldItalicMT',
+ 'label' => 'Arial-BoldItalicMT',
+ ),
+ array(
+ 'value' => 'Arial-ItalicMT',
+ 'label' => 'Arial-ItalicMT',
+ ),
+ array(
+ 'value' => 'STHeitiTC-Light',
+ 'label' => 'STHeitiTC-Light',
+ ),
+ array(
+ 'value' => 'STHeitiTC-Medium',
+ 'label' => 'STHeitiTC-Medium',
+ ),
+ array(
+ 'value' => 'AppleGothic',
+ 'label' => 'AppleGothic',
+ ),
+ array(
+ 'value' => 'CourierNewPS-BoldMT',
+ 'label' => 'CourierNewPS-BoldMT',
+ ),
+ array(
+ 'value' => 'CourierNewPS-ItalicMT',
+ 'label' => 'CourierNewPS-ItalicMT',
+ ),
+ array(
+ 'value' => 'CourierNewPS-BoldItalicMT',
+ 'label' => 'CourierNewPS-BoldItalicMT',
+ ),
+ array(
+ 'value' => 'CourierNewPSMT',
+ 'label' => 'CourierNewPSMT',
+ ),
+ array(
+ 'value' => 'Zapfino',
+ 'label' => 'Zapfino',
+ ),
+ array(
+ 'value' => 'HiraKakuProN-W6',
+ 'label' => 'HiraKakuProN-W6',
+ ),
+ array(
+ 'value' => 'ArialUnicodeMS',
+ 'label' => 'ArialUnicodeMS',
+ ),
+ array(
+ 'value' => 'STHeitiSC-Medium',
+ 'label' => 'STHeitiSC-Medium',
+ ),
+ array(
+ 'value' => 'STHeitiSC-Light',
+ 'label' => 'STHeitiSC-Light',
+ ),
+ array(
+ 'value' => 'AmericanTypewriter',
+ 'label' => 'AmericanTypewriter',
+ ),
+ array(
+ 'value' => 'AmericanTypewriter-Bold',
+ 'label' => 'AmericanTypewriter-Bold',
+ ),
+ array(
+ 'value' => 'Helvetica-Oblique',
+ 'label' => 'Helvetica-Oblique',
+ ),
+ array(
+ 'value' => 'Helvetica-BoldOblique',
+ 'label' => 'Helvetica-BoldOblique',
+ ),
+ array(
+ 'value' => 'Helvetica',
+ 'label' => 'Helvetica',
+ ),
+ array(
+ 'value' => 'Helvetica-Bold',
+ 'label' => 'Helvetica-Bold',
+ ),
+ array(
+ 'value' => 'MarkerFelt-Thin',
+ 'label' => 'MarkerFelt-Thin',
+ ),
+ array(
+ 'value' => 'HelveticaNeue',
+ 'label' => 'HelveticaNeue',
+ ),
+ array(
+ 'value' => 'HelveticaNeue-Bold',
+ 'label' => 'HelveticaNeue-Bold',
+ ),
+ array(
+ 'value' => 'DBLCDTempBlack',
+ 'label' => 'DBLCDTempBlack',
+ ),
+ array(
+ 'value' => 'Verdana-Bold',
+ 'label' => 'Verdana-Bold',
+ ),
+ array(
+ 'value' => 'Verdana-BoldItalic',
+ 'label' => 'Verdana-BoldItalic',
+ ),
+ array(
+ 'value' => 'Verdana',
+ 'label' => 'Verdana',
+ ),
+ array(
+ 'value' => 'Verdana-Italic',
+ 'label' => 'Verdana-Italic',
+ ),
+ array(
+ 'value' => 'TimesNewRomanPSMT',
+ 'label' => 'TimesNewRomanPSMT',
+ ),
+ array(
+ 'value' => 'TimesNewRomanPS-BoldMT',
+ 'label' => 'TimesNewRomanPS-BoldMT',
+ ),
+ array(
+ 'value' => 'TimesNewRomanPS-BoldItalicMT',
+ 'label' => 'TimesNewRomanPS-BoldItalicMT',
+ ),
+ array(
+ 'value' => 'TimesNewRomanPS-ItalicMT',
+ 'label' => 'TimesNewRomanPS-ItalicMT',
+ ),
+ array(
+ 'value' => 'Georgia-Bold',
+ 'label' => 'Georgia-Bold',
+ ),
+ array(
+ 'value' => 'Georgia',
+ 'label' => 'Georgia',
+ ),
+ array(
+ 'value' => 'Georgia-BoldItalic',
+ 'label' => 'Georgia-BoldItalic',
+ ),
+ array(
+ 'value' => 'Georgia-Italic',
+ 'label' => 'Georgia-Italic',
+ ),
+ array(
+ 'value' => 'STHeitiJ-Medium',
+ 'label' => 'STHeitiJ-Medium',
+ ),
+ array(
+ 'value' => 'STHeitiJ-Light',
+ 'label' => 'STHeitiJ-Light',
+ ),
+ array(
+ 'value' => 'ArialRoundedMTBold',
+ 'label' => 'ArialRoundedMTBold',
+ ),
+ array(
+ 'value' => 'TrebuchetMS-Italic',
+ 'label' => 'TrebuchetMS-Italic',
+ ),
+ array(
+ 'value' => 'TrebuchetMS',
+ 'label' => 'TrebuchetMS',
+ ),
+ array(
+ 'value' => 'Trebuchet-BoldItalic',
+ 'label' => 'Trebuchet-BoldItalic',
+ ),
+ array(
+ 'value' => 'TrebuchetMS-Bold',
+ 'label' => 'TrebuchetMS-Bold',
+ ),
+ array(
+ 'value' => 'STHeitiK-Medium',
+ 'label' => 'STHeitiK-Medium',
+ ),
+ array(
+ 'value' => 'STHeitiK-Light',
+ 'label' => 'STHeitiK-Light',
+ ),
+ );
+ }
+
+ /**
+ * List of allowed font sizes for iPad application
+ *
+ * @return array
+ */
+ public function getFontSizes()
+ {
+ $result = array( );
+ for ($i = 6; $i < 32; $i++) {
+ $result[] = array(
+ 'value' => $i,
+ 'label' => $i . ' pt',
+ );
+ }
+ return $result;
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Helper/Iphone.php b/app/code/core/Mage/XmlConnect/Helper/Iphone.php
index 1cf20fb9e5..890e9d2ae5 100644
--- a/app/code/core/Mage/XmlConnect/Helper/Iphone.php
+++ b/app/code/core/Mage/XmlConnect/Helper/Iphone.php
@@ -26,6 +26,57 @@
class Mage_XmlConnect_Helper_Iphone extends Mage_Core_Helper_Abstract
{
+
+ /**
+ * Get default application tabs
+ *
+ * @param string
+ * @return array
+ */
+ public function getDefaultDesignTabs()
+ {
+ if (!isset($this->_tabs)) {
+ $this->_tabs = array(
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Home'),
+ 'image' => 'tab_home.png',
+ 'action' => 'Home',
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Shop'),
+ 'image' => 'tab_shop.png',
+ 'action' => 'Shop',
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Search'),
+ 'image' => 'tab_search.png',
+ 'action' => 'Search',
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Cart'),
+ 'image' => 'tab_cart.png',
+ 'action' => 'Cart',
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('More'),
+ 'image' => 'tab_more.png',
+ 'action' => 'More',
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('Account'),
+ 'image' => 'tab_account.png',
+ 'action' => 'Account',
+ ),
+ array(
+ 'label' => Mage::helper('xmlconnect')->__('More Info'),
+ 'image' => 'tab_page.png',
+ 'action' => 'AboutUs',
+ ),
+ );
+ }
+ return $this->_tabs;
+ }
+
/**
* Default application configuration
*
diff --git a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php
index cbebbf51a7..2827d17793 100644
--- a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php
+++ b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php
@@ -24,7 +24,6 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
class Mage_XmlConnect_Model_Adminhtml_System_Config_Backend_Baseurl extends Mage_Adminhtml_Model_System_Config_Backend_Baseurl
{
/**
diff --git a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php
index 36749aa27b..43bad9e22e 100644
--- a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php
+++ b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php
@@ -24,7 +24,6 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
class Mage_XmlConnect_Model_Adminhtml_System_Config_Backend_Currency_Default extends Mage_Adminhtml_Model_System_Config_Backend_Currency_Default
{
/**
diff --git a/app/code/core/Mage/XmlConnect/Model/Application.php b/app/code/core/Mage/XmlConnect/Model/Application.php
index 20d60294a8..50cadfc731 100644
--- a/app/code/core/Mage/XmlConnect/Model/Application.php
+++ b/app/code/core/Mage/XmlConnect/Model/Application.php
@@ -24,7 +24,6 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
/**
* @method Mage_XmlConnect_Model_Mysql4_Application _getResource()
* @method Mage_XmlConnect_Model_Mysql4_Application getResource()
@@ -54,25 +53,31 @@
*/
class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
{
-
/**
* Application code cookie name
+ *
+ * @var string
*/
const APP_CODE_COOKIE_NAME = 'app_code';
/**
* Device screen size name
+ *
+ * @var string
*/
const APP_SCREEN_SIZE_NAME = 'screen_size';
-
/**
* Device screen size name
+ *
+ * @var string
*/
const APP_SCREEN_SIZE_DEFAULT = '320x480';
/**
* Device screen size source name
+ *
+ * @var string
*/
const APP_SCREEN_SOURCE_DEFAULT = 'default';
@@ -104,9 +109,92 @@ class Mage_XmlConnect_Model_Application extends Mage_Core_Model_Abstract
*/
protected $_imageIds = array('icon', 'loader_image', 'logo', 'big_logo');
+ /**
+ * Last submitted data from history table
+ *
+ * @var null|array
+ */
+ protected $_lastParams;
+
+ /**
+ * Application submit info
+ *
+ * @var array
+ */
+ protected $submit_params = array();
+
+ /**
+ * Application submit action type
+ *
+ * @var bool
+ */
+ protected $is_resubmit_action = false;
+
+ /**
+ * Full application code
+ *
+ * @var null|string
+ */
+ protected $code;
+
+ /**
+ * Main configuration of current application
+ *
+ * @var null|array
+ */
+ protected $conf;
+
+ /**
+ * Submission/Resubmission key max length
+ *
+ * @var int
+ */
+ const APP_MAX_KEY_LENGTH = 40;
+
+ /**
+ * XML path to config with an email address
+ * for contact to receive credentials
+ * of Urban Airship notifications
+ *
+ * @var string
+ */
+ const XML_PATH_CONTACT_CREDENTIALS_EMAIL = 'xmlconnect/mobile_application/urbanairship_credentials_email';
+
+ /**
+ * XML path to config with Urban Airship Terms of Service URL
+ *
+ * @var string
+ */
+ const XML_PATH_URBAN_AIRSHIP_TOS_URL = 'xmlconnect/mobile_application/urbanairship_terms_of_service_url';
+
+ /**
+ * XML path to config copyright data
+ *
+ * @var string
+ */
+ const XML_PATH_DESIGN_FOOTER_COPYRIGHT = 'design/footer/copyright';
+
+ /**
+ * XML path to config restriction status
+ * (EE module)
+ *
+ * @var string
+ */
+ const XML_PATH_GENERAL_RESTRICTION_IS_ACTIVE = 'general/restriction/is_active';
+
+ /**
+ * XML path to config restriction mode
+ * (EE module)
+ *
+ * @var string
+ */
+ const XML_PATH_GENERAL_RESTRICTION_MODE = 'general/restriction/mode';
+
/**
* Initialize application
+ *
+ * @return void
*/
protected function _construct()
{
@@ -168,7 +256,7 @@ protected function _flatArray($subtree, $prefix=null)
* @param array $b
* @return array
*/
- protected function _configMerge (array $a, array $b)
+ protected function _configMerge(array $a, array $b)
{
$result = array();
$keys = array_unique(array_merge(array_keys($a), array_keys($b)));
@@ -188,12 +276,13 @@ protected function _configMerge (array $a, array $b)
/**
* Set default configuration data
+ *
+ * @return void
*/
public function loadDefaultConfiguration()
{
- $this->setType('iphone');
$this->setCode($this->getCodePrefix());
- $this->setConf(Mage::helper('xmlconnect/iphone')->getDefaultConfiguration());
+ $this->setConf(Mage::helper('xmlconnect')->getDeviceHelper()->getDefaultConfiguration());
}
/**
@@ -235,7 +324,7 @@ public function prepareConfiguration()
*/
public function getRenderConf()
{
- $result = Mage::helper('xmlconnect/iphone')->getDefaultConfiguration();
+ $result = Mage::helper('xmlconnect')->getDeviceHelper()->getDefaultConfiguration();
$result = $result['native'];
$extra = array();
if (isset($this->_data['conf'])) {
@@ -290,23 +379,29 @@ public function getRenderConf()
$result['general']['updateTimeUTC'] = strtotime($this->getUpdatedAt());
$result['general']['browsingMode'] = $this->getBrowsingMode();
$result['general']['currencyCode'] = Mage::app()->getStore($this->getStoreId())->getDefaultCurrencyCode();
- $result['general']['secureBaseUrl'] = Mage::getStoreConfig('web/secure/base_url', $this->getStoreId());
+ $result['general']['secureBaseUrl'] = Mage::getStoreConfig(Mage_Core_Model_Store::XML_PATH_SECURE_BASE_URL, $this->getStoreId());
$maxRecipients = 0;
$allowGuest = 0;
- if (Mage::getStoreConfig('sendfriend/email/enabled')) {
- $maxRecipients = Mage::getStoreConfig('sendfriend/email/max_recipients');
- $allowGuest = Mage::getStoreConfig('sendfriend/email/allow_guest');
+ if (Mage::getStoreConfig(Mage_Sendfriend_Helper_Data::XML_PATH_ENABLED)) {
+ $maxRecipients = Mage::getStoreConfig(Mage_Sendfriend_Helper_Data::XML_PATH_MAX_RECIPIENTS);
+ $allowGuest = Mage::getStoreConfig(Mage_Sendfriend_Helper_Data::XML_PATH_ALLOW_FOR_GUEST);
}
$result['general']['emailToFriendMaxRecepients'] = $maxRecipients;
$result['general']['emailAllowGuest'] = $allowGuest;
$result['general']['primaryStoreLang'] = Mage::app()
->getStore($this->getStoreId())->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_LOCALE);
$result['general']['magentoVersion'] = Mage::getVersion();
- $result['general']['copyright'] = Mage::getStoreConfig('design/footer/copyright', $this->getStoreId());
+ $result['general']['copyright'] = Mage::getStoreConfig(self::XML_PATH_DESIGN_FOOTER_COPYRIGHT, $this->getStoreId());
$result['general']['isAllowedGuestCheckout'] = Mage::getSingleton('checkout/session')
->getQuote()->isAllowedGuestCheckout();
+ if (!Mage::getStoreConfigFlag('wishlist/general/active')) {
+ $result['general']['wishlistEnable'] = '0';
+ } else {
+ $result['general']['wishlistEnable'] = '1';
+ }
+
/**
* PayPal configuration
*/
@@ -315,10 +410,14 @@ public function getRenderConf()
$isActive = 0;
if (isset($result['paypal']) && isset($result['paypal']['isActive'])) {
- $isActive = (int)($result['paypal']['isActive'] && Mage::getModel('xmlconnect/payment_method_paypal_mep')->isAvailable(null, $this->getStoreId()));
+ $isActive = (int)($result['paypal']['isActive'] && Mage::getModel('xmlconnect/payment_method_paypal_mep')->isAvailable(null));
}
$result['paypal']['isActive'] = $isActive;
+ if ((int)Mage::getStoreConfig(self::XML_PATH_GENERAL_RESTRICTION_IS_ACTIVE)) {
+ $result['website_restrictions']['mode'] = (int) Mage::getStoreConfig(self::XML_PATH_GENERAL_RESTRICTION_MODE);
+ }
+
return $result;
}
@@ -416,10 +515,15 @@ protected function _beforeSave()
*/
public function loadConfiguration()
{
- $configuration = $this->getConfiguration();
- if (!empty($configuration)) {
- $configuration = unserialize($configuration);
- $this->setData('conf', $configuration);
+ static $isConfigurationLoaded = null;
+
+ if (is_null($isConfigurationLoaded)) {
+ $configuration = $this->getConfiguration();
+ if (!empty($configuration)) {
+ $configuration = unserialize($configuration);
+ $this->setData('conf', $configuration);
+ $isConfigurationLoaded = true;
+ }
}
return $this;
}
@@ -557,6 +661,17 @@ public function validateSubmit($params)
$errors[] = Mage::helper('xmlconnect')->__('Please enter the Title.');
}
+ if (isset($params['title'])) {
+ if ($this->getType() == Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE) {
+ $strRules = array('max' => '12');
+ } else {
+ $strRules = array('max' => '200');
+ }
+ if (!Zend_Validate::is($params['title'], 'StringLength', $strRules)) {
+ $errors[] = Mage::helper('xmlconnect')->__('"Title" is more than %d characters long', $strRules['max']);
+ }
+ }
+
if (!Zend_Validate::is(isset($params['copyright']) ? $params['copyright'] : null, 'NotEmpty')) {
$errors[] = Mage::helper('xmlconnect')->__('Please enter the Copyright.');
}
@@ -572,14 +687,18 @@ public function validateSubmit($params)
}
if ($this->getIsResubmitAction()) {
- if (!Zend_Validate::is(
- isset($params['resubmission_activation_key']) ? $params['resubmission_activation_key'] : null,
- 'NotEmpty')) {
+ $resubmissionKey = isset($params['resubmission_activation_key']) ? $params['resubmission_activation_key'] : null;
+ if (!Zend_Validate::is($resubmissionKey, 'NotEmpty')) {
$errors[] = Mage::helper('xmlconnect')->__('Please enter the Resubmission Key.');
+ } else if (!Zend_Validate::is($resubmissionKey, 'StringLength', array(1, self::APP_MAX_KEY_LENGTH))) {
+ $errors[] = Mage::helper('xmlconnect')->__('Submit App failure. Invalid activation key provided');
}
} else {
- if (!Zend_Validate::is(isset($params['key']) ? $params['key'] : null, 'NotEmpty')) {
- $errors[] = Mage::helper('xmlconnect')->__('Please enter the Activation Key.');
+ $key = isset($params['key']) ? $params['key'] : null;
+ if (!Zend_Validate::is($key, 'NotEmpty')) {
+ $errors[] = Mage::helper('xmlconnect')->__('Please enter the Activation Key.');
+ } else if (!Zend_Validate::is($key, 'StringLength', array(1, self::APP_MAX_KEY_LENGTH))) {
+ $errors[] = Mage::helper('xmlconnect')->__('Submit App failure. Invalid activation key provided');
}
}
@@ -592,6 +711,7 @@ public function validateSubmit($params)
/**
* Check config for valid values
*
+ * @throws Mage_Core_Exception
* @return bool|array
*/
protected function _validateConf()
@@ -607,18 +727,42 @@ protected function _validateConf()
$errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "Logo in Header" field from Design Tab.');
}
- if ( ($native === false)
- || (!isset($native['body']) || !is_array($native['body'])
- || !isset($native['body']['bannerImage'])
- || !Zend_Validate::is($native['body']['bannerImage'], 'NotEmpty'))) {
- $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "Banner on Home Screen" field from Design Tab.');
- }
+ $deviceType = Mage::helper('xmlconnect')->getApplication()->getType();
+ switch ($deviceType) {
+ case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE:
+ if (!Mage::helper('xmlconnect')->validateConfFieldNotEmpty('bannerImage', $native)) {
+ $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "Banner on Home Screen" field from Design Tab.');
+ }
- if (($native === false)
- || (!isset($native['body']) || !is_array($native['body'])
- || !isset($native['body']['backgroundImage'])
- || !Zend_Validate::is($native['body']['backgroundImage'], 'NotEmpty'))) {
- $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "App Background" field from Design Tab.');
+ if (!Mage::helper('xmlconnect')->validateConfFieldNotEmpty('backgroundImage', $native)) {
+ $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "App Background" field from Design Tab.');
+ }
+ break;
+ case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPAD:
+ if (!Mage::helper('xmlconnect')->validateConfFieldNotEmpty('bannerImageIpad', $native)) {
+ $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "Banner on Home Screen" field from Design Tab.');
+ }
+
+ if (!Mage::helper('xmlconnect')->validateConfFieldNotEmpty('backgroundImageIpadLandscape', $native)) {
+ $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "App Background (landscape mode)" field from Design Tab.');
+ }
+
+ if (!Mage::helper('xmlconnect')->validateConfFieldNotEmpty('backgroundImageIpadPortret', $native)) {
+ $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "App Background (portrait mode)" field from Design Tab.');
+ }
+ break;
+ case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID:
+ if (!Mage::helper('xmlconnect')->validateConfFieldNotEmpty('bannerImageAndroid', $native)) {
+ $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "Banner on Home Screen" field from Design Tab.');
+ }
+
+ if (!Mage::helper('xmlconnect')->validateConfFieldNotEmpty('backgroundImageAndroid', $native)) {
+ $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "App Background" field from Design Tab.');
+ }
+ break;
+ default:
+ Mage::throwException(Mage::helper('xmlconnect')->__('Device doesn\'t recognized: "%s". Unable to load a helper.', $deviceType));
+ break;
}
if (empty($errors)) {
@@ -635,7 +779,6 @@ protected function _validateConf()
*/
public function prepareSubmitParams($data)
{
-
$params = array();
if (isset($data['conf']) && is_array($data['conf'])) {
@@ -646,7 +789,12 @@ public function prepareSubmitParams($data)
$params['name'] = $this->getName();
$params['code'] = $this->getCode();
$params['type'] = $this->getType();
- $params['url'] = Mage::getBaseUrl() . 'xmlconnect/configuration/index/app_code/' . $this->getCode();
+ $params['url'] = Mage::getUrl('xmlconnect/configuration/index', array(
+ '_store' => $this->getStoreId(),
+ '_nosid' => true,
+ 'app_code' => $this->getCode()
+ ));
+
$params['magentoversion'] = Mage::getVersion();
if (isset($params['country']) && is_array($params['country'])) {
@@ -709,7 +857,6 @@ public function getActivationKey()
if (isset($this->_data['conf']) && is_array($this->_data['conf']) &&
isset($this->_data['conf']['submit_text']) && is_array($this->_data['conf']['submit_text']) &&
isset($this->_data['conf']['submit_text']['key'])) {
-
$key = $this->_data['conf']['submit_text']['key'];
}
return $key;
@@ -725,4 +872,44 @@ public function updateAllAppsUpdatedAtParameter()
$this->_getResource()->updateAllAppsUpdatedAtParameter();
return $this;
}
+
+ /**
+ * Getter return concatenated user and password
+ *
+ * @return string
+ */
+ public function getUserpwd()
+ {
+ return $this->loadConfiguration()->getAppKey() . ':' . $this->getAppMasterSecret();
+ }
+
+ /**
+ * Getter for Application Key
+ *
+ * @return string
+ */
+ public function getAppKey()
+ {
+ return $this->getData('conf/native/notifications/applicationKey');
+ }
+
+ /**
+ * Getter for Application Secret
+ *
+ * @return string
+ */
+ public function getAppSecret()
+ {
+ return $this->getData('conf/native/notifications/applicationSecret');
+ }
+
+ /**
+ * Getter for Application Master Secret
+ *
+ * @return string
+ */
+ public function getAppMasterSecret()
+ {
+ return $this->getData('conf/native/notifications/applicationMasterSecret');
+ }
}
diff --git a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php
index 7753cae571..bcbef70361 100644
--- a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php
+++ b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php
@@ -29,11 +29,10 @@
*
* @category Mage
* @package Mage_Catalog
- * @author Magento Core Team
+ * @author Magento Core Team
*/
class Mage_XmlConnect_Model_Catalog_Category_Image extends Mage_Catalog_Model_Product_Image
{
-
/**
* Set filenames for base file and new file
*
@@ -162,6 +161,8 @@ protected function _getWatermarkFilePath()
/**
* Clear catalog cache
+ *
+ * @return void
*/
public function clearCache()
{
diff --git a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php
index cce12e6e7f..6ecb4ebd65 100644
--- a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php
+++ b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php
@@ -24,7 +24,6 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
-
/**
* Catalog category media config
*
@@ -35,7 +34,7 @@
class Mage_XmlConnect_Model_Catalog_Category_Media_Config extends Mage_Catalog_Model_Product_Media_Config
{
/**
- * Getter , return Catalog baseMediaPath
+ * Getter, return Catalog baseMediaPath
*
* @return string
*/
@@ -73,5 +72,4 @@ public function getBaseTmpMediaUrl()
{
return Mage::getBaseUrl('media') . 'tmp/catalog/category';
}
-
}
diff --git a/app/code/core/Mage/XmlConnect/Model/History.php b/app/code/core/Mage/XmlConnect/Model/History.php
index 19e10dd801..30e49b92dd 100644
--- a/app/code/core/Mage/XmlConnect/Model/History.php
+++ b/app/code/core/Mage/XmlConnect/Model/History.php
@@ -23,6 +23,7 @@
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
+
/**
* @method Mage_XmlConnect_Model_Mysql4_History _getResource()
* @method Mage_XmlConnect_Model_Mysql4_History getResource()
@@ -45,6 +46,8 @@ class Mage_XmlConnect_Model_History extends Mage_Core_Model_Abstract
{
/**
* Initialize application
+ *
+ * @return void
*/
protected function _construct()
{
diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Application.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Application.php
index a42814d38a..c45d96db9f 100644
--- a/app/code/core/Mage/XmlConnect/Model/Mysql4/Application.php
+++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Application.php
@@ -27,6 +27,8 @@ class Mage_XmlConnect_Model_Mysql4_Application extends Mage_Core_Model_Mysql4_Ab
{
/**
* Constructor, setting table and index field
+ *
+ * @return void
*/
protected function _construct()
{
diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Application/Collection.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Application/Collection.php
index 9e94ea516e..bc2285828d 100644
--- a/app/code/core/Mage/XmlConnect/Model/Mysql4/Application/Collection.php
+++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Application/Collection.php
@@ -27,6 +27,8 @@ class Mage_XmlConnect_Model_Mysql4_Application_Collection extends Mage_Core_Mode
{
/**
* Constructor, setting table
+ *
+ * @return void
*/
protected function _construct()
{
diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/History.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/History.php
index ec2a49a662..257823525d 100644
--- a/app/code/core/Mage/XmlConnect/Model/Mysql4/History.php
+++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/History.php
@@ -27,11 +27,12 @@ class Mage_XmlConnect_Model_Mysql4_History extends Mage_Core_Model_Mysql4_Abstra
{
/**
* Constructor, setting table and index field
+ *
+ * @return void
*/
protected function _construct()
{
$this->_init('xmlconnect/history', 'history_id');
-
}
/**
@@ -62,7 +63,6 @@ protected function _afterLoad(Mage_Core_Model_Abstract $object)
* Returns array of existing images
*
* @param int $id - application instance Id
- *
* @return array
*/
public function getLastParams($id)
@@ -81,5 +81,4 @@ public function getLastParams($id)
}
return $paramArray;
}
-
}
diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/History/Collection.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/History/Collection.php
index 4c727d9e75..3539764f86 100644
--- a/app/code/core/Mage/XmlConnect/Model/Mysql4/History/Collection.php
+++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/History/Collection.php
@@ -30,7 +30,7 @@
*
* @category Mage
* @package Mage_XmlConnect
- * @author Magento Core Team
+ * @author Magento Core Team
*/
class Mage_XmlConnect_Model_Mysql4_History_Collection
extends Mage_Core_Model_Mysql4_Collection_Abstract
diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue.php
new file mode 100755
index 0000000000..404d258d01
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue.php
@@ -0,0 +1,37 @@
+_init('xmlconnect/queue', 'id');
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue/Collection.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue/Collection.php
new file mode 100755
index 0000000000..353e3930c3
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Queue/Collection.php
@@ -0,0 +1,103 @@
+
+ */
+class Mage_XmlConnect_Model_Mysql4_Queue_Collection
+ extends Mage_Core_Model_Mysql4_Collection_Abstract
+{
+ /**
+ * Internal constructor
+ *
+ * @return void
+ */
+ protected function _construct()
+ {
+ $this->_init('xmlconnect/queue');
+ }
+
+ /**
+ * Initialize collection select
+ *
+ * @return Mage_XmlConnect_Model_Mysql4_Queue_Collection
+ */
+ protected function _initSelect()
+ {
+ parent::_initSelect();
+ $this->_joinTemplateName()
+ ->_joinApplicationName();
+ return $this;
+ }
+
+ /**
+ * Join Template Name to collection
+ *
+ * @return Mage_XmlConnect_Model_Mysql4_Queue_Collection
+ */
+ protected function _joinTemplateName()
+ {
+ $this->getSelect()
+ ->joinLeft(array('t' => $this->getTable('xmlconnect/template')), 't.id = template_id', array(
+ 'template_name' => 't.name',
+ ));
+ return $this;
+ }
+
+ /**
+ * Join Application Name to collection
+ *
+ * @return Mage_XmlConnect_Model_Mysql4_Queue_Collection
+ */
+ protected function _joinApplicationName()
+ {
+ $this->getSelect()
+ ->joinLeft(array('app' => $this->getTable('xmlconnect/application')), 'app.code = main_table.app_code', array(
+ 'application_name' => 'app.name',
+ ));
+ return $this;
+ }
+
+ /**
+ * Add filter by only ready fot sending item
+ *
+ * @return Mage_XmlConnect_Model_Mysql4_Queue_Collection
+ */
+ public function addOnlyForSendingFilter()
+ {
+ $this->getSelect()
+ ->where('main_table.status in (?)', array(Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE))
+ ->where('main_table.exec_time < ?', Mage::getSingleton('core/date')->gmtDate())
+ ->order(new Zend_Db_Expr('main_table.exec_time ' . Zend_Db_Select::SQL_ASC));
+
+ return $this;
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Template.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Template.php
new file mode 100755
index 0000000000..691632aa5a
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Template.php
@@ -0,0 +1,37 @@
+_init('xmlconnect/template', 'id');
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Model/Mysql4/Template/Collection.php b/app/code/core/Mage/XmlConnect/Model/Mysql4/Template/Collection.php
new file mode 100755
index 0000000000..a1810df109
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Model/Mysql4/Template/Collection.php
@@ -0,0 +1,72 @@
+
+ */
+class Mage_XmlConnect_Model_Mysql4_Template_Collection
+ extends Mage_Core_Model_Mysql4_Collection_Abstract
+{
+ /**
+ * Internal constructor
+ *
+ * @return void
+ */
+ protected function _construct()
+ {
+ $this->_init('xmlconnect/template');
+ }
+
+ /**
+ * Initialize collection select
+ *
+ * @return Mage_XmlConnect_Model_Mysql4_Template_Collection
+ */
+ protected function _initSelect()
+ {
+ parent::_initSelect();
+ $this->_joinApplicationName();
+ return $this;
+ }
+
+ /**
+ * Join Application Name to collection
+ *
+ * @return Mage_XmlConnect_Model_Mysql4_Template_Collection
+ */
+ protected function _joinApplicationName()
+ {
+ $this->getSelect()
+ ->joinLeft(array('app' => $this->getTable('xmlconnect/application')), 'app.code = app_code', array(
+ 'app_name' => 'app.name',
+ ));
+ return $this;
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Model/Observer.php b/app/code/core/Mage/XmlConnect/Model/Observer.php
index a49b2afbb7..0955974c0b 100644
--- a/app/code/core/Mage/XmlConnect/Model/Observer.php
+++ b/app/code/core/Mage/XmlConnect/Model/Observer.php
@@ -44,6 +44,18 @@ class Mage_XmlConnect_Model_Observer
'currency/options/default'
);
+ /**
+ * Stop website stub or private sales restriction
+ *
+ * @param Varien_Event_Observer $observer
+ */
+ public function restrictWebsite($observer)
+ {
+ if (Mage::app()->getRequest()->getModuleName() == 'xmlconnect') {
+ $observer->getEvent()->getResult()->setShouldProceed(false);
+ }
+ }
+
/**
* Update all applications "updated at" parameter with current date on save some configurations
*
@@ -52,8 +64,57 @@ class Mage_XmlConnect_Model_Observer
public function changeUpdatedAtParamOnConfigSave($observer)
{
$configData = $observer->getEvent()->getConfigData();
- if ($configData && (int)$configData->isValueChanged() && in_array($configData->getPath(), $this->_appDependOnConfigFieldPathes)) {
+ if ($configData
+ && (int)$configData->isValueChanged()
+ && in_array($configData->getPath(), $this->_appDependOnConfigFieldPathes)
+ )
+ {
Mage::getModel('xmlconnect/application')->updateAllAppsUpdatedAtParameter();
}
}
+
+ /**
+ * Send a message if Start Date (Queue Date) is empty
+ *
+ * @param Varien_Event_Observer $observer
+ */
+ public function sendMessageImmediately($observer)
+ {
+ $message = $observer->getEvent()->getData('queueMessage');
+ if ($message instanceof Mage_XmlConnect_Model_Queue
+ && (strtolower($message->getExecTime()) == 'null'
+ || !$message->getExecTime()
+ )
+ )
+ {
+ $message->setExecTime(Mage::getSingleton('core/date')->gmtDate());
+ Mage::helper('xmlconnect')->sendBroadcastMessage($message);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Send sheduled messages
+ *
+ * @param mixed $schedule
+ */
+ public function scheduledSend($schedule = null)
+ {
+ $countOfQueue = Mage::getStoreConfig(Mage_XmlConnect_Model_Queue::XML_PATH_CRON_MESSAGES_COUNT);
+
+ $collection = Mage::getModel('xmlconnect/queue')->getCollection()
+ ->addOnlyForSendingFilter()
+ ->setPageSize($countOfQueue)
+ ->setCurPage(1)
+ ->load();
+
+ foreach ($collection as $message) {
+ if ($message->getId()) {
+ Mage::helper('xmlconnect')->sendBroadcastMessage($message);
+ $message->save();
+ }
+ }
+ }
}
diff --git a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php
index 384c169a9b..eac72efb4b 100644
--- a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php
+++ b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php
@@ -37,6 +37,11 @@ class Mage_XmlConnect_Model_Payment_Method_Paypal_Mep extends Mage_Paypal_Model_
*/
const MEP_METHOD_CODE = 'paypal_mep';
+ /**
+ * Payment method code
+ *
+ * @var string
+ */
protected $_code = self::MEP_METHOD_CODE;
protected $_canUseInternal = false;
@@ -64,8 +69,19 @@ public function getConfigPaymentAction()
*/
public function isAvailable($quote = null)
{
+ $storeId = false;
+ $model = Mage::registry('current_app');
+
+ if (($model instanceof Mage_XmlConnect_Model_Application)) {
+ $storeId = $model->getStoreId();
+ }
+
+ if (!$storeId) {
+ $storeId = $quote ? $quote->getStoreId() : Mage::app()->getStore()->getId();
+ }
+
return Mage::getModel('paypal/config')
- ->setStoreId(Mage::app()->getStore()->getId())
+ ->setStoreId($storeId)
->isMethodAvailable(Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS);
}
diff --git a/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php b/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php
index aeef37f69b..92cb6de107 100644
--- a/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php
+++ b/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php
@@ -41,7 +41,7 @@ class Mage_XmlConnect_Model_Paypal_Mep_Checkout
/**
* Payment method type
*
- * @var unknown_type
+ * @var string
*/
protected $_methodType = Mage_XmlConnect_Model_Payment_Method_Paypal_Mep::MEP_METHOD_CODE;
@@ -62,8 +62,10 @@ class Mage_XmlConnect_Model_Paypal_Mep_Checkout
/**
* Set quote instances
- *
+ *
+ * @throws Mage_Core_Exception
* @param array $params
+ * @return void
*/
public function __construct($params = array())
{
@@ -270,6 +272,8 @@ public function getLastOrderId()
/**
* Make sure addresses will be saved without validation errors
+ *
+ * @return void
*/
protected function _ignoreAddressValidation()
{
diff --git a/app/code/core/Mage/XmlConnect/Model/Queue.php b/app/code/core/Mage/XmlConnect/Model/Queue.php
new file mode 100755
index 0000000000..fb22a7218e
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Model/Queue.php
@@ -0,0 +1,296 @@
+_init('xmlconnect/queue');
+ }
+
+ /**
+ * Load object data
+ *
+ * @param integer $id
+ * @return Mage_Core_Model_Abstract
+ */
+ public function load($id, $field=null)
+ {
+ parent::load($id, $field);
+
+ if ($this->getTemplateId()) {
+ $this->setName(
+ Mage::getModel('xmlconnect/template')->load($this->getTemplateId())->getName()
+ );
+ }
+ return $this;
+ }
+
+ /**
+ * Get template type
+ *
+ * @return int
+ */
+ public function getType()
+ {
+ return self::TYPE_HTML;
+ }
+
+ /**
+ * Getter for application type
+ * @return string
+ */
+ public function getApplicationType()
+ {
+ if (empty($this->_appType) && $this->getAppCode()) {
+ $app = Mage::getModel('xmlconnect/application')->loadByCode($this->getAppCode());
+ $this->_appType = $app->getId() ? $app->getType() : null;
+ }
+
+ return $this->_appType;
+ }
+
+ /**
+ * Getter for application name
+ *
+ * @return string
+ */
+ public function getAppName()
+ {
+ return $this->getApplicationName() ? $this->getApplicationName() : Mage::helper('xmlconnect')->getApplicationName($this->getAppCode());
+ }
+
+ /**
+ * Getter for template name
+ *
+ * @return string
+ */
+ public function getTplName()
+ {
+ return $this->getTemplateName() ? $this->getTemplateName() : Mage::helper('xmlconnect')->getTemplateName($this->getTemplateId());
+ }
+
+ /**
+ * Retrieve processed template
+ *
+ * @param array $variables
+ * @param bool $usePreprocess
+ * @return string
+ */
+ public function getProcessedTemplate(array $variables = array(), $usePreprocess = false)
+ {
+ /* @var $processor Mage_Widget_Model_Template_Filter */
+ $processor = Mage::getModel('widget/template_filter');
+
+ $variables['this'] = $this;
+
+ if (Mage::app()->isSingleStoreMode()) {
+ $processor->setStoreId(Mage::app()->getStore());
+ } else {
+ $processor->setStoreId(1);
+ }
+
+ $htmlDescription = '%s:
';
+
+ switch ($this->getData('type')) {
+ case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL:
+ $html = sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Push title')) . $this->getPushTitle();
+ $html .= sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Message title')) . $this->getMessageTitle();
+ $html .= sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Message content')) . $processor->filter($this->getContent());
+ break;
+ case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_PUSH:
+ default:
+ $html = sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Push title')) . $this->getPushTitle();
+ break;
+ }
+ return $html;
+ }
+
+ /**
+ * Reset all model data
+ *
+ * @return Mage_XmlConnect_Model_Queue
+ */
+ public function reset()
+ {
+ $this->setData(array());
+ $this->setOrigData();
+
+ return $this;
+ }
+
+
+ /**
+ * Get JSON-encoded params for broadcast AirMail
+ * Format of JSON data:
+ * {
+ * "push": {
+ * "aps": {
+ * "alert": "New message!"
+ * }
+ * },
+ * "title": "Message title",
+ * "message": "Your full message here.",
+ * "extra": {
+ * "some_key": "some_value"
+ * }
+ * }
+ *
+ * @return string
+ */
+ public function getAirmailBroadcastParams()
+ {
+ $notificationType = Mage::getStoreConfig(sprintf(Mage_XmlConnect_Model_Queue::XML_PATH_NOTIFICATION_TYPE, $this->getApplicationType()));
+
+ $payload = array(
+ 'push' => array(
+ $notificationType => array(
+ 'alert' => $this->getPushTitle(),
+ )
+ ),
+ 'title' => $this->getMessageTitle(),
+ 'message' => $this->getContent(),
+ );
+ return Mage::helper('core')->jsonEncode($payload);
+ }
+
+ /**
+ * Get JSON-encoded params for broadcast Push Notification
+ * Format of JSON data:
+ * {
+ * "aps": {
+ * "badge": 15,
+ * "alert": "Hello from Urban Airship!",
+ * "sound": "cat.caf"
+ * },
+ * "exclude_tokens": [
+ * "device token you want to skip",
+ * "another device token you want to skip"
+ * ]
+ * }
+ *
+ * @return string
+ */
+ public function getPushBroadcastParams()
+ {
+ $notificationType = Mage::getStoreConfig(sprintf(Mage_XmlConnect_Model_Queue::XML_PATH_NOTIFICATION_TYPE, $this->getApplicationType()));
+
+ $payload = array(
+ $notificationType => array(
+// 'badge' => 'auto',
+ 'alert' => $this->getPushTitle(),
+ 'sound' => 'default'
+ )
+ );
+ return Mage::helper('core')->jsonEncode($payload);
+ }
+
+ /**
+ * Save object data
+ *
+ * @return Mage_Core_Model_Abstract
+ */
+ public function save()
+ {
+ if (!$this->getIsSent() && $this->getStatus() == self::STATUS_IN_QUEUE) {
+ try {
+ Mage::dispatchEvent('before_save_message_queue', array('queueMessage' => $this));
+ } catch (Exception $e) {
+ Mage::logException($e);
+ }
+ }
+ return parent::save();
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php
index 3898687512..704d3c2ab0 100644
--- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php
+++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php
@@ -28,7 +28,7 @@
*
* XmlConnect fixed Varien SimpleXML Element class
*
- * @author Magento Core Team
+ * @author Magento Core Team
*/
class Mage_XmlConnect_Model_Simplexml_Element extends Varien_Simplexml_Element
{
@@ -78,9 +78,7 @@ public function xmlAttribute($value = null)
$value = $this;
}
$value = (string)$value;
-
$value = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $value);
-
return $value;
}
}
diff --git a/app/code/core/Mage/XmlConnect/Model/Tabs.php b/app/code/core/Mage/XmlConnect/Model/Tabs.php
index 67d222ba77..24ae0df0b8 100644
--- a/app/code/core/Mage/XmlConnect/Model/Tabs.php
+++ b/app/code/core/Mage/XmlConnect/Model/Tabs.php
@@ -68,9 +68,18 @@ protected function _translateLabel(&$tabItems)
{
if (is_array($tabItems)) {
foreach ($tabItems as $id => $tab) {
- if (isset($tab->label)) {
- $temp = $tabItems[$id];
- $temp->label = Mage::helper('xmlconnect')->getTabLabel($tab->action);
+ $tempTab = $tabItems[$id];
+
+ if (is_array($tab)) {
+ if (isset($tab['label'])) {
+ $tempTab['label'] = Mage::helper('xmlconnect')->getTabLabel($tab['action']);
+ } else {
+ $tempTab['label'] = '';
+ }
+ } else {
+ if (isset($tab->label)) {
+ $tempTab->label = Mage::helper('xmlconnect')->getTabLabel($tab->action);
+ }
}
}
}
@@ -109,6 +118,7 @@ public function getRenderTabs()
$tab->image = Mage::getDesign()->getSkinUrl('images/xmlconnect/' . $tab->image);
$result[] = $tab;
}
+
return $result;
}
}
diff --git a/app/code/core/Mage/XmlConnect/Model/Template.php b/app/code/core/Mage/XmlConnect/Model/Template.php
new file mode 100755
index 0000000000..41da27eccc
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/Model/Template.php
@@ -0,0 +1,76 @@
+_init('xmlconnect/template');
+ }
+
+ /**
+ * Get template type
+ *
+ * @return int
+ */
+ public function getType()
+ {
+ return self::TYPE_HTML;
+ }
+
+ /**
+ * Retrieve processed template
+ *
+ * @param array $variables
+ * @param bool $usePreprocess
+ * @return string
+ */
+ public function getProcessedTemplate(array $variables = array(), $usePreprocess = false)
+ {
+ /* @var $processor Mage_Widget_Model_Template_Filter */
+ $processor = Mage::getModel('widget/template_filter');
+
+ $variables['this'] = $this;
+
+ if (Mage::app()->isSingleStoreMode()) {
+ $processor->setStoreId(Mage::app()->getStore());
+ } else {
+ $processor->setStoreId(1);
+ }
+
+ $htmlDescription = '%s:
';
+ $html = sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Push title')) . $this->getPushTitle();
+ $html .= sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Message title')) . $this->getMessageTitle();
+ $html .= sprintf($htmlDescription, Mage::helper('xmlconnect')->__('Message content')) . $processor->filter($this->getContent());
+
+ return $html;
+ }
+}
diff --git a/app/code/core/Mage/XmlConnect/Model/Theme.php b/app/code/core/Mage/XmlConnect/Model/Theme.php
index 97d8970273..8bf1e632db 100644
--- a/app/code/core/Mage/XmlConnect/Model/Theme.php
+++ b/app/code/core/Mage/XmlConnect/Model/Theme.php
@@ -34,6 +34,8 @@ class Mage_XmlConnect_Model_Theme
* Load Theme xml from $file
*
* @param string $file
+ * @throws Mage_Core_Exception
+ * @return void
*/
public function __construct($file)
{
diff --git a/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php b/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php
index 36aee8290c..c39f990291 100644
--- a/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php
+++ b/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php
@@ -28,11 +28,12 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll
{
/**
* Initialize application
- *
+ *
* @param string $paramName
+ * @param string $type
* @return Mage_XmlConnect_Model_Application
*/
- protected function _initApp($paramName = 'application_id')
+ protected function _initApp($paramName = 'application_id', $type = false)
{
$id = (int) $this->getRequest()->getParam($paramName);
$app = Mage::getModel('xmlconnect/application');
@@ -42,7 +43,10 @@ protected function _initApp($paramName = 'application_id')
$app->loadConfiguration();
}
} else {
+ $app->setType($type);
+ Mage::register('current_app', $app);
$app->loadDefaultConfiguration();
+ Mage::unregister('current_app');
}
Mage::register('current_app', $app);
return $app;
@@ -63,35 +67,12 @@ protected function _restoreSessionFilesFormData($data)
}
foreach ($filesData as $filePath => $fileName) {
$target =& $data;
- $this->_injectFieldToArray($target, $filePath, $fileName);
+ Mage::helper('xmlconnect')->_injectFieldToArray($target, $filePath, $fileName);
}
}
return $data;
}
-
- /**
- * Set value into multidimensional array 'conf/native/navigationBar/icon'
- *
- * @param &array $target // pointer to target array
- * @param string $fieldPath //'conf/native/navigationBar/icon'
- * @param mixed $fieldValue // 'Some Value' || 12345 || array(1=>3, 'aa'=>43)
- * @param string $delimiter // path delimiter
- * @return null
- */
- protected function _injectFieldToArray(&$target, $fieldPath, $fieldValue, $delimiter = '/')
- {
- $nameParts = explode($delimiter, $fieldPath);
- foreach ($nameParts as $next) {
- if (!isset($target[$next])) {
- $target[$next] = array();
- }
- $target =& $target[$next];
- }
- $target = $fieldValue;
- return null;
- }
-
/**
* Mobile applications management
*
@@ -109,7 +90,10 @@ public function indexAction()
*/
public function newAction()
{
- $this->_forward('edit');
+ Mage::getSingleton('adminhtml/session')->setData('new_application', true);
+ $this->loadLayout();
+ $this->_setActiveMenu('xmlconnect/mobile');
+ $this->renderLayout();
}
/**
@@ -120,7 +104,7 @@ public function submissionAction()
try {
$app = $this->_initApp();
if (!$app->getId()) {
- $this->_getSession()->addError(Mage::helper('xmlconnect')->__('App does not exist.'));
+ $this->_getSession()->addError($this->__('App does not exist.'));
$this->_redirect('*/*/');
return;
}
@@ -143,7 +127,7 @@ public function submissionAction()
$this->_redirect('*/*/');
}
} catch (Exception $e) {
- $this->_getSession()->addException($e, Mage::helper('xmlconnect')->__('Can\'t open submission form.'));
+ $this->_getSession()->addException($e, $this->__('Can\'t open submission form.'));
if (isset($app)) {
$this->_redirect('*/*/edit', array('application_id' => $app->getId()));
} else {
@@ -162,20 +146,33 @@ public function editAction()
$redirectBack = false;
try {
$id = (int) $this->getRequest()->getParam('application_id');
- $app = $this->_initApp();
+ $type = $this->getRequest()->getParam('type');
+ $app = $this->_initApp('application_id', $type);
if (!$app->getId() && $id) {
- $this->_getSession()->addError(Mage::helper('xmlconnect')->__('App does not exist.'));
+ $this->_getSession()->addError($this->__('App does not exist.'));
$this->_redirect('*/*/');
return;
}
- $app->loadSubmit();
- if ((bool) Mage::getSingleton('adminhtml/session')->getLoadSessionFlag(true)) {
- $newAppData = $this->_restoreSessionFilesFormData(Mage::getSingleton('adminhtml/session')->getFormData(true));
- if (!empty($newAppData)) {
- $app->setData(Mage::helper('xmlconnect')->arrayMergeRecursive($app->getData(), $newAppData));
- }
+
+ $newAppData = $this->_restoreSessionFilesFormData(Mage::getSingleton('adminhtml/session')->getFormData(true));
+ if (!empty($newAppData)) {
+ $app->setData(Mage::helper('xmlconnect')->arrayMergeRecursive($app->getData(), $newAppData));
}
+
+ if ($app->getId() || $app->getType()) {
+ Mage::getSingleton('adminhtml/session')->setData('new_application', false);
+ } else {
+ $this->_redirect('*/*/new');
+ }
+
+ $devArray = Mage::helper('xmlconnect')->getSupportedDevices();
+ if (array_key_exists($app->getType(), $devArray)) {
+ $deviceTitle = $devArray[$app->getType()];
+ }
+ $deviceTitle = isset($deviceTitle) ? $deviceTitle : $app->getType();
+ $app->setDevtype($deviceTitle);
+ $app->loadSubmit();
$this->loadLayout();
$this->_setActiveMenu('xmlconnect/mobile');
$this->renderLayout();
@@ -183,7 +180,7 @@ public function editAction()
$this->_getSession()->addError($e->getMessage());
$redirectBack = true;
} catch (Exception $e) {
- $this->_getSession()->addError(Mage::helper('xmlconnect')->__('Unable to load application form.'));
+ $this->_getSession()->addError($this->__('Unable to load application form.'));
$redirectBack = true;
Mage::logException($e);
}
@@ -228,6 +225,7 @@ public function submissionPostAction()
'created_at' => Mage::getModel('core/date')->date(),
'store_id' => $app->getStoreId(),
'title' => isset($params['title']) ? $params['title'] : '',
+ 'name' => $app->getName(),
'code' => $app->getCode(),
'activation_key' => isset($params['resubmission_activation_key']) ?
$params['resubmission_activation_key'] : $params['key'],
@@ -235,7 +233,7 @@ public function submissionPostAction()
$history->save();
$app->getResource()->updateApplicationStatus($app->getId(),
Mage_XmlConnect_Model_Application::APP_STATUS_SUCCESS);
- $this->_getSession()->addSuccess(Mage::helper('xmlconnect')->__('App has been submitted.'));
+ $this->_getSession()->addSuccess($this->__('App has been submitted.'));
$this->_clearSessionData();
$this->_redirect('*/*/edit', array('application_id' => $app->getId()));
} else {
@@ -251,7 +249,7 @@ public function submissionPostAction()
$this->_redirect('*/*/');
}
} catch (Exception $e) {
- $this->_getSession()->addException($e, Mage::helper('xmlconnect')->__('Can\'t submit application.'));
+ $this->_getSession()->addException($e, $this->__('Can\'t submit application.'));
Mage::logException($e);
if (isset($app)) {
Mage::getSingleton('adminhtml/session')->setLoadSessionFlag(true);
@@ -338,7 +336,7 @@ protected function _processPostRequest()
if (is_array($message)) {
$message = implode(' ,', $message);
}
- Mage::throwException(Mage::helper('xmlconnect')->__('Submit App failure. %s', $message));
+ Mage::throwException($this->__('Submit App failure. %s', $message));
}
} catch (Exception $e) {
throw $e;
@@ -351,17 +349,25 @@ protected function _processPostRequest()
public function saveAction()
{
$data = $this->getRequest()->getPost();
- $redirectBack = $this->getRequest()->getParam('back', false);
$redirectSubmit = $this->getRequest()->getParam('submitapp', false);
$app = false;
$isError = false;
+ $devType = false;
if ($data) {
Mage::getSingleton('adminhtml/session')->setFormData($data);
try {
$id = $this->getRequest()->getParam('application_id');
- $app = $this->_initApp();
+ if (!$id && isset($data['devtype'])) {
+ $devArray = Mage::helper('xmlconnect')->getSupportedDevices();
+ $devType = array_search($data['devtype'], $devArray);
+ if ($devType === false) {
+ $this->_getSession()->addError($this->__('Wrong device type.'));
+ $isError = true;
+ }
+ }
+ $app = $this->_initApp('application_id', $devType);
if (!$app->getId() && $id) {
- $this->_getSession()->addError(Mage::helper('xmlconnect')->__('App does not exist.'));
+ $this->_getSession()->addError($this->__('App does not exist.'));
$this->_redirect('*/*/');
return;
}
@@ -374,29 +380,30 @@ public function saveAction()
}
$isError = true;
}
+
if (!$isError) {
$this->_saveThemeAction($data, 'current_theme');
$app->save();
- $this->_getSession()->addSuccess(Mage::helper('xmlconnect')->__('App has been saved.'));
+ $this->_getSession()->addSuccess($this->__('App has been saved.'));
$this->_clearSessionData();
}
} catch (Mage_Core_Exception $e) {
$this->_getSession()->addException($e, $e->getMessage());
$isError = true;
- $redirectBack = true;
} catch (Exception $e) {
- $this->_getSession()->addException($e, Mage::helper('xmlconnect')->__('Unable to save app.'));
+ $this->_getSession()->addException($e, $this->__('Unable to save app.'));
$isError = true;
- $redirectBack = true;
Mage::logException($e);
}
}
- if (!$isError && $app->getId() && $redirectSubmit) {
+ if (!$isError && is_object($app) && $app->getId() && $redirectSubmit) {
$this->_redirect('*/*/submission', array('application_id' => $app->getId()));
- } else if ($isError || ($app->getId() && $redirectBack)) {
- if ($isError) {
- Mage::getSingleton('adminhtml/session')->setLoadSessionFlag(true);
- }
+ } else if ($isError && $app->getId()) {
+ Mage::getSingleton('adminhtml/session')->setLoadSessionFlag(true);
+ $this->_redirect('*/*/edit', array('application_id' => $app->getId()));
+ } else if ($isError && !$app->getId() && $app->getType()) {
+ $this->_redirect('*/*/edit', array('type' => $app->getType()));
+ } else if ($this->getRequest()->getParam('back')) {
$this->_redirect('*/*/edit', array('application_id' => $app->getId()));
} else {
$this->_redirect('*/*/');
@@ -423,19 +430,19 @@ protected function _saveThemeAction($data, $paramId = 'saveTheme')
if (isset($data['conf'])) {
$convertedConf = $data['conf'];
} else {
- $response = array('error' => true, 'message' => Mage::helper('xmlconnect')->__('Cannot save theme "%s". Incorrect data received', $themeName));
+ $response = array('error' => true, 'message' => $this->__('Cannot save theme "%s". Incorrect data received', $themeName));
}
}
$theme->importAndSaveData($convertedConf);
$response = Mage::helper('xmlconnect/theme')->getAllThemesArray(true);
} else {
- $response = array('error' => true, 'message' => Mage::helper('xmlconnect')->__('Cannot load theme "%s".', $themeName));
+ $response = array('error' => true, 'message' => $this->__('Cannot load theme "%s".', $themeName));
}
} else {
$response = Mage::helper('xmlconnect/theme')->getAllThemesArray(true);
}
} else {
- $response = array('error' => true, 'message' => Mage::helper('xmlconnect')->__('Theme name is not set.'));
+ $response = array('error' => true, 'message' => $this->__('Theme name is not set.'));
}
} catch (Mage_Core_Exception $e) {
$response = array(
@@ -445,7 +452,7 @@ protected function _saveThemeAction($data, $paramId = 'saveTheme')
} catch (Exception $e) {
$response = array(
'error' => true,
- 'message' => Mage::helper('xmlconnect')->__('Can\'t save theme.')
+ 'message' => $this->__('Can\'t save theme.')
);
}
if (is_array($response)) {
@@ -488,7 +495,6 @@ protected function _convertPost($data)
public function saveThemeAction()
{
$data = $this->getRequest()->getPost();
- $response = false;
$this->_saveThemeAction($data);
}
@@ -509,7 +515,7 @@ public function resetThemeAction()
} catch (Exception $e) {
$response = array(
'error' => true,
- 'message' => Mage::helper('xmlconnect')->__('Can\'t reset theme.')
+ 'message' => $this->__('Can\'t reset theme.')
);
}
if (is_array($response)) {
@@ -526,6 +532,14 @@ public function previewHomeAction()
$this->_previewAction('preview_home_content');
}
+ /**
+ * Preview Home landscape mode action handler
+ */
+ public function previewHomeHorAction()
+ {
+ $this->_previewAction('preview_home_hor_content');
+ }
+
/**
* Preview Catalog action handler
*/
@@ -534,6 +548,43 @@ public function previewCatalogAction()
$this->_previewAction('preview_catalog_content');
}
+ /**
+ * Preview Catalog landscape mode action handler
+ */
+ public function previewCatalogHorAction()
+ {
+ $this->_previewAction('preview_catalog_hor_content');
+ }
+
+ /**
+ * Preview Product Info action handler
+ */
+ public function previewProductinfoAction()
+ {
+ $this->_previewAction('preview_productinfo_content');
+ }
+
+ /**
+ * Preview AirMail Queue Template action handler
+ */
+ public function previewQueueAction()
+ {
+ $message = $this->_initMessage();
+ if ($message->getId()) {
+ $this->getRequest()->setParam('queue_preview', $message->getId());
+ }
+ $this->_forward('previewTemplate');
+ }
+
+ /**
+ * Preview AirMail Template action handler
+ */
+ public function previewTemplateAction()
+ {
+ $this->loadLayout('adminhtml_mobile_template_preview');
+ $this->renderLayout();
+ }
+
/**
* Preview action implementation
*
@@ -542,15 +593,17 @@ public function previewCatalogAction()
protected function _previewAction($block)
{
$redirectBack = false;
- $app = false;
+
try {
- $app = $this->_initApp();
+ $deviceTitle = $this->getRequest()->getParam('devtype');
+ $deviceType = array_search($deviceTitle, Mage::helper('xmlconnect')->getSupportedDevices());
+ $app = $this->_initApp('application_id', $deviceType);
if (!$this->getRequest()->getParam('submission_action')) {
$app->addData($this->_preparePostData($this->getRequest()->getPost()));
}
$app->addData($this->_processUploadedFiles($app->getData()));
- $this->loadLayout(FALSE);
+ $this->loadLayout(false);
$preview = $this->getLayout()->getBlock($block);
$preview->setConf($app->getRenderConf());
$this->renderLayout();
@@ -559,10 +612,10 @@ protected function _previewAction($block)
$this->_getSession()->addException($e, $e->getMessage());
$redirectBack = true;
} catch (Exception $e) {
- $this->_getSession()->addException($e, Mage::helper('xmlconnect')->__('Unable to process preview.'));
+ $this->_getSession()->addException($e, $this->__('Unable to process preview.'));
$redirectBack = true;
}
- if (isset($app) && $redirectBack) {
+ if (isset($app) && is_object($app) && $redirectBack) {
$this->_redirect('*/*/edit', array('application_id' => $app->getId()));
} else {
$this->_redirect('*/*/');
@@ -570,7 +623,7 @@ protected function _previewAction($block)
}
/**
- * Delete action
+ * Delete app action
*/
public function deleteAction()
{
@@ -578,18 +631,53 @@ public function deleteAction()
$app = $this->_initApp();
if (!$app->getIsSubmitted()) {
$app->delete();
- $this->_getSession()->addSuccess(Mage::helper('xmlconnect')->__('App has been deleted.'));
+ $this->_getSession()->addSuccess($this->__('App has been deleted.'));
} else {
- Mage::throwException(Mage::helper('xmlconnect')->__('It\'s not allowed to delete submitted application.'));
+ Mage::throwException($this->__('It\'s not allowed to delete submitted application.'));
}
} catch (Mage_Core_Exception $e) {
$this->_getSession()->addException($e, $e->getMessage());
} catch (Exception $e) {
- $this->_getSession()->addException($e, Mage::helper('xmlconnect')->__('Unable to find an app to delete.'));
+ $this->_getSession()->addException($e, $this->__('Unable to find an app to delete.'));
}
$this->_redirect('*/*/');
}
+ /**
+ * Delete template action
+ */
+ public function deleteTemplateAction()
+ {
+ // check if we know what should be deleted
+ if ($id = $this->getRequest()->getParam('id')) {
+ try {
+ // init template and delete
+ Mage::getModel('xmlconnect/template')->load($id)->delete();
+
+ // display success message
+ Mage::getSingleton('adminhtml/session')->addSuccess(
+ $this->__('Template has been deleted.')
+ );
+
+ // go to grid
+ $this->_redirect('*/*/template');
+ return;
+
+ } catch (Exception $e) {
+ // display error message
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
+ // go back to edit form
+ $this->_redirect('*/*/template', array('id' => $id));
+ return;
+ }
+ }
+
+ // display error message
+ Mage::getSingleton('adminhtml/session')->addError(
+ $this->__('Unable to find template to delete.')
+ );
+ }
+
/**
* Check the permission to run it
*
@@ -648,7 +736,7 @@ protected function _processUploadedFiles($data, $restore = false)
}
}
foreach ($this->_uploadedFiles as $fieldPath => $fileName) {
- $this->_injectFieldToArray($data, $fieldPath, $fileName);
+ Mage::helper('xmlconnect')->_injectFieldToArray($data, $fieldPath, $fileName);
}
Mage::getSingleton('adminhtml/session')->setUploadedFilesFormData($this->_uploadedFiles);
if ($restore === true) {
@@ -657,14 +745,8 @@ protected function _processUploadedFiles($data, $restore = false)
return $data;
}
-
-
-
-
-
/**
* Prepare post data
- *
* Retains previous data in the object.
*
* @param array $arr
@@ -727,6 +809,395 @@ public function submissionHistoryGridAction()
$this->loadLayout();
$this->renderLayout();
}
+
+ /**
+ * Initialize message queue
+ *
+ * @param string $paramName
+ * @return Mage_XmlConnect_Model_Queue
+ */
+ protected function _initMessage($paramName = 'id')
+ {
+ $id = (int) $this->getRequest()->getParam($paramName);
+ $message = Mage::getModel('xmlconnect/queue')->load($id);
+ Mage::unregister('current_message');
+ Mage::register('current_message', $message);
+ return $message;
+ }
+
+ /**
+ * Initialize Template object
+ *
+ * @param string $paramName
+ * @return Mage_XmlConnect_Model_Template
+ */
+ protected function _initTemplate($paramName = 'id')
+ {
+ $id = (int) $this->getRequest()->getParam($paramName);
+ $template = Mage::getModel('xmlconnect/template')->load($id);
+ Mage::unregister('current_template');
+ Mage::register('current_template', $template);
+ return $template;
+ }
+
+ /**
+ * List AirMail message queue grid
+ */
+ public function queueAction()
+ {
+ $this->loadLayout();
+ $this->_setActiveMenu('xmlconnect/queue');
+ $this->renderLayout();
+ }
+
+ /**
+ * Edit message action
+ */
+ public function editQueueAction()
+ {
+ $message = $this->_initMessage();
+ if ($message->getId()) {
+ $this->getRequest()->setParam('template_id', $message->getTemplateId());
+ $this->_initTemplate('template_id');
+ }
+ $this->_forward('queueMessage');
+ }
+
+ /**
+ * Filtering posted data. Converting localized data if needed
+ *
+ * @param array
+ * @return array
+ */
+ protected function _filterPostData($data)
+ {
+ $data = $this->_filterDateTime($data, array('exec_time'));
+ return $data;
+ }
+
+ /**
+ * Cancel queue action
+ *
+ * @return void
+ */
+ public function cancelQueueAction()
+ {
+ try {
+ $id = $this->getRequest()->getParam('id');
+ $message = $this->_initMessage();
+ if (!$message->getId() && $id) {
+ $this->_getSession()->addError($this->__('Queue does not exist.'));
+ $this->_redirect('*/*/');
+ return;
+ }
+ $message->setStatus(Mage_XmlConnect_Model_Queue::STATUS_CANCELED);
+ $message->save();
+ } catch (Mage_Core_Exception $e) {
+ $this->_getSession()->addException($e, $e->getMessage());
+ } catch (Exception $e) {
+ $this->_getSession()->addException($e, $this->__('Unable to cancel queue.'));
+ Mage::logException($e);
+ }
+
+ $this->_redirect('*/*/queue');
+ }
+
+ /**
+ * Delete queue action
+ *
+ * @return void
+ */
+ public function deleteQueueAction()
+ {
+ try {
+ $id = $this->getRequest()->getParam('id');
+ $message = $this->_initMessage();
+ if (!$message->getId() && $id) {
+ $this->_getSession()->addError($this->__('Queue does not exist.'));
+ $this->_redirect('*/*/');
+ return;
+ }
+ $message->setStatus(Mage_XmlConnect_Model_Queue::STATUS_DELETED);
+ $message->save();
+ } catch (Mage_Core_Exception $e) {
+ $this->_getSession()->addException($e, $e->getMessage());
+ } catch (Exception $e) {
+ $this->_getSession()->addException($e, $this->__('Unable to delete queue.'));
+ Mage::logException($e);
+ }
+
+ $this->_redirect('*/*/queue');
+ }
+
+ /**
+ * Cancel selected queue action
+ *
+ * @return void
+ */
+ public function massCancelQueueAction()
+ {
+ $queueIds = $this->getRequest()->getParam('queue');
+ if(!is_array($queueIds)) {
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select message(s).'));
+ } else {
+ try {
+ $queue = Mage::getModel('xmlconnect/queue');
+ foreach ($queueIds as $queueId) {
+ $queue->reset()
+ ->load((int)$queueId)
+ ->setStatus(Mage_XmlConnect_Model_Queue::STATUS_CANCELED)
+ ->save();
+ }
+ Mage::getSingleton('adminhtml/session')->addSuccess(
+ Mage::helper('adminhtml')->__('Total of %d record(s) were canceled.', count($queueIds))
+ );
+ } catch (Exception $e) {
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
+ }
+ }
+
+ $this->_redirect('*/*/queue');
+ }
+
+ /**
+ * Delete selected queue action
+ *
+ * @return void
+ */
+ public function massDeleteQueueAction()
+ {
+ $queueIds = $this->getRequest()->getParam('queue');
+ if(!is_array($queueIds)) {
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select message(s).'));
+ } else {
+ try {
+ $queue = Mage::getModel('xmlconnect/queue');
+ foreach ($queueIds as $queueId) {
+ $queue->reset()
+ ->load($queueId)
+ ->setStatus(Mage_XmlConnect_Model_Queue::STATUS_DELETED)
+ ->save();
+ }
+ Mage::getSingleton('adminhtml/session')->addSuccess(
+ Mage::helper('adminhtml')->__(
+ 'Total of %d record(s) were deleted.', count($queueIds)
+ )
+ );
+ } catch (Exception $e) {
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
+ }
+ }
+
+ $this->_redirect('*/*/queue');
+ }
+
+ /**
+ * Save AirMail message action
+ */
+ public function saveMessageAction()
+ {
+ $data = $this->_filterPostData($this->getRequest()->getPost());
+ $isError = false;
+ $message = false;
+
+ if ($data) {
+ try {
+ $template = $this->_initTemplate('template_id');
+ $message = $this->_initMessage();
+
+ if (!$template->getId() && !$message->getTemplateId()) {
+ $this->_getSession()->addError(
+ $this->__('Template for new AirMail Message does not exist.')
+ );
+ $this->_redirect('*/*/queue');
+ return;
+ }
+ $temporaryObject = new Varien_Object();
+ $temporaryObject->setData($data);
+
+ if ($temporaryObject->getTemplateId()) {
+ $message->setTemplateId($temporaryObject->getTemplateId());
+ } else {
+ $message->setTemplateId($template->getId());
+ }
+
+ if (!$message->getId()) {
+ // set status for new messages only
+ $message->setStatus(Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE);
+ } elseif ($message->getStatus() != Mage_XmlConnect_Model_Queue::STATUS_IN_QUEUE) {
+ $this->_getSession()->addError(
+ $this->__('Message can not be edited when it\'s status NOT is "IN QUEUE".')
+ );
+ $this->_redirect('*/*/queue');
+ return;
+ }
+
+ switch ($temporaryObject->getType()) {
+ case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL:
+ $message->setData('type', Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL);
+ break;
+
+ case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_PUSH:
+ default:
+ $message->setData('type', Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_PUSH);
+ break;
+ }
+ if ($temporaryObject->getExecTime()) {
+ $message->setExecTime(Mage::getSingleton('core/date')->gmtDate(null, $temporaryObject->getExecTime()));
+ } else {
+ $message->setExecTime(new Zend_Db_Expr('NULL'));
+ }
+ if ($template->getId()) {
+ $message->setAppCode($template->getAppCode());
+ }
+ $message->setPushTitle($temporaryObject->getPushTitle());
+ $message->setMessageTitle($temporaryObject->getMessageTitle());
+ $message->setContent($temporaryObject->getContent());
+ $message->save();
+ } catch (Mage_Core_Exception $e) {
+ $this->_getSession()->addException($e, $e->getMessage());
+ $isError = true;
+ } catch (Exception $e) {
+ $this->_getSession()->addException($e, $this->__('Unable to save message.'));
+ $isError = true;
+ Mage::logException($e);
+ }
+ }
+
+ if ($isError) {
+ if ($isError) {
+ Mage::getSingleton('adminhtml/session')->setLoadSessionFlag(true);
+ }
+ $redirectParams = array();
+ if ($message && $message->getId()) {
+ $redirectParams['id'] = $message->getId();
+ } else {
+ $redirectParams['template_id'] = (int) $this->getRequest()->getParam('template_id');
+ }
+ $this->_redirect('*/*/queueMessage', $redirectParams);
+ } else {
+ $this->_redirect('*/*/queue');
+ }
+
+ }
+
+ /**
+ * Temlate grid
+ */
+ public function templateAction()
+ {
+ $this->loadLayout();
+ $this->_setActiveMenu('xmlconnect/template');
+ $this->renderLayout();
+ }
+
+ /**
+ * Create new template action
+ */
+ public function newTemplateAction()
+ {
+ $this->_forward('editTemplate');
+ }
+
+ /**
+ * Edit template action
+ */
+ public function editTemplateAction()
+ {
+ $template = $this->_initTemplate();
+
+ $applicationsFound = Mage::helper('xmlconnect')->getApplicationOptions();
+ if (!$template->getId() && empty($applicationsFound)) {
+ $this->_getSession()->addError(
+ $this->__('Template creation is allowed only for applications which have device type iPhone, but this kind of applications has not been found.')
+ );
+ $this->_redirect('*/*/template');
+ return;
+ }
+
+ $this->loadLayout();
+ $this->_setActiveMenu('xmlconnect/templates');
+ $this->renderLayout();
+ }
+
+ /**
+ * Save template action
+ */
+ public function saveTemplateAction()
+ {
+ $data = $this->getRequest()->getPost();
+ $template = false;
+ $isError = false;
+ if ($data) {
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
+ try {
+ $id = $this->getRequest()->getParam('id');
+ $template = $this->_initTemplate();
+ if (!$template->getId() && $id) {
+ $this->_getSession()->addError($this->__('Template does not exist.'));
+ $this->_redirect('*/*/');
+ return;
+ }
+ $template->setModifiedAt(Mage::getSingleton('core/date')->gmtDate())->addData($data);
+ $template->save();
+ } catch (Mage_Core_Exception $e) {
+ $this->_getSession()->addException($e, $e->getMessage());
+ $isError = true;
+ } catch (Exception $e) {
+ $this->_getSession()->addException($e, $this->__('Unable to save template.'));
+ $isError = true;
+ Mage::logException($e);
+ }
+ }
+
+ if ($isError && ($template && $template->getId())) {
+ Mage::getSingleton('adminhtml/session')->setLoadSessionFlag(true);
+ $this->_redirect('*/*/editTemplate', array('id' => $template->getId()));
+ } else {
+ $this->_redirect('*/*/template');
+ }
+ }
+
+ /**
+ * Add message to queue action
+ */
+ public function queueMessageAction()
+ {
+ $message = $this->_initMessage();
+ if (!$message->getId()) {
+ $template = $this->_initTemplate('template_id');
+ if (!$template->getId()) {
+ $this->_getSession()->addError(
+ $this->__('Template for new AirMail Message does not exist.')
+ );
+ $this->_redirect('*/*/template');
+ }
+ }
+
+ $this->loadLayout();
+ if ($message->getId()) {
+ $title = $this->__('Edit AirMail Message');
+ } else {
+ $title = $this->__('New AirMail Message');
+ }
+ $this->_addBreadcrumb(
+ $this->__('AirMail Message Queue'),
+ $this->__('AirMail Message Queue'),
+ $this->getUrl('*/*/queue')
+ );
+ $this->_addBreadcrumb($title, $title);
+
+ $this->_setActiveMenu('xmlconnect/queue');
+ $this->renderLayout();
+ }
+
+ /**
+ * Edit queue message action
+ */
+ public function editMessageAction()
+ {
+ $this->_forward('queueMessage');
+ }
}
diff --git a/app/code/core/Mage/XmlConnect/controllers/CartController.php b/app/code/core/Mage/XmlConnect/controllers/CartController.php
index 9974097be3..66b3e0b99b 100644
--- a/app/code/core/Mage/XmlConnect/controllers/CartController.php
+++ b/app/code/core/Mage/XmlConnect/controllers/CartController.php
@@ -27,13 +27,14 @@
/**
* XmlConnect shopping cart controller
*
- * @author Magento Core Team
+ * @author Magento Core Team
*/
-
class Mage_XmlConnect_CartController extends Mage_XmlConnect_Controller_Action
{
/**
* Shopping cart display action
+ *
+ * @return void
*/
public function indexAction()
{
@@ -56,7 +57,7 @@ public function indexAction()
}
/**
- * if customer enteres shopping cart we should mark quote
+ * if customer enters shopping cart we should mark quote
* as modified bc he can has checkout page in another window.
*/
$this->_getSession()->setCartWasUpdated(true);
@@ -67,6 +68,8 @@ public function indexAction()
/**
* Update shoping cart data action
+ *
+ * @return void
*/
public function updateAction()
{
@@ -89,11 +92,11 @@ public function updateAction()
->save();
}
$this->_getSession()->setCartWasUpdated(true);
- $this->_message(Mage::helper('xmlconnect')->__('Cart has been updated.'), parent::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Cart has been updated.'), parent::MESSAGE_STATUS_SUCCESS);
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Can\'t update cart.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Can\'t update cart.'), self::MESSAGE_STATUS_ERROR);
}
}
@@ -153,29 +156,27 @@ public function addAction()
* Check product availability
*/
if (!$product) {
- $this->_message(Mage::helper('xmlconnect')->__('Product is unavailable.'), parent::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Product is unavailable.'), parent::MESSAGE_STATUS_ERROR);
return;
}
if ($product->isConfigurable()) {
$request = $this->_getProductRequest($params);
- $cartCandidates = $product->getTypeInstance(true)->prepareForCart($request, $product);
+
/**
* Hardcoded Configurable product default
+ * Set min required qty for a product if it's need
*/
- $minSaleQty = ((isset($params['qty']) ? $params['qty'] : 0) > 1) ? $params['qty'] : 1;
- if (is_array($cartCandidates)) {
- foreach ($cartCandidates as $candidate) {
- $current = $candidate->getStockItem()->getMinSaleQty();
- if ($minSaleQty < $current) {
- $minSaleQty = $current;
- }
- }
- }
- if ($minSaleQty) {
- $params['qty'] = $minSaleQty;
+ $qty = isset($params['qty']) ? $params['qty'] : 0;
+ $requestedQty = ($qty > 1) ? $qty : 1;
+ $subProduct = $product->getTypeInstance(true)->getProductByAttributes($request->getSuperAttribute(), $product);
+
+ if ($requestedQty < ($requiredQty = $subProduct->getStockItem()->getMinSaleQty())) {
+ $requestedQty = $requiredQty;
}
+
+ $params['qty'] = $requestedQty;
}
$cart->addProduct($product, $params);
@@ -195,9 +196,9 @@ public function addAction()
);
if (!$this->_getSession()->getNoCartRedirect(true)) {
- $message = Mage::helper('xmlconnect')->__('%s has been added to your cart.', Mage::helper('core')->htmlEscape($product->getName()));
+ $message = $this->__('%s has been added to your cart.', Mage::helper('core')->htmlEscape($product->getName()));
if ($cart->getQuote()->getHasError()) {
- $message .= Mage::helper('xmlconnect')->__(' But cart has some errors.');
+ $message .= $this->__(' But cart has some errors.');
}
$this->_message($message, parent::MESSAGE_STATUS_SUCCESS);
}
@@ -208,12 +209,14 @@ public function addAction()
$this->_message(implode("\n", array_unique(explode("\n", $e->getMessage()))), parent::MESSAGE_STATUS_ERROR);
}
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Can\'t add item to shopping cart.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Can\'t add item to shopping cart.'), self::MESSAGE_STATUS_ERROR);
}
}
/**
* Delete shoping cart item action
+ *
+ * @return void
*/
public function deleteAction()
{
@@ -221,17 +224,19 @@ public function deleteAction()
if ($id) {
try {
$this->_getCart()->removeItem($id)->save();
- $this->_message(Mage::helper('xmlconnect')->__('Item has been deleted from cart.'), parent::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Item has been deleted from cart.'), parent::MESSAGE_STATUS_SUCCESS);
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), parent::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Can\'t remove the item.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Can\'t remove the item.'), self::MESSAGE_STATUS_ERROR);
}
}
}
/**
* Initialize coupon
+ *
+ * @return void
*/
public function couponAction()
{
@@ -239,7 +244,7 @@ public function couponAction()
* No reason continue with empty shopping cart
*/
if (!$this->_getQuote()->getItemsCount()) {
- $this->_message(Mage::helper('xmlconnect')->__('Shopping cart is empty.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Shopping cart is empty.'), self::MESSAGE_STATUS_ERROR);
return;
}
@@ -250,7 +255,7 @@ public function couponAction()
$oldCouponCode = $this->_getQuote()->getCouponCode();
if (!strlen($couponCode) && !strlen($oldCouponCode)) {
- $this->_message(Mage::helper('xmlconnect')->__('Coupon code is empty.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Coupon code is empty.'), self::MESSAGE_STATUS_ERROR);
return;
}
@@ -262,23 +267,25 @@ public function couponAction()
if ($couponCode) {
if ($couponCode == $this->_getQuote()->getCouponCode()) {
- $this->_message(Mage::helper('xmlconnect')->__('Coupon code %s was applied.', strip_tags($couponCode)), parent::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Coupon code %s was applied.', strip_tags($couponCode)), parent::MESSAGE_STATUS_SUCCESS);
} else {
- $this->_message(Mage::helper('xmlconnect')->__('Coupon code %s is not valid.', strip_tags($couponCode)), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Coupon code %s is not valid.', strip_tags($couponCode)), self::MESSAGE_STATUS_ERROR);
}
} else {
- $this->_message(Mage::helper('xmlconnect')->__('Coupon code was canceled.'), parent::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Coupon code was canceled.'), parent::MESSAGE_STATUS_SUCCESS);
}
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Can\'t apply the coupon code.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Can\'t apply the coupon code.'), self::MESSAGE_STATUS_ERROR);
}
}
/**
* Get shopping cart summary and flag is_virtual
+ *
+ * @return void
*/
public function infoAction()
{
diff --git a/app/code/core/Mage/XmlConnect/controllers/CatalogController.php b/app/code/core/Mage/XmlConnect/controllers/CatalogController.php
index 8568c78e33..ea04fef8c2 100644
--- a/app/code/core/Mage/XmlConnect/controllers/CatalogController.php
+++ b/app/code/core/Mage/XmlConnect/controllers/CatalogController.php
@@ -27,13 +27,14 @@
/**
* XmlConnect catalog controller
*
- * @author Magento Core Team
+ * @author Magento Core Team
*/
-
class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Action
{
/**
* Category list
+ *
+ * @return void
*/
public function categoryAction()
{
@@ -43,6 +44,8 @@ public function categoryAction()
/**
* Filter product list
+ *
+ * @return void
*/
public function filtersAction()
{
@@ -53,12 +56,14 @@ public function filtersAction()
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
Mage::logException($e);
- $this->_message(Mage::helper('xmlconnect')->__('An error occurred while loading category filters.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('An error occurred while loading category filters.'), self::MESSAGE_STATUS_ERROR);
}
}
/**
* Product information
+ *
+ * @return void
*/
public function productAction()
{
@@ -69,13 +74,15 @@ public function productAction()
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Unable to load product info.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Unable to load product info.'), self::MESSAGE_STATUS_ERROR);
Mage::logException($e);
}
}
/**
* Product options list
+ *
+ * @return void
*/
public function productOptionsAction()
{
@@ -83,9 +90,10 @@ public function productOptionsAction()
$this->renderLayout();
}
-
/**
* Product gallery images list
+ *
+ * @return void
*/
public function productGalleryAction()
{
@@ -95,6 +103,8 @@ public function productGalleryAction()
/**
* Product reviews list
+ *
+ * @return void
*/
public function productReviewsAction()
{
@@ -104,6 +114,8 @@ public function productReviewsAction()
/**
* Add new review
+ *
+ * @return void
*/
public function productReviewAction()
{
@@ -113,6 +125,8 @@ public function productReviewAction()
/**
* Perform search products
+ *
+ * @return void
*/
public function searchAction()
{
@@ -160,6 +174,8 @@ public function searchAction()
/**
* Retrieve suggestions based on search query
+ *
+ * @return void
*/
public function searchSuggestAction()
{
@@ -181,12 +197,12 @@ public function sendEmailAction()
$session = Mage::getSingleton('customer/session');
if (!$helper->isEnabled()) {
- $this->_message(Mage::helper('xmlconnect')->__('Tell a Friend is disabled.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Tell a Friend is disabled.'), self::MESSAGE_STATUS_ERROR);
return $this;
}
if (!$helper->isAllowForGuest() && !$session->isLoggedIn()) {
- $this->_message(Mage::helper('xmlconnect')->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
return $this;
}
@@ -195,13 +211,13 @@ public function sendEmailAction()
*/
$productId = (int)$this->getRequest()->getParam('product_id');
if (!$productId) {
- $this->_message(Mage::helper('xmlconnect')->__('No product selected.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('No product selected.'), self::MESSAGE_STATUS_ERROR);
return $this;
}
$product = Mage::getModel('catalog/product')
->load($productId);
if (!$product->getId() || !$product->isVisibleInCatalog()) {
- $this->_message(Mage::helper('xmlconnect')->__('Selected product is unavailable.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Selected product is unavailable.'), self::MESSAGE_STATUS_ERROR);
return $this;
}
@@ -218,14 +234,14 @@ public function sendEmailAction()
Mage::register('send_to_friend_model', $model);
if ($model->getMaxSendsToFriend()) {
-// $this->_message(Mage::helper('xmlconnect')->__('Messages cannot be sent more than %d times in an hour.', $model->getMaxSendsToFriend()), self::MESSAGE_STATUS_WARNING);
+// $this->_message($this->__('Messages cannot be sent more than %d times in an hour.', $model->getMaxSendsToFriend()), self::MESSAGE_STATUS_WARNING);
// return $this;
}
- $data = $this->getRequest()->getPost();
+ $data = $this->getRequest()->getPost();
if (!$data) {
- $this->_message(Mage::helper('xmlconnect')->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
return $this;
}
@@ -254,21 +270,21 @@ public function sendEmailAction()
$validate = $model->validate();
if ($validate === true) {
$model->send();
- $this->_message(Mage::helper('xmlconnect')->__('Tell a Friend link has been sent.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Tell a Friend link has been sent.'), self::MESSAGE_STATUS_SUCCESS);
return;
} else {
if (is_array($validate)) {
$this->_message(implode(' ', $validate), self::MESSAGE_STATUS_ERROR);
return;
} else {
- $this->_message(Mage::helper('xmlconnect')->__('There were some problems with the data.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('There were some problems with the data.'), self::MESSAGE_STATUS_ERROR);
return;
}
}
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Some emails were not sent.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Some emails were not sent.'), self::MESSAGE_STATUS_ERROR);
}
return $this;
diff --git a/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php b/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php
index 8ed89734e4..1eba240c62 100644
--- a/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php
+++ b/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php
@@ -44,7 +44,7 @@ public function preDispatch()
if (!Mage::getSingleton('customer/session')->isLoggedIn()
&& !Mage::getSingleton('checkout/session')->getQuote()->isAllowedGuestCheckout()) {
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
- $this->_message(Mage::helper('xmlconnect')->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
return ;
}
}
@@ -61,19 +61,21 @@ public function getOnepage()
/**
* Onepage Checkout page
+ *
+ * @return void
*/
public function indexAction()
{
if (!Mage::helper('checkout')->canOnepageCheckout()) {
- $this->_message(Mage::helper('xmlconnect')->__('Onepage checkout is disabled.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Onepage checkout is disabled.'), self::MESSAGE_STATUS_ERROR);
return;
}
$quote = $this->getOnepage()->getQuote();
if ($quote->getHasError()) {
- $this->_message(Mage::helper('xmlconnect')->__('Cart has some errors.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Cart has some errors.'), self::MESSAGE_STATUS_ERROR);
return;
} else if (!$quote->hasItems()) {
- $this->_message(Mage::helper('xmlconnect')->__('Cart is empty.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Cart is empty.'), self::MESSAGE_STATUS_ERROR);
return;
} else if (!$quote->validateMinimumAmount()) {
$error = Mage::getStoreConfig('sales/minimum_order/error_message');
@@ -89,6 +91,8 @@ public function indexAction()
/**
* Display customer new billing addrress form
+ *
+ * @return void
*/
public function newBillingAddressFormAction()
{
@@ -98,6 +102,8 @@ public function newBillingAddressFormAction()
/**
* Display customer new shipping addrress form
+ *
+ * @return void
*/
public function newShippingAddressFormAction()
{
@@ -107,6 +113,8 @@ public function newShippingAddressFormAction()
/**
* Billing addresses list action
+ *
+ * @return void
*/
public function billingAddressAction()
{
@@ -116,11 +124,13 @@ public function billingAddressAction()
/**
* Save billing address to current quote using onepage model
+ *
+ * @return void
*/
public function saveBillingAddressAction()
{
if (!$this->getRequest()->isPost()) {
- $this->_message(Mage::helper('xmlconnect')->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
return;
}
@@ -131,7 +141,7 @@ public function saveBillingAddressAction()
}
$result = $this->getOnepage()->saveBilling($data, $customerAddressId);
if (!isset($result['error'])) {
- $this->_message(Mage::helper('xmlconnect')->__('Billing address has been set.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Billing address has been set.'), self::MESSAGE_STATUS_SUCCESS);
} else {
if (!is_array($result['message'])) {
$result['message'] = array($result['message']);
@@ -142,6 +152,8 @@ public function saveBillingAddressAction()
/**
* Shipping addresses list action
+ *
+ * @return void
*/
public function shippingAddressAction()
{
@@ -151,11 +163,13 @@ public function shippingAddressAction()
/**
* Save shipping address to current quote using onepage model
+ *
+ * @return void
*/
public function saveShippingAddressAction()
{
if (!$this->getRequest()->isPost()) {
- $this->_message(Mage::helper('xmlconnect')->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
return;
}
@@ -163,7 +177,7 @@ public function saveShippingAddressAction()
$customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);
$result = $this->getOnepage()->saveShipping($data, $customerAddressId);
if (!isset($result['error'])) {
- $this->_message(Mage::helper('xmlconnect')->__('Shipping address has been set.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Shipping address has been set.'), self::MESSAGE_STATUS_SUCCESS);
} else {
if (!is_array($result['message'])) {
$result['message'] = array($result['message']);
@@ -174,11 +188,13 @@ public function saveShippingAddressAction()
/**
* Get shipping methods for current quote
+ *
+ * @return void
*/
public function shippingMethodsAction()
{
try {
- $result = array('error' => Mage::helper('xmlconnect')->__('Error.'));
+ $result = array('error' => $this->__('Error.'));
$this->getOnepage()->getQuote()->getShippingAddress()->setCollectShippingRates(true);
$this->getOnepage()->getQuote()->collectTotals()->save();
$this->loadLayout(false);
@@ -192,18 +208,20 @@ public function shippingMethodsAction()
/**
* Shipping method save action
+ *
+ * @return void
*/
public function saveShippingMethodAction()
{
if (!$this->getRequest()->isPost()) {
- $this->_message(Mage::helper('xmlconnect')->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
return;
}
$data = $this->getRequest()->getPost('shipping_method', '');
$result = $this->getOnepage()->saveShippingMethod($data);
if (!isset($result['error'])) {
- $this->_message(Mage::helper('xmlconnect')->__('Shipping method has been set.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Shipping method has been set.'), self::MESSAGE_STATUS_SUCCESS);
} else {
if (!is_array($result['message'])) {
$result['message'] = array($result['message']);
@@ -216,6 +234,8 @@ public function saveShippingMethodAction()
/**
* Save checkout method
+ *
+ * @return void
*/
public function saveMethodAction()
{
@@ -223,7 +243,7 @@ public function saveMethodAction()
$method = (string) $this->getRequest()->getPost('method');
$result = $this->getOnepage()->saveCheckoutMethod($method);
if (!isset($result['error'])) {
- $this->_message(Mage::helper('xmlconnect')->__('Payment Method has been set.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Payment Method has been set.'), self::MESSAGE_STATUS_SUCCESS);
} else {
if (!is_array($result['message'])) {
$result['message'] = array($result['message']);
@@ -235,20 +255,30 @@ public function saveMethodAction()
/**
* Get payment methods action
+ *
+ * @return void
*/
public function paymentMethodsAction()
{
- $this->loadLayout(false);
- $this->renderLayout();
+ try {
+ $this->loadLayout(false);
+ $this->renderLayout();
+ return;
+ } catch (Mage_Core_Exception $e) {
+ $result['error'] = $e->getMessage();
+ }
+ $this->_message($result['error'], self::MESSAGE_STATUS_ERROR);
}
/**
* Save payment action
+ *
+ * @return void
*/
public function savePaymentAction()
{
if (!$this->getRequest()->isPost()) {
- $this->_message(Mage::helper('xmlconnect')->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
return;
}
try {
@@ -256,7 +286,7 @@ public function savePaymentAction()
$result = array();
$data = $this->getRequest()->getPost('payment', array());
$result = $this->getOnepage()->savePayment($data);
- $this->_message(Mage::helper('xmlconnect')->__('Payment method was successfully set.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Payment method was successfully set.'), self::MESSAGE_STATUS_SUCCESS);
return;
} catch (Mage_Payment_Exception $e) {
$result['error'] = $e->getMessage();
@@ -264,13 +294,15 @@ public function savePaymentAction()
$result['error'] = $e->getMessage();
} catch (Exception $e) {
Mage::logException($e);
- $result['error'] = Mage::helper('xmlconnect')->__('Unable to set payment method.');
+ $result['error'] = $this->__('Unable to set payment method.');
}
$this->_message($result['error'], self::MESSAGE_STATUS_ERROR);
}
/**
* Order summary info action
+ *
+ * @return void
*/
public function orderReviewAction()
{
@@ -281,11 +313,13 @@ public function orderReviewAction()
/**
* Create order action
+ *
+ * @return void
*/
public function saveOrderAction()
{
if (!$this->getRequest()->isPost()) {
- $this->_message(Mage::helper('xmlconnect')->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
return;
}
@@ -293,7 +327,7 @@ public function saveOrderAction()
if ($requiredAgreements = Mage::helper('checkout')->getRequiredAgreementIds()) {
$postedAgreements = array_keys($this->getRequest()->getPost('agreement', array()));
if ($diff = array_diff($requiredAgreements, $postedAgreements)) {
- $error = Mage::helper('xmlconnect')->__('Please agree to all the terms and conditions before placing the order.');
+ $error = $this->__('Please agree to all the terms and conditions before placing the order.');
$this->_message($error, self::MESSAGE_STATUS_ERROR);
return;
}
@@ -308,9 +342,9 @@ public function saveOrderAction()
$orderId = $this->getOnepage()->getLastOrderId();
- $text = Mage::helper('xmlconnect')->__('Thank you for your purchase! ');
- $text .= Mage::helper('xmlconnect')->__('Your order # is: %s. ', $orderId);
- $text .= Mage::helper('xmlconnect')->__('You will receive an order confirmation email with details of your order and a link to track its progress.');
+ $text = $this->__('Thank you for your purchase! ');
+ $text .= $this->__('Your order # is: %s. ', $orderId);
+ $text .= $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.');
$message->addChild('text', $text);
$message->addChild('order_id', $orderId);
@@ -327,7 +361,7 @@ public function saveOrderAction()
} catch (Exception $e) {
Mage::logException($e);
Mage::helper('checkout')->sendPaymentFailedEmail($this->getOnepage()->getQuote(), $e->getMessage());
- $error = Mage::helper('xmlconnect')->__('An error occurred while processing your order. Please contact us or try again later.');
+ $error = $this->__('An error occurred while processing your order. Please contact us or try again later.');
}
$this->getOnepage()->getQuote()->save();
diff --git a/app/code/core/Mage/XmlConnect/controllers/CmsController.php b/app/code/core/Mage/XmlConnect/controllers/CmsController.php
index 99140755a2..99cd88b583 100644
--- a/app/code/core/Mage/XmlConnect/controllers/CmsController.php
+++ b/app/code/core/Mage/XmlConnect/controllers/CmsController.php
@@ -27,14 +27,14 @@
/**
* XmlConnect cms page controller
*
- * @author Magento Core Team
+ * @author Magento Core Team
*/
-
class Mage_XmlConnect_CmsController extends Mage_XmlConnect_Controller_Action
{
-
/**
* Declare content type header
+ *
+ * @return void
*/
public function preDispatch()
{
@@ -45,6 +45,7 @@ public function preDispatch()
/**
* Category list
*
+ * @return void
*/
public function pageAction()
{
diff --git a/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php b/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php
index 2c1d58d593..117549433f 100644
--- a/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php
+++ b/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php
@@ -27,13 +27,14 @@
/**
* XmlConnect index controller
*
- * @author Magento Core Team
+ * @author Magento Core Team
*/
-
class Mage_XmlConnect_ConfigurationController extends Mage_Core_Controller_Front_Action
{
/**
* Declare content type header
+ *
+ * @return void
*/
public function preDispatch()
{
@@ -44,6 +45,7 @@ public function preDispatch()
/**
* Initialize application
*
+ * @throws Mage_Core_Exception
* @return Mage_XmlConnect_Model_Application
*/
protected function _initApp()
@@ -60,11 +62,11 @@ protected function _initApp()
Mage::getSingleton('core/locale')->emulate($app->getStoreId());
$app->setScreenSize($screenSize);
if (!$app->getId()) {
- Mage::throwException(Mage::helper('xmlconnect')->__('App with specified code does not exist.'));
+ Mage::throwException($this->__('App with specified code does not exist.'));
}
$app->loadConfiguration();
} else {
- Mage::throwException(Mage::helper('xmlconnect')->__('App code required.'));
+ Mage::throwException($this->__('App code required.'));
}
Mage::register('current_app', $app);
return $app;
@@ -72,6 +74,8 @@ protected function _initApp()
/**
* Default action
+ *
+ * @return void
*/
public function indexAction()
{
@@ -92,8 +96,8 @@ public function indexAction()
foreach ($cookieToSetArray as $item) {
if (!isset($_COOKIE[$item['cookieName']]) ||
(isset($_COOKIE[$item['cookieName']]) &&
- ($_COOKIE[$item['cookieName']] != $this->getRequest()->getParam($item['paramName'])))
- ) {
+ ($_COOKIE[$item['cookieName']] != $this->getRequest()->getParam($item['paramName']))
+ )) {
/**
* @todo add management of cookie expire to application admin panel
*/
@@ -123,7 +127,7 @@ public function indexAction()
} catch (Exception $e) {
$message = new Mage_XmlConnect_Model_Simplexml_Element(' ');
$message->addChild('status', Mage_XmlConnect_Controller_Action::MESSAGE_STATUS_ERROR);
- $message->addChild('text', Mage::helper('xmlconnect')->__('Can\'t show configuration.'));
+ $message->addChild('text', $this->__('Can\'t show configuration.'));
Mage::logException($e);
$this->getResponse()->setBody($message->asNiceXml());
}
diff --git a/app/code/core/Mage/XmlConnect/controllers/CustomerController.php b/app/code/core/Mage/XmlConnect/controllers/CustomerController.php
index 27f0e0feb2..089678ee1d 100644
--- a/app/code/core/Mage/XmlConnect/controllers/CustomerController.php
+++ b/app/code/core/Mage/XmlConnect/controllers/CustomerController.php
@@ -27,9 +27,8 @@
/**
* XmlConnect customer controller
*
- * @author Magento Core Team
+ * @author Magento Core Team
*/
-
class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Action
{
/**
@@ -42,7 +41,7 @@ public function loginAction()
$session = $this->_getSession();
$request = $this->getRequest();
if ($session->isLoggedIn()) {
- $this->_message(Mage::helper('xmlconnect')->__('You are already logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('You are already logged in.'), self::MESSAGE_STATUS_ERROR);
return;
}
@@ -54,9 +53,9 @@ public function loginAction()
if ($session->getCustomer()->getIsJustConfirmed()) {
$session->getCustomer()->sendNewAccountEmail('confirmed');
}
- $this->_message(Mage::helper('xmlconnect')->__('Authentication complete.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Authentication complete.'), self::MESSAGE_STATUS_SUCCESS);
} else {
- $this->_message(Mage::helper('xmlconnect')->__('Invalid login or password.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Invalid login or password.'), self::MESSAGE_STATUS_ERROR);
}
} catch (Mage_Core_Exception $e) {
switch ($e->getCode()) {
@@ -71,26 +70,27 @@ public function loginAction()
}
$this->_message($message, self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Customer authentication problem.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer authentication problem.'), self::MESSAGE_STATUS_ERROR);
}
} else {
- $this->_message(Mage::helper('xmlconnect')->__('Login and password are required.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Login and password are required.'), self::MESSAGE_STATUS_ERROR);
}
}
/**
* Customer logout
*
+ * @return void
*/
public function logoutAction()
{
try {
$this->_getSession()->logout();
- $this->_message(Mage::helper('xmlconnect')->__('Logout complete.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Logout complete.'), self::MESSAGE_STATUS_SUCCESS);
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Customer logout problem.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer logout problem.'), self::MESSAGE_STATUS_ERROR);
}
}
@@ -105,7 +105,7 @@ public function formAction()
$editFlag = (int)$this->getRequest()->getParam('edit');
if ($editFlag == 1) {
if (!$this->_getSession()->isLoggedIn()) {
- $this->_message(Mage::helper('xmlconnect')->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
return ;
}
$customer = $this->_getSession()->getCustomer();
@@ -123,7 +123,7 @@ public function formAction()
public function editAction()
{
if (!$this->_getSession()->isLoggedIn()) {
- $this->_message(Mage::helper('xmlconnect')->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
return ;
}
if ($this->getRequest()->isPost()) {
@@ -154,11 +154,11 @@ public function editAction()
$confPass = $this->getRequest()->getPost('confirmation');
if (empty($currPass) || empty($newPass) || empty($confPass)) {
- $errors[] = Mage::helper('xmlconnect')->__('Password fields cannot be empty.');
+ $errors[] = $this->__('Password fields cannot be empty.');
}
if ($newPass != $confPass) {
- $errors[] = Mage::helper('xmlconnect')->__('Please make sure your passwords match.');
+ $errors[] = $this->__('Please make sure your passwords match.');
}
$oldPass = $this->_getSession()->getCustomer()->getPasswordHash();
@@ -171,7 +171,7 @@ public function editAction()
if ($customer->hashPassword($currPass, $salt) == $oldPass) {
$customer->setPassword($newPass);
} else {
- $errors[] = Mage::helper('xmlconnect')->__('Invalid current password.');
+ $errors[] = $this->__('Invalid current password.');
}
}
@@ -186,15 +186,19 @@ public function editAction()
try {
$customer->save();
$this->_getSession()->setCustomer($customer);
- $this->_message(Mage::helper('xmlconnect')->__('Account information has been saved.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Account information has been saved.'), self::MESSAGE_STATUS_SUCCESS);
return;
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Can\'t save the customer.'), self::MESSAGE_STATUS_ERROR);
+ if ($e instanceof Mage_Eav_Model_Entity_Attribute_Exception) {
+ $this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
+ } else {
+ $this->_message($this->__('Can\'t save the customer.'), self::MESSAGE_STATUS_ERROR);
+ }
}
} else {
- $this->_message(Mage::helper('xmlconnect')->__('POST data is not valid.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('POST data is not valid.'), self::MESSAGE_STATUS_ERROR);
}
}
@@ -208,7 +212,7 @@ public function saveAction()
$session = $this->_getSession();
$request = $this->getRequest();
if ($session->isLoggedIn()) {
- $this->_message(Mage::helper('xmlconnect')->__('You are already logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('You are already logged in.'), self::MESSAGE_STATUS_ERROR);
return;
}
@@ -258,7 +262,7 @@ public function saveAction()
if ($customer->isConfirmationRequired()) {
$customer->sendNewAccountEmail('confirmation', $session->getBeforeAuthUrl());
- $message = Mage::helper('xmlconnect')->__('Account confirmation is required. Please check your email for the confirmation link.');
+ $message = $this->__('Account confirmation is required. Please check your email for the confirmation link.');
$messageXmlObj = new Mage_XmlConnect_Model_Simplexml_Element(' ');
$messageXmlObj->addChild('status', self::MESSAGE_STATUS_SUCCESS);
$messageXmlObj->addChild('text', $message);
@@ -268,28 +272,28 @@ public function saveAction()
} else {
$session->setCustomerAsLoggedIn($customer);
$customer->sendNewAccountEmail('registered');
- $this->_message(Mage::helper('xmlconnect')->__('Thank you for registering!'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Thank you for registering!'), self::MESSAGE_STATUS_SUCCESS);
return;
}
} else {
if (is_array($errors)) {
$message = implode("\n", $errors);
} else {
- $message = Mage::helper('xmlconnect')->__('Invalid customer data.');
+ $message = $this->__('Invalid customer data.');
}
$this->_message($message, self::MESSAGE_STATUS_ERROR);
return ;
}
} catch (Mage_Core_Exception $e) {
if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS) {
- $message = Mage::helper('xmlconnect')->__('An account with this email address already exists.');
+ $message = $this->__('An account with this email address already exists.');
$session->setEscapeMessages(false);
} else {
$message = $e->getMessage();
}
$this->_message($message, self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Can\'t save the customer.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Can\'t save the customer.'), self::MESSAGE_STATUS_ERROR);
}
}
}
@@ -304,7 +308,7 @@ public function forgotPasswordAction()
$email = $this->getRequest()->getPost('email');
if ($email) {
if (!Zend_Validate::is($email, 'EmailAddress')) {
- $this->_message(Mage::helper('xmlconnect')->__('Invalid email address.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Invalid email address.'), self::MESSAGE_STATUS_ERROR);
return;
}
$customer = Mage::getModel('customer/customer')
@@ -316,19 +320,19 @@ public function forgotPasswordAction()
$newPassword = $customer->generatePassword();
$customer->changePassword($newPassword, false);
$customer->sendPasswordReminderEmail();
- $this->_message(Mage::helper('xmlconnect')->__('A new password has been sent.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('A new password has been sent.'), self::MESSAGE_STATUS_SUCCESS);
return;
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Problem changing or sending password.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Problem changing or sending password.'), self::MESSAGE_STATUS_ERROR);
}
} else {
- $this->_message(Mage::helper('xmlconnect')->__('This email address was not found in our records.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('This email address was not found in our records.'), self::MESSAGE_STATUS_ERROR);
}
} else {
- $this->_message(Mage::helper('xmlconnect')->__('Customer email not specified.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer email not specified.'), self::MESSAGE_STATUS_ERROR);
}
}
@@ -340,7 +344,7 @@ public function forgotPasswordAction()
public function addressAction()
{
if (!$this->_getSession()->isLoggedIn()) {
- $this->_message(Mage::helper('xmlconnect')->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
return ;
}
@@ -363,7 +367,7 @@ public function addressAction()
public function addressFormAction()
{
if (!$this->_getSession()->isLoggedIn()) {
- $this->_message(Mage::helper('xmlconnect')->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
return ;
}
@@ -376,7 +380,7 @@ public function addressFormAction()
if ($addressId) {
$address->load($addressId);
if ($address->getCustomerId() != $this->_getSession()->getCustomerId()) {
- $this->_message(Mage::helper('xmlconnect')->__('Specified address does not exist.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Specified address does not exist.'), self::MESSAGE_STATUS_ERROR);
return ;
}
}
@@ -393,7 +397,7 @@ public function addressFormAction()
public function deleteAddressAction()
{
if (!$this->_getSession()->isLoggedIn()) {
- $this->_message(Mage::helper('xmlconnect')->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
return ;
}
@@ -404,16 +408,16 @@ public function deleteAddressAction()
// Validate address_id <=> customer_id
if ($address->getCustomerId() != $this->_getSession()->getCustomerId()) {
- $this->_message(Mage::helper('xmlconnect')->__('Address does not belong to this customer.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Address does not belong to this customer.'), self::MESSAGE_STATUS_ERROR);
return;
}
try {
$address->delete();
- $this->_message(Mage::helper('xmlconnect')->__('Address has been deleted.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Address has been deleted.'), self::MESSAGE_STATUS_SUCCESS);
} catch (Exception $e) {
Mage::logException($e);
- $this->_message(Mage::helper('xmlconnect')->__('An error occurred while deleting the address.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('An error occurred while deleting the address.'), self::MESSAGE_STATUS_ERROR);
}
}
}
@@ -426,7 +430,7 @@ public function deleteAddressAction()
public function saveAddressAction()
{
if (!$this->_getSession()->isLoggedIn()) {
- $this->_message(Mage::helper('xmlconnect')->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
return ;
}
@@ -473,25 +477,25 @@ public function saveAddressAction()
$message = new Mage_XmlConnect_Model_Simplexml_Element(' ');
$message->addChild('status', self::MESSAGE_STATUS_SUCCESS);
- $message->addChild('text', Mage::helper('xmlconnect')->__('Address has been saved.'));
+ $message->addChild('text', $this->__('Address has been saved.'));
$message->addChild('address_id', $address->getId());
$this->getResponse()->setBody($message->asNiceXml());
return;
} else {
- if (is_array($addressValidation)) {
- $this->_message(implode('. ', $addressValidation), self::MESSAGE_STATUS_ERROR);
+ if (is_array($errors)) {
+ $this->_message(implode('. ', $errors), self::MESSAGE_STATUS_ERROR);
} else {
- $this->_message(Mage::helper('xmlconnect')->__('Can\'t save address.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Can\'t save address.'), self::MESSAGE_STATUS_ERROR);
}
}
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
Mage::logException($e);
- $this->_message(Mage::helper('xmlconnect')->__('Can\'t save address.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Can\'t save address.'), self::MESSAGE_STATUS_ERROR);
}
} else {
- $this->_message(Mage::helper('xmlconnect')->__('Address data not specified.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Address data not specified.'), self::MESSAGE_STATUS_ERROR);
}
}
@@ -503,7 +507,7 @@ public function saveAddressAction()
public function orderListAction()
{
if (!$this->_getSession()->isLoggedIn()) {
- $this->_message(Mage::helper('xmlconnect')->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
return ;
}
@@ -513,6 +517,8 @@ public function orderListAction()
/**
* Check if customer is loggined
+ *
+ * @return void
*/
public function isLogginedAction()
{
diff --git a/app/code/core/Mage/XmlConnect/controllers/IndexController.php b/app/code/core/Mage/XmlConnect/controllers/IndexController.php
index 784929b953..c73d409dda 100644
--- a/app/code/core/Mage/XmlConnect/controllers/IndexController.php
+++ b/app/code/core/Mage/XmlConnect/controllers/IndexController.php
@@ -27,20 +27,18 @@
/**
* XmlConnect index controller
*
- * @author Magento Core Team
+ * @author Magento Core Team
*/
-
class Mage_XmlConnect_IndexController extends Mage_XmlConnect_Controller_Action
{
-
/**
* Default action
*
+ * @return void
*/
public function indexAction()
{
$this->loadLayout(false);
$this->renderLayout();
}
-
}
diff --git a/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php b/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php
index 8ed7196993..a76563964d 100644
--- a/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php
+++ b/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php
@@ -57,36 +57,40 @@ public function preDispatch()
if (!Mage::getSingleton('customer/session')->isLoggedIn()
&& !Mage::getSingleton('checkout/session')->getQuote()->isAllowedGuestCheckout()) {
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
- $this->_message(Mage::helper('xmlconnect')->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
return ;
}
}
/**
* Start MEP Checkout
+ *
+ * @return void
*/
public function indexAction()
{
try {
$this->_initCheckout();
$reservedOrderId = $this->_checkout->initCheckout();
- $this->_message(Mage::helper('xmlconnect')->__('Checkout has been initialized.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Checkout has been initialized.'), self::MESSAGE_STATUS_SUCCESS);
return;
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Unable to start MEP Checkout.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Unable to start MEP Checkout.'), self::MESSAGE_STATUS_ERROR);
Mage::logException($e);
}
}
/**
* Save shipping address to current quote using onepage model
+ *
+ * @return void
*/
public function saveShippingAddressAction()
{
if (!$this->getRequest()->isPost()) {
- $this->_message(Mage::helper('xmlconnect')->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
return;
}
try {
@@ -94,7 +98,7 @@ public function saveShippingAddressAction()
$data = $this->getRequest()->getPost('shipping', array());
$result = $this->_checkout->saveShipping($data);
if (!isset($result['error'])) {
- $this->_message(Mage::helper('xmlconnect')->__('Shipping address has been set.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Shipping address has been set.'), self::MESSAGE_STATUS_SUCCESS);
} else {
if (!is_array($result['message'])) {
$result['message'] = array($result['message']);
@@ -104,13 +108,15 @@ public function saveShippingAddressAction()
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Unable to save shipping address.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Unable to save shipping address.'), self::MESSAGE_STATUS_ERROR);
Mage::logException($e);
}
}
/**
* Get shipping methods for current quote
+ *
+ * @return void
*/
public function shippingMethodsAction()
{
@@ -121,18 +127,20 @@ public function shippingMethodsAction()
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Unable to get shipping methods list.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Unable to get shipping methods list.'), self::MESSAGE_STATUS_ERROR);
Mage::logException($e);
}
}
/**
* Shipping method save action
+ *
+ * @return void
*/
public function saveShippingMethodAction()
{
if (!$this->getRequest()->isPost()) {
- $this->_message(Mage::helper('xmlconnect')->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
return;
}
try {
@@ -142,7 +150,7 @@ public function saveShippingMethodAction()
if (!isset($result['error'])) {
$message = new Mage_XmlConnect_Model_Simplexml_Element(' ');
$message->addChild('status', self::MESSAGE_STATUS_SUCCESS);
- $message->addChild('text', Mage::helper('xmlconnect')->__('Shipping method has been set.'));
+ $message->addChild('text', $this->__('Shipping method has been set.'));
if ($this->_getQuote()->isVirtual()) {
$quoteAddress = $this->_getQuote()->getBillingAddress();
} else {
@@ -160,13 +168,15 @@ public function saveShippingMethodAction()
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Unable to save shipping method.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Unable to save shipping method.'), self::MESSAGE_STATUS_ERROR);
Mage::logException($e);
}
}
/**
* Shopping cart totals
+ *
+ * @return void
*/
public function cartTotalsAction()
{
@@ -178,18 +188,20 @@ public function cartTotalsAction()
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Unable to collect cart totals.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Unable to collect cart totals.'), self::MESSAGE_STATUS_ERROR);
Mage::logException($e);
}
}
/**
* Submit the order
+ *
+ * @return void
*/
public function saveOrderAction()
{
if (!$this->getRequest()->isPost()) {
- $this->_message(Mage::helper('xmlconnect')->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Specified invalid data.'), self::MESSAGE_STATUS_ERROR);
return;
}
try {
@@ -217,9 +229,9 @@ public function saveOrderAction()
$orderId = $this->_checkout->getLastOrderId();
- $text = Mage::helper('xmlconnect')->__('Thank you for your purchase! ');
- $text .= Mage::helper('xmlconnect')->__('Your order # is: %s. ', $orderId);
- $text .= Mage::helper('xmlconnect')->__('You will receive an order confirmation email with details of your order and a link to track its progress.');
+ $text = $this->__('Thank you for your purchase! ');
+ $text .= $this->__('Your order # is: %s. ', $orderId);
+ $text .= $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.');
$message->addChild('text', $text);
$message->addChild('order_id', $orderId);
@@ -228,7 +240,7 @@ public function saveOrderAction()
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Unable to place the order.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Unable to place the order.'), self::MESSAGE_STATUS_ERROR);
Mage::logException($e);
}
}
@@ -237,13 +249,14 @@ public function saveOrderAction()
* Instantiate quote and checkout
*
* @throws Mage_Core_Exception
+ * @return void
*/
protected function _initCheckout()
{
$quote = $this->_getQuote();
if (!$quote->hasItems() || $quote->getHasError()) {
- Mage::throwException(Mage::helper('xmlconnect')->__('Unable to initialize MEP Checkout.'));
+ Mage::throwException($this->__('Unable to initialize MEP Checkout.'));
}
if (!$quote->validateMinimumAmount()) {
$error = Mage::getStoreConfig('sales/minimum_order/error_message');
diff --git a/app/code/core/Mage/XmlConnect/controllers/WishlistController.php b/app/code/core/Mage/XmlConnect/controllers/WishlistController.php
index 1986c84aba..66d6e2dacc 100644
--- a/app/code/core/Mage/XmlConnect/controllers/WishlistController.php
+++ b/app/code/core/Mage/XmlConnect/controllers/WishlistController.php
@@ -29,10 +29,8 @@
*
* @author Magento Core Team
*/
-
class Mage_XmlConnect_WishlistController extends Mage_XmlConnect_Controller_Action
{
-
/**
* Check if customer is logged in
*
@@ -43,7 +41,7 @@ public function preDispatch()
parent::preDispatch();
if (!$this->_getCustomerSession()->isLoggedIn()) {
$this->setFlag('', self::FLAG_NO_DISPATCH, true);
- $this->_message(Mage::helper('xmlconnect')->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR);
return ;
}
}
@@ -73,7 +71,7 @@ protected function _getWishlist()
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
return false;
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Can\'t create wishlist.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Can\'t create wishlist.'), self::MESSAGE_STATUS_ERROR);
return false;
}
return $wishlist;
@@ -81,6 +79,8 @@ protected function _getWishlist()
/**
* Display customer wishlist
+ *
+ * @return void
*/
public function indexAction()
{
@@ -91,6 +91,8 @@ public function indexAction()
/**
* Adding new item
+ *
+ * @return void
*/
public function addAction()
{
@@ -103,13 +105,13 @@ public function addAction()
$request = $this->getRequest();
$productId = (int)$request->getParam('product');
if (!$productId) {
- $this->_message(Mage::helper('xmlconnect')->__('Product was not specified.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Product was not specified.'), self::MESSAGE_STATUS_ERROR);
return;
}
$product = Mage::getModel('catalog/product')->load($productId);
if (!$product->getId() || !$product->isVisibleInCatalog()) {
- $this->_message(Mage::helper('xmlconnect')->__('Can\'t specify product.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Can\'t specify product.'), self::MESSAGE_STATUS_ERROR);
return;
}
@@ -125,17 +127,19 @@ public function addAction()
Mage::helper('wishlist')->calculate();
- $message = Mage::helper('xmlconnect')->__('%1$s has been added to your wishlist.', $product->getName());
+ $message = $this->__('%1$s has been added to your wishlist.', $product->getName());
$this->_message($message, self::MESSAGE_STATUS_SUCCESS);
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('An error occurred while adding item to wishlist.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('An error occurred while adding item to wishlist.'), self::MESSAGE_STATUS_ERROR);
}
}
/**
* Remove item
+ *
+ * @return void
*/
public function removeAction()
{
@@ -147,14 +151,14 @@ public function removeAction()
try {
$item->delete();
$wishlist->save();
- $this->_message(Mage::helper('xmlconnect')->__('Item has been removed from wishlist.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Item has been removed from wishlist.'), self::MESSAGE_STATUS_SUCCESS);
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch(Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('An error occurred while removing item from wishlist.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('An error occurred while removing item from wishlist.'), self::MESSAGE_STATUS_ERROR);
}
} else {
- $this->_message(Mage::helper('xmlconnect')->__('Specified item does not exist in wishlist.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Specified item does not exist in wishlist.'), self::MESSAGE_STATUS_ERROR);
}
Mage::helper('wishlist')->calculate();
@@ -162,6 +166,8 @@ public function removeAction()
/**
* Clear wishlist action
+ *
+ * @return void
*/
public function clearAction()
{
@@ -173,11 +179,11 @@ public function clearAction()
$item->delete();
}
$wishlist->save();
- $this->_message(Mage::helper('xmlconnect')->__('Wishlist has been cleared.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Wishlist has been cleared.'), self::MESSAGE_STATUS_SUCCESS);
} catch (Mage_Core_Exception $e) {
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
} catch(Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('An error occurred while removing items from wishlist.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('An error occurred while removing items from wishlist.'), self::MESSAGE_STATUS_ERROR);
}
Mage::helper('wishlist')->calculate();
@@ -185,6 +191,8 @@ public function clearAction()
/**
* Update wishlist item comments
+ *
+ * @return void
*/
public function updateAction()
{
@@ -217,20 +225,20 @@ public function updateAction()
try {
$wishlist->save();
if ($problemsFlag) {
- $message = Mage::helper('xmlconnect')->__('Wishlist has been updated. But there are accrued some errors while updating some items.');
+ $message = $this->__('Wishlist has been updated. But there are accrued some errors while updating some items.');
} else {
- $message = Mage::helper('xmlconnect')->__('Wishlist has been updated.');
+ $message = $this->__('Wishlist has been updated.');
}
$this->_message($message, self::MESSAGE_STATUS_SUCCESS);
}
catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Items were updated. But can\'t update wishlist.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Items were updated. But can\'t update wishlist.'), self::MESSAGE_STATUS_SUCCESS);
}
} else {
- $this->_message(Mage::helper('xmlconnect')->__('No items were updated.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('No items were updated.'), self::MESSAGE_STATUS_ERROR);
}
} else {
- $this->_message(Mage::helper('xmlconnect')->__('No items were specifed to update.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('No items were specifed to update.'), self::MESSAGE_STATUS_ERROR);
}
}
@@ -240,6 +248,7 @@ public function updateAction()
* If Product has required options - item removed from wishlist and redirect
* to product view page with message about needed defined required options
*
+ * @return void
*/
public function cartAction()
{
@@ -253,7 +262,7 @@ public function cartAction()
$item = Mage::getModel('wishlist/item')->load($itemId);
if (!$item->getId() || $item->getWishlistId() != $wishlist->getId()) {
- $this->_message(Mage::helper('xmlconnect')->__('Invalid item or wishlist.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Invalid item or wishlist.'), self::MESSAGE_STATUS_ERROR);
return;
}
@@ -268,10 +277,10 @@ public function cartAction()
Mage::helper('wishlist')->calculate();
- $this->_message(Mage::helper('xmlconnect')->__('Item has been added to cart.'), self::MESSAGE_STATUS_SUCCESS);
+ $this->_message($this->__('Item has been added to cart.'), self::MESSAGE_STATUS_SUCCESS);
} catch (Mage_Core_Exception $e) {
if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {
- $this->_message(Mage::helper('xmlconnect')->__('Product(s) currently out of stock.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Product(s) currently out of stock.'), self::MESSAGE_STATUS_ERROR);
} else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS ||
$e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_IS_GROUPED_PRODUCT) {
$item->delete();
@@ -285,10 +294,9 @@ public function cartAction()
$this->_message($e->getMessage(), self::MESSAGE_STATUS_ERROR);
}
} catch (Exception $e) {
- $this->_message(Mage::helper('xmlconnect')->__('Can\'t add item to shopping cart.'), self::MESSAGE_STATUS_ERROR);
+ $this->_message($this->__('Can\'t add item to shopping cart.'), self::MESSAGE_STATUS_ERROR);
}
Mage::helper('wishlist')->calculate();
}
-
}
diff --git a/app/code/core/Mage/XmlConnect/etc/adminhtml.xml b/app/code/core/Mage/XmlConnect/etc/adminhtml.xml
index ce9192bc6b..3dc9b3d506 100644
--- a/app/code/core/Mage/XmlConnect/etc/adminhtml.xml
+++ b/app/code/core/Mage/XmlConnect/etc/adminhtml.xml
@@ -41,6 +41,16 @@
20
adminhtml/mobile/history
+
+ Message Templates
+ 30
+ adminhtml/mobile/template
+
+
+ Message Queue
+ 40
+ adminhtml/mobile/queue
+
@@ -60,6 +70,14 @@
Submission History
20
+
+ Message Templates
+ 30
+
+
+ Message Queue
+ 40
+
diff --git a/app/code/core/Mage/XmlConnect/etc/config.xml b/app/code/core/Mage/XmlConnect/etc/config.xml
index 28a67a2846..884bb91d78 100644
--- a/app/code/core/Mage/XmlConnect/etc/config.xml
+++ b/app/code/core/Mage/XmlConnect/etc/config.xml
@@ -28,7 +28,7 @@
- 1.4.0.8
+ 1.4.0.12
@@ -43,6 +43,8 @@
+
+ xmlconnect_notification_template
@@ -69,6 +71,16 @@
+
+
+
+
+ xmlconnect/observer
+ restrictWebsite
+
+
+
+
@@ -107,6 +119,14 @@
+
+
+
+ xmlconnect/observer
+ sendMessageImmediately
+
+
+
@@ -159,7 +179,7 @@
- 150 35
+ 35 35
320 40
@@ -173,8 +193,13 @@
320 230
+ 768 294
+ 320 258
90 120
320 367
+ 1024 704
+ 768 960
+ 320 455
320 90
30 90
136 28
@@ -270,6 +295,30 @@
+ <_480x800>
+
+ default
+
+
+ /
+ zoom
+ 1.5
+
+
+
+
+ <_480x854>
+ Â Â Â Â Â Â Â Â
+ Â Â Â Â Â Â Â Â Â Â default
+ Â Â Â Â Â Â Â Â Â Â
+ Â Â Â Â Â Â Â Â Â Â Â Â
+ Â Â Â Â Â Â Â Â Â Â Â Â Â Â /
+ Â Â Â Â Â Â Â Â Â Â Â Â Â Â zoom
+ Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1.5
+ Â Â Â Â Â Â Â Â Â Â Â Â
+ Â Â Â Â Â Â Â Â Â Â
+ Â Â Â Â Â Â Â Â
+ Â Â Â Â Â Â
<_640x960>
default
@@ -288,12 +337,44 @@
www.magentocommerce.com/mobile/activate/
http://www.magentocommerce.com/product/mobile
http://www.magentocommerce.com/product/mobile#resubmission
+ https://go.urbanairship.com/partners/magento/
+ magentomobile@magento.com
+ 3
+
+ notifications/applicationMasterSecret
+
5
+ aps
+
+ 10
+ aps
+
+
+ 10
+ aps
+
+
+ http://www.flurry.com/product/analytics/index.html
+
+
+ https://go.urbanairship.com/api/push/broadcast/
+
+
+ https://go.urbanairship.com/api/airmail/send/broadcast/
+
+
+
+
+ */5 * * * *
+ xmlconnect/observer::scheduledSend
+
+
+
diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-install-1.4.0.8.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-install-1.4.0.8.php
index c34bba35af..14dafc3aa4 100644
--- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-install-1.4.0.8.php
+++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-install-1.4.0.8.php
@@ -29,7 +29,7 @@
$installer->startSetup();
$installer->run("
-CREATE TABLE IF NOT EXISTS `{$installer->getTable('xmlconnect_application')}` (
+CREATE TABLE IF NOT EXISTS `{$installer->getTable('xmlconnect/application')}` (
`application_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`code` varchar(32) NOT NULL,
@@ -44,7 +44,7 @@
PRIMARY KEY (`application_id`),
UNIQUE KEY `UNQ_XMLCONNECT_APPLICATION_CODE` (`code`),
KEY `FK_XMLCONNECT_APPLICAION_STORE` (`store_id`),
- CONSTRAINT `FK_XMLCONNECT_APPLICAION_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core_store')}` (`store_id`) ON DELETE SET NULL ON UPDATE SET NULL
+ CONSTRAINT `FK_XMLCONNECT_APPLICAION_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$installer->getTable('core/store')}` (`store_id`) ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE IF NOT EXISTS `{$installer->getTable('xmlconnect_history')}` (
@@ -58,7 +58,7 @@
`code` varchar(255) NOT NULL,
PRIMARY KEY (`history_id`),
KEY `FK_XMLCONNECT_HISTORY_APPLICATION` (`application_id`),
- CONSTRAINT `FK_XMLCONNECT_HISTORY_APPLICATION` FOREIGN KEY (`application_id`) REFERENCES `{$installer->getTable('xmlconnect_application')}` (`application_id`) ON DELETE CASCADE ON UPDATE CASCADE
+ CONSTRAINT `FK_XMLCONNECT_HISTORY_APPLICATION` FOREIGN KEY (`application_id`) REFERENCES `{$installer->getTable('xmlconnect/application')}` (`application_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
");
diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.10-1.4.0.11.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.10-1.4.0.11.php
new file mode 100755
index 0000000000..31e9cdeb08
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.10-1.4.0.11.php
@@ -0,0 +1,32 @@
+startSetup();
+
+$installer->getConnection()->addColumn($installer->getTable('xmlconnect/history'), 'name', 'VARCHAR( 255 ) NOT NULL AFTER `activation_key`');
+
+$installer->endSetup();
diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.11-1.4.0.12.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.11-1.4.0.12.php
new file mode 100755
index 0000000000..646a42643b
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.11-1.4.0.12.php
@@ -0,0 +1,40 @@
+startSetup();
+
+$templateTable = $installer->getTable('xmlconnect/template');
+
+$installer->getConnection()->addColumn($templateTable, 'app_code', 'VARCHAR( 32 ) NOT NULL AFTER `id`');
+$installer->getConnection()->dropColumn($templateTable, 'app_type');
+
+$installer->run("SET foreign_key_checks = 0;");
+$installer->getConnection()->addConstraint('FK_APP_CODE', $templateTable, 'app_code', $installer->getTable('xmlconnect/application'), 'code');
+$installer->run("SET foreign_key_checks = 1;");
+
+$installer->endSetup();
diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.8-1.4.0.9.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.8-1.4.0.9.php
new file mode 100755
index 0000000000..160bcc8e34
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.8-1.4.0.9.php
@@ -0,0 +1,59 @@
+startSetup();
+$queueTable = $installer->getTable('xmlconnect/queue');
+$templateTable = $installer->getTable('xmlconnect/template');
+
+$installer->run("CREATE TABLE `{$queueTable}` (
+`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
+`exec_time` TIMESTAMP NOT NULL ,
+`template_id` INT NOT NULL ,
+`push_title` VARCHAR( 140 ) NOT NULL ,
+`message_title` VARCHAR( 255 ) NOT NULL ,
+`content` TEXT NOT NULL ,
+`status` TINYINT NOT NULL DEFAULT '0',
+`type` VARCHAR( 12 ) NOT NULL ,
+`app_code` VARCHAR( 12 ) NOT NULL
+) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin");
+
+
+$installer->run("CREATE TABLE `{$templateTable}` (
+`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`app_type` VARCHAR( 32 ) NOT NULL ,
+`name` VARCHAR( 255 ) NOT NULL ,
+`push_title` VARCHAR( 141 ) NOT NULL ,
+`message_title` VARCHAR( 255 ) NOT NULL ,
+`content` TEXT NOT NULL ,
+`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
+`modified_at` TIMESTAMP NOT NULL
+) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_bin");
+
+$installer->getConnection()->addConstraint('FK_TEMPLATE_ID', $queueTable, 'template_id', $templateTable, 'id');
+$installer->endSetup();
diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.9-1.4.0.10.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.9-1.4.0.10.php
new file mode 100755
index 0000000000..32b4e65dc3
--- /dev/null
+++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/mysql4-upgrade-1.4.0.9-1.4.0.10.php
@@ -0,0 +1,32 @@
+startSetup();
+
+$installer->getConnection()->changeColumn($installer->getTable('xmlconnect/queue'), 'exec_time', 'exec_time', 'TIMESTAMP NULL DEFAULT NULL');
+
+$installer->endSetup();
diff --git a/app/design/adminhtml/default/default/layout/customer.xml b/app/design/adminhtml/default/default/layout/customer.xml
index 91c9ff0702..eca83a4e00 100644
--- a/app/design/adminhtml/default/default/layout/customer.xml
+++ b/app/design/adminhtml/default/default/layout/customer.xml
@@ -36,9 +36,6 @@
mage/adminhtml/product/composite/configure.js
varien/configurable.js
-
-
-
diff --git a/app/design/adminhtml/default/default/layout/pagecache.xml b/app/design/adminhtml/default/default/layout/pagecache.xml
index deb570ea4f..718019da85 100644
--- a/app/design/adminhtml/default/default/layout/pagecache.xml
+++ b/app/design/adminhtml/default/default/layout/pagecache.xml
@@ -29,7 +29,7 @@
-
+
diff --git a/app/design/adminhtml/default/default/layout/sales.xml b/app/design/adminhtml/default/default/layout/sales.xml
index 12d79666d7..c612fb6c76 100644
--- a/app/design/adminhtml/default/default/layout/sales.xml
+++ b/app/design/adminhtml/default/default/layout/sales.xml
@@ -299,6 +299,7 @@
default adminhtml/sales_items_renderer_default sales/order/shipment/create/items/renderer/default.phtml
qty adminhtml/sales_items_column_qty sales/items/column/qty.phtml
name adminhtml/sales_items_column_name sales/items/column/name.phtml
+
@@ -330,6 +331,7 @@
default adminhtml/sales_items_renderer_default sales/order/shipment/view/items/renderer/default.phtml
qty adminhtml/sales_items_column_qty sales/items/column/qty.phtml
name adminhtml/sales_items_column_name sales/items/column/name.phtml
+
diff --git a/app/design/adminhtml/default/default/layout/xmlconnect.xml b/app/design/adminhtml/default/default/layout/xmlconnect.xml
index d2d2c0d199..f67dd9096a 100644
--- a/app/design/adminhtml/default/default/layout/xmlconnect.xml
+++ b/app/design/adminhtml/default/default/layout/xmlconnect.xml
@@ -45,6 +45,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+ js_css prototype/windows/themes/default.css
+ js_css prototype/windows/themes/magento.css
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -64,13 +115,19 @@
+
+
+
+
general_section mobile_edit_tab_general
design_section mobile_edit_tab_design
content_section mobile_edit_tab_content
payment_methods mobile_edit_tab_payment
+ flurryanalytics_section mobile_edit_tab_flurryanalytics
history_grid mobile_edit_tab_submission_history_grid
+ notification_section mobile_edit_tab_notification
@@ -114,16 +171,54 @@
+
+
+
+
+
-
-
+
+ home
+
+ home
+
+
+
+ home_hor
+
+ home
+
+
+
+
+
+
+ catalog_hor
+
+ shop
+
+
+
+
-
-
+
+ catalog
+
+ shop
+
+
+
+
+ productinfo
+
+ shop
+
+
+
diff --git a/app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml b/app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml
index edc3498994..be795783b2 100644
--- a/app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml
+++ b/app/design/adminhtml/default/default/template/api/role_users_grid_js.phtml
@@ -56,7 +56,7 @@
checkbox[0].checked = false;
checkBoxes.each(function(elem) {
if (elem.value.status == 1) {
- elem.value.object.checked = true;
+ elem.value.object.checked = true;
}
});
return false;
@@ -90,7 +90,7 @@
warning = false;
}
checkBoxes.each(function(elem) {
- getJsObjectName() ?>.setCheckboxChecked(elem.value.object, obj.checked);
+ getJsObjectName() ?>.setCheckboxChecked(elem.value.object, obj.checked);
});
}
diff --git a/app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/bundle.phtml b/app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/bundle.phtml
index 6461e815d2..7e4a4caa30 100644
--- a/app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/bundle.phtml
+++ b/app/design/adminhtml/default/default/template/bundle/product/composite/fieldset/options/bundle.phtml
@@ -87,7 +87,7 @@ BundleControl.prototype = {
this.changeSelection(selection);
}
}
- },
+ }
}
ProductConfigure.bundleControl = new BundleControl(getJsonConfig() ?>);
diff --git a/app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml b/app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml
index 492caede7e..4549e03291 100644
--- a/app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml
+++ b/app/design/adminhtml/default/default/template/catalog/product/composite/configure.phtml
@@ -26,7 +26,7 @@
?>
-
\ No newline at end of file
+
diff --git a/app/design/adminhtml/default/default/template/paygate/info/cc.phtml b/app/design/adminhtml/default/default/template/paygate/info/cc.phtml
index 2ab61987ec..427927958e 100644
--- a/app/design/adminhtml/default/default/template/paygate/info/cc.phtml
+++ b/app/design/adminhtml/default/default/template/paygate/info/cc.phtml
@@ -19,7 +19,7 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
- * @package base_default
+ * @package default_default
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
diff --git a/app/design/adminhtml/default/default/template/sales/items/column/name.phtml b/app/design/adminhtml/default/default/template/sales/items/column/name.phtml
index e067200e6b..f2f4b27de2 100644
--- a/app/design/adminhtml/default/default/template/sales/items/column/name.phtml
+++ b/app/design/adminhtml/default/default/template/sales/items/column/name.phtml
@@ -41,7 +41,8 @@
getCustomizedOptionValue($_option); ?>
- truncate($_option['value'], 55, '', $_remainder);?>
+ escapeHtml($_option['value'])); ?>
+ truncate($_option['value'], 55, '', $_remainder);?>
...
getButtonHtml() ?>
-
+
diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design.phtml
index ac0e18f840..73b5162d5d 100644
--- a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design.phtml
+++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design.phtml
@@ -27,11 +27,11 @@
- __('Select Template'); ?>:
+ __('Select Template'); ?>:
- __('Template Name'); ?>
+ __('Template Name'); ?>
- __('Add More Templates'); ?>
+ __('Add More Templates'); ?>
*/
?>
@@ -39,7 +39,11 @@
getChildHtml('design_accordion'); ?>
- getChildHtml('app_preview'); ?>
+
+ canShowPreview()) : ?>
+ getChildHtml('app_preview') ?>
+
+
diff --git a/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_iphone.phtml b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_iphone.phtml
new file mode 100644
index 0000000000..b82b5afb6a
--- /dev/null
+++ b/app/design/adminhtml/default/default/template/xmlconnect/edit/tab/design/preview_iphone.phtml
@@ -0,0 +1,89 @@
+
+getApplication()->getType();
+?>
+
+
+
+
+
+ __('Update Preview');?>
+
+
+
diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/addrow.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/addrow.phtml
index 41ba4b88f7..67b968e21e 100644
--- a/app/design/adminhtml/default/default/template/xmlconnect/form/element/addrow.phtml
+++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/addrow.phtml
@@ -59,7 +59,7 @@ function getTdValueInnerHtml() {
*/
function getTdButtonInnerHtml(id) {
return ''
- +'__('Delete'); ?> ';
+ +'__('Delete'); ?> ';
}
/**
diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_android.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_android.phtml
new file mode 100755
index 0000000000..42bfda00b9
--- /dev/null
+++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_android.phtml
@@ -0,0 +1,334 @@
+
+
+
+
+
+
+
+__('Title bar') ?>
+
+__('Options menu items') ?>
+
+__('Inactive Tabs'); ?>
+
+
+
diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_ipad.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_ipad.phtml
new file mode 100755
index 0000000000..ae740109c0
--- /dev/null
+++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_ipad.phtml
@@ -0,0 +1,218 @@
+
+
+
+
+
+
+
+
+__('Main Tabs') ?>
+
+
+__('Inactive Tabs'); ?>
+
+
+
diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_iphone.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_iphone.phtml
new file mode 100755
index 0000000000..d48272e757
--- /dev/null
+++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/app_tabs_iphone.phtml
@@ -0,0 +1,334 @@
+
+
+
+
+
+
+
+
+__('Main Tabs') ?>
+
+__('More Tabs') ?>
+
+__('Inactive Tabs'); ?>
+
+
+
diff --git a/app/design/adminhtml/default/default/template/xmlconnect/form/element/themes.phtml b/app/design/adminhtml/default/default/template/xmlconnect/form/element/themes.phtml
index 1fb27bbc16..a68b4f61c1 100644
--- a/app/design/adminhtml/default/default/template/xmlconnect/form/element/themes.phtml
+++ b/app/design/adminhtml/default/default/template/xmlconnect/form/element/themes.phtml
@@ -115,7 +115,7 @@ Magento.Dropdowns.prototype = {
if (!empty($themeId)) {
foreach ($themes as $theme) {
if ($theme->getName() == $themeId) {
- $themeLabel = Mage::helper('xmlconnect')->__($theme->getLabel());
+ $themeLabel = $this->__($theme->getLabel());
}
}
}
@@ -233,10 +233,10 @@ function resetThemeChanges() {
} else {
mmColorThemes = responseJSON;
mmSetTheme(currentTheme);
- message = '__('Reset Successful');?>';
+ message = '__('Reset Successful');?>';
}
} else {
- message = '__('Unknown Error'); ?>';
+ message = '__('Unknown Error'); ?>';
}
alert(message);
} catch(e) {
@@ -266,10 +266,10 @@ function saveThemeChanges() {
message = responseJSON.message;
} else {
mmColorThemes = responseJSON;
- message = '__('Theme has been saved.');?>';
+ message = '__('Theme has been saved.');?>';
}
} else {
- message = '__('Unknown Error.'); ?>';
+ message = '__('Unknown Error.'); ?>';
}
alert(message);
} catch(e) {
@@ -285,23 +285,23 @@ function saveThemeChanges() {
-__('Preset Theme'); ?>
+__('Preset Theme'); ?>
@@ -348,9 +348,9 @@ $('').observe('change', function() { changeColorListener('
-__('Reset'); ?>
-__('Save Theme'); ?>
-__('Apply Theme'); ?>
+__('Reset'); ?>
+__('Save Theme'); ?>
+__('Apply Theme'); ?>
*/?>
diff --git a/app/design/adminhtml/default/default/template/xmlconnect/mobile/notification_helper.phtml b/app/design/adminhtml/default/default/template/xmlconnect/mobile/notification_helper.phtml
new file mode 100644
index 0000000000..7a56c68ae1
--- /dev/null
+++ b/app/design/adminhtml/default/default/template/xmlconnect/mobile/notification_helper.phtml
@@ -0,0 +1,40 @@
+
+
+getId()):?>
+loadConfiguration(); ?>
+getAppKey()):?>
+
+
+helper('xmlconnect')->__('After submitting the App, please contact %1$s to receive the Application Key, Application Secret and Application Master Secret. Upon receiving these credentials, please fill in the corresponding fields. In addition, please accept Urban Airship\'s Terms of Service: click here .', Mage::getStoreConfig(Mage_XmlConnect_Model_Application::XML_PATH_CONTACT_CREDENTIALS_EMAIL), Mage::getStoreConfig(Mage_XmlConnect_Model_Application::XML_PATH_URBAN_AIRSHIP_TOS_URL));
+?>
+
+
+
+
+
diff --git a/app/design/adminhtml/default/default/template/xmlconnect/template/preview.phtml b/app/design/adminhtml/default/default/template/xmlconnect/template/preview.phtml
new file mode 100755
index 0000000000..e14a5a4e06
--- /dev/null
+++ b/app/design/adminhtml/default/default/template/xmlconnect/template/preview.phtml
@@ -0,0 +1,37 @@
+
+
+
+
+ __('AirMail Template Preview'); ?>
+
+
+
+ getChildHtml('content') ?>
+ getChildHtml('profiler') ?>
+
+
diff --git a/app/design/frontend/base/default/layout/paypal.xml b/app/design/frontend/base/default/layout/paypal.xml
index 7924e76eaa..7f6ee2047d 100644
--- a/app/design/frontend/base/default/layout/paypal.xml
+++ b/app/design/frontend/base/default/layout/paypal.xml
@@ -141,6 +141,6 @@ Available logo types can be assigned with action="setLogoType":
-
+
diff --git a/app/design/frontend/base/default/layout/xmlconnect.xml b/app/design/frontend/base/default/layout/xmlconnect.xml
index 8e327820fc..bb03271f81 100644
--- a/app/design/frontend/base/default/layout/xmlconnect.xml
+++ b/app/design/frontend/base/default/layout/xmlconnect.xml
@@ -64,6 +64,14 @@
+
+
+ simple xmlconnect/catalog_product_options_simple
+ virtual xmlconnect/catalog_product_options_virtual
+ configurable xmlconnect/catalog_product_options_configurable
+ bundle xmlconnect/catalog_product_options_bundle
+ grouped xmlconnect/catalog_product_options_grouped
+
diff --git a/app/design/frontend/base/default/template/checkout/cart/item/default.phtml b/app/design/frontend/base/default/template/checkout/cart/item/default.phtml
index eda17d18bb..b0990980d4 100644
--- a/app/design/frontend/base/default/template/checkout/cart/item/default.phtml
+++ b/app/design/frontend/base/default/template/checkout/cart/item/default.phtml
@@ -24,7 +24,10 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
-getItem()?>
+getItem();
+$isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
+?>
hasProductUrl()):?> hasProductUrl()):?>
@@ -63,11 +66,15 @@
+
__('Edit') ?>
+
helper('wishlist')->isAllowInCart()) : ?>
+
+
helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
diff --git a/app/design/frontend/base/default/template/checkout/cart/sidebar/default.phtml b/app/design/frontend/base/default/template/checkout/cart/sidebar/default.phtml
index e742a0d9cb..71491b6ccb 100644
--- a/app/design/frontend/base/default/template/checkout/cart/sidebar/default.phtml
+++ b/app/design/frontend/base/default/template/checkout/cart/sidebar/default.phtml
@@ -24,7 +24,10 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
-getItem() ?>
+getItem();
+ $isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();
+?>
hasProductUrl()): ?>
@@ -33,7 +36,9 @@
__('Remove This Item') ?>
+
__('Edit item')?>
+
hasProductUrl()): ?>htmlEscape($this->getProductName()) ?>hasProductUrl()): ?>
getQty() ?> x
diff --git a/app/design/frontend/base/default/template/checkout/onepage/billing.phtml b/app/design/frontend/base/default/template/checkout/onepage/billing.phtml
index 6cd7ccdb14..c889ae691f 100644
--- a/app/design/frontend/base/default/template/checkout/onepage/billing.phtml
+++ b/app/design/frontend/base/default/template/checkout/onepage/billing.phtml
@@ -39,7 +39,7 @@
- getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
+ getLayout()->createBlock('customer/widget_name')->setObject($this->getAddress()->getFirstname() ? $this->getAddress() : $this->getQuote()->getCustomer())->setFieldIdFormat('billing:%s')->setFieldNameFormat('billing[%s]')->toHtml() ?>
__('Company') ?>
diff --git a/app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml b/app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml
index 4165c827fb..5b22868b57 100644
--- a/app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml
+++ b/app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml
@@ -28,11 +28,13 @@
__('Sorry, no quotes are available for this order at this time.') ?>
+
$_rates): ?>
getCarrierName($code) ?>
+
diff --git a/app/design/frontend/base/default/template/checkout/total/tax.phtml b/app/design/frontend/base/default/template/checkout/total/tax.phtml
index f0fd6a11c2..0c6cd53286 100644
--- a/app/design/frontend/base/default/template/checkout/total/tax.phtml
+++ b/app/design/frontend/base/default/template/checkout/total/tax.phtml
@@ -38,8 +38,8 @@
-
- (%)
+
+ (%)
diff --git a/app/design/frontend/base/default/template/email/order/items/order/default.phtml b/app/design/frontend/base/default/template/email/order/items/order/default.phtml
index 35605f2b40..3fb0073d23 100644
--- a/app/design/frontend/base/default/template/email/order/items/order/default.phtml
+++ b/app/design/frontend/base/default/template/email/order/items/order/default.phtml
@@ -33,11 +33,13 @@
getItemOptions() as $option): ?>
-
+
+ escapeHtml($option['value'])) ?>
+
- htmlEscape($_item->getDescription()) ?>
+ escapeHtml($_item->getDescription()) ?>
htmlEscape($this->getSku($_item)) ?>
getQtyOrdered()*1 ?>
diff --git a/app/design/frontend/base/default/template/pagecache/cookie.phtml b/app/design/frontend/base/default/template/pagecache/cookie.phtml
index abb4278fb8..0f7fdb2f3e 100644
--- a/app/design/frontend/base/default/template/pagecache/cookie.phtml
+++ b/app/design/frontend/base/default/template/pagecache/cookie.phtml
@@ -27,4 +27,4 @@
\ No newline at end of file
+
diff --git a/app/design/frontend/base/default/template/paypal/hss/form.phtml b/app/design/frontend/base/default/template/paypal/hss/form.phtml
index 62433b9041..e75b4f5b2e 100644
--- a/app/design/frontend/base/default/template/paypal/hss/form.phtml
+++ b/app/design/frontend/base/default/template/paypal/hss/form.phtml
@@ -1,45 +1,45 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/app/design/frontend/base/default/template/review/customer/list.phtml b/app/design/frontend/base/default/template/review/customer/list.phtml
index 5d893675b6..b25d72e974 100644
--- a/app/design/frontend/base/default/template/review/customer/list.phtml
+++ b/app/design/frontend/base/default/template/review/customer/list.phtml
@@ -39,7 +39,7 @@
getCollection() as $_review): ?>
- dateFormat($_review->getCreatedAt()) ?>
+ dateFormat($_review->getCreatedAt()) ?>
getSum()): ?>
diff --git a/app/design/frontend/base/default/template/sales/order/items/renderer/default.phtml b/app/design/frontend/base/default/template/sales/order/items/renderer/default.phtml
index 31483561ef..f5f99234c9 100644
--- a/app/design/frontend/base/default/template/sales/order/items/renderer/default.phtml
+++ b/app/design/frontend/base/default/template/sales/order/items/renderer/default.phtml
@@ -38,14 +38,16 @@
- htmlEscape($_option['label']) ?>
+ escapeHtml($_option['label']) ?>
- htmlEscape( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) ) ?>
+
+ htmlEscape( (isset($_option['print_value']) ? $_option['print_value'] : $_option['value']) )) ?>
+
diff --git a/app/design/frontend/base/default/template/tax/checkout/tax.phtml b/app/design/frontend/base/default/template/tax/checkout/tax.phtml
index cfde921387..d0a6fd693b 100644
--- a/app/design/frontend/base/default/template/tax/checkout/tax.phtml
+++ b/app/design/frontend/base/default/template/tax/checkout/tax.phtml
@@ -46,8 +46,8 @@
-
- (%)
+
+ (%)
diff --git a/app/design/frontend/base/default/template/tax/order/tax.phtml b/app/design/frontend/base/default/template/tax/order/tax.phtml
index 901eb20098..2ccb9a9ef6 100644
--- a/app/design/frontend/base/default/template/tax/order/tax.phtml
+++ b/app/design/frontend/base/default/template/tax/order/tax.phtml
@@ -46,8 +46,8 @@
getIsPlaneMode()):?> style="display:none;">
getLabelProperties()?>>
-
- (%)
+
+ (%)
diff --git a/app/design/frontend/base/default/template/wishlist/sidebar.phtml b/app/design/frontend/base/default/template/wishlist/sidebar.phtml
index 51c99b05f2..4e295ff006 100644
--- a/app/design/frontend/base/default/template/wishlist/sidebar.phtml
+++ b/app/design/frontend/base/default/template/wishlist/sidebar.phtml
@@ -37,12 +37,12 @@
getWishlistItems() as $_item): ?>
getProduct(); ?>
-
+
diff --git a/app/design/frontend/base/default/template/wishlist/view.phtml b/app/design/frontend/base/default/template/wishlist/view.phtml
index 6b3bc414d6..dbd2856030 100644
--- a/app/design/frontend/base/default/template/wishlist/view.phtml
+++ b/app/design/frontend/base/default/template/wishlist/view.phtml
@@ -54,11 +54,14 @@
getWishlistItems() as $item): ?>
- getProduct(); ?>
+ getProduct();
+ $isVisibleProduct = $product->isVisibleInSiteVisibility();
+ ?>
-
-
+
+
getPriceHtml($product) ?>
getDetailsHtml($item) ?>
@@ -69,15 +72,19 @@
getFormatedDate($item->getAddedAt()) ?>
- canHaveQty()): ?>
+ canHaveQty() && $isVisibleProduct): ?>
isSaleable()): ?>
+
__('Add to Cart') ?>
+
__('Out of stock') ?>
+
__('Edit') ?>
+
__('Remove item')?>
diff --git a/app/etc/local.xml.additional b/app/etc/local.xml.additional
index 850ae3e56e..207131bc05 100644
--- a/app/etc/local.xml.additional
+++ b/app/etc/local.xml.additional
@@ -37,6 +37,8 @@ to app/etc/local.xml manually.
+
+
diff --git a/app/locale/en_US/Mage_Adminhtml.csv b/app/locale/en_US/Mage_Adminhtml.csv
index e315ab683c..2d6aa91ac9 100644
--- a/app/locale/en_US/Mage_Adminhtml.csv
+++ b/app/locale/en_US/Mage_Adminhtml.csv
@@ -30,6 +30,7 @@
"-- Please select --","-- Please select --"
"--Please Select--","--Please Select--"
"1 Hour","1 Hour"
+"10:40 AM","10:40 AM"
"12 Hours","12 Hours"
"12h AM/PM","12h AM/PM"
"2 Hours","2 Hours"
@@ -37,6 +38,8 @@
"24h","24h"
"2YTD","2YTD"
"6 Hours","6 Hours"
+"80px x 80px","80px x 80px"
+"80x80 px","80x80 px"
"404 Error Page not found.
","404 Error Page not found.
"
"A new password was sent to your email address. Please check your email and click Back to Login.","A new password was sent to your email address. Please check your email and click Back to Login."
"A user with the same user name or email aleady exists.","A user with the same user name or email aleady exists."
@@ -56,12 +59,14 @@
"Action","Action"
"Actions","Actions"
"Actions XML","Actions XML"
+"Activate","Activate"
"Active","Active"
"Add","Add"
"Add Contents Path","Add Contents Path"
"Add Exception","Add Exception"
"Add Field Mapping","Add Field Mapping"
"Add Field with URL:","Add Field with URL:"
+"Add More Templates","Add More Templates"
"Add New Image","Add New Image"
"Add New Profile","Add New Profile"
"Add New Role","Add New Role"
@@ -76,12 +81,15 @@
"Add URL Rewrite for a Category","Add URL Rewrite for a Category"
"Add URL Rewrite for a Product","Add URL Rewrite for a Product"
"Add after","Add after"
+"Add to Cart","Add to Cart"
+"Add to Wishlist","Add to Wishlist"
"Additional Cache Management","Additional Cache Management"
"Address Type:","Address Type:"
"Admin","Admin"
"Advanced Admin Section","Advanced Admin Section"
"Advanced Profiles","Advanced Profiles"
"Advanced Section","Advanced Section"
+"AirMail Template Preview","AirMail Template Preview"
"All","All"
"All Allowed Countries","All Allowed Countries"
"All Cache","All Cache"
@@ -127,6 +135,7 @@
"Any Store","Any Store"
"Any Type","Any Type"
"Any Visibility","Any Visibility"
+"Apply Theme","Apply Theme"
"Archive file name:","Archive file name:"
"Are you sure that you want to delete this template?","Are you sure that you want to delete this template?"
"Are you sure that you want to strip tags?","Are you sure that you want to strip tags?"
@@ -190,11 +199,14 @@
"Cannot update item quantity.","Cannot update item quantity."
"Cannot update the item\'s quantity.","Cannot update the item\'s quantity."
"Card Verification Number","Card Verification Number"
+"Carrier","Carrier"
"Catalog","Catalog"
"Catalog Price Rules","Catalog Price Rules"
"Catalog Rewrites","Catalog Rewrites"
"Categories","Categories"
"Category:","Category:"
+"Chairs","Chairs"
+"Change Orientation","Change Orientation"
"Channel","Channel"
"Chart is disabled. If you want to enable chart, click here .","Chart is disabled. If you want to enable chart, click here ."
"Checkbox","Checkbox"
@@ -241,6 +253,7 @@
"Current Configuration Scope:","Current Configuration Scope:"
"Current Month","Current Month"
"Custom","Custom"
+"Custom Colors","Custom Colors"
"Custom Variable ""%s""","Custom Variable ""%s"""
"Custom Variables","Custom Variables"
"Customer","Customer"
@@ -311,6 +324,7 @@
"Edit","Edit"
"Edit Design Change","Edit Design Change"
"Edit Email Template","Edit Email Template"
+"Edit Filter","Edit Filter"
"Edit Poll","Edit Poll"
"Edit Queue","Edit Queue"
"Edit Review","Edit Review"
@@ -346,6 +360,7 @@
"Export:","Export:"
"Extension","Extension"
"Extensions","Extensions"
+"FILTERS APPLIED","FILTERS APPLIED"
"FTP Host[:Port]","FTP Host[:Port]"
"Failed to add a product to cart by id ""%s"".","Failed to add a product to cart by id ""%s""."
"Failed to cancel the billing agreement.","Failed to cancel the billing agreement."
@@ -424,7 +439,9 @@
"In","In"
"In Database:","In Database:"
"In File:","In File:"
+"In Stock","In Stock"
"Inactive","Inactive"
+"Inactive Tabs","Inactive Tabs"
"Incl. Tax","Incl. Tax"
"Include","Include"
"Incoming Message","Incoming Message"
@@ -488,6 +505,7 @@
"Local Server","Local Server"
"Local/Remote Server","Local/Remote Server"
"Locale","Locale"
+"Log In","Log In"
"Log Out","Log Out"
"Log in to Admin Panel","Log in to Admin Panel"
"Log into Magento Admin Page","Log into Magento Admin Page"
@@ -505,6 +523,8 @@
"Magento is a trademark of Magento Inc. Copyright © %s Magento Inc.","Magento is a trademark of Magento Inc. Copyright © %s Magento Inc."
"Magento ver. %s","Magento ver. %s"
"Magento™ is a trademark of Magento Inc. Copyright © %s Magento Inc.","Magento™ is a trademark of Magento Inc. Copyright © %s Magento Inc."
+"Main Tabs","Main Tabs"
+"Make Inactive","Make Inactive"
"Make sure that data encoding in the file is consistent and saved in one of supported encodings (UTF-8 or ANSI).","Make sure that data encoding in the file is consistent and saved in one of supported encodings (UTF-8 or ANSI)."
"Make sure that you configure the design settings for the Payflow Link form in your Payflow link account.","Make sure that you configure the design settings for the Payflow Link form in your Payflow link account."
"Manage Attribute Sets","Manage Attribute Sets"
@@ -524,10 +544,11 @@
"Max","Max"
"Mb","Mb"
"Media (.avi, .flv, .swf)","Media (.avi, .flv, .swf)"
-"Media storage synchronization has completed!","Media storage synchronization has completed!"
+"Media storages synchronization has completed!","Media storages synchronization has completed!"
"Messages Inbox","Messages Inbox"
"Min","Min"
"Month","Month"
+"More Tabs","More Tabs"
"Most Viewed","Most Viewed"
"Most Viewed Products","Most Viewed Products"
"Multiple Select","Multiple Select"
@@ -616,6 +637,7 @@
"Only mapped fields","Only mapped fields"
"Optional","Optional"
"Options","Options"
+"Options menu items","Options menu items"
"Order #%s","Order #%s"
"Order #%s (%s)","Order #%s (%s)"
"Order Created Date","Order Created Date"
@@ -688,6 +710,7 @@
"Please select an option.","Please select an option."
"Please select catalog searches.","Please select catalog searches."
"Please select customer(s).","Please select customer(s)."
+"Please select message(s).","Please select message(s)."
"Please select one of the above options.","Please select one of the above options."
"Please select one of the options.","Please select one of the options."
"Please select review(s).","Please select review(s)."
@@ -711,6 +734,7 @@
"Popular","Popular"
"Position of Watermark for %s","Position of Watermark for %s"
"Pregenerated product images files.","Pregenerated product images files."
+"Preset Theme","Preset Theme"
"Prev. month (hold for menu)","Prev. month (hold for menu)"
"Prev. year (hold for menu)","Prev. year (hold for menu)"
"Preview","Preview"
@@ -721,6 +745,9 @@
"Price:","Price:"
"Processed %s%% %s/%d records","Processed %s%% %s/%d records"
"Product","Product"
+"Product Name3 ","Product Name3 "
+"Product Name3 1","Product Name3 1"
+"Product Name3 2","Product Name3 2"
"Product Reviews","Product Reviews"
"Product Thumbnail Itself","Product Thumbnail Itself"
"Product is not loaded.","Product is not loaded."
@@ -777,6 +804,7 @@
"Required settings","Required settings"
"Reset","Reset"
"Reset Filter","Reset Filter"
+"Reset Successful","Reset Successful"
"Resize","Resize"
"Resource Access","Resource Access"
"Resources","Resources"
@@ -805,6 +833,7 @@
"Running... Kill","Running... Kill"
"SKU","SKU"
"SKU:","SKU:"
+"SORT BY:","SORT BY:"
"SSL Error: Invalid or self-signed certificate","SSL Error: Invalid or self-signed certificate"
"Sales","Sales"
"Sales Report","Sales Report"
@@ -818,8 +847,10 @@
"Save Profile","Save Profile"
"Save Role","Save Role"
"Save Template","Save Template"
+"Save Theme","Save Theme"
"Save User","Save User"
"Save and Continue Edit","Save and Continue Edit"
+"Screens:","Screens:"
"Search","Search"
"Search Index","Search Index"
"Search Term","Search Term"
@@ -829,6 +860,7 @@
"Select Category","Select Category"
"Select Date","Select Date"
"Select Range","Select Range"
+"Select Template","Select Template"
"Select Visible","Select Visible"
"Select date","Select date"
"Selected allowed currency ""%s"" is not available in installed currencies.","Selected allowed currency ""%s"" is not available in installed currencies."
@@ -904,11 +936,13 @@
"System","System"
"System Section","System Section"
"System busy","System busy"
+"T-Shirts","T-Shirts"
"Tags","Tags"
"Target","Target"
"Target Path","Target Path"
"Tax","Tax"
"Tb","Tb"
+"Tell a Friend","Tell a Friend"
"Template","Template"
"Template Content","Template Content"
"Template Information","Template Information"
@@ -987,6 +1021,7 @@
"The tag has been saved.","The tag has been saved."
"The user has been deleted.","The user has been deleted."
"The user has been saved.","The user has been saved."
+"Theme has been saved.","Theme has been saved."
"Themes JavaScript and CSS files combined to one file.","Themes JavaScript and CSS files combined to one file."
"There has been wrong payment information submitted or time limit has expired. Please, try again.","There has been wrong payment information submitted or time limit has expired. Please, try again."
"There is an error in one of the option rows.","There is an error in one of the option rows."
@@ -1010,6 +1045,7 @@
"Time selection:","Time selection:"
"Time:","Time:"
"Timeout limit for response from synchronize process was reached.","Timeout limit for response from synchronize process was reached."
+"Title bar","Title bar"
"To","To"
"To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel.","To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel."
"To use Payflow Link, you must configure your Payflow Link account on the Paypal website.","To use Payflow Link, you must configure your Payflow Link account on the Paypal website."
@@ -1023,6 +1059,7 @@
"Total Refunded","Total Refunded"
"Total of %d record(s) have been deleted.","Total of %d record(s) have been deleted."
"Total of %d record(s) have been updated.","Total of %d record(s) have been updated."
+"Total of %d record(s) were canceled.","Total of %d record(s) were canceled."
"Track Order","Track Order"
"Track this shipment","Track this shipment"
"Tracking number %s for %s assigned","Tracking number %s for %s assigned"
@@ -1052,10 +1089,13 @@
"Unable to send the shipment email.","Unable to send the shipment email."
"Unable to void the credit memo.","Unable to void the credit memo."
"Unknown","Unknown"
+"Unknown Error","Unknown Error"
+"Unknown Error.","Unknown Error."
"Unlimited","Unlimited"
"Unselect All","Unselect All"
"Unselect Visible","Unselect Visible"
"Update","Update"
+"Update Preview","Update Preview"
"Updated At","Updated At"
"Upload File","Upload File"
"Upload Files","Upload Files"
@@ -1099,7 +1139,9 @@
"Verification cannot be processed","Verification cannot be processed"
"View","View"
"View Actions XML","View Actions XML"
+"View Details","View Details"
"View Full Size","View Full Size"
+"View Gallery","View Gallery"
"View Memo","View Memo"
"View Memo for #%s","View Memo for #%s"
"View Shipment","View Shipment"
@@ -1108,6 +1150,7 @@
"Warning! Empty value can cause problems with CSV format.","Warning! Empty value can cause problems with CSV format."
"Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?","Warning!\r\nThis action will remove this user from already assigned role\r\nAre you sure?"
"Warning!\r\nThis action will remove those users from already assigned roles\r\nAre you sure?","Warning!\r\nThis action will remove those users from already assigned roles\r\nAre you sure?"
+"Warning: All related AirMail messages will be deteted!\n Are you sure you want to do this?","Warning: All related AirMail messages will be deteted!\n Are you sure you want to do this?"
"Warning: Please do not close the window during importing/exporting data","Warning: Please do not close the window during importing/exporting data"
"Watermark File for %s","Watermark File for %s"
"We appreciate our merchants\' feedback, please take our survey to provide insight on the features you would like included in Magento. Remove this notification ","We appreciate our merchants\' feedback, please take our survey to provide insight on the features you would like included in Magento. Remove this notification "
diff --git a/app/locale/en_US/Mage_Api.csv b/app/locale/en_US/Mage_Api.csv
index 0d61d20c68..0d861cbb65 100644
--- a/app/locale/en_US/Mage_Api.csv
+++ b/app/locale/en_US/Mage_Api.csv
@@ -17,6 +17,9 @@
"- or Shift-click to decrease it","- or Shift-click to decrease it"
"- or click and drag for faster selection.","- or click and drag for faster selection."
"-- Please Select Billing Agreement--","-- Please Select Billing Agreement--"
+"10:40 AM","10:40 AM"
+"80px x 80px","80px x 80px"
+"80x80 px","80x80 px"
"About the calendar","About the calendar"
"Access denied.","Access denied."
"Account Created in:","Account Created in:"
@@ -24,16 +27,22 @@
"Account Created on:","Account Created on:"
"Action","Action"
"Actions","Actions"
+"Activate","Activate"
"Add Contents Path","Add Contents Path"
"Add Field with URL:","Add Field with URL:"
+"Add More Templates","Add More Templates"
"Add New Role","Add New Role"
"Add New User","Add New User"
"Add PHP Extension dependency","Add PHP Extension dependency"
"Add Package dependency","Add Package dependency"
+"Add to Cart","Add to Cart"
+"Add to Wishlist","Add to Wishlist"
"Address Type:","Address Type:"
+"AirMail Template Preview","AirMail Template Preview"
"All","All"
"All Websites","All Websites"
"All fields","All fields"
+"Apply Theme","Apply Theme"
"Archive file name:","Archive file name:"
"Are you sure that you want to delete this template?","Are you sure that you want to delete this template?"
"Are you sure that you want to strip tags?","Are you sure that you want to strip tags?"
@@ -42,6 +51,7 @@
"Attributes","Attributes"
"Authors","Authors"
"Available Products","Available Products"
+"Back","Back"
"Big Image","Big Image"
"Billing Address","Billing Address"
"Billing Agreement","Billing Agreement"
@@ -50,7 +60,10 @@
"CSV / Tab separated","CSV / Tab separated"
"Cancel URL: ","Cancel URL: "
"Card Verification Number","Card Verification Number"
+"Carrier","Carrier"
"Catalog","Catalog"
+"Chairs","Chairs"
+"Change Orientation","Change Orientation"
"Channel","Channel"
"Child Transactions","Child Transactions"
"Choose Store View","Choose Store View"
@@ -74,6 +87,7 @@
"Credit Memo Totals","Credit Memo Totals"
"Current Configuration Scope:","Current Configuration Scope:"
"Custom","Custom"
+"Custom Colors","Custom Colors"
"Customer","Customer"
"Customer Group:","Customer Group:"
"Customer Since:","Customer Since:"
@@ -96,6 +110,7 @@
"Do not enable AVS or CSC options. The do not work when using Payflow Link Silent Mode.","Do not enable AVS or CSC options. The do not work when using Payflow Link Silent Mode."
"Do not set any fields in the Billing and Shipping Information block as editable in your Payflow accout.","Do not set any fields in the Billing and Shipping Information block as editable in your Payflow accout."
"Drag to move","Drag to move"
+"Edit Filter","Edit Filter"
"Edit Role","Edit Role"
"Edit User '%s'","Edit User '%s'"
"Email","Email"
@@ -115,6 +130,7 @@
"Export:","Export:"
"Extension","Extension"
"Extensions","Extensions"
+"FILTERS APPLIED","FILTERS APPLIED"
"FTP Host[:Port]","FTP Host[:Port]"
"Field Mapping","Field Mapping"
"File Information","File Information"
@@ -135,6 +151,7 @@
"Google Base Items","Google Base Items"
"Group:","Group:"
"Help Us Keep Magento Healthy - Report All Bugs","Help Us Keep Magento Healthy - Report All Bugs"
+"Home","Home"
"If your Magento instance is used for multiple websites, you must configure a separate Payflow Link account for each website.","If your Magento instance is used for multiple websites, you must configure a separate Payflow Link account for each website."
"Ignore","Ignore"
"Images","Images"
@@ -145,6 +162,8 @@
"Important: ","Important: "
"In Database:","In Database:"
"In File:","In File:"
+"In Stock","In Stock"
+"Inactive Tabs","Inactive Tabs"
"Incl. Tax","Incl. Tax"
"Include","Include"
"Interactive","Interactive"
@@ -169,6 +188,7 @@
"Loading...","Loading..."
"Local Server","Local Server"
"Local/Remote Server","Local/Remote Server"
+"Log In","Log In"
"Log Out","Log Out"
"Logged in as %s","Logged in as %s"
"MS Excel XML","MS Excel XML"
@@ -177,11 +197,14 @@
"Magento Logo","Magento Logo"
"Magento ver. %s","Magento ver. %s"
"Magento™ is a trademark of Magento Inc. Copyright © %s Magento Inc.","Magento™ is a trademark of Magento Inc. Copyright © %s Magento Inc."
+"Main Tabs","Main Tabs"
+"Make Inactive","Make Inactive"
"Make sure that data encoding in the file is consistent and saved in one of supported encodings (UTF-8 or ANSI).","Make sure that data encoding in the file is consistent and saved in one of supported encodings (UTF-8 or ANSI)."
"Make sure that you configure the design settings for the Payflow Link form in your Payflow link account.","Make sure that you configure the design settings for the Payflow Link form in your Payflow link account."
"Manage Stores","Manage Stores"
"Max","Max"
"Min","Min"
+"More Tabs","More Tabs"
"N/A","N/A"
"Name","Name"
"Name on Card","Name on Card"
@@ -202,6 +225,7 @@
"On my website","On my website"
"Once you log into your Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below","Once you log into your Payflow Link account, navigate to the Service Settings - Hosted Checkout Pages - Set Up menu and set the options described below"
"Only mapped fields","Only mapped fields"
+"Options menu items","Options menu items"
"Order ID","Order ID"
"Order Totals","Order Totals"
"Order cannot be placed.","Order cannot be placed."
@@ -251,6 +275,7 @@
"Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.","Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006."
"Please wait while the indexes are being refreshed.","Please wait while the indexes are being refreshed."
"Please wait, loading...","Please wait, loading..."
+"Preset Theme","Preset Theme"
"Prev. month (hold for menu)","Prev. month (hold for menu)"
"Prev. year (hold for menu)","Prev. year (hold for menu)"
"Preview","Preview"
@@ -258,6 +283,9 @@
"Price","Price"
"Price:","Price:"
"Product","Product"
+"Product Name3 ","Product Name3 "
+"Product Name3 1","Product Name3 1"
+"Product Name3 2","Product Name3 2"
"Products","Products"
"Profile Information","Profile Information"
"Qty","Qty"
@@ -268,6 +296,8 @@
"Remote FTP","Remote FTP"
"Remove","Remove"
"Required settings","Required settings"
+"Reset","Reset"
+"Reset Successful","Reset Successful"
"Resource Access","Resource Access"
"Resources","Resources"
"Return URL: ","Return URL: "
@@ -276,9 +306,13 @@
"Roles Resources","Roles Resources"
"SKU","SKU"
"SKU:","SKU:"
+"SORT BY:","SORT BY:"
+"Save Theme","Save Theme"
+"Screens:","Screens:"
"Select All","Select All"
"Select Date","Select Date"
"Select Range","Select Range"
+"Select Template","Select Template"
"Select Visible","Select Visible"
"Select date","Select date"
"Shipment Comments","Shipment Comments"
@@ -311,9 +345,13 @@
"Switch/Solo/Maestro(UK Domestic) card start Date: %s/%s","Switch/Solo/Maestro(UK Domestic) card start Date: %s/%s"
"Synchronization is required.","Synchronization is required."
"System busy","System busy"
+"T-Shirts","T-Shirts"
"Target","Target"
+"Tell a Friend","Tell a Friend"
+"Template Name","Template Name"
"The card has failed verification with the issuer bank.","The card has failed verification with the issuer bank."
"The information in this tab has been changed.","The information in this tab has been changed."
+"Theme has been saved.","Theme has been saved."
"There has been wrong payment information submitted or time limit has expired. Please, try again.","There has been wrong payment information submitted or time limit has expired. Please, try again."
"This is a demo store. Any orders placed through this store will not be honored or fulfilled.","This is a demo store. Any orders placed through this store will not be honored or fulfilled."
"This is a required field.","This is a required field."
@@ -321,6 +359,7 @@
"Thumbnail","Thumbnail"
"Time selection:","Time selection:"
"Time:","Time:"
+"Title bar","Title bar"
"To","To"
"To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel.","To cancel pending authorizations and release amounts that have already been processed during this payment, click Cancel."
"To use Payflow Link, you must configure your Payflow Link account on the Paypal website.","To use Payflow Link, you must configure your Payflow Link account on the Paypal website."
@@ -335,8 +374,11 @@
"Type","Type"
"Type:","Type:"
"Unable to login.","Unable to login."
+"Unknown Error","Unknown Error"
+"Unknown Error.","Unknown Error."
"Unselect All","Unselect All"
"Unselect Visible","Unselect Visible"
+"Update Preview","Update Preview"
"Updated At","Updated At"
"Use Default Value","Use Default Value"
"Use Silent Post:","Use Silent Post:"
@@ -351,6 +393,8 @@
"Verification Successful","Verification Successful"
"Verification cannot be processed","Verification cannot be processed"
"View","View"
+"View Details","View Details"
+"View Gallery","View Gallery"
"View Statistics For","View Statistics For"
"Visibility:","Visibility:"
"Warning! Empty value can cause problems with CSV format.","Warning! Empty value can cause problems with CSV format."
diff --git a/app/locale/en_US/Mage_Checkout.csv b/app/locale/en_US/Mage_Checkout.csv
index 9bc85e1b4e..2608f9810a 100644
--- a/app/locale/en_US/Mage_Checkout.csv
+++ b/app/locale/en_US/Mage_Checkout.csv
@@ -3,6 +3,9 @@
"* Required Fields","* Required Fields"
"Add New Address","Add New Address"
"Add New Condition","Add New Condition"
+"Add coupon code for shopping cart","Add coupon code for shopping cart"
+"Add product to shopping cart","Add product to shopping cart"
+"Add product(s) to shopping cart","Add product(s) to shopping cart"
"Add to Cart","Add to Cart"
"Add to Compare","Add to Compare"
"Add to Wishlist","Add to Wishlist"
@@ -38,7 +41,7 @@
"Cannot update shopping cart.","Cannot update shopping cart."
"Cannot update the item.","Cannot update the item."
"Card Verification Number Visual Reference","Card Verification Number Visual Reference"
-"Cart Api","Cart Api"
+"Cart Product Api","Cart Product Api"
"Cart Subtotal:","Cart Subtotal:"
"Change","Change"
"Change Billing Address","Change Billing Address"
@@ -76,7 +79,10 @@
"Coupon code was canceled.","Coupon code was canceled."
"Create Billing Address","Create Billing Address"
"Create Shipping Address","Create Shipping Address"
+"Create an order from shopping cart","Create an order from shopping cart"
"Create shopping cart","Create shopping cart"
+"Customer Information","Customer Information"
+"Customer's information","Customer's information"
"Data saving problem","Data saving problem"
"Default Billing","Default Billing"
"Default Shipping","Default Shipping"
@@ -113,6 +119,11 @@
"Forgot an Item?","Forgot an Item?"
"Forgot your password?","Forgot your password?"
"Get a Quote","Get a Quote"
+"Get list of available payment methods","Get list of available payment methods"
+"Get list of available shipping methods","Get list of available shipping methods"
+"Get list of products in shopping cart","Get list of products in shopping cart"
+"Get terms and conditions","Get terms and conditions"
+"Get total prices for shopping cart","Get total prices for shopping cart"
"Grand Total:","Grand Total:"
"Grouped Product Image","Grouped Product Image"
"HTML","HTML"
@@ -168,7 +179,9 @@
"Payment Method","Payment Method"
"Payment Methods After Checkout Button","Payment Methods After Checkout Button"
"Payment Methods Before Checkout Button","Payment Methods Before Checkout Button"
+"Payment method information","Payment method information"
"Payment method is not defined","Payment method is not defined"
+"Payment methods in shopping cart","Payment methods in shopping cart"
"Payment profile # %s: ""%s"".","Payment profile # %s: ""%s""."
"Place Order","Place Order"
"Please agree to all Terms and Conditions before placing the order.","Please agree to all Terms and Conditions before placing the order."
@@ -182,6 +195,7 @@
"Proceed to Checkout","Proceed to Checkout"
"Product","Product"
"Product Name","Product Name"
+"Products","Products"
"Qty","Qty"
"Qty:","Qty:"
"Quantity was recalculated from %d to %d","Quantity was recalculated from %d to %d"
@@ -195,7 +209,11 @@
"Register with us for future convenience:","Register with us for future convenience:"
"Remove Item","Remove Item"
"Remove This Item","Remove This Item"
+"Remove coupon code from shopping cart","Remove coupon code from shopping cart"
"Remove item","Remove item"
+"Remove product from shopping cart","Remove product from shopping cart"
+"Remove product(s) from shopping cart","Remove product(s) from shopping cart"
+"Retrieve information about shopping cart","Retrieve information about shopping cart"
"Review Order","Review Order"
"Review Order - %s","Review Order - %s"
"Sales","Sales"
@@ -211,6 +229,10 @@
"Send Payment Failed Email Copy To","Send Payment Failed Email Copy To"
"Send To","Send To"
"Separate by "","".","Separate by "",""."
+"Set customer for shopping cart","Set customer for shopping cart"
+"Set customer's addresses in shopping cart","Set customer's addresses in shopping cart"
+"Set payment method","Set payment method"
+"Set shipping method","Set shipping method"
"Ship to Multiple Addresses","Ship to Multiple Addresses"
"Ship to different address","Ship to different address"
"Ship to this address","Ship to this address"
@@ -219,13 +241,16 @@
"Shipping Method","Shipping Method"
"Shipping Methods","Shipping Methods"
"Shipping To","Shipping To"
+"Shipping information","Shipping information"
"Shipping method has not been selected yet","Shipping method has not been selected yet"
+"Shipping methods in shopping cart","Shipping methods in shopping cart"
"Shipping selection is not applicable.","Shipping selection is not applicable."
"Shopping Cart","Shopping Cart"
"Shopping Cart Form Before","Shopping Cart Form Before"
"Shopping Cart Sidebar","Shopping Cart Sidebar"
"Shopping Cart Sidebar Extra Actions","Shopping Cart Sidebar Extra Actions"
"Shopping Cart is Empty","Shopping Cart is Empty"
+"Shopping cart ability to set coupon code","Shopping cart ability to set coupon code"
"Show Content as","Show Content as"
"Some of the requested products are not available in the desired quantity.","Some of the requested products are not available in the desired quantity."
"Some of the requested products are unavailable.","Some of the requested products are unavailable."
@@ -261,6 +286,8 @@
"Update Qty & Addresses","Update Qty & Addresses"
"Update Shopping Cart","Update Shopping Cart"
"Update Total","Update Total"
+"Update product quantities in shopping cart","Update product quantities in shopping cart"
+"Update product(s) quantities in shopping cart","Update product(s) quantities in shopping cart"
"Use Billing Address","Use Billing Address"
"We are processing your order and you will soon receive an email with details of the order. Once the order has shipped you will receive another email with a link to track its progress.","We are processing your order and you will soon receive an email with details of the order. Once the order has shipped you will receive another email with a link to track its progress."
"You have no items in your shopping cart.","You have no items in your shopping cart."
diff --git a/app/locale/en_US/Mage_Connect.csv b/app/locale/en_US/Mage_Connect.csv
index 87ffe528e5..6470dc9e4c 100644
--- a/app/locale/en_US/Mage_Connect.csv
+++ b/app/locale/en_US/Mage_Connect.csv
@@ -1,3 +1,4 @@
+"1.5.0.0 & later","1.5.0.0 & later"
"Action","Action"
"Add Author","Add Author"
"Add Contents Path","Add Contents Path"
@@ -37,16 +38,17 @@
"Package","Package"
"Package Extensions","Package Extensions"
"Package File Name","Package File Name"
-"Package Format","Package Format"
"Package Info","Package Info"
"Packages","Packages"
"Path","Path"
+"Pre-1.5.0.0","Pre-1.5.0.0"
"Release Info","Release Info"
"Remove","Remove"
"Save As...","Save As..."
"Save Data and Create Package","Save Data and Create Package"
"Save package with custom package file name","Save package with custom package file name"
"Summary","Summary"
+"Supported releases","Supported releases"
"System","System"
"Target","Target"
"The package %s data has been loaded.","The package %s data has been loaded."
@@ -54,5 +56,3 @@
"There was a problem saving package data","There was a problem saving package data"
"Type","Type"
"User","User"
-"Version 1.x","Version 1.x"
-"Version 2.x","Version 2.x"
diff --git a/app/locale/en_US/Mage_Core.csv b/app/locale/en_US/Mage_Core.csv
index 5d765b938f..324469c31c 100644
--- a/app/locale/en_US/Mage_Core.csv
+++ b/app/locale/en_US/Mage_Core.csv
@@ -37,7 +37,7 @@
"Browser Capabilities Detection","Browser Capabilities Detection"
"CSS Settings","CSS Settings"
"Cache Storage Management","Cache Storage Management"
-"Cache storage may contain another data. Are you sure that you want flush it?","Cache storage may contain another data. Are you sure that you want flush it?"
+"Cache storage may contain additional data. Are you sure that you want flush it?","Cache storage may contain additional data. Are you sure that you want flush it?"
"Can't retrieve request object","Can't retrieve request object"
"Cancel","Cancel"
"Cannot complete this operation from non-admin area.","Cannot complete this operation from non-admin area."
diff --git a/app/locale/en_US/Mage_Sales.csv b/app/locale/en_US/Mage_Sales.csv
index 4a0b94d8c8..761b445bf8 100644
--- a/app/locale/en_US/Mage_Sales.csv
+++ b/app/locale/en_US/Mage_Sales.csv
@@ -51,7 +51,6 @@
"An error occurred while unassigning order status.","An error occurred while unassigning order status."
"An error occurred while updating the order address. The address has not been changed.","An error occurred while updating the order address. The address has not been changed."
"An item option with code %s already exists.","An item option with code %s already exists."
-"And Use As Default","And Use As Default"
"Append Comments","Append Comments"
"Apply","Apply"
"Apply Coupon Code","Apply Coupon Code"
@@ -67,7 +66,6 @@
"Are you sure you want to void the payment?","Are you sure you want to void the payment?"
"Are you sure?","Are you sure?"
"Are you sure? This order will be canceled and a new one will be created instead","Are you sure? This order will be canceled and a new one will be created instead"
-"Assign Order Status","Assign Order Status"
"Assign Order Status to State","Assign Order Status to State"
"Assign Status to State","Assign Status to State"
"Assignment Information","Assignment Information"
@@ -400,6 +398,7 @@
"Order Information","Order Information"
"Order Invoices","Order Invoices"
"Order Shipments","Order Shipments"
+"Order State","Order State"
"Order Status","Order Status"
"Order Status Information","Order Status Information"
"Order Statuses","Order Statuses"
@@ -701,7 +700,6 @@
"Title","Title"
"To","To"
"To Name","To Name"
-"To Order State","To Order State"
"To:","To:"
"Total","Total"
"Total %d product(s)","Total %d product(s)"
@@ -754,6 +752,7 @@
"Updated At","Updated At"
"Updated:","Updated:"
"Use Aggregated Data (beta)","Use Aggregated Data (beta)"
+"Use Order Status As Default","Use Order Status As Default"
"Validate Each Address Separately in Multi-address Checkout","Validate Each Address Separately in Multi-address Checkout"
"Value","Value"
"View","View"
diff --git a/app/locale/en_US/Mage_Wishlist.csv b/app/locale/en_US/Mage_Wishlist.csv
index 04ce5faeda..5697d10d62 100644
--- a/app/locale/en_US/Mage_Wishlist.csv
+++ b/app/locale/en_US/Mage_Wishlist.csv
@@ -79,7 +79,6 @@
"User description","User description"
"View Details","View Details"
"View Product","View Product"
-"Visible In","Visible In"
"Wishlist","Wishlist"
"Wishlist Section","Wishlist Section"
"Wishlist Sharing","Wishlist Sharing"
diff --git a/app/locale/en_US/Mage_XmlConnect.csv b/app/locale/en_US/Mage_XmlConnect.csv
index 0604b5e715..730042705d 100644
--- a/app/locale/en_US/Mage_XmlConnect.csv
+++ b/app/locale/en_US/Mage_XmlConnect.csv
@@ -1,20 +1,24 @@
" "," "
" But cart has some errors."," But cart has some errors."
+"""Title"" is more than %d characters long","""Title"" is more than %d characters long"
"%1$s has been added to your wishlist.","%1$s has been added to your wishlist."
"%1$s incl tax.","%1$s incl tax."
"%s has been added to your cart.","%s has been added to your cart."
"10:40 AM","10:40 AM"
"80px x 80px","80px x 80px"
+"80x80 px","80x80 px"
"A Catalog Only App will not support functions such as add to cart, add to wishlist, or login.","A Catalog Only App will not support functions such as add to cart, add to wishlist, or login."
"A new password has been sent.","A new password has been sent."
"Account","Account"
"Account confirmation is required. Please check your email for the confirmation link.","Account confirmation is required. Please check your email for the confirmation link."
"Account information has been saved.","Account information has been saved."
+"Action","Action"
"Activate","Activate"
"Activate PayPal Checkout","Activate PayPal Checkout"
"Activation Key","Activation Key"
"Add App","Add App"
"Add More Templates","Add More Templates"
+"Add New Template","Add New Template"
"Add Page","Add Page"
"Add to Cart","Add to Cart"
"Add to Wishlist","Add to Wishlist"
@@ -28,6 +32,12 @@
"Address has been saved.","Address has been saved."
"Administrative contact for this app and for app submission issues.","Administrative contact for this app and for app submission issues."
"Advanced Settings","Advanced Settings"
+"After submitting the App, please contact %1$s to receive the Application Key, Application Secret and Application Master Secret. Upon receiving these credentials, please fill in the corresponding fields. In addition, please accept Urban Airship\'s Terms of Service: click here .","After submitting the App, please contact %1$s to receive the Application Key, Application Secret and Application Master Secret. Upon receiving these credentials, please fill in the corresponding fields. In addition, please accept Urban Airship\'s Terms of Service: click here ."
+"AirMail Message Queue","AirMail Message Queue"
+"AirMail Messages Queue","AirMail Messages Queue"
+"AirMail Template Preview","AirMail Template Preview"
+"AirMail message","AirMail message"
+"AirMail templates","AirMail templates"
"An account with this email address already exists.","An account with this email address already exists."
"An error occurred while adding item to wishlist.","An error occurred while adding item to wishlist."
"An error occurred while deleting the address.","An error occurred while deleting the address."
@@ -36,7 +46,11 @@
"An error occurred while processing your request.","An error occurred while processing your request."
"An error occurred while removing item from wishlist.","An error occurred while removing item from wishlist."
"An error occurred while removing items from wishlist.","An error occurred while removing items from wishlist."
+"Analytics","Analytics"
+"Android","Android"
"App Background","App Background"
+"App Background (landscape mode)","App Background (landscape mode)"
+"App Background (portrait mode)","App Background (portrait mode)"
"App Code","App Code"
"App Information","App Information"
"App Name","App Name"
@@ -50,8 +64,17 @@
"App model not loaded.","App model not loaded."
"App with specified code does not exist.","App with specified code does not exist."
"Appears in the info section of your app (example: Copyright 2010 – Your Company, Inc.)","Appears in the info section of your app (example: Copyright 2010 – Your Company, Inc.)"
+"Application","Application"
+"Application Key","Application Key"
+"Application Master Secret","Application Master Secret"
+"Application Name","Application Name"
+"Application Secret","Application Secret"
"Apply Theme","Apply Theme"
"Apply will automatically resize this image for display in the App Store and on users’ devices. A gloss (i.e. gradient) will also be applied, so you do not need to apply a gradient. Image must be at least 512x512","Apply will automatically resize this image for display in the App Store and on users’ devices. A gloss (i.e. gradient) will also be applied, so you do not need to apply a gradient. Image must be at least 512x512"
+"Are you sure you whant to cancel a message?","Are you sure you whant to cancel a message?"
+"Are you sure you whant to delete a message?","Are you sure you whant to delete a message?"
+"Are you sure you what to cancel selected records?","Are you sure you what to cancel selected records?"
+"Are you sure you what to delete selected records?","Are you sure you what to delete selected records?"
"Authentication complete.","Authentication complete."
"Back","Back"
"Back to App Edit","Back to App Edit"
@@ -65,6 +88,7 @@
"Can\'t apply the coupon code.","Can\'t apply the coupon code."
"Can\'t create wishlist.","Can\'t create wishlist."
"Can\'t load XML.","Can\'t load XML."
+"Can\'t load application with code ""%s""","Can\'t load application with code ""%s"""
"Can\'t open submission form.","Can\'t open submission form."
"Can\'t read file ""%s"".","Can\'t read file ""%s""."
"Can\'t remove the item.","Can\'t remove the item."
@@ -78,6 +102,9 @@
"Can\'t update cart.","Can\'t update cart."
"Can\'t write to file ""%s"".","Can\'t write to file ""%s""."
"Can\t copy file ""%s"" to ""%s"".","Can\t copy file ""%s"" to ""%s""."
+"Cancel","Cancel"
+"Canceled","Canceled"
+"Cancelled","Cancelled"
"Cannot load theme ""%s"".","Cannot load theme ""%s""."
"Cannot save theme ""%s"". Incorrect data received","Cannot save theme ""%s"". Incorrect data received"
"Card Verification Number","Card Verification Number"
@@ -87,16 +114,19 @@
"Cart has been updated.","Cart has been updated."
"Cart has some errors.","Cart has some errors."
"Cart is empty.","Cart is empty."
+"Cart line items are not eligible for exporting to PayPal API","Cart line items are not eligible for exporting to PayPal API"
"Catalog Only App?","Catalog Only App?"
"Category Button Color","Category Button Color"
"Category Item Background Color","Category Item Background Color"
+"Chairs","Chairs"
+"Change Orientation","Change Orientation"
"Change Password","Change Password"
"Checkout has been initialized.","Checkout has been initialized."
"City","City"
-"Code","Code"
"Color Themes","Color Themes"
"Colors","Colors"
"Company","Company"
+"Completed","Completed"
"Confirm New Password","Confirm New Password"
"Confirm Password","Confirm Password"
"Contact Email","Contact Email"
@@ -110,6 +140,7 @@
"Coupon code %s was applied.","Coupon code %s was applied."
"Coupon code is empty.","Coupon code is empty."
"Coupon code was canceled.","Coupon code was canceled."
+"Creating a Template is allowed only for applications which have device type iPhone.","Creating a Template is allowed only for applications which have device type iPhone."
"Credit Card Number","Credit Card Number"
"Credit Card Type","Credit Card Type"
"Credit card number does not match credit card type.","Credit card number does not match credit card type."
@@ -121,20 +152,33 @@
"Customer email not specified.","Customer email not specified."
"Customer logout problem.","Customer logout problem."
"Customer not logged in.","Customer not logged in."
+"Date Created","Date Created"
"Date Submitted","Date Submitted"
+"Date Updated","Date Updated"
"Default Billing Address","Default Billing Address"
"Default Shipping Address","Default Shipping Address"
"Default Theme","Default Theme"
"Delete","Delete"
+"Deleted","Deleted"
"Description","Description"
"Description that appears in the iTunes App Store. 4000 chars maximum. ","Description that appears in the iTunes App Store. 4000 chars maximum. "
"Design","Design"
"Device","Device"
+"Device Information","Device Information"
"Device Type","Device Type"
+"Device doesn\'t recognized. Unable to load a template.","Device doesn\'t recognized. Unable to load a template."
+"Device doesn\'t recognized: ""%s"". Unable to load a helper.","Device doesn\'t recognized: ""%s"". Unable to load a helper."
+"Edit","Edit"
+"Edit AirMail Message","Edit AirMail Message"
+"Edit AirMail Message Queue #%s","Edit AirMail Message Queue #%s"
"Edit App ""%s""","Edit App ""%s"""
"Edit Filter","Edit Filter"
+"Edit Template ""%s""","Edit Template ""%s"""
"Email","Email"
"Email Address","Email Address"
+"Enable AirMail Message Push notification","Enable AirMail Message Push notification"
+"Enable Flurry Analytics","Enable Flurry Analytics"
+"Enable Flurry Analytics for the merchant.","Enable Flurry Analytics for the merchant."
"Enable Standard Checkout","Enable Standard Checkout"
"Error while processing file ""%s"".","Error while processing file ""%s""."
"Error while uploading file ""%s"".","Error while uploading file ""%s""."
@@ -142,10 +186,14 @@
"Error.","Error."
"Expiration Date - Month","Expiration Date - Month"
"Expiration Date - Year","Expiration Date - Year"
+"Extensions","Extensions"
"FILTERS APPLIED","FILTERS APPLIED"
"Fax","Fax"
"File doesn\'t exist ""%s"".","File doesn\'t exist ""%s""."
"First Name","First Name"
+"Flurry Analytics","Flurry Analytics"
+"Flurry Analytics Site","Flurry Analytics Site"
+"Flurry Api Code","Flurry Api Code"
"Fonts","Fonts"
"Free","Free"
"Funk Leaf","Funk Leaf"
@@ -159,11 +207,14 @@
"Header Font Color","Header Font Color"
"Home","Home"
"Hot Red","Hot Red"
+"ID","ID"
"Icon that will appear on the user’s phone after they download your app. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Recommended size: 57px x 57px at 72 dpi.","Icon that will appear on the user’s phone after they download your app. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Recommended size: 57px x 57px at 72 dpi."
"Icons","Icons"
+"If leave this field empty, the message will be sent immediately","If leave this field empty, the message will be sent immediately"
"Image file was not found.","Image file was not found."
"Image that appears on first screen while your app is loading. Required size: 320px x 460px.","Image that appears on first screen while your app is loading. Required size: 320px x 460px."
"Images","Images"
+"In Queue","In Queue"
"In Stock","In Stock"
"In order to resubmit your app, you need to first purchase a %s from MagentoCommerce","In order to resubmit your app, you need to first purchase a %s from MagentoCommerce"
"In order to submit your app, you need to first purchase a %s from MagentoCommerce","In order to submit your app, you need to first purchase a %s from MagentoCommerce"
@@ -194,12 +245,23 @@
"Logo in Header","Logo in Header"
"Logout complete.","Logout complete."
"MEP is PayPal`s native checkout experience for the iPhone. You can choose to use MEP alongside standard checkout, or use it as your only checkout method for Magento mobile. PayPal MEP requires a PayPal business account ","MEP is PayPal`s native checkout experience for the iPhone. You can choose to use MEP alongside standard checkout, or use it as your only checkout method for Magento mobile. PayPal MEP requires a PayPal business account "
+"Mailbox title","Mailbox title"
"Main Tabs","Main Tabs"
"Make Inactive","Make Inactive"
"Make this app available in the following territories","Make this app available in the following territories"
"Manage Apps","Manage Apps"
"Manage Mobile App","Manage Mobile App"
+"Maximum length is 140","Maximum length is 140"
+"Maximum length is 255","Maximum length is 255"
"Merchant Label","Merchant Label"
+"Message Queue","Message Queue"
+"Message Settings","Message Settings"
+"Message Templates","Message Templates"
+"Message Title","Message Title"
+"Message Type","Message Type"
+"Message can not be edited when it\'s status NOT is ""IN QUEUE"".","Message can not be edited when it\'s status NOT is ""IN QUEUE""."
+"Message content","Message content"
+"Message title","Message title"
"Messages cannot be sent more than %d times in an hour.","Messages cannot be sent more than %d times in an hour."
"Mobile","Mobile"
"More","More"
@@ -207,8 +269,11 @@
"More Tabs","More Tabs"
"Name on Card","Name on Card"
"Name that appears beneath your app when users install it to their device. We recommend choosing a name that is 10-12 characters and that your customers will recognize.","Name that appears beneath your app when users install it to their device. We recommend choosing a name that is 10-12 characters and that your customers will recognize."
+"New AirMail Message","New AirMail Message"
+"New AirMail Message Queue","New AirMail Message Queue"
"New App","New App"
"New Password","New Password"
+"New Template","New Template"
"No items were specifed to update.","No items were specifed to update."
"No items were updated.","No items were updated."
"No product selected.","No product selected."
@@ -217,6 +282,7 @@
"One or more keywords that describe your app. Keywords are matched to users` searches in the App Store and help return accurate search results. Separate multiple keywords with commas. 100 chars is maximum.","One or more keywords that describe your app. Keywords are matched to users` searches in the App Store and help return accurate search results. Separate multiple keywords with commas. 100 chars is maximum."
"Onepage checkout is disabled.","Onepage checkout is disabled."
"Only free apps are allowed in this version.","Only free apps are allowed in this version."
+"Options menu items","Options menu items"
"POST data is not valid.","POST data is not valid."
"Pages","Pages"
"Password","Password"
@@ -227,6 +293,7 @@
"Payment method was successfully set.","Payment method was successfully set."
"Paypal Merchant Account Email.","Paypal Merchant Account Email."
"Paypal Merchant Account Username.","Paypal Merchant Account Username."
+"Please Select Application","Please Select Application"
"Please Select Device Type","Please Select Device Type"
"Please agree to all the terms and conditions before placing the order.","Please agree to all the terms and conditions before placing the order."
"Please enter ""App Title"".","Please enter ""App Title""."
@@ -238,11 +305,13 @@
"Please enter the Title.","Please enter the Title."
"Please make sure your passwords match.","Please make sure your passwords match."
"Please select at least one country.","Please select at least one country."
+"Please upload an image for ""App Background (landscape mode)"" field from Design Tab.","Please upload an image for ""App Background (landscape mode)"" field from Design Tab."
+"Please upload an image for ""App Background (portrait mode)"" field from Design Tab.","Please upload an image for ""App Background (portrait mode)"" field from Design Tab."
"Please upload an image for ""App Background"" field from Design Tab.","Please upload an image for ""App Background"" field from Design Tab."
"Please upload an image for ""Banner on Home Screen"" field from Design Tab.","Please upload an image for ""Banner on Home Screen"" field from Design Tab."
"Please upload an image for ""Logo in Header"" field from Design Tab.","Please upload an image for ""Logo in Header"" field from Design Tab."
-"Popularity","Popularity"
"Preset Theme","Preset Theme"
+"Preview","Preview"
"Price","Price"
"Price Font Color","Price Font Color"
"Primary Color","Primary Color"
@@ -256,10 +325,21 @@
"Product(s) currently out of stock.","Product(s) currently out of stock."
"Purchase Order Number","Purchase Order Number"
"Push Notification","Push Notification"
+"Push Title","Push Title"
+"Push message","Push message"
+"Push title","Push title"
+"Queue Date","Queue Date"
+"Queue Message","Queue Message"
+"Queue does not exist.","Queue does not exist."
"Quote instance is required.","Quote instance is required."
+"Recommended size 1024px x 704px. Note: Image size affects the performance of your app.","Recommended size 1024px x 704px. Note: Image size affects the performance of your app."
"Recommended size 320px x 230px. Note: Image size affects the performance of your app. Keep your image size below 50 KB for optimal performance.","Recommended size 320px x 230px. Note: Image size affects the performance of your app. Keep your image size below 50 KB for optimal performance."
+"Recommended size 320px x 258px. Note: Image size affects the performance of your app. Keep your image size below 50 KB for optimal performance.","Recommended size 320px x 258px. Note: Image size affects the performance of your app. Keep your image size below 50 KB for optimal performance."
"Recommended size 320px x 367px. Note: Image size affects the performance of your app. Keep your image size below 75 KB for optimal performance.","Recommended size 320px x 367px. Note: Image size affects the performance of your app. Keep your image size below 75 KB for optimal performance."
+"Recommended size 320px x 455px. Note: Image size affects the performance of your app. Keep your image size below 75 KB for optimal performance.","Recommended size 320px x 455px. Note: Image size affects the performance of your app. Keep your image size below 75 KB for optimal performance."
"Recommended size 35px x 35px.","Recommended size 35px x 35px."
+"Recommended size 768px x 294px. Note: Image size affects the performance of your app.","Recommended size 768px x 294px. Note: Image size affects the performance of your app."
+"Recommended size 768px x 960px. Note: Image size affects the performance of your app.","Recommended size 768px x 960px. Note: Image size affects the performance of your app."
"Regular and confirmation passwords must be equal","Regular and confirmation passwords must be equal"
"Related Product Background Color","Related Product Background Color"
"Reset","Reset"
@@ -268,7 +348,6 @@
"Resubmit","Resubmit"
"Resubmit App","Resubmit App"
"Resubmit Application","Resubmit Application"
-"Reviews","Reviews"
"SORT BY:","SORT BY:"
"Save","Save"
"Save Theme","Save Theme"
@@ -282,12 +361,14 @@
"Secondary Font Color","Secondary Font Color"
"Select Template","Select Template"
"Selected product is unavailable.","Selected product is unavailable."
+"Settings","Settings"
"Shipping address has been set.","Shipping address has been set."
"Shipping method has been set.","Shipping method has been set."
"Shop","Shop"
"Shopping cart is empty.","Shopping cart is empty."
"Sky Blue","Sky Blue"
"Some emails were not sent.","Some emails were not sent."
+"Sorry, no payment options are available for this order at this time.","Sorry, no payment options are available for this order at this time."
"Sorry, no quotes are available for this order at this time.","Sorry, no quotes are available for this order at this time."
"Specified address does not exist.","Specified address does not exist."
"Specified invalid app code.","Specified invalid app code."
@@ -295,6 +376,7 @@
"Specified item does not exist in wishlist.","Specified item does not exist in wishlist."
"Standard Checkout","Standard Checkout"
"Standard Checkout uses the checkout methods provided by Magento. Only inline payment methods are supported. (e.g PayPal Direct, Authorize.Net, etc.)","Standard Checkout uses the checkout methods provided by Magento. Only inline payment methods are supported. (e.g PayPal Direct, Authorize.Net, etc.)"
+"Start Date","Start Date"
"Start Date - Month","Start Date - Month"
"Start Date - Year","Start Date - Year"
"State/Province","State/Province"
@@ -311,6 +393,7 @@
"Submit App","Submit App"
"Submit App ""%s""","Submit App ""%s"""
"Submit App failure. %s","Submit App failure. %s"
+"Submit App failure. Invalid activation key provided","Submit App failure. Invalid activation key provided"
"Submit Application","Submit Application"
"Submitted","Submitted"
"Subtotal (Excl. Tax)","Subtotal (Excl. Tax)"
@@ -321,9 +404,16 @@
"Tell a Friend","Tell a Friend"
"Tell a Friend is disabled.","Tell a Friend is disabled."
"Tell a Friend link has been sent.","Tell a Friend link has been sent."
+"Template","Template"
+"Template Content","Template Content"
"Template Name","Template Name"
+"Template creation is allowed only for applications which have device type iPhone, but this kind of applications has not been found.","Template creation is allowed only for applications which have device type iPhone, but this kind of applications has not been found."
+"Template does not exist.","Template does not exist."
+"Template for new AirMail Message does not exist.","Template for new AirMail Message does not exist."
+"Template has been deleted.","Template has been deleted."
"Thank you for registering!","Thank you for registering!"
"Thank you for your purchase! ","Thank you for your purchase! "
+"The Mailbox title will be shown in the More Info tab. To understand more about the title, please click here ","The Mailbox title will be shown in the More Info tab. To understand more about the title, please click here "
"Theme has been saved.","Theme has been saved."
"Theme name is not set.","Theme name is not set."
"There were some problems with the data.","There were some problems with the data."
@@ -333,10 +423,14 @@
"This is the name that will appear beneath your app when users install it to their device. . We recommend choosing a name that is 10-12 characters in length, and that your customers will recognize.","This is the name that will appear beneath your app when users install it to their device. . We recommend choosing a name that is 10-12 characters in length, and that your customers will recognize."
"This will appear in the info section of your App (example: Copyright 2010 – Your Company, Inc.)","This will appear in the info section of your App (example: Copyright 2010 – Your Company, Inc.)"
"Title","Title"
+"Title bar","Title bar"
"To activate PayPal MEP payment method activate Express checkout first. ","To activate PayPal MEP payment method activate Express checkout first. "
"Total incl. Tax: %1$s","Total incl. Tax: %1$s"
+"Unable to cancel queue.","Unable to cancel queue."
"Unable to collect cart totals.","Unable to collect cart totals."
+"Unable to delete queue.","Unable to delete queue."
"Unable to find an app to delete.","Unable to find an app to delete."
+"Unable to find template to delete.","Unable to find template to delete."
"Unable to get shipping methods list.","Unable to get shipping methods list."
"Unable to initialize MEP Checkout.","Unable to initialize MEP Checkout."
"Unable to load application form.","Unable to load application form."
@@ -344,31 +438,40 @@
"Unable to place the order.","Unable to place the order."
"Unable to process preview.","Unable to process preview."
"Unable to save app.","Unable to save app."
+"Unable to save message.","Unable to save message."
"Unable to save shipping address.","Unable to save shipping address."
"Unable to save shipping method.","Unable to save shipping method."
+"Unable to save template.","Unable to save template."
"Unable to set payment method.","Unable to set payment method."
"Unable to start MEP Checkout.","Unable to start MEP Checkout."
+"Undefined","Undefined"
"Unknown Error","Unknown Error"
"Unknown Error.","Unknown Error."
"Update Preview","Update Preview"
+"Urban Airship Push Notification","Urban Airship Push Notification"
"Use as my default billing address","Use as my default billing address"
"Use as my default shipping address","Use as my default shipping address"
"Username","Username"
"Users will see this image as the first screen while your application is loading. It is a 320x460 image.","Users will see this image as the first screen while your application is loading. It is a 320x460 image."
"View Details","View Details"
"View Gallery","View Gallery"
+"Website is offline.","Website is offline."
"Wishlist has been cleared.","Wishlist has been cleared."
"Wishlist has been updated.","Wishlist has been updated."
"Wishlist has been updated. But there are accrued some errors while updating some items.","Wishlist has been updated. But there are accrued some errors while updating some items."
+"Wrong Ipad background image orientation has been specified: ""%s"".","Wrong Ipad background image orientation has been specified: ""%s""."
+"Wrong device type.","Wrong device type."
"Wrong email format","Wrong email format"
"Wrong theme format.","Wrong theme format."
"You are already logged in.","You are already logged in."
"You can set any additional countries added by Apple Store.","You can set any additional countries added by Apple Store."
"You can set any price you want for your app, or you can give it away for free. Most apps range from $0.99 - $4.99","You can set any price you want for your app, or you can give it away for free. Most apps range from $0.99 - $4.99"
+"You can watch statistics here.","You can watch statistics here."
"You will receive an order confirmation email with details of your order and a link to track its progress.","You will receive an order confirmation email with details of your order and a link to track its progress."
"Your order # is: %s. ","Your order # is: %s. "
"Zip/Postal Code","Zip/Postal Code"
"and","and"
"each","each"
+"iPad","iPad"
"iPhone","iPhone"
"save","save"
diff --git a/downloader/Maged/Controller.php b/downloader/Maged/Controller.php
index f0dcdbdbb8..0c45d5ab1d 100755
--- a/downloader/Maged/Controller.php
+++ b/downloader/Maged/Controller.php
@@ -288,6 +288,7 @@ public function connectPackagesAction()
}
$this->view()->set('connect', $connect);
+ $this->view()->set('channel_config', $this->channelConfig());
echo $this->view()->template('connect/packages.phtml');
}
diff --git a/downloader/Maged/Model/Config/Abstract.php b/downloader/Maged/Model/Config/Abstract.php
index fcf5434ea5..8d5825d748 100644
--- a/downloader/Maged/Model/Config/Abstract.php
+++ b/downloader/Maged/Model/Config/Abstract.php
@@ -109,5 +109,23 @@ public function save()
}
return $this;
}
+
+ /**
+ * Return channel label for channel name
+ *
+ * @param string $channel
+ * @return string
+ */
+ public function getChannelLabel($channel)
+ {
+ $channelLabel = '';
+ switch($channel)
+ {
+ case 'community':
+ $channelLabel = 'Magento Community Edition';
+ break;
+ }
+ return $channelLabel;
+ }
}
?>
diff --git a/downloader/template/connect/packages.phtml b/downloader/template/connect/packages.phtml
index 4398836a5b..520564a45e 100644
--- a/downloader/template/connect/packages.phtml
+++ b/downloader/template/connect/packages.phtml
@@ -120,6 +120,7 @@
get('connect')->getAllInstalledPackages(); $i = 0; $cnt = count($packages); ?>
+get('channel_config');?>
+ Magento is a trademark of Magento, Inc. Copyright © 2010 Magento Inc.
+