Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function test_menu() {
- $items['test'] = array(
- 'title' => 'Test Modal',
- 'page callback' => 'test_page',
- 'access callback' => TRUE,
- 'type' => MENU_NORMAL_ITEM,
- );
- $items['test/%ctools_js/test'] = array(
- 'title' => 'Test Content Type',
- 'page callback' => 'modal_content',
- 'page arguments' => array(1),
- 'access callback' => TRUE,
- 'type' => MENU_CALLBACK,
- );
- return $items;
- }
- function test_page() {
- global $user;
- ctools_include('ajax');
- ctools_include('modal');
- ctools_modal_add_js();
- $output = ctools_modal_text_button(t('Modal Content'), 'test/nojs/call', 'test');
- return array('markup' => array('#markup' => $output));
- }
- function modal_content($js = FALSE) {
- ctools_include('node.pages', 'node', '');
- if (!$js) {
- return drupal_get_form('test_node_form');
- }
- ctools_include('modal');
- ctools_include('ajax');
- $form_state = array(
- 'title' => t('Add Notification'),
- 'ajax' => TRUE,
- );
- $output = ctools_modal_form_wrapper('test_node_form', $form_state);
- if (!empty($form_state['executed'])) {
- }
- print ajax_render($output);
- exit;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement