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: extensions | |
--- | |
SiteConfig: | |
extensions: | |
- CustomSiteConfigExtension |
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
/* | |
This is a customised version of picturefill.js with the following modifications | |
1. Before setting the source on the img tag to the appropriate img file, check if the lazyload plugin is defined | |
2. If so, set the data-original attr of the img instead of the src attr. Also set width and height attrs from the picture span's data-width and data-height attrs. | |
3. Append the img tag and tell lazyload about it |
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 ContactBlock extends Block { | |
/** | |
* Template accessor for the form | |
**/ | |
public function ContactForm(){ | |
return $this->getController()->ContactForm(); | |
} |
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 ContentBlock extends Block{ | |
private static $singular_name = 'Content Block'; | |
private static $plural_name = 'Content Blocks'; | |
private static $db = array( | |
'Title' => 'Varchar(255)', | |
'Content' => '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 | |
class Page_Controller extends ContentController{ | |
/** | |
* Require a custom script from a file | |
* @param string $filepath | |
* @param bool $addMinLive - prepend .min to file extension if not in dev mode | |
*/ | |
public function inlineJS($filepath, $addMinLive = true){ | |
if(($addMinLive || $addMinLive != 'false') && !Director::isDev()) $filepath = str_replace('.js', '.min.js', $filepath); |
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 | |
/** | |
* BetterRequirements | |
* | |
* This class makes 2 things possible. | |
* 1) Require minified or non minified version of file based on development environment | |
* 2) Allows css/js file contents to be pulled into the page, saving on extra requests where appropriate | |
* | |
* @package ian-potter | |
* @author [email protected] |
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 | |
// place this file above web root | |
if(!defined('SS_ENVIRONMENT_TYPE')) define('SS_ENVIRONMENT_TYPE', 'dev'); | |
if(!defined('SS_DEFAULT_ADMIN_USERNAME')) define('SS_DEFAULT_ADMIN_USERNAME', 'admin'); | |
if(!defined('SS_DEFAULT_ADMIN_PASSWORD')) define('SS_DEFAULT_ADMIN_PASSWORD', 'admin'); | |
if(!defined('SS_DATABASE_CLASS')) define('SS_DATABASE_CLASS', 'MySQLDatabase'); | |
if(!defined('SS_DATABASE_SERVER')) define('SS_DATABASE_SERVER', '127.0.0.1'); | |
if(!defined('SS_DATABASE_USERNAME')) define('SS_DATABASE_USERNAME', 'root'); |
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
#!/bin/bash | |
HOST="[email protected] -pxxxx" | |
if [ ! $1 ]; then | |
ENVIRONMENT='prod' | |
else | |
ENVIRONMENT=${1} | |
fi |
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 | |
/** | |
* ImageGallery | |
* | |
* An example of a Shortcodable DataObject. | |
* See https://github.com/sheadawson/silverstripe-shortcodable | |
**/ | |
class ImageGallery extends DataObject | |
{ | |
private static $db = array( |