Hello
I created a plugin that allows you to create and access remote databases from groups of my Elggsite.
But I have a worry because I do not know how to find all the databases in the same group. The pathis displayed in the activity of my group but I do not know how to go to retrieve the name of the database.
Someone should track it?
Thank you in advance
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- perezj@perezj
perezj - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- perezj@perezj
perezj - 0 likes
- perezj@perezj
perezj - 0 likes
You must log in to post replies.Your question does not make much sense. Can you rephrase?
Will adding metadata to your group entities work?
It'not easy to explain!!!
When i am in a group, i can create databases with my plugin called couchdbs.
When i am in the group i can see plugins activated like blog, bookmarks,..., and my plugin couchdbs.
Under my group i can see every databases created in my group like i see all activity of group under group activity or when i go to myserver/myplugin/group/mygroupid/all i see all groups databases but i don't knowhow i can do get the name of all of these databases to permit databases access to group's users.
source of my all.php
<?php
elgg_pop_breadcrumb();
elgg_push_breadcrumb(elgg_echo('couchdbs'));
$offset = (int)get_input('offset', 0);
$content = elgg_list_entities(array(
'type' => 'object',
'subtype' => 'couchdbs',
'limit' => 10,
'offset' => $offset,
'full_view' => false,
'view_toggle_type' => false
));
$title = elgg_echo('couchdbs:everyone');
$body = elgg_view_layout('content', array(
'filter_context' => 'all',
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('couchdbs/sidebar'),
));
echo elgg_view_page($title, $body);
?>
If you replace elgg_list_entities() with elgg_get_entities() you will have an array of all couchdbs objects. You can then iterate through them and get attributes and metadata, e.g.
foreach ($dbs as $db) {
echo $db->title; // assuming the name of the database is stored as 'title'
echo $db->my_custom_meta;
}
i was wrong this next is the source where i can seee the couchdbs of my group
<?php
$group = $vars['entity'];
$icon = elgg_view_entity_icon($group, 'tiny');
$metadata = elgg_view_menu('entity', array(
'entity' => $group,
'handler' => 'groups',
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
));
if (elgg_in_context('owner_block') || elgg_in_context('widgets')) {
$metadata = '';
}
if ($vars['full_view']) {
echo elgg_view("groups/profile/profile_block", $vars);
} else {// brief view
$params = array(
'entity' => $group,'metadata' => $metadata,
'subtitle' => $group->briefdescription,
);
$params = $params + $vars;
$list_body = elgg_view('group/elements/summary', $params);
echo elgg_view_image_block($icon, $list_body, $vars);
}
yes it's ok with the for each you have given me thanks