Skip to content

Instantly share code, notes, and snippets.

View InvisibleKind's full-sized avatar

Viktor Livakivskyi InvisibleKind

  • Leonberg, Germany
View GitHub Profile
@InvisibleKind
InvisibleKind / List.html
Created November 28, 2013 17:44
Correct "alt"-text for sys_file_reference images in Fluid
<f:image src="{category.imageThumbnail.uid}" alt="{category.imageThumbnail.originalResource.title}" maxWidth="150" maxHeight="100" treatIdAsReference="1" />
@InvisibleKind
InvisibleKind / MyController.php
Last active May 14, 2019 14:00
FAL handling in FlexForms
public function indexAction() {
/** @var \TYPO3\CMS\Core\Resource\ResourceFactory $resourceFactory */
$resourceFactory = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
$fileReference = $resourceFactory->getFileReferenceObject($this->settings['test']);
$fileArray = $fileReference->getProperties();
$this->view->assign('image', $fileArray);
}
@InvisibleKind
InvisibleKind / ContentController.php
Created December 11, 2013 18:52
Assign current cObject to Fluid
$this->view->assign('record', $this->configurationManager->getContentObject()->data);
@InvisibleKind
InvisibleKind / DataHandlerHooks.php
Last active December 16, 2016 16:08
ExtBase localization of child records
<?php
namespace Vendor\Product\Hooks;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Database\DatabaseConnection;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class DataHandlerHooks {
/**
@InvisibleKind
InvisibleKind / anonymizer.sql
Created January 15, 2014 10:39
TYPO3 email (username) anonymizer on dev system
UPDATE `fe_users` SET username = CONCAT(md5(rand()), '@example.com'), email = username
@InvisibleKind
InvisibleKind / remove_backup.sh
Created January 22, 2014 12:33
Remove backup files
find ./ -name '*~' | xargs rm
@InvisibleKind
InvisibleKind / locallang_changed.sh
Created January 24, 2014 15:46
Select only XLIFF and XML files, changed from last release
git diff --name-only HEAD v.1.1.0 | grep '.xlf\|.xml'
@InvisibleKind
InvisibleKind / child_update.sql
Created April 23, 2014 10:05
Update childs with value from parent field in TYPO3
update tx_smiproducts_domain_model_device as child
inner join tx_smiproducts_domain_model_device as parent
on child.l10n_parent=parent.uid
set child.starttime=parent.starttime
@InvisibleKind
InvisibleKind / regexp_ide_arrays
Last active August 29, 2015 14:08
Regexp for replacing array() with [] in #YOUR_IDE_NAME#
search: array\(([^\(\)]++)\)
replace with: [$1]
@InvisibleKind
InvisibleKind / composer.json
Created March 9, 2016 12:52
Custom zip-archive as composer package dependency
{
"type": "package",
"package": {
"name": "typo3-ter/fal_securedownload",
"type": "typo3-cms-extension",
"version": "1.0.0",
"dist": {
"url": "https://typo3.org/extensions/repository/download/fal_securedownload/1.0.0/zip/",
"type": "zip"