phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgwapi/inc class.xslttemplates.inc.php, 1.17 functi


From: ceb
Subject: [Phpgroupware-cvs] phpgwapi/inc class.xslttemplates.inc.php, 1.17 functions.inc.php, 1.178 class.common.inc.php, 1.227 class.nextmatchs.inc.php, 1.70 class.nextmatchs_xslt.inc.php, 1.1
Date: Thu, 24 Feb 2005 15:58:12 -0000

Update of phpgwapi/inc

Modified Files:
     Branch: MAIN
            class.xslttemplates.inc.php lines: +13 -37
            functions.inc.php lines: +14 -36
            class.common.inc.php lines: +13 -10
            class.nextmatchs.inc.php lines: +5 -65
Added Files:
     Branch: MAIN
            class.nextmatchs_xslt.inc.php 

Log Message:
update xslt support

====================================================
Index: phpgwapi/inc/class.xslttemplates.inc.php
diff -u phpgwapi/inc/class.xslttemplates.inc.php:1.16 
phpgwapi/inc/class.xslttemplates.inc.php:1.17
--- phpgwapi/inc/class.xslttemplates.inc.php:1.16       Thu Dec 30 06:47:31 2004
+++ phpgwapi/inc/class.xslttemplates.inc.php    Tue Jan 18 01:51:20 2005
@@ -1,28 +1,15 @@
 <?php
-       /*******************************************************************\
-       * phpGroupWare API - XSLT Template class                            *
-       * Written by Dan Kuykendall <address@hidden>               *
-       * and Bettina Gille address@hidden                          *
-       * and Ralf Becker <address@hidden>                  *
-       * Copyright (C) 2002 Dan Kuykendall, Bettina Gille, Ralf Becker     *
-       * ----------------------------------------------------------------- *
-       * This library is part of the phpGroupWare API                      *
-       * ----------------------------------------------------------------- *
-       * This library is free software; you can redistribute it and/or     *
-       * modify it under the terms of the GNU General Public License as    *
-       * published by the Free Software Foundation; either version 2 of    *
-       * the License, or (at your option) any later version.               *
-       *                                                                   *
-       * This program is distributed in the hope that it will be useful,   *
-       * but WITHOUT ANY WARRANTY; without even the implied warranty of    *
-       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  *
-       * General Public License for more details.                          *
-       *                                                                   *
-       * You should have received a copy of the GNU General Public License *
-       * along with this program; if not, write to the Free Software       *
-       * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.         *
-       \*******************************************************************/
-  /* $Id$ */
+       /**
+       * XSLT Template class
+       * @author Dan Kuykendall <address@hidden>
+       * @author Bettina Gille address@hidden
+       * @author Ralf Becker <address@hidden>
+       * @copyright Copyright (C) 2002-2005 Free Software Foundation, Inc 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/lpl.html GNU General Public 
License
+       * @package phpgwapi
+       * @subpackage gui
+       * @version $Id$
+       */

        if (!extension_loaded('xslt'))
        {
@@ -179,9 +166,6 @@
                        {
                                $this->vars[$name] = $value;
                        }
-
-//                     $GLOBALS['phpgw']->xslttpl->pp();
-
                }

                function set_xml($xml, $append = False)
@@ -279,19 +263,11 @@
                {
                        if (!$GLOBALS['phpgw_info']['flags']['noframework'])
                        {
-                               $GLOBALS['phpgw']->common->phpgw_header();
-                               echo parse_navbar();
-                               $GLOBALS['phpgw_info']['flags']['noframework'] 
= False;
+                               $GLOBALS['phpgw']->common->phpgw_header(True);
                        }
                        else
                        {
-                               include(PHPGW_INCLUDE_ROOT . 
'/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set']
-                                       . '/head.inc.php');
-
-                               
if($GLOBALS['phpgw_info']['flags']['app_header'])
-                               {
-                                       echo '<table width="100%" ><tr 
class="th"><td class="th_text" align = "center">' . 
$GLOBALS['phpgw_info']['flags']['app_header'] . '</td></tr></table>';
-                               }
+                               include_once(PHPGW_INCLUDE_ROOT . 
'/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] . 
'/head.inc.php');
                        }

                        if($parsexsl)

