Elgg  Version 1.11
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 
20  if ($contributor['name']) {
21  $contributor['name'] = elgg_view('output/text', array(
22  'value' => $contributor['name'],
23  ));
24  } else {
25  continue;
26  }
27 
28  if ($contributor['website']) {
29  $contributor['website'] = elgg_view('output/url', array(
30  'href' => $contributor['website'],
31  'text' => $contributor['website'],
32  'is_trusted' => true,
33  ));
34  }
35 
36  if ($contributor['username']) {
37  $contributor['username'] = elgg_view('output/url', array(
38  'href' => "http://community.elgg.org/profile/{$contributor['username']}/",
39  'text' => "@{$contributor['username']}",
40  'is_trusted' => true,
41  ));
42  }
43 
44  if ($contributor['description']) {
45  $contributor['description'] = elgg_view('output/text', array(
46  'value' => $contributor['description'],
47  ));
48  }
49 
50  if ($contributor['name']) { // Name is requiried
51  echo '<li><dl>';
52  foreach ($contributor as $field => $value) {
53  if ($value) {
54  $dt = elgg_echo("admin:plugins:label:contributors:$field");
55  echo "<dt class=\"elgg-plugin-contributor-$field\">$dt</dt>";
56  echo "<dd class=\"elgg-plugin-contributor-$field\">$value</dd>";
57  }
58  }
59  echo '</dl></li>';
60  }
61 }
62 
63 echo '</ul>';
$contributors
$value
Definition: longtext.php:26
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1246
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg echo
Translates a string.
Definition: languages.js:43
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
$plugin
Definition: contributors.php:9
if(file_exists($welcome)) $vars
Definition: upgrade.php:93