rtgx

Functions test

class tslib_pibase

Links:

$params = array( $this->prefixId.'[command]' => 'list' );
$this->piVars['level'] = 'first';
$this->pi_linkToPage( 'get to this page', $this->id );

<a href="cms_typo3/extensions/test_funkcii/index.html" >get to this page</a>

$this->pi_linkToPage( 'page link', $this->id, '', $params );

<a href="cms_typo3/extensions/test_funkcii/index.html?tx_rtgtest_pi1%5Bcommand%5D=list" >page link</a>

$this->pi_linkTP( 'page link', $params );

<a href="cms_typo3/extensions/test_funkcii/index.html?tx_rtgtest_pi1%5Bcommand%5D=list" >page link</a>

$this->pi_getPageLink( $this->id );

cms_typo3/extensions/test_funkcii/index.html

$this->pi_linkTP_keepPIvars( 'self page link' );

<a href="cms_typo3/extensions/test_funkcii/index.html?tx_rtgtest_pi1%5Blevel%5D=first" >self page link</a>

$this->pi_linkTP_keepPIvars_url( 'self page link' );

cms_typo3/extensions/test_funkcii/index.html?tx_rtgtest_pi1=self%20page%20link

$this->pi_list_linkSingle( 'self page link', '' );

<a href="cms_typo3/extensions/test_funkcii/index.html?tx_rtgtest_pi1%5Blevel%5D=first" >self page link</a>

$this->pi_openAtagHrefInJSwindow( <a href="index.php">new win</a>, 'popupWin', 'width=300, height=300, status=0, menubar=0, scrollbars=0, resizable=0' );

<a href="#" onclick="vHWin=window.open('https://rtg.magnetica.sk/index.php','popupWin','width=300, height=300, status=0, menubar=0, scrollbars=0, resizable=0');vHWin.focus();return false;">new win</a>

Output: new win

Class t3lib_div

t3lib_div::formatSize( 685213, ' | k| M| G' );

Output: 669 k

t3lib_div::csvValues( array('Meno','Priezvisko','Telefon','Email'), ';', '"' )

Output: "Meno";"Priezvisko";"Telefon";"Email"

Output: <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <record> <uid>1</uid> <pid>7</pid> <tstamp>1202549941</tstamp> <crdate>1195309464</crdate> <cruser_id>1</cruser_id> <sorting>256</sorting> <deleted>0</deleted> <hidden>0</hidden> <title>Typo3</title> <description></description> </record>

t3lib_div::getFilesInDir( 'fileadmin/rtg/img/', '', 0, '', '' )
Output: Array
(
    [6cb396b293736c6a3f858cb6cd4101b2] => valid-xhtml10-blue.png
    [770aab1deaea5711585f71beae29f283] => timeicontrans.gif
    [c91243c7eb15b0155b5b4e61976f07ff] => hmleftbg.gif
    [54965c6c0c4839f5ec674884ac482d0a] => arrow.gif
    [e25f482d000bfaf43fb335369446cf93] => arrowDoubleBlue.gif
    [e268eb2c6bf48d6f8555f931fc351b6f] => commentBlue.gif
    [619492ecaf33677e0a7e3555a58c4d37] => bg.gif
    [93d754b274e4772b2ec879a3a3e999ec] => image.gif
    [ff5a68f6971f6fb8adc61f6cda774fce] => hmleftbg2.gif
    [3e8df2a028f93fbdd959461e3f0b75f4] => headerbg.gif
    [b26801608bc1e4fa64d10fba831ef9e9] => question.gif
    [e04ee6d1d51d7fa1e8cf541194e44c53] => timeicon.gif
    [9bfdaeae9b813bca61abcd40737b2a95] => arrowDouble.gif
    [bdd15b0dbceabe23a073bc62f720c136] => corner.gif
    [0ef2965d0a4c6c1c16e0cd0f8a90d66a] => document.gif
    [de6b23ee6a1b8f01c4d528cf17dbcd01] => hmrightbg.gif
    [e37e979c0e1d352c3fc98c382975e62d] => logo.gif
    [18b82f734cc4bb2cfd2e0b262673e882] => comment.gif
)
t3lib_div::getAllFilesAndFoldersInPath(
	$filesList, 'fileadmin/rtg/user_upload/html/', 'js,mp3,jpg', 1, 4
)
Output: Array
(
)
Output: Array
(
    [0] => fileadmin/rtg/user_upload/html/
    [956b5e4940a4c92f61781568e85c061f] => fileadmin/rtg/user_upload/html/javascript_gallery.jpg
    [1d23acad4f4e1dfa3015d270e851397d] => fileadmin/rtg/user_upload/html/stopa_09.mp3
    [1] => fileadmin/rtg/user_upload/html/flvplayer/
    [c34feab9fc5e4bba545ebf87adc066f5] => fileadmin/rtg/user_upload/html/flvplayer/stopa_09.mp3
    [12982877f602a67352880afbd67623b4] => fileadmin/rtg/user_upload/html/flvplayer/swfobject.js
    [386d477f3720f15726e015772066bb4f] => fileadmin/rtg/user_upload/html/flvplayer/swfobject__robert.js
    [2] => fileadmin/rtg/user_upload/html/menu/
    [3] => fileadmin/rtg/user_upload/html/table/
    [4] => fileadmin/rtg/user_upload/html/table/js/
    [3392526c7f18d49c6b24ca6db99e251e] => fileadmin/rtg/user_upload/html/table/js/jquery-1.11.1.min.js
    [5] => fileadmin/rtg/user_upload/html/tooltip/
    [4f9c0396eee623b984d3ea1bf2719f8b] => fileadmin/rtg/user_upload/html/tooltip/prototype.js
    [b5b35d6e9651d9d565e8ab2a91442694] => fileadmin/rtg/user_upload/html/tooltip/tooltip-v0.js
)

