Main Page | Directories | File List | File Members

Layout.class File Reference

Go to the source code of this file.

Functions

function box_top ($title, $subclass="", $noboxitem=0)
function box_middle ($title, $noboxitem=0)
function box_nextitem ($class)
function box_bottom ($noboxitem=0)
function box1_top ($title, $echoout=1, $subclass="")
function box1_middle ($title, $bgcolor='')
function box1_bottom ($echoout=1)
function generic_header_start ($params)
function generic_header_end ($params)
function generic_footer ($params)
function header ($params)
function footer ($params)
function menuhtml_top ($title)
function menu_entry ($link, $title, $available=1, $help=0)
function menuhtml_bottom ()
function maintab_start ($title, $typeadmin=0)
function maintab_stop ()
function subtab_start ()
function subtab_stop ()
function maintab_entry ($url, $title, $selected=0, $available=1, $help=0)
function subtab_entry ($url, $title, $selected=0, $available=1, $help=0)
function maintab_separator ()
function subtab_separator ()
function tabs ($params)
function user_tabs ()
function admin_tabs ()
function project_tabs ()

Variables

<?phpclassLayoutextendsError{var $bgpri=array();functionLayout(){GLOBAL $bgpri;$this- Error )()
 $bgpri [1] = 'priora'


Function Documentation

function admin_tabs  ) 
 

Definition at line 451 of file Layout.class.

References group, maintab_entry(), maintab_start(), maintab_stop(), print, subtab_entry(), subtab_start(), subtab_stop(), and task.

Referenced by tabs().

00452   {
00453 
00454     /*
00455         FIRST STEP: pointer to each feature activated
00456     */
00457 
00458     $tabDatas[] = $this->maintab_entry($GLOBALS['sys_home'].'admin/' ,
00459                                        _("Home"),
00460                                        SUBCONTEXT == 'browse');
00461 
00462     $tabDatas[] = $this->maintab_entry($GLOBALS['sys_home'].'admin/group_type.php' ,
00463                                        _("Group Type Management"),
00464                                        SUBCONTEXT == 'grouptype');
00465 
00466     $tabDatas[] = $this->maintab_entry($GLOBALS['sys_home'].'admin/grouplist.php' ,
00467                                        _("Group Management"),
00468                                        SUBCONTEXT == 'groupedit');
00469 
00470     $tabDatas[] = $this->maintab_entry($GLOBALS['sys_home'].'admin/userlist.php' ,
00471                                        _("User Management"),
00472                                        SUBCONTEXT == 'useredit');
00473 
00474     $tabDatas[] = $this->maintab_entry($GLOBALS['sys_home'].'people/admin/' ,
00475                                        _("Contributor Wanted Management"));
00476 
00477 
00478     /*
00479         SECOND STEP: pointer to the submenus
00480     */
00481 
00482     $subTabDatas = array();
00483     if (SUBCONTEXT == "browsing")
00484       {
00485         $subTabDatas[] = $this->subtab_entry($GLOBALS['sys_home'].'task/?group='.$GLOBALS['sys_unix_group_name'].'&amp;category_id=1&amp;status_id=1&amp;go_report=Apply' ,
00486                                              _("Pending Project Registrations"));
00487 
00488         $subTabDatas[] = $this->subtab_entry($GLOBALS['sys_home'].'news/approve.php?group='.$GLOBALS['sys_unix_group_name'] ,
00489                                              _("Site news approval"));
00490 
00491         $subTabDatas[] = $this->subtab_entry($GLOBALS['sys_home'].'admin/lastlogins.php' ,
00492                                              _("Most Recent Logins"));
00493 
00494       }
00495 
00496     if (SUBCONTEXT == "groupedit")
00497       {
00498         if ($GLOBALS['group_name'])
00499           {
00500             $subTabDatas[] = $this->subtab_entry($GLOBALS['sys_home'].'project/admin/?group='.$GLOBALS['group_name'] ,
00501                                                  _("This Project Admin"));
00502 
00503             $subTabDatas[] = $this->subtab_entry($GLOBALS['sys_home'].'project/admin/editgroupfeatures.php?group='.$GLOBALS['group_name'],
00504                                                  _("This Project Active Features"),
00505                                                  0);
00506 
00507             $subTabDatas[] = $this->subtab_entry($GLOBALS['sys_home'].'project/admin/useradmin.php?group='.$GLOBALS['group_name'] ,
00508                                                  _("Manage This Project Members"));
00509 
00510             $subTabDatas[] = $this->subtab_entry($GLOBALS['sys_home'].'project/admin/history.php?group='.$GLOBALS['group_name'],
00511                                                  _("Show This Project History"),
00512                                                  0);
00513 
00514           }
00515       }
00516 
00517     print $this->maintab_start(_("Server Admin"),1);
00518     print join ($this->maintab_separator(),$tabDatas);
00519 
00520     if ($subTabDatas)
00521       {
00522         print $this->subtab_start();
00523         print join ($this->subtab_separator(),$subTabDatas);
00524         print $this->subtab_stop();
00525       }
00526 
00527     print $this->maintab_stop();
00528   }

