PageRenderTime 73ms CodeModel.GetById 21ms RepoModel.GetById 2ms app.codeStats 0ms

/app/code/core/Mage/XmlConnect/Helper/Ipad.php

https://bitbucket.org/claudiu_marginean/magento-hg-mirror
PHP | 728 lines | 511 code | 42 blank | 175 comment | 44 complexity | 3aa3d7bb814bfb7b9ffc12ad2c9b48d5 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, LGPL-2.1, GPL-2.0, WTFPL
  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) 2010 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. * XmlConnect device helper for iPad
  28. *
  29. * @category Mage
  30. * @package Mage_XmlConnect
  31. * @author Magento Core Team <core@magentocommerce.com>
  32. */
  33. class Mage_XmlConnect_Helper_Ipad extends Mage_Core_Helper_Abstract
  34. {
  35. /**
  36. * Submission title length
  37. *
  38. * @var int
  39. */
  40. const SUBMISSION_TITLE_LENGTH = 200;
  41. /**
  42. * Submission description length
  43. *
  44. * @var int
  45. */
  46. const SUBMISSION_DESCRIPTION_LENGTH = 500;
  47. /**
  48. * Ipad landscape orientation identificator
  49. *
  50. * @var string
  51. */
  52. const ORIENTATION_LANDSCAPE = 'landscape';
  53. /**
  54. * Ipad portrait orientation identificator
  55. *
  56. * @var string
  57. */
  58. const ORIENTATION_PORTRAIT = 'portrait';
  59. /**
  60. * Ipad preview banner widht
  61. *
  62. * @var int
  63. */
  64. const PREVIEW_BANNER_WIDTH = 350;
  65. /**
  66. * Ipad preview banner image height
  67. *
  68. * @var int
  69. */
  70. const PREVIEW_BANNER_HEIGHT = 135;
  71. /**
  72. * Ipad landscape orientation preview image widht
  73. *
  74. * @var int
  75. */
  76. const PREVIEW_LANDSCAPE_BACKGROUND_WIDTH = 467;
  77. /**
  78. * Ipad landscape orientation preview image height
  79. *
  80. * @var int
  81. */
  82. const PREVIEW_LANDSCAPE_BACKGROUND_HEIGHT = 321;
  83. /**
  84. * Ipad portrait orientation preview image widht
  85. *
  86. * @var int
  87. */
  88. const PREVIEW_PORTRAIT_BACKGROUND_WIDTH = 350;
  89. /**
  90. * Ipad portrait orientation preview image height
  91. *
  92. * @var int
  93. */
  94. const PREVIEW_PORTRAIT_BACKGROUND_HEIGHT = 438;
  95. /**
  96. * Submit images that are stored in "params" field of history table
  97. *
  98. * @var array
  99. */
  100. protected $_imageIds = array('icon',
  101. 'ipad_loader_portrait_image',
  102. 'ipad_loader_landscape_image',
  103. 'ipad_logo',
  104. 'big_logo'
  105. );
  106. /**
  107. * Country field renderer
  108. *
  109. * @var Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Renderer_Country_Istore
  110. */
  111. protected $_countryRenderer = null;
  112. /**
  113. * Get submit images that are required for application submit
  114. *
  115. * @return array
  116. */
  117. public function getSubmitImages()
  118. {
  119. return $this->_imageIds;
  120. }
  121. /**
  122. * Get default application tabs
  123. *
  124. * @param string
  125. * @return array
  126. */
  127. public function getDefaultDesignTabs()
  128. {
  129. if (!isset($this->_tabs)) {
  130. $this->_tabs = array(
  131. array(
  132. 'label' => Mage::helper('xmlconnect')->__('Home'),
  133. 'image' => 'tab_home.png',
  134. 'action' => 'Home',
  135. ),
  136. array(
  137. 'label' => Mage::helper('xmlconnect')->__('Search'),
  138. 'image' => 'tab_search.png',
  139. 'action' => 'Search',
  140. ),
  141. array(
  142. 'label' => Mage::helper('xmlconnect')->__('Cart'),
  143. 'image' => 'tab_cart.png',
  144. 'action' => 'Cart',
  145. ),
  146. array(
  147. 'label' => Mage::helper('xmlconnect')->__('Account'),
  148. 'image' => 'tab_account_ipad.png',
  149. 'action' => 'Account',
  150. ),
  151. );
  152. }
  153. return $this->_tabs;
  154. }
  155. /**
  156. * Default application configuration
  157. *
  158. * @return array
  159. */
  160. public function getDefaultConfiguration()
  161. {
  162. return array(
  163. 'native' => array(
  164. 'body' => array(
  165. 'backgroundColor' => '#ABABAB',
  166. 'scrollBackgroundColor' => '#EDEDED',
  167. ),
  168. 'itemActions' => array(
  169. 'relatedProductBackgroundColor' => '#404040',
  170. ),
  171. 'fonts' => array(
  172. 'Title1' => array(
  173. 'name' => 'HelveticaNeue-Bold',
  174. 'size' => '20',
  175. 'color' => '#FEFEFE',
  176. ),
  177. 'Title2' => array(
  178. 'name' => 'HelveticaNeue-Bold',
  179. 'size' => '15',
  180. 'color' => '#222222',
  181. ),
  182. 'Title3' => array(
  183. 'name' => 'HelveticaNeue',
  184. 'size' => '14',
  185. 'color' => '#222222',
  186. ),
  187. 'Title4' => array(
  188. 'name' => 'HelveticaNeue',
  189. 'size' => '12',
  190. 'color' => '#FFFFFF',
  191. ),
  192. 'Title5' => array(
  193. 'name' => 'HelveticaNeue-Bold',
  194. 'size' => '18',
  195. 'color' => '#d55000',
  196. ),
  197. 'Title6' => array(
  198. 'name' => 'HelveticaNeue-Bold',
  199. 'size' => '16',
  200. 'color' => '#FFFFFF',
  201. ),
  202. 'Title7' => array(
  203. 'name' => 'HelveticaNeue-Bold',
  204. 'size' => '13',
  205. 'color' => '#222222',
  206. ),
  207. 'Title8' => array(
  208. 'name' => 'HelveticaNeue-Bold',
  209. 'size' => '13',
  210. 'color' => '#FFFFFF',
  211. ),
  212. 'Title9' => array(
  213. 'name' => 'HelveticaNeue-Bold',
  214. 'size' => '18',
  215. 'color' => '#FFFFFF',
  216. ),
  217. 'Text1' => array(
  218. 'name' => 'HelveticaNeue-Bold',
  219. 'size' => '14',
  220. 'color' => '#222222',
  221. ),
  222. 'Text2' => array(
  223. 'name' => 'HelveticaNeue',
  224. 'size' => '12',
  225. 'color' => '#222222',
  226. ),
  227. ),
  228. ),
  229. );
  230. }
  231. /**
  232. * List of allowed fonts for iPad application
  233. *
  234. * @return array
  235. */
  236. public function getFontList()
  237. {
  238. return array(
  239. array(
  240. 'value' => 'HiraKakuProN-W3',
  241. 'label' => 'HiraKakuProN-W3',
  242. ),
  243. array(
  244. 'value' => 'Courier',
  245. 'label' => 'Courier',
  246. ),
  247. array(
  248. 'value' => 'Courier-BoldOblique',
  249. 'label' => 'Courier-BoldOblique',
  250. ),
  251. array(
  252. 'value' => 'Courier-Oblique',
  253. 'label' => 'Courier-Oblique',
  254. ),
  255. array(
  256. 'value' => 'Courier-Bold',
  257. 'label' => 'Courier-Bold',
  258. ),
  259. array(
  260. 'value' => 'ArialMT',
  261. 'label' => 'ArialMT',
  262. ),
  263. array(
  264. 'value' => 'Arial-BoldMT',
  265. 'label' => 'Arial-BoldMT',
  266. ),
  267. array(
  268. 'value' => 'Arial-BoldItalicMT',
  269. 'label' => 'Arial-BoldItalicMT',
  270. ),
  271. array(
  272. 'value' => 'Arial-ItalicMT',
  273. 'label' => 'Arial-ItalicMT',
  274. ),
  275. array(
  276. 'value' => 'STHeitiTC-Light',
  277. 'label' => 'STHeitiTC-Light',
  278. ),
  279. array(
  280. 'value' => 'STHeitiTC-Medium',
  281. 'label' => 'STHeitiTC-Medium',
  282. ),
  283. array(
  284. 'value' => 'AppleGothic',
  285. 'label' => 'AppleGothic',
  286. ),
  287. array(
  288. 'value' => 'CourierNewPS-BoldMT',
  289. 'label' => 'CourierNewPS-BoldMT',
  290. ),
  291. array(
  292. 'value' => 'CourierNewPS-ItalicMT',
  293. 'label' => 'CourierNewPS-ItalicMT',
  294. ),
  295. array(
  296. 'value' => 'CourierNewPS-BoldItalicMT',
  297. 'label' => 'CourierNewPS-BoldItalicMT',
  298. ),
  299. array(
  300. 'value' => 'CourierNewPSMT',
  301. 'label' => 'CourierNewPSMT',
  302. ),
  303. array(
  304. 'value' => 'Zapfino',
  305. 'label' => 'Zapfino',
  306. ),
  307. array(
  308. 'value' => 'HiraKakuProN-W6',
  309. 'label' => 'HiraKakuProN-W6',
  310. ),
  311. array(
  312. 'value' => 'ArialUnicodeMS',
  313. 'label' => 'ArialUnicodeMS',
  314. ),
  315. array(
  316. 'value' => 'STHeitiSC-Medium',
  317. 'label' => 'STHeitiSC-Medium',
  318. ),
  319. array(
  320. 'value' => 'STHeitiSC-Light',
  321. 'label' => 'STHeitiSC-Light',
  322. ),
  323. array(
  324. 'value' => 'AmericanTypewriter',
  325. 'label' => 'AmericanTypewriter',
  326. ),
  327. array(
  328. 'value' => 'AmericanTypewriter-Bold',
  329. 'label' => 'AmericanTypewriter-Bold',
  330. ),
  331. array(
  332. 'value' => 'Helvetica-Oblique',
  333. 'label' => 'Helvetica-Oblique',
  334. ),
  335. array(
  336. 'value' => 'Helvetica-BoldOblique',
  337. 'label' => 'Helvetica-BoldOblique',
  338. ),
  339. array(
  340. 'value' => 'Helvetica',
  341. 'label' => 'Helvetica',
  342. ),
  343. array(
  344. 'value' => 'Helvetica-Bold',
  345. 'label' => 'Helvetica-Bold',
  346. ),
  347. array(
  348. 'value' => 'MarkerFelt-Thin',
  349. 'label' => 'MarkerFelt-Thin',
  350. ),
  351. array(
  352. 'value' => 'HelveticaNeue',
  353. 'label' => 'HelveticaNeue',
  354. ),
  355. array(
  356. 'value' => 'HelveticaNeue-Bold',
  357. 'label' => 'HelveticaNeue-Bold',
  358. ),
  359. array(
  360. 'value' => 'DBLCDTempBlack',
  361. 'label' => 'DBLCDTempBlack',
  362. ),
  363. array(
  364. 'value' => 'Verdana-Bold',
  365. 'label' => 'Verdana-Bold',
  366. ),
  367. array(
  368. 'value' => 'Verdana-BoldItalic',
  369. 'label' => 'Verdana-BoldItalic',
  370. ),
  371. array(
  372. 'value' => 'Verdana',
  373. 'label' => 'Verdana',
  374. ),
  375. array(
  376. 'value' => 'Verdana-Italic',
  377. 'label' => 'Verdana-Italic',
  378. ),
  379. array(
  380. 'value' => 'TimesNewRomanPSMT',
  381. 'label' => 'TimesNewRomanPSMT',
  382. ),
  383. array(
  384. 'value' => 'TimesNewRomanPS-BoldMT',
  385. 'label' => 'TimesNewRomanPS-BoldMT',
  386. ),
  387. array(
  388. 'value' => 'TimesNewRomanPS-BoldItalicMT',
  389. 'label' => 'TimesNewRomanPS-BoldItalicMT',
  390. ),
  391. array(
  392. 'value' => 'TimesNewRomanPS-ItalicMT',
  393. 'label' => 'TimesNewRomanPS-ItalicMT',
  394. ),
  395. array(
  396. 'value' => 'Georgia-Bold',
  397. 'label' => 'Georgia-Bold',
  398. ),
  399. array(
  400. 'value' => 'Georgia',
  401. 'label' => 'Georgia',
  402. ),
  403. array(
  404. 'value' => 'Georgia-BoldItalic',
  405. 'label' => 'Georgia-BoldItalic',
  406. ),
  407. array(
  408. 'value' => 'Georgia-Italic',
  409. 'label' => 'Georgia-Italic',
  410. ),
  411. array(
  412. 'value' => 'STHeitiJ-Medium',
  413. 'label' => 'STHeitiJ-Medium',
  414. ),
  415. array(
  416. 'value' => 'STHeitiJ-Light',
  417. 'label' => 'STHeitiJ-Light',
  418. ),
  419. array(
  420. 'value' => 'ArialRoundedMTBold',
  421. 'label' => 'ArialRoundedMTBold',
  422. ),
  423. array(
  424. 'value' => 'TrebuchetMS-Italic',
  425. 'label' => 'TrebuchetMS-Italic',
  426. ),
  427. array(
  428. 'value' => 'TrebuchetMS',
  429. 'label' => 'TrebuchetMS',
  430. ),
  431. array(
  432. 'value' => 'Trebuchet-BoldItalic',
  433. 'label' => 'Trebuchet-BoldItalic',
  434. ),
  435. array(
  436. 'value' => 'TrebuchetMS-Bold',
  437. 'label' => 'TrebuchetMS-Bold',
  438. ),
  439. array(
  440. 'value' => 'STHeitiK-Medium',
  441. 'label' => 'STHeitiK-Medium',
  442. ),
  443. array(
  444. 'value' => 'STHeitiK-Light',
  445. 'label' => 'STHeitiK-Light',
  446. ),
  447. );
  448. }
  449. /**
  450. * List of allowed font sizes for iPad application
  451. *
  452. * @return array
  453. */
  454. public function getFontSizes()
  455. {
  456. $result = array( );
  457. for ($i = 6; $i < 32; $i++) {
  458. $result[] = array(
  459. 'value' => $i,
  460. 'label' => $i . ' pt',
  461. );
  462. }
  463. return $result;
  464. }
  465. /**
  466. * Get list of countries that allowed in Itunes by Apple Store for Ipad
  467. * (we get info from Iphone helper)
  468. *
  469. * @return array
  470. */
  471. public function getItunesCountriesArray()
  472. {
  473. return Mage::helper('xmlconnect/iphone')->getItunesCountriesArray();
  474. }
  475. /**
  476. * Validate submit application data
  477. *
  478. * @param array $params
  479. * @return array
  480. */
  481. public function validateSubmit($params)
  482. {
  483. $errors = array();
  484. if (!Zend_Validate::is(isset($params['title']) ? $params['title'] : null, 'NotEmpty')) {
  485. $errors[] = Mage::helper('xmlconnect')->__('Please enter the Title.');
  486. }
  487. if (isset($params['title'])) {
  488. $titleLength = self::SUBMISSION_TITLE_LENGTH;
  489. $strRules = array('min' => '1', 'max' => $titleLength);
  490. if (!Zend_Validate::is($params['title'], 'StringLength', $strRules)) {
  491. $errors[] = Mage::helper('xmlconnect')->__('"Title" is more than %d characters long', $strRules['max']);
  492. }
  493. }
  494. if (!Zend_Validate::is(isset($params['description']) ? $params['description'] : null, 'NotEmpty')) {
  495. $errors[] = Mage::helper('xmlconnect')->__('Please enter the Description.');
  496. }
  497. if (isset($params['description'])) {
  498. $descriptionLength = self::SUBMISSION_DESCRIPTION_LENGTH;
  499. $strRules = array('min' => '1', 'max' => $descriptionLength);
  500. if (!Zend_Validate::is($params['title'], 'StringLength', $strRules)) {
  501. $errors[] = Mage::helper('xmlconnect')->__('"Description" is more than %d characters long', $strRules['max']);
  502. }
  503. }
  504. if (!Zend_Validate::is(isset($params['copyright']) ? $params['copyright'] : null, 'NotEmpty')) {
  505. $errors[] = Mage::helper('xmlconnect')->__('Please enter the Copyright.');
  506. }
  507. if (empty($params['price_free'])) {
  508. if (!Zend_Validate::is(isset($params['price']) ? $params['price'] : null, 'NotEmpty')) {
  509. $errors[] = Mage::helper('xmlconnect')->__('Please enter the Price.');
  510. }
  511. }
  512. if (!Zend_Validate::is(isset($params['country']) ? $params['country'] : null, 'NotEmpty')) {
  513. $errors[] = Mage::helper('xmlconnect')->__('Please select at least one country.');
  514. }
  515. $keyLenght = Mage_XmlConnect_Model_Application::APP_MAX_KEY_LENGTH;
  516. if (Mage::helper('xmlconnect')->getApplication()->getIsResubmitAction()) {
  517. if (isset($params['resubmission_activation_key'])) {
  518. $resubmissionKey = $params['resubmission_activation_key'];
  519. } else {
  520. $resubmissionKey = null;
  521. }
  522. if (!Zend_Validate::is($resubmissionKey, 'NotEmpty')) {
  523. $errors[] = Mage::helper('xmlconnect')->__('Please enter the Resubmission Key.');
  524. } else if (!Zend_Validate::is($resubmissionKey, 'StringLength', array(1, $keyLenght))) {
  525. $errors[] = Mage::helper('xmlconnect')->__('Submit App failure. Invalid activation key provided');
  526. }
  527. } else {
  528. $key = isset($params['key']) ? $params['key'] : null;
  529. if (!Zend_Validate::is($key, 'NotEmpty')) {
  530. $errors[] = Mage::helper('xmlconnect')->__('Please enter the Activation Key.');
  531. } else if (!Zend_Validate::is($key, 'StringLength', array(1, $keyLenght))) {
  532. $errors[] = Mage::helper('xmlconnect')->__('Submit App failure. Invalid activation key provided');
  533. }
  534. }
  535. return $errors;
  536. }
  537. /**
  538. * Check config for valid values
  539. *
  540. * @param array $native
  541. * @return array
  542. */
  543. public function validateConfig($native)
  544. {
  545. $errors = array();
  546. if ( ($native === false)
  547. || (!isset($native['navigationBar']) || !is_array($native['navigationBar'])
  548. || !isset($native['navigationBar']['icon'])
  549. || !Zend_Validate::is($native['navigationBar']['icon'], 'NotEmpty'))) {
  550. $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "Logo in Header" field from Design Tab.');
  551. }
  552. if (!Mage::helper('xmlconnect')->validateConfFieldNotEmpty('bannerIpadImage', $native)) {
  553. $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "Banner on Home Screen" field from Design Tab.');
  554. }
  555. if (!Mage::helper('xmlconnect')->validateConfFieldNotEmpty('backgroundIpadLandscapeImage', $native)) {
  556. $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "App Background (landscape mode)" field from Design Tab.');
  557. }
  558. if (!Mage::helper('xmlconnect')->validateConfFieldNotEmpty('backgroundIpadPortraitImage', $native)) {
  559. $errors[] = Mage::helper('xmlconnect')->__('Please upload an image for "App Background (portrait mode)" field from Design Tab.');
  560. }
  561. return $errors;
  562. }
  563. /**
  564. * Get renderer for submission country
  565. *
  566. * @return Mage_XmlConnect_Block_Adminhtml_Mobile_Submission_Renderer_Country_Istore
  567. */
  568. public function getCountryRenderer()
  569. {
  570. if (empty($this->_countryRenderer)) {
  571. $renderer = 'xmlconnect/adminhtml_mobile_submission_renderer_country_'
  572. . Mage_XmlConnect_Helper_Iphone::SUBMISSION_COUNTRY_RENDERER;
  573. $this->_countryRenderer = Mage::app()->getLayout()->createBlock($renderer);
  574. }
  575. return $this->_countryRenderer;
  576. }
  577. /**
  578. * Get label for submission country
  579. *
  580. * @return string
  581. */
  582. public function getCountryLabel()
  583. {
  584. return Mage::helper('xmlconnect')->__('App Stores');
  585. }
  586. /**
  587. * Get columns for submission country
  588. *
  589. * @return int
  590. */
  591. public function getCountryColumns()
  592. {
  593. return Mage_XmlConnect_Helper_Iphone::SUBMISSION_COUNTRY_COLUMNS;
  594. }
  595. /**
  596. * Get placement of Country Names for submission country
  597. *
  598. * @return bool
  599. */
  600. public function isCountryNamePlaceLeft()
  601. {
  602. return true;
  603. }
  604. /**
  605. * Get class name for submission country
  606. *
  607. * @return string
  608. */
  609. public function getCountryClass()
  610. {
  611. return Mage_XmlConnect_Helper_Iphone::SUBMISSION_COUNTRY_RENDERER . ' stripy';
  612. }
  613. /**
  614. * Check image fields
  615. *
  616. * We set empty value for image field if file was missed in some reason
  617. *
  618. * @param array $data
  619. * @return array
  620. */
  621. public function checkImages(array $data)
  622. {
  623. if (isset($data['conf']['native']['navigationBar']['icon']) &&
  624. !file_exists($data['conf']['native']['navigationBar']['icon'])
  625. ) {
  626. $data['conf']['native']['navigationBar']['icon'] = '';
  627. }
  628. if (isset($data['conf']['native']['body']['bannerIpadImage']) &&
  629. !file_exists($data['conf']['native']['body']['bannerIpadImage'])
  630. ) {
  631. $data['conf']['native']['body']['bannerIpadImage'] = '';
  632. }
  633. if (isset($data['conf']['native']['body']['backgroundIpadLandscapeImage']) &&
  634. !file_exists($data['conf']['native']['body']['backgroundIpadLandscapeImage'])
  635. ) {
  636. $data['conf']['native']['body']['backgroundIpadLandscapeImage'] = '';
  637. }
  638. if (isset($data['conf']['native']['body']['backgroundIpadPortraitImage']) &&
  639. !file_exists($data['conf']['native']['body']['backgroundIpadPortraitImage'])
  640. ) {
  641. $data['conf']['native']['body']['backgroundIpadPortraitImage'] = '';
  642. }
  643. return $data;
  644. }
  645. /**
  646. * Check required fields of a config for a front-end
  647. *
  648. * @throws Mage_Core_Exception
  649. * @param array $data
  650. * @return void
  651. */
  652. public function checkRequiredConfigFields($data)
  653. {
  654. if (!is_array($data)) {
  655. return;
  656. }
  657. if (isset($data['navigationBar']['icon'])
  658. && empty($data['navigationBar']['icon'])
  659. ) {
  660. Mage::throwException(
  661. Mage::helper('xmlconnect')->__('Logo in Header image missing.')
  662. );
  663. }
  664. if (isset($data['body']['bannerIpadImage'])
  665. && empty($data['body']['bannerIpadImage'])
  666. ) {
  667. Mage::throwException(
  668. Mage::helper('xmlconnect')->__('Banner on Home Screen image missing.')
  669. );
  670. }
  671. if (isset($data['body']['backgroundIpadLandscapeImage'])
  672. && empty($data['body']['backgroundIpadLandscapeImage'])
  673. ) {
  674. Mage::throwException(
  675. Mage::helper('xmlconnect')->__('App Background (landscape mode).')
  676. );
  677. }
  678. if (isset($data['body']['backgroundIpadPortraitImage'])
  679. && empty($data['body']['backgroundIpadPortraitImage'])
  680. ) {
  681. Mage::throwException(
  682. Mage::helper('xmlconnect')->__('App Background (portrait mode).')
  683. );
  684. }
  685. }
  686. }