/* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ // | Copyright (c) 2008, Demian Turner | // | All rights reserved. | // | | // | Redistribution and use in source and binary forms, with or without | // | modification, are permitted provided that the following conditions | // | are met: | // | | // | o Redistributions of source code must retain the above copyright | // | notice, this list of conditions and the following disclaimer. | // | o Redistributions in binary form must reproduce the above copyright | // | notice, this list of conditions and the following disclaimer in the | // | documentation and/or other materials provided with the distribution. | // | o The names of the authors may not be used to endorse or promote | // | products derived from this software without specific prior written | // | permission. | // | | // | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | // | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | // | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | // | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | // | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | // | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | // | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | // | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | // | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | // | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | // | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | // | | // +---------------------------------------------------------------------------+ // | Seagull 0.6 | // +---------------------------------------------------------------------------+ // | {t.managerName}Mgr.php | // +---------------------------------------------------------------------------+ // | Author: {t.authorName} <{t.authorEmail}> | // +---------------------------------------------------------------------------+ // $Id: ManagerTemplate.html,v 1.2 2005/04/17 02:15:02 demian Exp $ require_once 'DB/DataObject.php'; /** * Type your class description here ... * * @package {t.moduleName} * @author {t.authorName} <{t.authorEmail}> */ class {t.ManagerName}Mgr extends SGL_Manager { function {t.ManagerName}Mgr() { SGL::logMessage(null, PEAR_LOG_DEBUG); parent::SGL_Manager(); $this->pageTitle = '{t.ManagerName} Manager'; $this->template = '{t.managerName}List.html'; $this->_aActionsMapping = array({foreach:t.aActionMapping,action} {action:h}{end:} ); } function validate($req, &$input) { SGL::logMessage(null, PEAR_LOG_DEBUG); $this->validated = true; $input->error = array(); $input->pageTitle = $this->pageTitle; $input->masterTemplate = $this->masterTemplate; $input->template = $this->template; $input->action = ($req->get('action')) ? $req->get('action') : 'list'; $input->aDelete = $req->get('frmDelete'); $input->submitted = $req->get('submitted'); $input->{t.managerName} = (object)$req->get('{t.managerName}'); $input->{t.managerName}Id = $req->get('frm{t.ManagerName}ID'); // if errors have occured if (isset($aErrors) && count($aErrors)) { SGL::raiseMsg('Please fill in the indicated fields'); $input->error = $aErrors; $this->validated = false; } } function display(&$output) { if ($this->conf['{t.ManagerName}Mgr']['showUntranslated'] == false) { $c = &SGL_Config::singleton(); $c->set('debug', array('showUntranslated' => false)); } } {t.methods:h} }