Elgg  Version 3.0
contributors.php
Go to the documentation of this file.
1 <?php
9 $plugin = elgg_extract('plugin', $vars, false);
10 $contributors = $plugin->getManifest()->getContributors();
11 
12 if (empty($contributors)) {
13  return;
14 }
15 
16 echo '<ul class="elgg-plugin-contributors">';
17 
18 foreach ($contributors as $contributor) {
19  if ($contributor['name']) {
20  $contributor['name'] = elgg_view('output/text', [
21  'value' => $contributor['name'],
22  ]);
23  } else {
24  continue;
25  }
26 
27  if ($contributor['website']) {
28  $contributor['website'] = elgg_view('output/url', [
29  'href' => $contributor['website'],
30  'text' => $contributor['website'],
31  'is_trusted' => true,
32  ]);
33  }
34 
35  if ($contributor['username']) {
36  $contributor['username'] = elgg_view('output/url', [
37  'href' => "http://community.elgg.org/profile/{$contributor['username']}/",
38  'text' => "@{$contributor['username']}",
39  'is_trusted' => true,
40  ]);
41  }
42 
43  if ($contributor['description']) {
44  $contributor['description'] = elgg_view('output/text', [
45  'value' => $contributor['description'],
46  ]);
47  }
48 
49  if ($contributor['name']) { // Name is requiried
50  echo '<li><dl>';
51  foreach ($contributor as $field => $value) {
52  if ($value) {
53  $dt = elgg_echo("admin:plugins:label:contributors:$field");
54  echo "<dt class=\"elgg-plugin-contributor-$field\">$dt</dt>";
55  echo "<dd class=\"elgg-plugin-contributor-$field\">$value</dd>";
56  }
57  }
58  echo '</dl></li>';
59  }
60 }
61 
62 echo '</ul>';
$contributors
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$dt
Definition: time.php:69
elgg echo
Translates a string.
Definition: languages.js:43
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1131
if(elgg_extract('required', $vars)) $field
Definition: field.php:34
$value
Definition: debugging.php:7
$plugin
Definition: contributors.php:9
$vars['type']
Definition: save.php:11
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246