Database, queries:

pi_getRecord( $table, $uid, $checkPage=0 )

$this->pi_getRecord( 'tx_rtgfiles_systems', 1, 0 );
Output:
Array ( [uid] => 1 [pid] => 7 [tstamp] => 1202549941 [crdate] => 1195309464 [cruser_id] => 1 [sorting] => 256 [deleted] => 0 [hidden] => 0 [title] => Typo3 [description] => )

pi_getPidList( $pid_list, $recursive = 0 )

Parameters:
string $pid_list is a comma list of page ids (if empty current page is used)
integer $recursive is an integer >=0 telling how deep to dig for pids under each entry in $pid_list
Returns:
string List of PID values (comma separated)

$this->pi_getPidList( 1, 1 );

4,45,43,3,107,14,2,125,263,365,268,10,1

pi_prependFieldsWithTable( $table, $fieldList )

$this->pi_prependFieldsWithTable( 'tt_content', 'uid,header' );

Output: tt_content.uid,tt_content.header

Extensions

geshilib

GeSHi Documentation >>

require_once( t3lib_extMgm::siteRelPath( 'geshilib' ).'res/geshi.php' );
$geshi = new Geshi( $code, 'php', '' );
$geshi->enable_line_numbers( GESHI_NORMAL_LINE_NUMBERS, 1 );
$result = $geshi->parse_code();
			

Output:

  1.  
  2. /**
  3.  * List of files from DB
  4.  *
  5.  * @return array return: array of files records
  6.  */
  7. function getFiles() {
  8.  
  9. if( !$this->error ) {
  10. $whereAnd .= '
  11. AND ( tx_rtgfiles_files.title LIKE '%'.$this->valueWord.'%'
  12. OR tx_rtgfiles_files.description LIKE '%'.$this->valueWord.'%'
  13. OR tx_rtgfiles_files.keywords LIKE '%'.$this->valueWord.'%' )
  14. ';
  15. }
  16. }
  17.  

flvplayer2

$confFlvPlayer = array(
	'includeLibs' => 'EXT:flvplayer2/pi1/class.tx_flvplayer2_pi1.php',
	'userFunc' => 'tx_flvplayer2_pi1->main',
	'url' => '',
	'file' => 'ako_to_nepojde.flv',
	'image' => '',
	'splashImageMode' => '',
	'useFlowPlayer' => '0',
	'playerParams.' => array(
		'autoStart' => '1',
		'fullScreen' => '1',
		'controlbar' => 'bottom',
	),
	'width' => '600',
	'height' => '450',
	'version' => '8',
	'base' => '',
);
$video = $this->cObj->cObjGetSingle( 'USER_INT', $confFlvPlayer, 'flvplayer2' );

Output:

 

Note:
Pre potrebu prehrávať FLV video z iného adresára ako 'uploads/tx_flvplayer/'
je potrebné upraviť EXT flvplayer2 (class pi1):

// Upload directory
var $uploadDir = 'uploads/tx_flvplayer/';
 
Žiadne dokumenty ani odkazy k tejto stránke.

Generátor typoscriptu

Vytvára typoscript pre bežné použitie. Generátor je jednoduchý na obsluhu, stačí vyplniť zopár položiek formulára.

Odkazy