array( 'navigate_block' => array( 'callback' => NULL, 'content' => 'Block', 'name' => 'Block', 'single' => FALSE, ), ) ); break; case 'delete': break; } } /** * Generate search widget */ function navigate_block_widget($wid) { $settings = navigate_widget_settings_get($wid); $inputs['content'] = navigate_textarea(array( 'name' => 'content', 'class' => 'navigate-content-input', 'filters' => 'true', 'callback' => 'navigate_block_save', 'help' => 'Type your custom code in here', 'wid' => $wid, )); $output = theme('navigate_block_widget', $inputs, $wid); return $output; } /** * Theme search widget */ function theme_navigate_block_widget($inputs, $wid) { $content['widget'] = '
'; $content['title'] = t('Custom'); $content['settings'] = ' '; return $content; } /** * Implementation of hook_perm(). */ function navigate_block_perm() { return array("navigate_block use"); } /** * Implementation of hook_navigate_widget_process(). */ function navigate_block_navigate_widget_process($wid, $action) { switch ($action) { case 'save': echo navigate_block_save(); break; } } /** * Save the content of a custom widget */ function navigate_block_save() { $output = navigate_block_output($_POST['wid']); return $output; } /** * Output the saved content */ function navigate_block_output($wid) { $settings = navigate_widget_settings_get($wid); $settings['content_format'] = isset($settings['content_format']) ? $settings['content_format'] : ''; $settings['content'] = isset($settings['content']) ? $settings['content'] : t('Click this widget\'s settings button to change this content.'); $output = check_markup($settings['content'], $settings['content_format']); return $output; } /** * Implementation of hook_navigate_help_page(). */ function navigate_block_navigate_help_page() { $help['content'] = t('The Custom widget allows you to add arbitrary code to your Navigate bar, based on what input filters you have available to you. This includes PHP code, for example, if you are allowed to use that filter. Click the settings icon in the upper right hand corner of the widget to display a textbox where you can add your code.
'); $help['title'] = 'Custom'; $help['access'] = user_access('navigate_block use'); return $help; } /** * Implementation of hook_theme(). */ function navigate_block_theme() { return array( 'navigate_block_widget' => array( 'arguments' => array('inputs' => NULL, 'wid' => NULL), ), ); }