phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: sitemgr/inc class.Content_BO.inc.php,1.6,1.7 cla


From: Michael Totschnig <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/inc class.Content_BO.inc.php,1.6,1.7 class.Content_SO.inc.php,1.12,1.13 class.Modules_BO.inc.php,1.4,1.5 class.module.inc.php,1.11,1.12 class.xslt_transform.inc.php,1.1,1.2
Date: Fri, 13 Jun 2003 23:34:04 -0400

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

Modified Files:
        class.Content_BO.inc.php class.Content_SO.inc.php 
        class.Modules_BO.inc.php class.module.inc.php 
        class.xslt_transform.inc.php 
Log Message:
minor adjustments


Index: class.Content_BO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Content_BO.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.Content_BO.inc.php    31 May 2003 03:53:51 -0000      1.6
--- class.Content_BO.inc.php    14 Jun 2003 03:34:02 -0000      1.7
***************
*** 191,195 ****
                }
  
!               function getversion($version_id,$lang)
                {
                        //TODO: add ACL ?
--- 191,195 ----
                }
  
!               function getversion($version_id,$lang=False)
                {
                        //TODO: add ACL ?
***************
*** 281,284 ****
--- 281,292 ----
                                
$this->so->saveversiondatalang($version_id,$data,$lang) :
                                false;
+               }
+ 
+               //this function can be called from a block's get_content 
function. It stores modification to the 
+               //blocks arguments in the database
+               function savepublicdata(&$block)
+               {
+                       //TODO: check if argument is public, disentangle 
session data from arguments
+                       
$this->so->saveversiondata($block->id,$block->version,$block->arguments);
                }
  

Index: class.Content_SO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Content_SO.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.Content_SO.inc.php    3 Jun 2003 16:01:39 -0000       1.12
--- class.Content_SO.inc.php    14 Jun 2003 03:34:02 -0000      1.13
***************
*** 256,272 ****
                }
  
!               function getversion($version_id,$lang)
                {
!                       $sql = "SELECT arguments, arguments_lang FROM 
phpgw_sitemgr_content AS t1 LEFT JOIN phpgw_sitemgr_content_lang AS t2 ON 
(t1.version_id = t2.version_id AND lang='$lang') WHERE t1.version_id = 
$version_id";
  
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())
                        {
!                               $block = CreateObject('sitemgr.Block_SO',True);
!                               $block->arguments = array_merge(
!                                       
unserialize(stripslashes($this->db->f('arguments'))),
!                                       
unserialize(stripslashes($this->db->f('arguments_lang')))
!                               );
!                               return $block;
                        }
                        else
--- 256,275 ----
                }
  
