Elgg  Version 1.11
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.
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
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
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:419
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
const REFERER
Definition: elgglib.php:1995
$id
Elgg profile plugin edit default profile action removal.
Definition: delete.php:7
elgg system_message
Wrapper function for system_messages.
Definition: elgglib.js:374
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:383