/**
  * Method to get the field input markup for a spacer.
  * The spacer does not have accept input.
  *
  * @return  string  The field input markup.
  *
  * @since   11.1
  */
 protected function getInput()
 {
     $apiHelper = new mauticApiHelper();
     $settings = $apiHelper->getApiSettings();
     $url = Juri::root() . 'administrator/?plugin=mautic';
     $text = 'PLG_MAUTIC_AUTHORIZE_BTN';
     if (!empty($settings['accessToken'])) {
         $url .= '&reauthorize=true';
         $text = 'PLG_MAUTIC_REAUTHORIZE_BTN';
     } else {
         $url .= '&authorize=true';
     }
     if (!empty($settings['clientKey']) && !empty($settings['clientSecret'])) {
         // Note: style is added for Joomla 2.5
         $btn = Jhtml::link($url, JText::_($text), array('class' => 'btn btn-small btn-success', 'style' => 'float: left;'));
         if (!empty($settings['accessToken'])) {
             $resetUrl = Juri::root() . 'administrator/?plugin=mautic&reset=true';
             $btn .= ' <span style="float: left;  padding: 0 4px;">|</span> ';
             $btn .= Jhtml::link($resetUrl, JText::_('PLG_MAUTIC_RESET_BTN'), array('class' => 'btn btn-small btn-default pull-right', 'style' => 'float: left;'));
         }
         return $btn;
     } else {
         return JText::_('PLG_MAUTIC_SAVE_KEYS_FIRST');
     }
 }
Example #2
0
 /**
  * Display debug info
  *
  * @return  string  The field input markup.
  *
  * @since   11.1
  */
 protected function getInput()
 {
     $apiHelper = new mauticApiHelper();
     $settings = $apiHelper->getApiSettings();
     $params = $apiHelper->getPluginParams();
     $debug = '';
     if ($params->get('debug_on')) {
         $debug = '<fieldset><pre>';
         $debug .= isset($_SESSION['oauth']['debug']) ? var_export($_SESSION['oauth']['debug'], true) : 'N/A';
         $debug .= '</pre>';
         $debug .= '<h3>' . JText::_('PLG_MAUTIC_OAUTH_SETTINGS') . '</h3>';
         $debug .= '<pre>';
         $debug .= var_export($settings, true);
         $debug .= '</pre></fieldset>';
         return $debug;
     }
 }