Skip to content

Instantly share code, notes, and snippets.

<?php
try {
$imageSize = getimagesize('resource://' . $this->resource->getResourcePointer()->getHash());
if ($imageSize === FALSE) {
throw new \TYPO3\Media\Exception('The given resource was not a valid image file');
}
$this->width = (integer)$imageSize[0];
$this->height = (integer)$imageSize[1];
$this->type = (integer)$imageSize[2];
@aertmann
aertmann / gist:2966975
Created June 21, 2012 16:52
JavaScript TYPO3 Exception
function TYPO3Exception(message, code) {
this.message = message;
this.code = code;
this.toString = function() {
return this.message + ' (#' + this.code + ')';
};
}
-
name: 'Activate'
uriPattern: '{@action}/{string}'
defaults:
'@package': 'ACME.Activation'
'@controller': 'Activation'
'@format': 'html'
-
name: 'default with action and format'
uriPattern: '{@controller}/{@action}(.{@format})'
defaults:
'@format': 'html'
'@package': 'YourPackage'
appendExceedingArguments: true
-
name: 'default'
<?php
require_once(t3lib_extMgm::extPath('realurl').'class.tx_realurl.php');
$GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], 0, 0);
tslib_eidtools::connectDB();
tslib_eidtools::initLanguage();
$GLOBALS['TSFE']->initFEuser();
$GLOBALS['TSFE']->set_no_cache();
$GLOBALS['TSFE']->checkAlternativeIdMethods();
$GLOBALS['TSFE']->determineId();
$GLOBALS['TSFE']->initTemplate();
/**
* Finds the nearest parent folder node of the provided node by looping recursively trough
* the node's parent nodes and checking if they are a sub content type of TYPO3.TYPO3CR:Folder
*
* @param \TYPO3\TYPO3CR\Domain\Model\NodeInterface $node
* @return \TYPO3\TYPO3CR\Domain\Model\NodeInterface|NULL
*/
protected function findNextParentFolderNode(\TYPO3\TYPO3CR\Domain\Model\NodeInterface $node) {
$folderTypes = $this->contentTypeManager->getSubContentTypes('TYPO3.TYPO3CR:Folder');
$check = function($node) use ($folderTypes) {
/**
* Finds the nearest parent folder node of the provided node by looping recursively trough
* the node's parent nodes and checking if they are a sub content type of TYPO3.TYPO3CR:Folder
*
* @param \TYPO3\TYPO3CR\Domain\Model\NodeInterface $node
* @return \TYPO3\TYPO3CR\Domain\Model\NodeInterface|NULL
*/
protected function findNextParentFolderNode(\TYPO3\TYPO3CR\Domain\Model\NodeInterface $node) {
$folderTypes = $this->contentTypeManager->getSubContentTypes('TYPO3.TYPO3CR:Folder');
while ($node) {
10 = USER
10 {
userFunc = tx_templavoila_pi1->tvSectionIndex
select {
pidInList = {$FooterPageUid}
}
table = tt_content
indexField = field_content
}
$this->isAllowedFile($f['particle_filter_document']['type'], $f['particle_filter_document']['size'], 'particle_filter_document',$f['registration_form_document']['name'])
/**
* Verify the filetype is valid according to the TCA definition
*
* @param string $fileMimeType
* @param string $fileSize
* @param string $fieldName
* @param string $name
*
@aertmann
aertmann / MainController.php
Created November 16, 2012 13:37
Pagination view helper
/**
* @var integer
*/
protected $usersPerPage = 12;
/**
* List action
*
* @param integer $page
* @return void