Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## filemanager/_config.php
- <?php
- /**
- * Configuration for the HasManyFileManager extension/module
- * Make sure the beginning of the rewrite rule matches your folder name.
- * Example: if you installed the HasManyFileManager Module in a folder named
- * "filemanager" the rule below MUST start with this foldername.
- *
- * If you intend to change the filemanager directory name to something else, be sure
- * to change the references in AttachedFile as well!
- */
- Director::addRules(100, array(
- 'filemanager/$Action/$Class/$ID/$ImageField/$Group/$ItemID' => 'AttachedFile_Uploader'
- ));
- // decorate File with AttachedFile
- DataObject::add_extension('File', 'AttachedFile');
- DataObject::add_extension('SiteTree', 'SiteTreeFileHandler');
- //DataObject::add_extension('LeftAndMain', 'CustomScriptInit')
- Object::add_extension('LeftAndMain','CustomScriptInit');
- ?>
- ## filemanager/code/CustomScriptInit.php
- <?php
- class CustomScriptInit extends LeftAndMainDecorator
- {
- /**
- * Load our required scripts and stylesheets into the cms
- * We do this by adding DataObject::add_extension('LeftAndMain', 'CustomScriptInit');
- * into our _config.php file.
- * DARN! That took some time to figure out.
- */
- public function init(){
- //Debug::show('Custom Script Init Ran');
- Requirements::css('filemanager/css/filemanager.css');
- //Requirements::javascript('filemanager/javascript/lib/jquery-1.2.6.pack.js');
- Requirements::javascript('filemanager/javascript/lib/jquery.dimensions.min.js');
- Requirements::javascript('filemanager/javascript/lib/jquery-ui-sortables-1.5.2.packed.js');
- Requirements::javascript('filemanager/javascript/FileManager.js');
- }
- }
- ?>
Add Comment
Please, Sign In to add comment