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 Account extends AppModel { | |
var $actsAs = array('Permissionable'); | |
var $hasMany = array( | |
'User' => array('dependent' => true) | |
); | |
function permissions($user) { | |
if ($user['Role']['accounts'] != 'owner') { | |
return false; |
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 User extends AppModel { | |
var $validate = array( | |
'first_name' => array('rule' => 'notEmpty', 'message' => 'Please enter a first name.'), | |
'last_name' => array('rule' => 'notEmpty', 'message' => 'Please enter a last name.'), | |
'phone' => array('rule' => array('phone', null, 'us'), 'allowEmpty' => true, 'message' => 'Please enter a valid phone number.'), | |
'email' => array( | |
'email' => array('rule' => array('email', true), 'message' => 'Please use a valid email address.'), | |
'isUnique' => array('rule' => 'isUnique', 'message' => 'This email address is already being used.') | |
), |
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 | |
App::import('Vendor', 'tcPDF', array('file' => 'tcpdf' . DS . 'tcpdf.php')); | |
class CustomPDF extends TCPDF { | |
public function Footer() { | |
} | |
public function Header() { | |
} | |
} |
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
results = { | |
ajaxRequest : null, | |
ajaxLoader : '<div class="ajax_loader"><div class="overlay"></div><div class="message">Loading...</div></div>', | |
displayLoader : function(container){ | |
container = container || $('div.records:first'); | |
if ($(container).find('div.ajax_loader').length) { | |
return; | |
} | |
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 AppModel extends Model { | |
function __construct($id = false, $table = null, $ds = null) { | |
parent::__construct($id, $table, $ds); | |
if (isset($this->hasMany['Note'])) { | |
$this->hasMany['Note']['conditions']['Note.class'] = $this->name; | |
$this->hasMany['Note']['foreignKey'] = 'foreign_id'; | |
} | |
} | |
} |
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
<table id="prejam_vendors"> | |
<thead> | |
<tr> | |
<th class="text_left">Vendor Name</th> | |
<th class="text_left">Quote Date</th> | |
<th class="text_left">Quote #</th> | |
<th class="text_left">Description</th> | |
<th class="text_left">Discount</th> | |
<th class="text_left">Price Book</th> | |
<th class="text_left">Quote Expiration Date</th> |
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 | |
App::import('Core', 'Controller'); | |
class BuildAclShell extends Shell { | |
function main() { | |
$log = array(); | |
App::import('Component', 'Acl'); | |
$acl =& new AclComponent(null); | |
$aco =& $acl->Aco; | |
$root = $aco->node('controllers'); |
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 StatefulComponent extends Object { | |
var $components = array('Session'); | |
function initialize(&$controller, $settings = array()) { | |
$this->controller =& $controller; | |
$this->_set($settings); | |
} | |
function startup() { |
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
# Secure local IPs: | |
# | |
# 127.0.0.2 - www.example.dev | |
# | |
127.0.0.1 localhost | |
# example.com | |
127.0.0.2 www.example.dev |
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 Contact extends AppModel { | |
var $actsAs = array('Acl' => array('requester')); | |
var $belongsTo = array( | |
'Account', | |
'Role', | |
'Supervisor' => array( | |
'className' => 'Contact', | |
'foreignKey' => 'supervisor_id' | |
) |