tagging as ATutor 1.5.4-release
[atutor.git] / mods / _standard / links / module.php
1 <?php\r
2 if (!defined('AT_INCLUDE_PATH')) { exit; }\r
3 if (!isset($this) || (isset($this) && (strtolower(get_class($this)) != 'module'))) { exit(__FILE__ . ' is not a Module'); }\r
4 \r
5 define('AT_PRIV_LINKS', $this->getPrivilege());\r
6 \r
7 // if this module is to be made available to students on the Home or Main Navigation\r
8 $_group_tool = $_student_tool = 'links/index.php';\r
9 \r
10 /*$this->_pages['tools/links/index.php']['title_var'] = 'links';\r
11 $this->_pages['tools/links/index.php']['parent']    = 'tools/index.php';\r
12 $this->_pages['tools/links/index.php']['children'] = array('tools/links/add.php', 'tools/links/categories.php', 'tools/links/categories_create.php');\r
13 $this->_pages['tools/links/index.php']['guide'] = 'instructor/?p=links.php';\r
14 \r
15         $this->_pages['tools/links/add.php']['title_var']  = 'add_link';\r
16         $this->_pages['tools/links/add.php']['parent'] = 'tools/links/index.php';\r
17 \r
18         $this->_pages['tools/links/edit.php']['title_var']  = 'edit_link';\r
19         $this->_pages['tools/links/edit.php']['parent'] = 'tools/links/index.php';\r
20 \r
21         $this->_pages['tools/links/delete.php']['title_var']  = 'delete_link';\r
22         $this->_pages['tools/links/delete.php']['parent'] = 'tools/links/index.php';\r
23 \r
24         $this->_pages['tools/links/categories.php']['title_var']  = 'categories';\r
25         $this->_pages['tools/links/categories.php']['parent'] = 'tools/links/index.php';\r
26 \r
27         $this->_pages['tools/links/categories_create.php']['title_var']  = 'create_category';\r
28         $this->_pages['tools/links/categories_create.php']['parent'] = 'tools/links/index.php';\r
29 \r
30         $this->_pages['tools/links/categories_edit.php']['title_var']  = 'edit_category';\r
31         $this->_pages['tools/links/categories_edit.php']['parent'] = 'tools/links/categories.php';\r
32 \r
33         $this->_pages['tools/links/categories_delete.php']['title_var']  = 'delete_category';\r
34         $this->_pages['tools/links/categories_delete.php']['parent'] = 'tools/links/categories.php';\r
35 */\r
36 \r
37 //instructor & group pages\r
38 $this->_pages['tools/links/index.php']['title_var'] = 'manage_links';\r
39 $this->_pages['tools/links/index.php']['parent']    = 'links/index.php';\r
40 $this->_pages['tools/links/index.php']['children'] = array('tools/links/add.php', 'tools/links/categories.php', 'tools/links/categories_create.php');\r
41 $this->_pages['tools/links/index.php']['guide'] = 'instructor/?p=links.php';\r
42 \r
43         $this->_pages['tools/links/add.php']['title_var']  = 'add_link';\r
44         $this->_pages['tools/links/add.php']['parent'] = 'tools/links/index.php';\r
45 \r
46         $this->_pages['tools/links/edit.php']['title_var']  = 'edit_link';\r
47         $this->_pages['tools/links/edit.php']['parent'] = 'tools/links/index.php';\r
48 \r
49         $this->_pages['tools/links/delete.php']['title_var']  = 'delete_link';\r
50         $this->_pages['tools/links/delete.php']['parent'] = 'tools/links/index.php';\r
51 \r
52         $this->_pages['tools/links/categories.php']['title_var']  = 'categories';\r
53         $this->_pages['tools/links/categories.php']['parent'] = 'tools/links/index.php';\r
54 \r
55         $this->_pages['tools/links/categories_create.php']['title_var']  = 'create_category';\r
56         $this->_pages['tools/links/categories_create.php']['parent'] = 'tools/links/index.php';\r
57 \r
58         $this->_pages['tools/links/categories_edit.php']['title_var']  = 'edit_category';\r
59         $this->_pages['tools/links/categories_edit.php']['parent'] = 'tools/links/categories.php';\r
60 \r
61         $this->_pages['tools/links/categories_delete.php']['title_var']  = 'delete_category';\r
62         $this->_pages['tools/links/categories_delete.php']['parent'] = 'tools/links/categories.php';\r
63 \r
64 //student pages\r
65 $this->_pages['links/index.php']['title_var'] = 'links';\r
66 $this->_pages['links/index.php']['children']  = array('links/add.php', 'tools/links/index.php');\r
67 $this->_pages['links/index.php']['img']       = 'images/home-links.gif';\r
68 \r
69         $this->_pages['links/add.php']['title_var'] = 'suggest_link';\r
70         $this->_pages['links/add.php']['parent']    = 'links/index.php';\r
71 \r
72 \r
73 function links_get_group_url($group_id) {\r
74         global $db;\r
75         $sql = "SELECT cat_id FROM ".TABLE_PREFIX."links_categories WHERE owner_id=$group_id and owner_type=".LINK_CAT_GROUP;\r
76         $result = mysql_query($sql, $db);\r
77         if ($row = mysql_fetch_assoc($result)) {\r
78                 return 'links/index.php?cat_parent_id='.$row['cat_id'].'&search=&filter=Filter';\r
79         } \r
80 \r
81         return 'links/index.php';\r
82 }\r
83 \r
84 ?>