Sessions pre BE usera
Funkcia getSession() zapisuje alebo načítava BE session do dvoch členských premenných (status, limit) podľa toho, či bol v BE odoslaný formulár, v ktorom bol stlačený button tx_extname_submit (označený červenou). Ak bol formulár odoslaný, premenné sa nastavia z poľa $POST, ak nie tak z BE session.
class tx_extname_module1 extends t3lib_SCbase {
...
var $beuserKeyForm = 'tx_extname_module1::form';
/**
* Get BE user session data
*
* @return void
*/
function getSession() {
global $BE_USER;
$beuserSes = $BE_USER->getModuleData( $this->beuserKeyForm, 'ses' );
// Set/get BE user session
if( isset( $_POST['tx_extname_submit'] ) ) {
$beuserSes['status'] = $this->status;
$beuserSes['limit'] = $this->limit;
$BE_USER->pushModuleData( $this->beuserKeyForm, $beuserSes );
}
else {
$this->status = intval( $beuserSes['status'] );
$this->limit = intval( $beuserSes['limit'] );
}
}
...
}
Úryvok z formulára:
<form name="searchForm" action="index.php" method="post">
...
<input type="submit" name="tx_rtgcreator_submit" value="Hľadaj" />
</form>
| Ž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.