Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_XmlConnect_Adminhtml_MobileController
  • Mage_XmlConnect_Block_Adminhtml_History
  • Mage_XmlConnect_Block_Adminhtml_History_Grid
  • Mage_XmlConnect_Block_Adminhtml_Mobile
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Form
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Submission
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Cache
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Content
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Accordion
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Accordion_Images
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Accordion_Tabs
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Accordion_Themes
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Preview
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Design_Themes
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Flurryanalytics
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_General
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Notification
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Payment
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Settings
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Social
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tab_Submission_History
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Edit_Tabs
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Addrow
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Color
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Country
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Datetime
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Font
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Image
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Page
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Tabs
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Theme
  • Mage_Xmlconnect_Block_Adminhtml_Mobile_Grid
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Grid_Renderer_Bool
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Grid_Renderer_Type
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Content
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Preview_Tabitems
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Form
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Renderer_Country_Androidmarket
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Renderer_Country_Istore
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Tab_Container
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Tab_Container_Submission
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Tabs
  • Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form
  • Mage_XmlConnect_Block_Adminhtml_Queue
  • Mage_XmlConnect_Block_Adminhtml_Queue_Edit
  • Mage_XmlConnect_Block_Adminhtml_Queue_Edit_Form
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Action
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Application
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Id
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Msgtitle
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Pushtitle
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Status
  • Mage_XmlConnect_Block_Adminhtml_Queue_Grid_Renderer_Template
  • Mage_XmlConnect_Block_Adminhtml_Template
  • Mage_XmlConnect_Block_Adminhtml_Template_Edit
  • Mage_XmlConnect_Block_Adminhtml_Template_Edit_Form
  • Mage_XmlConnect_Block_Adminhtml_Template_Grid
  • Mage_XmlConnect_Block_Adminhtml_Template_Grid_Renderer_Application
  • Mage_XmlConnect_Block_Adminhtml_Template_Grid_Renderer_Name
  • Mage_XmlConnect_Block_Adminhtml_Template_Preview
  • Mage_XmlConnect_Block_Adminhtml_Template_Preview_Form
  • Mage_XmlConnect_Block_Cart
  • Mage_XmlConnect_Block_Cart_Crosssell
  • Mage_XmlConnect_Block_Cart_Info
  • Mage_XmlConnect_Block_Cart_Item_Renderer
  • Mage_XmlConnect_Block_Cart_Item_Renderer_Configurable
  • Mage_XmlConnect_Block_Cart_Item_Renderer_Grouped
  • Mage_XmlConnect_Block_Cart_Paypal_Mecl_Details
  • Mage_XmlConnect_Block_Cart_Paypal_Mecl_Review
  • Mage_XmlConnect_Block_Cart_Paypal_Mecl_Shippingmethods
  • Mage_XmlConnect_Block_Cart_Paypal_Mep_Totals
  • Mage_XmlConnect_Block_Cart_Totals
  • Mage_XmlConnect_Block_Catalog
  • Mage_XmlConnect_Block_Catalog_Category
  • Mage_XmlConnect_Block_Catalog_Category_Info
  • Mage_XmlConnect_Block_Catalog_Filters
  • Mage_XmlConnect_Block_Catalog_Product
  • Mage_XmlConnect_Block_Catalog_Product_Attributes
  • Mage_XmlConnect_Block_Catalog_Product_Gallery
  • Mage_XmlConnect_Block_Catalog_Product_List
  • Mage_XmlConnect_Block_Catalog_Product_Options
  • Mage_XmlConnect_Block_Catalog_Product_Options_Bundle
  • Mage_XmlConnect_Block_Catalog_Product_Options_Configurable
  • Mage_XmlConnect_Block_Catalog_Product_Options_Giftcard
  • Mage_XmlConnect_Block_Catalog_Product_Options_Grouped
  • Mage_XmlConnect_Block_Catalog_Product_Options_Simple
  • Mage_XmlConnect_Block_Catalog_Product_Options_Virtual
  • Mage_XmlConnect_Block_Catalog_Product_Price
  • Mage_XmlConnect_Block_Catalog_Product_Price_Bundle
  • Mage_XmlConnect_Block_Catalog_Product_Price_Default
  • Mage_XmlConnect_Block_Catalog_Product_Price_Giftcard
  • Mage_XmlConnect_Block_Catalog_Product_Related
  • Mage_XmlConnect_Block_Catalog_Product_Review
  • Mage_XmlConnect_Block_Catalog_Product_Review_List
  • Mage_XmlConnect_Block_Catalog_Search
  • Mage_XmlConnect_Block_Catalog_Search_Suggest
  • Mage_XmlConnect_Block_Checkout_Address_Billing
  • Mage_XmlConnect_Block_Checkout_Address_Form
  • Mage_XmlConnect_Block_Checkout_Address_Shipping
  • Mage_XmlConnect_Block_Checkout_Agreements
  • Mage_XmlConnect_Block_Checkout_Order_Review
  • Mage_XmlConnect_Block_Checkout_Order_Review_Info
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Authorizenet
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Ccsave
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Checkmo
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Authorizenet
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Ccsave
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Checkmo
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Free
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Paypal_Abstract
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Paypal_Express
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Paypal_Mecl
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Pbridge_Authorizenet
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Pbridge_Paypal_Direct
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Pbridge_Paypaluk_Direct
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Pbridge_Verisign
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Info_Purchaseorder
  • Mage_XmlConnect_Block_Checkout_Payment_Method_List
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Paypal_Direct
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Paypal_Payflow
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Pbridge_Abstract
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Pbridge_Authorizenet
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Pbridge_Paypal
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Pbridge_Paypaluk
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Pbridge_Verisign
  • Mage_XmlConnect_Block_Checkout_Payment_Method_Purchaseorder
  • Mage_XmlConnect_Block_Checkout_Pbridge_Result
  • Mage_XmlConnect_Block_Checkout_Shipping_Method_Available
  • Mage_XmlConnect_Block_Cms_Page
  • Mage_XmlConnect_Block_Configuration
  • Mage_XmlConnect_Block_Customer_Address_Form
  • Mage_XmlConnect_Block_Customer_Address_List
  • Mage_XmlConnect_Block_Customer_Form
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Boolean
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Date
  • Mage_XmlConnect_Block_Customer_Form_Renderer_File
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Image
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Multiline
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Multiselect
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Select
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Text
  • Mage_XmlConnect_Block_Customer_Form_Renderer_Textarea
  • Mage_XmlConnect_Block_Customer_GiftcardCheck
  • Mage_XmlConnect_Block_Customer_Order_Details
  • Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Bundle
  • Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Default
  • Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Downloadable
  • Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Giftcard
  • Mage_XmlConnect_Block_Customer_Order_Item_Renderer_Grouped
  • Mage_XmlConnect_Block_Customer_Order_Items
  • Mage_XmlConnect_Block_Customer_Order_List
  • Mage_XmlConnect_Block_Customer_Order_Totals
  • Mage_XmlConnect_Block_Customer_Order_Totals_Customerbalance
  • Mage_XmlConnect_Block_Customer_Order_Totals_Customerbalance_Refunded
  • Mage_XmlConnect_Block_Customer_Order_Totals_Giftcards
  • Mage_XmlConnect_Block_Customer_Order_Totals_Tax
  • Mage_XmlConnect_Block_Customer_Storecredit
  • Mage_XmlConnect_Block_Home
  • Mage_XmlConnect_Block_Review_Form
  • Mage_XmlConnect_Block_Wishlist
  • Mage_XmlConnect_CartController
  • Mage_XmlConnect_CatalogController
  • Mage_XmlConnect_CheckoutController
  • Mage_XmlConnect_CmsController
  • Mage_XmlConnect_ConfigurationController
  • Mage_XmlConnect_Controller_Action
  • Mage_XmlConnect_CustomerController
  • Mage_XmlConnect_Helper_Android
  • Mage_XmlConnect_Helper_Catalog_Category_Image
  • Mage_XmlConnect_Helper_Customer_Form_Renderer
  • Mage_XmlConnect_Helper_Customer_Order
  • Mage_XmlConnect_Helper_Data
  • Mage_XmlConnect_Helper_Image
  • Mage_XmlConnect_Helper_Ipad
  • Mage_XmlConnect_Helper_Iphone
  • Mage_XmlConnect_Helper_Theme
  • Mage_XmlConnect_IndexController
  • Mage_XmlConnect_Model_Adminhtml_System_Config_Backend_Baseurl
  • Mage_XmlConnect_Model_Adminhtml_System_Config_Backend_Currency_Default
  • Mage_XmlConnect_Model_Application
  • Mage_XmlConnect_Model_Catalog_Category_Image
  • Mage_XmlConnect_Model_ConfigData
  • Mage_XmlConnect_Model_History
  • Mage_XmlConnect_Model_Mysql4_Application
  • Mage_XmlConnect_Model_Mysql4_Application_Collection
  • Mage_XmlConnect_Model_Mysql4_Cms_Page_Collection
  • Mage_XmlConnect_Model_Mysql4_ConfigData
  • Mage_XmlConnect_Model_Mysql4_ConfigData_Collection
  • Mage_XmlConnect_Model_Mysql4_Filter_Collection
  • Mage_XmlConnect_Model_Mysql4_History
  • Mage_XmlConnect_Model_Mysql4_History_Collection
  • Mage_XmlConnect_Model_Mysql4_Queue
  • Mage_XmlConnect_Model_Mysql4_Queue_Collection
  • Mage_XmlConnect_Model_Mysql4_Setup
  • Mage_XmlConnect_Model_Mysql4_Template
  • Mage_XmlConnect_Model_Mysql4_Template_Collection
  • Mage_XmlConnect_Model_Observer
  • Mage_XmlConnect_Model_Payment_Method_Paypal_Config
  • Mage_XmlConnect_Model_Payment_Method_Paypal_Mecl
  • Mage_XmlConnect_Model_Payment_Method_Paypal_Mep
  • Mage_XmlConnect_Model_Paypal_Mecl_Checkout
  • Mage_XmlConnect_Model_Paypal_Mep_Checkout
  • Mage_XmlConnect_Model_Preview_Abstract
  • Mage_XmlConnect_Model_Preview_Android
  • Mage_XmlConnect_Model_Preview_Ipad
  • Mage_XmlConnect_Model_Preview_Iphone
  • Mage_XmlConnect_Model_Queue
  • Mage_XmlConnect_Model_Resource_Application
  • Mage_XmlConnect_Model_Resource_Application_Collection
  • Mage_XmlConnect_Model_Resource_Cms_Page_Collection
  • Mage_XmlConnect_Model_Resource_ConfigData
  • Mage_XmlConnect_Model_Resource_ConfigData_Collection
  • Mage_XmlConnect_Model_Resource_Filter_Collection
  • Mage_XmlConnect_Model_Resource_History
  • Mage_XmlConnect_Model_Resource_History_Collection
  • Mage_XmlConnect_Model_Resource_Queue
  • Mage_XmlConnect_Model_Resource_Queue_Collection
  • Mage_XmlConnect_Model_Resource_Setup
  • Mage_XmlConnect_Model_Resource_Template
  • Mage_XmlConnect_Model_Resource_Template_Collection
  • Mage_XmlConnect_Model_Simplexml_Element
  • Mage_XmlConnect_Model_Simplexml_Form
  • Mage_XmlConnect_Model_Simplexml_Form_Abstract
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Checkbox
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Collection
  • Mage_XmlConnect_Model_Simplexml_Form_Element_CountryListSelect
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Date
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Email
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset
  • Mage_XmlConnect_Model_Simplexml_Form_Element_File
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Image
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Multiline
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Multiselect
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Select
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Text
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Textarea
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Validator
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Validator_Abstract
  • Mage_XmlConnect_Model_Simplexml_Form_Element_Validator_Rule
  • Mage_XmlConnect_Model_Tabs
  • Mage_XmlConnect_Model_Template
  • Mage_XmlConnect_Model_Theme
  • Mage_XmlConnect_Paypal_MeclController
  • Mage_XmlConnect_Paypal_MepController
  • Mage_XmlConnect_PbridgeController
  • Mage_XmlConnect_ReviewController
  • Mage_XmlConnect_WishlistController

