From: Siegfried L. <si...@us...> - 2003-01-06 22:41:34
|
Update of /cvsroot/xine/xine_www In directory sc8-pr-cvs1:/tmp/cvs-serv23482 Modified Files: Tag: xinehq framework.php index.php Log Message: merging changes back to official site... Index: framework.php =================================================================== RCS file: /cvsroot/xine/xine_www/framework.php,v retrieving revision 1.4.2.2 retrieving revision 1.4.2.3 diff -u -r1.4.2.2 -r1.4.2.3 --- framework.php 21 Dec 2002 00:05:37 -0000 1.4.2.2 +++ framework.php 6 Jan 2003 22:39:18 -0000 1.4.2.3 @@ -1,156 +1,77 @@ <?php include_once($include.'/menu_definition.inc.php'); +include_once($include.'/template.inc.php'); if (file_exists($base_dir.$module_header_file)) { include ($base_dir.$module_header_file); } +if (isset($parameters['theme'])) { + $theme = $parameters['theme']; +} +elseif (isset($_SESSION['theme'])) { + $theme = $_SESSION['theme']; +} +$themefile = $base_dir.'/themes/'.$theme.'.php'; +if ($fp = @fopen($themefile, 'r')){ + fclose($fp); +} +else { //theme file is not readable + $theme='default'; + $themefile = $base_dir.'/themes/'.$theme.'.php'; +} +include_once($themefile); + function render_menu($menu_array, $level = 0){ - global $current_key; + global $current_key, + $menu_item; + $menu_items = ''; $previous_entry = ''; foreach ($menu_array as $entry) { - if (is_array($entry)): + if (is_array($entry)){ if (in_array($previous_entry, $current_key['parents'])){ - render_menu($entry, $level+1); + $menu_items .= render_menu($entry, $level+1); } else{ } - else: - + } + else{ $previous_entry = $entry; $info = key2info($entry); if (!$info['access']){ continue; //skip invalid (due to guard) entries } - - ?> - - <div class="panel" onmouseover="switchColorIn(this);" - onmouseout="switchColorOut(this);" onmousedown="MaybeChangeURL('<?php echo $info['href']; ?>')"> - - <table width="100%" border="0" cellpadding="0" cellspacing="0" class="panel_label"> - <tr> - <?php - for ($i = 0; $i < $level; $i++) { - echo '<td width="14" align="center"> </td>'; - } - ?> - - <td width="13" align="center"><img class="bullet" src="<?php - echo $url_base.'/images/framework/bullet.png'; - ?>" width="4" height="4" border="0" alt="+" /></td> - <td align="left"><a class="panel_label" href="<?php - echo $info['href']; ?>" onmouseover="disableChange();" - onmouseout="enableChange();"><?php echo $info['name']; - ?></a></td> - </tr> - </table> - </div> - - <?php - - endif; + $menu_items .= fill_template($menu_item, + array('href'=>$info['href'], + 'name'=>$info['name'], + 'menu_indent'=>menu_indent($level) + ) + ); + } } + return $menu_items; } + - -echo '<?xml version="1.0" encoding="iso-8859-1"?>'; -?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> -<title>xine - A Free Video Player</title> -<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> -<meta content="RAPHEAD" name="original-author" /> -<meta content="the xine project" name="author" /> -<meta content="Homepage" name="classification" /> -<meta content="XINE Project" lang="en" name="description" /> -<meta content="XINE Projekt" lang="de" name="description" /> -<meta content="XINE, Video, Player, VCD, DivX, MPEG, Linux, Multimedia, Codec, DVD" lang="de" name="keywords" /> -<meta content="XINE, Video, Player, VCD, DivX, MPEG, Linux, Multimedia, Codec, DVD" lang="en" name="keywords" /> -<meta content="index, follow" name="robots" /> -<meta content="14 days" name="revisit-after" /> - -<link rel="SHORTCUT ICON" href="/xine-x.png" /> - -<link rel="stylesheet" type="text/css" href="/css/framework.css" /> - -<script type="text/javascript" src="<?php - echo $url_base.'/js/framework.js'; - ?>"></script> - -</head> -<body> - -<div class="layout"> -<div class="teaser"> </div> -</div> - - -<div class="hbar"> -<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> -<tr valign="middle"> -<td align="left"><!-- HBAR --></td><td align="right"> -<?php include ($base_dir.$hbar_module_file); ?> -</td> -</tr> -</table> -</div> - -<table width="100%" border="0" cellpadding="0" cellspacing="0"> -<tr width="100%" valign="top"> -<td width="180"> -<div class="navbar_top"></div> -<?php render_menu ($menu); ?> -<div class="navbar_bottom"></div> -<div class="spacer10"></div> -<div class="spacer10"></div> -<div class="center"><a href="http://xine.sourceforge.net/"><img src="http://sourceforge.net/sflogo.php?group_id=9655&type=" width="88" height="31" border="0" alt="SourceForge Logo" /></a></div> -</td> -<td align="left" valign="top"> -<div class="content"> -<table width="100%" border="0" valign="middle" cellspacing="0" cellpadding="0"> -<td width="18" align="left" valign="middle"><div class="nav_bullet"></div></td> -<td align="left"><span class="nav_description"><?php echo $current_key['name'] ?></span></td> -</tr> -</table> -<div class="hline"></div> -<div class="spacer3"></div> -<!-- CONTENT starts here --> -<?php +$hbar=''; +$content=''; +include ($base_dir.$hbar_module_file); if (file_exists($base_dir.$module_file)) { include ($base_dir.$module_file); } -else { - include ($base_dir.$module_dir.'dummy.php'); -} -?> -<!-- CONTENT ends here --> -</div> -</td> -</tr> -</table> -<?php /* pre($_SESSION); */ ?> -<div class="spacer15"></div> - -<!-- topSTATISTIK --> -<img src="http://stats.topwebmaster.net/extern/de/guenterb" width="10" height="1" alt="" /> - -<div class="footer"> -<table border="0" cellpadding="0" cellspacing="0" class="footer"> -<tr align="left" valign="top"> -<td width="33%">Copyright © 2002 The xine-Project</td> -<td><!-- Legal Information --></td> -<td width="33%">Pageimpressions since July 2000: <?php echo get_count ('global'); ?><br /> -Page generated in: <?php $timer->stop(); printf ("%0.4f", $timer->getElapsed()); ?> sec -</td> -</tr> -</table> -</div> -</body> -</html> +echo fill_template($page_framework, array( + 'menu_items' => render_menu ($menu), + 'hbar' => $hbar, + 'content' => $content, + 'sf_logo' => sflogo(), + 'page_name' => $current_key['name'], + 'count' => get_count ('global'), + ) + ); + + Index: index.php =================================================================== RCS file: /cvsroot/xine/xine_www/index.php,v retrieving revision 1.80.2.1 retrieving revision 1.80.2.2 diff -u -r1.80.2.1 -r1.80.2.2 --- index.php 20 Dec 2002 11:36:58 -0000 1.80.2.1 +++ index.php 6 Jan 2003 22:39:22 -0000 1.80.2.2 @@ -17,18 +17,29 @@ } -$params = explode('/', $_SERVER['PATH_INFO']); -array_shift($params); -$parameters = array(); -foreach ($params as $param){ - if (preg_match('/^([^=]*)=(.*)$/', $param, $m)){ - $parameters[$m[1]] = $m[2]; +function add_parameters($params){ + + global $parameters; + + if (!is_array($params)){ + $params = explode('/', $params); + if ($params[0] == ''){ + array_shift($params); + } } - else{ - $parameters[] = $param; + foreach ($params as $param){ + if (preg_match('/^([^=]*)=(.*)$/', $param, $m)){ + $parameters[$m[1]] = $m[2]; + } + else{ + $parameters[] = $param; + } } } +$parameters = array(); +add_parameters($_SERVER['PATH_INFO']); + //special case: forced downloads: if ($parameters[0] == 'force-download'){ array_shift($parameters); @@ -44,11 +55,12 @@ redirect($current_key['href']); break; case 'module': + add_parameters($current_key['parameter']); $hbar_module_file = $module_dir.$current_key['module'].'_hbar.php'; if (!file_exists($base_dir.$hbar_module_file)) { $hbar_module_file = $module_dir.'dummy.php'; } - + $module_file = $module_dir.$current_key['module'].'.php'; if (!file_exists($base_dir.$module_file)) { $module_file = $module_dir.'dummy.php'; |