/**
  * Annotated Controllers and Extensions
  */
 public function afterCallActionHandler()
 {
     $this->setUp();
     $skipAnnotation = $this->owner->getRequest()->getVar('skipannotation');
     $envIsAllowed = $this->permissionChecker->environmentIsAllowed();
     if ($skipAnnotation === null && $envIsAllowed) {
         $this->displayMessage(' Generating class docblocks');
         $modules = $this->permissionChecker->enabledModules();
         foreach ($modules as $module) {
             $this->annotator->annotateModule($module);
         }
         $this->displayMessage(' Docblock generation finished!');
     }
 }
 /**
  * @param SS_HTTPRequest $request
  * @return bool
  */
 public function run($request)
 {
     /* @var $permissionChecker AnnotatePermissionChecker */
     $permissionChecker = Injector::inst()->get('AnnotatePermissionChecker');
     if (!$permissionChecker->environmentIsAllowed()) {
         return false;
     }
     /* @var $annotator DataObjectAnnotator */
     $annotator = DataObjectAnnotator::create();
     $annotator->annotateObject($request->getVar('object'));
     $annotator->annotateModule($request->getVar('module'));
     return true;
 }
 public function requireDefaultRecords()
 {
     if (!Config::inst()->get('DataObjectAnnotator', 'enabled') || isset($_GET['skipannotation'])) {
         return false;
     }
     /* @var $annotator DataObjectAnnotator */
     $annotator = DataObjectAnnotator::create();
     $annotator->annotateDataObject($this->owner->ClassName);
     if ($extensions = Config::inst()->get($this->owner->ClassName, 'extensions', Config::UNINHERITED)) {
         foreach ($extensions as $extension) {
             $annotator->annotateDataObject($extension);
         }
     }
 }
 /**
  * @param $request SS_HTTPRequest
  *
  * @return bool || void
  */
 public function run($request)
 {
     if (!Config::inst()->get('DataObjectAnnotator', 'enabled')) {
         return false;
     }
     $className = $request->getVar('dataobject');
     $moduleName = $request->getVar('module');
     $undo = $request->getVar('undo');
     /* @var $annotator DataObjectAnnotator */
     $annotator = DataObjectAnnotator::create();
     if ($className) {
         $annotator->annotateDataObject($className, $undo);
     } elseif ($moduleName) {
         $annotator->annotateModule($moduleName, $undo);
     }
 }
 /**
  * @param $className
  *
  * @return string
  */
 public function getClassFilePath($className)
 {
     return parent::getClassFilePath($className);
 }