Changeset 6528 for trunk/home.php


Ignore:
Timestamp:
06/15/12 17:00:17 (12 years ago)
Author:
gustavo
Message:

Ticket #2766 - Merge do branch das novas funcionalidaes para o trunk

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/home.php

    r5042 r6528  
    9898                echo parse_navbar(); 
    9999        } 
    100         // Default Applications (Home Page)  
    101         $default_apps = Array(                   
    102                         'workflow',                      
    103                         'expressoMail1_2', 
    104                         'calendar', 
    105                         'news_admin' 
    106                 ); 
    107         $sorted_apps = array(); 
    108         $user_apps = $GLOBALS['phpgw_info']['user']['apps'];  
    109         @reset($user_apps);      
    110         for($i = 0; $i < count($default_apps);$i++) { 
    111                 if(array_key_exists($default_apps[$i], $user_apps)){ 
    112                         $sorted_apps[] = $default_apps[$i]; 
    113                 }                
    114         } 
    115          
    116         foreach($GLOBALS['phpgw_info']['user']['apps'] as $i => $p) { 
    117                 $sorted_apps[] = $p['name']; 
    118         } 
    119          
     100 
     101        // Default Applications (Home Page)  
     102        $default_apps = Array(                   
     103                        'workflow',                      
     104                        'expressoMail1_2', 
     105                        'calendar', 
     106                        'news_admin' 
     107                ); 
     108        $sorted_apps = array(); 
     109        $user_apps = $GLOBALS['phpgw_info']['user']['apps'];  
     110        @reset($user_apps);      
     111        for($i = 0; $i < count($default_apps);$i++) { 
     112                if(array_key_exists($default_apps[$i], $user_apps)){ 
     113                        $sorted_apps[] = $default_apps[$i]; 
     114                }                
     115        } 
     116         
     117        foreach($GLOBALS['phpgw_info']['user']['apps'] as $i => $p) { 
     118                $sorted_apps[] = $p['name']; 
     119        } 
     120 
    120121        $portal_oldvarnames = array('mainscreen_showevents', 'homeShowEvents','homeShowLatest','mainscreen_showmail','mainscreen_showbirthdays','mainscreen_show_new_updated'); 
    121         $done = array(); 
    122         // Display elements, within appropriate table cells      
    123         @reset($sorted_apps); 
    124         $idx = 1; 
    125         echo "<table width='100%' cellpadding=5>"; 
    126         foreach($sorted_apps as $appname) 
    127         { 
    128                 if((int)$done[$appname] == 1 || empty($appname)){ 
    129                         continue; 
    130                 }                
    131                 $varnames = $portal_oldvarnames; 
    132                 $varnames[] = 'homepage_display'; 
    133                 $thisd = 0; 
    134                 $tmp = ''; 
    135                  
    136                 foreach($varnames as $varcheck) 
    137                 { 
    138                                                                          
    139                         /*if($appname == 'expressoMail1_2') { 
    140                                 $tmp = $appname; 
    141                                 $appname = 'expressoMail'; 
    142                         }*/                              
     122        $done = array(); 
     123        // Display elements, within appropriate table cells      
     124        @reset($sorted_apps); 
     125        $idx = 1; 
     126        echo "<table width='100%' cellpadding=5>"; 
     127        foreach($sorted_apps as $appname) 
     128        { 
     129                if((int)$done[$appname] == 1 || empty($appname)){ 
     130                        continue; 
     131                } 
     132                $varnames = $portal_oldvarnames; 
     133                $varnames[] = 'homepage_display'; 
     134                $thisd = 0; 
     135                $tmp = ''; 
    143136 
    144                         if(array_search($appname, $default_apps) !== False){ 
    145                                 $thisd = 1; 
    146                                 break; 
    147                         } 
    148                         if($GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]=='True') { 
    149                                 $thisd = 1; 
    150                                 break; 
    151                         } 
    152                         else  { 
    153                                 $_thisd = (int)$GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]; 
    154                                 if($_thisd > 0) { 
    155                                         $thisd = $_thisd; 
    156                                         break; 
    157                                 } 
    158                         } 
    159                 } 
     137                foreach($varnames as $varcheck) 
     138                { 
    160139 
    161                 if($thisd > 0) 
    162                 { 
    163                         if($tmp) { 
    164                 $appname = $tmp; 
    165                                 $tmp = ''; 
    166                         } 
    167                         if($idx == 0) {                          
    168                                 print '<tr>'; 
    169                         } 
    170                         print '<td style="vertical-align:top;" width="45%">'; 
    171                         $GLOBALS['phpgw']->hooks->single('home',$appname);                       
    172                         print '</td>'; 
    173                          
    174                         if($idx == 2){ 
    175                                 $idx = 0; 
    176                                 print '</tr>'; 
    177                         }                        
    178                         $idx++; 
    179                         $neworder[] = $appname; 
    180                 } 
    181                 $done[$appname] = 1; 
    182         } 
    183         print '</table>'; 
     140                        /*if($appname == 'expressoMail1_2') { 
     141                                $tmp = $appname; 
     142                                $appname = 'expressoMail'; 
     143                        }*/ 
     144 
     145                        if(array_search($appname, $default_apps) !== False){ 
     146                                $thisd = 1; 
     147                                break; 
     148                        } 
     149                        if($GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]=='True') { 
     150                                $thisd = 1; 
     151                                break; 
     152                        } 
     153                        else  { 
     154                                $_thisd = (int)$GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]; 
     155                                if($_thisd > 0) { 
     156                                        $thisd = $_thisd; 
     157                                        break; 
     158                                } 
     159                        } 
     160                } 
     161 
     162               if($thisd > 0) 
     163                { 
     164                        if($tmp) { 
     165                $appname = $tmp; 
     166                                $tmp = ''; 
     167                        } 
     168                        if($idx == 0) { 
     169                                print '<tr>'; 
     170                        } 
     171                        print '<td style="vertical-align:top;" width="45%">'; 
     172                        $GLOBALS['phpgw']->hooks->single('home',$appname); 
     173                        print '</td>'; 
     174 
     175                        if($idx == 2){ 
     176                                $idx = 0; 
     177                                print '</tr>'; 
     178                        } 
     179                        $idx++; 
     180                        $neworder[] = $appname; 
     181                } 
     182                $done[$appname] = 1; 
     183        } 
     184        print '</table>'; 
     185 
    184186        $GLOBALS['phpgw']->common->phpgw_footer(); 
    185187?> 
Note: See TracChangeset for help on using the changeset viewer.