Interfaces

  • Mage_XmlConnect_Model_Simplexml_Form_Element_Renderer_Interface
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_XmlConnect
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: /**
 28:  * Ipad preview model
 29:  *
 30:  * @category    Mage
 31:  * @package     Mage_XmlConnect
 32:  * @author      Magento Core Team <core@magentocommerce.com>
 33:  */
 34: class Mage_XmlConnect_Model_Preview_Ipad extends Mage_XmlConnect_Model_Preview_Abstract
 35: {
 36:     /**
 37:      * Current device orientation
 38:      *
 39:      * @var string
 40:      */
 41:     protected $_orientation = 'unknown';
 42: 
 43:     /**
 44:      * Set device orientation
 45:      *
 46:      * @param string $orientation
 47:      * @return Mage_XmlConnect_Model_Preview_Ipad
 48:      */
 49:     public function setOrientation($orientation)
 50:     {
 51:         $this->_orientation = $orientation;
 52:         return $this;
 53:     }
 54: 
 55:     /**
 56:      * Get current device orientation
 57:      *
 58:      * @return string
 59:      */
 60:     public function getOrientation()
 61:     {
 62:         return $this->_orientation;
 63:     }
 64: 
 65:     /**
 66:      * Get application banner image url
 67:      *
 68:      * @return string
 69:      */
 70:     public function getBannerImage()
 71:     {
 72:         $orientation = $this->getOrientation();
 73:         switch ($orientation) {
 74:             case Mage_XmlConnect_Helper_Ipad::ORIENTATION_LANDSCAPE:
 75:                 $configPath = 'conf/body/bannerIpadLandscapeImage';
 76:                 $imageUrlOrig = $this->getData($configPath);
 77:                 if ($imageUrlOrig) {
 78:                     $width  = Mage_XmlConnect_Helper_Ipad::PREVIEW_LANDSCAPE_BANNER_WIDTH;
 79:                     $height = Mage_XmlConnect_Helper_Ipad::PREVIEW_LANDSCAPE_BANNER_HEIGHT;
 80:                     $bannerImage = Mage::helper('xmlconnect/image')
 81:                         ->getCustomSizeImageUrl($imageUrlOrig, $width, $height);
 82:                 } else {
 83:                     $bannerImage = $this->getPreviewImagesUrl('ipad/banner_image_l.png');
 84:                 }
 85:                 break;
 86:             case Mage_XmlConnect_Helper_Ipad::ORIENTATION_PORTRAIT:
 87:                 $configPath = 'conf/body/bannerIpadImage';
 88:                 $imageUrlOrig = $this->getData($configPath);
 89:                 if ($imageUrlOrig) {
 90:                     $width  = Mage_XmlConnect_Helper_Ipad::PREVIEW_PORTRAIT_BANNER_WIDTH;
 91:                     $height = Mage_XmlConnect_Helper_Ipad::PREVIEW_PORTRAIT_BANNER_HEIGHT;
 92:                     $bannerImage = Mage::helper('xmlconnect/image')
 93:                         ->getCustomSizeImageUrl($imageUrlOrig, $width, $height);
 94:                 } else {
 95:                     $bannerImage = $this->getPreviewImagesUrl('ipad/banner_image.png');
 96:                 }
 97:                 break;
 98:         }
 99:         return $bannerImage;
100:     }
101: 
102:     /**
103:      * Get background image url according orientation
104:      *
105:      * @throws Mage_Core_Exception
106:      * @return string
107:      */
108:     public function getBackgroundImage()
109:     {
110:         $orientation = $this->getOrientation();
111:         $backgroundImage = '';
112:         /** @var $helperImage Mage_XmlConnect_Helper_Image */
113:         $helperImage = Mage::helper('xmlconnect/image');
114: 
115:         switch ($orientation) {
116:             case Mage_XmlConnect_Helper_Ipad::ORIENTATION_LANDSCAPE:
117:                 $configPath = 'conf/body/backgroundIpadLandscapeImage';
118:                 $imageUrlOrig = $this->getData($configPath);
119:                 if ($imageUrlOrig) {
120:                     $width = Mage_XmlConnect_Helper_Ipad::PREVIEW_LANDSCAPE_BACKGROUND_WIDTH;
121:                     $height = Mage_XmlConnect_Helper_Ipad::PREVIEW_LANDSCAPE_BACKGROUND_HEIGHT;
122:                     $backgroundImage = $helperImage->getCustomSizeImageUrl($imageUrlOrig, $width, $height);
123:                 } else {
124:                     $backgroundImage = $this->getPreviewImagesUrl('ipad/background_home_landscape.jpg');
125:                 }
126:                 break;
127:             case Mage_XmlConnect_Helper_Ipad::ORIENTATION_PORTRAIT:
128:                 $configPath = 'conf/body/backgroundIpadPortraitImage';
129:                 $imageUrlOrig = $this->getData($configPath);
130:                 if ($imageUrlOrig) {
131:                     $width = Mage_XmlConnect_Helper_Ipad::PREVIEW_PORTRAIT_BACKGROUND_WIDTH;
132:                     $height = Mage_XmlConnect_Helper_Ipad::PREVIEW_PORTRAIT_BACKGROUND_HEIGHT;
133:                     $backgroundImage = $helperImage->getCustomSizeImageUrl($imageUrlOrig, $width, $height);
134:                 } else {
135:                     $backgroundImage = $this->getPreviewImagesUrl('ipad/background_portrait.jpg');
136:                 }
137:                 break;
138:             default:
139:                 Mage::throwException(
140:                     Mage::helper('xmlconnect')->__('Wrong Ipad background image orientation has been specified: "%s".', $orientation)
141:                 );
142:                 break;
143:         }
144:         return $backgroundImage;
145:     }
146: }
147: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0