Changing project tabs order

This commit is contained in:
Manuel Cillero 2017-09-01 08:21:18 +02:00
parent 2e117ffa26
commit 527efa9b29
2 changed files with 28 additions and 28 deletions

View file

@ -37,7 +37,7 @@ function book_made_simple_menu()
$items['admin/settings/book_made_simple'] = array( $items['admin/settings/book_made_simple'] = array(
'title' => t('BookMadeSimple settings'), 'title' => t('BookMadeSimple settings'),
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('book_made_simple_settings_form'), 'page arguments' => array('book_made_simple_settings_form'),
'access arguments' => array('administer site configuration'), 'access arguments' => array('administer site configuration'),
'description' => t('BookMadeSimple module settings.'), 'description' => t('BookMadeSimple module settings.'),
'type' => MENU_NORMAL_ITEM, 'type' => MENU_NORMAL_ITEM,
@ -49,7 +49,7 @@ function book_made_simple_menu()
'access callback' => 'is_reorder_access', 'access callback' => 'is_reorder_access',
'access arguments' => array(1), 'access arguments' => array(1),
'type' => MENU_LOCAL_TASK, 'type' => MENU_LOCAL_TASK,
'weight' => 2 'weight' => 4
); /* ); /*
$items['node/%node/outline'] = array( $items['node/%node/outline'] = array(
'title' => 'Outline', 'title' => 'Outline',
@ -124,7 +124,7 @@ function book_made_simple_settings_form()
'#description' => t('Check content-type that can be included as child in a book. This selection is overriden by selection in content-type settings.'), '#description' => t('Check content-type that can be included as child in a book. This selection is overriden by selection in content-type settings.'),
); );
$form['book_made_simple']['book_made_simple_add_types'] = array( $form['book_made_simple']['book_made_simple_add_types'] = array(
'#type' => 'checkboxes', '#type' => 'checkboxes',
'#options' => $types, '#options' => $types,
'#multiple' => true, '#multiple' => true,
'#default_value' => variable_get('book_made_simple_add_types', array()), '#default_value' => variable_get('book_made_simple_add_types', array()),
@ -138,7 +138,7 @@ function book_made_simple_settings_form()
'#description' => t('Check content-types if you want they will automatically be created as main page of a book.'), '#description' => t('Check content-types if you want they will automatically be created as main page of a book.'),
); );
$form['book_made_simple2']['book_made_simple_auto_main_page'] = array( $form['book_made_simple2']['book_made_simple_auto_main_page'] = array(
'#type' => 'checkboxes', '#type' => 'checkboxes',
'#options' => $types, '#options' => $types,
'#multiple' => true, '#multiple' => true,
'#default_value' => variable_get('book_made_simple_auto_main_page', array()), '#default_value' => variable_get('book_made_simple_auto_main_page', array()),
@ -151,7 +151,7 @@ function book_made_simple_settings_form()
'#collapsed' => FALSE, '#collapsed' => FALSE,
); );
$form['book_made_simple3']['book_made_simple_limit_depth'] = array( $form['book_made_simple3']['book_made_simple_limit_depth'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Default limit book depth'), '#title' => t('Default limit book depth'),
'#default_value' => variable_get('book_made_simple_limit_depth', 99), '#default_value' => variable_get('book_made_simple_limit_depth', 99),
'#description' => t('Maximum number of childs for a book'), '#description' => t('Maximum number of childs for a book'),
@ -159,33 +159,33 @@ function book_made_simple_settings_form()
'#size' => 2, '#size' => 2,
); );
$form['book_made_simple3']['book_made_simple_admin_use_css'] = array( $form['book_made_simple3']['book_made_simple_admin_use_css'] = array(
'#type' => 'checkbox', '#type' => 'checkbox',
'#title' => t('Disable BMS settings layout'), '#title' => t('Disable BMS settings layout'),
'#default_value' => variable_get('book_made_simple_admin_use_css', false), '#default_value' => variable_get('book_made_simple_admin_use_css', false),
'#description' => t('Check to disable BMS layout (content types as columns).'), '#description' => t('Check to disable BMS layout (content types as columns).'),
); );
$form['book_made_simple3']['book_made_simple_hide_default_add_child'] = array( $form['book_made_simple3']['book_made_simple_hide_default_add_child'] = array(
'#type' => 'checkbox', '#type' => 'checkbox',
'#title' => t('Hide default add child link'), '#title' => t('Hide default add child link'),
'#default_value' => variable_get('book_made_simple_hide_default_add_child', true), '#default_value' => variable_get('book_made_simple_hide_default_add_child', true),
'#description' => t('Check to hide default add child page link.'), '#description' => t('Check to hide default add child page link.'),
); );
$form['book_made_simple3']['book_made_simple_child_list_style'] = array( $form['book_made_simple3']['book_made_simple_child_list_style'] = array(
'#type' => 'radios', '#type' => 'radios',
'#title' => t('Style of child list'), '#title' => t('Style of child list'),
'#options' => array("DDLIST" => t("Dropdown listbox"),"LI" => t("Unordered list"),"THEME" => t("Themeable function")), '#options' => array("DDLIST" => t("Dropdown listbox"),"LI" => t("Unordered list"),"THEME" => t("Themeable function")),
'#default_value' => variable_get('book_made_simple_child_list_style', "DDLIST"), '#default_value' => variable_get('book_made_simple_child_list_style', "DDLIST"),
'#description' => t('Choose the style of the child list.'), '#description' => t('Choose the style of the child list.'),
); );
$form['book_made_simple3']['book_made_simple_child_list_style_position'] = array( $form['book_made_simple3']['book_made_simple_child_list_style_position'] = array(
'#type' => 'select', '#type' => 'select',
'#title' => t('Child list position in links area'), '#title' => t('Child list position in links area'),
'#options' => array("FIRST" => t("First"),"LAST" => t("Last")), '#options' => array("FIRST" => t("First"),"LAST" => t("Last")),
'#default_value' => variable_get('book_made_simple_child_list_style_position', "FIRST"), '#default_value' => variable_get('book_made_simple_child_list_style_position', "FIRST"),
'#description' => t('Choose where to print child list in the links area'), '#description' => t('Choose where to print child list in the links area'),
); );
$form['book_made_simple3']['book_made_simple_reorder_link'] = array( $form['book_made_simple3']['book_made_simple_reorder_link'] = array(
'#type' => 'radios', '#type' => 'radios',
'#title' => t('Show reorder tab even if book is empty'), '#title' => t('Show reorder tab even if book is empty'),
'#options' => array("0"=>t("No"),"1" => t("Yes")), '#options' => array("0"=>t("No"),"1" => t("Yes")),
'#default_value' => variable_get('book_made_simple_reorder_link', "0"), '#default_value' => variable_get('book_made_simple_reorder_link', "0"),
@ -212,7 +212,7 @@ function book_made_simple_form_alter(&$form, $form_state, $form_id)
{ {
//$form['book']['bid']['#default_value'] = 0; //$form['book']['bid']['#default_value'] = 0;
$nid = isset($node->nid) ? $node->nid : 'new'; $nid = isset($node->nid) ? $node->nid : 'new';
unset($form['book']['bid']['#options'][$nid]); unset($form['book']['bid']['#options'][$nid]);
$form['#node']->nid = isset($form['#node']->nid) ? $form['#node']->nid : '0'; $form['#node']->nid = isset($form['#node']->nid) ? $form['#node']->nid : '0';
$form['#node']->book['original_bid'] = $form['#node']->nid; $form['#node']->book['original_bid'] = $form['#node']->nid;
} }
@ -243,7 +243,7 @@ function book_made_simple_form_alter(&$form, $form_state, $form_id)
} }
} }
} }
//3 : show/hide Outline section //3 : show/hide Outline section
$book = $node->book; $book = $node->book;
if (is_outline_access($node)) if (is_outline_access($node))
{ {
@ -263,19 +263,19 @@ function book_made_simple_form_alter(&$form, $form_state, $form_id)
} }
if ($node->status == 0) { if ($node->status == 0) {
$form['book']['bid']['#options'][$node->nid] = $node->title; $form['book']['bid']['#options'][$node->nid] = $node->title;
} }
return $form; return $form;
} }
switch ($form["#id"]) switch ($form["#id"])
{ {
case "node-type-form" : // $type . '_node_settings': case "node-type-form" : // $type . '_node_settings':
$type = $form["#node_type"]->type; $type = $form["#node_type"]->type;
$default = array_key_exists($type,variable_get('book_made_simple_auto_main_page',array())); $default = array_key_exists($type,variable_get('book_made_simple_auto_main_page',array()));
$form['book_made_simple'] = array( $form['book_made_simple'] = array(
'#type' => 'fieldset', '#type' => 'fieldset',
'#attributes' => array('class' => 'bms-fieldset'), '#attributes' => array('class' => 'bms-fieldset'),
'#title' => t('BookMadeSimple'), '#title' => t('BookMadeSimple'),
'#collapsible' => TRUE, '#collapsible' => TRUE,
'#collapsed' => TRUE, '#collapsed' => TRUE,
@ -289,7 +289,7 @@ function book_made_simple_form_alter(&$form, $form_state, $form_id)
); );
$types = node_get_types("names"); $types = node_get_types("names");
$form['book_made_simple']['1']['book_made_simple_for_type'] = array( $form['book_made_simple']['1']['book_made_simple_for_type'] = array(
'#type' => 'checkboxes', '#type' => 'checkboxes',
'#options' => $types, '#options' => $types,
'#multiple' => true, '#multiple' => true,
'#default_value' => variable_get('book_made_simple_for_type_' . $type, array()), '#default_value' => variable_get('book_made_simple_for_type_' . $type, array()),
@ -312,13 +312,13 @@ function book_made_simple_form_alter(&$form, $form_state, $form_id)
'#collapsed' => FALSE, '#collapsed' => FALSE,
); );
$form['book_made_simple']['2']['book_made_simple_for_book'] = array( $form['book_made_simple']['2']['book_made_simple_for_book'] = array(
'#type' => 'checkboxes', '#type' => 'checkboxes',
'#options' => $types, '#options' => $types,
'#multiple' => true, '#multiple' => true,
'#default_value' => $aa, '#default_value' => $aa,
); );
$form['book_made_simple']['3'] = array( $form['book_made_simple']['3'] = array(
'#attributes' => array('class' =>'bms-other-settings'), '#attributes' => array('class' =>'bms-other-settings'),
'#type' => 'fieldset', '#type' => 'fieldset',
'#collapsible' => TRUE, '#collapsible' => TRUE,
'#collapsed' => FALSE, '#collapsed' => FALSE,
@ -326,7 +326,7 @@ function book_made_simple_form_alter(&$form, $form_state, $form_id)
$varTypes = variable_get('book_made_simple_auto_main_page',array()); $varTypes = variable_get('book_made_simple_auto_main_page',array());
$default = (array_key_exists($type, $varTypes) && $varTypes[$type] != "0"); $default = (array_key_exists($type, $varTypes) && $varTypes[$type] != "0");
$form['book_made_simple']['3']['book_made_simple_auto_main_page'] = array( $form['book_made_simple']['3']['book_made_simple_auto_main_page'] = array(
'#attributes' => array('style' =>'float:none;clear:both'), '#attributes' => array('style' =>'float:none;clear:both'),
'#type' => 'checkbox', '#type' => 'checkbox',
'#title' => t('Auto create book main page'), '#title' => t('Auto create book main page'),
'#default_value' => $default, '#default_value' => $default,
@ -443,7 +443,7 @@ function book_made_simple_form_submit($form, &$form_state)
$a[$type]= $type; $a[$type]= $type;
variable_set('book_made_simple_for_type_' . $ctype, $a); variable_set('book_made_simple_for_type_' . $ctype, $a);
} }
} }
variable_del("book_made_simple_for_book_" . $type); variable_del("book_made_simple_for_book_" . $type);
} }
/** /**
@ -488,7 +488,7 @@ function book_made_simple_link($type, $node = null, $teaser = false)
$query['gids[]'] = $group_node->nid; $query['gids[]'] = $group_node->nid;
} }
} }
$links['book_made_simple_' . $type] = array( $links['book_made_simple_' . $type] = array(
'title' => t('Add !content-type', array('!content-type' => t($name))), 'title' => t('Add !content-type', array('!content-type' => t($name))),
'href' => "node/add/" . $type, 'href' => "node/add/" . $type,
@ -533,7 +533,7 @@ function book_made_simple_theme()
* Array of allowed child type. * Array of allowed child type.
* @param $node * @param $node
* Source node * Source node
* @return * @return
* Html code to display allowed child type * Html code to display allowed child type
*/ */
@ -567,7 +567,7 @@ function book_made_simple_add_child_book_content_types_ddlist($allowedTypes, $no
$newUrl .= '&gids[]=' . $group_node->nid; $newUrl .= '&gids[]=' . $group_node->nid;
} }
} }
return "<select onchange='location.href=\"" . $newUrl . "\"'>$html</select>"; return "<select onchange='location.href=\"" . $newUrl . "\"'>$html</select>";
} }
/** /**
@ -605,7 +605,7 @@ function book_made_simple_nodeapi(&$node, $op, $teaser, $page)
} }
break; break;
// Hack for translation module. Adding parent property to automatically select parent book. // Hack for translation module. Adding parent property to automatically select parent book.
case "prepare translation": case "prepare translation":
$translation = $node->translation_source; $translation = $node->translation_source;
if (isset($translation->book) && (! isset($_GET["parent"]))) if (isset($translation->book) && (! isset($_GET["parent"])))
{ {
@ -649,7 +649,7 @@ function book_made_simple_nodeapi(&$node, $op, $teaser, $page)
else { else {
switch ($op) switch ($op)
{ {
// Hide standard add Child link // Hide standard add Child link
case 'alter': case 'alter':
if ($node->links) if ($node->links)
{ {

View file

@ -268,7 +268,7 @@ function stormtask_menu() {
'access arguments' => array(1), 'access arguments' => array(1),
'file' => 'stormtask.admin.inc', 'file' => 'stormtask.admin.inc',
'type' => MENU_LOCAL_TASK, 'type' => MENU_LOCAL_TASK,
'weight' => 4 'weight' => 5
); );
$items['storm/project_tasks_js/%'] = array( $items['storm/project_tasks_js/%'] = array(
'title' => 'Tasks', 'title' => 'Tasks',
@ -293,7 +293,7 @@ function stormtask_menu() {
'access arguments' => array('Storm task: access'), 'access arguments' => array('Storm task: access'),
'type' => MENU_NORMAL_ITEM, 'type' => MENU_NORMAL_ITEM,
'file' => 'stormtask.admin.inc', 'file' => 'stormtask.admin.inc',
'weight' => 4, 'weight' => 5,
); );
$items['admin/settings/suitedesk/task'] = array( $items['admin/settings/suitedesk/task'] = array(