cvs: php-gtk-doc /search/include layout.php manual-lookup.inc prepend.php site.php style.css

From: Date: Mon, 27 Jan 2003 19:07:38 +0000
Subject: cvs: php-gtk-doc /search/include layout.php manual-lookup.inc prepend.php site.php style.css
Groups: php.gtk.doc 
Request: Send a blank email to php-gtk-doc+get-592@lists.php.net to get a copy of this message
sfox Mon Jan 27 14:07:38 2003 EDT Added files: /php-gtk-doc/search/include layout.php manual-lookup.inc prepend.php site.php style.css Log: nightmare .. trying to put search in place

Index: php-gtk-doc/search/include/layout.php +++ php-gtk-doc/search/include/layout.php <? /* $Id: layout.php,v 1.1 2003/01/27 19:07:38 sfox Exp $ */ function spacer($width=1, $height=1, $align=false, $extras=false) { printf('<img src="/gifs/spacer.gif" width="%d" height="%d" border="0" alt="" %s%s>', $width, $height, ($align ? 'align="'.$align.'" ' : ''), ($extras ? $extras : '') ); } # resize_image() # tag the output of make_image() and resize it manually # function resize_image($img, $width=1, $height=1) { $str = preg_replace('/width=\"([0-9]+?)\"/i', '', $img ); $str = preg_replace('/height=\"([0-9]+?)\"/i', '', $str ); $str = substr($str,0,-1) . sprintf(' height="%s" width="%s">', $height, $width ); return $str; } # make_image() # return an IMG tag for a given file (relative to the images dir) # function make_image($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { global $HTTP_SERVER_VARS; if (!$dir) { $dir = '/gifs'; } if ($size = @getimagesize($HTTP_SERVER_VARS['DOCUMENT_ROOT'].$dir.'/'.$file)) { $image = sprintf('<img src="%s/%s" border="%d" %s ALT="%s" %s%s>', $dir, $file, $border, $size[3], ($alt ? $alt : ''), ($align ? ' align="'.$align.'"' : ''), ($extras ? ' '.$extras : '') ); } else { $image = sprintf('<img src="%s/%s" border="%d" ALT="%s" %s%s>', $dir, $file, $border, ($alt ? $alt : ''), ($align ? ' ALIGN="'.$align.'"' : ''), ($extras ? ' '.$extras : '') ); } return $image; } # print_image() # print an IMG tag for a given file # function print_image($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { print make_image($file, $alt, $align, $extras, $dir); } # make_submit() # - make a submit button image # function make_submit($file, $alt=false, $align=false, $extras=false, $dir=false, $border=0) { if (!$dir) { $dir = '/gifs'; } $return = make_image($file, $alt, $align, $extras, $dir, $border); if ($return != "<img>") { $return = '<input type="image"'.substr($return,4); } else { $return = '<input type="submit">'; } return $return; } # delim() # print a pipe delimiter # function delim($color=false) { if (!$color) { return '&nbsp;|&nbsp;'; } return sprintf('<font color="%s">&nbsp;|&nbsp;</font>', $color ); } # hdelim() # print a horizontal delimiter (just a wide line); # function hdelim($color="#000000") { if (!$color) { return '<hr noshade size="1">'; } return sprintf('<hr noshade size="1" color="%s">', $color ); } # make_link() # return a hyperlink to something function make_link ($url, $linktext=false, $target=false, $extras=false) { if($url) { if(!strstr($url, "www")) $url = "/manual/$url"; return sprintf("<a href=\"%s\"%s%s>%s</a>", $url, ($target ? ' target="'.$target.'"' : ''), ($extras ? ' '.$extras : ''), ($linktext ? $linktext : $url) ); } } # print_link() # echo a hyperlink to something, within the site # function print_link($url, $linktext=false, $target=false, $extras=false) { echo make_link($url, $linktext, $target, $extras); } function make_email($email, $linktext=false) { return sprintf("<a href=\"mailto:%s\">%s</a>", $email, ($linktext ? $linktext : $email) ); } function print_email($email, $linktext=false) { echo make_email($email, $linktext); } # commonheader() # # function commonHeader($title=false, $padding=true) { global $SIDEBAR_DATA; ?><html> <head> <title>PHP-GTK<?php if ($title) { echo ':'.$title; } ?></title> <link rel="stylesheet" href="/include/style.css" /> <link rel="shortcut icon" href="/gifs/favicon.ico" /> </head> <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#ffffff" text="#000000" link="#000033" alink="#0099ff" vlink="#000033" ><a name="TOP"></a> <table border="0" cellspacing="0" cellpadding="0" height="48" width="100%"> <tr bgcolor="#0099cc"> <td align="left" rowspan="2"> <?php print_link('/', make_image('php-gtk.gif', 'PHP-GTK', false, 'vspace="2" hspace="2"') ); ?><br> </td> <td align="right" valign="top" nowrap> <font size="5%" color="#ffffff"><b><br> <?php echo "Offline Manual"; ?> </b>&nbsp;<br> </font> </td> </tr> <tr bgcolor="#000033"><td colspan="2"><?php spacer(1,1);?><br></td></tr> <tr bgcolor="#006699"></tr> <tr bgcolor="#000033"><td colspan="2"><?php spacer(1,1);?><br></td></tr> </table> <table cellpadding="0" cellspacing="0"> <tr valign="top"> <?php if (isset($SIDEBAR_DATA)):?> <td bgcolor="#f0f0f0"> <table width="170" cellpadding="4" cellspacing="0"> <tr valign="top"> <td class="sidebar"><?php echo $SIDEBAR_DATA?></td> </tr> </table> </td> <td bgcolor="#cccccc" background="/gifs/checkerboard.gif"><?php spacer(1,1);?><br></td> <?php endif; ?> <td> <table width="600" cellpadding="<?php if( $padding ) { print("10"); }else { print("0"); } ?>" cellspacing="0"> <tr> <td valign="top"> <?php } # commonfooter() # # function commonFooter($padding = true) { global $HTTP_SERVER_VARS; if( $padding ) { print("<br>"); } ?> </td> </tr> </table> </td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr bgcolor="#000033"><td><?php spacer(1,1);?><br></td></tr> <tr bgcolor="#006699"> <td align="right" valign="bottom"><? print_link('credits.php', 'credits', false, 'class="menuWhite"'); ?>&nbsp;<br> </td> </tr> <tr bgcolor="#000033"><td><?php spacer(1,1); ?><br></td></tr> </table> <table border="0" cellspacing="0" cellpadding="6" width="100%"> <tr valign="top" bgcolor="#cccccc"> <td><small> <?php print_link('http://www.php.net/', make_image('php-logo.gif', 'PHP', 'left') ); ?> <?php print_link('copyright.php', 'Copyright &copy; 2001 The PHP Group'); ?><BR> All rights reserved.<BR> </small> </td> <td align="right"><small> Last updated: <?php echo strftime("%c %Z", getlastmod()); ?><BR> </small><br> </td> </tr> </table> </body> </html> <?php } function clean_note($text) { $text = htmlspecialchars($text); $fixes = array('<br>','<p>','</p>'); foreach ($fixes as $f) { $text=str_replace(htmlspecialchars($f), $f, $text); $text=str_replace(htmlspecialchars(strtoupper($f)), $f, $text); } $text = "<tt>".nl2br($text)."</tt>"; return $text; } function sect_to_file($string) { $string = strtolower($string); $string = str_replace(' ','-',$string); $string = str_replace('_','-',$string); $func = "function.$string.php"; $chap = "ref.$string.php"; $feat = "features.$string.php"; $struct = "control-structures.$string.php"; if(is_file($func)) return $func; else if(is_file($chap)) return $chap; else if(is_file($feat)) return $feat; else if(is_file($struct)) return $struct; else return "$string.php"; } Index: php-gtk-doc/search/include/manual-lookup.inc +++ php-gtk-doc/search/include/manual-lookup.inc <?php function tryprefix($func, $prefix) { /* set up the tools for the job - this array tests class and enum names */ $classes = array('GtkAccelGroup.', 'GtkAccelLabel.', 'GtkAdjustment.', 'GtkAlignment.', 'GtkArrow.', 'GtkAspectFrame.', 'GtkBin.', 'GtkBox.', 'GtkBoxChild.', 'GtkButton.', 'GtkButtonBox.', 'GtkCalendar.', 'GtkCheckButton.', 'GtkCheckMenuItem.', 'GtkCList.', 'GtkCListRow.', 'GtkColorSelection.', 'GtkColorSelectionDialog.', 'GtkCombo.', 'GtkContainer.', 'GtkCTree.', 'GtkCTreeNode.', 'GtkCurve.', 'GtkData.', 'GtkDialog.', 'GtkDrawingArea.', 'GtkEditable.', 'GtkEntry.', 'GtkEventBox.', 'GtkFileSelection.', 'GtkFixed.', 'GtkFixedChild.', 'GtkFontSelection.', 'GtkFontSelectionDialog.', 'GtkFrame.', 'GtkGammaCurve.', 'GtkHandleBox.', 'GtkHBox.', 'GtkHButtonBox.', 'GtkHPaned.', 'GtkHRuler.', 'GtkHScale.', 'GtkHScrollbar.', 'GtkHSeparator.', 'GtkImage.', 'GtkInputDialog.', 'GtkInvisible.', 'GtkItem.', 'GtkItemFactory.', 'GtkLabel.', 'GtkLayout.', 'GtkList.', 'GtkListItem.', 'GtkMenu.', 'GtkMenuBar.', 'GtkMenuItem.', 'GtkMenuShell.', 'GtkMisc.', 'GtkNotebook.', 'GtkObject.', 'GtkOptionMenu.', 'GtkPacker.', 'GtkPaned.', 'GtkPixmap.', 'GtkPlug.', 'GtkPreview.', 'GtkProgress.', 'GtkProgressbar.', 'GtkRadioButton.', 'GtkRadioMenuItem.', 'GtkRange.', 'GtkRuler.', 'GtkScale.', 'GtkScrollbar.', 'GtkScrolledWindow.', 'GtkSelectionData.', 'GtkSeparator.', 'GtkSocket.', 'GtkSpinButton.', 'GtkStatusBar.', 'GtkStyle.', 'GtkTable.', 'GtkTableChild.', 'GtkTearoffMenuItem.', 'GtkText.', 'GtkTipsQuery.', 'GtkToggleButton.', 'GtkToolBar.', 'GtkToolTips.', 'GtkTree.', 'GtkTreeItem.', 'GtkVBox.', 'GtkVButtonBox.', 'GtkViewport.', 'GtkVPaned.', 'GtkVRuler.', 'GtkVScale.', 'GtkVScrollbar.', 'GtkVSeparator.', 'GtkWidget.', 'GtkWindow.', 'GdkAtom.', 'GdkBitmap.', 'GdkColor.', 'GdkColormap.', 'GdkCursor.', 'GdkDragContext.', 'GdkEvent.', 'GdkEventAny.', 'GdkEventExpose.', 'GdkFont.', 'GdkGC.', 'GdkPixmap.', 'GdkVisual.', 'GdkWindow.', 'GdkCapStyle.', 'GdkCursorType.', 'GdkDragAction.', 'GdkEventMask.', 'GdkEventType.', 'GdkFill.', 'GdkFontType.', 'GdkFunction.', 'GdkInputCondition.', 'GdkJoinStyle.', 'GdkLineStyle.', 'GdkModifierType.', 'GdkRgbDither.', 'GdkSubwindowMode.', 'GdkVisualType.', 'GtkAccelFlags.', 'GtkAnchorType.', 'GtkArrowType.', 'GtkAttachOptions.', 'GtkButtonAction.', 'GtkButtonBoxStyle.', 'GtkCalendarDisplayOptions.', 'GtkCellType.', 'GtkCornerStyle.', 'GtkCTreeExpanderStyle.', 'GtkCTreeExpansionType.', 'GtkCTreeLineStyle.', 'GtkCurveType.', 'GtkDestDefaults.', 'GtkDirectionType.', 'GtkFontFilterType.', 'GtkFontType.', 'GtkJustification.', 'GtkObjectFlags.', 'GtkOrientation.', 'GtkPackerOptions.', 'GtkPackType.', 'GtkPolicyType.', 'GtkPositionType.', 'GtkPreviewType.', 'GtkProgressBarOrientation.', 'GtkProgressBarStyle.', 'GtkReliefStyle.', 'GtkResizeMode.', 'GtkScrollType.', 'GtkSelectionMode.', 'GtkShadowType.', 'GtkSideType.', 'GtkSortType.', 'GtkSpinButtonUpdatePolicy.', 'GtkSpinType.', 'GtkStateType.', 'GtkSubmenuPlacement.', 'GtkToolbarChildType.', 'GtkToolbarSpaceStyle.', 'GtkToolbarStyle.', 'GtkTreeViewMode.', 'GtkUpdateType.', 'GtkVisibility.', 'GtkWidgetFlags.', 'GtkWindowPosition.', 'GtkWindowType.'); $types = array('method.', 'signal.', 'property.'); $first = substr($prefix, 0, 3); $hit = array(); /* just so's we don't have to guess wildly at capitalisation in classes/enums */ for($i = 0; $i < sizeof($classes); $i++) { if(stristr($classes[$i], "${func}.")) $pos = $i; } $realname = $classes[$pos]; /* checking for classes, enums and static functions */ if(strstr($func, "gdk") || strstr($func, "gtk") || strstr($prefix, "method")) { /* checking for full function name (e.g. 'gtkwindow::set_default_size') */ if(strstr($prefix, "method") && strlen($prefix) > 11) { $try = "/manual/${first}.${prefix}${func}.php"; if (file_exists("$_SERVER[DOCUMENT_ROOT]$try")) $hit[] = $try; } else { /* it's either a gtk/gdk static function or it's a full class or enum name */ $try = "/manual/${prefix}${func}.php"; $constructor = "/manual/${prefix}${func}.constructor.php"; if (file_exists("$_SERVER[DOCUMENT_ROOT]$constructor")) { $try = "/manual/${prefix}${realname}php"; $constructor = "/manual/${prefix}${realname}constructor.php"; $hit = array($try, $constructor); } else if (file_exists("$_SERVER[DOCUMENT_ROOT]$try")) $hit[] = $try; } /* full queries can only have this return, so send it straight home to Daddy */ return $hit; } /* undeclared class/constructor or enum */ $try = "/manual/${prefix}${first}${func}.php"; $constructor = "/manual/${prefix}${first}${func}.constructor.php"; if (file_exists("$_SERVER[DOCUMENT_ROOT]$constructor")) { for($i = 0; $i < sizeof($classes); $i++) { if(stristr($classes[$i], "${first}${func}.")) $pos = $i; } $realname = $classes[$pos]; $try = "/manual/${prefix}${realname}php"; $constructor = "/manual/${prefix}${realname}constructor.php"; $hit = array($try, $constructor); } else { if (file_exists("$_SERVER[DOCUMENT_ROOT]$try")) { for($i = 0; $i < sizeof($classes); $i++) { if(stristr($classes[$i], "${first}${func}.")) { $pos = $i; $realname = $classes[$pos]; $try = "/manual/${prefix}${realname}php"; } } $hit[] = $try; } } /* undeclared static function */ $try = "/manual/${prefix}method.${func}.php"; if(file_exists("$_SERVER[DOCUMENT_ROOT]$try")) $hit[] = $try; /* class methods, signals and properties with no clues attached */ foreach($classes as $class) { $lowclass = strtolower($class); foreach($types as $type) { if($first == substr($lowclass, 0, 3)) { $try = "/manual/${prefix}${lowclass}${type}${func}.php"; $uc = "/manual/${prefix}${class}${type}${func}.php"; if(file_exists("$_SERVER[DOCUMENT_ROOT]$try")) $hit[] = $uc; } } } return $hit; } function find_manual_page($function) { /* names of xml-generated sections */ $sections = array("gdk.enum.", "gdk.", "gtk.enum.", "gtk."); /* if there's no :: in there we could be looking for anything */ if(!strstr($function, "::")) { foreach($sections as $section) { $try = tryprefix($function, $section); if($try) $result = array_merge($try, $result); } if($result) return $result; } else { /* fast track, single return :) */ list($funcpre, $funcpost) = split("::", $function); $try = tryprefix($funcpost, "$funcpre.method."); if($try) return $try; } return ""; } ?> Index: php-gtk-doc/search/include/prepend.php +++ php-gtk-doc/search/include/prepend.php <?php require_once 'site.php'; require_once 'layout.php'; Index: php-gtk-doc/search/include/site.php +++ php-gtk-doc/search/include/site.php <?php # http://www.unicode.org/unicode/onlinedat/languages.html $LANGUAGES = array( 'en' => 'English', 'bg' => 'Bulgarian', 'ca' => 'Catalan', 'zh' => 'Chinese', 'cs' => 'Czech', 'da' => 'Danish', 'nl' => 'Dutch', 'fi' => 'Finnish', 'fr' => 'French', 'de' => 'German', 'el' => 'Greek', 'hu' => 'Hungarian', 'in' => 'Indonesian', 'it' => 'Italian', 'ja' => 'Japanese', 'kr' => 'Korean', # this should be 'ko'. its wrong in phpdoc. 'lv' => 'Latvian', 'no' => 'Norwegian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'pt_BR' => 'Brazilian', 'ro' => 'Romanian', 'ru' => 'Russian', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'es' => 'Spanish', 'sv' => 'Swedish', 'th' => 'Thai', 'tr' => 'Turkish', 'uk' => 'Ukranian', ); ?> Index: php-gtk-doc/search/include/style.css +++ php-gtk-doc/search/include/style.css body, td, th { font-family: arial,helvetica,sans-serif; font-size: 95%; } em { font-weight: bold; font-style: italic; } newsDate { font-size: 85%; font-style: italic; color: #6666cc; } A.menuWhite { font-family: arial,helvetica,sans-serif; font-size: 75%; color: #ffffff; } A.menuBlack { font-family: arial,helvetica,sans-serif; font-size: 75%; color: #000000; } sidebar { font-size: 75%; } pre,code { font-family: "andale mono", "monotype.com", "courier new", monospace; font-size: 85%; } tt { font-family: "andale mono", "monotype.com", "courier new", monospace; font-size: 80%; } pre.code { background-color: #f0f0f0; } h1 { font-family: arial,helvetica,sans-serif; font-size: 140%; font-weight: bold; color: #000066; } h2 { font-family: arial,helvetica,sans-serif; font-size: 120%; font-weight: bold; color: #000066; } dt,h3 { font-family: arial,helvetica,sans-serif; font-size: 110%; font-weight: bold; color: #000066; } h4 { font-family: arial,helvetica,sans-serif; font-size: 90%; font-weight: bold; color: #000066; padding-top: 0px; padding-bottom: 0px; } blockquote { margin-left: 12px; } small { font-family: arial,helvetica,sans-serif; font-size: 75%; } a.small { font-family: arial,helvetica,sans-serif; font-size: 75%; text-decoration: none; } tableTitle { font-family: arial,helvetica,sans-serif; font-weight: bold; } tableExtras { font-family: arial,helvetica,sans-serif; font-size: 85%; color: #FFFFFF; } input { font-family: arial,helvetica,sans-serif; } textarea { font-family: "andale mono", "monotype.com", "courier new", monospace; } input.small, select.small { font-family: arial,helvetica,sans-serif; font-size: 75%; } textarea.small { font-family: "andale mono", "monotype.com", "courier new", monospace; font-size: 75%; } programlisting { display: block; width: 100%; background-color: #E0E0E0 }
« previous php.gtk.doc (#592) next »