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 | |
/** | |
* Handles URL requests. | |
* | |
* - ViewableData::handleRequest() iterates through each rule in {@link self::$url_handlers}. | |
* - If the rule matches, the named method will be called. | |
* - If there is still more URL to be processed, then handleRequest() | |
* is called on the object that that method returns. | |
* |
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
/** | |
* File: NewsPage.js | |
*/ | |
(function($) { | |
$.entwine('ss', function($) { | |
/** | |
* Class: .cms-edit-form .Actions #Form_EditForm_action_deletefromlive | |
* | |
* Show users a warning before allowing them to delete a page of 'NewsPage' | |
* page type. |
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 Plot extends DataObject { | |
public static $db = array( | |
'SortOrder' => 'Int', | |
'Title' => 'Varchar', | |
'Availability' => "Enum('Available, Reserved, Sold')", | |
'Price' => 'Currency', | |
'SalePrice' => 'Currency', |
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 | |
/** | |
* Add 'no alignment' option when inserting images through 'Insert Media' form | |
*/ | |
class HtmlEditorField_ToolbarExtension extends Extension { | |
public function updateFieldsForImage(&$fields, $url, $file) { | |
$className = $fields->fieldByName('CSSClass'); | |
$classes = $className->getSource(); | |
$classes = array_merge(array('' => _t('HtmlEditorField.CSSCLASSNONE', 'No alignment.')), $classes); |
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 | |
private static $image_alignment_options = null; | |
//.... | |
new TextField('CaptionText', _t('HtmlEditorField.CAPTIONTEXT', 'Caption text')), | |
DropdownField::create( | |
'CSSClass', | |
_t('HtmlEditorField.CSSCLASS', 'Alignment / style'), | |
$this->getImageAlignmentOptions() | |
)->addExtraClass('last') |
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
/** | |
* File: LinkSwitcher.js | |
*/ | |
(function($) { | |
$.entwine(function($) { | |
/** | |
* Class: .cms-edit-form .field.switchable-controller | |
*/ | |
$('.cms-edit-form .field.switchable-controller').entwine({ |
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 CustomGDBackend extends GDBackend { | |
public function watermark() { | |
$newGD = imagecreatetruecolor($width, $height); | |
// Do image watermark stuff here. The current image resource is $this->gd | |
imagecopyresampled($newGD, $this->gd, 0, 0, $left, $top, $width, $height, $width, $height); | |
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 ($data['Tel'] !== $data['ConfirmTel']) { | |
Session::set("FormInfo.{$form->FormName()}.data", $form->getData()); | |
$form->addErrorMessage('Tel', 'Telephone numbers do not match', 'message required'); | |
return $this->redirectBack(); | |
} |
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 | |
public function index() { | |
// If they've not seen the intro, show that and set the cookie... | |
if ( ! Cookie::get('ShownIntro')) { | |
Cookie::set('ShownIntro', true); | |
return $this->renderWith(array('IntroPage', 'Page')); | |
} | |
// ... otherwise proceed as normal |
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
<ul><!-- | |
--><% loop Menu(1) %><!-- | |
--><li class="$LinkingMode"><!-- | |
--><a href="$Link">$MenuTitle.XML</a><!-- | |
--></li><!-- | |
--><% end_loop %><!-- | |
--></ul> |
OlderNewer