Commit 37357ad7 authored by Andy Hausmann's avatar Andy Hausmann

Added namespaces.

parent e3e45322
<?php <?php
namespace SotaStudio\Flexslider\Controller;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use SotaStudio\Flexslider\Domain\Repository\FlexSliderRepository,
SotaStudio\Flexslider\Utility\EmConfiguration,
TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface,
TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
/** /**
* Main Controller. * Main Controller.
* *
...@@ -31,27 +36,29 @@ ...@@ -31,27 +36,29 @@
* @package flexslider * @package flexslider
* @subpackage Controller * @subpackage Controller
*/ */
class Tx_Flexslider_Controller_FlexSliderController extends Tx_Extbase_MVC_Controller_ActionController { class FlexSliderController extends ActionController {
/** /** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
* @var tslib_cObj protected $TSFE;
*/
/** @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer */
protected $contentObject; protected $contentObject;
/** /**
* flexSliderRepository * flexSliderRepository
* *
* @var Tx_Flexslider_Domain_Repository_FlexSliderRepository * @var \SotaStudio\Flexslider\Domain\Repository\FlexSliderRepository
*/ */
protected $flexSliderRepository; protected $flexSliderRepository;
/** /**
* injectFlexSliderRepository * injectFlexSliderRepository
* *
* @param Tx_Flexslider_Domain_Repository_FlexSliderRepository $flexSliderRepository * @param \SotaStudio\Flexslider\Domain\Repository\FlexSliderRepository $flexSliderRepository
* @return void * @return void
*/ */
public function injectFlexSliderRepository(Tx_Flexslider_Domain_Repository_FlexSliderRepository $flexSliderRepository) { public function injectFlexSliderRepository(FlexSliderRepository $flexSliderRepository) {
$this->flexSliderRepository = $flexSliderRepository; $this->flexSliderRepository = $flexSliderRepository;
} }
...@@ -63,17 +70,19 @@ class Tx_Flexslider_Controller_FlexSliderController extends Tx_Extbase_MVC_Contr ...@@ -63,17 +70,19 @@ class Tx_Flexslider_Controller_FlexSliderController extends Tx_Extbase_MVC_Contr
*/ */
public function initializeAction() { public function initializeAction() {
$this->contentObject = $this->configurationManager->getContentObject(); $this->contentObject = $this->configurationManager->getContentObject();
$this->TSFE =& $GLOBALS['TSFE'];
// Fallback to current pid if no storagePid is defined // Fallback to current pid if no storagePid is defined
$configuration = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); $configuration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
if(empty($configuration['persistence']['storagePid'])){ if(empty($configuration['persistence']['storagePid'])){
$currentPid['persistence']['storagePid'] = $GLOBALS['TSFE']->id; $currentPid['persistence']['storagePid'] = $this->TSFE->id;
$this->configurationManager->setConfiguration(array_merge($configuration, $currentPid)); $this->configurationManager->setConfiguration(array_merge($configuration, $currentPid));
} }
} }
/** /**
* action list * Action list
* Displays all slider elements.
* *
* @return void * @return void
*/ */
...@@ -81,7 +90,7 @@ class Tx_Flexslider_Controller_FlexSliderController extends Tx_Extbase_MVC_Contr ...@@ -81,7 +90,7 @@ class Tx_Flexslider_Controller_FlexSliderController extends Tx_Extbase_MVC_Contr
$flexSliders = $this->flexSliderRepository->findAll(); $flexSliders = $this->flexSliderRepository->findAll();
$tplObj = array( $tplObj = array(
'configuration' => Tx_Flexslider_Utility_EmConfiguration::getConfiguration(), 'configuration' => EmConfiguration::getConfiguration(),
'data' => $this->contentObject->data, 'data' => $this->contentObject->data,
'altUid' => uniqid('alt'), 'altUid' => uniqid('alt'),
'flexSliders' => $flexSliders 'flexSliders' => $flexSliders
......
<?php <?php
namespace SotaStudio\Flexslider\Domain\Model;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
/** /**
* Model for the FlexSlider items. * Model for the FlexSlider items.
* *
...@@ -31,7 +33,7 @@ ...@@ -31,7 +33,7 @@
* @package flexslider * @package flexslider
* @subpackage Domain\Model * @subpackage Domain\Model
*/ */
class Tx_Flexslider_Domain_Model_FlexSlider extends Tx_Extbase_DomainObject_AbstractEntity { class FlexSlider extends AbstractEntity {
/** @var string */ /** @var string */
protected $name; protected $name;
...@@ -54,6 +56,7 @@ class Tx_Flexslider_Domain_Model_FlexSlider extends Tx_Extbase_DomainObject_Abst ...@@ -54,6 +56,7 @@ class Tx_Flexslider_Domain_Model_FlexSlider extends Tx_Extbase_DomainObject_Abst
/** @var string */ /** @var string */
protected $caption; protected $caption;
/** /**
* Returns the name * Returns the name
* *
......
<?php <?php
namespace SotaStudio\Flexslider\Domain\Repository;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use TYPO3\CMS\Extbase\Persistence\QueryInterface,
TYPO3\CMS\Extbase\Persistence\Repository;
/** /**
* Repository for FlexSlider items. * Repository for FlexSlider items.
* *
...@@ -31,7 +34,7 @@ ...@@ -31,7 +34,7 @@
* @package flexslider * @package flexslider
* @subpackage Domain\Repository * @subpackage Domain\Repository
*/ */
class Tx_Flexslider_Domain_Repository_FlexSliderRepository extends Tx_Extbase_Persistence_Repository { class FlexSliderRepository extends Repository {
/** /**
* Small workaround to allow backend sorting. * Small workaround to allow backend sorting.
...@@ -39,7 +42,7 @@ class Tx_Flexslider_Domain_Repository_FlexSliderRepository extends Tx_Extbase_Pe ...@@ -39,7 +42,7 @@ class Tx_Flexslider_Domain_Repository_FlexSliderRepository extends Tx_Extbase_Pe
* @var array * @var array
*/ */
protected $defaultOrderings = array( protected $defaultOrderings = array(
'sorting' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING 'sorting' => QueryInterface::ORDER_ASCENDING
); );
} }
\ No newline at end of file
<?php <?php
namespace SotaStudio\Flexslider\Utility;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use \TYPO3\CMS\Core\Utility\DebugUtility;
/** /**
* Helper Class which makes debugging tools available * Helper Class which makes debugging tools available
* *
...@@ -31,7 +33,7 @@ ...@@ -31,7 +33,7 @@
* @package flexslider * @package flexslider
* @subpackage Utility * @subpackage Utility
*/ */
class Tx_Flexslider_Utility_Debug { class Debug {
/** /**
* Helper function for debuggin purposes. * Helper function for debuggin purposes.
...@@ -39,7 +41,7 @@ class Tx_Flexslider_Utility_Debug { ...@@ -39,7 +41,7 @@ class Tx_Flexslider_Utility_Debug {
* @param mixed $v Var to debug * @param mixed $v Var to debug
*/ */
public static function debug($v) { public static function debug($v) {
t3lib_utility_Debug::debug($v); DebugUtility::debug($v);
} }
/** /**
......
<?php <?php
namespace SotaStudio\Flexslider\Utility;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use TYPO3\CMS\Core\Messaging\FlashMessage,
TYPO3\CMS\Core\Utility\ExtensionManagementUtility,
TYPO3\CMS\Core\Utility\GeneralUtility;
/** /**
* Helper Class which makes various tools and helper available * Helper Class which makes various tools and helper available
* *
...@@ -33,7 +37,7 @@ ...@@ -33,7 +37,7 @@
* @package flexslider * @package flexslider
* @subpackage Utility * @subpackage Utility
*/ */
class Tx_Flexslider_Utility_Div { class Div {
/** /**
* Better implementation of php's array_combine(). * Better implementation of php's array_combine().
...@@ -81,6 +85,7 @@ class Tx_Flexslider_Utility_Div { ...@@ -81,6 +85,7 @@ class Tx_Flexslider_Utility_Div {
/** /**
* Returns the reference to a 'resource' in TypoScript. * Returns the reference to a 'resource' in TypoScript.
* *
* @var $GLOBALS['TSFE'] \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
* @param string $file File get a reference from - can contain EXT:ext_name * @param string $file File get a reference from - can contain EXT:ext_name
* @return mixed * @return mixed
*/ */
...@@ -91,6 +96,7 @@ class Tx_Flexslider_Utility_Div { ...@@ -91,6 +96,7 @@ class Tx_Flexslider_Utility_Div {
/** /**
* Checks a passed CSS or JS file and adds it to the Frontend. * Checks a passed CSS or JS file and adds it to the Frontend.
* *
* @var $GLOBALS['TSFE'] \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
* @param string $file File reference * @param string $file File reference
* @param bool $moveToFooter Flag to include file into footer - doesn't work for CSS files * @param bool $moveToFooter Flag to include file into footer - doesn't work for CSS files
*/ */
...@@ -109,6 +115,7 @@ class Tx_Flexslider_Utility_Div { ...@@ -109,6 +115,7 @@ class Tx_Flexslider_Utility_Div {
// Stylesheet processing // Stylesheet processing
} elseif ($mediaTypeSplit == '.css') { } elseif ($mediaTypeSplit == '.css') {
/** \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
$GLOBALS['TSFE']->getPageRenderer()->addCssFile($resolved); $GLOBALS['TSFE']->getPageRenderer()->addCssFile($resolved);
} }
} }
...@@ -117,12 +124,13 @@ class Tx_Flexslider_Utility_Div { ...@@ -117,12 +124,13 @@ class Tx_Flexslider_Utility_Div {
/** /**
* Checks a passed CSS or JS file and adds it to the Frontend. * Checks a passed CSS or JS file and adds it to the Frontend.
* *
* @param string $script JS Block * @var $GLOBALS['TSFE'] \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
* @param string $addUnique Unique key to avoid multiple inclusions * @param string $code JS Block
* @param string $name Unique key to avoid multiple inclusions
* @param bool $moveToFooter Flag to include file into footer - doesn't work for CSS files * @param bool $moveToFooter Flag to include file into footer - doesn't work for CSS files
* @return void
*/ */
public static function addJsInline($code, $name, $moveToFooter = FALSE) { public static function addJsInline($code, $name, $moveToFooter = FALSE) {
if ($code) { if ($code) {
//$code = '<script type="text/javascript">'.$code.'</script>'; //$code = '<script type="text/javascript">'.$code.'</script>';
($moveToFooter) ($moveToFooter)
...@@ -134,19 +142,20 @@ class Tx_Flexslider_Utility_Div { ...@@ -134,19 +142,20 @@ class Tx_Flexslider_Utility_Div {
/** /**
* Adds/renders a Flash message. * Adds/renders a Flash message.
* *
* @var $GLOBALS['TSFE'] \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
* @param string $title The title * @param string $title The title
* @param string $message The message * @param string $message The message
* @param int $type Message level * @param int $type Message level
* @return mixed * @return mixed
*/ */
public static function renderFlashMessage($title, $message, $type = t3lib_FlashMessage::WARNING) { public static function renderFlashMessage($title, $message, $type = FlashMessage::WARNING) {
$code = '.typo3-message .message-header{padding: 10px 10px 0 30px;font-size:0.9em;}'; $code = '.typo3-message .message-header{padding: 10px 10px 0 30px;font-size:0.9em;}';
$code .= '.typo3-message .message-body{padding: 10px;font-size:0.9em;}'; $code .= '.typo3-message .message-body{padding: 10px;font-size:0.9em;}';
$GLOBALS['TSFE']->getPageRenderer()->addCssFile(t3lib_extMgm::siteRelPath('t3skin') . 'stylesheets/visual/element_message.css'); $GLOBALS['TSFE']->getPageRenderer()->addCssFile(ExtensionManagementUtility::siteRelPath('t3skin') . 'stylesheets/visual/element_message.css');
$GLOBALS['TSFE']->getPageRenderer()->addCssInlineBlock('flashmessage',$code); $GLOBALS['TSFE']->getPageRenderer()->addCssInlineBlock('flashmessage',$code);
$flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', $message, $title, $type); $flashMessage = GeneralUtility::makeInstance('t3lib_FlashMessage', $message, $title, $type);
return $flashMessage->render(); return $flashMessage->render();
} }
......
<?php <?php
namespace SotaStudio\Flexslider\Utility;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* @package flexslider * @package flexslider
* @subpackage Utility * @subpackage Utility
*/ */
class Tx_Flexslider_Utility_EmConfiguration { class EmConfiguration {
/** /**
* Extension key to get the EM Config from. * Extension key to get the EM Config from.
......
<?php <?php
namespace SotaStudio\Flexslider\ViewHelpers;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use SotaStudio\Flexslider\Utility\Div,
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
/** /**
* *
* A view helper for adding CSS and JS files to teh frontend. * A view helper for adding CSS and JS files to teh frontend.
...@@ -43,7 +46,7 @@ ...@@ -43,7 +46,7 @@
* @package flexslider * @package flexslider
* @subpackage ViewHelpers * @subpackage ViewHelpers
*/ */
class Tx_Flexslider_ViewHelpers_AddCssJsViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractTagBasedViewHelper { class AddCssJsViewHelper extends AbstractTagBasedViewHelper {
/** /**
* Adds JS and CSS to the frontend * Adds JS and CSS to the frontend
...@@ -55,7 +58,7 @@ class Tx_Flexslider_ViewHelpers_AddCssJsViewHelper extends Tx_Fluid_Core_ViewHel ...@@ -55,7 +58,7 @@ class Tx_Flexslider_ViewHelpers_AddCssJsViewHelper extends Tx_Fluid_Core_ViewHel
public function render($file = NULL, $moveToFooter = FALSE) { public function render($file = NULL, $moveToFooter = FALSE) {
if ($file) { if ($file) {
Tx_Flexslider_Utility_Div::addCssJsFile( Div::addCssJsFile(
$file, $file,
$moveToFooter $moveToFooter
); );
......
<?php <?php
namespace SotaStudio\Flexslider\ViewHelpers;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use SotaStudio\Flexslider\Utility\Div,
TYPO3\CMS\Core\Messaging\FlashMessage,
TYPO3\CMS\Core\Utility\ExtensionManagementUtility,
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
/** /**
* *
* A view helper for adding jQuery to the frontend. * A view helper for adding jQuery to the frontend.
...@@ -40,7 +45,7 @@ ...@@ -40,7 +45,7 @@
* @package flexslider * @package flexslider
* @subpackage ViewHelpers * @subpackage ViewHelpers
*/ */
class Tx_Flexslider_ViewHelpers_AddJQueryViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractTagBasedViewHelper { class AddJQueryViewHelper extends AbstractTagBasedViewHelper {
/** /**
* Adds T3Jquery as Lib * Adds T3Jquery as Lib
...@@ -54,8 +59,8 @@ class Tx_Flexslider_ViewHelpers_AddJQueryViewHelper extends Tx_Fluid_Core_ViewHe ...@@ -54,8 +59,8 @@ class Tx_Flexslider_ViewHelpers_AddJQueryViewHelper extends Tx_Fluid_Core_ViewHe
*/ */
public function render($altJQueryFile = NULL, $moveToFooter = FALSE) { public function render($altJQueryFile = NULL, $moveToFooter = FALSE) {
// checks if t3jquery is loaded // checks if t3jquery is loaded
if (t3lib_extMgm::isLoaded('t3jquery')) { if (ExtensionManagementUtility::isLoaded('t3jquery')) {
require_once(t3lib_extMgm::extPath('t3jquery').'class.tx_t3jquery.php'); require_once(ExtensionManagementUtility::extPath('t3jquery').'class.tx_t3jquery.php');
} }
// if t3jquery is loaded and the custom Library had been created // if t3jquery is loaded and the custom Library had been created
if (T3JQUERY === TRUE) { if (T3JQUERY === TRUE) {
...@@ -63,15 +68,15 @@ class Tx_Flexslider_ViewHelpers_AddJQueryViewHelper extends Tx_Fluid_Core_ViewHe ...@@ -63,15 +68,15 @@ class Tx_Flexslider_ViewHelpers_AddJQueryViewHelper extends Tx_Fluid_Core_ViewHe
} else { } else {
if ($altJQueryFile) { if ($altJQueryFile) {
Tx_Flexslider_Utility_Div::addCssJsFile( div::addCssJsFile(
$altJQueryFile, $altJQueryFile,
$moveToFooter $moveToFooter
); );
} else { } else {
Tx_Flexslider_Utility_Div::renderFlashMessage( Div::renderFlashMessage(
'jQuery not loaded', 'jQuery not loaded',
'jQuery could not be loaded. Please check the path to the alternative jQuery library or simply use the Extension t3jquery.', 'jQuery could not be loaded. Please check the path to the alternative jQuery library or simply use the Extension t3jquery.',
t3lib_FlashMessage::ERROR FlashMessage::ERROR
); );
} }
} }
......
<?php <?php
namespace SotaStudio\Flexslider\ViewHelpers;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use SotaStudio\Flexslider\Utility\Div,
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
/** /**
* *
* Renders Inline JS via PageRenderer and enables Plugins to throw it into external files, * Renders Inline JS via PageRenderer and enables Plugins to throw it into external files,
...@@ -43,7 +46,7 @@ ...@@ -43,7 +46,7 @@
* @package flexslider * @package flexslider
* @subpackage ViewHelpers * @subpackage ViewHelpers
*/ */
class Tx_Flexslider_ViewHelpers_AddJsInlineViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractTagBasedViewHelper { class AddJsInlineViewHelper extends AbstractTagBasedViewHelper {
/** /**
* Adds JS and CSS to the frontend * Adds JS and CSS to the frontend
...@@ -56,7 +59,7 @@ class Tx_Flexslider_ViewHelpers_AddJsInlineViewHelper extends Tx_Fluid_Core_View ...@@ -56,7 +59,7 @@ class Tx_Flexslider_ViewHelpers_AddJsInlineViewHelper extends Tx_Fluid_Core_View
public function render($code = NULL, $name = '', $moveToFooter = FALSE) { public function render($code = NULL, $name = '', $moveToFooter = FALSE) {
if ($code) { if ($code) {
Tx_Flexslider_Utility_Div::addJsInline( Div::addJsInline(
$code, $code,
$name, $name,
$moveToFooter $moveToFooter
......
<?php <?php
namespace SotaStudio\Flexslider\ViewHelpers;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use SotaStudio\Flexslider\Utility\Div,
TYPO3\CMS\Core\Utility\GeneralUtility,
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
/** /**
* *
* A view helper for dynamic rendering of links. * A view helper for dynamic rendering of links.
...@@ -34,7 +38,7 @@ ...@@ -34,7 +38,7 @@
* @package flexslider * @package flexslider
* @subpackage ViewHelpers * @subpackage ViewHelpers
*/ */
class Tx_Flexslider_ViewHelpers_DynLinkViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractTagBasedViewHelper { class DynLinkViewHelper extends AbstractTagBasedViewHelper {
/** /**
* @var string * @var string
...@@ -83,13 +87,13 @@ class Tx_Flexslider_ViewHelpers_DynLinkViewHelper extends Tx_Fluid_Core_ViewHelp ...@@ -83,13 +87,13 @@ class Tx_Flexslider_ViewHelpers_DynLinkViewHelper extends Tx_Fluid_Core_ViewHelp
protected function processLinkParams($link) { protected function processLinkParams($link) {
$paramDataArr = explode(' ', $link); $paramDataArr = explode(' ', $link);
// Combine labels and values into one array // Combine labels and values into one array
$paramDataArr = Tx_Flexslider_Utility_Div::combineArray($this->paramLabels, $paramDataArr, FALSE); $paramDataArr = Div::combineArray($this->paramLabels, $paramDataArr, FALSE);
if (isset($paramDataArr['href']) && !empty($paramDataArr['href'])) { if (isset($paramDataArr['href']) && !empty($paramDataArr['href'])) {
// Save link data into ViewHelper arguments // Save link data into ViewHelper arguments
$this->setArgumentsFromArray($paramDataArr); $this->setArgumentsFromArray($paramDataArr);
$cObj = t3lib_div::makeInstance('tslib_cObj'); $cObj = GeneralUtility::makeInstance('tslib_cObj');
$configuration = array( $configuration = array(
'parameter' => $this->arguments['href'], 'parameter' => $this->arguments['href'],
'returnLast' => TRUE 'returnLast' => TRUE
......
...@@ -3,8 +3,10 @@ if (!defined ('TYPO3_MODE')) { ...@@ -3,8 +3,10 @@ if (!defined ('TYPO3_MODE')) {
die ('Access denied.'); die ('Access denied.');
} }
use SotaStudio\Flexslider\Utility\EmConfiguration;
// Extension manager configuration // Extension manager configuration
$configuration = Tx_Flexslider_Utility_EmConfiguration::getConfiguration(); $configuration = EmConfiguration::getConfiguration();
$pathLL = 'LLL:EXT:flexslider/Resources/Private/Language/locallang_db.xml:'; $pathLL = 'LLL:EXT:flexslider/Resources/Private/Language/locallang_db.xml:';
......
{namespace fs=Tx_Flexslider_ViewHelpers} {namespace fs=SotaStudio\Flexslider\ViewHelpers}
<fs:AddJQuery altJQueryFile="{settings.lib.jQuery}" moveToFooter="{settings.lib.moveToFooter}" /> <fs:AddJQuery altJQueryFile="{settings.lib.jQuery}" moveToFooter="{settings.lib.moveToFooter}" />
<fs:AddCssJs file="{settings.lib.flexslider}" moveToFooter="{settings.lib.moveToFooter}" /> <fs:AddCssJs file="{settings.lib.flexslider}" moveToFooter="{settings.lib.moveToFooter}" />
......
...@@ -48,9 +48,9 @@ class flexslider_pi1_wizicon { ...@@ -48,9 +48,9 @@ class flexslider_pi1_wizicon {
$this->extKey = 'flexslider'; $this->extKey = 'flexslider';
$this->plugin = 'pi1'; $this->plugin = 'pi1';
$this->pluginSignature = strtolower($this->extKey . '_' . $this->plugin); $this->pluginSignature = strtolower($this->extKey . '_' . $this->plugin);
$this->LANG =& $GLOBALS['LANG'];
} }
/** /**
* Processing the wizard items array * Processing the wizard items array
* *
...@@ -61,31 +61,30 @@ class flexslider_pi1_wizicon { ...@@ -61,31 +61,30 @@ class flexslider_pi1_wizicon {
$locallang = $this->includeLocalLang(); $locallang = $this->includeLocalLang();
$wizardItems['plugins_tx_' . $this->extKey] = array( $wizardItems['plugins_tx_' . $this->extKey] = array(
'icon' => t3lib_extMgm::extRelPath($this->extKey) . 'Resources/Public/Icons/' . $this->plugin . '_ce_wiz.gif', 'icon' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($this->extKey) . 'Resources/Public/Icons/' . $this->plugin . '_ce_wiz.gif',
'title' => $GLOBALS['LANG']->getLLL($this->plugin . '_title', $locallang), 'title' => $this->LANG->getLLL($this->plugin . '_title', $locallang),
'description' => $GLOBALS['LANG']->getLLL($this->plugin . '_plus_wiz_description', $locallang), 'description' => $this->LANG->getLLL($this->plugin . '_plus_wiz_description', $locallang),
'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=' . $this->pluginSignature 'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=' . $this->pluginSignature
); );
return $wizardItems; return $wizardItems;
} }
/** /**
* Reads the Backend Localization file. * Reads the Backend Localization file.
* *
* @return array The array with language labels * @return array The array with language labels
*/ */
protected function includeLocalLang() { protected function includeLocalLang() {
$llFile = t3lib_extMgm::extPath($this->extKey) . 'Resources/Private/Language/locallang_be.xml'; $llFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($this->extKey) . 'Resources/Private/Language/locallang_be.xml';
$l10n = t3lib_div::makeInstance('language'); $l10n = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('language');
$l10n->init($GLOBALS['LANG']->lang); $l10n->init($this->LANG->lang);
$l10nArr = $l10n->includeLLFile($llFile, false); $l10nArr = $l10n->includeLLFile($llFile, FALSE);
// Removed following lines, because this will only work with TYPO3 4.6+ // Removed following lines, because this will only work with TYPO3 4.6+
//$l10nParser = t3lib_div::makeInstance('t3lib_l10n_parser_Llxml'); //$l10nParser = t3lib_div::makeInstance('t3lib_l10n_parser_Llxml');
//return $l10nParser->getParsedData($llFile, $GLOBALS['LANG']->lang); //return $l10nParser->getParsedData($llFile, $this->LANG->lang);
return $l10nArr; return $l10nArr;
} }
......
{namespace fs=Tx_Flexslider_ViewHelpers} {namespace fs=SotaStudio\Flexslider\ViewHelpers}
<f:layout name="Default" /> <f:layout name="Default" />
......
<?php <?php
$extensionClassesPath = t3lib_extMgm::extPath('flexslider') . 'Classes/'; $extensionClassesPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('flexslider') . 'Classes/';
return array( return array(
'tx_flexslider_utility_emconfiguration' => $extensionClassesPath . 'Utility/EmConfiguration.php', 'tx_flexslider_utility_emconfiguration' => $extensionClassesPath . 'Utility/EmConfiguration.php',
); );
\ No newline at end of file
...@@ -3,12 +3,10 @@ if (!defined('TYPO3_MODE')) { ...@@ -3,12 +3,10 @@ if (!defined('TYPO3_MODE')) {
die ('Access denied.'); die ('Access denied.');
} }
Tx_Extbase_Utility_Extension::configurePlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$_EXTKEY, 'SotaStudio.' . $_EXTKEY,
'Pi1', 'Pi1',
array( array(
'FlexSlider' => 'list', 'FlexSlider' => 'list',
) )
); );
\ No newline at end of file
?>
\ No newline at end of file
...@@ -4,11 +4,11 @@ if (!defined('TYPO3_MODE')) { ...@@ -4,11 +4,11 @@ if (!defined('TYPO3_MODE')) {
} }
// Build extension name vars - used for plugin registration, flexforms and similar // Build extension name vars - used for plugin registration, flexforms and similar
$extensionName = t3lib_div::underscoredToUpperCamelCase($_EXTKEY); $extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY);
$pluginSignature = strtolower($extensionName) . '_pi1'; $pluginSignature = strtolower($extensionName) . '_pi1';
Tx_Extbase_Utility_Extension::registerPlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY, 'SotaStudio.' . $_EXTKEY,
'Pi1', 'Pi1',
'FlexSlider' 'FlexSlider'
); );
...@@ -20,13 +20,13 @@ $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSi ...@@ -20,13 +20,13 @@ $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSi
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
// Add custom Flexform fields // Add custom Flexform fields
t3lib_extMgm::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform.xml'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform.xml');
// Add static TypoScript // Add static TypoScript
t3lib_extMgm::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'FlexSlider'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript', 'FlexSlider');
t3lib_extMgm::addLLrefForTCAdescr('tx_flexslider_domain_model_flexslider', 'EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_csh_tx_flexslider_domain_model_flexslider.xml'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_flexslider_domain_model_flexslider', 'EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_csh_tx_flexslider_domain_model_flexslider.xml');
t3lib_extMgm::allowTableOnStandardPages('tx_flexslider_domain_model_flexslider'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_flexslider_domain_model_flexslider');
$TCA['tx_flexslider_domain_model_flexslider'] = array( $TCA['tx_flexslider_domain_model_flexslider'] = array(
'ctrl' => array( 'ctrl' => array(
'title' => 'LLL:EXT:flexslider/Resources/Private/Language/locallang_db.xml:tx_flexslider_domain_model_flexslider', 'title' => 'LLL:EXT:flexslider/Resources/Private/Language/locallang_db.xml:tx_flexslider_domain_model_flexslider',
...@@ -48,15 +48,17 @@ $TCA['tx_flexslider_domain_model_flexslider'] = array( ...@@ -48,15 +48,17 @@ $TCA['tx_flexslider_domain_model_flexslider'] = array(
'starttime' => 'starttime', 'starttime' => 'starttime',
'endtime' => 'endtime', 'endtime' => 'endtime',
), ),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'Configuration/TCA/FlexSlider.php', 'dynamicConfigFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/FlexSlider.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'Resources/Public/Icons/tx_flexslider_domain_model_flexslider.gif' 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/tx_flexslider_domain_model_flexslider.gif'
), ),
); );
/** /**
* Add Plugin to New Content Element Wizard * Add Plugin to New Content Element Wizard
*/ */
/*
if (TYPO3_MODE === 'BE') { if (TYPO3_MODE === 'BE') {
// Add Plugin to CE Wizard // Add Plugin to CE Wizard
$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'][$pluginSignature . '_wizicon'] = t3lib_extMgm::extPath($_EXTKEY) . 'Resources/Private/Php/class.' . $_EXTKEY . '_wizicon.php'; $TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'][$pluginSignature . '_wizicon'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Resources/Private/Php/class.' . $_EXTKEY . '_wizicon.php';
} }
\ No newline at end of file */
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment