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 | |
/** | |
* Ci da la possibilità di effettuare queries all'oggetto ACL | |
* | |
* @author Sergio Rinaudo | |
*/ | |
class My_Controller_Action_Helper_Acl | |
extends Zend_Controller_Action_Helper_Abstract | |
{ | |
protected $_acl = null; |
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 My_Controller_Plugin_Acl | |
extends Zend_Controller_Plugin_Abstract | |
{ | |
public function preDispatch(Zend_Controller_Request_Abstract $request) | |
{ | |
$acl = My_Acl::getInstance(); | |
$auth = Zend_Auth::getInstance(); | |
$identity = $auth->getIdentity(); | |
$role = null !== $identity ? $identity->role : My_Acl::ROLE_GUEST; |
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 My_Acl extends Zend_Acl | |
{ | |
protected static $_instance = null; | |
const ROLE_GUEST = 'guest'; | |
const ROLE_MEMBER_STANDARD = 'member-standard'; | |
const ROLE_MEMBER_PREMIUM = 'member-premium'; | |
const ROLE_ADMIN = 'admin'; | |
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
/* | |
* First server | |
*/ | |
$i++; | |
/* Authentication type and info */ | |
$cfg['Servers'][$i]['auth_type'] = 'config'; | |
$cfg['Servers'][$i]['user'] = 'root'; | |
$cfg['Servers'][$i]['password'] = ''; | |
$cfg['Servers'][$i]['extension'] = 'mysql'; |
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
.run(['$rootScope', 'LoggedInLoader', 'CategoriesLoader', 'LocationsLoader', | |
function($rootScope, LoggedInLoader, CategoriesLoader, LocationsLoader) { | |
// All GLOBAL here | |
$rootScope.redirectionDelay = 2500; | |
$rootScope.checkedLogged = false; | |
$rootScope.logged = false; | |
$rootScope.username = ''; | |
$rootScope.check = function() { | |
$rootScope.resource = new LoggedInLoader({}); |
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
if(!function_exists('renderMenu')) { | |
function renderMenu($container, $obj, $step = 0) { | |
$html = ''; | |
if(null !== $container && $container->count()) { | |
if(!$step) { | |
$html.= '<ul class="nav ">' . PHP_EOL; | |
$step++; | |
} elseif($step == 1) { | |
$html.= '<ul class="dropdown-menu">' . PHP_EOL; |
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
$qb = $this->_em->createQueryBuilder(); | |
$qb->select(array( | |
'a.termTaxonomyId', | |
'b.name', | |
'a.parentId', | |
'COALESCE(a.parentId, a.termTaxonomyId) AS HIDDEN fld') | |
); | |
$qb->from('\My\Entity\TermTaxonomy', 'a'); | |
$qb->leftJoin('\My\Entity\Term', 'b', 'WITH', 'b.termId = a.termId'); | |
$qb->andWhere($qb->expr()->eq('a.taxonomy', ':taxonomy')); |
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
public function breadcrumbsAction() | |
{ | |
$default = 'dashboard'; | |
$id = $this->getRequest()->getQuery('id', $default); | |
$pos = strpos($id, '/'); | |
$id = false !== $pos ? substr($id, 0, $pos) : $id; | |
$view = $this->getServiceLocator()->get('Zend\View\Renderer\PhpRenderer'); | |
$navigation = $view->navigation('navigation'); | |
$container = $navigation->getContainer(); | |
$page = $container->findOneBy('fragment', $id); |
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 | |
namespace Application\Test; | |
use ZFTool\Diagnostics\Test\AbstractTest; | |
use ZFTool\Diagnostics\Result\Success; | |
use ZFTool\Diagnostics\Result\Failure; | |
use ZFTool\Diagnostics\Result\Warning; | |
class Is64Bit |
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
use Zend\View\Model\ViewModel; | |
[...] | |
// within the constructor | |
$this->viewmodel = new ViewModel(); | |
$this->viewmodel->setVariable('myobj', $this); // object assigned to view model will be available | |
// within the view script using $this->myobj | |
[...] | |
public function render() |