예제 #1
0
 /**
  * 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 = Mage::helper('xmlconnect')->getApplication()->getFormData();
     $yesNoValues = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
     $fieldset = $form->addFieldset('flurryAnalytics', array('legend' => $this->__('Flurry Analytics')));
     if (isset($data['conf[native][merchantFlurryTracking][isActive]'])) {
         $isActiveValue = $data['conf[native][merchantFlurryTracking][isActive]'];
     } else {
         $isActiveValue = '0';
     }
     $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' => $isActiveValue));
     $flurryAnalyticsUrl = $this->escapeHtml(Mage::getStoreConfig('xmlconnect/flurry_analytics/statistics_url'));
     $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.')));
     if (isset($data['conf[native][merchantFlurryTracking][accountId]'])) {
         $accountIdValue = $data['conf[native][merchantFlurryTracking][accountId]'];
     } else {
         $accountIdValue = '';
     }
     $flurryApiCode = $fieldset->addField('conf/native/merchantFlurryTracking/accountId', 'text', array('label' => $this->__('Flurry API Code'), 'name' => 'conf[native][merchantFlurryTracking][accountId]', 'enabled' => true, 'required' => true, 'value' => $accountIdValue));
     // 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();
 }
예제 #2
0
 /**
  * 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('application_id', 'select', array('name' => 'application_id', '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('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' => !$this->_fieldsEnabled ? true : false, 'config' => $wysiwygConfig));
     $form->setValues($model->getData());
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
예제 #3
0
 /**
  * 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('onepage_checkout', array('legend' => $this->__('Standard Checkout')));
     $fieldset->addField('conf/native/defaultCheckout/isActive', 'select', array('label' => $this->__('Enable Standard Checkout'), 'name' => 'conf[native][defaultCheckout][isActive]', 'values' => $yesNoValues, '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'));
     /**
      * PayPal MEP management
      */
     $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' => $this->__('PayPal Mobile Embedded Payment (MEP)')));
     $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 = $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 <a href="%s">PayPal business account</a>', $paypalConfigurationUrl);
     $paypalActiveField = $fieldsetPaypal->addField('conf/native/paypal/isActive', 'select', array('label' => $this->__('Activate PayPal Checkout'), 'name' => 'conf[native][paypal][isActive]', 'note' => !$isExpressCheckoutAvaliable ? $activateMepMethodNote : $businessAccountNote, 'values' => $yesNoValues, 'value' => $paypalActive, 'disabled' => !$isExpressCheckoutAvaliable));
     $merchantlabelField = $fieldsetPaypal->addField('conf/special/merchantLabel', 'text', array('name' => 'conf[special][merchantLabel]', 'label' => $this->__('Merchant Label'), 'title' => $this->__('Merchant Label'), 'required' => true, 'value' => isset($data['conf[special][merchantLabel]']) ? $data['conf[special][merchantLabel]'] : ''));
     // field dependencies
     $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')->addFieldMap($merchantlabelField->getHtmlId(), $merchantlabelField->getName())->addFieldMap($paypalActiveField->getHtmlId(), $paypalActiveField->getName())->addFieldDependence($merchantlabelField->getName(), $paypalActiveField->getName(), 1));
     return parent::_prepareForm();
 }
