/mods/_standard/social/module.php

https://github.com/harriswong/ATutor · PHP · 173 lines · 88 code · 34 blank · 51 comment · 8 complexity · 1816486b40abf466093aafec9c823ade MD5 · raw file

  1. <?php
  2. /****************************************************************/
  3. /* ATutor */
  4. /****************************************************************/
  5. /* Copyright (c) 2002-2009 */
  6. /* Inclusive Design Institute */
  7. /* http://atutor.ca */
  8. /* */
  9. /* This program is free software. You can redistribute it and/or*/
  10. /* modify it under the terms of the GNU General Public License */
  11. /* as published by the Free Software Foundation. */
  12. /****************************************************************/
  13. // $Id$
  14. /*******
  15. * doesn't allow this file to be loaded with a browser.
  16. */
  17. if (!defined('AT_INCLUDE_PATH')) { exit; }
  18. /*******
  19. * add savant variable
  20. */
  21. global $savant;
  22. require(AT_INCLUDE_PATH.'../mods/_standard/social/lib/constants.inc.php'); //load constant file right away.
  23. $savant->addPath('template', AT_SOCIAL_BASE.'html/');
  24. /******
  25. * this file must only be included within a Module obj
  26. */
  27. if (!isset($this) || (isset($this) && (strtolower(get_class($this)) != 'module'))) { exit(__FILE__ . ' is not a Module'); }
  28. /*******
  29. * assign the instructor and admin privileges to the constants.
  30. */
  31. define('AT_PRIV_SOCIAL', $this->getPrivilege());
  32. define('AT_ADMIN_PRIV_SOCIAL', $this->getAdminPrivilege());
  33. /*******
  34. * create a side menu box/stack.
  35. */
  36. $this->_stacks['social'] = array('title_var'=>'social', 'file'=>AT_INCLUDE_PATH.'../mods/_standard/social/side_menu.inc.php');
  37. // ** possible alternative: **
  38. // $this->addStack('social', array('title_var' => 'social', 'file' => './side_menu.inc.php');
  39. /*******
  40. * if this module is to be made available to students on the Home or Main Navigation.
  41. */
  42. $_group_tool = $_student_tool = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;
  43. $this->_list['social'] = array('title_var'=>'social','file'=>'mods/_standard/social/sublinks.php');
  44. $this->_pages[AT_SOCIAL_BASENAME.'index.php']['icon'] = 'images/home-directory_sm.png';
  45. /*******
  46. * add the admin pages when needed.
  47. */
  48. if (admin_authenticate(AT_ADMIN_PRIV_SOCIAL, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {
  49. //$this->_pages[AT_NAV_ADMIN] = array('mods/_standard/social/index_admin.php');
  50. $this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['title_var'] = 'social';
  51. $this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['parent'] = 'admin/config_edit.php';
  52. $this->_pages[AT_SOCIAL_BASENAME.'index_admin.php']['children'] = array(AT_SOCIAL_BASENAME.'admin/delete_applications.php');
  53. $this->_pages[AT_SOCIAL_BASENAME.'admin/delete_applications.php']['title_var'] = 'delete_applications';
  54. $this->_pages[AT_SOCIAL_BASENAME.'admin/delete_applications.php']['parent'] = AT_SOCIAL_BASENAME.'index_admin.php';
  55. }
  56. /*******
  57. * instructor Manage section:
  58. */
  59. //$this->_pages[AT_SOCIAL_BASENAME.'index_instructor.php']['title_var'] = 'social';
  60. //$this->_pages[AT_SOCIAL_BASENAME.'index_instructor.php']['parent'] = 'tools/index.php';
  61. // ** possible alternative: **
  62. // $this->pages['./index_instructor.php']['title_var'] = 'social';
  63. // $this->pages['./index_instructor.php']['parent'] = 'tools/index.php';
  64. /*******
  65. * student page.
  66. */
  67. $this->_pages[AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX]['title_var'] = 'social';
  68. $this->_pages[AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX]['img'] = AT_SOCIAL_BASENAME.'images/social.gif';
  69. $this->_pages[AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX]['children'] = array_merge(
  70. array(AT_SOCIAL_BASENAME.'connections.php',
  71. AT_SOCIAL_BASENAME.'sprofile.php',
  72. AT_SOCIAL_BASENAME.'applications.php',
  73. AT_SOCIAL_BASENAME.'groups/index.php',
  74. AT_SOCIAL_BASENAME.'settings.php'),
  75. isset($_pages[AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX]['children']) ? $_pages[AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX]['children'] : array());
  76. $this->_pages[AT_SOCIAL_BASENAME.'sprofile.php']['title_var'] = 'social_profile';
  77. $this->_pages[AT_SOCIAL_BASENAME.'sprofile.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;
  78. $this->_pages[AT_SOCIAL_BASENAME.'edit_profile.php']['title_var'] = 'edit_profile';
  79. $this->_pages[AT_SOCIAL_BASENAME.'edit_profile.php']['parent'] = AT_SOCIAL_BASENAME.'sprofile.php';
  80. $this->_pages[AT_SOCIAL_BASENAME.'sprofile.php']['guide'] = 'general/?p=my_profile.php';
  81. $this->_pages[AT_SOCIAL_BASENAME.'profile_picture.php']['title_var'] = 'picture';
  82. $this->_pages[AT_SOCIAL_BASENAME.'profile_picture.php']['parent'] = AT_SOCIAL_BASENAME.'edit_profile.php';
  83. $this->_pages[AT_SOCIAL_BASENAME.'basic_profile.php']['title_var'] = 'profile';
  84. $this->_pages[AT_SOCIAL_BASENAME.'basic_profile.php']['parent'] = AT_SOCIAL_BASENAME.'edit_profile.php';
  85. $this->_pages[AT_SOCIAL_BASENAME.'applications.php']['title_var'] = 'applications';
  86. $this->_pages[AT_SOCIAL_BASENAME.'applications.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;
  87. $this->_pages[AT_SOCIAL_BASENAME.'applications.php']['guide'] = 'general/?p=my_gadgets.php';
  88. $this->_pages[AT_SOCIAL_BASENAME.'connections.php']['title_var'] = 'connections';
  89. $this->_pages[AT_SOCIAL_BASENAME.'connections.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;
  90. $this->_pages[AT_SOCIAL_BASENAME.'connections.php']['guide'] = 'general/?p=my_contacts.php';
  91. // $this->_pages['mods/social/add_friends.php']['title_var'] = 'add_friends';
  92. // $this->_pages['mods/social/add_friends.php']['parent'] = 'mods/social/connections.php';
  93. $this->_pages[AT_SOCIAL_BASENAME.'activities.php']['title_var'] = 'activities';
  94. $this->_pages[AT_SOCIAL_BASENAME.'activities.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;
  95. $this->_pages[AT_SOCIAL_BASENAME.'settings.php']['title_var'] = 'settings';
  96. $this->_pages[AT_SOCIAL_BASENAME.'settings.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;
  97. $this->_pages[AT_SOCIAL_BASENAME.'settings.php']['guide'] = 'general/?p=my_settings.php';
  98. $this->_pages[AT_SOCIAL_BASENAME.'groups/index.php']['title_var'] = 'social_groups';
  99. $this->_pages[AT_SOCIAL_BASENAME.'groups/index.php']['parent'] = AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;
  100. $this->_pages[AT_SOCIAL_BASENAME.'groups/index.php']['guide'] = 'general/?p=my_groups.php';
  101. $this->_pages[AT_SOCIAL_BASENAME.'groups/create.php']['title_var'] = 'create_groups';
  102. $this->_pages[AT_SOCIAL_BASENAME.'groups/create.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';
  103. $this->_pages[AT_SOCIAL_BASENAME.'groups/view.php']['title_var'] = 'view_groups';
  104. $this->_pages[AT_SOCIAL_BASENAME.'groups/view.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';
  105. $this->_pages[AT_SOCIAL_BASENAME.'groups/delete_message.php']['title_var'] = 'delete_message';
  106. $this->_pages[AT_SOCIAL_BASENAME.'groups/delete_message.php']['parent'] = AT_SOCIAL_BASENAME.'groups/view.php';
  107. $this->_pages[AT_SOCIAL_BASENAME.'groups/invite.php']['title_var'] = 'invite_groups';
  108. $this->_pages[AT_SOCIAL_BASENAME.'groups/invite.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';
  109. $this->_pages[AT_SOCIAL_BASENAME.'groups/edit.php']['title_var'] = 'edit_group';
  110. $this->_pages[AT_SOCIAL_BASENAME.'groups/edit.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';
  111. $this->_pages[AT_SOCIAL_BASENAME.'groups/search.php']['title_var'] = 'search';
  112. $this->_pages[AT_SOCIAL_BASENAME.'groups/search.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';
  113. $this->_pages[AT_SOCIAL_BASENAME.'groups/list.php']['title_var'] = 'group_members';
  114. $this->_pages[AT_SOCIAL_BASENAME.'groups/list.php']['parent'] = AT_SOCIAL_BASENAME.'groups/index.php';
  115. /* public pages */
  116. $this->_pages[AT_NAV_PUBLIC] = array(AT_SOCIAL_BASENAME.'index_public.php');
  117. $this->_pages[AT_SOCIAL_BASENAME.'index_public.php']['title_var'] = 'social';
  118. $this->_pages[AT_SOCIAL_BASENAME.'index_public.php']['parent'] = AT_NAV_PUBLIC;
  119. /* my start page pages */
  120. if ($_SESSION['valid_user']==1){
  121. $this->_pages[AT_NAV_START] = array('mods/social/index_mystart.php');
  122. $this->_pages[AT_NAV_START] = array(AT_SOCIAL_BASENAME.'index_mystart.php');
  123. $this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['title_var'] = 'social';
  124. $this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['guide'] = 'general/?p=my_network.php';
  125. $this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['parent'] = AT_NAV_START;
  126. $this->_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['children'] = array_merge(
  127. array(AT_SOCIAL_BASENAME.'connections.php',
  128. AT_SOCIAL_BASENAME.'sprofile.php',
  129. AT_SOCIAL_BASENAME.'applications.php',
  130. AT_SOCIAL_BASENAME.'groups/index.php',
  131. AT_SOCIAL_BASENAME.'settings.php'),
  132. isset($_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['children']) ? $_pages[AT_SOCIAL_BASENAME.'index_mystart.php']['children'] : array());
  133. $this->_pages[AT_SOCIAL_BASENAME.'index.php']['title_var'] = 'social';
  134. $this->_pages[AT_SOCIAL_BASENAME.'index.php']['guide'] = 'general/?p=my_network.php';
  135. }
  136. function social_get_group_url($group_id) {
  137. return AT_SOCIAL_BASENAME.AT_SOCIAL_INDEX;
  138. }
  139. ?>