function box1_bottom echoout = 1  ) 
 

Definition at line 145 of file Layout.class.

References $return, and print.

00146   {
00147     $return = '
00148                         </td>
00149                 </tr>
00150         </table>';
00151     if ($echoout)
00152       {  print $return; }
00153     else
00154       { return $return; }
00155   }

function box1_middle title,
bgcolor = ''
 

Definition at line 132 of file Layout.class.

00133   {
00134     return '
00135                         </td>
00136                 </tr>
00137                 <tr>
00138                         <td colspan="2" class="boxtitle">'.$title.'</td>
00139                 </tr>
00140                 <tr>
00141                         <td colspan=2 class="boxitem">';
00142   }

function box1_top title,
echoout = 1,
subclass = ""
 

Definition at line 117 of file Layout.class.

References $return, and print.

00118   {
00119     $return = '<table class="box'.$subclass.'">
00120                 <tr>
00121                         <td colspan="2" class="boxtitle">'.$title.'</td>
00122                 </tr>
00123                 <tr>
00124                         <td colspan="2" class="boxitem">';
00125     if ($echoout)
00126       { print $return; }
00127     else
00128       { return $return;}
00129   }

function box_bottom noboxitem = 0  ) 
 

Definition at line 101 of file Layout.class.

References $return.

00102   {
00103     if (!$noboxitem)
00104       {
00105         $return = '</div><!-- end boxitem -->';
00106       }
00107 
00108     $return .= '
00109      </div><!-- end box -->
00110 ';
00111     return $return;
00112   }

function box_middle title,
noboxitem = 0
 

Definition at line 81 of file Layout.class.

References $return.

00082   {
00083     $return = '</div><!-- end boxitem -->
00084        <div class="boxtitle">'.$title.'</div><!-- end boxtitle -->';
00085     if (!$noboxitem)
00086       {
00087         $return .= '
00088        <div class="boxitem">';
00089       }
00090     return $return;
00091   }

function box_nextitem class  ) 
 

Definition at line 94 of file Layout.class.

00095   {
00096     return '</div><!-- end boxitem -->
00097        <div class="'.$class.'">';
00098   }

function box_top title,
subclass = "",
noboxitem = 0
 

Definition at line 68 of file Layout.class.

References $return.

00069   {
00070     $return = '     <div class="box'.$subclass.'">
00071        <div class="boxtitle">'.$title.'</div><!-- end boxtitle -->';
00072     if (!$noboxitem)
00073       {
00074         $return .= '
00075        <div class="boxitem">';
00076       }
00077     return $return;
00078   }

function footer params  ) 
 

Definition at line 282 of file Layout.class.

References generic_footer(), and print.

00283   {
00284     print '
00285   <p class="backtotop">
00286   '.utils_link("#top", '<img src="'.$GLOBALS['sys_home'].'images/'.SV_THEME.'.theme/top.orig.png" border="0" alt="'._("Back to the top").'" />').'
00287   </p>';
00288 # yeupou--gnu.org 2005-09-16:
00289 # Dirty hack to get rid of serious issue in MSIE handling of
00290 # CSS.
00291 # If we are using MSIE, we cannot close main, because the footer
00292 # will never be visible otherwise.
00293     if (!strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") || $_GET["printer"])
00294       {
00295         print '
00296  </div><!-- end main -->
00297 <br class="clear" />
00298 </div><!-- end realbody -->
00299 ';
00300       }
00301 
00302     $this->generic_footer ($params);
00303 
00304   }

function generic_footer params  ) 
 

