Am updating this code to enable user edit information provided in support of their uploaded content like mp3. The link does not load the edit page with forms to make changes.
.......................
//if the user can edit, display edit and delete links
if ($file->canEdit()) {
echo "<div class=\"filerepo_controls\"><p>";
echo "<a href=\"{elgg_get_site_url()}mod/file/edit.php?file_guid={$file->getGUID()}\">" . elgg_echo('edit') . "</a> ";
echo elgg_view('output/confirmlink',array(
'href' => elgg_get_site_url() . "action/file/delete?file=" . $file->getGUID(),
'text' => elgg_echo("delete"),
'confirm' => elgg_echo("file:delete:confirm"),
));
echo "</p></div>";
}
} else {
echo "<p class=\"filerepo_title\">{$title}</p>";
echo "<a href=\"{$file->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $mime, 'thumbnail' => $file->thumbnail, 'file_guid' => $file_guid, 'size' => 'large')) . "</a>";
echo "<p class=\"filerepo_timestamp\"><small><a href=\"{elgg_get_site_url()]}file/{$owner->username}\">{$owner->name}</a> {$friendlytime}</small></p>";
//get the number of comments
$numcomments = ElggEntitycountComments($file);
if ($numcomments)
echo "<p class=\"filerepo_comments\"><a href=\"{$file->getURL()}\">" . sprintf(elgg_echo("comments")) . " (" . $numcomments . ")</a></p>";
}
echo "</div>";
....................................
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.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 2 likes
- kxx4@kxx4
kxx4 - 0 likes
You must log in to post replies.@RvR: hahahahah