phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/inc class.Template3.inc.ph


From: Michael Totschnig <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/inc class.Template3.inc.php,1.3,1.4 class.bo.inc.php,1.11,1.12
Date: Tue, 04 Mar 2003 12:26:45 -0500

Update of /cvsroot/phpgroupware/sitemgr/sitemgr-site/inc
In directory subversions:/tmp/cvs-serv28077/sitemgr-site/inc

Modified Files:
        class.Template3.inc.php class.bo.inc.php 
Log Message:
reorganise place where modules are stored


Index: class.Template3.inc.php
===================================================================
RCS file: 
/cvsroot/phpgroupware/sitemgr/sitemgr-site/inc/class.Template3.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.Template3.inc.php     19 Jan 2003 01:10:02 -0000      1.3
--- class.Template3.inc.php     4 Mar 2003 17:26:43 -0000       1.4
***************
*** 90,96 ****
                                $this->template);
                        $this->permitted_modules = 
array_keys($this->modulebo->getcascadingmodulepermissions('__PAGE__',$page->cat_id));
!                       //process module calls hardcoded into template of form 
{appname.modulename?arguments}
                        $str = preg_replace_callback(
!                               "/\{([[:alnum:]_-]*)\.([[:alnum:]_-]*)(\?([^{ 
]+))?\}/",
                                array($this,'exec_module'),
                                $str);
--- 90,96 ----
                                $this->template);
                        $this->permitted_modules = 
array_keys($this->modulebo->getcascadingmodulepermissions('__PAGE__',$page->cat_id));
!                       //process module calls hardcoded into template of form 
{modulename?arguments}
                        $str = preg_replace_callback(
!                               "/\{([[:alnum:]_-]*)\?([^{ ]+)?\}/",
                                array($this,'exec_module'),
                                $str);
***************
*** 159,163 ****
                                                        //is added, we do not 
have to worry about transformers staying around 
                                                        //on the transformer 
chain
!                                                       $moduleobject = 
$this->getmodule($block->app_name,$block->module_name);
                                                        
$moduleobject->set_block($block,True);
                                                        if (isset($transformer))
--- 159,163 ----
                                                        //is added, we do not 
have to worry about transformers staying around 
                                                        //on the transformer 
chain
!                                                       $moduleobject = 
$this->getmodule($block->module_name);
                                                        
$moduleobject->set_block($block,True);
                                                        if (isset($transformer))
***************
*** 167,171 ****
  
                                                        $output = 
$moduleobject->get_output();
- 
                                                        //process module calls 
embedded into output
                                                        $content .= 
preg_replace_callback(
--- 167,170 ----
***************
*** 176,180 ****
                                                else
                                                {
!                                                       $content .= 
lang('Module %1 is not permitted in this context!',$block->app_name . '.' . 
$block->module_name);
                                                }
                                        }
--- 175,179 ----
                                                else
                                                {
!                                                       $content .= 
lang('Module %1 is not permitted in this context!',$block->module_name);
                                                }
                                        }
***************
*** 187,195 ****
                {
                        global $page;
!                       list(,$appname,$modulename,,$query)= $vars;
!                       $moduleid = 
$this->modulebo->getmoduleid($appname,$modulename);
                        if (in_array($moduleid,$this->permitted_modules))
                        {
!                               $moduleobject = 
$this->getmodule($appname,$modulename);
                                if ($moduleobject)
                                {
--- 186,194 ----
                {
                        global $page;
!                       list(,$modulename,$query)= $vars;
!                       $moduleid = $this->modulebo->getmoduleid($modulename);
                        if (in_array($moduleid,$this->permitted_modules))
                        {
!                               $moduleobject = $this->getmodule($modulename);
                                if ($moduleobject)
                                {
***************
*** 200,204 ****
                                        $block->area = '__PAGE__';
                                        $block->cat_id = $page->cat_id;
-                                       $block->app_name = $appname;
                                        $block->module_name = $modulename;
                                        $block->arguments = $arguments;
--- 199,202 ----
***************
*** 209,213 ****
                        else
                        {
!                               return lang('Module %1 is not permitted in this 
context!',$appname . '.' . $modulename);
                        }
                }
--- 207,211 ----
                        else
                        {
!                               return lang('Module %1 is not permitted in this 
context!',$modulename);
                        }
                }
***************
*** 267,281 ****
                }
  
!               function getmodule($appname,$modulename)
                {
!                       $module = $appname . '.' . $modulename;
!                       if (!in_array($module,array_keys($this->modules)))
                        {
!                               $moduleobject = 
$this->modulebo->createmodule($appname,$modulename);
!                               $this->modules[$module] = $moduleobject;
                        }
                        else
                        {
!                               $moduleobject = $this->modules[$module];
                        }
                        return $moduleobject;
--- 265,278 ----
                }
  
!               function getmodule($modulename)
                {
!                       if (!in_array($modulename,array_keys($this->modules)))
                        {
!                               $moduleobject = 
$this->modulebo->createmodule($modulename);
!                               $this->modules[$modulename] = $moduleobject;
                        }
                        else
                        {
!                               $moduleobject = $this->modules[$modulename];
                        }
                        return $moduleobject;

Index: class.bo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/sitemgr-site/inc/class.bo.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.bo.inc.php    31 Jan 2003 18:18:04 -0000      1.11
--- class.bo.inc.php    4 Mar 2003 17:26:43 -0000       1.12
***************
*** 79,85 ****
                        $page->index = True;
                        $page->block = CreateObject('sitemgr.Block_SO',True);
-                       $page->block->app_name = 'sitemgr';
                        $page->block->module_name = 'index';
!                       $page->block->module_id = 
$GLOBALS['Common_BO']->modules->getmoduleid('sitemgr','index');
                        $page->block->view = 0;
                        return true;
--- 79,84 ----
                        $page->index = True;
                        $page->block = CreateObject('sitemgr.Block_SO',True);
                        $page->block->module_name = 'index';
!                       $page->block->module_id = 
$GLOBALS['Common_BO']->modules->getmoduleid('index');
                        $page->block->view = 0;
                        return true;
***************
*** 153,160 ****
                        }
                        $page->block = CreateObject('sitemgr.Block_SO',True);
-                       $page->block->app_name = 'sitemgr';
                        $page->block->module_name = 'toc';
                        $page->block->arguments = array('category_id' => 
$category_id);
!                       $page->block->module_id = 
$GLOBALS['Common_BO']->modules->getmoduleid('sitemgr','toc');
                        $page->block->view = 0;
                        return true;
--- 152,158 ----
                        }
                        $page->block = CreateObject('sitemgr.Block_SO',True);
                        $page->block->module_name = 'toc';
                        $page->block->arguments = array('category_id' => 
$category_id);
!                       $page->block->module_id = 
$GLOBALS['Common_BO']->modules->getmoduleid('toc');
                        $page->block->view = 0;
                        return true;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]