protected function BeforeRemove(TableObject $deleteObject)
 {
     foreach (self::$deleteHooks as $deleteHook) {
         $deleteHook->BeforeDelete($deleteObject);
     }
     $logger = new Logger(self::Guard()->GetUser());
     $logger->ReportContainerAction($deleteObject, Action::Delete());
 }
Beispiel #2
0
 /**
  * Execute delete hooks
  */
 protected function BeforeDelete()
 {
     foreach (self::$deleteHooks as $hook) {
         $hook->BeforeDelete($this->item);
     }
     $logger = new Logger(BackendModule::Guard()->GetUser());
     $logger->ReportAreaAction($this->item, Action::Delete());
 }
Beispiel #3
0
 protected function BeforeRemove(Layout $layout)
 {
     $layoutFile = PathUtil::LayoutTemplate($layout);
     if (File::Exists($layoutFile)) {
         File::Delete($layoutFile);
     }
     $logger = new Logger(self::Guard()->GetUser());
     $logger->ReportLayoutAction($layout, Action::Delete());
 }
 /**
  * Deletes the container contents related to the container
  * @param Container $item The container to be deleted
  */
 public function BeforeDelete($item)
 {
     $contContainers = ContentContainer::Schema()->FetchByContainer(true, $item);
     $logger = new Logger(BackendModule::Guard()->GetUser());
     foreach ($contContainers as $contContainer) {
         $content = $contContainer->GetContent();
         $provider = ContentTreeUtil::GetTreeProvider($content);
         $tree = new TreeBuilder($provider);
         $logger->ReportContentAction($content, Action::Delete());
         $tree->Remove($provider->ItemByContent($content));
     }
 }
Beispiel #5
0
 /**
  * Remove htaccess page commands before page is deleted
  */
 protected function BeforeDelete()
 {
     foreach (self::$deleteHooks as $hook) {
         $hook->BeforeDelete($this->item);
     }
     $logger = new Logger(BackendModule::Guard()->GetUser());
     $logger->ReportPageAction($this->item, Action::Delete());
     $file = Path::Combine(PHINE_PATH, 'Public/.htaccess');
     if (!File::Exists($file)) {
         return;
     }
     $this->UpdateHtaccess($file);
 }
 protected function BeforeRemove(TableObject $deleteObject)
 {
     $logger = new Logger(self::Guard()->GetUser());
     $logger->ReportMemberGroupAction($deleteObject, Action::Delete());
 }
 protected function BeforeDelete()
 {
     $logger = new Logger(BackendModule::Guard()->GetUser());
     $logger->ReportContentAction($this->TreeProvider()->ContentByItem($this->item), Action::Delete());
 }
Beispiel #8
0
 private function RemoveTemplate()
 {
     $id = Request::PostData('delete');
     if (!$id) {
         return false;
     }
     $idParts = \explode('/', $id);
     $module = $this->RemovalTemplateModule($idParts);
     $templateName = trim($idParts[1]);
     if (!$module || !$templateName) {
         return false;
     }
     $logger = new Logger(self::Guard()->GetUser());
     $logger->ReportTemplateAction($module->MyType(), $templateName, Action::Delete());
     $folder = PathUtil::ModuleCustomTemplatesFolder($module);
     $template = Path::Combine($folder, Path::AddExtension($templateName, 'phtml'));
     if (File::Exists($template)) {
         File::Delete($template);
     }
     $this->DeleteUsages($module, $templateName);
     return true;
 }
Beispiel #9
0
 /**
  * Reports a user group action to the log
  * @param Usergroup  $userGroup  The user group being manipulated
  * @param Enums\Action $action The operation executed on the user group 
  */
 function ReportUserGroupAction(Usergroup $userGroup, Enums\Action $action)
 {
     $logItem = $this->CreateLogItem(Enums\ObjectType::UserGroup(), $action);
     if (!$action->Equals(Enums\Action::Delete())) {
         $logUserGroup = new LogUsergroup();
         $logUserGroup->SetLogItem($logItem);
         $logUserGroup->SetUserGroup($userGroup);
         $logUserGroup->Save();
     }
 }