This file contains hidden or 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 $mycolumns = $('.casestudies .study'); | |
var height = 0; | |
$mycolumns.each(function () { | |
if ($(this).height() > height) { | |
height = $(this).height(); | |
} | |
}); | |
$mycolumns.height(height); |
This file contains hidden or 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 | |
public function ProductTypeBrands(){ | |
//list to return | |
$brands = ArrayList::create(); | |
$addToBrands = function($product) use (&$brands){ | |
if(!$brands->find($product->BrandID)){ | |
$brands->push($Product->Brand());//Assuming the relation name for the has_one is Brand | |
} |
This file contains hidden or 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 | |
public function CurrentLevel() { | |
$page = $this->owner; | |
$level = 1; | |
while(1) { | |
if($page->Parent) { | |
$level++; | |
$page = $page->Parent(); | |
}else { |
This file contains hidden or 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
(function($) { | |
$(.cms-container).entwine(function($) { | |
onmatch: function(){ | |
alert('Yay!!!'); | |
} | |
}); | |
}); |
This file contains hidden or 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 MyUserForm extends UserDefinedForm{ | |
private static $db = array( | |
'Template' => 'Enum("Template1","Template2","Template3")' | |
); | |
public funciton getCMSFields(){ | |
$fields = parent::getCMSFields(); |
This file contains hidden or 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 | |
public function validate() | |
{ | |
$result = parent::validate(); | |
if($this->MyImage()->getWidth() < 100 || $this->MyImage()->getHeight() < 100) { | |
$result->error('Need a larger image'); | |
} |
This file contains hidden or 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 MyPage extends Page{ | |
} | |
class MyPage_Controller extends Page_Controller{ | |
private static $allowed_actions = array(); | |
This file contains hidden or 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 MyClass extends Page{ | |
public static function getFilteredList(SS_HTTPRequest $request = null){ | |
//assume the request var holds a valid SS_HTTPRequest | |
$list = MyObject::get(); | |
if($someVar = $request->getVar('Somevar')){ |
This file contains hidden or 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 MyObject extends DataObject{ | |
private static $has_one = array( | |
'Image' => 'Image' | |
); | |
public function getOriginalImage(){ | |
return $this->Image(); |
This file contains hidden or 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
jQuery(document).ready(function(){ | |
jQuery.each('.same', function(index){ | |
var newClass = 'extra' + index; | |
jQuery(this).addClass(newClass); | |
}); | |
}); |