예제 #4
0
 /**
  * Prepare form
  *
  * @throws Mage_Core_Exception
  * @return Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $fieldset = $form->addFieldset('field_logo', array());
     $this->_addElementTypes($fieldset);
     $this->addImage($fieldset, 'conf[native][navigationBar][icon]', $this->__('Logo in Header'), $this->__('Recommended size 35px x 35px.'), $this->_getDesignPreviewImageUrl(Mage::helper('xmlconnect/image')->getInterfaceImagesPaths('conf/native/navigationBar/icon')), 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][bannerIpadImage]', $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/bannerIpadImage')), true);
             $this->addImage($fieldset, 'conf[native][body][backgroundIpadLandscapeImage]', $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/backgroundIpadLandscapeImage')), true);
             $this->addImage($fieldset, 'conf[native][body][backgroundIpadPortraitImage]', $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/backgroundIpadPortraitImage')), true);
             break;
         case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID:
             $this->addImage($fieldset, 'conf[native][body][bannerAndroidImage]', $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/bannerAndroidImage')), true);
             $this->addImage($fieldset, 'conf[native][body][backgroundAndroidLandscapeImage]', $this->__('App Background (landscape mode)'), $this->__('Recommended size 480px x 250px. 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/backgroundAndroidLandscapeImage')), true);
             $this->addImage($fieldset, 'conf[native][body][backgroundAndroidPortraitImage]', $this->__('App Background (portrait mode)'), $this->__('Recommended size 320px x 410px. 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/backgroundAndroidPortraitImage')), 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);
     return parent::_prepareForm();
 }
 /**
  * Add theme field
  *
  * @return Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $fieldset = $form->addFieldset('field_colors', array());
     $this->_addElementTypes($fieldset);
     $fieldset->addField('theme', 'theme', array('name' => 'theme', 'themes' => Mage::helper('xmlconnect/theme')->getAllThemes()));
     $form->setValues(Mage::helper('xmlconnect')->getApplication()->getFormData());
     $this->setForm($form);
     return parent::_prepareForm();
 }
예제 #6
0
파일: Tabs.php 프로젝트: natxetee/magento2
 /**
  * Prepare form
  *
  * @return Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $fieldset = $form->addFieldset('field_tabs', array());
     $this->_addElementTypes($fieldset);
     $fieldset->addField('conf[extra][tabs]', 'tabs', array('name' => 'conf[extra][tabs]'));
     $form->setValues(Mage::helper('Mage_XmlConnect_Helper_Data')->getApplication()->getFormData());
     $this->setForm($form);
     return parent::_prepareForm();
 }
예제 #7
0
 /**
  * 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 <a target="_blank" href="http://www.magentocommerce.com/img/product/mobile/helpers/mail_box_title.png">click here</a>')));
     // 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();
 }
예제 #8
0
 /**
  * Prepare form before rendering HTML
  * Setting Form Fieldsets and fields
  *
  * @return Mage_Adminhtml_Block_Widget_Form
  */
 protected function _prepareForm()
 {
     $model = Mage::helper('xmlconnect')->getApplication();
     $conf = $model->getConf();
     $form = new Varien_Data_Form();
     $this->setForm($form);
     $pages = Mage::getResourceModel('xmlconnect/cms_page_collection')->toOptionIdArray();
     $dummy = array(array('value' => '', 'label' => ''));
     $this->_pages = array_merge($dummy, $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' => $this->__('Label'), 'before_element_html' => $this->__('Get Content from CMS Page') . '</td><td class="label">'));
     if (!empty($conf['native']['pages'])) {
         foreach ($conf['native']['pages'] as $key => $dummy) {
             $this->_addPage($fieldset, 'conf[native][pages][' . $key . ']');
         }
     }
     $data = $model->getFormData();
     $data['page_row_add'] = $this->__('Add Page');
     $form->setValues($data);
     return parent::_prepareForm();
 }
예제 #9
0
 /**
  * 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 = Mage::helper('xmlconnect')->getApplication()->getFormData();
     $yesNoValues = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
     $fieldset = $form->addFieldset('onepage_checkout', array('legend' => $this->__('Standard Checkout')));
     if (isset($data['conf[native][defaultCheckout][isActive]'])) {
         $checkoutStatus = $data['conf[native][defaultCheckout][isActive]'];
     } else {
         $checkoutStatus = '1';
     }
     $fieldset->addField('conf/native/defaultCheckout/isActive', 'select', array('label' => $this->__('Enable Standard Checkout'), 'name' => 'conf[native][defaultCheckout][isActive]', 'values' => $yesNoValues, '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' => $checkoutStatus));
     $deviceType = Mage::helper('xmlconnect')->getDeviceType();
     switch ($deviceType) {
         case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE:
         case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPAD:
             /**
              * PayPal MEP management
              */
             $fieldsetPaypal = $form->addFieldset('paypal_mep_checkout', array('legend' => $this->__('PayPal Mobile Embedded Payment (MEP)')));
             $paypalMepIsAvailable = 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]'] && $paypalMepIsAvailable);
             }
             $paypalConfigurationUrl = $this->escapeHtml($this->getUrl('adminhtml/system_config/edit', array('section' => 'paypal')));
             $activateMepMethodNote = $this->__('To activate PayPal MEP payment method activate Express checkout first. ');
             $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 <a href="%s">PayPal business account</a>', $paypalConfigurationUrl);
             $paypalActiveField = $fieldsetPaypal->addField('conf/native/paypal/isActive', 'select', array('label' => $this->__('Activate PayPal Checkout'), 'name' => 'conf[native][paypal][isActive]', 'note' => !$paypalMepIsAvailable ? $activateMepMethodNote : $businessAccountNote, 'values' => $yesNoValues, 'value' => $paypalActive, 'disabled' => !$paypalMepIsAvailable));
             if (isset($data['conf[special][merchantLabel]'])) {
                 $merchantLabelValue = $data['conf[special][merchantLabel]'];
             } else {
                 $merchantLabelValue = '';
             }
             $merchantlabelField = $fieldsetPaypal->addField('conf/special/merchantLabel', 'text', array('name' => 'conf[special][merchantLabel]', 'label' => $this->__('Merchant Label'), 'title' => $this->__('Merchant Label'), 'required' => true, 'value' => $merchantLabelValue));
             if (isset($data['config_data[payment][paypalmep/allowspecific]'])) {
                 $paypalMepAllow = (int) $data['config_data[payment][paypalmep/allowspecific]'];
             } else {
                 $paypalMepAllow = 0;
             }
             $paypalMepAllowSpecific = $fieldsetPaypal->addField('config_data/paypalmep/allowspecific', 'select', array('name' => 'config_data[payment:paypalmep/allowspecific]', 'label' => $this->__('Payment Applicable From'), 'values' => array(array('value' => 0, 'label' => $this->__('All Allowed Countries')), array('value' => 1, 'label' => $this->__('Specific Countries'))), 'value' => $paypalMepAllow));
             $countries = Mage::getModel('adminhtml/system_config_source_country')->toOptionArray(true);
             if (empty($data['config_data[payment][paypalmep/allowspecific]'])) {
                 $countrySelected = array();
             } else {
                 $countrySelected = explode(',', $data['config_data[payment][paypalmep/applicable]']);
             }
             $paypalMepApplicable = $fieldsetPaypal->addField('config_data/paypalmep/applicable', 'multiselect', array('name' => 'config_data[payment:paypalmep/applicable]', 'label' => $this->__('Countries Payment Applicable From'), 'values' => $countries, 'value' => $countrySelected));
             // field dependencies
             $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')->addFieldMap($paypalMepAllowSpecific->getHtmlId(), $paypalMepAllowSpecific->getName())->addFieldMap($paypalMepApplicable->getHtmlId(), $paypalMepApplicable->getName())->addFieldMap($merchantlabelField->getHtmlId(), $merchantlabelField->getName())->addFieldMap($paypalActiveField->getHtmlId(), $paypalActiveField->getName())->addFieldDependence($paypalMepApplicable->getName(), $paypalMepAllowSpecific->getName(), 1)->addFieldDependence($paypalMepAllowSpecific->getName(), $paypalActiveField->getName(), 1)->addFieldDependence($paypalMepApplicable->getName(), $paypalActiveField->getName(), 1)->addFieldDependence($merchantlabelField->getName(), $paypalActiveField->getName(), 1));
             break;
         case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID:
             /**
              * PayPal MECL management
              */
             if (Mage::app()->isSingleStoreMode() || Mage::helper('xmlconnect')->getApplication()->getId()) {
                 $paypalMeclIsAvailable = Mage::getModel('xmlconnect/payment_method_paypal_mecl')->isAvailable();
                 $activateMeclMethodNote = $this->__('You need to enable PayPal Express Checkout first from the Payment configuration before enabling PayPal MECL.');
             } else {
                 $paypalMeclIsAvailable = false;
                 $activateMeclMethodNote = $this->__('Please create and save an application first.');
             }
             $fieldsetMecl = $form->addFieldset('paypal_mecl_checkout', array('legend' => $this->__('PayPal Mobile Express Checkout Library (MECL)')));
             $meclAccountNote = $this->__('PayPal MECL is the mobile version of PayPal\'s Express Checkout service. You can choose to use MECL alongside standard checkout, or use it as your only checkout method for Magento Mobile.');
             $paypalMeclActive = 0;
             if (isset($data['config_data[payment][paypalmecl_is_active]'])) {
                 $paypalMeclActive = (int) $data['config_data[payment][paypalmecl_is_active]'];
             }
             $fieldsetMecl->addField('config_data/paypalmecl_is_active', 'select', array('label' => $this->__('Activate PayPal MECL'), 'name' => 'config_data[payment:paypalmecl_is_active]', 'note' => !$paypalMeclIsAvailable ? $activateMeclMethodNote : $meclAccountNote, 'values' => $yesNoValues, 'value' => $paypalMeclActive, 'disabled' => !$paypalMeclIsAvailable));
             /**
              * PayPal MEP management
              */
             $fieldsetPaypal = $form->addFieldset('paypal_mep_checkout', array('legend' => $this->__('PayPal Mobile Embedded Payment (MEP)')));
             $fieldsetPaypal->addField('paypal_note', 'note', array('label' => $this->__('Notice'), 'text' => $this->__('Currently, PayPal MEP is not available for the Android application')));
             break;
         default:
             Mage::throwException($this->__('Device doesn\'t recognized: "%s". Unable to load preview model.', $deviceType));
             break;
     }
     return parent::_prepareForm();
 }
