phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: etemplate/inc class.boetemplate.inc.php,1.12,1.1


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: etemplate/inc class.boetemplate.inc.php,1.12,1.13 class.editor.inc.php,1.7,1.8
Date: Mon, 02 Sep 2002 13:09:51 -0400

Update of /cvsroot/phpgroupware/etemplate/inc
In directory subversions:/tmp/cvs-serv29251

Modified Files:
        class.boetemplate.inc.php class.editor.inc.php 
Log Message:
fixed problem when loading an extension from an other app-dir

Index: class.boetemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.boetemplate.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.boetemplate.inc.php   2 Sep 2002 11:11:08 -0000       1.12
--- class.boetemplate.inc.php   2 Sep 2002 17:09:49 -0000       1.13
***************
*** 311,316 ****
                @author ralfbecker
                @abstact trys to load the Extension / Widget-class from the app 
or etemplate
!               @param $name name of the extension the classname should be 
class.${name}_widget.inc.php
!               @discussion the $name might be "$name.$app" to give a app-name 
(default is the current app)
                */
                function loadExtension($name,&$parent,$ui='html')
--- 311,316 ----
                @author ralfbecker
                @abstact trys to load the Extension / Widget-class from the app 
or etemplate
!               @param $name name of the extension, the classname should be 
class.${name}_widget.inc.php
!               @discussion the $name might be "$name.$app" to give a app-name 
(default is the current app,or template-name)
                */
                function loadExtension($name,&$parent,$ui='html')
***************
*** 322,325 ****
--- 322,329 ----
                        {
                                $app = 
$GLOBALS['phpgw_info']['flags']['current_app'];
+                       }
+                       if 
(!file_exists(PHPGW_SERVER_ROOT."/$app/inc/class.$class.inc.php"))
+                       {
+                               list($app) = explode('.',$this->name);
                        }
                        if 
(!file_exists(PHPGW_SERVER_ROOT."/$app/inc/class.$class.inc.php"))

Index: class.editor.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.editor.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.editor.inc.php        2 Sep 2002 11:11:08 -0000       1.7
--- class.editor.inc.php        2 Sep 2002 17:09:49 -0000       1.8
***************
*** 67,75 ****
                        {
                                $this->extensions = 
$this->scan_for_extensions();
!                               list($app) = explode('.',$this->name);
!                               if ($app != '' && $app != 'etemplate')
!                               {
!                                       $this->extensions += 
$this->scan_for_extensions($app);
!                               }
                        }
                        $content = $this->etemplate->as_array() + array(
--- 67,77 ----
                        {
                                $this->extensions = 
$this->scan_for_extensions();
!                       }
!                       list($app) = explode('.',$this->etemplate->name);
!                       if ($app && $app != 'etemplate' && 
is_array($this->extensions) &&
!                           (!is_array($this->extensions['**loaded**']) || 
!$this->extensions['**loaded**'][$app]))
!                       {
!                               $this->extensions += 
$this->scan_for_extensions($app);
!                               $this->extensions['**loaded**'][$app] = True;
                        }
                        $content = $this->etemplate->as_array() + array(
***************
*** 137,143 ****
                                echo 'editor.edit: content ='; 
_debug_array($content);
                        }
                        
$this->editor->exec('etemplate.editor.process_edit',$content,
                                array(
!                                       'type' => 
array_merge($this->etemplate->types,$this->extensions),
                                        'align' => $this->aligns
                                ),
--- 139,147 ----
                                echo 'editor.edit: content ='; 
_debug_array($content);
                        }
+                       $types = 
array_merge($this->etemplate->types,$this->extensions);
+                       unset($types['**loaded**']);
                        
$this->editor->exec('etemplate.editor.process_edit',$content,
                                array(
!                                       'type' => $types,
                                        'align' => $this->aligns
                                ),
***************
*** 436,440 ****
                /*!
                @function scan_for_extensions
!               @syntax scan_for_extensions(  )
                @author ralfbecker
                @abstract search the inc-dirs of etemplate and the app whichs 
template is edited for extensions / custom widgets
--- 440,444 ----
                /*!
                @function scan_for_extensions
!               @syntax scan_for_extensions( $app )
                @author ralfbecker
                @abstract search the inc-dirs of etemplate and the app whichs 
template is edited for extensions / custom widgets
***************
*** 448,451 ****
--- 452,456 ----
                        $dir = @opendir(PHPGW_SERVER_ROOT.'/'.$app.'/inc');
  
+                       echo "<p>loading extenstions for '$app': ";
                        while ($dir && ($file = readdir($dir)))
                        {
***************
*** 453,459 ****
--- 458,466 ----
                                         ($ext = 
$this->etemplate->loadExtension($regs[1].'.'.$app,$this->etemplate)))
                                {
+                                       echo "$regs[1], ";
                                        $extensions[$regs[1]] = 
$ext->human_name;
                                }
                        }
+                       echo "</p>\n";
                        return $extensions;
                }





reply via email to

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