コード例 #1
0
ファイル: Group.php プロジェクト: pradeep-wagento/magento2
 /**
  * Return collapse state
  *
  * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
  * @return bool
  */
 protected function _isCollapseState($element)
 {
     $extra = $this->_authSession->getUser()->getExtra();
     if (isset($extra['configState'][$element->getId()])) {
         return $extra['configState'][$element->getId()];
     }
     $groupConfig = $element->getGroup();
     if (!empty($groupConfig['expanded'])) {
         return true;
     }
     return false;
 }
コード例 #2
0
ファイル: Payment.php プロジェクト: pradeep-wagento/magento2
 /**
  * Return header title part of html for payment solution
  *
  * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
  * @return string
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 protected function _getHeaderTitleHtml($element)
 {
     $html = '<div class="config-heading" ><div class="heading"><strong>' . $element->getLegend();
     $groupConfig = $element->getGroup();
     $html .= '</strong>';
     if ($element->getComment()) {
         $html .= '<span class="heading-intro">' . $element->getComment() . '</span>';
     }
     $html .= '</div>';
     $disabledAttributeString = $this->_isPaymentEnabled($element) ? '' : ' disabled="disabled"';
     $disabledClassString = $this->_isPaymentEnabled($element) ? '' : ' disabled';
     $htmlId = $element->getHtmlId();
     $html .= '<div class="button-container"><button type="button"' . $disabledAttributeString . ' class="button action-configure' . (empty($groupConfig['paypal_ec_separate']) ? '' : ' paypal-ec-separate') . $disabledClassString . '" id="' . $htmlId . '-head" onclick="paypalToggleSolution.call(this, \'' . $htmlId . "', '" . $this->getUrl('adminhtml/*/state') . '\'); return false;"><span class="state-closed">' . __('Configure') . '</span><span class="state-opened">' . __('Close') . '</span></button>';
     if (!empty($groupConfig['more_url'])) {
         $html .= '<a class="link-more" href="' . $groupConfig['more_url'] . '" target="_blank">' . __('Learn More') . '</a>';
     }
     if (!empty($groupConfig['demo_url'])) {
         $html .= '<a class="link-demo" href="' . $groupConfig['demo_url'] . '" target="_blank">' . __('View Demo') . '</a>';
     }
     $html .= '</div></div>';
     return $html;
 }
コード例 #3
0
ファイル: Fieldset.php プロジェクト: Doability/magento2dev
 /**
  * Get frontend class
  *
  * @param AbstractElement $element
  * @return string
  */
 protected function _getFrontendClass($element)
 {
     $group = $element->getGroup();
     $cssClass = isset($group['fieldset_css']) ? $group['fieldset_css'] : '';
     return 'section-config' . (empty($cssClass) ? '' : ' ' . $cssClass);
 }