本文整理汇总了PHP中AppController类的典型用法代码示例。如果您正苦于以下问题:PHP AppController类的具体用法?PHP AppController怎么用?PHP AppController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AppController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modify
function modify()
{
global $lll, $siteDemo, $allowedMethods;
$found = FALSE;
if ($siteDemo || !class_exists('rss')) {
// It is disabled to save these attributes in the demo version:
foreach (array("extraHead", "extraBody", "extraTopContent", "extraBottomContent", "extraFooter", "logoImage", "headerBackground") as $attr) {
if (!empty($this->{$attr})) {
$found = TRUE;
$this->{$attr} = "";
}
}
}
foreach (array("homeLocation", "redirectFirstLogin", "redirectLogin", "redirectAdminLogin") as $attr) {
$ctrl = new AppController();
if ($this->{$attr}) {
if (!$ctrl->init($this->{$attr}) || !isset($allowedMethods[$ctrl->method]) || !class_exists($ctrl->getClass())) {
return Roll::setFormInvalid("invalidInternalLink", $this->{$attr});
}
}
}
modify($this);
$this->uploadImages();
if ($found) {
Roll::setInfoText("This feature is not available in the Lite (and demo) version of the program!");
}
}
示例2: beforeRender
public function beforeRender()
{
AppController::beforeRender();
$subMenu = array(array("Autorisations", array('controller' => 'Autorisation', 'action' => 'index'), $this->params['action'] == 'index'), array("Membres", array('controller' => 'Autorisation', 'action' => 'members'), $this->params['action'] == 'members'));
$this->set('subMenu', $subMenu);
$this->layout = 'connected';
}
示例3: getRequest
/**
* Get request object for current request. Returns null if no request is available
* (if, for example, the plugin is being run in a batch script - scripts don't use the request/response model)
*
* @return Request object or null if no request object is available
*/
public function getRequest()
{
if (($o_app = AppController::getInstance()) && ($o_req = $o_app->getRequest())) {
return $o_req;
}
return null;
}
示例4: title
/**
* Build SEO title
*
* @param string $pageTitle Title of the current item/page/posts...
*/
function title($pageTitle = null)
{
if (!is_object($this->controller)) {
return;
}
if (!$pageTitle) {
$pageTitle = $this->controller->pageTitle;
}
if (!$pageTitle) {
$pageTitle = ucwords($this->controller->params['controller']);
}
$description = Configure::read('AppSettings.description');
$nameAndDescription = hsc(Configure::read('AppSettings.site_name'));
if ($description) {
$description = hsc($description);
$nameAndDescription = "{$nameAndDescription} - {$description}";
}
if ($this->controller->isHome) {
$this->controller->pageTitle = $nameAndDescription;
} else {
$this->controller->pageTitle = "{$pageTitle} • {$nameAndDescription}";
}
$this->controller->set('page_title_for_layout', $pageTitle);
$this->controller->set('site_title_for_layout', $nameAndDescription);
}
示例5: beforeFilter
function beforeFilter()
{
$this->Auth->allow('logout', 'reg', 'password_reset', 'view', 'acoset', 'aroset', 'permset', 'buildAcl');
parent::beforeFilter();
$this->Auth->autoRedirect = false;
//debug($this->Session->read() );
}
示例6: beforeFilter
/**
* Displays a view
*
* @param mixed What page to display
* @access public
*/
public function beforeFilter()
{
parent::beforeFilter();
if (isset($this->Auth)) {
$this->Auth->allow('display');
}
}
示例7: beforeFilter
public function beforeFilter()
{
parent::beforeFilter();
// what pages are allowed for non-logged-in users
$this->Auth->allow('xml');
$this->Auth->allow('csv');
$this->Auth->allow('nids');
$this->Auth->allow('hids_md5');
$this->Auth->allow('hids_sha1');
$this->Auth->allow('text');
$this->Auth->allow('dot');
$this->Auth->allow('restSearch');
$this->Auth->allow('stix');
// TODO Audit, activate logable in a Controller
if (count($this->uses) && $this->{$this->modelClass}->Behaviors->attached('SysLogLogable')) {
$this->{$this->modelClass}->setUserData($this->activeUser);
}
// convert uuid to id if present in the url, and overwrite id field
if (isset($this->params->query['uuid'])) {
$params = array('conditions' => array('Event.uuid' => $this->params->query['uuid']), 'recursive' => 0, 'fields' => 'Event.id');
$result = $this->Event->find('first', $params);
if (isset($result['Event']) && isset($result['Event']['id'])) {
$id = $result['Event']['id'];
$this->params->addParams(array('pass' => array($id)));
// FIXME find better way to change id variable if uuid is found. params->url and params->here is not modified accordingly now
}
}
// if not admin or own org, check private as well..
if (!$this->_isSiteAdmin()) {
$this->paginate = Set::merge($this->paginate, array('conditions' => array("OR" => array(array('Event.org =' => $this->Auth->user('org')), "AND" => array(array('Event.distribution >' => 0), Configure::read('MISP.unpublishedprivate') ? array('Event.published =' => 1) : array())))));
}
}
示例8: beforeFilter
public function beforeFilter()
{
parent::beforeFilter();
$this->Auth->allow();
$this->set('logged_user', $this->Auth->user());
$this->layout = 'cultural';
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->TiposPagamento = new TiposPagamento();
$this->SituacaoConta = new SituacaoConta();
$this->layout = 'painel';
}
示例10: beforeFilter
public function beforeFilter()
{
parent::beforeFilter();
if ($this->action == 'admin_edit') {
$this->Security->disabledFields = array('alias');
}
}
示例11: beforeFilter
function beforeFilter()
{
parent::beforeFilter();
// $this->Auth->allow('*');
//$this->set('menuTab', 'kelas');
//$this->set('menuTabChild', 'kuis');
}
示例12: beforeRender
function beforeRender()
{
parent::beforeRender();
$this->set('service_titles', $this->service_titles);
$this->set('service_status', $this->service_status);
$this->set('service_schedule', $this->service_schedule);
}
示例13: beforeFilter
/**
* beforeFilter
*
* @return void
*/
public function beforeFilter()
{
parent::beforeFilter();
if (!empty($this->siteConfigs['editor']) && $this->siteConfigs['editor'] != 'none') {
$this->helpers[] = $this->siteConfigs['editor'];
}
}
示例14: beforeFilter
public function beforeFilter()
{
parent::beforeFilter();
// We're doing a backend request, require backend access
$this->requireBackend();
$this->set('at_backendpanel', true);
}
示例15: beforeFilter
/**
* Displays a view
*
* @return void
* @throws NotFoundException When the view file could not be found
* or MissingViewException in debug mode.
*/
function beforeFilter()
{
parent::beforeFilter();
$this->layout = 'homepage';
//allows pages without auth so you dont have 2 login :):):):):):)
$this->Auth->allow('display');
}