Skip to content

Instantly share code, notes, and snippets.

View ursbraem's full-sized avatar
💭
🐧

Urs Braem ursbraem

💭
🐧
View GitHub Profile
@ursbraem
ursbraem / FilesizeViewHelper.php
Created March 19, 2014 16:30
Viewhelper for showing the size of a file in TYPO3 fluid
<?php
/* *
* This script belongs to the FLOW3 package "Fluid". *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation, either version 3 of the License, or (at your *
* option) any later version. *
* *
* This script is distributed in the hope that it will be useful, but *
#!/bin/sh
hosts="user@server.com user@server2.com"
name="typo3_src-6.2.12"
oldname="typo3_src-6.2.11"
url="http://www.mystorage.com/temp/"$name".tar.gz"
for h in $hosts ; do
echo $h
@ursbraem
ursbraem / gist:f6b573724c9dad9724a0
Last active February 16, 2016 18:24
Tsconfig-all
options {
// enable upload fields in Element Browser
uploadFieldsInTopOfEB = 1
createFoldersInEB =1
//Add save-and-new to all forms
saveDocNew = 1
// better Page tree
pageTree {
showNavTitle = 1
showPageIdWithTitle = 1
namespace My\Site\Userfunc;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
{namespace n=Tx_News_ViewHelpers}
{namespace stubr=STUBR\Customvhs\ViewHelpers}
<time class="event-date" datetime="<n:format.date format="{f:translate(key:'dateTimeFormatMachine')}">{newsItem.datetime}</n:format.date>">
<f:if condition="{settings.forcelocale}==true">
<stubr:switchlocale new="de_CH.UTF-8" />
</f:if>
<n:format.date format="{f:translate(key:'dateTimeFormatHumanWeekday')}">{newsItem.datetime}</n:format.date>
<f:if condition="{settings.forcelocale}==true">
<stubr:switchlocale new="fr_CH.UTF-8" />
</f:if>
'.html':
'Perch Template Comment':
'prefix': 'cmm'
'body': '<!--* $1 *-->'
Uncaught TYPO3 Exception
#1297759968: Exception while property mapping at property path "":It is not allowed to map property "answers". You need to use $propertyMappingConfiguration->allowProperties('answers') to enable mapping of this property. (More information)
TYPO3\CMS\Extbase\Property\Exception thrown in file
/home/username/typo3_src-6.2.26/typo3/sysext/extbase/Classes/Property/PropertyMapper.php in line 112.
16 TYPO3\CMS\Extbase\Property\PropertyMapper::convert(array, "In2code\Powermail\Domain\Model\Mail", TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration)
/home/username/typo3_src-6.2.26/typo3/sysext/extbase/Classes/Mvc/Controller/Argument.php:
00376: }
@ursbraem
ursbraem / layouts-adminlogin.php
Last active September 5, 2016 16:02
Static file caching for expensive perch queries
<?php
// layout to prepend to restricted pages
$Users = new PerchUsers;
$CurrentUser = $Users->get_current_user();
if (!(is_object($CurrentUser) && $CurrentUser->logged_in())) {
// user is not logged in to Perch
exit('Please log in first.');
}
<?php
namespace STUBR\Template\Resource;
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
@ursbraem
ursbraem / AdditionalConfiguration.php
Last active March 14, 2018 20:29 — forked from jrenggli/AdditionalConfiguration.php
pageNotFound_handling for restricted pages in TYPO3
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'] = 'USER_FUNCTION:EXT:usermytemplate/Classes/Utility/PageNotFoundHandling.php:user_pageNotFound->pageNotFound';
// Custom configuration for multi-language 404 page, see EXT:usermytemplate/Classes/Utility/PageNotFoundHandling.php
// ID of the page to redirect to if page was not found
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling_redirectPageID'] = 123;
// ID of the page to redirect to if current page is access protected
$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling_loginPageID'] = 789;