257abdf7a6b9e3ed126ce844c9c9c9fe04b8eae6
[atutor.git] / mods / mediawiki / module.php
1 <?php
2 /*******
3  * doesn't allow this file to be loaded with a browser.
4  */
5 if (!defined('AT_INCLUDE_PATH')) { exit; }
6
7 /******
8  * this file must only be included within a Module obj
9  */
10 if (!isset($this) || (isset($this) && (strtolower(get_class($this)) != 'module'))) { exit(__FILE__ . ' is not a Module'); }
11
12 /*******
13  * assign the instructor and admin privileges to the constants.
14  * not technically need for instructors for the current version of the module
15  */
16 define('AT_PRIV_MEDIAWIKI',       $this->getPrivilege());
17 define('AT_ADMIN_PRIV_MEDIAWIKI', $this->getAdminPrivilege());
18
19 /*******
20  * create a side menu box/stack.
21  */
22 // Sidemenu block is disbaled by default in this version of the module
23 //$this->_stacks['mediawiki'] = array('title_var'=>'mediawiki', 'file'=>'mods/mediawiki/side_menu.inc.php');
24 // ** possible alternative: **
25 // $this->addStack('mediawiki', array('title_var' => 'mediawiki', 'file' => './side_menu.inc.php');
26
27 /*******
28  * create optional sublinks for module "detail view" on course home page
29  * when this line is uncommented, "mods/mediawiki/sublinks.php" need to be created to return an array of content to be displayed
30  */
31 $this->_list['mediawiki'] = array('title_var'=>'mediawiki','file'=>'mods/mediawiki/sublinks.php');
32
33 // Uncomment for tiny list bullet icon for module sublinks "icon view" on course home page
34 $this->_pages['mods/mediawiki/index.php']['icon']      = 'mods/mediawiki/mw_icon_sm.png';
35
36 // Uncomment for big icon for module sublinks "detail view" on course home page
37 //$this->_pages['mods/mediawiki/index.php']['img']      = 'mods/mediawiki/mediawiki.jpg';
38
39 // ** possible alternative: **
40 // the text to display on module "detail view" when sublinks are not available
41 $this->_pages['mods/mediawiki/index.php']['text']      = _AT('mediawiki_text');
42
43 /*******
44  * if this module is to be made available to students on the Home or Main Navigation.
45  */
46 $_group_tool = $_student_tool = 'mods/mediawiki/index.php';
47
48 /*******
49  * add the admin pages when needed.
50  */
51 if (admin_authenticate(AT_ADMIN_PRIV_MEDIAWIKI, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {
52         $this->_pages[AT_NAV_ADMIN] = array('mods/mediawiki/index_admin.php');
53         $this->_pages['mods/mediawiki/index_admin.php']['title_var'] = 'mediawiki';
54         $this->_pages['mods/mediawiki/index_admin.php']['parent']    = AT_NAV_ADMIN;
55 }
56
57 /*******
58  * instructor Manage section:
59  */
60 $this->_pages['mods/mediawiki/index_instructor.php']['title_var'] = 'mediawiki';
61 $this->_pages['mods/mediawiki/index_instructor.php']['parent']   = 'tools/index.php';
62 // ** possible alternative: **
63 // $this->pages['./index_instructor.php']['title_var'] = 'mediawiki';
64 // $this->pages['./index_instructor.php']['parent']    = 'tools/index.php';
65
66 /*******
67  * student page.
68  */
69 $this->_pages['mods/mediawiki/index.php']['title_var'] = 'mediawiki';
70 $this->_pages['mods/mediawiki/index.php']['img']       = 'mods/mediawiki/mw_logo.png';
71
72 // /* public pages */
73 // Uncomment the following three lines if MediaWiki should be accessible from public pages
74 // for users who are not logged into ATutor
75
76 // $this->_pages[AT_NAV_PUBLIC] = array('mods/mediawiki/index_public.php');
77 // $this->_pages['mods/mediawiki/index_public.php']['title_var'] = 'mediawiki';
78 // $this->_pages['mods/mediawiki/index_public.php']['parent'] = AT_NAV_PUBLIC;
79
80 /* my start page pages */
81 $this->_pages[AT_NAV_START]  = array('mods/mediawiki/index_mystart.php');
82 $this->_pages['mods/mediawiki/index_mystart.php']['title_var'] = 'mediawiki';
83 $this->_pages['mods/mediawiki/index_mystart.php']['parent'] = AT_NAV_START;
84
85 function mediawiki_get_group_url($group_id) {
86         return 'mods/mediawiki/index.php';
87 }
88
89 ?>