diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-23 16:27:05 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-23 16:27:05 +0000 |
commit | 737394eb15a2ef0c1f5a085d7f5958d2f3e66b89 (patch) | |
tree | d3d3d9f880e9ffd63b73d9f3ab83c1ce0fda825f /engine/lib | |
parent | dc28ff0bed2216d97e24b1286c68190c843cb684 (diff) | |
download | elgg-737394eb15a2ef0c1f5a085d7f5958d2f3e66b89.tar.gz elgg-737394eb15a2ef0c1f5a085d7f5958d2f3e66b89.tar.bz2 |
Refs #76: User settings page (to Elgg Classic standard). Committing some work before shutting down for the day.
git-svn-id: https://code.elgg.org/elgg/trunk@1068 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/plugins.php | 36 | ||||
-rw-r--r-- | engine/lib/usersettings.php | 51 |
2 files changed, 87 insertions, 0 deletions
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index c3f1d0d25..073869a52 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -171,6 +171,42 @@ return false; } + + /** + * Find the plugin settings for a user. + * + * @param string $plugin_name Plugin name. + * @param int $user_guid The guid who's settings to retrieve. + */ + function find_plugin_usersettings($plugin_name = "", $user_guid = 0) + { + $plugin_name = sanitise_string($plugin_name); + $user_guid = (int)$user_guid; + + if (!$plugin_name) + $plugin_name = get_plugin_name(); + + if ($user_guid == 0) $user_guid = $_SESSION['user']->guid; + + + + + + + + + + + + + + + + + + + return false; + } /** * Set a setting for a plugin. diff --git a/engine/lib/usersettings.php b/engine/lib/usersettings.php new file mode 100644 index 000000000..487ea9230 --- /dev/null +++ b/engine/lib/usersettings.php @@ -0,0 +1,51 @@ +<?php + /** + * Elgg user settings functions. + * Functions for adding and manipulating options on the user settings panel. + * + * @package Elgg + * @subpackage Core + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Marcus Povey + * @copyright Curverider Ltd 2008 + * @link http://elgg.org/ + */ + + /** + * Register a user settings page with the admin panel. + * This function extends the view "usersettings/main" with the provided view. This view should provide a description + * and either a control or a link to. + * + * Usage: + * - To add a control to the main admin panel then extend usersettings/main + * - To add a control to a new page create a page which renders a view usersettings/subpage (where subpage is your new page - + * nb. some pages already exist that you can extend), extend the main view to point to it, and add controls to your + * new view. + * + * At the moment this is essentially a wrapper around extend_view. + * + * @param string $new_settings_view The view associated with the control you're adding + * @param string $view The view to extend, by default this is 'usersettings/main'. + * @param int $priority Optional priority to govern the appearance in the list. + */ + function extend_elgg_settings_page( $new_settings_view, $view = 'usersettings/main', $priority = 500) + { + return extend_view($view, $new_settings_view, $priority); + } + + /** + * Initialise the admin page. + */ + function usersettings_init() + { + // Add plugin main menu option (last) + extend_elgg_settings_page('usersettings/main_opt/statistics', 'usersettings/main'); + extend_elgg_settings_page('usersettings/main_opt/user', 'usersettings/main'); + extend_elgg_settings_page('usersettings/main_opt/plugins', 'usersettings/main', 999); // Always last + + } + + /// Register init function + register_elgg_event_handler('init','system','usersettings_init'); + +?>
\ No newline at end of file |