Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
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.
elgg_view_icon($name, $vars=array())
View one of the icons.
Definition: views.php:1447
$n
Profile fields.
Definition: list.php:9
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$fieldlist
Definition: list.php:12
$url
Definition: exceptions.php:24
ul
Definition: admin.css.php:44
elgg river comments li
$item
Definition: item.php:12
$loaded_defaults
Definition: list.php:10
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:342
$items
Definition: list.php:11
b
Definition: admin.css.php:56
if(!$display_name) $type
Definition: delete.php:27