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 | |
class GridFieldDetailFormExtension extends Extension { | |
/** | |
* @var array | |
*/ | |
private static $allowed_actions = array( | |
'doLock' | |
); |
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
// Adds the class 'csstransforms3d' if the browser supports 3d transforms | |
// Stripped down version of Modernizr's detection: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/css/transforms3d.js | |
// Assumes the script is always being run in the <head> - will create a body element. Should work outside the head, but is untested | |
(function(document) { | |
var docElem = document.documentElement, | |
div = document.createElement('div'), | |
body = document.createElement('body'); | |
ret = false, | |
properties = 'p# p#Property WebkitP# MozP# OP# msP#'.replace(/[#]/g, 'erspective').split(' '); | |
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 | |
if (class_exists('PHP_CodeSniffer_Standards_AbstractPatternSniff', true) === false) { | |
throw new PHP_CodeSniffer_Exception('Class PHP_CodeSniffer_Standards_AbstractPatternSniff not found'); | |
} | |
class SilverStripe_Sniffs_ControlStructures_ControlSignatureSniff implements PHP_CodeSniffer_Sniff | |
{ |
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
<snippet> | |
<content><![CDATA[ | |
<?php | |
class ${TM_FILENAME/(\.php)$/$'/} extends DataObject { | |
private static \$db = array( | |
$1 | |
); |
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 | |
class ParkListing extends Location { | |
/** | |
* @param GeocodedLocation $location | |
* @return DataList | |
*/ | |
public static function get_by_geo(GeocodedLocation $location) { | |
$query = new SQLQuery(); |
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
<% cached List(FeatureBox).Max(LastEdited) %> | |
... | |
<% end_cached %> | |
SHOW TABLES LIKE 'FeatureBox' 0.0005ms | |
SHOW FULL FIELDS IN "FeatureBox" 0.0021ms | |
SELECT DISTINCT "ClassName" FROM "FeatureBox" 0.0002ms | |
SELECT DISTINCT MAX("LastEdited") FROM "FeatureBox" 0.0002ms | |
------------------------------------------------------------------------------------------------------ |
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 | |
class ColumnedList extends SS_ListDecorator { | |
/** | |
* @param int $columns | |
* @return array | |
*/ | |
public function stack($columns) { | |
$total = $this->list->count(); |
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 | |
class GroupExtension extends Extension { | |
public function updateCMSFields($fields) { | |
$gridField = $fields->dataFieldByName('Members'); | |
$exportButton = $gridField->getConfig()->getComponentByType('GridFieldExportButton'); | |
$exportButton->setExportColumns(array( | |
'FirstName' => 'First name', | |
'Surname' => 'Last name', |
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
--- | |
Name: rootroutes | |
--- | |
Director: | |
rules: | |
'': 'ArticleController' | |
'$Identifier': 'ArticleController' |
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 | |
// https://gist.github.com/mindplay-dk/3359812 | |
define('NUM_TESTS', 10); | |
header('Content-type: text/plain'); | |
class Foo | |
{ |