imce_mkdir.module

  1. cis7 sites/all/modules/ulmus/imce_mkdir/imce_mkdir.module
  2. cle7 sites/all/modules/ulmus/imce_mkdir/imce_mkdir.module
  3. ecd7 sites/all/modules/ulmus/imce_mkdir/imce_mkdir.module
  4. elmsmedia7 sites/all/modules/ulmus/imce_mkdir/imce_mkdir.module
  5. harmony7 sites/all/modules/ulmus/imce_mkdir/imce_mkdir.module
  6. icor7 sites/all/modules/ulmus/imce_mkdir/imce_mkdir.module
  7. meedjum_blog7 sites/all/modules/ulmus/imce_mkdir/imce_mkdir.module
  8. mooc7 sites/all/modules/ulmus/imce_mkdir/imce_mkdir.module

Functions

Namesort descending Description
imce_js_mkdir Ajax operation: mkdir
imce_js_rmdir Ajax operation: rmdir
imce_mkdir_content Custom content. Returns directory creation form
imce_mkdir_form Mkdir form.
imce_mkdir_form_imce_profile_form_alter Implements hook_form_formID_alter().
imce_mkdir_process_profile Custom profile process. Redefines mkdir permission based on some other parameters.

File

sites/all/modules/ulmus/imce_mkdir/imce_mkdir.module
View source
  1. <?php
  2. /**
  3. * Implements hook_form_formID_alter().
  4. */
  5. function imce_mkdir_form_imce_profile_form_alter(&$form, &$form_state) {
  6. include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'imce_mkdir') . '/imce_mkdir.inc';
  7. return _imce_mkdir_form_imce_profile_form_alter($form, $form_state);
  8. }
  9. /**
  10. * Custom profile process. Redefines mkdir permission based on some other parameters.
  11. */
  12. function imce_mkdir_process_profile(&$imce) {
  13. if (!$imce['error']) {
  14. $imce['mkdirnum'] = (int) $imce['mkdirnum'];
  15. $imce['perm']['mkdir'] = $imce['perm']['mkdir'] && (!$imce['mkdirnum'] || ($imce['direct'] && $imce['mkdirnum'] > count($imce['subdirectories'])));
  16. $imce['perm']['rmdir'] = $imce['perm']['rmdir'] && (!$imce['mkdirnum'] || $imce['direct']);
  17. }
  18. }
  19. /**
  20. * Custom content. Returns directory creation form
  21. */
  22. function imce_mkdir_content(&$imce) {
  23. if (!$imce['error'] && (imce_perm_exists($imce, 'mkdir') || imce_perm_exists($imce, 'rmdir'))) {
  24. $path = drupal_get_path('module', 'imce_mkdir');
  25. drupal_add_js($path . '/imce_mkdir.js');
  26. drupal_add_css($path . '/imce_mkdir.css');
  27. $form = drupal_get_form('imce_mkdir_form', array('imce' => &$imce));
  28. return drupal_render($form);
  29. }
  30. }
  31. /**
  32. * Mkdir form.
  33. */
  34. function imce_mkdir_form($form, &$form_state, $ref) {
  35. $imce =& $ref['imce'];
  36. include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'imce_mkdir') . '/imce_mkdir.inc';
  37. return _imce_mkdir_form($form, $form_state, $imce);
  38. }
  39. /**
  40. * Ajax operation: mkdir
  41. */
  42. function imce_js_mkdir(&$imce) {
  43. if ($imce['perm']['mkdir']) {
  44. $_POST['op'] = t('Add');
  45. drupal_get_form('imce_mkdir_form', array('imce' => &$imce));
  46. return array('diradded' => array_map('rawurlencode', $imce['diradded']));
  47. }
  48. }
  49. /**
  50. * Ajax operation: rmdir
  51. */
  52. function imce_js_rmdir(&$imce) {
  53. if ($imce['perm']['rmdir']) {
  54. $_POST['op'] = t('Remove');
  55. drupal_get_form('imce_mkdir_form', array('imce' => &$imce));
  56. return array('dirremoved' => array_map('rawurlencode', $imce['dirremoved']));
  57. }
  58. }
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.