changed git call from https to git readonly
[atutor.git] / mods / hello_world / 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  */
15 define('AT_PRIV_HELLO_WORLD',       $this->getPrivilege());
16 define('AT_ADMIN_PRIV_HELLO_WORLD', $this->getAdminPrivilege());
17
18 /*******
19  * create a side menu box/stack.
20  */
21 $this->_stacks['hello_world'] = array('title_var'=>'hello_world', 'file'=>'mods/hello_world/side_menu.inc.php');
22 // ** possible alternative: **
23 // $this->addStack('hello_world', array('title_var' => 'hello_world', 'file' => './side_menu.inc.php');
24
25 /*******
26  * create optional sublinks for module "detail view" on course home page
27  * when this line is uncommented, "mods/hello_world/sublinks.php" need to be created to return an array of content to be displayed
28  */
29 //$this->_list['hello_world'] = array('title_var'=>'hello_world','file'=>'mods/hello_world/sublinks.php');
30
31 // Uncomment for tiny list bullet icon for module sublinks "icon view" on course home page
32 //$this->_pages['mods/hello_world/index.php']['icon']      = 'mods/hello_world/hello_world_sm.jpg';
33
34 // Uncomment for big icon for module sublinks "detail view" on course home page
35 //$this->_pages['mods/hello_world/index.php']['img']      = 'mods/hello_world/hello_world.jpg';
36
37 // ** possible alternative: **
38 // the text to display on module "detail view" when sublinks are not available
39 $this->_pages['mods/hello_world/index.php']['text']      = _AT('hello_world_text');
40
41 /*******
42  * if this module is to be made available to students on the Home or Main Navigation.
43  */
44 $_group_tool = $_student_tool = 'mods/hello_world/index.php';
45
46 /*******
47  * add the admin pages when needed.
48  */
49 if (admin_authenticate(AT_ADMIN_PRIV_HELLO_WORLD, TRUE) || admin_authenticate(AT_ADMIN_PRIV_ADMIN, TRUE)) {
50         $this->_pages[AT_NAV_ADMIN] = array('mods/hello_world/index_admin.php');
51         $this->_pages['mods/hello_world/index_admin.php']['title_var'] = 'hello_world';
52         $this->_pages['mods/hello_world/index_admin.php']['parent']    = AT_NAV_ADMIN;
53 }
54
55 /*******
56  * instructor Manage section:
57  */
58 $this->_pages['mods/hello_world/index_instructor.php']['title_var'] = 'hello_world';
59 $this->_pages['mods/hello_world/index_instructor.php']['parent']   = 'tools/index.php';
60 // ** possible alternative: **
61 // $this->pages['./index_instructor.php']['title_var'] = 'hello_world';
62 // $this->pages['./index_instructor.php']['parent']    = 'tools/index.php';
63
64 /*******
65  * student page.
66  */
67 $this->_pages['mods/hello_world/index.php']['title_var'] = 'hello_world';
68 $this->_pages['mods/hello_world/index.php']['img']       = 'mods/hello_world/hello_world.jpg';
69
70 /* public pages */
71 $this->_pages[AT_NAV_PUBLIC] = array('mods/hello_world/index_public.php');
72 $this->_pages['mods/hello_world/index_public.php']['title_var'] = 'hello_world';
73 $this->_pages['mods/hello_world/index_public.php']['parent'] = AT_NAV_PUBLIC;
74
75 /* my start page pages */
76 $this->_pages[AT_NAV_START]  = array('mods/hello_world/index_mystart.php');
77 $this->_pages['mods/hello_world/index_mystart.php']['title_var'] = 'hello_world';
78 $this->_pages['mods/hello_world/index_mystart.php']['parent'] = AT_NAV_START;
79
80 /*******
81  * Use the following array to define a tool to be added to the Content Editor's icon toolbar. 
82  * id = a unique identifier to be referenced by javascript or css, prefix with the module name
83  * class = reference to a css class in the module.css or the primary theme styles.css to style the tool icon etc
84  * src = the src attribute for an HTML img element, referring to the icon to be embedded in the Content Editor toolbar
85  * title = reference to a language token rendered as an HTML img title attribute
86  * alt = reference to a language token rendered as an HTML img alt attribute
87  * text = reference to a language token rendered as the text of a link that appears below the tool icon
88  * js = reference to the script that provides the tool's functionality
89  */
90
91 $this->_content_tools[] = array("id"=>"helloworld_tool", 
92                                 "class"=>"fl-col clickable", 
93                                 "src"=>AT_BASE_HREF."mods/hello_world/hello_world.jpg",
94                                 "title"=>_AT('hello_world_tool'),
95                                 "alt"=>_AT('hello_world_tool'),
96                                 "text"=>_AT('hello_world'), 
97                                 "js"=>AT_BASE_HREF."mods/hello_world/content_tool_action.js");
98
99 /*******
100  * Register the entry of the callback class. Make sure the class name is properly namespaced, 
101  * for instance, prefixed with the module name, to enforce its uniqueness.
102  * This class must be defined in "ModuleCallbacks.class.php".
103  * This class is an API that contains the static methods to act on core functions.
104  */
105 $this->_callbacks['hello_world'] = 'HelloWorldCallbacks';
106
107 function hello_world_get_group_url($group_id) {
108         return 'mods/hello_world/index.php';
109 }
110 ?>