phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgroupware home.php set_box.php


From: Dave Hall
Subject: [Phpgroupware-cvs] phpgroupware home.php set_box.php
Date: Tue, 26 Dec 2006 11:35:35 +0000

CVSROOT:        /sources/phpgroupware
Module name:    phpgroupware
Changes by:     Dave Hall <skwashd>     06/12/26 11:35:35

Modified files:
        .              : home.php set_box.php 

Log message:
        fix redordering and cleanup a little

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/home.php?cvsroot=phpgroupware&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/set_box.php?cvsroot=phpgroupware&r1=1.6&r2=1.7

Patches:
Index: home.php
===================================================================
RCS file: /sources/phpgroupware/phpgroupware/home.php,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- home.php    25 Nov 2006 08:03:13 -0000      1.35
+++ home.php    26 Dec 2006 11:35:34 -0000      1.36
@@ -7,7 +7,7 @@
        * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package phpgroupware
-       * @version $Id: home.php,v 1.35 2006/11/25 08:03:13 sigurdne Exp $
+       * @version $Id: home.php,v 1.36 2006/12/26 11:35:34 skwashd Exp $
        */
 
        /**
@@ -15,15 +15,7 @@
        */
        $phpgw_info = array();
 
-       if (!is_file('header.inc.php'))
-       {
-               echo '<p style="{text-align: center; font-weight: bold;}"><a 
href="setup/index.php>"';
-               echo lang('It appears that phpGroupWare is not setup yet, 
please run setup.');
-               echo '</a></p>';
-               exit;
-       }
-
-       $GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] : 
$_COOKIE['sessionid'];
+       $GLOBALS['sessionid'] = $_REQUEST['sessionid'];
        if (!isset($GLOBALS['sessionid']) || !$GLOBALS['sessionid'])
        {
                Header('Location: login.php');
@@ -67,6 +59,7 @@
                
$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] = 
$GLOBALS['phpgw_info']['server']['force_default_app'];
        }
 
