2 /*==============================================================
\r
4 ==============================================================
\r
5 Copyright (c) 2006 by Dylan Cheon & Kelvin Wong
\r
6 Institute for Assistive Technology / University of Victoria
\r
7 http://www.canassist.ca/
\r
9 This program is free software. You can redistribute it and/or
\r
10 modify it under the terms of the GNU General Public License
\r
11 as published by the Free Software Foundation.
\r
12 ==============================================================
\r
17 * @desc This file generates the index page in the administrator panel
\r
18 * @author Dylan Cheon & Kelvin Wong
\r
19 * @copyright 2006, Institute for Assistive Technology / University of Victoria
\r
20 * @link http://www.canassist.ca/
\r
24 define('AT_INCLUDE_PATH', '../../include/');
\r
25 require (AT_INCLUDE_PATH.'vitals.inc.php');
\r
26 admin_authenticate(AT_ADMIN_PRIV_PHOTO_ALBUM);
\r
27 require (AT_INCLUDE_PATH.'header.inc.php');
\r
31 require_once('define.php');
\r
32 require_once('HTML/Template/ITX.php');
\r
33 require_once('include/data_func.php');
\r
34 require_once('include/general_func.php');
\r
36 $courses=get_course_list();
\r
37 if (empty($courses)){
\r
38 $msg->addError('pa_var_course_empty');
\r
39 redirect('../../admin/index.php');
\r
41 $link=$base_path.'mods/photo_album/admin_image_list.php';
\r
42 $template=new HTML_Template_ITX("./Template");
\r
43 $template->loadTemplatefile("index_admin.tpl.php", true, true);
\r
45 $template->setVariable("TITLE", _AT('pa_title_admin_index'));
\r
46 $template->setVariable("MESSAGE", _AT('pa_note_admin'));
\r
47 $template->setVariable("FORM_NAME", "photo_form");
\r
48 $template->setVariable("FORM_ACTION", $link);
\r
49 $template->setVariable("SELECT_NAME", "course_id");
\r
51 for ($i=0; $i<count($courses); $i++){
\r
52 $template->setCurrentBlock("OPTION_VALUE");
\r
53 $template->setVariable("TABINDEX", $i);
\r
54 $template->setVariable("VALUE", $courses[$i]['id']);
\r
55 $template->setVariable("TEXT", $courses[$i]['title']);
\r
56 $template->parseCurrentBlock("OPTION_VALUE");
\r
59 $template->setVariable("SUBMIT_NAME", "submit");
\r
60 $template->setVariable("SUBMIT_VALUE", _AT('pa_tag_go'));
\r
62 $template->parseCurrentBlock();
\r
66 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>