source: trunk/news_admin/inc/class.boexport.inc.php @ 2

Revision 2, 2.4 KB checked in by niltonneto, 17 years ago (diff)

Removida todas as tags usadas pelo CVS ($Id, $Source).
Primeira versão no CVS externo.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2        /**************************************************************************\
3        * eGroupWare - News                                                        *
4        * http://www.egroupware.org                                                *
5        * --------------------------------------------                             *
6        *  This program is free software; you can redistribute it and/or modify it *
7        *  under the terms of the GNU General Public License as published by the   *
8        *  Free Software Foundation; either version 2 of the License, or (at your  *
9        *  option) any later version.                                              *
10        * --------------------------------------------                             *
11        \**************************************************************************/
12
13
14        class boexport
15        {
16                var $start = 0;
17                var $query = '';
18                var $sort  = '';
19                var $total = 0;
20                var $catbo;
21                var $cats;
22                var $so;
23
24                var $debug;
25                var $use_session = False;
26
27                function boexport($session=False)
28                {
29                        $this->so = CreateObject('news_admin.soexport');
30                        $this->debug = False;
31                        if($session)
32                        {
33                                $this->read_sessiondata();
34                                $this->use_session = True;
35                                foreach(array('start','query','sort','order') as $var)
36                                {
37                                        if (isset($_POST[$var]))
38                                        {
39                                                $this->$var = $_POST[$var];
40                                        }
41                                        elseif (isset($_GET[$var]))
42                                        {
43                                                $this->$var = $_GET[$var];
44                                        }
45                                }
46                                $this->save_sessiondata();
47                                $this->catbo = createobject('phpgwapi.categories');
48                                $this->cats = $this->catbo->return_array('all',$this->start,True,$this->query,$this->sort,'cat_name',True);
49                        }
50                }
51
52                function save_sessiondata()
53                {
54                               
55                        $data = array(
56                                'start' => $this->start,
57                                'query' => $this->query,
58                                'sort'  => $this->sort,
59                                'order' => $this->order,
60                        );
61                        if($this->debug) { echo '<br>Save:'; _debug_array($data); }
62                        $GLOBALS['phpgw']->session->appsession('session_data','news_admin_export',$data);
63                }
64
65                function read_sessiondata()
66                {
67                        $data = $GLOBALS['phpgw']->session->appsession('session_data','news_admin_export');
68                        if($this->debug) { echo '<br>Read:'; _debug_array($data); }
69
70                        $this->start  = $data['start'];
71                        $this->query  = $data['query'];
72                        $this->sort   = $data['sort'];
73                        $this->order  = $data['order'];
74                }
75
76                function readconfig($cat_id)
77                {
78                        return $this->so->readconfig($cat_id);
79                }
80
81                function saveconfig($cat_id,$config)
82                {
83                        $this->so->saveconfig($cat_id,$config);
84                }
85        }
Note: See TracBrowser for help on using the repository browser.