Definition at line 221 of file Layout.class.

References print, and utils_get_content().

Referenced by footer().

00222   {
00223     print '<p class="footer">';
00224     utils_get_content("page_footer");
00225 
00226     # Powered by is no longer translated: it allows us to search on google
00227     # for a simple string to find public site running Savane, which would be
00228     # more complicated if it was i18n-ized
00229     print ' </p>
00230  <div align="right">'.utils_link($GLOBALS['savane_url'], sprintf("Powered by Savane %s", $GLOBALS['savane_version'])).'</div>';
00231 
00232 # yeupou--gnu.org 2005-09-16:
00233 # Dirty hack to get rid of serious issue in MSIE handling of
00234 # CSS.
00235 # If we are using MSIE, we havent closed main and realbody yet,
00236 # because the footer wouldnt be visible otherwise.
00237     if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") && !$_GET["printer"])
00238       {
00239         print '</div></div>';
00240       }
00241     print '
00242 </body>
00243 </html>';
00244   }

function generic_header_end params  ) 
 

Definition at line 215 of file Layout.class.

References print.

Referenced by header().

00216   {
00217     print '
00218 </head>';
00219   }

function generic_header_start params  ) 
 

Definition at line 157 of file Layout.class.

References $G_SESSION, $G_USER, $title, context_title(), group, header(), print, and utils_get_content().

Referenced by header().

00158   {
00159     global $G_USER, $G_SESSION;
00160 
00161 # Avoid any cache by setting an expire time in the past, without
00162 # distinction.
00163 # On Savane there are many forms, the content changes frequently,
00164 # it is probably better to avoid any cache problem that way.
00165 # We could use the Lastest-Modification header, but it would require
00166 # an extra call to time().
00167     $context = $params['context'];
00168     if ($context)
00169       {
00170 # Only make the test if context is set.
00171 # Then look for usual trackers (bugs, patch...), project admin part
00172 # and personal area (/my)
00173         if ("news" == $context ||
00174             "support" == $context ||
00175             "bugs" == $context ||
00176             "task" == $context ||
00177             "my" == $context ||
00178             "myitems" == $context ||
00179             "mygroups" == $context ||
00180             ereg("^a", $context))
00181           {
00182             header("Expires: Thu, 22 Dec 1977 15:00:00 GMT");
00183             dbg("Expires is set.");
00184           }
00185       }
00186 
00187     $title = context_title($context, $params['group']);
00188 
00189 
00190     if ($params['title'] && $title)
00191       {
00192         $params['title'] = sprintf("%s: %s", $title, $params['title']);
00193       }
00194     elseif ($title)
00195       {
00196         $params['title'] = $title;
00197       }
00198 
00199     $params['title'] = sprintf("%s  [%s]", $params['title'], $GLOBALS['sys_name']);
00200 
00201     print '<?xml version="1.0" encoding="utf-8"?>
00202 <!DOCTYPE html
00203         PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
00204          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
00205 <html xmlns="http://www.w3.org/1999/xhtml" lang="'.SV_LANG.'" xml:lang="'.SV_LANG.'">
00206 <head>
00207   <title>'.$params['title'].'</title>
00208   <meta name="Generator" content="Savane '.$GLOBALS['savane_version'].', see '.$GLOBALS['savane_url'].'" />
00209   <meta http-equiv="Content-Script-Type" content="text/javascript" />
00210   <link rel="stylesheet" type="text/css" href="'.$GLOBALS['sys_home'].'css/'.SV_THEME.'.css" />
00211   <link rel="icon" type="image/png" href="'.$GLOBALS['sys_home'].'images/'.SV_THEME.'.theme/icon.png" />
00212 ';
00213     utils_get_content("page_header");
00214   }

function header params  ) 
 

Definition at line 246 of file Layout.class.

References generic_header_end(), generic_header_start(), menu_print_sidebar(), print, and sane_all().

