2 rcs_id('$Id: themeinfo.php,v 1.4 2004-04-08 01:22:54 rurban Exp $');
5 require_once('lib/Theme.php');
7 $Theme = new Theme('wikilens');
9 // CSS file defines fonts, colors and background images for this
10 // style. The companion '*-heavy.css' file isn't defined, it's just
11 // expected to be in the same directory that the base style is in.
13 // This should result in phpwiki-printer.css being used when
14 // printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
15 $Theme->setDefaultCSS('PhpWiki',
16 array('' => 'phpwiki.css',
17 'print' => 'phpwiki-printer.css'));
19 // This allows one to manually select "Printer" style (when browsing page)
20 // to see what the printer style looks like.
21 $Theme->addAlternateCSS(_("Printer"), 'phpwiki-printer.css', 'print, screen');
22 $Theme->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css');
23 $Theme->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
26 * The logo image appears on every page and links to the HomePage.
28 $Theme->addImageAlias('logo', WIKI_NAME . 'Logo.png');
31 * The Signature image is shown after saving an edited page. If this
32 * is set to false then the "Thank you for editing..." screen will
36 $Theme->addImageAlias('signature', WIKI_NAME . "Signature.png");
37 // Uncomment this next line to disable the signature.
38 $Theme->addImageAlias('signature', false);
43 //$Theme->setLinkIcon('http');
44 $Theme->setLinkIcon('https');
45 $Theme->setLinkIcon('ftp');
46 $Theme->setLinkIcon('mailto');
47 //$Theme->setLinkIcon('interwiki');
48 $Theme->setLinkIcon('wikiuser');
49 //$Theme->setLinkIcon('*', 'url');
51 //$Theme->setButtonSeparator("\n | ");
54 * WikiWords can automatically be split by inserting spaces between
55 * the words. The default is to leave WordsSmashedTogetherLikeSo.
57 //$Theme->setAutosplitWikiWords(false);
60 * Layout improvement with dangling links for mostly closed wiki's:
61 * If false, only users with edit permissions will be presented the
62 * special wikiunknown class with "?" and Tooltip.
63 * If true (default), any user will see the ?, but will be presented
64 * the PrintLoginForm on a click.
66 $Theme->setAnonEditUnknownLinks(false);
69 * You may adjust the formats used for formatting dates and times
70 * below. (These examples give the default formats.)
71 * Formats are given as format strings to PHP strftime() function See
72 * http://www.php.net/manual/en/function.strftime.php for details.
73 * Do not include the server's zone (%Z), times are converted to the
76 $Theme->setDateFormat("%B %d, %Y");
77 $Theme->setTimeFormat("%H:%M");
80 * To suppress times in the "Last edited on" messages, give a
81 * give a second argument of false:
83 //$Theme->setDateFormat("%B %d, %Y", false);
86 * Custom UserPreferences:
87 * A list of name => _UserPreference class pairs.
88 * Rationale: Certain themes should be able to extend the predefined list
89 * of preferences. Display/editing is done in the theme specific userprefs.tmpl
90 * but storage/sanification/update/... must be extended to the Get/SetPreferences methods.
93 class _UserPreference_recengine // recommendation engine method
94 extends _UserPreference
96 var $valid_values = array('php','mysuggest','mymovielens','mycluto');
97 var $default_value = 'php';
99 function sanify ($value) {
100 if (!in_array($value,$this->valid_values)) return $this->default_value;
105 class _UserPreference_recalgo // recommendation engine algorithm
106 extends _UserPreference
108 var $valid_values = array
110 'itemCos', // Item-based Top-N recommendation algorithm with cosine-based similarity function
111 'itemProb', // Item-based Top-N recommendation algorithm with probability-based similarity function.
112 // This algorithms tends to outperform the rest.
113 'userCos', // User-based Top-N recommendation algorithm with cosine-based similarity function.
114 'bayes'); // Naïve Bayesian Classifier
115 var $default_value = 'itemProb';
117 function sanify ($value) {
118 if (!in_array($value,$this->valid_values)) return $this->default_value;
123 class _UserPreference_recnnbr // recommendation engine key clustering, neighborhood size
124 extends _UserPreference_numeric{}
126 $Theme->customUserPreferences(array(
127 'recengine' => new _UserPreference_recengine('php'),
128 'recalgo' => new _UserPreference_recalgo('itemProb'),
129 //recnnbr: typically 15-30 for item-based, 40-80 for user-based algos
130 'recnnbr' => new _UserPreference_recnnbr(10,14,80),
133 require_once('lib/PageList.php');
136 * Custom PageList classes
137 * Rationale: Certain themes should be able to extend the predefined list
138 * of pagelist types. E.g. certain plugins, like MostPopular might use
139 * info=pagename,hits,rating
140 * which displays the rating column whenever the wikilens theme is active.
141 * Similarly as in certain plugins, like WikiAdminRename or _WikiTranslation
143 class _PageList_Column_rating extends _PageList_Column {
144 function _getValue ($page_handle, &$revision_handle) {
146 $loader = new WikiPluginLoader();
147 $args = "pagename=".$page_handle->_pagename;
149 $args .= " imgPrefix=".$prefix++;
150 return $loader->expandPi('<'."?plugin RateIt $args ?".'>',
151 $GLOBALS['request'], $page_handle);
155 // register custom PageList type
156 $Theme->addPageListColumn(array('rating' =>
157 new _PageList_Column_rating('rating', _("Rate"))));
160 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
161 // (c-file-style: "gnu")
166 // c-hanging-comment-ender-p: nil
167 // indent-tabs-mode: nil