From 7346a379980aa42ce88a90a64a80bd0f0b65ffa4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 10 Jan 2015 09:51:51 +0000 Subject: [PATCH] cleaning up old addressbook stuff --- addressbook/setup/setup.inc.php | 1 - calendar/inc/class.calendar_hooks.inc.php | 64 ------ calendar/setup/setup.inc.php | 1 - home/inc/class.updates.inc.php | 98 --------- home/index.php | 256 ++-------------------- home/templates/default/home.tpl | 61 ------ home/templates/default/portal.tpl | 70 ------ home/templates/jerryr/portal.tpl | 70 ------ infolog/inc/hook_home.inc.php | 68 ------ infolog/setup/setup.inc.php | 1 - mail/setup/setup.inc.php | 4 - phpgwapi/inc/class.listbox.inc.php | 89 -------- phpgwapi/inc/class.portalbox.inc.php | 174 --------------- phpgwapi/inc/class.resultbox.inc.php | 68 ------ phpgwapi/templates/default/portal.tpl | 68 ------ resources/setup/setup.inc.php | 6 +- 16 files changed, 26 insertions(+), 1073 deletions(-) delete mode 100755 home/inc/class.updates.inc.php delete mode 100755 home/templates/default/home.tpl delete mode 100755 home/templates/default/portal.tpl delete mode 100644 home/templates/jerryr/portal.tpl delete mode 100644 infolog/inc/hook_home.inc.php delete mode 100755 phpgwapi/inc/class.listbox.inc.php delete mode 100755 phpgwapi/inc/class.portalbox.inc.php delete mode 100644 phpgwapi/inc/class.resultbox.inc.php delete mode 100755 phpgwapi/templates/default/portal.tpl diff --git a/addressbook/setup/setup.inc.php b/addressbook/setup/setup.inc.php index c4211bd87b..dda66a0a7f 100755 --- a/addressbook/setup/setup.inc.php +++ b/addressbook/setup/setup.inc.php @@ -36,7 +36,6 @@ $setup_info['addressbook']['tables'] = array(); // addressbook tables are in th $setup_info['addressbook']['hooks']['admin'] = 'addressbook_hooks::all_hooks'; $setup_info['addressbook']['hooks']['sidebox_menu'] = 'addressbook_hooks::all_hooks'; $setup_info['addressbook']['hooks']['settings'] = 'addressbook_hooks::settings'; -$setup_info['addressbook']['hooks'][] = 'home'; $setup_info['addressbook']['hooks']['deleteaccount'] = 'addressbook.addressbook_bo.deleteaccount'; $setup_info['addressbook']['hooks']['deletegroup'] = 'addressbook.addressbook_bo.deleteaccount'; $setup_info['addressbook']['hooks']['delete_category'] = 'addressbook.addressbook_bo.delete_category'; diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index 930ff110eb..5c5727392d 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -67,70 +67,6 @@ class calendar_hooks return $GLOBALS['egw_info']['server']['calendar_export_limit']; } - /** - * Draw calendar part of home - */ - static function home() - { - if($GLOBALS['egw_info']['user']['preferences']['calendar']['mainscreen_showevents']) - { - $GLOBALS['egw']->translation->add_app('calendar'); - - $save_app_header = $GLOBALS['egw_info']['flags']['app_header']; - - if ($GLOBALS['egw_info']['user']['preferences']['calendar']['mainscreen_showevents'] == 'listview') - { - if (!file_exists(EGW_SERVER_ROOT.($et_css_file ='/etemplate/templates/'.$GLOBALS['egw_info']['user']['preferences']['common']['template_set'].'/app.css'))) - { - $et_css_file = '/etemplate/templates/default/app.css'; - } - $content =& ExecMethod('calendar.calendar_uilist.home'); - } - else - { - unset($et_css_file); - $content =& ExecMethod('calendar.calendar_uiviews.home'); - } - $portalbox =& CreateObject('phpgwapi.listbox',array( - 'title' => $GLOBALS['egw_info']['flags']['app_header'], - 'primary' => $GLOBALS['egw_info']['theme']['navbar_bg'], - 'secondary' => $GLOBALS['egw_info']['theme']['navbar_bg'], - 'tertiary' => $GLOBALS['egw_info']['theme']['navbar_bg'], - 'width' => '100%', - 'outerborderwidth' => '0', - 'header_background_image' => $GLOBALS['egw']->common->image('phpgwapi/templates/default','bg_filler') - )); - $GLOBALS['egw_info']['flags']['app_header'] = $save_app_header; - unset($save_app_header); - - $GLOBALS['portal_order'][] = $app_id = $GLOBALS['egw']->applications->name2id('calendar'); - foreach(array('up','down','close','question','edit') as $key) - { - $portalbox->set_controls($key,Array('url' => '/set_box.php', 'app' => $app_id)); - } - $portalbox->data = Array(); - - if (!file_exists(EGW_SERVER_ROOT.($css_file ='/calendar/templates/'.$GLOBALS['egw_info']['user']['preferences']['common']['template_set'].'/app.css'))) - { - $css_file = '/calendar/templates/default/app.css'; - } - echo ' - - -'.$portalbox->draw($content)."\n".''."\n"; - } - } - /** * Entries for calendar's admin menu */ diff --git a/calendar/setup/setup.inc.php b/calendar/setup/setup.inc.php index cc9f158942..8d929bc80c 100755 --- a/calendar/setup/setup.inc.php +++ b/calendar/setup/setup.inc.php @@ -36,7 +36,6 @@ $setup_info['calendar']['tables'][] = 'egw_cal_timezones'; /* The hooks this app includes, needed for hooks registration */ $setup_info['calendar']['hooks']['admin'] = 'calendar_hooks::admin'; $setup_info['calendar']['hooks']['deleteaccount'] = 'calendar.calendar_so.deleteaccount'; -$setup_info['calendar']['hooks']['home'] = 'calendar_hooks::home'; $setup_info['calendar']['hooks']['settings'] = 'calendar_hooks::settings'; $setup_info['calendar']['hooks']['verify_settings'] = 'calendar_hooks::verify_settings'; $setup_info['calendar']['hooks']['sidebox_menu'] = 'calendar.calendar_ui.sidebox_menu'; diff --git a/home/inc/class.updates.inc.php b/home/inc/class.updates.inc.php deleted file mode 100755 index 4cc74e989e..0000000000 --- a/home/inc/class.updates.inc.php +++ /dev/null @@ -1,98 +0,0 @@ - * - * Based on the file modified by Greg Haygood * - * Original file: home.php by phpgroupware * - * The file written by Edo van Bruggen * - * -------------------------------------------- * - * This program 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. * - \**************************************************************************/ - - /* $Id$ */ - - /* - ** Provides the status of the eGroupware installation. - */ - class updates - { - /* - ** @return boolean: are there updates or not - */ - function hasUpdates() - { - if(count($this->showUpdates()) > 0) - { - return false; - } - else - { - return false; - } - } - - /* - ** @return array with string-message about status of eGroupware and status of all application - */ - function showUpdates() - { - $updates = array(); - - if (isset($GLOBALS['egw_info']['user']['apps']['admin']) && $GLOBALS['egw_info']['user']['apps']['admin'] && - isset($GLOBALS['egw_info']['server']['checkfornewversion']) && $GLOBALS['egw_info']['server']['checkfornewversion']) - { - $GLOBALS['egw']->network->set_addcrlf(False); - $lines = $GLOBALS['egw']->network->gethttpsocketfile('http://www.egroupware.org/currentversion'); - for($i=0; $icommon->cmp_version_long($GLOBALS['egw_info']['server']['versions']['phpgwapi'],$line_found[1])) - { - $updates['egroupware'] = '