!               //returns the versions arguments array
!               function getversion($version_id,$lang=false)
                {
!                       $fields = "arguments" . ($lang ? ', arguments_lang' : 
'');
!                       $lang_join = $lang ? "LEFT JOIN 
phpgw_sitemgr_content_lang AS t2 ON (t1.version_id = t2.version_id AND 
lang='$lang')" : '';
!                       $sql = "SELECT $fields FROM phpgw_sitemgr_content AS t1 
$lang_join WHERE t1.version_id = $version_id";
  
                        $this->db->query($sql,__LINE__,__FILE__);
                        if ($this->db->next_record())
                        {
!                                return $lang ? 
!                                       array_merge(
!                                               
unserialize(stripslashes($this->db->f('arguments'))),
!                                               
unserialize(stripslashes($this->db->f('arguments_lang'))) 
!                                       ) : 
!                                       
unserialize(stripslashes($this->db->f('arguments')));
                        }
                        else

Index: class.Modules_BO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Modules_BO.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.Modules_BO.inc.php    30 May 2003 04:01:43 -0000      1.4
--- class.Modules_BO.inc.php    14 Jun 2003 03:34:02 -0000      1.5
***************
*** 25,29 ****
                function 
savemoduleproperties($module_id,$element,$contentarea,$cat_id)
                {
!                       
$this->so->savemoduleproperties($module_id,$element,$contentarea,$cat_id);
                }
  
--- 25,34 ----
                function 
savemoduleproperties($module_id,$element,$contentarea,$cat_id)
                {
!                       $module = $this->getmodule($module_id);
!                       $moduleobject = 
$this->createmodule($module['module_name']);
!                       if ($moduleobject->validate_properties($element))
!                       {
!                               
$this->so->savemoduleproperties($module_id,$element,$contentarea,$cat_id);
!                       }
                }
  

Index: class.module.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.module.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** class.module.inc.php        1 Jun 2003 01:00:39 -0000       1.11
--- class.module.inc.php        14 Jun 2003 03:34:02 -0000      1.12
***************
*** 19,22 ****
--- 19,23 ----
  class Module 
  {
+       var $i18n; //flag a module must use if it wants its content to be 
translatable
        var $validation_error;
        var $transformer_chain;
***************
*** 52,56 ****
                        if ($this->session)
                        {
!                               $sessionarguments = 
$GLOBALS['phpgw']->session->appsession($block->module_name,'sitemgr-site');
                                while (list(,$argument) = @each($this->session))
                                {
--- 53,57 ----
                        if ($this->session)
                        {
!                               $sessionarguments = 
$GLOBALS['phpgw']->session->appsession('block[' . $block->id . ']', 
'sitemgr-site');
                                while (list(,$argument) = @each($this->session))
                                {
***************
*** 63,69 ****
                        while (list(,$argument) = @each($this->get))
                        {
!                               if 
(isset($_GET[$block->module_name][$argument]))
                                {
!                                       $block->arguments[$argument] = 
$_GET[$block->module_name][$argument];
                                }
                        }
--- 64,70 ----
                        while (list(,$argument) = @each($this->get))
                        {
!                               if 
(isset($_GET['block'][$block->id][$argument]))
                                {
!                                       $block->arguments[$argument] = 
$_GET['block'][$block->id][$argument];
                                }
                        }
***************
*** 72,85 ****
                        while (list($argument,) = @each($this->post))
                        {
!                               if 
(isset($_POST[$block->module_name][$argument]))
                                {
!                                       $block->arguments[$argument] = 
$_POST[$block->module_name][$argument];
                                }
                        }
                        while (list(,$argument) = @each($this->cookie))
                        {
!                               if 
(isset($_COOKIE[$block->module_name][$argument]))
                                {
!                                       $block->arguments[$argument] = 
$_COOKIE[$block->module_name][$argument];
                                }
                        }
--- 73,86 ----
                        while (list($argument,) = @each($this->post))
                        {
!                               if 
(isset($_POST['block'][$block->id][$argument]))
                                {
!                                       $block->arguments[$argument] = 
$_POST['block'][$block->id][$argument];
                                }
                        }
                        while (list(,$argument) = @each($this->cookie))
                        {
!                               if 
(isset($_COOKIE['block'][$block->id][$argument]))
                                {
!                                       $block->arguments[$argument] = 
$_COOKIE['block'][$block->id][$argument];
                                }
                        }
***************
*** 93,97 ****
                {
                        //%5B and %5D are urlencoded [ and ]
!                       $extravars[$this->block->module_name.'%5B'.$key.'%5D'] 
= $value;
                }
                if ($GLOBALS['page']->name)
--- 94,98 ----
                {
                        //%5B and %5D are urlencoded [ and ]
!                       $extravars['block' . '%5B'. $this->block->id  .'%5D%5B' 
. $key . '%5D'] = $value;
                }
                if ($GLOBALS['page']->name)
***************
*** 229,236 ****
        {
                $properties = $this->get_properties(False);
-               $elementname = 'element[' .$key . ']';
                $interface = array();
                while (list($key,$input) = @each($this->properties))
                {
                        $element['label'] = $input['label'];
                        $element['form'] = 
$this->build_input_element($input,$properties[$key],$elementname);
--- 230,237 ----
        {
                $properties = $this->get_properties(False);
                $interface = array();
                while (list($key,$input) = @each($this->properties))
                {
+                       $elementname = 'element[' .$key . ']';
                        $element['label'] = $input['label'];
                        $element['form'] = 
$this->build_input_element($input,$properties[$key],$elementname);
***************
*** 245,249 ****
                        $this->post[$key],
                        ($default !== False) ? $default : 
$this->block->arguments[$key],
!                       ($this->block->module_name . '[' . $key . ']')
                );
        }
--- 246,250 ----
                        $this->post[$key],
                        ($default !== False) ? $default : 
$this->block->arguments[$key],
!                       ('block[' . $this->block->id  . '][' . $key . ']')
                );
        }
***************
*** 317,320 ****
--- 318,326 ----
        }
  
+       function validate_properties(&$data)
+       {
+               return true;
+       }
+ 
        //never call get_content directly, get_output takes care of passing it 
the right arguments
        function get_content(&$arguments,$properties)
***************
*** 351,355 ****
                                        }
                                }
!                               
$GLOBALS['phpgw']->session->appsession($this->block->module_name,'sitemgr-site',$sessionarguments);
                        }
                        return $content;
--- 357,361 ----
                                        }
                                }
!                               $GLOBALS['phpgw']->session->appsession('block[' 
. $block->id . ']','sitemgr-site',$sessionarguments);
                        }
                        return $content;

Index: class.xslt_transform.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.xslt_transform.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.xslt_transform.inc.php        17 Jan 2003 03:37:52 -0000      1.1
--- class.xslt_transform.inc.php        14 Jun 2003 03:34:02 -0000      1.2
***************
*** 5,11 ****
        var $arguments;
  
!       function xslt_transform($xsltfile)
        {
                $this->xsltfile = $xsltfile;
        }
  
--- 5,12 ----
        var $arguments;
  
!       function xslt_transform($xsltfile,$xsltparameters=NULL)
        {
                $this->xsltfile = $xsltfile;
+               $this->xsltparameters = $xsltparameters;
        }
  
***************
*** 14,18 ****
                $xh = xslt_create();
                $xsltarguments = array('/_xml' => $content);
!               $result = xslt_process($xh, 'arg:/_xml', $this->xsltfile, NULL, 
$xsltarguments);
                xslt_free($xh);
                return $result;
--- 15,19 ----
                $xh = xslt_create();
                $xsltarguments = array('/_xml' => $content);
!               $result = xslt_process($xh, 'arg:/_xml', $this->xsltfile, NULL, 
$xsltarguments,$this->xsltparameters);
                xslt_free($xh);
                return $result;





reply via email to

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