Elgg  Version 1.9
access.php
Go to the documentation of this file.
1 <?php
11 $class = "elgg-input-access";
12 
13 if ((!isset($vars['options'])) || (!is_array($vars['options']))) {
14  $vars['options'] = array();
15  $vars['options'] = get_write_access_array();
16 }
17 
18 if (is_array($vars['options']) && sizeof($vars['options']) > 0) {
19 
20  ?>
21 
22  <select name="<?php echo $vars['name']; ?>" class="<?php echo $class; ?>">
23  <?php
24 
25  foreach($vars['options'] as $key => $option) {
26  if ($key != $vars['value']) {
27  echo "<option value=\"{$key}\">{$option}</option>";
28  } else {
29  echo "<option value=\"{$key}\" selected=\"selected\">{$option}</option>";
30  }
31  }
32 
33  ?>
34  </select>
35 
36  <?php
37 
38 }
if($entity) $vars
Definition: access.php:44
$key
Definition: summary.php:34
elgg echo
Translates a string.
Definition: languages.js:43
$class
Elgg access level input Displays a dropdown input field.
Definition: access.php:11
get_write_access_array($user_guid=0, $site_guid=0, $flush=false)
Returns an array of access permissions that the user is allowed to save content with.
Definition: access.php:484