\SecuredAssetAdmin
Creates a new folder on the F/S for uploading assets to, and in a secure manner by:
- Adding dynamically populated .htaccess and web.config files.
- Use of canXX() methods on both child folders and files.
- Author: Deviate Ltd 2014-2015 http://www.deviate.net.nz
Synopsis
class SecuredAssetAdmin
extends AssetAdmin
implements
PermissionProvider
{
- // members
- private static string $url_segment = 'advanced-assets';
- private static string $url_rule = '/$Action/$ID';
- private static string $menu_title = 'Advanced Assets';
- private static string $menu_icon = "silverstripe-advancedassets/images/icons/controller-secured-asset-admin-16.png";
- private static string $tree_class = 'Folder';
- private static integer $menu_priority = 5;
- private static array $allowed_actions = ;
- // methods
- public void init()
- public SS_HTTPResponse initValidate()
- public static void instantiate()
- public SS_List getList()
- public number currentPageID()
- public Form getEditForm()
- public SS_List SiteTreeAsUL()
- public ArrayList Breadcrumbs()
- public array providePermissions()
- public null doSync()
- public HTMLText addfolder()
- public static void write_config_files()
Hierarchy
Extends
- AssetAdmin
Implements
- PermissionProvider
Tasks
Line | Task |
---|---|
14+ | Modify addFolder() and initValidate() to show messages within the CMS. |
83+ | Refactor into single static. There are v.close dupes of this in the other controllers. |
Members
private
- $allowed_actions — array
- $tree_class — string
- $url_rule — string
- $url_segment — string
Methods
public
- Breadcrumbs()
- SiteTreeAsUL()
- addfolder() — {@inheritdoc}
- currentPageID() — Return fake-ID "root" if no ID is found (needed to upload files into the root-folder) If no ID is found, it is assumed no secured|advanced assets folder exists, and so it is created.
- doSync() — Can be queried with an ajax request to trigger the filesystem sync. It returns a FormResponse status message to display in the CMS
- getEditForm()
- getList()
- init()
- initValidate() — Intial validation of incoming CMS requests before we do anything useful.
- instantiate()
- providePermissions()
- write_config_files() — Write web-server specific config files to the module's files, assets-sub directory.