예제 #10
0
파일: Social.php 프로젝트: okite11/frames21
 /**
  * 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 = Mage::helper('xmlconnect')->getApplication()->getFormData();
     $yesNoValues = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
     /**
      * Default values for social networks is DISABLED
      */
     $twitterStatus = $facebookStatus = $linkedinStatus = 0;
     $noteText = $this->__('Please <a href="%s" target="_blank">click here</a> to see how to setup and retrieve API credentials.');
     /**
      * Twitter fieldset options
      */
     $fieldsetTwitter = $form->addFieldset('twitter', array('legend' => $this->__('Twitter API')));
     if (isset($data['conf[native][socialNetworking][twitter][isActive]'])) {
         $twitterStatus = (int) $data['conf[native][socialNetworking][twitter][isActive]'];
     }
     $twitterActiveField = $fieldsetTwitter->addField('conf/native/socialNetworking/twitter/isActive', 'select', array('label' => $this->__('Enable Twitter'), 'name' => 'conf[native][socialNetworking][twitter][isActive]', 'values' => $yesNoValues, 'value' => $twitterStatus));
     if (isset($data['conf[native][socialNetworking][twitter][apiKey]'])) {
         $twitterApiKey = $data['conf[native][socialNetworking][twitter][apiKey]'];
     } else {
         $twitterApiKey = '';
     }
     $twitterApiKeyField = $fieldsetTwitter->addField('conf/native/socialNetworking/twitter/apiKey', 'text', array('label' => $this->__('Twitter API Key'), 'name' => 'conf[native][socialNetworking][twitter][apiKey]', 'required' => true, 'value' => $twitterApiKey));
     if (isset($data['conf[native][socialNetworking][twitter][secretKey]'])) {
         $twitterSecretKey = $data['conf[native][socialNetworking][twitter][secretKey]'];
     } else {
         $twitterSecretKey = '';
     }
     $twitterSecretKeyField = $fieldsetTwitter->addField('conf/native/socialNetworking/twitter/secretKey', 'text', array('label' => $this->__('Twitter Secret Key'), 'name' => 'conf[native][socialNetworking][twitter][secretKey]', 'required' => true, 'value' => $twitterSecretKey));
     $fieldsetTwitter->addField('twitterNote', 'note', array('text' => sprintf($noteText, Mage::getStoreConfig(Mage_XmlConnect_Model_Application::XML_PATH_HOWTO_TWITTER_URL))));
     /**
      * Facebook fieldset options
      */
     $fieldsetFacebook = $form->addFieldset('facebook', array('legend' => $this->__('Facebook API')));
     if (isset($data['conf[native][socialNetworking][facebook][isActive]'])) {
         $facebookStatus = (int) $data['conf[native][socialNetworking][facebook][isActive]'];
     }
     $facebookActiveField = $fieldsetFacebook->addField('conf/native/socialNetworking/facebook/isActive', 'select', array('label' => $this->__('Enable Facebook'), 'name' => 'conf[native][socialNetworking][facebook][isActive]', 'values' => $yesNoValues, 'value' => $facebookStatus));
     if (isset($data['conf[native][socialNetworking][facebook][appID]'])) {
         $facebookAppID = $data['conf[native][socialNetworking][facebook][appID]'];
     } else {
         $facebookAppID = '';
     }
     $facebookAppIDField = $fieldsetFacebook->addField('conf/native/socialNetworking/facebook/appID', 'text', array('label' => $this->__('Facebook Application ID'), 'name' => 'conf[native][socialNetworking][facebook][appID]', 'required' => true, 'value' => $facebookAppID));
     $fieldsetFacebook->addField('facebookNote', 'note', array('text' => sprintf($noteText, Mage::getStoreConfig(Mage_XmlConnect_Model_Application::XML_PATH_HOWTO_FACEBOOK_URL))));
     /**
      * LinkedIn fieldset options
      */
     $fieldsetLinkedin = $form->addFieldset('linkedin', array('legend' => $this->__('LinkedIn API')));
     if (isset($data['conf[native][socialNetworking][linkedin][isActive]'])) {
         $linkedinStatus = (int) $data['conf[native][socialNetworking][linkedin][isActive]'];
     }
     $linkedinActiveField = $fieldsetLinkedin->addField('conf/native/socialNetworking/linkedin/isActive', 'select', array('label' => $this->__('Enable LinkedIn'), 'name' => 'conf[native][socialNetworking][linkedin][isActive]', 'values' => $yesNoValues, 'value' => $linkedinStatus));
     if (isset($data['conf[native][socialNetworking][linkedin][apiKey]'])) {
         $linkedinApiKey = $data['conf[native][socialNetworking][linkedin][apiKey]'];
     } else {
         $linkedinApiKey = '';
     }
     $linkedinApiKeyField = $fieldsetLinkedin->addField('conf/native/socialNetworking/linkedin/apiKey', 'text', array('label' => $this->__('LinkedIn API Key'), 'name' => 'conf[native][socialNetworking][linkedin][apiKey]', 'required' => true, 'value' => $linkedinApiKey));
     if (isset($data['conf[native][socialNetworking][linkedin][secretKey]'])) {
         $linkedinSecretKey = $data['conf[native][socialNetworking][linkedin][secretKey]'];
     } else {
         $linkedinSecretKey = '';
     }
     $linkedinSecretKeyField = $fieldsetLinkedin->addField('conf/native/socialNetworking/linkedin/secretKey', 'text', array('label' => $this->__('LinkedIn Secret Key'), 'name' => 'conf[native][socialNetworking][linkedin][secretKey]', 'required' => true, 'value' => $linkedinSecretKey));
     $fieldsetLinkedin->addField('linkedinNote', 'note', array('text' => sprintf($noteText, Mage::getStoreConfig(Mage_XmlConnect_Model_Application::XML_PATH_HOWTO_LINKEDIN_URL))));
     /**
      * Set field dependencies
      */
     $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')->addFieldMap($facebookActiveField->getHtmlId(), $facebookActiveField->getName())->addFieldMap($facebookAppIDField->getHtmlId(), $facebookAppIDField->getName())->addFieldDependence($facebookAppIDField->getName(), $facebookActiveField->getName(), 1)->addFieldMap($twitterApiKeyField->getHtmlId(), $twitterApiKeyField->getName())->addFieldMap($twitterActiveField->getHtmlId(), $twitterActiveField->getName())->addFieldMap($twitterSecretKeyField->getHtmlId(), $twitterSecretKeyField->getName())->addFieldDependence($twitterApiKeyField->getName(), $twitterActiveField->getName(), 1)->addFieldDependence($twitterSecretKeyField->getName(), $twitterActiveField->getName(), 1)->addFieldMap($linkedinApiKeyField->getHtmlId(), $linkedinApiKeyField->getName())->addFieldMap($linkedinActiveField->getHtmlId(), $linkedinActiveField->getName())->addFieldMap($linkedinSecretKeyField->getHtmlId(), $linkedinSecretKeyField->getName())->addFieldDependence($linkedinApiKeyField->getName(), $linkedinActiveField->getName(), 1)->addFieldDependence($linkedinSecretKeyField->getName(), $linkedinActiveField->getName(), 1));
     return parent::_prepareForm();
 }
