Exemple #1
0
/**
 * @deprecated Replaced by {@link phorum_api_custom_field_configure()}.
 */
function phorum_api_custom_profile_field_configure($field)
{
    require_once PHORUM_PATH . '/include/api/custom_field.php';
    $field['field_type'] = PHORUM_CUSTOM_FIELD_USER;
    return phorum_api_custom_field_configure($field);
}
Exemple #2
0
            print htmlspecialchars($_POST['show_in_admin']);
            ?>
" />
            <input type="submit" name="restore" value="Restore deleted field" />
            <input type="submit" name="create" value="Create new field" />
          </form>
        </div>
        <?php 
            return;
        }
    }
    // $_POST could have been emptied in the previous code.
    if (count($_POST)) {
        // Create or update the custom field.
        $field = array('id' => $_POST['curr'] == 'NEW' ? NULL : $_POST['curr'], 'name' => $_POST['name'], 'field_type' => $_POST['field_type'], 'length' => $_POST['length'], 'html_disabled' => $_POST['html_disabled'], 'show_in_admin' => $_POST['show_in_admin']);
        $field = phorum_api_custom_field_configure($field);
        if ($field === FALSE) {
            $error = phorum_api_error_message();
            $action = $_POST['curr'] == 'NEW' ? "create" : "update";
            phorum_admin_error("Failed to {$action} custom field: " . $error);
        } else {
            $action = $_POST['curr'] == 'NEW' ? "created" : "updated";
            phorum_admin_okmsg("Custom field {$action}");
        }
    }
}
// Confirm deleting a profile field.
if (isset($_GET["curr"]) && isset($_GET["delete"])) {
    ?>
  <div class="PhorumInfoMessage">
    Are you sure you want to delete this custom field?