diff -ur olaf_glob2/index.php olaf/index.php --- olaf_glob2/index.php Mon Mar 17 00:28:08 2003 +++ olaf/index.php Tue Jul 8 17:41:09 2003 @@ -11,8 +11,6 @@ of the License, or (at your option) any later version. */ -$mode='frameset'; - require_once('src/olaf.inc'); ?> diff -ur olaf_glob2/src/cache.inc olaf/src/cache.inc --- olaf_glob2/src/cache.inc Thu Apr 24 01:17:44 2003 +++ olaf/src/cache.inc Wed Jul 9 10:31:00 2003 @@ -17,7 +17,7 @@ $config['cachesize']=2000000; // Make the unique cache name string out of the get variables -$cache['file']=$config['cachepath'].md5($_SERVER['PHP_SELF'].'?path='.$get['path'].'&lang='.$get['lang']); +$cache['file']=$config['cachepath'].md5($_SERVER['PHP_SELF'].$get['path'].'?frame='.$get['frame'].'&lang='.$get['lang']); // If the cache exists if(file_exists($cache['file'].'.buf') && file_exists($cache['file'].'.dep')) diff -ur olaf_glob2/src/html.inc olaf/src/html.inc --- olaf_glob2/src/html.inc Thu Apr 24 02:00:22 2003 +++ olaf/src/html.inc Wed Jul 9 11:46:58 2003 @@ -15,24 +15,24 @@ function genPage() { - switch($GLOBALS['mode']) + switch($GLOBALS['frame']) { - case 'noframe': - noframe(); + case 'no': + frameno(); break; - case 'frameset': + case 'set': frameset(); break; - case 'framemenu': + case 'menu': framemenu(); break; - case 'framecontent': + case 'content': framecontent(); break; } } -function noframe() +function frameno() { head(); ?> @@ -66,12 +66,23 @@ function frameset() { head(); + + $defaultframe = $GLOBALS['root']['frame_default']; + $menuframeArg = ''; + if ($defaultframe!='menu') + $menuframeArg="frame=menu&"; + $contentframeArg = ''; + if ($defaultframe!='content') + $contentframeArg="frame=content&"; + $noframeArg = ''; + if ($defaultframe!='no') + $noframeArg="frame=no&"; ?> - - + + - <P align="center"><A href="noframe.php"><?php echo(tag(lang($GLOBALS['root']['noframe'], 1))); ?></A></P> + <P align="center"><A href="<?php echo($GLOBALS['config']['base'].'/'.$GLOBALS['get']['path'].'?'.$noframeArg.'lang='.$GLOBALS['get']['lang']); ?>"><?php echo(tag(lang($GLOBALS['root']['noframe'], 1))); ?></A></P> diff -ur olaf_glob2/src/htmlutils.inc olaf/src/htmlutils.inc --- olaf_glob2/src/htmlutils.inc Thu Apr 24 01:46:30 2003 +++ olaf/src/htmlutils.inc Wed Jul 9 11:29:14 2003 @@ -52,12 +52,16 @@ $url=trim($url); if($url[0]=='=' && isset($root['menu_tree'][substr($url, 1)]) && $root['menu_tree'][substr($url, 1)]['type']==='dyn') { - $GLOBALS['mode']=='noframe'? $phpPage='noframe.php': $phpPage='index.php'; $pageId=$root['menu_tree'][substr($url, 1)]['id']; if(!isset($pageTitle)) $pageTitle=lang($root['menu_text'][$pageId], 1); - return "$pageTitle"; + $frame = $GLOBALS['frame']; + $frameArg = ''; + if ($frame==$GLOBALS['root']['frame_default']) + $frameArg="frame={$frame}&"; + + return "$pageTitle"; } else { @@ -140,20 +144,24 @@ >  -"> +"> -  -"> +"> @@ -182,20 +190,25 @@  ($langFound)"; - $GLOBALS['mode']=='noframe'? $phpPage='noframe.php': $phpPage='index.php'; + $langFound==$GLOBALS['lang']['want']? $otherLang="": $otherLang=" ($langFound)"; + + $frame = $GLOBALS['frame']; + $frameArg = ''; + if ($frame==$GLOBALS['root']['frame_default']) + $frameArg="frame={$frame}&"; + if($tree['path']==$GLOBALS['page']['path']) - { + { ?> >  -"> +"> -  -"> +"> @@ -575,7 +588,7 @@ <?php lang($GLOBALS['root']['menu_text'][$GLOBALS['page']['id']]); echo(' - '); lang($GLOBALS['root']['title']); ?> diff -ur olaf_glob2/src/inputconf.inc olaf/src/inputconf.inc --- olaf_glob2/src/inputconf.inc Thu Apr 24 01:17:52 2003 +++ olaf/src/inputconf.inc Wed Jul 9 10:55:36 2003 @@ -33,6 +33,9 @@ $tagSize['note']=2; $tagSize['noframe']=2; + $tagSize['frame']=2; + $tagSize['frame_default']=1; + return $tagSize; } @@ -93,6 +96,9 @@ $tagFunct['update']='langStr'; $tagFunct['note']='langStr'; $tagFunct['noframe']='langStr'; + + $tagFunct['frame']='langStr'; + $tagFunct['frame_default']='simple'; return $tagFunct; } diff -ur olaf_glob2/src/olaf.inc olaf/src/olaf.inc --- olaf_glob2/src/olaf.inc Thu Apr 24 01:17:52 2003 +++ olaf/src/olaf.inc Wed Jul 9 11:46:06 2003 @@ -13,10 +13,9 @@ /* GLOBAL VARIABLES - $mode=('noframe' | 'frameset' | 'menu' | 'content') - $config{srcpath, txtpath, (cache), (cachepath), (cachesize)} + $config{base, srcpath, txtpath, (cache), (cachepath), (cachesize)} $cache{file, use, dep} (only if included cache.inc) - $get{path, lang} + $get{path, lang, frame} $root{...} $page{...} $lang{default, want, found} @@ -26,10 +25,13 @@ //error_reporting(0); // Set the $get variable that contains the useful arguments passed to the script -isset($_GET['path']) ? $get['path']=strtolower($_GET['path']) : $get['path']=''; -isset($_GET['lang']) ? $get['lang']=strtolower($_GET['lang']) : $get['lang']=''; - +$get['path'] = isset($PATH_INFO) ? strtolower(substr($PATH_INFO, 1)) : ''; +//echo $get['path']; +$get['lang'] = isset($_GET['lang']) ? strtolower($_GET['lang']) : ''; +$get['frame'] = isset($_GET['frame']) ? strtolower($_GET['frame']) : ''; + // General Configuration +$config['base']=$SCRIPT_NAME; $config['srcpath']='src/'; $config['txtpath']='txt/'; diff -ur olaf_glob2/src/utils.inc olaf/src/utils.inc --- olaf_glob2/src/utils.inc Tue Jul 1 11:10:47 2003 +++ olaf/src/utils.inc Wed Jul 9 10:57:49 2003 @@ -110,7 +110,17 @@ $lang['found']=key($root['menu_text'][$page['id']]); } + // Set $frame + if(empty($frame)) + { + if(isset($get['frame']) && isset($root['frame'][$get['frame']])) + $frame=$get['frame']; + else + $frame=$root['frame_default']; + } + $GLOBALS['page']=&$page; $GLOBALS['lang']=&$lang; + $GLOBALS['frame']=&$frame; } ?> diff -ur olaf_glob2/txt/root.txt olaf/txt/root.txt --- olaf_glob2/txt/root.txt Sun Jun 29 15:31:22 2003 +++ olaf/txt/root.txt Wed Jul 9 11:22:55 2003 @@ -70,11 +70,11 @@ {void} {missing} {dyn} {void} {olaf_exemples} {dyn} -* menu_default: page choisie si l'url ne contient pas de ?path=... +* menu_default: page par defaut... \menu_default {glob2/welcome} -* menu_missing: page choisie si le ?path=... de l'url n'a pas ete trouve +* menu_missing: page choisie si la page n'a pas ete trouvee \menu_missing {void/missing} @@ -135,4 +135,24 @@ \note {en} {Copyright \c 2003 \Lhttp://www.ysagoon.com/glob2/\xGlobulation 2\l.\n Permission is granted to copy, distribute and/or modify this document\n - under the terms of the \Lhttp://www.gnu.org/licenses/fdl.html\xGNU Free Documentation License\l.} \ No newline at end of file + under the terms of the \Lhttp://www.gnu.org/licenses/fdl.html\xGNU Free Documentation License\l.} + +====== + FRAME +====== + +* frame: definit les frames disponibles +1 id de la frame +2 texte affiche (inutilise, mais peut servir un jour) + +\frame +{no} {No frames} +{set} {Frameset} +{menu} {Menu frame} +{content} {Content frame} + +* frame_default: frame choisi quand l'url ne contient pas de ?frame=... +1 id de la frame + +\frame_default {set} + Only in olaf: view Only in olaf: view.php