Guest User

Untitled

a guest
Jun 19th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. ## filemanager/_config.php
  2.  
  3. <?php
  4. /**
  5. * Configuration for the HasManyFileManager extension/module
  6. * Make sure the beginning of the rewrite rule matches your folder name.
  7. * Example: if you installed the HasManyFileManager Module in a folder named
  8. * "filemanager" the rule below MUST start with this foldername.
  9. *
  10. * If you intend to change the filemanager directory name to something else, be sure
  11. * to change the references in AttachedFile as well!
  12. */
  13. Director::addRules(100, array(
  14. 'filemanager/$Action/$Class/$ID/$ImageField/$Group/$ItemID' => 'AttachedFile_Uploader'
  15. ));
  16.  
  17. // decorate File with AttachedFile
  18. DataObject::add_extension('File', 'AttachedFile');
  19. DataObject::add_extension('SiteTree', 'SiteTreeFileHandler');
  20. //DataObject::add_extension('LeftAndMain', 'CustomScriptInit')
  21. Object::add_extension('LeftAndMain','CustomScriptInit');
  22.  
  23. ?>
  24.  
  25. ## filemanager/code/CustomScriptInit.php
  26. <?php
  27. class CustomScriptInit extends LeftAndMainDecorator
  28. {
  29. /**
  30. * Load our required scripts and stylesheets into the cms
  31. * We do this by adding DataObject::add_extension('LeftAndMain', 'CustomScriptInit');
  32. * into our _config.php file.
  33. * DARN! That took some time to figure out.
  34. */
  35. public function init(){
  36. //Debug::show('Custom Script Init Ran');
  37. Requirements::css('filemanager/css/filemanager.css');
  38. //Requirements::javascript('filemanager/javascript/lib/jquery-1.2.6.pack.js');
  39. Requirements::javascript('filemanager/javascript/lib/jquery.dimensions.min.js');
  40. Requirements::javascript('filemanager/javascript/lib/jquery-ui-sortables-1.5.2.packed.js');
  41. Requirements::javascript('filemanager/javascript/FileManager.js');
  42. }
  43. }
  44. ?>
Add Comment
Please, Sign In to add comment