'.lang('There is a new version of eGroupWare available'). - ' www.egroupware.org

'; - } - - $_found = False; - foreach($GLOBALS['egw_info']['apps'] as $_app_name => $data) - { - $_db_version = $data['version']; - $_app_dir = $GLOBALS['egw']->common->get_app_dir($_app_name); - $_versionfile = $_app_dir . '/setup/setup.inc.php'; - if($_app_dir && file_exists($_versionfile)) - { - include($_versionfile); - $_file_version = $setup_info[$_app_name]['version']; - $_app_title = $GLOBALS['egw_info']['apps'][$_app_name]['title']; - unset($setup_info); - - if($GLOBALS['egw']->common->cmp_version_long($_db_version,$_file_version)) - { - $_found = True; - $_app_string .= '
' . $_app_title; - } - unset($_file_version); - unset($_app_title); - } - unset($_db_version); - unset($_versionfile); - } - if($_found) - { - $updates['apps'] = lang('The following applications require upgrades') . ':' . "\n"; - $updates['apps'] .= $_app_string . "\n"; - $updates['apps'] .= '
' . lang('Please run setup to become current') . '.' . "\n"; - unset($_app_string); - } - } - return $updates; - } - } diff --git a/home/index.php b/home/index.php index 422c104ae5..def1d400a6 100755 --- a/home/index.php +++ b/home/index.php @@ -1,237 +1,29 @@ * - * This file modified by Greg Haygood * - * This file modified by Edo van Bruggend * - * -------------------------------------------- * - * This program 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. * - \**************************************************************************/ +/** + * EGroupware - Home - user interface + * + * @link www.egroupware.org + * @author Nathan Gray + * @copyright (c) 2013 by Nathan Gray + * @package home + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @version $Id$ + */ - /* $Id$ */ +$GLOBALS['egw_info'] = array( + 'flags' => array( + 'noheader' => true, + 'nonavbar' => true, + 'currentapp' => 'home', + ) +); - /* - ** Initializing the home application - */ - $GLOBALS['egw_info'] = array( - 'flags' => array( - 'noheader' => true, - 'nonavbar' => true, - 'currentapp' => 'home', - ) - ); +include('../header.inc.php'); +$GLOBALS['egw_info']['flags']['nonavbar']=false; - include('../header.inc.php'); - $GLOBALS['egw_info']['flags']['nonavbar']=false; +// check and if neccessary force user to chane password +auth::check_password_age('home','index'); - // Home is treated specially, so a redirect won't work. - $home = new home_ui(); - echo $home->index(); -exit; - - /* - ** Initializing the template - */ - - $GLOBALS['tpl'] = new Template(common::get_tpl_dir('home')); - $GLOBALS['tpl']->set_unknowns('remove'); - - $GLOBALS['tpl']->set_file( - array( - 'home' => 'home.tpl' - ) - ); - - $GLOBALS['tpl']->set_block('home','notify_window','notify_window'); - $GLOBALS['tpl']->set_block('home','begin_table','begin_table'); - $GLOBALS['tpl']->set_block('home','end_table','end_table'); - $GLOBALS['tpl']->set_block('home','begin_row','begin_row'); - $GLOBALS['tpl']->set_block('home','end_row','end_row'); - $GLOBALS['tpl']->set_block('home','cell','cell'); - - if ($GLOBALS['egw']->session->session_flags == 'A') - { - if ($_SERVER['HTTP_REFERER'] && strstr($_SERVER['HTTP_REFERER'],'home.php') === False) - { - $GLOBALS['egw']->redirect($_SERVER['HTTP_REFERER']); - } - else - { - // redirect to the login-page, better then giving an empty page - $GLOBALS['egw']->redirect('login.php'); - } - exit; - } - - /* - ** Show the updates - */ - $GLOBALS['egw']->hooks->single('showUpdates','home'); - - /* - ** Display the mainscreen message - */ - translation::add_app('mainscreen'); - $greeting = translation::translate('mainscreen_message',false,''); - - if($greeting == 'mainscreen_message'|| empty($greeting)) - { - translation::add_app('mainscreen','en'); // trying the en one - $greeting = translation::translate('mainscreen_message',false,''); - } - if(!($greeting == 'mainscreen_message'|| empty($greeting))) - { - echo '
' . $greeting . "
\n"; - } - - /* - ** Display the notification window - */ - if (isset($GLOBALS['egw_info']['user']['apps']['notifywindow']) && $GLOBALS['egw_info']['user']['apps']['notifywindow']) - { - $var['link'] = $GLOBALS['egw']->link('/notify.php'); - $var['notifywindow'] = lang('Open notify window'); - $GLOBALS['tpl']->set_var($var); - $GLOBALS['tpl']->pfp('out','notify_window'); - } - - if (is_array($GLOBALS['egw_info']['user']['preferences']['portal_order'])) - { - $sorted_apps = array(); - ksort($GLOBALS['egw_info']['user']['preferences']['portal_order']); - foreach($GLOBALS['egw_info']['user']['preferences']['portal_order'] as $order => $app) - { - $sorted_apps[$app] = $GLOBALS['egw']->applications->id2name((int)$app); - } - } - else - { - $sorted_apps = Array( - 'calendar', - 'email', - 'infolog', - 'news_admin' - ); - } - - // Now add the rest of the user's apps, to make sure we pick up any additions to the home display - foreach($GLOBALS['egw_info']['user']['apps'] as $app) - { - if(!in_array($app['name'], $sorted_apps)) - { - $sorted_apps[] = $app['name']; - } - } - - // make sure to show only apps user has rights to - $sorted_apps = array_intersect($sorted_apps, array_keys($GLOBALS['egw_info']['user']['apps'])); - - $portal_oldvarnames = array('mainscreen_showevents', 'homeShowEvents','homeShowLatest','mainscreen_showmail','mainscreen_showbirthdays','mainscreen_show_new_updated'); - $neworder = array(); - $done = array(); - - /* - ** Display application hooks - ** - */ - - $GLOBALS['tpl']->pfp('out','begin_table'); - $tropen=0; - $tdopen=0; - $lastd = 0; - $numcols = 2; - $curcol = 1; - $searchlist = array(); - foreach($sorted_apps as $appname) - { - if((int)$done[$appname] == 1 || empty($appname)) - { - continue; - } - $varnames = $portal_oldvarnames; - $varnames[] = 'homepage_display'; - foreach($varnames as $varcheck) - { - //echo "$appname:$varcheck=".$GLOBALS['egw_info']['user']['preferences'][$appname][$varcheck]."
"; - $thisd = (int)$GLOBALS['egw_info']['user']['preferences'][$appname][$varcheck]; - if (!$thisd && $GLOBALS['egw_info']['user']['preferences'][$appname][$varcheck]) $thisd = 1; - if($thisd>0) - { - //echo "Found $appname=$_thisd through $varcheck
"; - break; - } - } - //echo "$appname: $thisd
"; - if($thisd>0) - { - $searchlist[$appname] = $thisd; - $neworder[] = $appname; - $done[$appname] = 1; - } - } - foreach($neworder as $index => $appname) - { - $thisd = $searchlist[$appname]; - //echo "$appname: $thisd
"; - if((($curcol++>$numcols) || ($thisd==1)) && $tropen==1) - { - $GLOBALS['tpl']->pfp('out','end_row'); - $tropen = 0; - //$curcol = 1; - } - if(!$tropen) - { - $GLOBALS['tpl']->pfp('out','begin_row'); - $tropen=1; - } - - $small = ($thisd>1) && (count($neworder) >= $index + 1) && ($searchlist[$neworder[$index + 1]] > 1 || $searchlist[$neworder[$index - 1]] > 1); - $var['tdwidth'] = $small ? '50' : '100'; - $var['colspan'] = $small ? '1' : '2'; - - ob_start(); - $var['content'] = $GLOBALS['egw']->hooks->single('home',$appname); - if (!$var['content'] || $var['content'] == 1) // content has been echoed and not returned - { - $var['content'] = ob_get_contents(); - ob_end_clean(); - } - $GLOBALS['tpl']->set_var($var); - - $GLOBALS['tpl']->pfp('out','cell'); - - if(($thisd<=1 || ($thisd>1&&$lastd>1)) && $tropen && $var['content']) - { - $GLOBALS['tpl']->pfp('out','end_row'); - $tropen = 0; - $lastd = 0; - $curcol = 1; - } - else - { - $lastd = $thisd; - } - } - - $GLOBALS['tpl']->pfp('out','end_table'); - - // Update stored value of order - //_debug_array($neworder); - if(count($neworder)>0)//$GLOBALS['portal_order']) - { - $GLOBALS['egw']->preferences->delete('portal_order'); - foreach($neworder as $app_order => $app_name) - { - $app_id = $GLOBALS['egw']->applications->name2id($app_name); - //echo "neworder: $app_order=$app_id:$app_name
"; - $GLOBALS['egw']->preferences->add('portal_order',$app_order,$app_id); - } - $GLOBALS['egw_info']['user']['preferences'] = $GLOBALS['egw']->preferences->save_repository(); - } - //_debug_array($GLOBALS['egw_info']['user']['preferences']); - - $GLOBALS['egw']->framework->render(ob_get_clean()); +// Home is treated specially, so a redirect won't work. +$home = new home_ui(); +echo $home->index(); diff --git a/home/templates/default/home.tpl b/home/templates/default/home.tpl deleted file mode 100755 index c02d08eed1..0000000000 --- a/home/templates/default/home.tpl +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - -{notifywindow} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{content}
- - \ No newline at end of file diff --git a/home/templates/default/portal.tpl b/home/templates/default/portal.tpl deleted file mode 100755 index dcc39152f1..0000000000 --- a/home/templates/default/portal.tpl +++ /dev/null @@ -1,70 +0,0 @@ - -

-

- - - - - - - -
-
- - - {portal_controls} - -
 {title}
-
-
- - {row} -
-
-
-

- - - - - - - -{output} - - - - - - - - - -
    - - - - - -
  • {text}
  • - - - - - -
- - - - - - - - {control_link} - - - - - - {link_field_data} - diff --git a/home/templates/jerryr/portal.tpl b/home/templates/jerryr/portal.tpl deleted file mode 100644 index 11e62047be..0000000000 --- a/home/templates/jerryr/portal.tpl +++ /dev/null @@ -1,70 +0,0 @@ - -

-

- - - - - - - -
-
- - - {portal_controls} - -
 {title}
-
-
- - {row} -
-
-
-

- - - - - - - -{output} - - - - - - - - - -
    - - - - - -
  • {text}
  • - - - - - -
- - - - - - - - {control_link} - - - - - - {link_field_data} - diff --git a/infolog/inc/hook_home.inc.php b/infolog/inc/hook_home.inc.php deleted file mode 100644 index 10773c4ebd..0000000000 --- a/infolog/inc/hook_home.inc.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @package infolog - * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License - * @version $Id$ - */ - -if (($showevents = $GLOBALS['egw_info']['user']['preferences']['infolog']['homeShowEvents'])) -{ - $save_app = $GLOBALS['egw_info']['flags']['currentapp']; - $GLOBALS['egw_info']['flags']['currentapp'] = 'infolog'; - - $GLOBALS['egw']->translation->add_app('infolog'); - - $app_id = $GLOBALS['egw']->applications->name2id('infolog'); - $GLOBALS['portal_order'][] = $app_id; - - $infolog = new infolog_ui(); - $infolog->called_by = 'home'; - - if (in_array($showevents,array('1','2'))) $showevents = 'own-open-today'; - $html = $infolog->index(array('nm' => array('filter' => $showevents)),'','',0,False,True); - $title = lang('InfoLog').' - '.lang($infolog->filters[$showevents]); - unset($infolog); - - $portalbox =& CreateObject('phpgwapi.listbox',array( - 'title' => $title, - 'primary' => $GLOBALS['egw_info']['theme']['navbar_bg'], - 'secondary' => $GLOBALS['egw_info']['theme']['navbar_bg'], - 'tertiary' => $GLOBALS['egw_info']['theme']['navbar_bg'], - 'width' => '100%', - 'outerborderwidth' => '0', - 'header_background_image' => $GLOBALS['egw']->common->image('phpgwapi/templates/default','bg_filler') - )); - foreach(array('up','down','close','question','edit') as $key) - { - $portalbox->set_controls($key,Array('url' => '/set_box.php', 'app' => $app_id)); - } - $portalbox->data = $data; - - if (!file_exists(EGW_SERVER_ROOT.($et_css_file ='/etemplate/templates/'.$GLOBALS['egw_info']['user']['preferences']['common']['template_set'].'/app.css'))) - { - $et_css_file = '/etemplate/templates/default/app.css'; - } - if (!file_exists(EGW_SERVER_ROOT.($css_file ='/infolog/templates/'.$GLOBALS['egw_info']['user']['preferences']['common']['template_set'].'/app.css'))) - { - $css_file = '/infolog/templates/default/app.css'; - } - echo ' - - -'. $portalbox->draw($html)."\n\n"; - - unset($css_file); unset($et_css_file); - unset($portalbox); - unset($html); - $GLOBALS['egw_info']['flags']['currentapp'] = $save_app; -} -unset($showevents); diff --git a/infolog/setup/setup.inc.php b/infolog/setup/setup.inc.php index 20156b41bb..7b57011ed7 100755 --- a/infolog/setup/setup.inc.php +++ b/infolog/setup/setup.inc.php @@ -52,7 +52,6 @@ $setup_info['infolog']['hooks']['not_enum_group_acls'] = 'infolog_hooks::not_enu $setup_info['infolog']['hooks']['acl_rights'] = 'infolog_hooks::acl_rights'; $setup_info['infolog']['hooks']['categories'] = 'infolog_hooks::categories'; $setup_info['infolog']['hooks']['deleteaccount'] = 'infolog.infolog_so.change_delete_owner'; -$setup_info['infolog']['hooks'][] = 'home'; $setup_info['infolog']['hooks']['addressbook_view'] = 'infolog.infolog_ui.hook_view'; $setup_info['infolog']['hooks']['projects_view'] = 'infolog.infolog_ui.hook_view'; $setup_info['infolog']['hooks']['calendar_view'] = 'infolog.infolog_ui.hook_view'; diff --git a/mail/setup/setup.inc.php b/mail/setup/setup.inc.php index ac84e5401a..436107028c 100644 --- a/mail/setup/setup.inc.php +++ b/mail/setup/setup.inc.php @@ -38,10 +38,6 @@ $setup_info['mail']['hooks']['clear_cache'] = 'mail_bo::unsetCachedObjects'; $setup_info['mail']['hooks']['check_notify'] = 'mail_hooks::notification_check_mailbox'; $setup_info['mail']['hooks']['emailadmin_edit'] = 'mail_hooks::emailadmin_edit'; -/* -$setup_info['mail']['hooks'][] = 'home'; -*/ - /* Dependencies for this app to work */ $setup_info['mail']['depends'][] = array( 'appname' => 'phpgwapi', diff --git a/phpgwapi/inc/class.listbox.inc.php b/phpgwapi/inc/class.listbox.inc.php deleted file mode 100755 index 4fdb3f1b9b..0000000000 --- a/phpgwapi/inc/class.listbox.inc.php +++ /dev/null @@ -1,89 +0,0 @@ - * - * Creates listboxes using templates * - * Copyright (C) 2000, 2001 Mark Peters * - * -------------------------------------------------------------------------* - * This library is part of the eGroupWare API * - * http://www.egroupware.org/api * - * ------------------------------------------------------------------------ * - * This library is free software; you can redistribute it and/or modify it * - * under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 of the License, * - * or any later version. * - * This library 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 Lesser General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License * - * along with this library; if not, write to the Free Software Foundation, * - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - \**************************************************************************/ - - /* $Id$ */ - - require_once(EGW_INCLUDE_ROOT.'/phpgwapi/inc/class.portalbox.inc.php'); - - class listbox extends portalbox - { - /* - Set up the Object. You will notice, we have not reserved - memory space for variables. In this circumstance it is not necessary. - */ - - /* - This is the constructor for the listbox. The only thing this does - is to call the constructor of the parent class. Why? Well, whilst - PHP manages a certain part of OO, one of the bits it falls down on - (at the moment) is constructors within sub-classes. So, to - be sure that the sub-class is instantiated with the constructor of - the parent class, I simply call the parent constructor. Of course, - if I then wanted to override any of the values, I could easily do so. - */ - function listbox($param) - { - $this->setvar('classname','listbox'); - $this->setvar('outerwidth',300); - $this->setvar('innerwidth',300); - $this->setvar('width',300); - - @reset($param); - while(list($key,$value) = each($param)) - { - if($key != 'title' && $key != 'primary' && $key != 'secondary' && $key != 'tertiary') - { -//echo 'Setting '.$key.':'.$value."
\n"; - $this->setvar($key,$value); - } - } - $this->portalbox($param['title'], $param['primary'], $param['secondary'], $param['tertiary']); - $this->start_template(); - } - - /* - This is the only method within the class. Quite simply, as you can see - it draws the table(s), placing the required data in the appropriate place. - */ - function draw($extra_data='') - { - if(count($this->data)) - { - $this->p->parse('row','portal_listbox_header',True); - - for ($x = 0; $x < count($this->data); $x++) - { - $var = Array( - 'text' => $this->data[$x]['text'], - 'link' => $this->data[$x]['link'] - ); - $this->p->set_var($var); - $this->p->parse('row','portal_listbox_link',True); - } - $this->p->parse('row','portal_listbox_footer',True); - } - $this->set_internal($extra_data); - return $this->draw_box(); - } - } diff --git a/phpgwapi/inc/class.portalbox.inc.php b/phpgwapi/inc/class.portalbox.inc.php deleted file mode 100755 index f39a391275..0000000000 --- a/phpgwapi/inc/class.portalbox.inc.php +++ /dev/null @@ -1,174 +0,0 @@ - * - * Helps manage the portal boxes for eGroupWares main page * - * Copyright (C) 2000, 2001 Joseph Engo * - * -------------------------------------------------------------------------* - * This library is part of the eGroupWare API * - * http://www.egroupware.org/api * - * ------------------------------------------------------------------------ * - * This library is free software; you can redistribute it and/or modify it * - * under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 of the License, * - * or any later version. * - * This library 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 Lesser General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License * - * along with this library; if not, write to the Free Software Foundation, * - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - \**************************************************************************/ - - /* $Id$ */ - - class portalbox - { - //Set up the Object, reserving memory space for variables - - var $outerwidth; - var $outerbordercolor; - var $outerborderwidth = 1; - var $titlebgcolor; - var $width; - var $innerwidth; - var $innerbgcolor; - var $controls; - var $header_background_image; - var $classname; - var $up; - var $down; - var $close; - var $question; - var $edit; - - var $data = Array(); - - // Textual variables - var $title; - - // Template - var $p; - - /* - Use these functions to get and set the values of this - object's variables. This is good OO practice, as it means - that datatype checking can be completed and errors raised accordingly. - */ - function setvar($var,$value='') - { - if ($value=='') - { - global $$var; - $value = $$var; - } - $this->$var = $value; - // echo $var." = ".$this->$var."
\n"; - } - - function getvar($var='') - { - if ($var=='' || !isset($this->$var)) - { - echo 'Programming Error: '.$this->getvar('classname').'->getvar('.$var.')!
'."\n"; - echo function_backtrace(1); - $GLOBALS['phpgw']->common->phpgw_exit(); - } - //echo "Var = ".$var."
\n"; - //echo $var." = ".$this->$var."
\n"; - return $this->$var; - } - - /* - This is the constructor for the object. - */ - function portalbox($title='', $primary='', $secondary='', $tertiary='') - { - $this->setvar('title',$title); - // echo 'After SetVar Title = '.$this->getvar('title')."
\n"; - $this->setvar('titlebgcolor',$primary); - $this->setvar('innerbgcolor',$secondary); - $this->setvar('outerbordercolor',$tertiary); - } - - function start_template() - { - $this->p = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('home')); - $this->p->set_file( - array( - 'PORTAL' => 'portal.tpl' - ) - ); - - $this->p->set_block('PORTAL','portal_box','portal_box'); - $this->p->set_block('PORTAL','portal_row','portal_row'); - $this->p->set_block('PORTAL','portal_listbox_header','portal_listbox_header'); - $this->p->set_block('PORTAL','portal_listbox_link','portal_listbox_link'); - $this->p->set_block('PORTAL','portal_listbox_footer','portal_listbox_footer'); - $this->p->set_block('PORTAL','portal_control','portal_control'); - $this->p->set_block('PORTAL','link_field','link_field'); - - $var = Array( - 'outer_width' => $this->getvar('width'), - 'title' => $this->getvar('title'), - 'inner_width' => $this->getvar('width'), - 'control_link' => '' - ); - $this->p->set_var($var); - $this->p->set_var('row','',False); - } - - function set_controls($control='',$control_param='') - { - if($control != '' && $control_param != '') - { - if($control == 'close' && $GLOBALS['egw']->preferences->forced[$GLOBALS['egw']->applications->id2name($control_param['app'])]['homepage_display']) { - // User is forced to have this box on their home page, hide the close button - return; - } - $this->setvar($control,$GLOBALS['phpgw']->link($control_param['url'],'app='.$control_param['app'].'&control='.$control)); - } - } - - function set_internal($data='') - { - if($data=='' && !count($this->data)) - { - $data = ' '; - } - $this->p->set_var('output',$data); - $this->p->parse('row','portal_row',true); - } - - function draw_box() - { - $control = ''; - if($this->up || $this->down || $this->close || $this->question || $this->edit) - { - $control_array = Array( - 'up', - 'down', - 'close', - /*'question', - 'edit'*/ - ); - @reset($control_array); - while(list($key,$param) = each($control_array)) - { - if(isset($this->$param) && $this->$param) - { - $image_width = 15; - if($param == 'edit') - { - $image_width = 30; - } - $this->p->set_var('link_field_data',''.lang($param).''); - $this->p->parse('control_link','link_field',True); - } - } - $this->p->parse('portal_controls','portal_control',True); - } - return $this->p->fp('out','portal_box'); - } - } diff --git a/phpgwapi/inc/class.resultbox.inc.php b/phpgwapi/inc/class.resultbox.inc.php deleted file mode 100644 index 976a723422..0000000000 --- a/phpgwapi/inc/class.resultbox.inc.php +++ /dev/null @@ -1,68 +0,0 @@ - * - * and Joseph Engo * - * Creates result boxes using templates * - * Copyright (C) 2000, 2001 Dan Kuykendall * - * -------------------------------------------------------------------------* - * This library is part of the eGroupWare API * - * http://www.egroupware.org/api * - * ------------------------------------------------------------------------ * - * This library is free software; you can redistribute it and/or modify it * - * under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 of the License, * - * or any later version. * - * This library 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 Lesser General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License * - * along with this library; if not, write to the Free Software Foundation, * - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - \**************************************************************************/ - - /* $Id$ */ - - CreateObject('phpgwapi.portalbox'); - - class resultbox extends portalbox - { - /* - Set up the Object. You will notice, we have not reserved memory - space for variables. In this circumstance it is not necessary. - */ - //constructor - function resultbox($title='', $primary='', $secondary='', $tertiary='') - { - $this->portalbox($title, $primary, $secondary, $tertiary); - $this->setvar('outerwidth',400); - $this->setvar('innerwidth',400); - } - - /* - This is the only method within the class. Quite simply, as you can see - it draws the table(s), placing the required data in the appropriate place. - */ - function draw() - { - echo ''; - echo ''; - echo ''; - echo '
'.$this->getvar("title") . '
'; - echo ''; - for ($x = 0; $x < count($this->data); $x++) - { - echo ''; - echo ''; - echo ''; - echo ''; - } - echo '
' . $this->data[$x][0] . '' . $this->data[$x][1] . '
'; - echo '
'; - } - } diff --git a/phpgwapi/templates/default/portal.tpl b/phpgwapi/templates/default/portal.tpl deleted file mode 100755 index 98398fc1e6..0000000000 --- a/phpgwapi/templates/default/portal.tpl +++ /dev/null @@ -1,68 +0,0 @@ - -

-

- - - - - - - -
- - - {portal_controls} - -
 {title}
-
- - {row} -
-
-
-

- - - - - - - -{output} - - - - - - - - - -
    - - - - - -
  • {text}
  • - - - - - -
- - - - - - - - {control_link} - - - - - - {link_field_data} - diff --git a/resources/setup/setup.inc.php b/resources/setup/setup.inc.php index 1268beae34..ae174f425c 100755 --- a/resources/setup/setup.inc.php +++ b/resources/setup/setup.inc.php @@ -1,8 +1,8 @@ 'phpgwapi',