예제 #11
0
 /**
  * Prepare form before rendering HTML
  *
  * @return Mage_Adminhtml_Block_Widget_Form
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $this->setForm($form);
     $form->setAction($this->getUrl('*/mobile/submission'));
     $isResubmit = $this->getApplication()->getIsResubmitAction();
     $formData = $this->getApplication()->getFormData();
     $url = Mage::getStoreConfig('xmlconnect/mobile_application/activation_key_url');
     $afterElementHtml = $this->__('In order to submit your app, you need to first purchase a <a href="%s" target="_blank">%s</a> 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' => $this->__('Activation Key'), 'value' => isset($formData['conf[submit_text][key]']) ? $formData['conf[submit_text][key]'] : null, 'after_element_html' => $afterElementHtml));
     if (!$isResubmit) {
         $field->setRequired(true);
     } else {
         $field->setDisabled('disabled');
         $fieldset->addField('conf[submit_text][key]_hidden', 'hidden', array('name' => 'conf[submit_text][key]', 'value' => isset($formData['conf[submit_text][key]']) ? $formData['conf[submit_text][key]'] : null));
     }
     if ($isResubmit) {
         $url = Mage::getStoreConfig('xmlconnect/mobile_application/resubmission_key_url');
         $afterElementHtml = $this->__('In order to resubmit your app, you need to first purchase a <a href="%s" target="_blank">%s</a> from MagentoCommerce', $url, $this->__('Resubmission Key'));
         $fieldset->addField('conf[submit_text][resubmission_activation_key]', 'text', array('name' => 'conf[submit_text][resubmission_activation_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' => $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' => $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' => $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' => $this->__('Description'), 'maxlength' => '500', 'value' => isset($formData['conf[submit_text][description]']) ? $formData['conf[submit_text][description]'] : null, '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' => $this->__('Contact Email'), 'class' => 'email', 'maxlength' => '40', 'value' => isset($formData['conf[submit_text][email]']) ? $formData['conf[submit_text][email]'] : null, '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' => $this->__('Price'), 'value' => $this->__('Free'), 'maxlength' => '40', 'checked' => 'checked', 'note' => $this->__('Only free apps are allowed in this version.')));
     $fieldset->addField('conf/submit_text/price_free', 'hidden', array('name' => 'conf[submit_text][price_free]', 'value' => '1'));
     $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' => $this->__('Country'), 'values' => Mage::helper('xmlconnect')->getCountryOptionsArray(), 'value' => $selected, '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' => $this->__('Copyright'), 'maxlength' => '200', 'value' => isset($formData['conf[submit_text][copyright]']) ? $formData['conf[submit_text][copyright]'] : null, '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' => $this->__('Keywords'), 'maxlength' => '100', 'value' => isset($formData['conf[submit_text][keywords]']) ? $formData['conf[submit_text][keywords]'] : null, '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' => $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', $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();
 }
예제 #12
0
 /**
  * Prepare form before rendering HTML
  *
  * @return Mage_Adminhtml_Block_Widget_Form
  */
 protected function _prepareForm()
 {
     $this->_prepareButtons();
     return parent::_prepareForm();
 }
예제 #13
0
 /**
  * Prepare form before rendering HTML
  *
  * @return Mage_Adminhtml_Block_Widget_Form
  */
 protected function _prepareForm()
 {
     $deviceType = Mage::helper('xmlconnect')->getDeviceType();
     $form = new Varien_Data_Form();
     $this->setForm($form);
     /** @var $app Mage_XmlConnect_Model_Application */
     $app = Mage::helper('xmlconnect')->getApplication();
     $form->setAction($this->getUrl('*/mobile/submission'));
     $isResubmit = $app->getIsResubmitAction();
     $formData = $app->getFormData();
     $url = Mage::getStoreConfig('xmlconnect/mobile_application/activation_key_url');
     $afterElementHtml = $this->__('In order to submit your app, you need to first purchase a <a href="%s" target="_blank">%s</a> 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' => $this->__('Activation Key'), 'value' => isset($formData['conf[submit_text][key]']) ? $formData['conf[submit_text][key]'] : null, 'after_element_html' => $afterElementHtml));
     if (!$isResubmit) {
         $field->setRequired(true);
     } else {
         $field->setDisabled('disabled');
         $fieldset->addField('conf[submit_text][key]_hidden', 'hidden', array('name' => 'conf[submit_text][key]', 'value' => isset($formData['conf[submit_text][key]']) ? $formData['conf[submit_text][key]'] : null));
     }
     if ($isResubmit) {
         $url = Mage::getStoreConfig('xmlconnect/mobile_application/resubmission_key_url');
         $rsText = $this->__('Resubmission Key');
         $afterElementHtml = $this->__('In order to resubmit your app, you need to first purchase a <a href="%s" target="_blank">%s</a> from MagentoCommerce', $url, $rsText);
         if (isset($formData['conf[submit_text][resubmission_activation_key]'])) {
             $rsKeyVal = $formData['conf[submit_text][resubmission_activation_key]'];
         } else {
             $rsKeyVal = null;
         }
         $fieldset->addField('conf[submit_text][resubmission_activation_key]', 'text', array('name' => 'conf[submit_text][resubmission_activation_key]', 'label' => $this->__('Resubmission Key'), 'value' => $rsKeyVal, 'required' => true, 'after_element_html' => $afterElementHtml));
     }
     $fieldset = $form->addFieldset('submit_general', array('legend' => $this->__('Submission Fields')));
     $fieldset->addField('submission_action', 'hidden', array('name' => 'submission_action', 'value' => '1'));
     switch ($deviceType) {
         case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE:
             $titleLength = Mage_XmlConnect_Helper_Iphone::SUBMISSION_TITLE_LENGTH;
             $descriptionLength = Mage_XmlConnect_Helper_Iphone::SUBMISSION_DESCRIPTION_LENGTH;
             $descriptionNote = $this->__('Description that appears in the iTunes App Store. %s chars maximum. ', $descriptionLength);
             break;
         case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPAD:
             $titleLength = Mage_XmlConnect_Helper_Ipad::SUBMISSION_TITLE_LENGTH;
             $descriptionLength = Mage_XmlConnect_Helper_Ipad::SUBMISSION_DESCRIPTION_LENGTH;
             $descriptionNote = $this->__('Description that appears in the iTunes App Store. %s chars maximum. ', $descriptionLength);
             break;
         case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID:
             $titleLength = Mage_XmlConnect_Helper_Android::SUBMISSION_TITLE_LENGTH;
             $descriptionLength = Mage_XmlConnect_Helper_Android::SUBMISSION_DESCRIPTION_LENGTH;
             $descriptionNote = $this->__('Description that appears in Android Market. %s chars maximum. ', $descriptionLength);
             break;
     }
     $titleNote = $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. %s chars max.', $titleLength);
     $fieldset->addField('conf/submit_text/title', 'text', array('name' => 'conf[submit_text][title]', 'label' => $this->__('Title'), 'maxlength' => $titleLength, 'value' => isset($formData['conf[submit_text][title]']) ? $formData['conf[submit_text][title]'] : null, 'note' => $titleNote, 'required' => true));
     if (isset($formData['conf[submit_text][description]'])) {
         $descrVal = $formData['conf[submit_text][description]'];
     } else {
         $descrVal = null;
     }
     $field = $fieldset->addField('conf/submit_text/description', 'textarea', array('name' => 'conf[submit_text][description]', 'label' => $this->__('Description'), 'maxlength' => $descriptionLength, 'value' => $descrVal, 'note' => $descriptionNote, 'required' => true));
     $field->setRows(15);
     $fieldset->addField('conf/submit_text/contact_email', 'text', array('name' => 'conf[submit_text][email]', 'label' => $this->__('Contact Email'), 'class' => 'email', 'maxlength' => '40', 'value' => isset($formData['conf[submit_text][email]']) ? $formData['conf[submit_text][email]'] : null, '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' => $this->__('Price'), 'value' => $this->__('Free'), 'maxlength' => '40', 'checked' => 'checked', 'note' => $this->__('Only free apps are allowed in this version.')));
     $fieldset->addField('conf/submit_text/price_free', 'hidden', array('name' => 'conf[submit_text][price_free]', 'value' => '1'));
     if (isset($formData['conf[submit_text][country]'])) {
         $selected = explode(',', $formData['conf[submit_text][country]']);
     } else {
         $selected = null;
     }
     $deviceHelper = Mage::helper('xmlconnect')->getDeviceHelper();
     $fieldset->addType('country', 'Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Country');
     $fieldset->addField('conf/submit_text/country', 'country', array('id' => 'submission-countries', 'name' => 'conf[submit_text][country][]', 'label' => $deviceHelper->getCountryLabel(), 'values' => Mage::helper('xmlconnect')->getCountryOptionsArray(), 'value' => $selected, 'note' => $this->__('Make this app available in the following territories'), 'columns' => $deviceHelper->getCountryColumns(), 'place_name_left' => $deviceHelper->isCountryNamePlaceLeft(), 'class' => $deviceHelper->getCountryClass(), 'required' => true))->setRenderer($deviceHelper->getCountryRenderer());
     if (isset($formData['conf[submit_text][copyright]'])) {
         $copyVal = $formData['conf[submit_text][copyright]'];
     } else {
         $copyVal = null;
     }
     $fieldset->addField('conf/submit_text/copyright', 'text', array('name' => 'conf[submit_text][copyright]', 'label' => $this->__('Copyright'), 'maxlength' => '200', 'value' => $copyVal, 'note' => $this->__('Appears in the info section of your app (example: Copyright 2010 – Your Company, Inc.)'), 'required' => true));
     if ($deviceType !== Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID) {
         if (isset($formData['conf[submit_text][keywords]'])) {
             $keyWordsVal = $formData['conf[submit_text][keywords]'];
         } else {
             $keyWordsVal = null;
         }
         $fieldset->addField('conf/submit_text/keywords', 'text', array('name' => 'conf[submit_text][keywords]', 'label' => $this->__('Keywords'), 'maxlength' => '100', 'value' => $keyWordsVal, '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' => $this->__('Icons')));
     switch ($deviceType) {
         case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPHONE:
             $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/loader_image_i4', $this->__('Loader Splash Screen <br />(iPhone 4 retina)'), $this->__('Image that appears on first screen while your app is loading. Required size: 640px x 920px.'), '', false);
             $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/logo_i4', $this->__('Custom App Icon <br />(iPhone 4 retina)'), $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: 114px x 114px.'), '', false);
             $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);
             $this->addImage($fieldset, 'conf/submit/big_logo_i4', $this->__('Copyright Page Logo <br />(iPhone 4 retina)'), $this->__('Store logo that is displayed on copyright page of app. Preferred size: 200px x 200px.'), '', false);
             break;
         case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_IPAD:
             $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/ipad_loader_portrait_image', $this->__('Loader Splash Screen <br />(portrait mode)'), $this->__('Image that appears on first screen while your app is loading. Required size: 768px x 1024px.'), '', true);
             $this->addImage($fieldset, 'conf/submit/ipad_loader_landscape_image', $this->__('Loader Splash Screen <br />(landscape mode)'), $this->__('Image that appears on first screen while your app is loading. Required size: 1024px x 768px.'), '', true);
             $this->addImage($fieldset, 'conf/submit/ipad_logo', $this->__('Custom App Icon'), $this->__('Icon that will appear on the user\'s device after they download your app. You do not need to apply a gradient or soft edges (this is done automatically by Apple). Recommended size: 72px x 72px.'), '', 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);
             break;
         case Mage_XmlConnect_Helper_Data::DEVICE_TYPE_ANDROID:
             $this->addImage($fieldset, 'conf/submit/icon', $this->__('High Resolution Application Icon'), $this->__('The icon that appears in the Android Market. Recommended size: 512px x 512px. Maximum size: 1024 KB.'), '', true);
             $this->addImage($fieldset, 'conf/submit/android_loader_image', $this->__('Loader Splash Screen'), $this->__('Image that appears on first screen while your app is loading. Required size: 320px x 455px.'), '', true);
             $this->addImage($fieldset, 'conf/submit/android_logo', $this->__('Custom App Icon'), $this->__('Icon that will appear on the user\'s device after they download your app. Recommended size: 48px x 48px.'), '', 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);
             break;
     }
     return parent::_prepareForm();
 }
