phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: etemplate/inc class.editor.inc.php,1.19,1.20 cla


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: etemplate/inc class.editor.inc.php,1.19,1.20 class.soetemplate.inc.php,1.15,1.16 class.uietemplate.inc.php,1.29,1.30
Date: Sun, 29 Sep 2002 09:01:01 -0400

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

Modified Files:
        class.editor.inc.php class.soetemplate.inc.php 
        class.uietemplate.inc.php 
Log Message:
template-options now in separate fields in the editor, made options/size field 
in the db bigger and added a modified to the db

Index: class.editor.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.editor.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** class.editor.inc.php        27 Sep 2002 16:17:39 -0000      1.19
--- class.editor.inc.php        29 Sep 2002 13:00:58 -0000      1.20
***************
*** 37,40 ****
--- 37,55 ----
                        'center' => 'Center'
                );
+               var $options = array(
+                       'width',
+                       'height',
+                       'border',
+                       'class',
+                       'spaceing',
+                       'padding',
+                       'overflow'
+               );
+               var $overflows = array(
+                       '' => 'visible',
+                       'hidden' => 'hidden',
+                       'scroll' => 'scroll',
+                       'auto' => 'auto'
+               );
                var $extensions = '';
  
***************
*** 96,99 ****
--- 111,120 ----
                                'msg' => $msg
                        );
+                       $options = explode(',',$this->etemplate->size);
+                       reset($this->options);
+                       while (list($n,$opt) = each($this->options))
+                       {
+                               $content['options'][$opt] = $options[$n];
+                       }
                        $cols_spanned = array();
                        reset($this->etemplate->data);
***************
*** 161,165 ****
                                array(
                                        'type' => $types,
!                                       'align' => $this->aligns
                                ),
                                $no_button,$cols_spanned + 
array('**extensions**' => $this->extensions));
--- 182,187 ----
                                array(
                                        'type' => $types,
!                                       'align' => $this->aligns,
!                                       'overflow' => $this->overflows
                                ),
                                $no_button,$cols_spanned + 
array('**extensions**' => $this->extensions));
***************
*** 179,187 ****
                        $this->extensions = $content['**extensions**']; 
unset($content['**extensions**']);
                        $this->etemplate->init($content);
-                       $this->etemplate->size = $content['size'];
-                       $this->etemplate->style = $content['style'];
  
                        $opts = array();
                        $names = array('width','height','class');
                        while (list(,$opt) = each($names))
                        {
--- 201,216 ----
                        $this->extensions = $content['**extensions**']; 
unset($content['**extensions**']);
                        $this->etemplate->init($content);
  
                        $opts = array();
+                       reset($this->options);
+                       while (list(,$opt) = each($this->options))
+                       {
+                               $opts[$opt] = $content['options'][$opt];
+                       }
+                       $this->etemplate->size = 
ereg_replace(',*$','',implode(',',$opts));
+                       $this->etemplate->style = $content['style'];
+ 
                        $names = array('width','height','class');
+                       $opts = array();
                        while (list(,$opt) = each($names))
                        {
***************
*** 364,367 ****
--- 393,400 ----
                        elseif ($content['save'])
                        {
+                               if (!$this->etemplate->modified_set || 
!$this->etemplate->modified)
+                               {
+                                       $this->etemplate->modified = time();
+                               }
                                $ok = 
$this->etemplate->save($content['name'],$content['template'],$content['lang'],$content['group'],$content['version']);
                                $msg = $this->messages[$ok ? 'saved' : 
'error_writing'];
***************
*** 460,463 ****
--- 493,498 ----
                        }
                        $imported = 
$this->etemplate->xul_io->import(&$this->etemplate,$xul);
+                       $this->etemplate->modified = filemtime($f);
+                       $this->etemplate->modified_set = 'xul-import';
  
                        if (is_array($imported))

Index: class.soetemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.soetemplate.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.soetemplate.inc.php   27 Sep 2002 16:17:39 -0000      1.15
--- class.soetemplate.inc.php   29 Sep 2002 13:00:58 -0000      1.16
***************
*** 62,66 ****
                        'et_data' => 'data',
                        'et_size' => 'size',
!                       'et_style' => 'style'
                );
                var $db_cols;
--- 62,67 ----
                        'et_data' => 'data',
                        'et_size' => 'size',
!                       'et_style' => 'style',
!                       'et_modified' => 'modified'
                );
                var $db_cols;
