~ubuntu-branches/ubuntu/quantal/gallery2/quantal

« back to all changes in this revision

Viewing changes to lib/tools/repository/MainPage.inc

  • Committer: Bazaar Package Importer
  • Author(s): Michael C. Schultheiss
  • Date: 2007-09-10 20:22:19 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070910202219-0jsuntvqge4ade6b
Tags: 2.2.3-2
Add Slovak translation of Debconf templates.  (Thanks to 
Ivan Masá.  Closes: #441671)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/*
3
 
 * Gallery - a web based photo album viewer and editor
4
 
 * Copyright (C) 2000-2007 Bharat Mediratta
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or (at
9
 
 * your option) any later version.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful, but
12
 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
 * General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
19
 
 */
20
 
 
21
 
/**
22
 
 * Controller for the initial page displaying link to available actions.
23
 
 *
24
 
 * @author Jozef Selesi <selesi at gmail dot com>
25
 
 *
26
 
 * @version $Revision: 15513 $
27
 
 * @package RepositoryTools
28
 
 * @subpackage Controllers
29
 
 * @module MainPageController
30
 
 */
31
 
class MainPageControllerAndView extends RepositoryControllerAndView {
32
 
 
33
 
    /**
34
 
     * Displays the available actions in the repository tools.
35
 
     *
36
 
     * @return object GalleryStatus a status code
37
 
     */
38
 
     function showAvailableActions() {
39
 
        global $gallery;
40
 
        $data = array();
41
 
        $urlGenerator =& $gallery->getUrlGenerator();
42
 
 
43
 
        /* Make sure logged in user is an administrator. */
44
 
        list ($ret, $data['isSiteAdmin']) = GalleryCoreApi::isUserInSiteAdminGroup();
45
 
        if ($ret) {
46
 
            print $ret->getAsHtml();
47
 
            return;
48
 
        }
49
 
 
50
 
        /* Create links for repository actions. */
51
 
        $data['packagePluginLink'] = $urlGenerator->generateUrl(array(
52
 
            'controller' => 'PackagePlugin', 'action' => 'showAvailablePlugins'));
53
 
        $data['packageAllPlugins'] = $urlGenerator->generateUrl(array(
54
 
            'controller' => 'PackagePlugin', 'action' => 'packagePlugins'));
55
 
        $data['generateIndex'] = $urlGenerator->generateUrl(array(
56
 
            'controller' => 'IndexGenerator', 'action' => 'generate'));
57
 
        $data['browseRepository'] = $urlGenerator->generateUrl(array(
58
 
            'controller' => 'RepositoryManager', 'action' => 'browse'));
59
 
 
60
 
        $ret = $this->showView('MainPage', $data);
61
 
        if ($ret) {
62
 
            return $ret;
63
 
        }
64
 
        return null;
65
 
    }
66
 
}
67
 
?>