function kaltura_metadata_editor in Kaltura 7.3
Same name and namespace in other branches
- 7.2 kaltura.module \kaltura_metadata_editor()
CTools callback function for metadata editor modal.
Parameters
mixed $js: Is js enabled.
mixed $entry_id: The entry id of the entry metadata.
Return value
array|null
1 string reference to 'kaltura_metadata_editor'
- kaltura_menu in ./
kaltura.module - Implements hook_menu().
File
- ./
kaltura.module, line 401 - Kaltura integration module - core functions.
Code
function kaltura_metadata_editor($js, $entry_id) {
if (!$js) {
return drupal_get_form('kaltura_metadata_editor_form');
}
ctools_include('modal');
ctools_include('ajax');
drupal_add_css(drupal_get_path('module', 'kaltura') . '/style/kaltura_modal.css');
$form_state = array(
'title' => t('Kaltura metadata edit'),
'ajax' => TRUE,
'eid' => $entry_id,
);
$output = ctools_modal_form_wrapper('kaltura_metadata_editor_form', $form_state);
if ($form_state['executed'] && $js) {
$commands = array();
$commands[] = ctools_modal_command_dismiss();
print ajax_render($commands);
exit;
}
if (isset($form_state['clicked_button']) && $form_state['clicked_button']['#value'] == 'cancel' && $js) {
$commands = array();
$commands[] = ctools_modal_command_dismiss();
print ajax_render($commands);
exit;
}
print ajax_render($output);
exit;
}