function filedepot_newfolder_dialog in filedepot 7
1 string reference to 'filedepot_newfolder_dialog'
- filedepot_menu in ./
filedepot.module - Implementation of hook_menu().
File
- ./
filedepot.module, line 2488 - filedepot.module Filedepot: File Management Module developed by Nextide www.nextide.ca Full featured document managment module with a desktop application feel. Integrated Organic Group, Role and User permissions to secure folders, automated…
Code
function filedepot_newfolder_dialog($js = NULL) {
// Fall back if $js is not set.
if (!$js) {
return drupal_get_form('filedepot_newfolder_form');
}
ctools_include('modal');
ctools_include('ajax');
ctools_add_js('ajax-responder');
drupal_add_css(drupal_get_path('module', 'filedepot') . '/css/filedepot_ctools.css');
$form_state = array(
'title' => t('Add a new folder'),
'ajax' => TRUE,
);
$output = ctools_modal_form_wrapper('filedepot_newfolder_form', $form_state);
if ($form_state['executed'] && $js) {
$cid = intval($form_state['values']['folder_nid']);
$commands = array();
$commands[] = ctools_ajax_command_redirect("filedepot/folder/{$cid}");
$commands[] = ctools_modal_command_dismiss(t('New folder success'));
// In typical usage you will do something else here, such as update a
// div with HTML or redirect the page based upon the results of the modal
// form.
print ajax_render($commands);
exit;
}
print ajax_render($output);
exit;
}