From 653147a09c22ec68344871638989e739b35d0dd5 Mon Sep 17 00:00:00 2001 From: dairiki Date: Thu, 17 Jan 2002 20:34:02 +0000 Subject: [PATCH] Moved much theme configuration out of index.php into themeinfo.php. git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@1285 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- index.php | 131 ++++++++-------------------------- themes/Hawaiian/themeinfo.php | 46 +++++------- themes/MacOSX/themeinfo.php | 71 ++++++++---------- themes/WikiTrek/themeinfo.php | 55 ++++---------- themes/default/themeinfo.php | 77 ++++++++------------ 5 files changed, 116 insertions(+), 264 deletions(-) diff --git a/index.php b/index.php index 106618899..54c1f291c 100644 --- a/index.php +++ b/index.php @@ -68,7 +68,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA define ('PHPWIKI_VERSION', '1.3.2-jeffs-hacks'); require "lib/prepend.php"; -rcs_id('$Id: index.php,v 1.63 2002-01-17 05:52:11 carstenklapp Exp $'); +rcs_id('$Id: index.php,v 1.64 2002-01-17 20:34:01 dairiki Exp $'); ///////////////////////////////////////////////////////////////////// // @@ -259,6 +259,22 @@ $ExpireParams['author'] = array('max_age' => 365, // ///////////////////////////////////////////////////////////////////// +/* THEME + * + * Most of the page appearance is controlled by files in the theme + * subdirectory. + * + * There are a number of pre-defined themes shipped with PhpWiki. + * Or you may create your own (e.g. by copying and then modifying one of + * stock themes.) + * + * Pick one. + */ +//define('THEME', 'default'); +//define('THEME', 'Hawaiian'); +//define('THEME', 'MacOSX'); +//define('THEME', 'WikiTrek'); + // Select a valid charset name to be inserted into the xml/html pages, // and to reference links to the stylesheets (css). For more info see: // . Note that PhpWiki @@ -313,99 +329,25 @@ $LANG='C'; // to find the correct setting: //putenv('LC_TIME=de_DE'); -// If you specify a relative URL for the CSS and images, the are -// interpreted relative to DATA_PATH (see below). (The default value -// of DATA_PATH is the directory in which index.php (this file) -// resides.) - -// CSS location -// -// Note that if you use the stock phpwiki style sheet, 'phpwiki.css', -// you should make sure that it's companion 'phpwiki-heavy.css' is -// installed in the same directory that the base style file is. -// FIXME: These default CSS key names could use localization, but -// gettext() is not available at this point yet -$CSS_URLS = array('PhpWiki' => "phpwiki.css", - 'Printer' => "phpwiki-printer.css", - 'Modern' => "phpwiki-modern.css"); - -$CSS_DEFAULT = "PhpWiki"; - -// logo image (path relative to index.php) -$logo = "themes/default/images/logo.png"; - -// RSS logo icon (path relative to index.php) -// If this is left blank (or unset), the default "images/rss.png" -// will be used. -//$rssicon = "themes/default/images/RSS.png"; - -// Signature image which is shown after saving an edited page -// If this is left blank (or unset), the signature will be omitted. -//$SignatureImg = "themes/default/images/signature.png"; - -// this turns on url indicator icons, inserted before embedded links -// '*' icon is shown when the link type has no icon listed here, but -// ONLY for the AllowedProtocols specified in in part four! The -// 'interwiki' icon indicates a Wiki listed in lib/interwiki.map If -// you want icons just to differentiate between urls and Wikis then -// turn on only 'interwiki' and '*', comment out the other four. -/* -$URL_LINK_ICONS = array( - 'http' => 'themes/default/images/http.png', - 'https' => 'themes/default/images/https.png', - 'ftp' => 'themes/default/images/ftp.png', - 'mailto' => 'themes/default/images/mailto.png', - 'interwiki' => 'themes/default/images/interwiki.png', - '*' => 'themes/default/images/url.png' - ); -*/ - -// Date & time formats used to display modification times, etc. -// Formats are given as format strings to PHP strftime() function See -// http://www.php.net/manual/en/function.strftime.php for details. -$datetimeformat = "%B %e, %Y"; // may contain time of day -$dateformat = "%B %e, %Y"; // must not contain time - -// FIXME: delete -// this defines how many page names to list when displaying -// the MostPopular pages; the default is to show the 20 most popular pages -define("MOST_POPULAR_LIST_LENGTH", 20); - -// this defines how many page names to list when displaying related pages -define("NUM_RELATED_PAGES", 5); - -// This defines separators used in RecentChanges and RecentEdits lists. -// If undefined, defaults to '' (nothing) and '...' (three periods). -//define("RC_SEPARATOR_A", '. . . '); -//define("RC_SEPARATOR_B", '. . . . . '); - -// Controls whether the '?' appears before or after UnknownWikiWords. -// The PhpWiki default is for the '?' to appear before. -//define('WIKIMARK_AFTER', true); - -// Template files (filenames are relative to script position) -// However, if a LANG is set, they we be searched for in a locale -// specific location first. -$templates = array("BROWSE" => "templates/browse.html", - "EDITPAGE" => "templates/editpage.html", - "MESSAGE" => "templates/message.html"); /* WIKI_PGSRC -- specifies the source for the initial page contents of -* the Wiki. The setting of WIKI_PGSRC only has effect when the wiki is -* accessed for the first time (or after clearing the database.) -* WIKI_PGSRC can either name a directory or a zip file. In either case -* WIKI_PGSRC is scanned for files -- one file per page. + * the Wiki. The setting of WIKI_PGSRC only has effect when the wiki is + * accessed for the first time (or after clearing the database.) + * WIKI_PGSRC can either name a directory or a zip file. In either case + * WIKI_PGSRC is scanned for files -- one file per page. */ define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior. //define('WIKI_PGSRC', 'wiki.zip'); // New style. //define('WIKI_PGSRC', '../../../Logs/Hamwiki/hamwiki-20010830.zip'); // New style. -// DEFAULT_WIKI_PGSRC is only used when the language is *not* the -// default (English) and when reading from a directory: in that case -// some English pages are inserted into the wiki as well -// DEFAULT_WIKI_PGSRC defines where the English pages reside FIXME: is -// this really needed? Can't we just copy these pages into the -// localized pgsrc? +/* + * DEFAULT_WIKI_PGSRC is only used when the language is *not* the + * default (English) and when reading from a directory: in that case + * some English pages are inserted into the wiki as well. + * DEFAULT_WIKI_PGSRC defines where the English pages reside. + */ +// FIXME: is this really needed? Can't we just copy these pages into +// the localized pgsrc? define('DEFAULT_WIKI_PGSRC', "pgsrc"); // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC. $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage"); @@ -439,21 +381,6 @@ $WikiNameRegexp = "(? "themes/$theme/${CSS_DEFAULT}.css")); +$Theme->setDefaultCSS('Hawaiian', 'Hawaiian.css'); +$Theme->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen'); // Logo image appears on every page and links to the HomePage. -$logo = "themes/$theme/PalmBeach.jpg"; +$Theme->addImageAlias('logo', 'PalmBeach.jpg'); +//$Theme->addImageAlias('signature', 'SubmersiblePiscesV.jpg'); //for Steve +$Theme->addImageAlias('signature', 'WaterFall.jpg'); //for Steve -// RSS logo icon (path relative to index.php) -// If this is left blank (or unset), the default "images/rss.png" -// will be used. -//$rssicon = "images/rss.png"; +/* + * Link Icons + */ +$Theme->setLinkIcon('interwiki'); +$Theme->setLinkIcon('*', 'flower.png'); -// Signature image which is shown after saving an edited page. If -// this is left blank, any signature defined in index.php will be -// used. If it is not defined by index.php or in here then the "Thank -// you for editing..." screen will be omitted. -//$SignatureImg = "themes/$theme/pictures/SubmersiblePiscesV.jpg"; #for Steve -$SignatureImg = "themes/$theme/WaterFall.jpg"; +// FIXME: do we need this? // If you want to see more than just the waterfall let a random // picture be chosen for the signature image: -include("themes/$theme/pictures/random.php"); +//include("themes/$theme/pictures/random.php"); // This defines separators used in RecentChanges and RecentEdits lists. // If undefined, defaults to '' (nothing) and '...' (three periods). @@ -57,16 +53,6 @@ $templates = array( ); */ -// If this theme defines any custom link icons, they will completely -// override any link icon settings defined in index.php. -$URL_LINK_ICONS = array( - /* 'http' => "themes/$theme/http.png", */ - /* 'https' => "themes/$theme/https.png", */ - /* 'ftp' => "themes/$theme/ftp.png", */ - /* 'mailto' => "themes/$theme/mailto.png", */ - 'interwiki' => "themes/$theme/interwiki.png", - '*' => "themes/$theme/flower.png" - ); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // (c-file-style: "gnu") diff --git a/themes/MacOSX/themeinfo.php b/themes/MacOSX/themeinfo.php index dc87ec681..b43619b2f 100644 --- a/themes/MacOSX/themeinfo.php +++ b/themes/MacOSX/themeinfo.php @@ -1,6 +1,6 @@ 'text/css'), + sprintf("\n", + $this->getImageURL('bggranular'))); + return $css; + } +} + +$Theme = new Theme_MacOSX('MacOSX'); // CSS file defines fonts, colors and background images for this // style. The companion '*-heavy.css' file isn't defined, it's just // expected to be in the same directory that the base style is in. -$CSS_DEFAULT = "MacOSX"; - -$CSS_URLS = array_merge($CSS_URLS, - array("$CSS_DEFAULT" => "themes/$theme/${CSS_DEFAULT}.css")); - -// Logo image appears on every page and links to the HomePage. -$logo = "themes/$theme/PhpWiki.png"; - -// RSS logo icon (path relative to index.php) -// If this is left blank (or unset), the default "images/rss.png" -// will be used. -//$rssicon = "images/rss.png"; -$rssicon = "themes/$theme/RSS.png"; - -// Signature image which is shown after saving an edited page. If -// this is left blank, any signature defined in index.php will be -// used. If it is not defined by index.php or in here then the "Thank -// you for editing..." screen will be omitted. -$SignatureImg = "themes/$theme/Signature.png"; // Papyrus 19pt +$Theme->setDefaultCSS("MacOSX", "MacOSX.css"); + +/* + * Link icons. + */ +$Theme->setLinkIcon('http'); +$Theme->setLinkIcon('https'); +$Theme->setLinkIcon('ftp'); +$Theme->setLinkIcon('mailto'); +$Theme->setLinkIcon('interwiki'); +$Theme->setLinkIcon('*', 'url'); // This defines separators used in RecentChanges and RecentEdits lists. // If undefined, defaults to '' (nothing) and '...' (three periods). @@ -94,28 +101,7 @@ define("RC_SEPARATOR_B", ' --'); // The PhpWiki default is for the '?' to appear before. define('WIKIMARK_AFTER', true); -// If this theme defines any templates, they will completely override -// whatever templates have been defined in index.php. - -$templates = array( - 'BROWSE' => "themes/$theme/templates/browse.html", - 'EDITPAGE' => "themes/$theme/templates/editpage.html", - 'MESSAGE' => "themes/$theme/templates/message.html" - ); - -// If this theme defines any custom link icons, they will completely -// override any link icon settings defined in index.php. - -// Currently only the mailto icon is overridden from the default theme -$URL_LINK_ICONS = array( - 'http' => "themes/default/images/http.png", - 'https' => "themes/default/images/https.png", - 'ftp' => "themes/default/images/ftp.png", - 'mailto' => "themes/MacOSX/mailto.png", - 'interwiki' => "themes/default/images/interwiki.png", - '*' => "themes/default/images/url.png" - ); - +/* $ToolbarImages = array( 'RecentChanges' => array( '1 day' => "themes/$theme/locale/en/toolbars/RecentChanges/1day.png", @@ -127,6 +113,7 @@ $ToolbarImages = array( '90 days' => "themes/$theme/locale/en/toolbars/RecentChanges/90days.png", '...' => "themes/$theme/locale/en/toolbars/RecentChanges/alltime.png") ); +*/ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // (c-file-style: "gnu") diff --git a/themes/WikiTrek/themeinfo.php b/themes/WikiTrek/themeinfo.php index e65dde941..158399f96 100644 --- a/themes/WikiTrek/themeinfo.php +++ b/themes/WikiTrek/themeinfo.php @@ -1,6 +1,6 @@ "themes/$theme/${CSS_DEFAULT}.css")); +$Theme->setDefaultCSS('WikiTrek', 'WikiTrek.css'); +$Theme->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen'); + -// Logo image appears on every page and links to the HomePage. -$logo = "themes/$theme/Ufp-logo.jpg"; +// The logo image +$Theme->addImageAlias('logo', 'Ufp-logo.jpg'); -// RSS logo icon (path relative to index.php) -// If this is left blank (or unset), the default "images/rss.png" -// will be used. -//$rssicon = "images/rss.png"; // Signature image which is shown after saving an edited page. If // this is left blank, any signature defined in index.php will be // used. If it is not defined by index.php or in here then the "Thank // you for editing..." screen will be omitted. -$SignatureImg = "themes/$theme/lights.gif"; +$Theme->addImageAlias('signature', 'lights.gif'); -// If this theme defines any templates, they will completely override -// whatever templates have been defined in index.php. -/* -$templates = array( - 'BROWSE' => "themes/$theme/templates/browse.html", - 'EDITPAGE' => "themes/$theme/templates/editpage.html", - 'MESSAGE' => "themes/$theme/templates/message.html" - ); -*/ - -// If this theme defines any custom link icons, it will completely -// override any link icon settings defined in index.php. -/* -$URL_LINK_ICONS = array( - 'http' => "themes/$theme/http.png", - 'https' => "themes/$theme/https.png", - 'ftp' => "themes/$theme/ftp.png", - 'mailto' => "themes/$theme/mailto.png", - 'interwiki' => "themes/$theme/interwiki.png", - '*' => "themes/$theme/zapg.png" - ); -*/ // The gettext() function does not work here because we are included // from 'index.php'. Normally themes shouldn't override date & time // settings because this will mess up any future user-specific // preferences for locale. -$datetimeformat = sprintf(("Stardate %s"),'%B.%e.%Y'); // may contain - // time of day -$dateformat = sprintf(("Stardate %s"),'%B.%e.%Y'); // must not contain - // time +$Theme->setDateTimeFormat("Stardate %B.%e.%Y"); // may contain time of day +$Theme->setDateFormat("Stardate %B.%e.%Y"); // must not contain time + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // (c-file-style: "gnu") diff --git a/themes/default/themeinfo.php b/themes/default/themeinfo.php index a7c22c84c..138b6dcba 100644 --- a/themes/default/themeinfo.php +++ b/themes/default/themeinfo.php @@ -1,72 +1,51 @@ "themes/$theme/${CSS_DEFAULT}.css")); -*/ +$Theme->setDefaultCSS('PhpWiki', 'phpwiki.css'); +$Theme->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen'); +$Theme->addAlternateCSS(_("Modern"), 'phpwiki-modern.css'); -// Logo image appears on every page and links to the HomePage. -$logo = "themes/$theme/images/logo.png"; -// RSS logo icon (path relative to index.php) -// If this is left blank (or unset), the default "images/rss.png" -// will be used. -$rssicon = "themes/$theme/images/RSS.png"; +/* + * You may adjust the formats used for formatting dates and times + * below. (These examples give the default formats.) + * Formats are given as format strings to PHP strftime() function See + * http://www.php.net/manual/en/function.strftime.php for details. + */ +//$Theme->setDateTimeFormat("%B %e, %Y"); // may contain time of day +//$Theme->setDateFormat("%B %e, %Y"); // must not contain time -// Signature image which is shown after saving an edited page. If -// this is left blank, any signature defined in index.php will be -// used. If it is not defined by index.php or in here then the "Thank -// you for editing..." screen will be omitted. -$SignatureImg = "themes/$theme/images/signature.png"; +/* + * Link icons. + */ +$Theme->setLinkIcon('http'); +$Theme->setLinkIcon('https'); +$Theme->setLinkIcon('ftp'); +$Theme->setLinkIcon('mailto'); +$Theme->setLinkIcon('interwiki'); +$Theme->setLinkIcon('*', 'url'); // This defines separators used in RecentChanges and RecentEdits lists. // If undefined, defaults to '' (nothing) and '...' (three periods). -//define("RC_SEPARATOR_A", ' . . . '); -//define("RC_SEPARATOR_B", ' --'); +//define("RC_SEPARATOR_A", '. . . '); +//define("RC_SEPARATOR_B", '. . . . . '); // Controls whether the '?' appears before or after UnknownWikiWords. // The PhpWiki default is for the '?' to appear before. //define('WIKIMARK_AFTER', true); -// If this theme defines any templates, they will completely override -// whatever templates have been defined in index.php. -/* -$templates = array( - 'BROWSE' => "themes/$theme/templates/browse.html", - 'EDITPAGE' => "themes/$theme/templates/editpage.html", - 'MESSAGE' => "themes/$theme/templates/message.html" - ); -*/ - -// If this theme defines any custom link icons, they will completely -// override any link icon settings defined in index.php. -/* -$URL_LINK_ICONS = array( - 'http' => "themes/$theme/images/http.png", - 'https' => "themes/$theme/images/https.png", - 'ftp' => "themes/$theme/images/ftp.png", - 'mailto' => "themes/$theme/images/mailto.png", - 'interwiki' => "themes/$theme/images/interwiki.png", - '*' => "themes/$theme/images/url.png" - ); -*/ - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // (c-file-style: "gnu") // Local Variables: -- 2.45.0