contributors.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Shows a list of contributors for ElggPlugin in $vars['plugin'].
  4. *
  5. * @package Elgg.Core
  6. * @subpackage Admin.Plugins
  7. */
  8. $plugin = elgg_extract('plugin', $vars, false);
  9. $contributors = $plugin->getManifest()->getContributors();
  10. if (empty($contributors)) {
  11. return;
  12. }
  13. echo '<ul class="elgg-plugin-contributors">';
  14. foreach ($contributors as $contributor) {
  15. if ($contributor['name']) {
  16. $contributor['name'] = elgg_view('output/text', array(
  17. 'value' => $contributor['name'],
  18. ));
  19. } else {
  20. continue;
  21. }
  22. if ($contributor['website']) {
  23. $contributor['website'] = elgg_view('output/url', array(
  24. 'href' => $contributor['website'],
  25. 'text' => $contributor['website'],
  26. 'is_trusted' => true,
  27. ));
  28. }
  29. if ($contributor['username']) {
  30. $contributor['username'] = elgg_view('output/url', array(
  31. 'href' => "http://community.elgg.org/profile/{$contributor['username']}/",
  32. 'text' => "@{$contributor['username']}",
  33. 'is_trusted' => true,
  34. ));
  35. }
  36. if ($contributor['description']) {
  37. $contributor['description'] = elgg_view('output/text', array(
  38. 'value' => $contributor['description'],
  39. ));
  40. }
  41. if ($contributor['name']) { // Name is requiried
  42. echo '<li><dl>';
  43. foreach ($contributor as $field => $value) {
  44. if ($value) {
  45. $dt = elgg_echo("admin:plugins:label:contributors:$field");
  46. echo "<dt class=\"elgg-plugin-contributor-$field\">$dt</dt>";
  47. echo "<dd class=\"elgg-plugin-contributor-$field\">$value</dd>";
  48. }
  49. }
  50. echo '</dl></li>';
  51. }
  52. }
  53. echo '</ul>';