====================================================
Index: phpgwapi/inc/functions.inc.php
diff -u phpgwapi/inc/functions.inc.php:1.177 
phpgwapi/inc/functions.inc.php:1.178
--- phpgwapi/inc/functions.inc.php:1.177        Tue Jan 11 13:39:26 2005
+++ phpgwapi/inc/functions.inc.php      Tue Jan 18 01:51:20 2005
@@ -10,7 +10,7 @@
        * @version $Id$
        */

-
+
        
/****************************************************************************\
        * If running in PHP3, then force admin to upgrade                       
     *
        
\****************************************************************************/
@@ -216,17 +216,17 @@
        
/************************************************************************\
        * Required classes                                                      
 *
        
\************************************************************************/
-       $GLOBALS['phpgw']->log          = CreateObject('phpgwapi.log');
+       $GLOBALS['phpgw']->log                  = CreateObject('phpgwapi.log');
        include_once(PHPGW_API_INC . '/log_functions.inc.php');
-       $GLOBALS['phpgw']->translation  = CreateObject('phpgwapi.translation');
-       $GLOBALS['phpgw']->common       = CreateObject('phpgwapi.common');
-       $GLOBALS['phpgw']->hooks        = CreateObject('phpgwapi.hooks');
-       $GLOBALS['phpgw']->auth         = CreateObject('phpgwapi.auth');
-       $GLOBALS['phpgw']->accounts     = CreateObject('phpgwapi.accounts');
-       $GLOBALS['phpgw']->acl          = CreateObject('phpgwapi.acl');
-       $GLOBALS['phpgw']->session      = CreateObject('phpgwapi.sessions');
-       $GLOBALS['phpgw']->preferences  = CreateObject('phpgwapi.preferences');
-       $GLOBALS['phpgw']->applications = CreateObject('phpgwapi.applications');
+       $GLOBALS['phpgw']->translation  = CreateObject('phpgwapi.translation');
+       $GLOBALS['phpgw']->common               = 
CreateObject('phpgwapi.common');
+       $GLOBALS['phpgw']->hooks                = 
CreateObject('phpgwapi.hooks');
+       $GLOBALS['phpgw']->auth                 = CreateObject('phpgwapi.auth');
+       $GLOBALS['phpgw']->accounts             = 
CreateObject('phpgwapi.accounts');
+       $GLOBALS['phpgw']->acl                  = CreateObject('phpgwapi.acl');
+       $GLOBALS['phpgw']->session              = 
CreateObject('phpgwapi.sessions');
+       $GLOBALS['phpgw']->preferences  = CreateObject('phpgwapi.preferences');
+       $GLOBALS['phpgw']->applications = CreateObject('phpgwapi.applications');
        print_debug('main class loaded', 'messageonly','api');
        // This include was here before for the old error class.  I've left it 
in for the
        // new log_message class with replaced error.  I'm not sure if it is 
needed, though. -doug
@@ -348,8 +348,7 @@
                
if(address@hidden'phpgw_info']['flags']['disable_Template_class'])
                {
                        $GLOBALS['phpgw']->template = 
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-                       $GLOBALS['phpgw']->xslttpl = 
CreateObject('phpgwapi.xslttemplates',PHPGW_TEMPLATE_DIR);
-                       $GLOBALS['phpgw']->xslttpl->set_root(PHPGW_APP_TPL);
+                       $GLOBALS['phpgw']->xslttpl = 
CreateObject('phpgwapi.xslttemplates',PHPGW_APP_TPL);
                }

                
