-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tmpl.php
170 lines (156 loc) · 6.67 KB
/
index.tmpl.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
/************************************************************************/
/* ATutor */
/************************************************************************/
/* Copyright (c) 2002 - 2009 */
/* Adaptive Technology Resource Centre / University of Toronto */
/* */
/* This program is free software. You can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/************************************************************************/
if (!defined('AT_INCLUDE_PATH')) { exit; }
global $_base_path;
if ($this->banner): ?><?php echo $this->banner; ?><br /><?php endif;
// positioning switch of home ONLY FOR INSTRUCTORS. two icons will be used for identification to distinguish the two different views of the home.
if(authenticate(AT_PRIV_ADMIN,AT_PRIV_RETURN) && count($this->home_links) > 0){
if($this->view_mode==0)
echo '<a href ="'.AT_BASE_HREF.'switch_view.php?swid='.$this->view_mode.'" style="background-color:#FFFFFF;"><img src="'.AT_BASE_HREF.'images/detail_view.png" title ="'._AT('detail_view').'" alt ="'._AT('detail_view').'" border="0"/></a><br />';
else
echo '<a href ="'.AT_BASE_HREF.'switch_view.php?swid='.$this->view_mode.'" style="background-color:#FFFFFF;"><img src="'.AT_BASE_HREF.'images/icon_view.png" title ="'._AT('icon_view').'" alt ="'._AT('icon_view').'" border="0"/></a><br />';
}
// Icon View, $this->view_mode = 0. course will be made changes to the icons to restore the classic icons.
if($this->view_mode==0){
?>
<div style="width: 98%; margin-top: -5px; float:left;">
<ul id="home-links">
<?php if (is_array($this->home_links)): ?>
<?php foreach ($this->home_links as $link): ?>
<li><a href="<?php echo $link['url']; ?>"><img src="<?php echo $link['img']; ?>" alt="" class="img-size-home" border="0" /><?php echo $link['title']; ?></a></li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div> <?php
} else { ?>
<div id="details_view" class="fluid-horizontal-order" style="width: 98%; margin-top: -5px; float: left; ">
<?php // create table container divided into two columns for the placement of modules
if(authenticate(AT_PRIV_ADMIN,AT_PRIV_RETURN) && is_array($this->home_links)){ // display enabled course tool
foreach ($this->home_links as $link){
?>
<div class="home_box" id="<?php echo str_replace('/', '-', substr($link['url'], strlen($_base_path))); ?>">
<?php print_sublinks($link); // display each module ?>
</div>
<?php
} // end of foreach
} // end of inner if
else {
if (is_array($this->home_links)) {
foreach ($this->home_links as $link){?>
<div class="home_box">
<?php print_sublinks($link); ?>
</div>
<?php } // end of foreach
}// end of inner inner if
} ?>
</div>
<?php
} // end of if
if ($this->announcements): ?>
<h2 class="page-title"><?php echo _AT('announcements'); ?></h2>
<?php foreach ($this->announcements as $item): ?>
<div class="news">
<h3><?php echo $item['title']; ?></h3>
<p><span class="date"><?php echo $item['date'] .' '. _AT('by').' ' . $item['author']; ?></span></p> <?php echo $item['body']; ?>
</div>
<?php endforeach; ?>
<?php if ($this->num_pages > 1): ?>
<?php echo _AT('page'); ?>: |
<?php for ($i=1; $i<=$this->num_pages; $i++): ?>
<?php if ($i == $this->current_page): ?>
<strong><?php echo $i; ?></strong>
<?php else: ?>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?p=<?php echo $i; ?>"><?php echo $i; ?></a>
<?php endif; ?>
|
<?php endfor; ?>
<?php endif; ?>
<?php endif;
// Generate HTML for modules at "detail view"
function print_sublinks($link){
global $_base_path;
?>
<div class="details_ol">
<div class="details_or">
<div class="outside_box">
<?php if (authenticate(AT_PRIV_ADMIN,AT_PRIV_RETURN)) {?>
<div class="buttonbox">
<a href="#" onclick="javascript: remove_module('<?php echo htmlentities(substr($link['url'], strlen($_base_path))); ?>'); return false;"><img src="<?php echo AT_BASE_HREF; ?>images/x.gif" border="0" alt="<?php echo _AT('close'); ?>"/></a>
</div>
<?php }?>
<img src="<?php echo $link['img']; ?>" alt="" border="0" style="vertical-align:middle;" height="45" width="45"/>
<span class="home-title"><a href="<?php echo $link['url']; ?>"><?php echo $link['title']; ?></a></span>
<div class="inside_box">
<?php
// if $link['sub_file'] is defined, print the text array returned from sub_file, otherwise, print the text defined in $link['text']
if($link['sub_file']!=""){
$array = require(AT_INCLUDE_PATH.'../'.$link['sub_file']);
if(!is_array($array)){
?>
<div class="details-text">
<i><?php echo _AT('none_found'); ?></i>
</div>
<?php } else { ?>
<div class="details-text">
<?php foreach($array as $sublink){ ?>
<img src="<?php echo $link['icon']; ?>" border="0" alt="" style="vertical-align:middle;"/>
<?php if ($sublink <> '') echo $sublink."<br />"; } ?>
</div>
<?php
} // end of else
} else { ?>
<div class="details_text"><?php echo $link['text']; ?></div>
<?php } ?>
</div>
</div>
</div>
</div>
<!--
<div class="details_ol">
<div class="details_or">
<div class="outside_box">
<?php if (authenticate(AT_PRIV_ADMIN,AT_PRIV_RETURN)) {?>
<div class="buttonbox">
<a href="#" onclick="javascript: remove_module('<?php echo htmlentities(substr($link['url'], strlen($_base_path))); ?>'); return false;"><img src="<?php echo AT_BASE_HREF; ?>images/x.gif" border="0" alt="<?php echo _AT('close'); ?>"/></a>
</div>
<?php }?>
<img src="<?php echo $link['img']; ?>" alt="" border="0" style="vertical-align:middle;" height="51" width="51"/>
<span class="home-title"><a href="<?php echo $link['url']; ?>"><?php echo $link['title']; ?></a></span>
<div class="inside_box">
<div class="details_il"> </div>
<div class="details_ir"></div>
<?php
// if $link['sub_file'] is defined, print the text array returned from sub_file, otherwise, print the text defined in $link['text']
if($link['sub_file']!=""){
//$array = require(AT_INCLUDE_PATH.'../'.$link['sub_file']);
if(!is_array($array)){
?>
<div class="details-text">
<i><?php echo _AT('none_found'); ?></i>
</div>
<?php } else { ?>
<div class="details-text">
<?php foreach($array as $sublink){ ?>
<img src="<?php echo $link['icon']; ?>" border="0" alt="" />
<?php if ($sublink <> '') echo $sublink."<br />"; } ?>
</div>
<?php
} // end of else
} else { ?>
<div class="details_text"><?php echo $link['text']; ?></div>
<?php } ?>
</div>
</div>
</div>
</div>
-->
<?php } ?>