public function onAfterInit() { // the 'ping' action is called via AJAX from the /admin and will cause // the admin section to 'grow' over time. We only need the css and js // for login, reset, logout and so on. if (!$this->owner->getRequest()->isAjax()) { DNRoot::include_requirements(); } }
public function init() { parent::init(); $project = $this->getCurrentProject(); if (!$project) { return $this->project404Response(); } if (!$project->allowed(self::ALLOW_ENVIRONMENT_CONFIG_READ)) { return \Security::permissionFailure(); } }
/** * Get the menu to be shown on projects * * @return ArrayList */ public function Menu() { $list = new ArrayList(); $list->push(new ArrayData(array('Link' => sprintf('naut/project/%s', $this->Name), 'Title' => 'Deploy', 'IsActive' => Controller::curr()->getAction() == 'project'))); if (DNRoot::FlagSnapshotsEnabled()) { $list->push(new ArrayData(array('Link' => sprintf('naut/project/%s/snapshots', $this->Name), 'Title' => 'Snapshots', 'IsActive' => Controller::curr()->getAction() == 'snapshots'))); } $this->extend('updateMenu', $list); return $list; }
/** * Get the menu to be shown on projects * * @return ArrayList */ public function Menu() { $list = new ArrayList(); $controller = Controller::curr(); $actionType = $controller->getField('CurrentActionType'); if (DNRoot::FlagSnapshotsEnabled() && $this->isProjectReady()) { $list->push(new ArrayData(array('Link' => sprintf('naut/project/%s/snapshots', $this->Name), 'Title' => 'Snapshots', 'IsCurrent' => $this->isSection() && $controller->getAction() == 'snapshots', 'IsSection' => $this->isSection() && $actionType == DNRoot::ACTION_SNAPSHOT))); } $this->extend('updateMenu', $list); return $list; }
public function onAfterInit() { DNRoot::include_requirements(); }