/*************************************************************************\
@@ -380,27 +379,6 @@
                                
$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = 
$GLOBALS['phpgw_info']['server']['force_theme'];
                        }
                }
-
-               /* Core-Team decided to use CSS
-               if(@file_exists(PHPGW_SERVER_ROOT . '/phpgwapi/themes/' . 
$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '.theme'))
-               {
-                       include(PHPGW_SERVER_ROOT . '/phpgwapi/themes/' . 
$GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '.theme');
-               }
-               elseif(@file_exists(PHPGW_SERVER_ROOT . 
'/phpgwapi/themes/default.theme'))
-               {
-                       include(PHPGW_SERVER_ROOT . 
'/phpgwapi/themes/default.theme');
-               }
-               else
-               {
-                       echo '<body bgcolor="FFFFFF">';
-                       echo lang('No themes found');
-                       echo '</body>';
-                       $GLOBALS['phpgw']->log->write(array('text'=>'F-Abort, 
No themes found'));
-
-                       exit;
-               }
-               */
-               unset($theme_to_load);

                
/*************************************************************************\
                * If they are using frames, we need to set some variables       
          *
@@ -448,7 +426,7 @@
                
\*************************************************************************/
                if (address@hidden'phpgw_info']['flags']['noheader'])
                {
-                       $GLOBALS['phpgw']->common->phpgw_header();
+                       
$GLOBALS['phpgw']->common->phpgw_header($GLOBALS['phpgw_info']['flags']['nonavbar']?False:True);
                }

                
/*************************************************************************\

====================================================
Index: phpgwapi/inc/class.common.inc.php
diff -u phpgwapi/inc/class.common.inc.php:1.226 
phpgwapi/inc/class.common.inc.php:1.227
--- phpgwapi/inc/class.common.inc.php:1.226     Mon Jan 17 15:23:57 2005
+++ phpgwapi/inc/class.common.inc.php   Tue Jan 18 01:51:20 2005
@@ -794,7 +794,7 @@
                        }
                        if 
(empty($GLOBALS['phpgw_info']['server']['template_set']))
                        {
-                               
$GLOBALS['phpgw_info']['server']['template_set'] = 'simple';
+                               
$GLOBALS['phpgw_info']['server']['template_set'] = 'base';
                        }

                        $imagedir                       = PHPGW_SERVER_ROOT . 
'/' . $appname . '/templates/' . 
$GLOBALS['phpgw_info']['server']['template_set'] . '/images';
@@ -1053,28 +1053,31 @@
                /**
                * Load header.inc.php for an application
                */
-               function app_header()
+               /*function app_header()
                {
                        if (file_exists(PHPGW_APP_INC . '/header.inc.php'))
                        {
                                include(PHPGW_APP_INC . '/header.inc.php');
                        }
-               }
+               }*/

                /**
                * Load the phpgw header
                */
-               function phpgw_header()
+               function phpgw_header($navbar = False)
                {
-                       include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . 
$GLOBALS['phpgw_info']['server']['template_set']
-                               . '/head.inc.php');
+                       include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . 
$GLOBALS['phpgw_info']['server']['template_set'] . '/head.inc.php');
                        $this->navbar(False);
-                       include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . 
$GLOBALS['phpgw_info']['server']['template_set']
-                               . '/navbar.inc.php');
-                       if (address@hidden'phpgw_info']['flags']['nonavbar'] && 
address@hidden'phpgw_info']['flags']['navbar_target'])
+                       include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . 
$GLOBALS['phpgw_info']['server']['template_set'] . '/navbar.inc.php');
+                       if ($navbar)
                        {
                                echo parse_navbar();
                        }
+
+                       if($GLOBALS['phpgw_info']['flags']['xslt_app'])
+                       {
+                               
$GLOBALS['phpgw']->xslttpl->add_file('app_data');
+                       }
                }

                function phpgw_footer()

====================================================
Index: phpgwapi/inc/class.nextmatchs.inc.php
diff -u phpgwapi/inc/class.nextmatchs.inc.php:1.69 
phpgwapi/inc/class.nextmatchs.inc.php:1.70
--- phpgwapi/inc/class.nextmatchs.inc.php:1.69  Thu Jan 13 11:30:12 2005
+++ phpgwapi/inc/class.nextmatchs.inc.php       Tue Jan 18 01:51:20 2005
@@ -3,20 +3,22 @@
        * Handles limiting number of rows displayed
        * @author Joseph Engo <address@hidden>
        * @author Bettina Gille <address@hidden>
