function newsclient_pagesetup() { // register links -- global $profile_id; global $PAGE; global $CFG; $page_owner = $profile_id; $rss_username = user_info('username', $page_owner); if (isloggedin()) { /*if (defined("context") && context == "resources" && $page_owner == $_SESSION['userid']) { $PAGE->menu[] = array( 'name' => 'feeds', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/feeds/\" class=\"selected\" >" .__gettext("Your Resources").'</a></li>'); } else { $PAGE->menu[] = array( 'name' => 'feeds', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/feeds/\" >" .__gettext("Your Resources").'</a></li>'); }*/ } if (defined("context") && context == "resources") { if ($page_owner != -1) { $PAGE->menu_sub[] = array('name' => 'newsfeed:subscription', 'html' => a_href($CFG->wwwroot . $rss_username . "/feeds/", __gettext("Feeds"))); if (permissions_check("profile", $page_owner) && isloggedin()) { $PAGE->menu_sub[] = array('name' => 'newsfeed:subscription:publish:blog', 'html' => a_href($CFG->wwwroot . "_rss/blog.php?profile_name=" . user_info("username", $page_owner), __gettext("Publish to blog"))); } $PAGE->menu_sub[] = array('name' => 'newsclient', 'html' => a_href($CFG->wwwroot . $rss_username . "/feeds/all/", __gettext("View aggregator"))); } $PAGE->menu_sub[] = array('name' => 'feed', 'html' => a_href($CFG->wwwroot . "_rss/popular.php", __gettext("Popular Feeds"))); /* $PAGE->menu_sub[] = array( 'name' => 'feed', 'html' => a_href( $CFG->wwwroot."help/feeds_help.php", "Page help")); */ } }
function file_pagesetup() { // register links -- global $profile_id; global $PAGE; global $CFG; global $metatags; require_once dirname(__FILE__) . "/lib/file_config.php"; $page_owner = $profile_id; if (isloggedin()) { if (defined("context") && context == "files" && $page_owner == $_SESSION['userid']) { $PAGE->menu[] = array('name' => 'files', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/files/\" class=\"selected\" >" . __gettext("Photos") . '</a></li>'); } else { $PAGE->menu[] = array('name' => 'files', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/files/\" >" . __gettext("Photos") . '</a></li>'); } } if (defined("context") && context == "files") { $files_username = user_info('username', $page_owner); if ($page_owner != -1) { if ($page_owner == $_SESSION['userid'] && $page_owner != -1) { $PAGE->menu_sub[] = array('name' => 'file:rss', 'html' => '<a href="' . $CFG->wwwroot . $_SESSION['username'] . '/files/rss/"><img src="' . $CFG->wwwroot . 'mod/template/icons/rss.png" border="0" alt="rss" /></a>'); } } if ($page_owner == $_SESSION['userid'] && $page_owner != -1) { $PAGE->menu_sub[] = array('name' => 'file:add', 'html' => a_href("{$CFG->wwwroot}{$_SESSION['username']}/files/addphoto", __gettext("Add a Photo"))); } if ($page_owner == $_SESSION['userid'] && $page_owner != -1) { $PAGE->menu_sub[] = array('name' => 'file:add', 'html' => a_href("{$CFG->wwwroot}{$_SESSION['username']}/files/addfolder", __gettext("Add a folder"))); } } // Adding the file's selector wizard $options = array('options' => 'width=600,height=300,left=20,top=20,scrollbars=yes,resizable=yes', 'name' => 'mediapopup', 'url' => $CFG->wwwroot . "mod/file/file_include_wizard.php?owner=" . page_owner()); add_content_tool_button("mediapopup", __gettext("Add File"), "image.png", "f", $options); }
function admin_pagesetup() { global $PAGE, $CFG; /* if (isadmin()) { $PAGE->menu_top [] = array( 'name' => 'admin', //'html' => a_href("{$CFG->wwwroot}_admin/", // "Administration")); 'html' => "<li><a href=\"" . $CFG->wwwroot . "mod/admin/\">" . __gettext("Administration") . "</a></li>"); } */ if (defined("context") && context == "account") { $PAGE->menu_sub[] = array('name' => 'user:edit', 'html' => a_href("{$CFG->wwwroot}_userdetails/", __gettext("Edit user details"))); /*$PAGE->menu_sub[] = array ( 'name' => 'user:icon', 'html' => a_href("{$CFG->wwwroot}_icons/",__gettext("Your site picture")));*/ } if (defined("context") && context == "admin" && isloggedin() && user_flag_get("admin", $_SESSION['userid'])) { $PAGE->menu_sub[] = array('name' => 'admin', 'html' => a_href(get_url(-1, 'admin::main'), __gettext("Main"))); $PAGE->menu_sub[] = array('name' => 'admin:users:add', 'html' => a_href(get_url(-1, 'admin::users::add'), __gettext("Add users"))); $PAGE->menu_sub[] = array('name' => 'admin:users', 'html' => a_href(get_url(-1, 'admin::users'), __gettext("Manage users"))); $PAGE->menu_sub[] = array('name' => 'admin:users:banned', 'html' => a_href(get_url(-1, 'admin::users::banned'), __gettext("Banned users"))); $PAGE->menu_sub[] = array('name' => 'admin:users:admin', 'html' => a_href(get_url(-1, 'admin::users::admin'), __gettext("Admin users"))); $PAGE->menu_sub[] = array('name' => 'admin:flags', 'html' => a_href(get_url(-1, 'admin::flags'), __gettext("Manage flagged content"))); $PAGE->menu_sub[] = array('name' => 'admin:spam', 'html' => a_href(get_url(-1, 'admin::spam'), __gettext("Spam control"))); } }
function friend_pagesetup() { // register links -- global $profile_id; global $PAGE; global $CFG; global $metatags; require_once dirname(__FILE__) . "/default_template.php"; require_once dirname(__FILE__) . "/lib/friends_config.php"; $metatags .= "<link rel=\"stylesheet\" href=\"" . $CFG->wwwroot . "mod/friend/css.css\" type=\"text/css\" media=\"screen\" />"; $page_owner = $profile_id; if (isloggedin()) { if (defined("context") && context == "network" && $page_owner == $_SESSION['userid']) { $PAGE->menu[] = array('name' => 'friends', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/friends/\" class=\"selected\" >" . __gettext("Contacts") . '</a></li>'); } else { $PAGE->menu[] = array('name' => 'friends', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/friends/\" >" . __gettext("Contacts") . '</a></li>'); } } if (defined("context") && context == "network") { if (user_type($page_owner) == "person" || user_type($page_owner) == "external") { $friends_username = user_info('username', $page_owner); $PAGE->menu_sub[] = array('name' => 'friend', 'html' => a_href("{$CFG->wwwroot}{$friends_username}/friends/", __gettext("My friends"))); /*$PAGE->menu_sub[] = array( 'name' => 'friend:of', 'html' => a_href( "{$CFG->wwwroot}{$friends_username}/friendsof/", __gettext("Friend of")));*/ if (isloggedin() && $page_owner == $_SESSION['userid']) { $PAGE->menu_sub[] = array('name' => 'friend:requests', 'html' => a_href("{$CFG->wwwroot}{$friends_username}/friends/requests", __gettext("Friendship requests"))); } if (FRIENDS_FOAF) { $PAGE->menu_sub[] = array('name' => 'friend:foaf', 'html' => a_href("{$CFG->wwwroot}{$friends_username}/foaf/", __gettext("FOAF"))); } } } }
function community_pagesetup() { // register links -- global $profile_id; global $PAGE; global $CFG; global $USER; require_once dirname(__FILE__) . "/default_template.php"; require_once dirname(__FILE__) . "/lib/communities_config.php"; $page_owner = $profile_id; $usertype = user_type($page_owner); $username = user_info('username', $page_owner); if (isloggedin()) { if (COMMUNITY_CONTEXT != "network") { if (defined("context") && context == COMMUNITY_CONTEXT) { $PAGE->menu[] = array('name' => 'community', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/communities\" class=\"selected\" >" . __gettext("Communities") . '</a></li>'); } else { $PAGE->menu[] = array('name' => 'community', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/communities\" >" . __gettext("Communities") . '</a></li>'); } } } if ($usertype == "community") { /*$PAGE->menu_sub[] = array( 'name' => 'profile:edit', 'html' => '<a href="'.$CFG->wwwroot.'profile/edit.php?profile_id='.$page_owner.'">' . __gettext("Edit community profile") . '</a>');*/ $PAGE->menu_sub[] = array('name' => 'community:pic', 'html' => a_href("{$CFG->wwwroot}_icons/?context=profile&profile_id={$page_owner}", __gettext("Community site picture"))); $PAGE->menu_sub[] = array('name' => 'community:edit', 'html' => a_href("{$CFG->wwwroot}_userdetails/?context=profile&profile_id={$page_owner}", __gettext("Edit community details"))); /*$PAGE->menu_sub[] = array( 'name' => 'profile:view', 'html' => a_href("{$CFG->wwwroot}{$username}/profile", __gettext("Return to community profile")));*/ $PAGE->menu_sub[] = array('name' => 'community:adminmembers', 'html' => a_href("{$CFG->wwwroot}{$username}/community/members", __gettext("Edit members"))); $PAGE->menu_sub[] = array('name' => 'community:requests', 'html' => a_href("{$CFG->wwwroot}{$username}/community/requests", __gettext("View membership requests"))); $PAGE->menu_sub[] = array('name' => 'community:invite', 'html' => a_href("{$CFG->wwwroot}{$username}/community/invite", __gettext("Invite people"))); $PAGE->menu_sub[] = array('name' => 'community:invite', 'html' => a_href("{$CFG->wwwroot}{$USER->username}/communities", __gettext("Back to communities"))); } else { if ($usertype == "person") { if (defined("context") && context == COMMUNITY_CONTEXT) { if (COMMUNITY_COMPACT_VIEW) { $PAGE->menu_sub[] = array('name' => 'community', 'html' => a_href("{$CFG->wwwroot}{$username}/communities", __gettext("My Communities"))); if (logged_on && $page_owner == $_SESSION['userid'] && ($CFG->community_create_flag == "" || user_flag_get($CFG->community_create_flag, $USER->ident))) { $PAGE->menu_sub[] = array('name' => 'community:owned', 'html' => a_href("{$CFG->wwwroot}{$username}/communities/new", __gettext("New Community"))); } } else { if ($CFG->community_create_flag == "" || user_flag_get($CFG->community_create_flag, $USER->ident)) { $PAGE->menu_sub[] = array('name' => 'community:owned', 'html' => a_href("{$CFG->wwwroot}{$username}/communities/create", __gettext("Create a Community"))); $PAGE->menu_sub[] = array('name' => 'community', 'html' => a_href("{$CFG->wwwroot}{$username}/communities", __gettext("My Communities"))); if ($CFG->community_create_flag == "" || user_flag_get($CFG->community_create_flag, $USER->ident)) { $PAGE->menu_sub[] = array('name' => 'community:owned', 'html' => a_href("{$CFG->wwwroot}{$username}/communities/owned", __gettext("Owned Communities"))); } } } } } } $PAGE->search_menu[] = array('name' => __gettext("Communities"), 'user_type' => 'community'); // Add membership requests to the personal network page if (defined("context") && context == "community" && isloggedin() && $page_owner == $_SESSION['userid']) { $PAGE->menu_sub[] = array('name' => 'membership:invites', 'html' => a_href("{$CFG->wwwroot}{$username}/communities/invitations", __gettext("Community invitations"))); } }
function invite_pagesetup() { global $PAGE; if (defined('context') && context == 'network' && isloggedin()) { if (!maxusers_limit()) { $PAGE->menu_sub[] = array('name' => 'invite:friend', 'html' => a_href(get_url(null, 'invite::invite'), __gettext("Invite a friend"))); } } }
function template_pagesetup() { // register links -- global $profile_id; global $PAGE; global $CFG; $page_owner = $profile_id; if (defined("context") && context == "account" && !$CFG->disable_templatechanging && user_info("user_type", $_SESSION['userid']) != "external") { if ($page_owner == $_SESSION['userid'] && $page_owner != -1) { $PAGE->menu_sub[] = array('name' => 'template:change', 'html' => a_href("{$CFG->wwwroot}mod/template/", __gettext("Change theme"))); } } $CFG->templates->variables_substitute['templatesroot'][] = "templates_root"; }