예제 #14
0
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $this->setForm($form);
     $form->setAction($this->getUrl('*/mobile/submission'));
     $application = Mage::registry('current_app');
     $isResubmit = $application->getIsResubmitAction();
     $formData = $application->getFormData();
     $fieldset = $form->addFieldset('submit0', array('legend' => $this->__('Submission Fields')));
     $fieldset->addField('conf/submit_text/title', 'text', array('name' => 'conf[submit_text][title]', 'label' => $this->__('Title'), 'maxlength' => '200', 'value' => isset($formData['conf[submit_text][title]']) ? $formData['conf[submit_text][title]'] : null, 'note' => $this->__('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.'), 'required' => true));
     $field = $fieldset->addField('conf/submit_text/description', 'textarea', array('name' => 'conf[submit_text][description]', 'label' => $this->__('Description'), 'maxlength' => '500', 'value' => isset($formData['conf[submit_text][description]']) ? $formData['conf[submit_text][description]'] : null, 'note' => $this->__('This is the description that will appear in the iTunes marketplace. '), 'required' => true));
     $field->setRows(15);
     $fieldset->addField('conf/submit_text/username/', 'text', array('name' => 'conf[submit_text][username]', 'label' => $this->__('Username'), 'maxlength' => '40', 'value' => isset($formData['conf[submit_text][username]']) ? $formData['conf[submit_text][username]'] : null, 'note' => $this->__('Paypal Merchant Account Username.'), 'required' => true));
     $fieldset->addField('conf/submit_text/email', 'text', array('name' => 'conf[submit_text][email]', 'label' => $this->__('Email'), 'class' => 'email', 'maxlength' => '40', 'value' => isset($formData['conf[submit_text][email]']) ? $formData['conf[submit_text][email]'] : null, 'note' => $this->__('Paypal Merchant Account Email.'), 'required' => true));
     $fieldset->addField('conf/submit_text/price_free', 'radio', array('name' => 'conf[submit_text][price_free]', 'label' => $this->__('Price'), 'value' => '1', 'maxlength' => '40', 'after_element_html' => $this->__('Free'), 'onclick' => "\$('conf/submit_text/price').setValue('')"));
     $fieldset->addField('conf/submit_text/price', 'text', array('name' => 'conf[submit_text][price]', 'label' => $this->__(' '), 'maxlength' => '40', 'value' => isset($formData['conf[submit_text][price]']) ? $formData['conf[submit_text][price]'] : null, 'note' => $this->__('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'), 'onchange' => "\$('conf/submit_text/price_free').checked = false"));
     $selected = isset($formData['conf[submit_text][country]']) ? json_decode($formData['conf[submit_text][country]']) : null;
     $fieldset->addField('conf/submit_text/country', 'multiselect', array('name' => 'conf[submit_text][country][]', 'label' => $this->__('Country'), 'values' => Mage::helper('xmlconnect')->getCountryOptionsArray(), 'value' => $selected, 'note' => $this->__('Make this app available in the following territories')));
     $fieldset->addField('conf/submit_text/country_additional', 'text', array('name' => 'conf[submit_text][country_additional]', 'label' => $this->__('Additional Countries'), 'maxlength' => '200', 'value' => isset($formData['conf[submit_text][country_additional]']) ? $formData['conf[submit_text][country_additional]'] : null, 'note' => $this->__('You can set any additional countries added by Apple Store.')));
     $fieldset->addField('conf/submit_text/copyright', 'textarea', array('name' => 'conf[submit_text][copyright]', 'label' => $this->__('Copyright'), 'maxlength' => '200', 'value' => isset($formData['conf[submit_text][copyright]']) ? $formData['conf[submit_text][copyright]'] : null, 'note' => $this->__('This will appear in the info section of your App (example:  Copyright 2010 – Your Company, Inc.)'), 'size' => '30', 'required' => true));
     $fieldset->addField('conf/submit_text/push_notification', 'checkbox', array('name' => 'conf[submit_text][push_notification]', 'label' => $this->__('Push Notification'), 'checked' => isset($formData['conf[submit_text][push_notification]']), 'value' => '1'));
     $fieldset = $form->addFieldset('submit1', array('legend' => $this->__('Icons')));
     $this->addImage($fieldset, 'conf/submit/icon', 'Application Icon', $this->__('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'));
     $this->addImage($fieldset, 'conf/submit/loader_image', 'Loader Splash Screen', $this->__('Users will see this image as the first screen while your application is loading.  It is a 320x460 image.'));
     $this->addImage($fieldset, 'conf/submit/logo', $this->__('Custom application icon'), $this->__('This icon will be  used for users’ devices in case if different than AppSore icon needed. '));
     $this->addImage($fieldset, 'conf/submit/big_logo', $this->__('Copyright page logo'), $this->__('Store logo that will be displayed on copyright page of application '));
     $fieldset = $form->addFieldset('submit2', array('legend' => $this->__('Key')));
     $fieldset->addField('conf[submit_text][key]', 'text', array('name' => 'conf[submit_text][key]', 'label' => $this->__('Activation Key'), 'value' => isset($formData['conf[submit_text][key]']) ? $formData['conf[submit_text][key]'] : null, 'disabled' => $isResubmit, 'after_element_html' => '<a href="' . Mage::getStoreConfig('xmlconnect/mobile_application/get_activation_key_url') . '" target="_blank">' . $this->__('Get Activation Key') . '</a>'));
     if (!$isResubmit) {
         $fieldset->addField('submit_application', 'button', array('name' => 'submit_application', 'label' => $this->__('Submit'), 'value' => $this->__('Submit Application'), 'onclick' => 'submitApplication()'));
     } else {
         $fieldset->addField('submit_application', 'button', array('name' => 'submit_application', 'label' => $this->__('Resubmit'), 'value' => $this->__('Resubmit Application'), 'onclick' => 'resubmitAction(); return false;'));
     }
     return parent::_prepareForm();
 }