Skip to content

Commit

Permalink
[TASK] Remove unneeded methods, move some methods to AbstractController
Browse files Browse the repository at this point in the history
  • Loading branch information
reinhardfuehricht committed Feb 26, 2016
1 parent c1b06c1 commit cc91f89
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 55 deletions.
51 changes: 12 additions & 39 deletions Classes/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
* TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
* Public License for more details. *
* */
use Typoheads\Formhandler\Component\AbstractClass;

/**
* Abstract class for Controller Classes used by Formhandler.
*
* @author Reinhard Führicht <[email protected]>
* @abstract
*/
abstract class AbstractController extends \Typoheads\Formhandler\Component\AbstractClass
abstract class AbstractController extends AbstractClass
{

/**
Expand All @@ -39,12 +40,20 @@ abstract class AbstractController extends \Typoheads\Formhandler\Component\Abstr
protected $predefined;

/**
* The path to a possibly selected translation file
* The template file to be used. Only if template file was defined via plugin record
*
* @access protected
* @var string
*/
protected $langFile;
protected $templateFile;

/**
* Array of configured translation files
*
* @access protected
* @var array
*/
protected $langFiles;

/**
* Sets the content attribute of the controller
Expand Down Expand Up @@ -81,30 +90,6 @@ public function setPredefined($key)
$this->predefined = $key;
}

/**
* Sets the internal attribute "redirectPage"
*
* @author Reinhard Führicht <[email protected]>
* @param integer $new
* @return void
*/
public function setRedirectPage($new)
{
$this->redirectPage = $new;
}

/**
* Sets the internal attribute "requiredFields"
*
* @author Reinhard Führicht <[email protected]>
* @param array $new
* @return void
*/
public function setRequiredFields($new)
{
$this->requiredFields = $new;
}

/**
* Sets the internal attribute "langFile"
*
Expand All @@ -117,18 +102,6 @@ public function setLangFiles($langFiles)
$this->langFiles = $langFiles;
}

/**
* Sets the internal attribute "emailSettings"
*
* @author Reinhard Führicht <[email protected]>
* @param array $new
* @return void
*/
public function setEmailSettings($new)
{
$this->emailSettings = $new;
}

/**
* Sets the template file attribute to $template
*
Expand Down
10 changes: 10 additions & 0 deletions Classes/Controller/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ class Dispatcher extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
*/
protected $globals;

/**
* The Formhandler utility functions
*
* @access protected
* @var \Typoheads\Formhandler\Utility\GeneralUtility
*/
protected $utilityFuncs;

/**
* Main method of the dispatcher. This method is called as a user function.
*
Expand Down Expand Up @@ -88,6 +96,8 @@ public function main($content, $setup)
if ($setup['controller']) {
$controller = $setup['controller'];
}

/** @var \Typoheads\Formhandler\Controller\AbstractController $controller */
$controller = $this->componentManager->getComponent($controller);

if (isset($content)) {
Expand Down
16 changes: 0 additions & 16 deletions Classes/Controller/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,6 @@ class Form extends AbstractController
*/
protected $formValuesPrefix;

/**
* The template file to be used. Only if template file was defined via plugin record
*
* @access protected
* @var string
*/
protected $templateFile;

/**
* Array of configured translation files
*
* @access protected
* @var array
*/
protected $langFiles;

/**
* Flag indicating if the form got submitted
*
Expand Down

0 comments on commit cc91f89

Please sign in to comment.