script

Wednesday, May 22, 2013

languages markers for extensions

$markerArray = array();
        $basePath = 'EXT:' . $this->extKey . '/' . dirname($this->scriptRelPath) . '/locallang.xml';
        $languageArray  = $this->LOCAL_LANG = t3lib_div::readLLfile($basePath,$this->LLkey,$GLOBALS['TSFE']->renderCharset);
               
       
        if($GLOBALS['TSFE']->sys_language_uid==0)
        {
            $key = 'default';
        }else
        {
            $res = $GLOBALS["TYPO3_DB"]->exec_SELECTquery("st.lg_iso_2","sys_language sl INNER JOIN static_languages st ON st.uid=sl.static_lang_isocode","sl.uid='".$GLOBALS['TSFE']->sys_language_uid."'");
            $row = $GLOBALS["TYPO3_DB"]->sql_fetch_assoc($res);
            $key = strtolower($row["lg_iso_2"]);
        }
       
       
       
        foreach($languageArray[$key] as $key=>$val)
        {
        $index = '###'.strtoupper($key).'###';
        $markerArray[$index] = $this->pi_getLL($key);
        }
       

Monday, May 20, 2013

Allow tags on RTE in TYPO3


# Allow embed (Youtube) HTML tags in the RTE
lib.parseFunc_RTE.allowTags := addToList(object,param,embed)

Monday, May 13, 2013

MVC in TYPO3

var $cObj;
var $records_per_page;
var $language;
   
function __construct()
{
        $this->cObj = t3lib_div::makeInstance('tslib_cObj');
        $this->records_per_page = 5;
        $this->language = $GLOBALS['TSFE']->sys_language_uid;
}    


function test()
{

$templateFile = $this->conf['templateFile'] ? $this->conf['templateFile'] : 'EXT:imagevideo/pi1/view/image.html';
$this->template = $this->cObj->fileResource($templateFile);
$subpart = $this->cObj->getSubpart($this->template, '###GET_IMAGE###');
$markerArray = array();



return $this->cObj->substituteMarkerArrayCached($subpart, $markerArray);
}