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 Model_Acl extends Zend_Acl { | |
public function __construct() { | |
// define Roles | |
$this->addRole(new Zend_Acl_Role('guest')); // not authenicated | |
$this->addRole(new Zend_Acl_Role('member'), 'guest'); // authenticated as member inherit guest privilages | |
$this->addRole(new Zend_Acl_Role('admin'), 'member'); // authenticated as admin inherit member privilages |
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 Bootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
/* Other functions may have been omitted */ | |
protected function _initTwigView() | |
{ | |
$twigView = new ZExt_Twig(APPLICATION_PATH, APPLICATION_PATH."/modules"); | |
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper("ViewRenderer"); |
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 | |
$preloads = array( | |
// from get_declared_classes() | |
'Zend_Controller_Front', | |
'Zend_Controller_Plugin_Abstract', | |
'Zend_Controller_Plugin_Broker', | |
'Zend_Controller_Router_Abstract', | |
'Zend_Controller_Router_Rewrite', | |
'Zend_Controller_Router_Route_Abstract', | |
'Zend_Controller_Router_Route', |
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 Bootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
protected function _initAutoloader() | |
{ | |
$loader = new Zend_Application_Module_Autoloader(array( | |
'namespace' => 'Application', | |
'basePath' => dirname(__FILE__) |
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 Endo_Controller_Plugin_Modular extends Zend_Controller_Plugin_Abstract | |
{ | |
public function preDispatch(Zend_Controller_Request_Abstract $request) | |
{ | |
$module = $request->getModuleName(); | |
$module = empty($module) ? 'frontend' : $request->getModuleName(); | |
$namespace = Zend_Auth_Storage_Session::NAMESPACE_DEFAULT; | |
$member = Zend_Auth_Storage_Session::MEMBER_DEFAULT | |
. '-' . $module; |
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 isAjax() { | |
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) | |
&& $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') ? true : false; | |
} |
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
// Add the custom route for the gets action in the index controller of the slot module | |
$router = Zend_Controller_Front::getInstance()->getRouter(); | |
$route = new Zend_Controller_Router_Route( | |
'slots/get', | |
array( | |
'module' => 'slots', | |
'controller' => 'index', | |
'action' => 'get' |
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 addXhrProgressEvent($) { | |
var originalXhr = $.ajaxSettings.xhr; | |
$.ajaxSetup({ | |
progress: function() { console.log("standard progress callback"); }, | |
xhr: function() { | |
var req = originalXhr(), that = this; | |
if (req) { | |
if (typeof req.addEventListener == "function") { | |
req.addEventListener("progress", function(evt) { | |
that.progress(evt); |
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 SomeModel = Backbone.Model.extend({}); | |
someModel = new SomeModel(); | |
someModel.bind("change", function(model, collection){ | |
alert("You set some_attribute to " + model.get('some_attribute')); | |
}); | |
someModel.set({some_attribute: "some value"}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<div id="email"> | |
<span>Enter your email to sign up</span> | |
<form action="/subscribe.php" id="invite" method="POST"> |
OlderNewer