Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into typo3db
Browse files Browse the repository at this point in the history
  • Loading branch information
bmack authored May 17, 2019
2 parents f676f4c + d465f21 commit 1bb5eb9
Show file tree
Hide file tree
Showing 63 changed files with 541 additions and 793 deletions.
4 changes: 1 addition & 3 deletions Classes/Ajax/RemoveFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ public function main()

/**
* Initialize the class. Read GET parameters
*
* @return void
*/
protected function init()
{
Expand Down Expand Up @@ -125,4 +123,4 @@ protected function init()
$ajaxHandler->initAjax();
}
}
}
}
2 changes: 0 additions & 2 deletions Classes/Ajax/Submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ public function main()

/**
* Initialize the class. Read GET parameters
*
* @return void
*/
protected function init()
{
Expand Down
7 changes: 2 additions & 5 deletions Classes/Ajax/Validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ class Validate
/**
* @var array
*/
protected $templates = array(
protected $templates = [
'spanSuccess' => '<span class="success">%s</span>',
'spanError' => '<span class="error">%s</span>',
);

];

/**
* Main method of the class.
Expand Down Expand Up @@ -87,8 +86,6 @@ public function main()

/**
* Initialize the class. Read GET parameters
*
* @return void
*/
protected function init()
{
Expand Down
5 changes: 0 additions & 5 deletions Classes/AjaxHandler/AbstractAjaxHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ abstract class AbstractAjaxHandler extends \Typoheads\Formhandler\Component\Abst

/**
* Initialize AJAX stuff
*
* @return void
*/
abstract public function initAjax();

/**
* Initialize the AjaxHandler
*
* @param array $settings The settings of the AjaxHandler
* @return void
*/
public function init($settings)
{
Expand All @@ -46,7 +43,6 @@ public function init($settings)
* The view passes the marker array by reference.
*
* @param array &$markers Reference to the marker array
* @return void
*/
abstract public function fillAjaxMarkers(&$markers);

Expand All @@ -56,7 +52,6 @@ abstract public function fillAjaxMarkers(&$markers);
* @param string $text The link text to be used
* @param string $field The field name of the form field
* @param string $uploadedFileName The name of the file to be deleted
* @return void
*/
abstract public function getFileRemovalLink($text, $field, $uploadedFileName);
}
34 changes: 15 additions & 19 deletions Classes/AjaxHandler/JQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,21 @@ class JQuery extends \Typoheads\Formhandler\AjaxHandler\AbstractAjaxHandler
/**
* @var array
*/
protected $templates = array(
protected $templates = [
'spanLoading'=>'<span class="loading" id="loading_%s" style="display:none">%s</span>',
'spanResult'=>'<span id="result_%s" class="formhandler-ajax-validation-result">%s</span>',
'aRemoveLink'=>'<a class="formhandler_removelink" href="%s">%s</a>',
);
];

/**
* Position of JS generated by AjaxHandler_JQuery (head|footer)
*
* @access protected
* @var string
*/
protected $jsPosition;

/**
* Initialize AJAX stuff
*
* @return void
*/
public function initAjax()
{
Expand Down Expand Up @@ -108,7 +105,6 @@ public function initAjax()
* The view passes the marker array by reference.
*
* @param array &$markers Reference to the marker array
* @return void
*/
public function fillAjaxMarkers(&$markers)
{
Expand Down Expand Up @@ -203,20 +199,20 @@ protected function getJavascriptFormInit($formSelector, $submitButtonSelector, $
{
return '(function( $ ) {
$(function() {
$("'.$formSelector.'").formhandler({
pageID: "'.$GLOBALS['TSFE']->id.'",
contentID: "'.$this->cObj->data['uid'].'",
randomID: "'.$this->globals->getRandomID().'",
formValuesPrefix: "'.$this->globals->getFormValuesPrefix().'",
lang: "'.$GLOBALS['TSFE']->sys_language_uid.'",
submitButtonSelector: "'.$submitButtonSelector.'",
ajaxSubmit: '.($isAjaxSubmit ? "true" : "false").',
autoDisableSubmitButton: '.($autoDisableSubmitButton ? "true" : "false").',
validateFields: [\''.implode("','", $validateFields).'\'],
$("' . $formSelector . '").formhandler({
pageID: "' . $GLOBALS['TSFE']->id . '",
contentID: "' . $this->cObj->data['uid'] . '",
randomID: "' . $this->globals->getRandomID() . '",
formValuesPrefix: "' . $this->globals->getFormValuesPrefix() . '",
lang: "' . $GLOBALS['TSFE']->sys_language_uid . '",
submitButtonSelector: "' . $submitButtonSelector . '",
ajaxSubmit: ' . ($isAjaxSubmit ? 'true' : 'false') . ',
autoDisableSubmitButton: ' . ($autoDisableSubmitButton ? 'true' : 'false') . ',
validateFields: [\'' . implode("','", $validateFields) . '\'],
validationStatusClasses: {
base: "'.$this->validationStatusClasses['base'].'",
valid: "'.$this->validationStatusClasses['valid'].'",
invalid: "'.$this->validationStatusClasses['invalid'].'"
base: "' . $this->validationStatusClasses['base'] . '",
valid: "' . $this->validationStatusClasses['valid'] . '",
invalid: "' . $this->validationStatusClasses['invalid'] . '"
}
});
});
Expand Down
12 changes: 3 additions & 9 deletions Classes/Component/AbstractClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,34 @@ abstract class AbstractClass
/**
* The Formhandler component manager
*
* @access protected
* @var \Typoheads\Formhandler\Component\Manager
*/
protected $componentManager;

/**
* The global Formhandler configuration
*
* @access protected
* @var \Typoheads\Formhandler\Controller\Configuration
*/
protected $configuration;

/**
* The global Formhandler values
*
* @access protected
* @var \Typoheads\Formhandler\Utility\Globals
*/
protected $globals;

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

/**
* The cObj
*
* @access protected
* @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
*/
protected $cObj;
Expand All @@ -67,13 +62,12 @@ abstract class AbstractClass
*
* @param \Typoheads\Formhandler\Component\Manager $componentManager
* @param \Typoheads\Formhandler\Controller\Configuration $configuration
* @return void
*/
public function __construct(
\Typoheads\Formhandler\Component\Manager $componentManager,
\Typoheads\Formhandler\Controller\Configuration $configuration,
\Typoheads\Formhandler\Utility\Globals $globals,
\Typoheads\Formhandler\Utility\GeneralUtility $utilityFuncs
\Typoheads\Formhandler\Controller\Configuration $configuration,
\Typoheads\Formhandler\Utility\Globals $globals,
\Typoheads\Formhandler\Utility\GeneralUtility $utilityFuncs
) {
$this->componentManager = $componentManager;
$this->configuration = $configuration;
Expand Down
4 changes: 0 additions & 4 deletions Classes/Component/AbstractComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ abstract class AbstractComponent extends AbstractClass
/**
* The GET/POST parameters
*
* @access protected
* @var array
*/
protected $gp;

/**
* Settings
*
* @access protected
* @var array
*/
protected $settings;
Expand All @@ -43,8 +41,6 @@ abstract class AbstractComponent extends AbstractClass
*
* @param array $gp GET and POST variable array
* @param array $settings Typoscript configuration for the component (component.1.config.*)
*
* @return void
*/
public function init($gp, $settings)
{
Expand Down
2 changes: 0 additions & 2 deletions Classes/Component/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ class Manager implements SingletonInterface
/**
* The global Formhandler values
*
* @access protected
* @var \Typoheads\Formhandler\Utility\Globals
*/
protected $globals;

/**
* The global Formhandler values
*
* @access protected
* @var \Typoheads\Formhandler\Utility\GeneralUtility
*/
protected $utilityFuncs;
Expand Down
8 changes: 0 additions & 8 deletions Classes/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,27 @@ abstract class AbstractController extends AbstractClass
/**
* The content returned by the controller
*
* @access protected
* @var Content
*/
protected $content;

/**
* The key of a possibly selected predefined form
*
* @access protected
* @var string
*/
protected $predefined;

/**
* 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;
Expand All @@ -58,7 +54,6 @@ abstract class AbstractController extends AbstractClass
* Sets the content attribute of the controller
*
* @param Content $content
* @return void
*/
public function setContent($content)
{
Expand All @@ -79,7 +74,6 @@ public function getContent()
* Sets the internal attribute "predefined"
*
* @param string $key
* @return void
*/
public function setPredefined($key)
{
Expand All @@ -90,7 +84,6 @@ public function setPredefined($key)
* Sets the internal attribute "langFile"
*
* @param array $langFiles
* @return void
*/
public function setLangFiles($langFiles)
{
Expand All @@ -100,7 +93,6 @@ public function setLangFiles($langFiles)
/**
* Sets the template file attribute to $template
* @param string $template
* @return void
*/
public function setTemplateFile($template)
{
Expand Down
4 changes: 0 additions & 4 deletions Classes/Controller/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@ class Configuration implements \ArrayAccess
/**
* The TS setup
*
* @access protected
* @var array
*/
protected $setup;

/**
* The constructor reading the TS setup into the according attribute
*
* @return void
*/
public function __construct()
{
Expand All @@ -60,7 +57,6 @@ public function __construct()
* Merges the values of $setup with plugin.[xxx].settings
*
* @param array $setup
* @return void
*/
public function merge($setup)
{
Expand Down
4 changes: 0 additions & 4 deletions Classes/Controller/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ class Content
/**
* The actual content
*
* @access protected
* @var string
*/
protected $content;

/**
* The constructor settings the internal attribute "content"
*
* @return void
*/
public function __construct($content)
{
Expand All @@ -42,7 +39,6 @@ public function __construct($content)
* Sets the internal attribute "content"
*
* @param string $content
* @return void
*/
public function setContent($content)
{
Expand Down
3 changes: 0 additions & 3 deletions Classes/Controller/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,20 @@ class Dispatcher extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
/**
* Compontent Manager
*
* @access protected
* @var \Typoheads\Formhandler\Component\Manager
*/
protected $componentManager;

/**
* The global Formhandler values
*
* @access protected
* @var \Typoheads\Formhandler\Utility\Globals
*/
protected $globals;

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

0 comments on commit 1bb5eb9

Please sign in to comment.