PageRenderTime 59ms CodeModel.GetById 33ms RepoModel.GetById 0ms app.codeStats 0ms

/app/templates/typo3conf/ext/flux/Classes/Form/Wizard/Link.php

https://github.com/JBusch/generator-typo3
PHP | 207 lines | 79 code | 26 blank | 102 comment | 6 complexity | 6cd2936e5f6867454139f99b9c595929 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0
  1. <?php
  2. namespace FluidTYPO3\Flux\Form\Wizard;
  3. /*****************************************************************
  4. * Copyright notice
  5. *
  6. * (c) 2014 Claus Due <claus@namelesscoder.net>
  7. *
  8. * All rights reserved
  9. *
  10. * This script is part of the TYPO3 project. The TYPO3 project is
  11. * free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 3 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * The GNU General Public License can be found at
  17. * http://www.gnu.org/copyleft/gpl.html.
  18. *
  19. * This script is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * This copyright notice MUST APPEAR in all copies of the script!
  25. *****************************************************************/
  26. use FluidTYPO3\Flux\Form\AbstractWizard;
  27. use TYPO3\CMS\Core\Utility\GeneralUtility;
  28. /**
  29. * @package Flux
  30. * @subpackage Form\Wizard
  31. */
  32. class Link extends AbstractWizard {
  33. /**
  34. * @var string
  35. */
  36. protected $name = 'link';
  37. /**
  38. * @var string
  39. */
  40. protected $type = 'popup';
  41. /**
  42. * @var string
  43. */
  44. protected $icon = 'link_popup.gif';
  45. /**
  46. * @var string
  47. */
  48. protected $script = 'wizard_add.php';
  49. /**
  50. * @var string
  51. */
  52. protected $activeTab = 'file';
  53. /**
  54. * @var integer
  55. */
  56. protected $height = 500;
  57. /**
  58. * @var integer
  59. */
  60. protected $width = 400;
  61. /**
  62. * @var mixed
  63. */
  64. protected $blindLinkOptions = '';
  65. /**
  66. * @var mixed
  67. */
  68. protected $blindLinkFields = '';
  69. /**
  70. * @var mixed
  71. */
  72. protected $allowedExtensions;
  73. /**
  74. * @return array
  75. */
  76. public function buildConfiguration() {
  77. $structure = array(
  78. 'script' => 'browse_links.php?mode=wizard&act=' . $this->getActiveTab(),
  79. 'JSopenParams' => 'height=' . $this->getHeight() . ',width=' . $this->getWidth() . ',status=0,menubar=0,scrollbars=1',
  80. 'params' => array(
  81. 'blindLinkOptions' => implode(',', $this->getBlindLinkOptions()),
  82. 'blindLinkFields' => implode(',', $this->getBlindLinkFields()),
  83. 'allowedExtensions' => implode(',', $this->getAllowedExtensions()),
  84. )
  85. );
  86. return $structure;
  87. }
  88. /**
  89. * @param string $activeTab
  90. * @return Link
  91. */
  92. public function setActiveTab($activeTab) {
  93. $this->activeTab = $activeTab;
  94. return $this;
  95. }
  96. /**
  97. * @return string
  98. */
  99. public function getActiveTab() {
  100. return $this->activeTab;
  101. }
  102. /**
  103. * @param integer $height
  104. * @return Link
  105. */
  106. public function setHeight($height) {
  107. $this->height = $height;
  108. return $this;
  109. }
  110. /**
  111. * @return integer
  112. */
  113. public function getHeight() {
  114. return $this->height;
  115. }
  116. /**
  117. * @param integer $width
  118. * @return Link
  119. */
  120. public function setWidth($width) {
  121. $this->width = $width;
  122. return $this;
  123. }
  124. /**
  125. * @return integer
  126. */
  127. public function getWidth() {
  128. return $this->width;
  129. }
  130. /**
  131. * @param mixed $blindLinkOptions
  132. * @return Link
  133. */
  134. public function setBlindLinkOptions($blindLinkOptions) {
  135. $this->blindLinkOptions = $blindLinkOptions;
  136. return $this;
  137. }
  138. /**
  139. * @return mixed
  140. */
  141. public function getBlindLinkOptions() {
  142. if (FALSE === is_array($this->blindLinkOptions) && FALSE === $this->blindLinkOptions instanceof \Traversable) {
  143. return GeneralUtility::trimExplode(',', $this->blindLinkOptions);
  144. }
  145. return $this->blindLinkOptions;
  146. }
  147. /**
  148. * @param mixed $blindLinkFields
  149. * @return Link
  150. */
  151. public function setBlindLinkFields($blindLinkFields) {
  152. $this->blindLinkFields = $blindLinkFields;
  153. return $this;
  154. }
  155. /**
  156. * @return mixed
  157. */
  158. public function getBlindLinkFields() {
  159. if (FALSE === is_array($this->blindLinkFields) && FALSE === $this->blindLinkFields instanceof \Traversable) {
  160. return GeneralUtility::trimExplode(',', $this->blindLinkFields);
  161. }
  162. return $this->blindLinkFields;
  163. }
  164. /**
  165. * @param mixed $allowedExtensions
  166. * @return Link
  167. */
  168. public function setAllowedExtensions($allowedExtensions) {
  169. $this->allowedExtensions = $allowedExtensions;
  170. return $this;
  171. }
  172. /**
  173. * @return mixed
  174. */
  175. public function getAllowedExtensions() {
  176. if (FALSE === is_array($this->allowedExtensions) && FALSE === $this->allowedExtensions instanceof \Traversable) {
  177. return GeneralUtility::trimExplode(',', $this->allowedExtensions);
  178. }
  179. return $this->allowedExtensions;
  180. }
  181. }