]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/wikilens/themeinfo.php
fixed PageChange Notification
[SourceForge/phpwiki.git] / themes / wikilens / themeinfo.php
1 <?php
2 rcs_id('$Id: themeinfo.php,v 1.4 2004-04-08 01:22:54 rurban Exp $');
3 /**
4  */
5 require_once('lib/Theme.php');
6
7 $Theme = new Theme('wikilens');
8
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.
12
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'));
18
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');
24
25 /**
26  * The logo image appears on every page and links to the HomePage.
27  */
28 $Theme->addImageAlias('logo', WIKI_NAME . 'Logo.png');
29
30 /**
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
33  * be omitted.
34  */
35
36 $Theme->addImageAlias('signature', WIKI_NAME . "Signature.png");
37 // Uncomment this next line to disable the signature.
38 $Theme->addImageAlias('signature', false);
39
40 /*
41  * Link icons.
42  */
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');
50
51 //$Theme->setButtonSeparator("\n | ");
52
53 /**
54  * WikiWords can automatically be split by inserting spaces between
55  * the words. The default is to leave WordsSmashedTogetherLikeSo.
56  */
57 //$Theme->setAutosplitWikiWords(false);
58
59 /**
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.
65  */
66 $Theme->setAnonEditUnknownLinks(false);
67
68 /*
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
74  * user's time zone.
75  */
76 $Theme->setDateFormat("%B %d, %Y");
77 $Theme->setTimeFormat("%H:%M");
78
79 /*
80  * To suppress times in the "Last edited on" messages, give a
81  * give a second argument of false:
82  */
83 //$Theme->setDateFormat("%B %d, %Y", false); 
84
85 /**
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.
91  */
92
93 class _UserPreference_recengine // recommendation engine method
94 extends _UserPreference
95 {
96     var $valid_values = array('php','mysuggest','mymovielens','mycluto');
97     var $default_value = 'php';
98
99     function sanify ($value) {
100         if (!in_array($value,$this->valid_values)) return $this->default_value;
101         else return $value;
102     }
103 }
104
105 class _UserPreference_recalgo // recommendation engine algorithm
106 extends _UserPreference
107 {
108     var $valid_values = array
109         (
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';
116
117     function sanify ($value) {
118         if (!in_array($value,$this->valid_values)) return $this->default_value;
119         else return $value;
120     }
121 }
122
123 class _UserPreference_recnnbr // recommendation engine key clustering, neighborhood size
124 extends _UserPreference_numeric{}
125
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),
131                                    ));
132
133 require_once('lib/PageList.php');
134
135 /**
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
142  */
143 class _PageList_Column_rating extends _PageList_Column {
144     function _getValue ($page_handle, &$revision_handle) {
145         static $prefix = 0;
146         $loader = new WikiPluginLoader();
147         $args = "pagename=".$page_handle->_pagename;
148         $args .= " small=1";
149         $args .= " imgPrefix=".$prefix++;
150         return $loader->expandPi('<'."?plugin RateIt $args ?".'>',
151                                  $GLOBALS['request'], $page_handle);
152     }
153 };
154
155 // register custom PageList type
156 $Theme->addPageListColumn(array('rating' => 
157                                 new _PageList_Column_rating('rating', _("Rate"))));
158
159
160 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
161 // (c-file-style: "gnu")
162 // Local Variables:
163 // mode: php
164 // tab-width: 8
165 // c-basic-offset: 4
166 // c-hanging-comment-ender-p: nil
167 // indent-tabs-mode: nil
168 // End:   
169 ?>