diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-08 06:09:02 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-08 06:09:02 +0000 |
commit | 978c2a7bba800e92d21b17d5398cba02ccd63645 (patch) | |
tree | 6aff590e6fe3f496c64eb4a3b6c2eaa2543548f2 /mod/thewire/start.php | |
parent | 47d476c3a6a1a58fc7cc0d4078248d83e1ab7de8 (diff) | |
download | elgg-978c2a7bba800e92d21b17d5398cba02ccd63645.tar.gz elgg-978c2a7bba800e92d21b17d5398cba02ccd63645.tar.bz2 |
Fixes #3025: The wire uses core's metadata view.
git-svn-id: http://code.elgg.org/elgg/trunk@8633 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/thewire/start.php')
-rw-r--r-- | mod/thewire/start.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mod/thewire/start.php b/mod/thewire/start.php index 0f51d052e..a9a576904 100644 --- a/mod/thewire/start.php +++ b/mod/thewire/start.php @@ -24,6 +24,9 @@ function thewire_init() { // add a site navigation item
$item = new ElggMenuItem('thewire', elgg_echo('thewire'), 'pg/thewire/all');
elgg_register_menu_item('site', $item);
+
+ // remove entity menu items edit and access because they don't apply here.
+ elgg_register_plugin_hook_handler('prepare', 'menu:entity', 'thewire_remove_entity_menu_items');
// Extend system CSS with our own styles, which are defined in the thewire/css view
elgg_extend_view('css', 'thewire/css');
@@ -354,4 +357,26 @@ function thewire_test($hook, $type, $value, $params) { global $CONFIG;
$value[] = $CONFIG->pluginspath . 'thewire/tests/regex.php';
return $value;
+}
+
+/**
+ * Removes the access and edit items from the entity menu
+ *
+ * @param type $hook
+ * @param type $type
+ * @param type $value
+ * @param type $params
+ * @return array
+ */
+function thewire_remove_entity_menu_items($hook, $type, $value, $params) {
+ if (elgg_in_context('thewire')) {
+ $menu = elgg_extract('default', $value, array());
+ foreach ($menu as $i => $entry) {
+ $name = $entry->getName();
+ if ($name == 'access' || $name == 'edit') {
+ unset($value['default'][$i]);
+ }
+ }
+ return $value;
+ }
}
\ No newline at end of file |