Commit 0dedd161 authored by Andy Hausmann's avatar Andy Hausmann

Increased code quality.

parent a4f2f3d9
### 1.4.6
* __Bugfix__: Restored compatibility to TYPO3 CMS 4.5.x.
* __Improvement__: Increased code quality.
### 1.4.5
* __Improvement__: Improved alternative id generation in case FlexSlider is being generated via TypoScript.
* __Bugfix__: Fixed #30 (github): Var altUid is now being passed correctly along all template files.
### 1.4.4
* __Bugfix__: Fixed a small bug regarding subtitle expansion by rte.
......@@ -15,33 +24,39 @@
### 1.4.2
* __Misc__: Fixed broken links in Extension documentation.
### 1.4.1
* __Improvement__: JS can now be injected inline via Page Renderer as well which enables the Extension to put in the Footer and Header if wished so.
### 1.4.0
* __Improvement__: CSS & JS is now being rendered through the Page Renderer which enables the Extensions Resources to be concatenated and compressed.
### 1.3.4
* __Hotfix__: Fixed ViewHelper for link building - multiple dynamic links per page faled to render. Thanks to Simon Rauterberg for reporting this.
### 1.3.3
* __Hotfix__: Fixed ViewHelper for link building - caused errors in Environments with reporting turned on.
### 1.3.2
* __Hotfix__: Switched type of field "subtitle" to text.
### 1.3.1
* __Hotfix__: Fixed an incompatibility to TYPO3 4.5 LTS within the DynLink ViewHelper.
### 1.3.0
* __Feature__: Implemented new LinkViewHelper - external URLs are now working.
......@@ -54,17 +69,20 @@
* __Misc__: Extended Fluid Template.
* __Misc__: Updated README in EXT root.
### 1.2.2
* __Bugfix__: Fixed a bug regarding backward compatibility to TYPO3 4.5.x.
* __Misc__: Improved performance.
### 1.2.1
* __Bugfix/Feature__: Running multiple FlexSliders per Page now possible.
* __Misc__: Improved performance.
* __Misc__: Updated README in EXT root.
### 1.2.0
* Initial Release
......
......@@ -61,8 +61,7 @@ class Tx_Flexslider_Controller_FlexSliderController extends Tx_Extbase_MVC_Contr
*
* @return void
*/
public function initializeAction()
{
public function initializeAction() {
$this->contentObject = $this->configurationManager->getContentObject();
// Fallback to current pid if no storagePid is defined
......@@ -90,5 +89,4 @@ class Tx_Flexslider_Controller_FlexSliderController extends Tx_Extbase_MVC_Contr
$this->view->assignMultiple($tplObj);
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -190,5 +190,4 @@ class Tx_Flexslider_Domain_Model_FlexSlider extends Tx_Extbase_DomainObject_Abst
$this->caption = $caption;
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -42,5 +42,4 @@ class Tx_Flexslider_Domain_Repository_FlexSliderRepository extends Tx_Extbase_Pe
'sorting' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING
);
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -31,16 +31,14 @@
* @package flexslider
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/
class Tx_Flexslider_Utility_Debug
{
class Tx_Flexslider_Utility_Debug {
/**
* Helper function for debuggin purposes.
*
* @param mixed $v Var to debug
*/
public static function debug($v)
{
public static function debug($v) {
t3lib_utility_Debug::debug($v);
}
......@@ -50,8 +48,7 @@ class Tx_Flexslider_Utility_Debug
* @param object $obj Object to analyze
* @return string Class name
*/
public static function getClassName($obj)
{
public static function getClassName($obj) {
return get_class($obj);
}
......@@ -61,8 +58,7 @@ class Tx_Flexslider_Utility_Debug
* @param object $obj Object to analyze
* @return array List of class methods
*/
public static function getClassMethods($obj)
{
public static function getClassMethods($obj) {
return get_class_methods($obj);
}
......@@ -72,8 +68,7 @@ class Tx_Flexslider_Utility_Debug
* @param object $obj Object to analyze
* @return array List of vlass properties
*/
public static function getClassVars($obj)
{
public static function getClassVars($obj) {
return get_object_vars($obj);
}
......
......@@ -33,8 +33,7 @@
* @package flexslider
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/
class Tx_Flexslider_Utility_Div
{
class Tx_Flexslider_Utility_Div {
/**
* Better implementation of php's array_combine().
......@@ -46,7 +45,7 @@ class Tx_Flexslider_Utility_Div
* @param bool $pad Switch for allowing padding. Fills the combined array with empty values if any array is larger than the other one.
* @return array Combined array.
*/
public static function combineArray($a, $b, $pad = true) {
public static function combineArray($a, $b, $pad = TRUE) {
$acount = count($a);
$bcount = count($b);
// more elements in $a than $b but we don't want to pad either
......@@ -62,7 +61,7 @@ class Tx_Flexslider_Utility_Div
// Add empty strings to ensure arrays $a and $b have same number of elements
$more = $acount - $bcount;
for($i = 0; $i < $more; $i++) {
$b[] = "";
$b[] = '';
}
// more fields than headers
} else if ($acount < $bcount) {
......@@ -85,8 +84,7 @@ class Tx_Flexslider_Utility_Div
* @param string $file File get a reference from - can contain EXT:ext_name
* @return mixed
*/
public static function getFileResource($file)
{
public static function getFileResource($file) {
return $GLOBALS['TSFE']->tmpl->getFileName($file);
}
......@@ -96,8 +94,7 @@ class Tx_Flexslider_Utility_Div
* @param string $file File reference
* @param bool $moveToFooter Flag to include file into footer - doesn't work for CSS files
*/
public static function addCssJsFile($file, $moveToFooter = FALSE)
{
public static function addCssJsFile($file, $moveToFooter = FALSE) {
// Get file extension (after last occurance of a dot)
$mediaTypeSplit = strrchr($file, '.');
// Get file reference
......@@ -124,8 +121,7 @@ class Tx_Flexslider_Utility_Div
* @param string $addUnique Unique key to avoid multiple inclusions
* @param bool $moveToFooter Flag to include file into footer - doesn't work for CSS files
*/
public static function addJsInline($code, $name, $moveToFooter = false)
{
public static function addJsInline($code, $name, $moveToFooter = FALSE) {
if ($code) {
//$code = '<script type="text/javascript">'.$code.'</script>';
......@@ -144,8 +140,8 @@ class Tx_Flexslider_Utility_Div
* @return mixed
*/
public static function renderFlashMessage($title, $message, $type = t3lib_FlashMessage::WARNING) {
$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-header{padding: 10px 10px 0 30px;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()->addCssInlineBlock('flashmessage',$code);
......
......@@ -31,8 +31,7 @@
* @package flexslider
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/
class Tx_Flexslider_Utility_EmConfiguration
{
class Tx_Flexslider_Utility_EmConfiguration {
/**
* Extension key to get the EM Config from.
......@@ -49,8 +48,7 @@ class Tx_Flexslider_Utility_EmConfiguration
* @static
* @return string The Extension key.
*/
protected static function getExtKey()
{
protected static function getExtKey() {
return self::$extKey;
}
......@@ -60,8 +58,7 @@ class Tx_Flexslider_Utility_EmConfiguration
* @static
* @param string $extKey The Extension key.
*/
protected static function setExtKey($extKey)
{
protected static function setExtKey($extKey) {
self::$extKey = $extKey;
}
......@@ -71,8 +68,7 @@ class Tx_Flexslider_Utility_EmConfiguration
* @static
* @param string $extKey Lower-cased key of the extension to get the EM Config from.
*/
protected static function overrideExtKey($extKey)
{
protected static function overrideExtKey($extKey) {
$extKey = (string) trim($extKey);
if (strlen($extKey)) {
self::setExtKey($extKey);
......@@ -86,8 +82,7 @@ class Tx_Flexslider_Utility_EmConfiguration
* @param string $extensionKey The Extension key.
* @return array The Extension Configuration.
*/
public static function getConfiguration($extensionKey = '')
{
public static function getConfiguration($extensionKey = '') {
self::overrideExtKey($extensionKey);
return self::parseConfiguration();
}
......@@ -97,8 +92,7 @@ class Tx_Flexslider_Utility_EmConfiguration
*
* @return array unserialized extconf settings
*/
protected static function parseConfiguration()
{
protected static function parseConfiguration() {
$settings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::getExtKey()]);
if (!is_array($settings)) {
$settings = array();
......
......@@ -53,8 +53,7 @@ class Tx_Flexslider_ViewHelpers_AddCssJsViewHelper extends Tx_Fluid_Core_ViewHel
* @return void Flag to include file into footer - doesn't work for CSS files
*/
public function render($file = NULL, $moveToFooter = FALSE)
{
public function render($file = NULL, $moveToFooter = FALSE) {
if ($file) {
Tx_Flexslider_Utility_Div::addCssJsFile(
$file,
......@@ -62,5 +61,4 @@ class Tx_Flexslider_ViewHelpers_AddCssJsViewHelper extends Tx_Fluid_Core_ViewHel
);
}
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -40,8 +40,7 @@
* @package flexslider
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/
class Tx_Flexslider_ViewHelpers_AddJQueryViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractTagBasedViewHelper
{
class Tx_Flexslider_ViewHelpers_AddJQueryViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractTagBasedViewHelper {
/**
* Adds T3Jquery as Lib
......@@ -59,7 +58,7 @@ class Tx_Flexslider_ViewHelpers_AddJQueryViewHelper extends Tx_Fluid_Core_ViewHe
require_once(t3lib_extMgm::extPath('t3jquery').'class.tx_t3jquery.php');
}
// if t3jquery is loaded and the custom Library had been created
if (T3JQUERY === true) {
if (T3JQUERY === TRUE) {
tx_t3jquery::addJqJS();
} else {
......@@ -77,5 +76,4 @@ class Tx_Flexslider_ViewHelpers_AddJQueryViewHelper extends Tx_Fluid_Core_ViewHe
}
}
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -48,14 +48,13 @@ class Tx_Flexslider_ViewHelpers_AddJsInlineViewHelper extends Tx_Fluid_Core_View
/**
* Adds JS and CSS to the frontend
*
* @param null $code The JS code
* @param string $code The JS code
* @param bool $moveToFooter Move the the ending body tag?
* @param null $uniqueLabel Unique label in order to avoid multiple code blocks of the same code.
* @param string $uniqueLabel Unique label in order to avoid multiple code blocks of the same code.
* @return void
*/
public function render($code = null, $name = '', $moveToFooter = false)
{
public function render($code = NULL, $name = '', $moveToFooter = FALSE) {
if ($code) {
Tx_Flexslider_Utility_Div::addJsInline(
$code,
......@@ -64,5 +63,5 @@ class Tx_Flexslider_ViewHelpers_AddJsInlineViewHelper extends Tx_Fluid_Core_View
);
}
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -34,8 +34,7 @@
* @package flexslider
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/
class Tx_Flexslider_ViewHelpers_DynLinkViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractTagBasedViewHelper
{
class Tx_Flexslider_ViewHelpers_DynLinkViewHelper extends Tx_Fluid_Core_ViewHelper_AbstractTagBasedViewHelper {
/**
* @var string
......@@ -53,8 +52,7 @@ class Tx_Flexslider_ViewHelpers_DynLinkViewHelper extends Tx_Fluid_Core_ViewHelp
*
* @return void
*/
public function initializeArguments()
{
public function initializeArguments() {
$this->registerUniversalTagAttributes();
$this->registerArgument('arguments', 'array', 'Given arguments by Fluid call as an array.');
$this->registerArgument('href', 'string', 'Link href.');
......@@ -80,13 +78,12 @@ class Tx_Flexslider_ViewHelpers_DynLinkViewHelper extends Tx_Fluid_Core_ViewHelp
* Checks and processes the given link parameters.
*
* @param string $link Output from TYPO3 link wizard.
* @return bool Returns true if it is possible to build a link.
* @return bool Returns TRUE if it is possible to build a link.
*/
protected function processLinkParams($link)
{
protected function processLinkParams($link) {
$paramDataArr = explode(' ', $link);
// Combine labels and values into one array
$paramDataArr = Tx_Flexslider_Utility_Div::combineArray($this->paramLabels, $paramDataArr, false);
$paramDataArr = Tx_Flexslider_Utility_Div::combineArray($this->paramLabels, $paramDataArr, FALSE);
if (isset($paramDataArr['href']) && !empty($paramDataArr['href'])) {
// Save link data into ViewHelper arguments
......@@ -95,14 +92,14 @@ class Tx_Flexslider_ViewHelpers_DynLinkViewHelper extends Tx_Fluid_Core_ViewHelp
$cObj = t3lib_div::makeInstance('tslib_cObj');
$configuration = array(
'parameter' => $this->arguments['href'],
'returnLast' => true
'returnLast' => TRUE
);
$href = $cObj->typolink('', $configuration);
$this->arguments['href'] = $href;
return true;
return TRUE;
} else {
return false;
return FALSE;
}
}
......@@ -111,8 +108,7 @@ class Tx_Flexslider_ViewHelpers_DynLinkViewHelper extends Tx_Fluid_Core_ViewHelp
*
* @return void
*/
protected function addTagAttributes()
{
protected function addTagAttributes() {
foreach ($this->paramLabels as $label) {
if (isset($this->arguments[$label])
&& !empty($this->arguments[$label]))
......@@ -127,8 +123,7 @@ class Tx_Flexslider_ViewHelpers_DynLinkViewHelper extends Tx_Fluid_Core_ViewHelp
*
* @return mixed|void
*/
public function render()
{
public function render() {
if ($this->processLinkParams($this->arguments['arguments']['link'])) {
$this->tag->setContent($this->renderChildren());
$this->addTagAttributes();
......@@ -137,5 +132,5 @@ class Tx_Flexslider_ViewHelpers_DynLinkViewHelper extends Tx_Fluid_Core_ViewHelp
return $this->renderChildren();
}
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -31,16 +31,14 @@
* @package flexslider
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
*/
class flexslider_pi1_wizicon
{
class flexslider_pi1_wizicon {
protected $extKey = '';
protected $plugin = '';
protected $pluginSignature = '';
public function __construct()
{
public function __construct() {
$this->extKey = 'flexslider';
$this->plugin = 'pi1';
$this->pluginSignature = strtolower($this->extKey . '_' . $this->plugin);
......@@ -53,8 +51,7 @@ class flexslider_pi1_wizicon
* @param array $wizardItems: The wizard items
* @return array Modified array with wizard items
*/
public function proc($wizardItems)
{
public function proc($wizardItems) {
$locallang = $this->includeLocalLang();
$wizardItems['plugins_tx_' . $this->extKey] = array(
......@@ -73,8 +70,7 @@ class flexslider_pi1_wizicon
*
* @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';
$l10n = t3lib_div::makeInstance('language');
......@@ -92,5 +88,4 @@ class flexslider_pi1_wizicon
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/flexslider/Resources/Private/Php/class.flexslider_wizicon.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/flexslider/Resources/Private/Php/class.flexslider_wizicon.php']);
}
?>
\ No newline at end of file
}
\ No newline at end of file
<?php
$extensionClassesPath = t3lib_extMgm::extPath('flexslider') . 'Classes/';
return array(
'tx_flexslider_utility_emconfiguration' => $extensionClassesPath . 'Utility/EmConfiguration.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