Elgg  Version 1.11
list.php
Go to the documentation of this file.
1 <?php
8 // List form elements
9 $n = 0;
10 $loaded_defaults = array();
11 $items = array();
12 $fieldlist = elgg_get_config('profile_custom_fields');
13 if ($fieldlist || $fieldlist === '0') {
14  $fieldlistarray = explode(',', $fieldlist);
15  foreach ($fieldlistarray as $listitem) {
16  $translation = elgg_get_config("admin_defined_profile_$listitem");
17  $type = elgg_get_config("admin_defined_profile_type_$listitem");
18  if ($translation && $type) {
19  $item = new stdClass;
20  $item->translation = $translation;
21  $item->shortname = $listitem;
22  $item->name = "admin_defined_profile_$listitem";
23  $item->type = elgg_echo("profile:field:$type");
24  $items[] = $item;
25  }
26  }
27 }
28 ?>
29 <ul id="elgg-profile-fields" class="mvm">
30 <?php
31 
32 foreach ($items as $item) {
33  echo elgg_view("profile/", array('value' => $item->translation));
34 
35  //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
36  $url = elgg_view('output/url', array(
37  'href' => "action/profile/fields/delete?id={$item->shortname}",
38  'text' => elgg_view_icon('delete-alt'),
39  'is_action' => true,
40  'is_trusted' => true,
41  ));
42  $type = elgg_echo($item->type);
43  $drag_arrow = elgg_view_icon("drag-arrow", "elgg-state-draggable");
44  echo <<<HTML
45 <li id="$item->shortname" class="clearfix">
46  $drag_arrow
47  <b><span id="elgg-profile-field-{$item->shortname}" class="elgg-state-editable">{$item->translation}</span></b> [$type] $url
48 </li>
49 HTML;
50 }
51 
52 ?>
53 </ul>
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
$n
Profile fields.
Definition: list.php:9
ul
Definition: admin.php:44
elgg_view_icon($name, $vars=array())
View one of the elgg sprite icons.
Definition: views.php:1403
$fieldlist
Definition: list.php:12
$url
Definition: exceptions.php:24
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
b
Definition: admin.php:56
$item
Definition: item.php:12
$loaded_defaults
Definition: list.php:10
elgg echo
Translates a string.
Definition: languages.js:43
$type
Definition: add.php:8
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
ui datepicker td span
Definition: admin.php:634
$items
Definition: list.php:11
elgg menu user li
Definition: admin.php:211