public static function addPaths($role, $paths) { switch ($role) { case 'model': $options =& PEAR::getStaticProperty('DB_DataObject', 'options'); $options['class_location'] .= ':' . implode(',', $paths); break; case 'lang': foreach ($paths as $path) { T::addPath($path); } break; case 'templates': $moduloptions =& PEAR::getStaticProperty('Module', 'global'); if (!is_array($moduloptions['template_dir'])) { $moduloptions['template_dir'] = array(); } $moduloptions['template_dir'] = array_merge($moduloptions['template_dir'], $paths); break; case 'modules': $dispatchopt =& PEAR::getStaticProperty('Dispatcher', 'global'); if (!is_array($dispatchopt['all']['modulepath'])) { $dispatchopt['all']['modulepath'] = array(); } $dispatchopt['all']['modulepath'] = array_merge($dispatchopt['all']['modulepath'], $paths); break; default: Mreg::append("{$role}_paths", $paths); break; } }
* * * @package M * @subpackage M_Office * @author Arnaud Sellenet <demental at github> * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License * @version 0.1 */ if (!defined('ROOT_ADMIN_SCRIPT')) { define('ROOT_ADMIN_SCRIPT', ''); } if (!defined('OFFICE_TEMPLATES_FOLDER')) { define('OFFICE_TEMPLATES_FOLDER', realpath(dirname(__FILE__)) . '/Office/Templates/'); } $dispatchopt =& PEAR::getStaticProperty('Dispatcher', 'global'); T::addPath(dirname(__FILE__) . '/Office/lang/'); /** * * "Office" application dispatcher * The office application is one of the most powerful features of the M framework. * It's also the one that needs most refactoring * This was originally base upon Justin Patrin's PEAR_DB_DataObject_FormBuilder_Frontend * * */ class M_Office extends M_Office_Controller implements iListener { public static $dsp = '__defaut/index'; public function __construct($layout = 'main') { parent::__construct();