+       /* The 1990s just called and asked for their frames back
        if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['useframes'])
                && ($GLOBALS['phpgw_info']['server']['useframes'] == 'allowed'
                || $GLOBALS['phpgw_info']['server']['useframes'] == 'always') )
@@ -112,12 +105,15 @@
                                }
                        }
                }
-               elseif (isset($_GET['cd']) && $_GET['cd']=='yes' 
+               else
+               */
+               if (isset($_GET['cd']) && $_GET['cd']=='yes' 
                        && 
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'])
                        && 
$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']
                        && 
$GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']])
                {
-                       $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/' 
. $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' 
. 'index.php'));
+                       $GLOBALS['phpgw']->redirect_link('/' . 
$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' . 
'index.php');
+                       exit;
                }
                else
                {
@@ -128,7 +124,7 @@
                $GLOBALS['phpgw']->translation->add_app('mainscreen');
                if (lang('mainscreen_message') != 'mainscreen_message*')
                {
-                       echo '<center>' . 
stripslashes(lang('mainscreen_message')) . '</center>';
+                       echo '<div class="msg">' . 
stripslashes(lang('mainscreen_message')) . '</div>';
                }
 
                if ((isset($GLOBALS['phpgw_info']['user']['apps']['admin']) &&
@@ -147,12 +143,12 @@
                        }
                        
if($GLOBALS['phpgw']->common->cmp_version($GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],$line_found[1]))
                        {
-                               echo '<p>There is a new version of phpGroupWare 
available. <a href="'
+                               echo '<p>There is a new version of phpGroupWare 
available from <a href="'
                                        . 
'http://www.phpgroupware.org";>http://www.phpgroupware.org</a>';
                        }
 
                        $_found = False;
-                       $GLOBALS['phpgw']->db->query("select 
app_name,app_version from phpgw_applications",__LINE__,__FILE__);
+                       $GLOBALS['phpgw']->db->query("SELECT 
app_name,app_version FROM phpgw_applications",__LINE__,__FILE__);
                        while($GLOBALS['phpgw']->db->next_record())
                        {
                                $_db_version  = 
$GLOBALS['phpgw']->db->f('app_version');
@@ -210,7 +206,7 @@
        }
 </script>
 <?php
-               echo '<a href="javascript:opennotifywindow()">' . lang('Open 
notify window') . '</a>';
+               echo '<a href="#" onclick="opennotifywindow()">' . lang('Open 
notify window') . '</a>';
        }
 
        // This initializes the users portal_order preference if it does not 
exist.
@@ -233,13 +229,13 @@
        if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['portal_order'])
                && 
is_array($GLOBALS['phpgw_info']['user']['preferences']['portal_order']) )
        {
-               $app_check = Array();
+               $app_check = array();
                
ksort($GLOBALS['phpgw_info']['user']['preferences']['portal_order']);
-               
foreach($GLOBALS['phpgw_info']['user']['preferences']['portal_order'] as $app 
=> $order)
+               
foreach($GLOBALS['phpgw_info']['user']['preferences']['portal_order'] as $app)
                {
                        if(!isset($app_check[$app]) || !$app_check[$app])
                        {
-                               $app_check[intval($app)] = True;
+                               $app_check[$app] = true;
                                $sorted_apps[] = 
$GLOBALS['phpgw']->applications->id2name($app);
                        }
                }
@@ -252,9 +248,9 @@
                        'calendar',
                        'news_admin',
                        'addressbook',
-                       'squirrelmail'
                );
        }
+
        $GLOBALS['phpgw']->hooks->process('home',$sorted_apps);
 
        if ( isset($GLOBALS['portal_order']) )

Index: set_box.php
===================================================================
RCS file: /sources/phpgroupware/phpgroupware/set_box.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- set_box.php 15 Apr 2005 13:19:15 -0000      1.6
+++ set_box.php 26 Dec 2006 11:35:34 -0000      1.7
@@ -7,10 +7,11 @@
        * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package phpgroupware
-       * @version $Id: set_box.php,v 1.6 2005/04/15 13:19:15 powerstat Exp $
+       * @version $Id: set_box.php,v 1.7 2006/12/26 11:35:34 skwashd Exp $
        */
 
-       $GLOBALS['phpgw_info']['flags'] = Array(
+       $GLOBALS['phpgw_info']['flags'] = array
+       (
                'noheader'      => True,
                'nofooter'      => True,
                'currentapp'    => 'home'
@@ -21,19 +22,8 @@
        */
        include_once('header.inc.php');
 
-//     if(basename($HTTP_REFERER) != 'home.php')
-//     {
-//             Header('Location: '.$GLOBALS['phpgw']->link('/home.php'));
-//             $GLOBALS['phpgw']->common->phpgw_exit();
-//     }
-
-//     $GLOBALS['phpgw']->preferences->delete('portal_order');
-//     unset($GLOBALS['phpgw_info']['user']['preferences']['portal_order']);
-//     $GLOBALS['phpgw']->preferences->save_repository();
-
-       
        /**
-       * Move boxes
+       * Move content "boxes" on the home.php "screen"
        *
        * @param integer $curr_position
        * @param integer $new_order
@@ -72,15 +62,15 @@
                        }
                }
                
$GLOBALS['phpgw']->preferences->delete('portal_order',$new_order);
-               
$GLOBALS['phpgw']->preferences->add('portal_order',$new_order,intval($GLOBALS['HTTP_GET_VARS']['app']));
+               
$GLOBALS['phpgw']->preferences->add('portal_order',$new_order,intval($_GET['app']));
                        
                $GLOBALS['phpgw']->preferences->save_repository();
        }
 
-       switch($GLOBALS['HTTP_GET_VARS']['control'])
+       switch($_GET['control'])
        {
                case 'up':
-                       $curr_position = 
$GLOBALS['phpgw']->common->find_portal_order(intval($GLOBALS['HTTP_GET_VARS']['app']));
+                       $curr_position = 
$GLOBALS['phpgw']->common->find_portal_order((int) $_GET['app']);
                        $max_count = 
count($GLOBALS['phpgw_info']['user']['preferences']['portal_order']) - 1;
                        $offset = -1;
                        if($curr_position == 0)
@@ -94,7 +84,7 @@
                        
move_boxes($curr_position,$new_order,$offset,0,$max_count);
                        break;
                case 'down':
-                       $curr_position = 
$GLOBALS['phpgw']->common->find_portal_order(intval($GLOBALS['HTTP_GET_VARS']['app']));
+                       $curr_position = 
$GLOBALS['phpgw']->common->find_portal_order((int) $_GET['app']);
                        $max_count = 
count($GLOBALS['phpgw_info']['user']['preferences']['portal_order']) - 1;
                        $offset = 1;
                        if($curr_position == $max_count)




reply via email to

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