-       * @copyright Copyright (C) 2000-2004 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.fsf.org/licenses/lgpl.html GNU Lesser General 
Public License
        * @package phpgwapi
        * @subpackage gui
        * @version $Id$
        */

+       include_once(PHPGW_API_INC . '/class.nextmatchs_xslt.inc.php');
+
        /**
        * Handles limiting number of rows displayed
        *
        * @package phpgwapi
        * @subpackage gui
        */
-       class nextmatchs
+       class nextmatchs extends nextmatchs_xslt
        {
                var $maxmatches;
                var $action;
@@ -941,67 +943,5 @@
                        return '<img src="'.$img_full.'" border="0" width="12" 
height="12" alt="'.$alt_text.'">'."\r\n";
                }

-               function xslt_filter($data=0)
-               {
-                       
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','base')
 . SEP . 'filter_select');
-
-                       if(is_array($data))
-                       {
-                               $filter         = 
(isset($data['filter'])?$data['filter']:'');
-                               $format         = 
(isset($data['format'])?$data['format']:'all');
-                               $link_data      = 
(isset($data['link_data'])?$data['link_data']:'');
-                       }
-                       else
-                       {
-                               //$filter = 
get_var('filter',Array('GET','POST'));
-                               //$filter = $data;
-                               //$format       = 'all';
-                               return False;
-                       }
-
-                       switch($format)
-                       {
-                               case 'yours':
-                                       $filter_obj = array
-                                       (
-                                               array('key' => 'none','lang' => 
lang('show all')),
-                                               array('key' => 'yours','lang' 
=> lang('only yours'))
-                                       );
-                                       break;
-                               case 'private':
-                                       $filter_obj = array
-                                       (
-                                               array('key' => 'none','lang' => 
lang('show all')),
-                                               array('key' => 'private','lang' 
=> lang('only private'))
-                                       );
-                                       break;
-                               default:
-                                       $filter_obj = array
-                                       (
-                                               array('key' => 'none','lang' => 
lang('show all')),
-                                               array('key' => 'yours','lang' 
=> lang('only yours')),
-                                               array('key' => 'private','lang' 
=> lang('only private'))
-                                       );
-                       }
-
-                       for($i=0;$i<count($filter_obj);$i++)
-                       {
-                               if($filter_obj[$i]['key'] == $filter)
-                               {
-                                       $filter_obj[$i]['selected'] = 'yes';
-                               }
-                       }
-
-                       $filter_data = array
-                       (
-                               'filter_list'                           => 
$filter_obj,
-                               'lang_filter_statustext'        => lang('Select 
the filter. To show all entries select SHOW ALL'),
-                               'lang_submit'                           => 
lang('submit'),
-                               'select_url'                            => 
$GLOBALS['phpgw']->link('/index.php',$link_data)
-                       );
-                       return $filter_data;
-               }
-
-
        } // End of nextmatchs class
 ?>

