array( 'title' => 'General', 'description' => t('Various Navigate Settings'), 'section' => array( 'performance' => array( 'header' => 'Performance', 'content' => 'This is where performance settings will be.', ) ), ), 'widget' => array( 'title' => t('Widgets'), 'description' => t('Add/Remove Widgets'), 'section' => array( 'add' => array( 'header' => t('Add Widget'), 'content' => '', 'empty' => t('There are currently no plugins enabled. Please visit the "Navigate - Plugins" section on the the !module page to enable them.', array('!module' => l('module settings', 'admin/build/modules'))), 'plugins' => array(), ), 'remove' => array( 'header' => t('Remove Widget'), 'content' => t('To remove a widget, drag it away from the Navigate dock. A droppable area will appear over the page on the right. Drop the widget there to remove it. Once a widget is removed, it no longer exists and cannot be retrieved.'), ) ), ) ); // Create Add Widget section foreach ($_navigate['hooks']['plugin'] as $plugin) { $function = $plugin .'_navigate_plugin'; if (function_exists($function)) { $settings['widget']['section']['add']['content'] .= theme('navigate_settings_add_widget', $function('widget_add')); } } if (!empty($settings['widget']['section']['add']['content'])) { $settings['widget']['section']['add']['content'] = ''; } // Administrative Settings if (navigate_user_access('administer')) { $settings['admin'] = array( 'title' => 'Administration', 'description' => t('Administrative Settings'), 'section' => array( 'roles' => array( 'header' => 'Users & Roles', 'content' => navigate_build_defaults_admin(), ) ), ); } // Process any tab callback data foreach ($settings as $tab => $data) { if ((isset($data['page callback']) && isset($data['page arguments'])) || isset($data['js callback'])) { $callbacks = array( 'jsCallback' => $data['js callback'], 'pageCallback' => array_merge(array('op' => $data['page callback']), $data['page arguments']), ); $settings[$tab]['data'] = ''; } } return $settings; } function navigate_plugin_defaults($plugin = NULL) { global $_navigate; $widgets = &$_navigate['plugin']['default']['widgets']; foreach ($_navigate['hooks']['plugin'] as $module) { if (!isset($widgets[$module])) { $function = $module .'_navigate_plugin'; if (function_exists($function)) { $widget = $function('widget_default'); if (!empty($widget)) { $widgets[$module] = $widget; } } } } if ($plugin) { if (isset($widgets[$plugin])) { return $widgets[$plugin]; } else { return FALSE; } } } function navigate_plugin_install() { global $_navigate; $_navigate['hooks'] = array(); } function navigate_plugin_uninstall() { global $_navigate; $_navigate['hooks'] = array(); }