'custom', 'module' => 'navigate_custom', 'content' => navigate_add_widget_link('', 'navigate_custom_load'), ), ); case 'delete': break; } } /** * Generate search widget */ function navigate_custom_widget($wid) { $settings = navigate_widget_settings_get($wid); $inputs['content'] = navigate_textarea(array( 'name' => 'content', 'class' => 'navigate-content-input', 'filters' => 'true', 'callback' => 'navigate_custom_save', 'help' => 'Type your custom code in here', 'wid' => $wid, )); $output = theme('navigate_custom_widget', $inputs, $wid); return $output; } /** * Theme search widget */ function theme_navigate_custom_widget($inputs, $wid) { $content['widget'] = ' '; $content['title'] = t('Custom'); $content['settings'] = ' '; return $content; } /** * Implementation of hook_perm() */ function navigate_custom_perm() { return array("navigate_custom use"); } /** * Implementation of hook_navigate_widget_process() */ function navigate_custom_navigate_widget_process($wid, $action) { switch ($action) { case 'save': echo navigate_custom_save(); break; } } /** * Save the content of a custom widget */ function navigate_custom_save() { $output = navigate_custom_output($_POST['wid']); return $output; } /** * Output the saved content */ function navigate_custom_output($wid) { $settings = navigate_widget_settings_get($wid); if ($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_custom_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_custom use'); return $help; }