Referenced by exit_not_logged_in(), generic_header_start(), and sendmail_encode_header_content().

00247   {
00248     $this->generic_header_start($params);
00249     $this->generic_header_end($params);
00250     
00251     
00252     # Hide the box option if any
00253     unset($script_hide);
00254     if (!sane_all("printer"))
00255       {
00256         $script_hide = ' onload="document.getElementById(\'boxoptionscontent\').style.display=\'none\'; document.getElementById(\'boxoptionslinkhide\').style.display=\'none\'; document.getElementById(\'boxoptionslinkshow\').style.display=\'inline\';"';
00257       }
00258 
00259     print '
00260 <body'.$script_hide.'>
00261 <div class="realbody">
00262 ';
00263     menu_print_sidebar($params);
00264 
00265 # yeupou--gnu.org 2005-09-16:
00266 # Dirty hack to get rid of serious issue in MSIE handling of
00267 # CSS.
00268 # Please, do never add such an hack in savane somewhere else without
00269 # talking about it on savane-dev.
00270 # DONT CHANGE width, margin and padding size, or you ll be very sorry
00271 # for MSIE users
00272 # (do nothing in printer mode)
00273     unset($dirtyhack);
00274     if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") && !$_GET["printer"])
00275       { $dirtyhack = ' style="position: absolute; width: 83%; margin-left: 0.5%;  overflow: visible;"'; }
00276     print '
00277  <div class="main"'.$dirtyhack.'><a name="top"></a>
00278 ';
00279 
00280   }

function maintab_entry url,
title,
selected = 0,
available = 1,
help = 0
 

Definition at line 372 of file Layout.class.

References selected.

Referenced by admin_tabs(), project_tabs(), subtab_entry(), and user_tabs().

00373   {
00374     if ($selected)
00375       { return "\n        ".utils_link($url, $title, "tabselect", $available, $help); }
00376     else
00377       { return "\n        ".utils_link($url, $title, "tabs", $available, $help); }
00378   }

function maintab_separator  ) 
 

Definition at line 385 of file Layout.class.

References nbsp.

00386   {
00387     return ' |&nbsp;';
00388   }

function maintab_start title,
typeadmin = 0
 

Definition at line 336 of file Layout.class.

Referenced by admin_tabs(), project_tabs(), and user_tabs().

00337   {
00338 # FIXME: it is still used?
00339 #<div class="topmenu"><div class="'.($typeadmin ? 'topmenurestricted' : 'topmenupublic').'">
00340 
00341     return  '
00342     <div class="topmenu">
00343       <span class="topmenutitle">'.$title.'</span>
00344       <div class="topmenuitem">';
00345   }

function maintab_stop  ) 
 

Definition at line 347 of file Layout.class.

Referenced by admin_tabs(), project_tabs(), and user_tabs().

00348   {
00349     return  '
00350       </div><!-- end topmenuitem -->
00351     </div><!-- end topmenu -->
00352 
00353 ';
00354 #</div></div><!-- end topmenu + public/restricted -->
00355   }

function menu_entry link,
title,
available = 1,
help = 0
 

Definition at line 318 of file Layout.class.

References print.

00319   {
00320     print '
00321         <li class="menuitem">
00322            '.utils_link($link, $title, "menulink", $available, $help).'
00323         </li><!-- end menuitem -->';
00324   }

function menuhtml_bottom  ) 
 

Definition at line 327 of file Layout.class.

00328   {
00329 
00330   }

function menuhtml_top title  ) 
 

Definition at line 309 of file Layout.class.

References print.

00310   {
00311     print '
00312         <li class="menutitle">
00313            '.$title.'
00314         </li><!-- end menutitle -->';
00315   }

function project_tabs  ) 
 

Definition at line 532 of file Layout.class.

References $GLOBALS, $group_id, $project, $sys_group_id, group, group_id, maintab_entry(), maintab_start(), maintab_stop(), member_check(), patch, print, subtab_entry(), subtab_start(), subtab_stop(), and task.

Referenced by tabs().

function subtab_entry url,
title,
selected = 0,
available = 1,
help = 0
 

Definition at line 380 of file Layout.class.

References maintab_entry(), and selected.

Referenced by admin_tabs(), and project_tabs().

