api_client->users_isAppAdded()) $front = $fb_navigation_data['front_added']; else if ($fb->get_loggedin_user()) $front = $fb_navigation_data['front_loggedin']; else $front = $fb_navigation_data['front_anonymous']; if ($front) menu_set_active_item(drupal_get_normal_path($front)); } } } /** * Implementation of hook_form_alter. */ function fb_navigation_form_alter($form_id, &$form) { // Add our settings to the fb_app edit form. if (is_array($form['fb_app_data'])) { $node = $form['#node']; $fb_app_data = fb_app_get_data($node->fb_app); $fb_navigation_data = $fb_app_data['fb_navigation']; $form['fb_app_data']['fb_navigation'] = array('#type' => 'fieldset', '#collapsible' => TRUE, '#collapsed' => TRUE, '#title' => t('Facebook navigation settings'), '#description' => t('Allows application-specific front page and navigation links.') ); $form['fb_app_data']['fb_navigation']['front_anonymous'] = array('#type' => 'textfield', '#title' => t('Front page when user is not logged in'), '#description' => t('Leave blank to use the site-wide front page.'), '#default_value' => $fb_navigation_data['front_anonymous'], ); $form['fb_app_data']['fb_navigation']['front_loggedin'] = array('#type' => 'textfield', '#title' => t('Front page when user is logged in, but has not added the app.'), '#description' => t('Leave blank to use the site-wide front page.'), '#default_value' => $fb_navigation_data['front_loggedin'], ); $form['fb_app_data']['fb_navigation']['front_added'] = array('#type' => 'textfield', '#title' => t('Front page when user has added this application.'), '#description' => t('Leave blank to use the site-wide front page.'), '#default_value' => $fb_navigation_data['front_added'], ); } } ?>