Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
delete.php
Go to the documentation of this file.
1 <?php
7 $id = get_input('id');
8 
9 $fieldlist = elgg_get_config('profile_custom_fields');
10 if (!$fieldlist) {
11  $fieldlist = '';
12 }
13 
14 $fieldlist = str_replace("{$id},", "", $fieldlist);
15 $fieldlist = str_replace(",{$id}", "", $fieldlist);
16 $fieldlist = str_replace("{$id}", "", $fieldlist);
17 
18 if ($id &&
19  unset_config("admin_defined_profile_$id") &&
20  unset_config("admin_defined_profile_type_$id") &&
21  elgg_save_config('profile_custom_fields', $fieldlist)) {
22 
23  system_message(elgg_echo('profile:editdefault:delete:success'));
24 } else {
25  register_error(elgg_echo('profile:editdefault:delete:fail'));
26 }
27 
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
unset_config($name, $site_guid=0)
Removes a config setting.
elgg_save_config($name, $value, $site_guid=0)
Save a configuration setting.
$fieldlist
Definition: delete.php:9
register_error($error)
Display an error on next page load.
Definition: elgglib.php:452
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
const REFERER
Definition: elgglib.php:2029
$id
Elgg profile plugin edit default profile action removal.
Definition: delete.php:7
forward($location="", $reason= 'system')
Forward to $location.
Definition: elgglib.php:93
system_message($message)
Display a system message on next page load.
Definition: elgglib.php:438