12 use Symfony\Component\HttpFoundation\Request;
13 use Symfony\Component\HttpFoundation\Response;
17 const NAME =
'content_unlink';
22 function __construct()
24 parent::__construct(self::NAME, array(
25 self::TITLE => _(
"Unlink upload or folder"),
26 self::MENU_LIST =>
"Organize::Folders::Unlink Content",
28 self::REQUIRES_LOGIN => TRUE
30 $this->folderDao = $GLOBALS[
'container']->get(
'dao.folder');
37 protected function handle(Request $request)
39 $userId = Auth::getUserId();
42 $folderContentId = intval($request->get(
'foldercontent'));
43 if ($folderContentId) {
45 $this->folderDao->removeContent($folderContentId);
46 }
catch (Exception $ex) {
47 $vars[
'message'] = $ex->getMessage();
51 $rootFolderId = $this->folderDao->getRootFolder($userId)->getId();
53 $uiFolderNav = $GLOBALS[
'container']->get(
'ui.folder.nav');
54 $vars[
'folderTree'] = $uiFolderNav->showFolderTree($rootFolderId);
56 return $this->
render(
'admin_content_delete.html.twig', $this->mergeWithDefault($vars));
Contains the constants and helpers for authentication of user.
render($templateName, $vars=null, $headers=null)
#define PERM_ADMIN
Administrator.