Archive for the ‘ GENERAL ’ Category

TYPO3 6 and earlier version – Custom TCA for different TYPO3 versions

Related to the this post, where I had solved a problem with TCA and the t3editor, there appears another problem.
The t3editor in my extension works now fine with TYPO3 6 – but TYPO3 4.x we have destroyed the functionality.

But with a small ‘TCA hack’ we are able to fix it. Just append the next PHP code after the TCA, that uses the t3editor, like this:

if(isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version'])) {
  if((float)$GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version']<6) {
      $TCA['tx_ftm_domain_model_templatemarker']['columns']['marker_typo_script']['config']['wizards']['t3editorTypoScript']['userFunc'] = 
        'EXT:t3editor/classes/class.tx_t3editor_tceforms_wizard.php:tx_t3editor_tceforms_wizard->main';
  }
}

In the first line we make sure that the variable of the compat version is defined. After that we check if the TYPO3 version is lower that TYPO3 6. If it so, we overwrite the TCA field, where the userFunc is defined and makes the classes-c lowercase.

If you have some optimizations or tipps, feel free to comment this post 🙂

TYPO3 6 – How to uninstall an extension manually

Often it happens, that you install a new extension into your TYPO3 6, but the extension isn’t already compatible with this new TYPO3 version.
In worst case your TYPO3 throws an 500 internal server error on each request – and now?

No problem, just uninstall the extension manually by the next few steps (in these case the gridelements v1.4.0):

1. Open the LocalConfiguration.php file which is located in the typo3conf directory. Here you have to remove the following entries:

	'EXT' => array(
		'extConf' => array(
			... -> this gridelements entry
			'gridelements' => 'a:1:{s:20:"additionalStylesheet";s:0:"";}',
			... <- end
	'EXT' => array(
		'extListArray' => array(
			... -> and this second gridelements entry
			'gridelements',
			... <- end

2. In the next step we have to clear the cached configuration files. In order to do this in TYPO3 6 you just can delete the Cache directory, that is located in the typo3temp directory.
3. Finally you’re able to remove the extension as usual by using the extensionmanager.

TYPO3 6 with integrated t3editor in own extbase extension

In a current project of mine, the Fluid Template Manager, I use the t3editor in the developed backend module. Thanks of the great post of the typo3blogger I was able to integrate them easily in TYPO3 4.7.x.
But while preparing our ftm Extension for TYPO3 6.1 there happens a small error.
The page with the t3editor isn’t loading, because there happens a 500 internal server error.

The solution is easy.
By the conventions of the TYPO3-Extension folder structure, the folder classes must be written uppercase first. The corrected TCA-Snippet looks now like that:

'template_code' => array(
    'exclude' => 0,
    'label' => 'LLL:EXT:ftm/Resources/Private/Language/locallang_db.xml:tx_ftm_domain_model_templatefluid.template_code',
    'config' => array(
        'type' => 'text',
        'cols' => 112,
        'rows' => 36,
        'eval' => 'trim',
        'wizards' => array(
            't3editorHtml' => array(
                'enableByTypeConfig' => 1,
                'type' => 'userFunc',
                'userFunc' => 'EXT:t3editor/Classes/class.tx_t3editor_tceforms_wizard.php:tx_t3editor_tceforms_wizard->main',
                'params' => array(
                    'format' => 'html',
                ),
            ),
        ),
    ),
),

By the way, i found out that the cols and rows entries now worked as they should. 🙂

Note: Related to this problem there is another post here, that deals with the integration in different TYPO3 versions.

(Deutsch) Die verwendeted Typo3 Storage-ID in einer ExtBase Controller-Action verwenden

Sorry, this entry is only available in Deutsch.

My favorite 500 Internal Server Error Page ;)

That’s my favorite 500 Internal Server Error Page 😉

After starting Audacious the Player is not visible

Since some time, always when i started the Audacious-Player under Ubuntu, the Player isn’t visible 🙁
The music plays, but no Player is shown..
 
After a little research i found a shell-action to get the Player back:

audtool --mainwin-show on

 
If you still see no Audacious-Player, you can try to press ‘Alt’+’M’ to toggle the main window.
 
Now, i’m happy to have my Player back.. But something with my color-Theme went wrong. The complete Player is dyed red.
But a solution for this problem is also find quickly.
Open the preferences and navigate to the Appearance-Tab. In there you will find color preferences. I put each color to be at its maximum.


 
Hope this helps some guys! 😉

Change line-height in OpenLaszlo Flash/SWF10 Runtime

When you’re using OpenLaszlo by compiling to flash/swf10 Flash, the lineheight attribute within the text class is readonly. That’s sometimes problematic, if you getting strict specifications from your designer for create a website or GUI (graphic user interface). The designer wants that you do implement all the typographic specification that he gives you, pixel by pixel.

For this case, i’ve searched for a workaround to change the lineheight within text fields.
The result is the following class:

<?xml version="1.0" encoding="UTF-8" ?>
<library>
	<class name="lineHeightText" extends="text" multiline="true">
		
		<switch>
			<unless property="$as3">
				<method name="setLineHeight" args="newLineHeight:Number =0">
				<![CDATA[
					Debug.error("setLineHeight is not supported");
				]]>
				</method>				
			</unless>
		    <otherwise>
				<passthrough>
					import flash.text.*;
				</passthrough>
				
				<method name="setLineHeight" args="newLineHeight:Number =0, refreshHeight:Boolean =true">
				<![CDATA[
				
					// get an reference of this text
					var test = this.getDisplayObject();
					
					// set new line-height
					var format:TextFormat = new TextFormat();
					format.leading = newLineHeight-test.lineheight;
					
					// set line-height in the sprites
					test.lineheight = newLineHeight;
										
					// make this textfield bigger
					if(refreshHeight) this.setAttribute("height", newLineHeight*test.textfield.numLines);
					
					// set the new format
					test.textfield.setTextFormat(format);					
					test.textfield.defaultTextFormat = format;
								
				]]>
				</method>
				
			</otherwise>
		</switch>
		
	</class>
</library>

The usage is very simple:

<?xml version="1.0" encoding="UTF-8" ?>
<canvas name="lineHeight" width="100%" height="100%">
		
	<include href="./lineHeightText.lzx" />
	
	<lineHeightText fontsize="11" fgcolor="#000000" bgcolor="#abcdef" x="10" y="10" name="textarea1" width="200" selectable="true">
		[start]Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.[end]
	</lineHeightText>
	
	<lineHeightText fontsize="11" fgcolor="#000000" bgcolor="#abcdef" x="220" y="10" name="textarea2" width="200" selectable="true">
		<handler name="oninit">
		<![CDATA[
			this.setLineHeight(20);
		]]>
		</handler>
		[start]Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.[end]
	</lineHeightText>	

</canvas>

I hope this can help somebody.
If you find some errors, or have some questions or tips, write me.. 😉

Sourcecode: OpenLaszlo - LineHeight.zip (907)

ISCOPE in the OpenLaszlo Showcase

I’m very happy that our company ISCOPE GmbH now also is list in the OpenLaszlo Showcase 🙂
Check it out!

That’s it…

I say hello world! 😉

My first own blog entry, and henceforth i will torture you all with my small fantasy english 😀