====================================================
Index: class.nextmatchs_xslt.inc.php
<?php
        /**
        * Handles xslt nm widgets
        * @author Bettina Gille <address@hidden>
        * @copyright Copyright (C) 2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.fsf.org/licenses/gpl.html GNU General Public 
License
        * @package phpgwapi
        * @subpackage gui
        * @version $Id: class.nextmatchs_xslt.inc.php,v 1.1 2005/01/18 01:51:20 
ceb Exp $
        */

        /*!
        @class nextmatchs_xslt
        @abstract
        */
        class nextmatchs_xslt
        {
                var $maxmatches;
                var $action;
                var $template;

                function nextmatchs_xslt()
                {

                }

                function xslt_filter($data=0)
                {
                        
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','base')
 . SEP . 'filter_select');

                        if(is_array($data))
                        {
                                $filter         = 
(isset($data['filter'])?$data['filter']:'');
                                $format         = 
(isset($data['format'])?$data['format']:'all');
                                $link_data      = 
(isset($data['link_data'])?$data['link_data']:'');
                        }
                        else
                        {
                                //$filter = 
get_var('filter',Array('GET','POST'));
                                //$filter = $data;
                                //$format       = 'all';
                                return False;
                        }

                        switch($format)
                        {
                                case 'yours':
                                        $filter_obj = array
                                        (
                                                array('key' => 'none','lang' => 
lang('show all')),
                                                array('key' => 'yours','lang' 
=> lang('only yours'))
                                        );
                                        break;
                                case 'private':
                                        $filter_obj = array
                                        (
                                                array('key' => 'none','lang' => 
lang('show all')),
                                                array('key' => 'private','lang' 
=> lang('only private'))
                                        );
                                        break;
                                default:
                                        $filter_obj = array
                                        (
                                                array('key' => 'none','lang' => 
lang('show all')),
                                                array('key' => 'yours','lang' 
=> lang('only yours')),
                                                array('key' => 'private','lang' 
=> lang('only private'))
                                        );
                        }

                        for($i=0;$i<count($filter_obj);$i++)
                        {
                                if($filter_obj[$i]['key'] == $filter)
                                {
                                        $filter_obj[$i]['selected'] = 'yes';
                                }
                        }

                        $filter_data = array
                        (
                                'filter_list'                           => 
$filter_obj,
                                'lang_filter_statustext'        => lang('Select 
the filter. To show all entries select SHOW ALL'),
                                'lang_submit'                           => 
lang('submit'),
                                'select_url'                            => 
$GLOBALS['phpgw']->link('/index.php',$link_data)
                        );
                        return $filter_data;
                }

                function xslt_search($values=0)
                {
                        
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','base')
 . SEP . 'search_field');

                        $search_data = array
                        (
                                'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
                                'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
                                'query'                                         
        => $values['query'],
                                'lang_search'                                   
=> lang('search'),
                                'select_url'                                    
=> $GLOBALS['phpgw']->link('/index.php',$values['link_data'])
                        );
                        return $search_data;
                }

                function xslt_nm($values = 0)
                {
                        
$GLOBALS['phpgw']->xslttpl->add_file($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','base')
 . SEP . 'nextmatchs');

                        $nm_data = array
                        (
                                'img_width'                     => 
($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set']=='funkwerk'?'':'12'),
                                'img_height'            => 
($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set']=='funkwerk'?'':'12'),
                                'allow_all_rows'        => 
(isset($values['allow_all_rows'])?False:'yes'),
                                'start_record'          => 
intval($values['start']),
                                'record_limit'          => $this->maxmatches,
                                'num_records'           => 
intval($values['num_records']),
                                'all_records'           => 
intval($values['all_records']),
                                'nextmatchs_url'        => 
$GLOBALS['phpgw']->link('/index.php',$values['link_data']),
                                'first_img'                     => 
$GLOBALS['phpgw']->common->image('phpgwapi','first'),
                                'first_grey_img'        => 
$GLOBALS['phpgw']->common->image('phpgwapi','first-grey'),
                                'left_img'                      => 
$GLOBALS['phpgw']->common->image('phpgwapi','left'),
                                'left_grey_img'         => 
$GLOBALS['phpgw']->common->image('phpgwapi','left-grey'),
                                'right_img'                     => 
$GLOBALS['phpgw']->common->image('phpgwapi','right'),
                                'right_grey_img'        => 
$GLOBALS['phpgw']->common->image('phpgwapi','right-grey'),
                                'last_img'                      => 
$GLOBALS['phpgw']->common->image('phpgwapi','last'),
                                'last_grey_img'         => 
$GLOBALS['phpgw']->common->image('phpgwapi','last-grey'),
                                'all_img'                       => 
$GLOBALS['phpgw']->common->image('phpgwapi','down_nm'),
                                'title_first'           => lang('first page'),
                                'title_previous'        => lang('previous 
page'),
                                'title_next'            => lang('next page'),
                                'title_last'            => lang('last page'),
                                'title_all'                     => lang('show 
all'),
                                'lang_showing'          => 
$this->show_hits(intval($values['all_records']),intval($values['start']))
                        );
                        return $nm_data;
                }
        }
?>






reply via email to

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