00381   {
00382     return $this->maintab_entry($url,$title,$selected,$available,$help);
00383   }

function subtab_separator  ) 
 

Definition at line 390 of file Layout.class.

References nbsp.

00391   {
00392     return ' |&nbsp;';
00393   }

function subtab_start  ) 
 

Definition at line 357 of file Layout.class.

References nbsp.

Referenced by admin_tabs(), and project_tabs().

00358   {
00359     return  '
00360        </div><!-- end topmenuitem -->
00361       <div class="topmenuitem"><span class="smaller">
00362          &gt;&gt;&nbsp;&nbsp;';
00363   }

function subtab_stop  ) 
 

Definition at line 365 of file Layout.class.

Referenced by admin_tabs(), and project_tabs().

00366   {
00367 # no need to close the topmenuitem div, it is handled by maintab_stop()
00368     return  '</span>';
00369   }

function tabs params  ) 
 

Definition at line 398 of file Layout.class.

References $group_id, admin_tabs(), context_title(), group_id, print, project_tabs(), and user_tabs().

00399   {
00400     global $group_id;
00401 
00402 # Print topmenu title
00403     print '<h2 class="toptitle"><img src="'.$GLOBALS['sys_home'].'images/'.SV_THEME.'.theme/'.context_icon().'.orig.png" width="48" height="48" alt="'.context_icon().'" class="pageicon" />';
00404     print context_title();
00405 
00406     if ($params['title'] != "")
00407       { print _(": ").$params['title']; }
00408 
00409     print '</h2>';
00410 
00411 # Now call the specific tab function
00412     switch (CONTEXT)
00413       {
00414       case 'my': $this->user_tabs(); break;
00415       case 'siteadmin': $this->admin_tabs(); break;
00416       case 'userguide': $this->project_tabs(); break;
00417       case isset($group_id): $this->project_tabs(); break;
00418       default: $this->site_tabs();
00419       }
00420   }

function user_tabs  ) 
 

Definition at line 425 of file Layout.class.

References maintab_entry(), maintab_start(), maintab_stop(), and print.

Referenced by tabs().

00426   {
00427     $tabDatas = array();
00428 
00429     $tabDatas[] = $this->maintab_entry($GLOBALS['sys_home'].'my/', _("Incoming Items"), SUBCONTEXT == 'browse', 1, _("What's new for me?"));
00430     $tabDatas[] = $this->maintab_entry($GLOBALS['sys_home'].'my/items.php', _("Items"), SUBCONTEXT == 'items', 1, _("Browse my items (bugs, tasks, bookmarks...)"));
00431     if (user_use_votes())
00432       {
00433         $tabDatas[] = $this->maintab_entry($GLOBALS['sys_home'].'my/votes.php', _("Votes"), SUBCONTEXT == 'votes', 1, _("Browse items I voted for"));
00434       }
00435     $tabDatas[] = $this->maintab_entry($GLOBALS['sys_home'].'my/groups.php', _("Group Membership"), SUBCONTEXT == 'groups', 1, _("List the groups I belong to"));
00436     if (user_get_preference("use_bookmarks"))
00437       {
00438         $tabDatas[] = $this->maintab_entry($GLOBALS['sys_home'].'my/bookmarks.php', _("Bookmarks"), SUBCONTEXT == 'bookmarks', 1, _("List my bookmarks"));
00439       }
00440 
00441     $tabDatas[] = $this->maintab_entry($GLOBALS['sys_home'].'my/admin/',  _("Account Configuration"), SUBCONTEXT == 'configure', 1, _("Account configuration: authentication, cosmetics preferences..."));
00442 
00443     print $this->maintab_start(_("My"));
00444     print join ($this->maintab_separator(),$tabDatas);
00445     print $this->maintab_stop();
00446 
00447   }


Variable Documentation

$bgpri[19] = 'priora'
 

Definition at line 45 of file Layout.class.

<?phpclassLayoutextendsError{var$bgpri=array();functionLayout(){GLOBAL$bgpri;$this- Error)()
 

Definition at line 42 of file Layout.class.


Generated on Sun Feb 26 13:23:05 2006 for Savane PHP Frontend Developer Reference by  doxygen 1.4.4