<?php
/**
* Field to render a checkbox as a switch with left and right option text.
*/
class SwitchField extends CompositeField {
public function __construct($checkboxField, $leftOption, $rightOption) {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var that = this; | |
var closeHandler = function(event){ | |
if (!$(event.target).closest(that).length) { | |
that.tabs('option', 'active', false); | |
var frame = $('.cms').find('iframe'); | |
frame.each(function(index, iframe){ | |
$(iframe).contents().off('click', closeHandler); | |
}); | |
$(document).off('click', closeHandler); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fields->removeByName("Tags"); | |
$taxonomyMap = TaxonomyTerm::get()->map("ID", "Name")->toArray(); | |
asort($taxonomyMap); | |
$taxonomy = ListboxField::create('Terms', singleton('TaxonomyTerm')->i18n_plural_name()) | |
->setMultiple(true) | |
->setSource($taxonomyMap) | |
->setAttribute( | |
'data-placeholder', | |
_t('Member.Tags', 'Tags', 'Placeholder text for a dropdown')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.tree-view { | |
.icon:before{ | |
display:none; | |
} | |
&.list-tree.has-collapsable-children .list-nested-item { | |
> .list-item:before{ | |
content: "\f05b"; | |
} | |
&.collapsed > .list-item:before{ | |
content: "\f05a"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function setManyManyRelation($relationFieldList){ | |
if(!$relationFieldList){ | |
return false; | |
} | |
foreach($relationFieldList as $relation){ | |
$this->ManyManyRelation()->add($relation); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$result = new ArrayList(); | |
foreach($dataList as $dataListItem) { | |
$result->push(new ArrayData(array( | |
'Title' => $Title, | |
'Othervalue' => $something | |
))); | |
} | |
return $result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function updateCMSFields(FieldList $fields) { | |
// Make sure settings tab is last | |
$formContent = $fields->fieldByName('Root.Settings'); | |
$fields->removeByName('Settings'); | |
$fields->findOrMakeTab('Root.Settings', $formContent); | |
} |
private static $allowed_actions = array (
'expandPageContent'
);
/*
* Method to retrive the rendered page template, sans any external elements (such as header, footer, nav)
*
* @return HTMLText
*/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A list decorator that allows a list to be grouped into sub-lists by number. Based on GroupBy functionality | |
* @author Naomi Guyer | |
*/ | |
class SplitList extends SS_ListDecorator { | |
/** | |
* @param string $num | |
* @return array |
OlderNewer