예제 #1
0
 /**
  * Return list of the "Button" widgets
  *
  * @return array
  */
 protected function getFormButtons()
 {
     $result = parent::getFormButtons();
     $requestCredentialsBtn = new \XLite\Module\XC\PitneyBowes\View\Button\CredentialsForm(array(\XLite\View\Button\AButton::PARAM_LABEL => 'Request credentials', \XLite\View\Button\AButton::PARAM_STYLE => 'action always-enabled'));
     $result = static::arrayInsertBefore('shipping_methods', $result, 'request', $requestCredentialsBtn);
     return $result;
 }
예제 #2
0
 /**
  * Return list of the "Button" widgets
  *
  * @return array
  */
 protected function getFormButtons()
 {
     $result = array();
     $buttons = parent::getFormButtons();
     $submit = $buttons['submit'];
     unset($buttons['submit']);
     $config = \XLite\Core\Config::getInstance()->CDev->AustraliaPost;
     if ($config->optionValues) {
         $result['submit'] = $submit;
         $url = $this->buildURL('aupost', 'renew_settings');
         $result['module_settings'] = new \XLite\View\Button\ProgressState(array(\XLite\View\Button\AButton::PARAM_LABEL => 'Renew available settings', \XLite\View\Button\AButton::PARAM_STYLE => 'action always-enabled', \XLite\View\Button\Regular::PARAM_JS_CODE => 'self.location=\'' . $url . '\''));
     } else {
         $url = $this->buildURL('aupost', 'renew_settings');
         $result['module_settings'] = new \XLite\View\Button\ProgressState(array(\XLite\View\Button\AButton::PARAM_LABEL => 'Get module settings', \XLite\View\Button\AButton::PARAM_BTN_TYPE => 'regular-main-button', \XLite\View\Button\AButton::PARAM_STYLE => 'action always-enabled', \XLite\View\Button\Regular::PARAM_JS_CODE => 'self.location=\'' . $url . '\''));
     }
     return $result + $buttons;
 }