Beispiel #1
0
 /**
  * This method initialises the Proofreader's form and stores it into static variable
  */
 protected function initForm()
 {
     require_once JPATH_SITE . '/components/com_proofreader/helpers/form.php';
     $form = ProofreaderFormHelper::getScript($this->params);
     JFactory::getApplication()->setUserState('com_proofreader.typo.form', $form);
 }
Beispiel #2
0
 /**
  * Returns an object with Proofreader's form code and used scripts
  *
  * @param  string $url   The page link
  * @param  string $title The page title
  *
  * @return object
  */
 private function getFormResponse($url, $title)
 {
     $response = new StdClass();
     $response->error = false;
     $response->form = ProofreaderFormHelper::getForm($url, $title);
     $params = JComponentHelper::getParams('com_proofreader', true);
     if ($params->get('captcha') !== '' && $params->get('captcha') !== '0' && $params->get('dynamic_form_load', 0) == 1) {
         $scripts = ProofreaderFormHelper::getFormScripts();
         $response->scripts = $scripts['scripts'];
         $response->script = $scripts['script'];
     } else {
         $response->scripts = array();
         $response->script = '';
     }
     return $response;
 }