menu_node_edit_user_form

Versions
menu_node_edit
menu_node_edit_user_form($account)

Generate the user form.

Parameters

$account The user account being edited or created.

Return value

Form elements to add to the user edit form.

Code

./menu_node_edit.module, line 640

<?php
function menu_node_edit_user_form($account) {
  $form = array();
  $options = menu_node_edit_get_options();
  if (!user_access('assign menu node edit') || empty($options)) {
    return $form;
  }
  $defaults = menu_node_edit_load_access($account);
  $form['menu_node_edit'] = array(
    '#type' => 'fieldset',
    '#title' => t('Section editing'),
    '#collapsible' => TRUE,
    '#collapsed' => menu_node_edit_variable('collapsed'),
    '#description' => t('Select the site sections in which this user may edit content.'),
    '#tree' => TRUE,
  );
  foreach ($options as $menu => $array) {
    $name = check_plain(db_result(db_query("SELECT title FROM {menu_custom} WHERE menu_name = '%s'", $menu)));
    $form['menu_node_edit'][$menu] = array(
      '#type' => 'fieldset',
      '#title' => $name,
      '#collapsible' => TRUE,
      '#description' => t('Select the !menu sections in which this user may edit content.', array('!menu' => $name)),
      '#tree' => TRUE,
    );
    foreach ($array as $title => $item) {
      $form['menu_node_edit'][$menu][$title]['mlid'] = array(
        '#type' => 'checkboxes',
        '#title' => check_plain($title),
        '#options' => $item,
        '#default_value' => $defaults,
      );
    }
  }
  $form['menu_node_edit_active'] = array('#type' => 'value', '#value' => TRUE);
  return $form;
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List