5 * Copyright (C) 2008 Vincent Tunru
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
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
20 * @license http://www.fsf.org/licensing/licenses/info/GPLv2.html GPL v.2
21 * @category PivipModulesDefault
22 * @package Module_Page
23 * @copyright (C) 2008 Vincent Tunru
24 * @author Vincent Tunru <email@vincentt.org>
28 * Manage the Page module
30 * The Page module handles detemining which modules need to be loaded for each
33 * @see /library/Pivip/Module/Abstract.php
35 class Page_Module
extends Pivip_Module_Abstract
38 * Defines the dependencies
40 * Page depends on Pivip
42 protected $_dependencies = array('Pivip' => array('max' => '0.0.0dev'));
45 * Checks whether this module is already installed
47 * In the case of the Page module, "installed" means that the database
50 * @return boolean Whether Page is already installed.
52 public static function isInstalled()
57 * Communicate that Page does not need any configuration
59 * Always returns false since there is nothing to configure for the Page
62 * @return boolean False, since Page does not need to be configured.
64 public static function needsConfiguring()
70 * Creates the table in the database
72 * @throws Pivip_Install_Exception
73 * @return boolean Whether the installation succeeded
75 public function install()
80 * Remove the table from the database
82 * @throws Pivip_Install_Exception
83 * @return boolean Whether uninstallation succeeded
85 public function uninstall()
92 * Sets the default route to the Page module.
94 public static function bootstrap()
96 $frontController = Zend_Controller_Front
::getInstance();
97 require_once 'plugins/SegmentMapper.php';
98 $frontController->registerPlugin(new SegmentMapper());
99 $frontController->setDefaultModule('page');
100 Zend_Layout
::startMvc(array('layoutPath' =>
101 'modules/page/views/scripts'));
102 $generalConfig = Zend_Registry
::get('generalConfig');
103 $viewRenderer = Zend_Controller_Action_HelperBroker
104 ::getStaticHelper('viewRenderer');
105 $viewRenderer->view
->headTitle($generalConfig->website
->name
);