2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2009 */
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************/
15 define('AT_INCLUDE_PATH', '../../include/');
16 require (AT_INCLUDE_PATH.'vitals.inc.php');
17 //include (AT_INCLUDE_PATH.'../mods/_core/file_manager/filemanager.inc.php'); //clr_dir()
18 include (AT_INCLUDE_PATH.'lib/filemanager.inc.php'); //clr_dir()
19 include (AT_PA_INCLUDE.'lib.inc.php');
20 include (AT_PA_INCLUDE.'classes/PhotoAlbum.class.php');
22 admin_authenticate(AT_ADMIN_PRIV_PHOTO_ALBUM);
25 $aid = intval($_REQUEST['aid']);
26 $pa = new PhotoAlbum($aid);
29 if (isset($_POST['edit'])){
30 //open up the edit page
31 header('Location: edit_album.php?id='.$aid);
32 } elseif (isset($_POST['delete'])){
34 if ($_POST['submit_no']) {
35 $msg->addFeedback('CANCELLED');
36 Header('Location: index_admin.php');
39 if ($_POST['submit_yes']) {
42 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
43 Header('Location: index_admin.php');
46 //printing out the confirmation box
47 $hidden_vars['aid'] = $aid;
48 $hidden_vars['delete'] = 'delete';
49 $msg->addConfirm(array('PA_DELETE_ALBUM', htmlentities_utf82($info['name'])), $hidden_vars);
53 $page = intval($_GET['p']);
54 $albums_count = sizeof($pa->getAllAlbums());
55 $last_page = ceil($albums_count/AT_PA_ADMIN_ALBUMS_PER_PAGE);
57 if (!$page || $page < 0) {
59 } elseif ($page > $last_page){
62 $count = (($page-1) * AT_PA_ADMIN_ALBUMS_PER_PAGE) + 1;
63 $offset = ($page-1) * AT_PA_ADMIN_ALBUMS_PER_PAGE;
66 $albums = $pa->getAllAlbums($offset);
68 require (AT_INCLUDE_PATH.'header.inc.php');
70 $savant->assign('albums', $albums);
71 $savant->assign('page', $page);
72 $savant->assign('num_rows', $photos_count);
73 $savant->display('admin/pa_index.tmpl.php');
74 require (AT_INCLUDE_PATH.'footer.inc.php');