From f50849a3a3896dd5ccbdcc1d046a1fd1d5de265c Mon Sep 17 00:00:00 2001 From: bachy Date: Sat, 4 Feb 2012 18:57:50 +0100 Subject: [PATCH 1/3] first import Signed-off-by: bachy --- contentsadminrelink.info | 29 ++++++++++++ contentsadminrelink.module | 90 +++++++++++++++++++++++++++++++++++++ icon.png | Bin 0 -> 690 bytes 3 files changed, 119 insertions(+) create mode 100644 contentsadminrelink.info create mode 100644 contentsadminrelink.module create mode 100644 icon.png diff --git a/contentsadminrelink.info b/contentsadminrelink.info new file mode 100644 index 00000000..53fae05c --- /dev/null +++ b/contentsadminrelink.info @@ -0,0 +1,29 @@ +name = Contents admin relink +description = "Relink admin/content and admin/content/node with the path of your choice (a view for example)" + +; Core version (required) +core = 7.x + +; Package name (see http://drupal.org/node/542202 for a list of names) +; package = + +; PHP version requirement (optional) +; php = 5.2 + +; Loadable code files +; files[] = contentsadminrelink.module +; files[] = contentsadminrelink.admin.inc +; files[] = contentsadminrelink.class.inc + +; Module dependencies +; dependencies[] = mymodule +; dependencies[] = theirmodule (1.2) +; dependencies[] = anothermodule (>=2.4) +; dependencies[] = views (3.x) + +; Configuration page +; configure = admin/config/contentsadminrelink + + +; For further information about configuration options, see +; - http://drupal.org/node/542202 diff --git a/contentsadminrelink.module b/contentsadminrelink.module new file mode 100644 index 00000000..95bdd56e --- /dev/null +++ b/contentsadminrelink.module @@ -0,0 +1,90 @@ + array( + 'title' => t('Access core content overview'), + // 'description' => t('Perform administration tasks for my module.'), + ), + 'access core media overview' => array( + 'title' => t('Access classic media overview'), + // 'description' => t('Perform administration tasks for my module.'), + ), + + ); +} + +/** + * Implements hook_menu_alter(). + */ +function contentsadminrelink_menu_alter(&$items) { + // dsm($items, '$items'); + if(isset($items['admin/content'])) + $items['admin/content']['access arguments'] = array('access core content overview'); + + if(isset($items['admin/content/node'])) + $items['admin/content/node']['access arguments'] = array('access core content overview'); + + if(isset($items['admin/content/media'])) + $items['admin/content/media']['access arguments'] = array('access classic media overview'); + + // dsm($items, '$items'); +} + +/** + * Implements hook_menu_local_tasks_alter(). + */ +function contentsadminrelink_menu_local_tasks_alter(&$data, $router_item, $root_path) { + switch($root_path){ + case 'admin/content/nodes' : // for example 'page/view/news' + $item = menu_get_item('node/add'); + if ($item['access']) { + $data['actions']['output'][] = array( + '#theme' => 'menu_local_action', + '#link' => $item, + ); + } + break; + // case 'admin/content/medias' : // for example 'page/view/news' + // $item = menu_get_item('admin/content/media/import'); + // if ($item['access']) { + // $data['actions']['output'][] = array( + // '#theme' => 'menu_local_action', + // '#link' => $item, + // ); + // } + // break; + + } + +} diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ea1a1090acb247d648a63596fa6d6a02fcfb56d1 GIT binary patch literal 690 zcmV;j0!{siP)>&&c1_NL6)oSGvuSq-i`~AMy@Au&W zq|<3xogU-y_@6HH0PL;lvYrB+Qq}v#V&S`nAoZXXw<7A&e?4@O1%bRqy)yuFF_T&V zRw@TV!e^6aW-nDwRAC2vW6$-nZLrA6qjS5IGF|(#KbS8?u$7tH`@Q&;JA% Y04Qla$nB&I5&!@I07*qoM6N<$f-@&KdjJ3c literal 0 HcmV?d00001 From c0a96539757d325d6104154292045f9ac4c61192 Mon Sep 17 00:00:00 2001 From: bachy Date: Mon, 21 May 2012 17:52:04 +0200 Subject: [PATCH 2/3] add shortcuts action to materiaux/breves & companies admin pages Signed-off-by: bachy --- contentsadminrelink.module | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/contentsadminrelink.module b/contentsadminrelink.module index 95bdd56e..fc0ddc43 100644 --- a/contentsadminrelink.module +++ b/contentsadminrelink.module @@ -75,6 +75,41 @@ function contentsadminrelink_menu_local_tasks_alter(&$data, $router_item, $root_ ); } break; + case 'admin/content/materiaux' : + $item = menu_get_item('node/add/materiau'); + if ($item['access']) { + $data['actions']['output'][] = array( + '#theme' => 'menu_local_action', + '#link' => $item, + ); + } + $item = menu_get_item('node/add/breve'); + if ($item['access']) { + $data['actions']['output'][] = array( + '#theme' => 'menu_local_action', + '#link' => $item, + ); + } + + break; + case 'admin/content/companies' : + $item = menu_get_item('node/add/company'); + if ($item['access']) { + $data['actions']['output'][] = array( + '#theme' => 'menu_local_action', + '#link' => $item, + ); + } + $item = menu_get_item('admin/people/create'); + if ($item['access']) { + $data['actions']['output'][] = array( + '#theme' => 'menu_local_action', + '#link' => $item, + ); + } + + break; + // case 'admin/content/medias' : // for example 'page/view/news' // $item = menu_get_item('admin/content/media/import'); // if ($item['access']) { From 2543d32599004979c40ac1059aa48d41d67bfc02 Mon Sep 17 00:00:00 2001 From: bachy Date: Tue, 9 Oct 2012 21:37:17 +0200 Subject: [PATCH 3/3] =?UTF-8?q?add=20=E2=80=9Cpeople=20create"=20short=20c?= =?UTF-8?q?ut=20on=20admin/user=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bachy --- contentsadminrelink.module | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/contentsadminrelink.module b/contentsadminrelink.module index fc0ddc43..aa340a3b 100644 --- a/contentsadminrelink.module +++ b/contentsadminrelink.module @@ -109,7 +109,16 @@ function contentsadminrelink_menu_local_tasks_alter(&$data, $router_item, $root_ } break; - + case 'admin/users' : + $item = menu_get_item('admin/people/create'); + if ($item['access']) { + $data['actions']['output'][] = array( + '#theme' => 'menu_local_action', + '#link' => $item, + ); + } + break; + // case 'admin/content/medias' : // for example 'page/view/news' // $item = menu_get_item('admin/content/media/import'); // if ($item['access']) {