***************
*** 259,263 ****
                        if ($this->name == '' || $app == '' || $name == '' || 
address@hidden($file) || !($f = @fopen($file,'r')))
                        {
!                               if ($this->debug == 1 || $this->debug == 
$this->name)
                                {
                                        echo "<p>Can't open '$file' !!!</p>\n";
--- 260,264 ----
                        if ($this->name == '' || $app == '' || $name == '' || 
address@hidden($file) || !($f = @fopen($file,'r')))
                        {
!                               if ($this->debug == 1 || $this->name != '' && 
$this->debug == $this->name)
                                {
                                        echo "<p>Can't open '$file' !!!</p>\n";
***************
*** 334,338 ****
                        while ($this->db->next_record())
                        {
!                               $result[] = $this->db->Record;
                        }
                        return $result;
--- 335,342 ----
                        while ($this->db->next_record())
                        {
!                               if ($this->db->f('et_lang') != '##')    // 
exclude or import-time-stamps
!                               {
!                                       $result[] = $this->db->Record;
!                               }
                        }
                        return $result;
***************
*** 495,498 ****
--- 499,506 ----
                                }
                        }
+                       if (!$this->modified)
+                       {
+                               $this->modified = time();
+                       }
                        $data = $this->as_array(1);
                        $data['data'] = 
serialize($this->compress_array($data['data']));
***************
*** 694,698 ****
                function import_dump($app)
                {
!                       
include(PHPGW_SERVER_ROOT."/$app/setup/etemplates.inc.php");
                        $templ = new etemplate($app);
  
--- 702,706 ----
                function import_dump($app)
                {
!                       include($path = 
PHPGW_SERVER_ROOT."/$app/setup/etemplates.inc.php");
                        $templ = new etemplate($app);
  
***************
*** 704,707 ****
--- 712,719 ----
                                }
                                $templ->data = 
unserialize(stripslashes($templ->data));
+                               if (!$templ->modified)
+                               {
+                                       $templ->modified = filemtime($path);
+                               }
                                $templ->save();
                        }
***************
*** 731,738 ****
                        {
                                $templ = new soetemplate(".$app",'','##');
!                               if ($templ->lang != '##' || $templ->data[0] < 
$time) // need to import
                                {
                                        $ret = $this->import_dump($app);
!                                       $templ->data = array($time);
                                        $templ->save(".$app",'','##');
                                }
--- 743,750 ----
                        {
                                $templ = new soetemplate(".$app",'','##');
!                               if ($templ->lang != '##' || $templ->modified < 
$time) // need to import
                                {
                                        $ret = $this->import_dump($app);
!                                       $templ->modified = $time;
                                        $templ->save(".$app",'','##');
                                }

Index: class.uietemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.uietemplate.inc.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** class.uietemplate.inc.php   29 Sep 2002 08:50:18 -0000      1.29
--- class.uietemplate.inc.php   29 Sep 2002 13:00:58 -0000      1.30
***************
*** 302,310 ****
                                
$GLOBALS['phpgw_info']['etemplate']['styles_included'][$this->name] = True;
                        }
!                       list(,,$border) = explode(',',$this->size);
  
!                       return "\n\n<!-- BEGIN $this->name -->\n$style\n".
!                               
$this->html->table($rows,$this->html->formatOptions($this->size,'WIDTH,HEIGHT,BORDER,CLASS,CELLSPACING,CELLPADDING')).
!                               "<!-- END $this->name -->\n\n";
                }
  
--- 302,313 ----
                                
$GLOBALS['phpgw_info']['etemplate']['styles_included'][$this->name] = True;
                        }
!                       $html = 
$this->html->table($rows,$this->html->formatOptions($this->size,'WIDTH,HEIGHT,BORDER,CLASS,CELLSPACING,CELLPADDING'));
  
!                       list($width,$height,,,,,$overflow) = 
explode(',',$this->size);
!                       if (!empty($overflow)) {
!                               $div_style=' STYLE="'.($width?"width: $width; 
":'').($height ? "height: $height; ":'')."overflow: $overflow\"";
!                               $html = $this->html->div($html,$div_style);
!                       }
!                       return "\n\n<!-- BEGIN $this->name 
-->\n$style\n".$html."<!-- END $this->name -->\n\n";
                }
  





reply via email to

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