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 ReportAdminExtension extends Extension { | |
public function updateEditForm($form) { | |
$gridField = $form->Fields()->dataFieldByName('Reports'); | |
if ($gridField instanceof GridField) { | |
$columns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns'); | |
$columns->setFieldFormatting(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
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
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
<% loop $Menu(1) %> | |
$RenderLayout | |
<% end_loop %> |
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 SomeModelAdmin extends ModelAdmin { | |
private static $managed_models = array( | |
"MyDataObject" | |
); | |
public function getEditForm($id = null, $fields = null) { | |
$form = parent::getEditForm($id, $fields); |
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 ManyManyListWithHook extends ManyManyList { | |
/** | |
* @param mixed $item | |
* @param array|null $extraFields | |
*/ | |
public function add($item, $extraFields = null) { | |
parent::add($item, $extraFields); |
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 | |
//error_reporting(E_ALL); | |
//ini_set( 'display_errors','1'); | |
$strPostUrl = 'http://client.txtnation.com/mbill.php'; | |
$strPostReq = ''; | |
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 | |
try { | |
// Use Stripe's bindings... | |
} catch(Stripe_CardError $e) { | |
// Since it's a decline, Stripe_CardError will be caught | |
$body = $e->getJsonBody(); | |
$err = $body['error']; | |
print('Status is:' . $e->getHttpStatus() . "\n"); | |
print('Type is:' . $err['type'] . "\n"); | |
print('Code is:' . $err['code'] . "\n"); |
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 Store extends DataObject { | |
static $db = array( | |
'Title' => "Varchar(128)", | |
'Name' => "Varchar(128)", | |
'Address1' => "Varchar(128)", | |
'Address2' => "Varchar(128)", | |
'Address3' => "Varchar(128)", |
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 MyDataObject extends DataObject { | |
private static $singular_name = 'MyDataObject'; | |
private static $plural_name = 'MyDataObjects'; | |
private static $db = array( | |
'Sort' => 'Int' | |
); |
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 MyDataObjectAdmin extends ModelAdmin { | |
private static $managed_models = array('MyDataObject'); // Can manage multiple models | |
private static $url_segment = 'my-data-object'; // Linked as /admin/my-data-object/ | |
private static $menu_title = 'My DataObjects'; | |
public function getSearchContext() { |
NewerOlder