本文整理汇总了PHP中Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form类的具体用法?PHP Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form怎么用?PHP Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_XmlConnect_Block_Adminhtml_Mobile_Widget_Form类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareForm
/**
* 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();
}
示例2: _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();
}
示例3: _prepareForm
/**
* 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();
}
示例4: _prepareForm
/**
* 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();
}
示例5: _prepareForm
/**
* 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();
}
示例6: _prepareForm
/**
* 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();
}
示例7: _prepareForm
/**
* 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();
}
示例8: _prepareForm
/**
* 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();
}
示例9: _toHtml
/**
* Prepare html output
* Adding preview for images if application was submitted(so we have saved images)
*
* @return string
*/
protected function _toHtml()
{
return parent::_toHtml() . $this->getChildHtml('images');
}
示例10: _prepareForm
/**
* Prepare form before rendering HTML
*
* @return Mage_Adminhtml_Block_Widget_Form
*/
protected function _prepareForm()
{
$this->_prepareButtons();
return parent::_prepareForm();
}
示例11: _toHtml
/**
* Append helper above form
*
* @return string
*/
protected function _toHtml()
{
return $this->getChildHtml('app_notification_helper') . parent::_toHtml();
}
示例12: _toHtml
protected function _toHtml()
{
return parent::_toHtml() . $this->getChildHtml('submission_scripts') . (!Mage::registry('current_app')->getIsResubmitAction() ? '' : $this->getChildHtml('mobile_edit_tab_submission_history') . $this->getChildHtml('resubmit') . $this->getChildHtml('images'));
}