* Initialise the diagnostics tool
*
*/
-function diagnostics_init()
-{
+function diagnostics_init() {
global $CONFIG;
// Register a page handler, so we can have nice URLs
* Adding the diagnostics to the admin menu
*
*/
-function diagnostics_pagesetup()
-{
+function diagnostics_pagesetup() {
if (elgg_get_context() == 'admin' && isadminloggedin()) {
- elgg_add_submenu_item(array('text' => elgg_echo('diagnostics'), 'href' => 'pg/diagnostics/'));
+ elgg_register_menu_item('page', array(
+ 'name' => 'diagnostics',
+ 'title' => elgg_echo('diagnostics'),
+ 'url' => 'pg/diagnostics/',
+ 'context' => 'admin',
+ ));
}
}
*
* @param array $page Array of page elements, forwarded by the page handling mechanism
*/
-function diagnostics_page_handler($page)
-{
+function diagnostics_page_handler($page) {
global $CONFIG;
// only interested in one page for now
* @param unknown_type $returnvalue
* @param unknown_type $params
*/
-function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params)
-{
+function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params) {
global $CONFIG;
// Get version information
* @param unknown_type $returnvalue
* @param unknown_type $params
*/
-function diagnostics_plugins_hook($hook, $entity_type, $returnvalue, $params)
-{
+function diagnostics_plugins_hook($hook, $entity_type, $returnvalue, $params) {
$returnvalue .= elgg_echo('diagnostics:report:plugins', array(print_r(get_installed_plugins(), true)));
return $returnvalue;
* @param starting dir $dir
* @param buffer $buffer
*/
-function diagnostics_md5_dir($dir)
-{
+function diagnostics_md5_dir($dir) {
$extensions_allowed = array('.php', '.js', '.css');
$buffer = "";
* @param unknown_type $returnvalue
* @param unknown_type $params
*/
-function diagnostics_sigs_hook($hook, $entity_type, $returnvalue, $params)
-{
+function diagnostics_sigs_hook($hook, $entity_type, $returnvalue, $params) {
global $CONFIG;
$returnvalue .= elgg_echo('diagnostics:report:md5', array(diagnostics_md5_dir($CONFIG->path)));
* @param unknown_type $returnvalue
* @param unknown_type $params
*/
-function diagnostics_phpinfo_hook($hook, $entity_type, $returnvalue, $params)
-{
+function diagnostics_phpinfo_hook($hook, $entity_type, $returnvalue, $params) {
global $CONFIG;
ob_start();
* @param unknown_type $params
* @return unknown
*/
-function diagnostics_globals_hook($hook, $entity_type, $returnvalue, $params)
-{
+function diagnostics_globals_hook($hook, $entity_type, $returnvalue, $params) {
global $CONFIG;
$output = str_replace($CONFIG->dbpass, '<<DBPASS>>', print_r($GLOBALS, true));
elgg_register_plugin_hook_handler("diagnostics:report", "system", "diagnostics_globals_hook"); // Global variables
elgg_register_plugin_hook_handler("diagnostics:report", "system", "diagnostics_phpinfo_hook"); // PHP info
-?>
\ No newline at end of file
function messages_init() {
- // add submenu options
- if (elgg_get_context() == "messages") {
- add_submenu_item(elgg_echo('messages:inbox'), "pg/messages/" . get_loggedin_user()->username);
- add_submenu_item(elgg_echo('messages:sentmessages'), "mod/messages/sent.php");
- }
+ // add page menu items
+ elgg_register_menu_item('page', array(
+ 'name' => 'messages:inbox',
+ 'title' => elgg_echo('messages:inbox'),
+ 'url' => "pg/messages/" . get_loggedin_user()->username,
+ 'context' => 'messages',
+ ));
+ elgg_register_menu_item('page', array(
+ 'name' => 'messages:sentmessages',
+ 'title' => elgg_echo('messages:sentmessages'),
+ 'url' => "mod/messages/sent.php",
+ 'context' => 'messages',
+ ));
// Extend system CSS with our own styles, which are defined in the shouts/css view
elgg_extend_view('css/screen', 'messages/css');