ActionHandler/Borrower.php

Go to the documentation of this file.
00001 <?php
00003 // {{{ license
00004 
00005 // +----------------------------------------------------------------------+
00006 // | FastFrame Application Framework                                      |
00007 // +----------------------------------------------------------------------+
00008 // | Copyright (c) 2002-2006 The Codejanitor Group                        |
00009 // +----------------------------------------------------------------------+
00010 // | This source file is subject to the GNU Lesser Public License (LGPL), |
00011 // | that is bundled with this package in the file LICENSE, and is        |
00012 // | available at through the world-wide-web at                           |
00013 // | http://www.fsf.org/copyleft/lesser.html                              |
00014 // | If you did not receive a copy of the LGPL and are unable to          |
00015 // | obtain it through the world-wide-web, you can get it by writing the  |
00016 // | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
00017 // | MA 02111-1307, USA.                                                  |
00018 // +----------------------------------------------------------------------+
00019 // | Authors: Jason Rust <jrust@codejanitor.com>                          |
00020 // | Authors: Greg Gilbert <ggilbert@codejanitor.com>                          |
00021 // +----------------------------------------------------------------------+
00022 
00023 // }}}
00024 // {{{ requires
00025 
00026 require_once FASTFRAME_ROOT . 'lib/FastFrame/ActionHandlerConfig.php';
00027 require_once dirname(__FILE__) . '/../Model/Borrower.php';
00028 require_once dirname(__FILE__) . '/actions.php';
00029 
00030 // }}}
00031 // {{{ class FF_ActionHandlerConfig_Borrower
00032 
00043 // }}}
00044 class FF_ActionHandlerConfig_Borrower extends FF_ActionHandlerConfig {
00045     // {{{ loadConfig()
00046 
00053     function loadConfig()
00054     {
00055         $appName = $this->actionHandler->o_registry->getCurrentApp();
00056         $this->actionHandler->setDefaultActionId(ACTION_BORROWER_LOOKUP);
00057         $this->actionHandler->batchModifyActions(
00058             array(ACTION_LIST, ACTION_EDIT, ACTION_ADD, ACTION_EDIT_SUBMIT, ACTION_ADD_SUBMIT, ACTION_DISPLAY, ACTION_SELECT),
00059             $this->actionHandler->o_registry->getAppFile('Action', $appName, 'libs'), 
00060             '_Borrower',
00061             'Borrower'
00062         );
00063         $this->actionHandler->addAction(
00064             ACTION_BORROWER_LOOKUP, 
00065             $this->actionHandler->o_registry->getAppFile('Action/BorrowerLookupForm.php', $appName, 'libs'), 
00066             'FF_Action_Form_BorrowerLookup'
00067         );
00068         $this->actionHandler->addAction(
00069             ACTION_BORROWER_LOOKUP_SUBMIT, 
00070             $this->actionHandler->o_registry->getAppFile('Action/BorrowerLookupFormSubmit.php', $appName, 'libs'), 
00071             'FF_Action_FormSubmit_BorrowerLookup'
00072         );
00073         $this->actionHandler->addAction(
00074             ACTION_BORROWER_INFO, 
00075             $this->actionHandler->o_registry->getAppFile('Action/BorrowerDisplay.php', $appName, 'libs'), 
00076             'FF_Action_Display_Borrower'
00077         );
00078         $this->actionHandler->addAction(
00079             ACTION_BORROWER_DOWNLOAD_FORM, 
00080             $this->actionHandler->o_registry->getAppFile('Action/BorrowerDownloadForm.php', $appName, 'libs'), 
00081             'FF_Action_Form_BorrowerDownload'
00082         );
00083         $this->actionHandler->addAction(
00084             ACTION_DOWNLOAD, 
00085             $this->actionHandler->o_registry->getAppFile('Action/BorrowerDownload.php', $appName, 'libs'), 
00086             'FF_Action_Download_Borrowers'
00087         );
00088         $this->actionHandler->o_model =& new FF_Model_Borrower();
00089     }
00090 
00091     // }}}
00092     // {{{ checkPerms()
00093 
00102     function checkPerms()
00103     {
00104         $o_perms =& FF_Perms::factory();
00105         if (!$o_perms->hasPerm(array('can_use_borrower'))) {
00106             $this->actionHandler->setActionId(ACTION_PROBLEM);
00107             $o_output =& FF_Output::factory();
00108             $o_output->setMessage(_('You do not have permission to use the borrowers module.'), FASTFRAME_ERROR_MESSAGE);
00109             return false;
00110         }
00111 
00112         return true;
00113     }
00114 
00115     // }}}
00116 }
00117 
00118 ?>

Generated on Fri Jun 23 11:38:15 2006 for FastFrame by  doxygen 1.4.4