cvs: pear /Translation2 Admin.php

From: Date: Tue, 26 Oct 2004 20:34:41 +0000
Subject: cvs: pear /Translation2 Admin.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-25264@lists.php.net to get a copy of this message
ieure Tue Oct 26 16:34:41 2004 EDT Modified files: /pear/Translation2 Admin.php Log: Add getAdminDecorator() method for admin decorators. http://cvs.php.net/diff.php/pear/Translation2/Admin.php?r1=1.7&r2=1.8&ty=u Index: pear/Translation2/Admin.php diff -u pear/Translation2/Admin.php:1.7 pear/Translation2/Admin.php:1.8 --- pear/Translation2/Admin.php:1.7 Tue Oct 19 20:50:02 2004 +++ pear/Translation2/Admin.php Tue Oct 26 16:34:41 2004 @@ -16,11 +16,11 @@ // | Authors: Lorenzo Alberton <l dot alberton at quipo dot it> | // +----------------------------------------------------------------------+ // -// $Id: Admin.php,v 1.7 2004/10/20 00:50:02 ieure Exp $ +// $Id: Admin.php,v 1.8 2004/10/26 20:34:41 ieure Exp $ // /** * @package Translation2 - * @version $Id: Admin.php,v 1.7 2004/10/20 00:50:02 ieure Exp $ + * @version $Id: Admin.php,v 1.8 2004/10/26 20:34:41 ieure Exp $ */ /** @@ -35,7 +35,7 @@ * with a common API for all the containers. * * @package Translation2 - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ */ class Translation2_Admin extends Translation2 { @@ -119,6 +119,31 @@ } // }}} + // {{{ getAdminDecorator() + + /** + * Return an instance of an admin decorator + * + * + * @see Translation2::getDecorator() + * @access public + * @param string $decorator Name of the decorator + * @return object Decorator object reference + */ + function &getAdminDecorator($decorator) + { + $decorator_path = 'Translation2/Admin/Decorator/'.$decorator.'.php'; + $decorator_class = 'Translation2_Admin_Decorator_'.$decorator; + require_once $decorator_path; + if (func_num_args() > 1) { + $obj =& func_get_arg(1); + return new $decorator_class($obj); + } else { + return new $decorator_class($this); + } + } + + // }}} // {{{ createNewLang /**

« previous php.pear.cvs (#25264) next »