Skip to content

Instantly share code, notes, and snippets.

View daKmoR's full-sized avatar
❤️
Web Components & open-wc

Thomas Allmer daKmoR

❤️
Web Components & open-wc
View GitHub Profile
@daKmoR
daKmoR / Controller.php
Created March 4, 2011 01:15
implementing a demand overwrite in Extbase
<?php
/**
* Displays all Labors
*
* @param Tx_CdgLabors_Domain_Model_Demand $demand
* @param array $demandOverwrite
* @return string The rendered list view
*/
public function listAction(Tx_CdgLabors_Domain_Model_Demand $demand = NULL, array $demandOverwrite = NULL) {
if (count($demandOverwrite)> 0) {
@daKmoR
daKmoR / DateMenu.html
Created July 25, 2011 09:12
Datemenu for News2
<div class="news2 news2-datemenu">
<ul>
<f:groupedFor each="{news}" as="newsByYear" groupBy="yearOf{dateField}" groupKey="year">
<f:if condition="{settings.datemenu.year}">
<li class="{f:if(condition: '{year} == {overwriteDemand.year}', then: 'active year', else: 'year')}"><f:link.action pageUid="{listPid}" arguments="{overwriteDemand:{year: year}}">{year}</f:link.action>
<ul>
</f:if>
<f:groupedFor each="{newsByYear}" as="newsByMonth" groupBy="monthOf{dateField}" groupKey="month">
<f:if condition="{settings.datemenu.month}">
@daKmoR
daKmoR / Example.html
Created October 14, 2011 14:05
GroupedForDateTimeViewHelper for Fluid
<div class="itemsListYearMonth">
<a:groupedForDateTime each="{items}" as="itemsByYear" groupBy="start" format="Y" groupKey="year">
<a:groupedForDateTime each="{itemsByYear}" as="itemsByMonth" groupBy="start" format="m" dateTimeKey="month">
<div class="yearMonth clearfix">
<div class="timeframe" data-behavior="FixTimeframe">
{month -> f:format.date(format: 'F Y')}
</div>
<f:for each="{itemsByMonth}" as="item">
<div class="item">
<p class="startEnd"><a:format.duration start="{item.start}" end="{item.end}" /></p>
<?php
/**
* creates the actual text and sends it via e-mail
*
* @param $newForm
* @validate $newForm Tx_Xform_Domain_Validator_XformValidator
* @return void
*/
public function createAction(Tx_Xform_Domain_Model_Form $newForm) {
$view = t3lib_div::makeInstance('Tx_Fluid_View_StandaloneView');
@daKmoR
daKmoR / Box.html
Last active December 22, 2015 17:39
{namespace neos=TYPO3\Neos\ViewHelpers}
{namespace ts=TYPO3\TypoScript\ViewHelpers}
<neos:contentElement node="{node}">
<div class="box">
<ts:render path="columnContent" />
</div>
</neos:contentElement>
@daKmoR
daKmoR / Root.ts2
Created September 27, 2013 09:15
page = Page
page.head {
stylesheets = TYPO3.TypoScript:Template
stylesheets {
templatePath = 'resource://[...]/Private/Templates/Page/Default.html'
sectionName = 'stylesheets'
}
scripts = TYPO3.TypoScript:Template
@daKmoR
daKmoR / toNamespaces.sh
Last active December 21, 2020 18:37
Converts a TYPO3 CMS extension from using non-namespaced names to namespaced names (used since TYPO3 6.0) Usage: just copy the file inside your extension and call it from the shell ./toNamespaces.sh It replaces MOST of the non-namespaced calls... but it's by far not perfect, so pls handle with care and ALWAYS look what it changed before commitin…
#!/bin/bash
search=()
replace=()
# 0
search+=("'tx_cms_layout'")
replace+=("'TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutView'")
search+=("Facets_ChildNodeAccessInterface")
{namespace flux=Tx_Flux_ViewHelpers}
{namespace v=Tx_Vhs_ViewHelpers}
<f:section name="Configuration">
<flux:flexform id="one" label="OneColumn" icon="../typo3conf/ext/site_default/Resources/Public/Icons/Page/OneColumn.png">
<flux:flexform.field.checkbox name="settings.showHeaderSlideshow" label="Show Header Slideshow" default="1" />
<flux:flexform.field.input name="settings.headertext" label="Header Text" />
<flux:flexform.field.inline.fal name="settings.header" label="Header Image" />
<flux:flexform.grid>
@daKmoR
daKmoR / webcomponents-lite.min.js
Created January 5, 2017 20:48
v1 webcomponents-lite.min.js
!function(){window.WebComponents=window.WebComponents||{flags:{}};var a="webcomponents-lite.js",b=document.querySelector('script[src*="'+a+'"]'),c={};if(!c.noOpts){if(location.search.slice(1).split("&").forEach(function(a){var d,b=a.split("=");b[0]&&(d=b[0].match(/wc-(.+)/))&&(c[d[1]]=b[1]||!0)}),b)for(var e,d=0;e=b.attributes[d];d++)"src"!==e.name&&(c[e.name]=e.value||!0);if(c.log&&c.log.split){var f=c.log.split(",");c.log={},f.forEach(function(a){c.log[a]=!0})}else c.log={}}c.register&&(window.CustomElements=window.CustomElements||{flags:{}},window.CustomElements.flags.register=c.register),WebComponents.flags=c}(),function(a){"use strict";function f(a){return void 0!==d[a]}function g(){o.call(this),this._isInvalid=!0}function h(a){return""==a&&g.call(this),a.toLowerCase()}function i(a){var b=a.charCodeAt(0);return b>32&&b<127&&[34,35,60,62,63,96].indexOf(b)==-1?a:encodeURIComponent(a)}function j(a){var b=a.charCodeAt(0);return b>32&&b<127&&[34,35,60,62,96].indexOf(b)==-1?a:encodeURIComponent(a)}function n(a
@daKmoR
daKmoR / BaseElement.html
Created March 15, 2017 14:02
IE Edge will ignore inline style set variables e.g. style="--my-color: #ccc" will not overwrite any default value for my-color.
<link rel="import" href="../../../../bower_components/polymer/polymer.html">
<script>
class BaseElement extends Polymer.Element {
vhToPx(vh) {
if (vh.indexOf('vh') > 0) {
return document.documentElement.clientHeight * (parseInt(vh)/100) + '';
}