Skip to content
Snippets Groups Projects
Commit 09cf7779 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

[gh-152] Remove some code mistakenly merged into staging in r839

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@840 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 9b7e4a44
No related branches found
No related tags found
No related merge requests found
......@@ -167,17 +167,17 @@ function unl_menu() {
'page callback' => 'unl_whoami',
'file' => 'unl_whoami.php',
);
// Returns html technical feedback form
// Returns html technical feedback form
$items['user/unl/technical_feedback'] = array(
'title' => 'Technical Feedback',
'description' => 'Returns a form to fill out to give technical feedback',
'access callback' => TRUE,
'page callback' => 'technical_feedback',
'file' => 'technical_feedback.php'
);
$items['admin/content/unl/migration'] = array(
'title' => 'UNL Migration Tool',
'description' => 'Migrate a static UNL template page into drupal',
......@@ -197,7 +197,7 @@ function unl_menu() {
'position' => 'left',
'weight' => -6,
);
$items['_status'] = array(
'title' => 'Still Alive',
'page callback' => 'unl_still_alive',
......@@ -274,75 +274,6 @@ function unl_file_validate($file) {
return;
}
/**
* Implementation of hook_form_BASE_FORM_ID_alter().
*/
function unl_form_node_form_alter(&$form, &$form_state, $form_id) {
/**
* On the node edit form, hide the "Provide a menu link" checkbox since we'll
* be using the menu to build a site hierarchy. Instead, add a button that will
* determine whether or not the menu link is visible or not.
*/
$form['menu']['#title'] = 'Site hierachy';
$form['menu']['enabled']['#default_value'] = TRUE;
$form['menu']['enabled']['#prefix'] = '<div style="display: none;">';
$form['menu']['enabled']['#suffix'] = '</div>';
$form['menu']['link']['link_title']['#required'] = TRUE;
$mlid = $form['menu']['link']['mlid']['#value'];
if ($mlid) {
$menu_link = menu_link_load($mlid);
$default_visible = ($menu_link['hidden'] ? 0 : 1);
}
else {
$default_visible = 0;
}
$form['menu']['visible'] = array(
'#type' => 'checkbox',
'#title' => 'Display in menu',
'#default_value' => $default_visible,
'#weight' => 0,
);
$form['actions']['submit']['#submit'][] = 'unl_node_form_submit';
// Also turn on revisioning by default
$form['revision_information']['revision']['#default_value'] = TRUE;
unset($form['revision_information']['revision']['#states']);
// Also hide the "Promoted to front page" option
$form['options']['promote']['#prefix'] = '<div style="display:none;">';
$form['options']['promote']['#suffix'] = '</div>';
// Also hide the "Sticky at top of lists" option
$form['options']['sticky']['#prefix'] = '<div style="display:none;">';
$form['options']['sticky']['#suffix'] = '</div>';
/*
* Add user-added menus to the Parent Item select box since sub-sites do not have access to edit Available Menus of shared/features Content types.
* @see menu_form_node_form_alter() for what this is replacing
*/
$type = $form['#node']->type;
// Get the menus selected in Available Menus from the Content Type edit form (admin/structure/types/manage/%)
$options = menu_parent_options(menu_get_menus(), $type);
// This line below is the addition to what menu_form_node_form_alter() does. Get only user-added menus and use them in their entirety.
$options_custom = menu_parent_options(menu_get_menus(FALSE), array('mlid' => 0));
$link = $form['#node']->menu;
$default = ($link['mlid'] ? $link['menu_name'] . ':' . $link['plid'] : variable_get('menu_parent_' . $type, 'main-menu:0'));
if (!isset($options[$default])) {
$default = 'navigation:0';
}
$form['menu']['link']['parent'] = array(
'#type' => 'select',
'#title' => t('Parent item'),
'#default_value' => $default,
'#options' => array_merge($options, $options_custom),
'#attributes' => array('class' => array('menu-parent-select')),
);
}
/**
* Implementation of hook_form_FORM_ID_alter() for field_ui_display_overview_form.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment