<?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
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; |
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 | |
/* What kind of environment is this: development, test, or live (ie, production)? */ | |
define('SS_ENVIRONMENT_TYPE', 'dev'); | |
/* Database connection */ | |
define('SS_DATABASE_SERVER', '127.0.0.1'); | |
define('SS_DATABASE_USERNAME', 'root'); | |
define('SS_DATABASE_PASSWORD', ''); | |
/* Configure a default username and password to access the CMS on all sites in this environment. */ |
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
### SILVERSTRIPE START ### | |
<Files *.ss> | |
Order deny,allow | |
Deny from all | |
Allow from 127.0.0.1 | |
</Files> | |
<Files web.config> | |
Order deny,allow | |
Deny from all |
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"; |
OlderNewer