Skip to content

Instantly share code, notes, and snippets.

View wdebusschere's full-sized avatar
💭
Laravel / Kirby CMS

Wannes Debusschere wdebusschere

💭
Laravel / Kirby CMS
View GitHub Profile
<!-- Test -->
@wdebusschere
wdebusschere / event.event1.php
Last active October 31, 2018 13:08
Custom event for multiple events
<?php
class eventevent1 extends SectionEvent
{
public $ROOTELEMENT = 'event1';
public $eParamFILTERS = array(
);
public function priority(){
@wdebusschere
wdebusschere / copyfield.html
Last active October 31, 2018 12:04
When you need to copy the value of a field in another field
<!--
Usecase example: You have a section and you want to replace a textbox field with a number field.
1. Create a datasource which loads the section and the oldfield
2. Add the datasource to a page with this html
3. Create an event with allow multiple
Tip: you can use paging 500 records {$url-page} in your datasource and ?page=1 in your url.
-->
<form method="post" action="{$current-url}/?debug" enctype="multipart/form-data">
<input name="MAX_FILE_SIZE" type="hidden" value="5242880000" />
@wdebusschere
wdebusschere / data.ds1.php
Created October 31, 2018 12:07
Dynamic url parameters in a datasource
<!--
Usecase example: You want to unset the price filter if the $url-price is 0
-->
<?php
class datasourceds1 extends SectionDatasource
{
public $dsParamROOTELEMENT = 'ds1';
public $dsParamORDER = '{$url-order:desc}';
public $dsParamPAGINATERESULTS = 'yes';
public $dsParamLIMIT = '20';
@wdebusschere
wdebusschere / data.dscustom.php
Created October 31, 2018 14:43
Custom datasource with symql
<!--
Usecase example:
-->
public function allowEditorToParse()
{
return false;
}
public function execute(array &$param_pool = null)
@wdebusschere
wdebusschere / data.dsRoles.php
Last active November 19, 2018 16:32
Custom datasource Member roles
<?php
class datasourcedsRoles extends SectionDatasource
{
public $dsParamROOTELEMENT = 'dsRoles';
public $dsParamCACHE = -1;
public $dsParamFILTERS = array(

html

<label class="uk-hidden">Leave this field empty:</label>
<input class="uk-hidden" type="text" name="phoneNumber6tY4bPYk" autocomplete="off" />```


# css

.uk-hidden {

in the config.php add to the log settings the following line 'filter' => 24575,
1. extension.meta.xml
<release version="2.1.3" date="2018-10-01" min="2.4" max="2.x.x">
<?php
Class contentExtensionReferencelinkAutocomplete extends AjaxPage{
public function handleFailedAuthorisation(){
$this->_status = self::STATUS_UNAUTHORISED;
$this->_Result = json_encode(array('status' => __('You are not authorised to access this page.')));
}
public function view(){