Example #1
0
 /**
  * Used to broker incoming requests to other calls.
  * Called by typo3/ajax.php
  *
  * @param array $unused additional parameters (not used)
  * @param AjaxRequestHandler $ajax the AJAX object for this request
  *
  * @return void
  */
 public function ajaxBroker(array $unused, AjaxRequestHandler $ajax)
 {
     $state = (bool) GeneralUtility::_POST('state');
     $checkbox = GeneralUtility::_POST('checkbox');
     if (in_array($checkbox, $this->validCheckboxKeys, true)) {
         $ajax->setContentFormat('json');
         $this->userSettingsService->set($checkbox, $state);
         $ajax->addContent('success', true);
     } else {
         $ajax->setContentFormat('plain');
         $ajax->setError('Illegal input parameters.');
     }
 }
Example #2
0
 /**
  * Used to broker incoming requests to other calls.
  * Called by typo3/ajax.php
  *
  * @param array $unused additional parameters (not used)
  * @param TYPO3AJAX $ajax the AJAX object for this request
  *
  * @return void
  */
 public function ajaxBroker(array $unused, TYPO3AJAX $ajax)
 {
     $state = (bool) t3lib_div::_POST('state');
     $checkbox = t3lib_div::_POST('checkbox');
     if (in_array($checkbox, $this->validCheckboxKeys, TRUE)) {
         $ajax->setContentFormat('json');
         $this->userSettingsService->set($checkbox, $state);
         $ajax->addContent('success', TRUE);
     } else {
         $ajax->setContentFormat('plain');
         $ajax->setError('Illegal input parameters.');
     }
 }
Example #3
0
 /**
  * Gets the key of the currently selected testable and saves it to the user settings.
  *
  * @return string the currently selected testable key, will not be empty
  */
 protected function getAndSaveSelectedTestableKey()
 {
     $testableKeyFromSettings = $this->userSettingsService->getAsString(Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE);
     if ($this->request->hasString(Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE)) {
         $selectedTestableKey = $this->request->getAsString(Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE);
     } else {
         $selectedTestableKey = $testableKeyFromSettings;
     }
     if ($selectedTestableKey !== Tx_Phpunit_Testable::ALL_EXTENSIONS && !$this->testFinder->existsTestableForKey($selectedTestableKey)) {
         // We know that phpunit must be loaded.
         $selectedTestableKey = 'phpunit';
     }
     if ($selectedTestableKey !== $testableKeyFromSettings) {
         $this->userSettingsService->set(Tx_Phpunit_Interface_Request::PARAMETER_KEY_TESTABLE, $selectedTestableKey);
     }
     return $selectedTestableKey;
 }