Merge lp:~quam-plures-core/quam-plures/qp5_html5_templates into lp:quam-plures

Proposed by EdB
Status: Merged
Merged at revision: 7659
Proposed branch: lp:~quam-plures-core/quam-plures/qp5_html5_templates
Merge into: lp:quam-plures
Diff against target: 36764 lines (+12324/-15134)
238 files modified
blog2.php (+21/-16)
blog3.php (+21/-16)
blog4.php (+21/-16)
license.txt (+652/-276)
multiblogs.php (+21/-19)
qp_config/license.txt (+0/-293)
qp_inc/_application.php (+1/-1)
qp_inc/_core/__core.init.php (+2/-1)
qp_inc/_core/_param.funcs.php (+343/-267)
qp_inc/_core/_template.funcs.php (+22/-8)
qp_inc/_core/model/__core.install.php (+4/-2)
qp_inc/collections/coll_settings.ctrl.php (+2/-2)
qp_inc/collections/collections.ctrl.php (+1/-1)
qp_inc/collections/model/_blog.class.php (+12/-0)
qp_inc/comments/views/_comment.form.php (+193/-217)
qp_inc/items/views/_item_expert.form.php (+125/-142)
qp_inc/license.txt (+0/-293)
qp_inc/plugins/_plugin.class.php (+8/-5)
qp_inc/plugins/_plugin.funcs.php (+1/-1)
qp_inc/plugins/model/_plugins.class.php (+291/-512)
qp_inc/templates/_template.funcs.php (+675/-661)
qp_inc/templates/model/_template.class.php (+692/-544)
qp_inc/templates/model/_templatecache.class.php (+41/-70)
qp_inc/templates/templates.ctrl.php (+127/-153)
qp_inc/templates/views/_coll_sel_template.view.php (+0/-39)
qp_inc/templates/views/_coll_template.view.php (+0/-58)
qp_inc/templates/views/_coll_template_settings.form.php (+0/-101)
qp_inc/templates/views/_template.form.php (+58/-71)
qp_inc/templates/views/_template_list.view.php (+0/-89)
qp_inc/templates/views/_template_list_available.view.php (+50/-36)
qp_inc/templates/views/_template_list_installed.view.php (+85/-0)
qp_inc/templates/views/_template_select.view.php (+46/-0)
qp_inc/templates/views/_template_select_create.view.php (+37/-0)
qp_inc/templates/views/_template_settings.form.php (+71/-0)
qp_inc/users/model/_user.class.php (+10/-14)
qp_inc/xhtml_validator/_html5_dtd.inc.php (+387/-0)
qp_inc/xhtml_validator/_xhtml_dtd.inc.php (+116/-296)
qp_inc/xhtml_validator/_xhtml_validator.class.php (+13/-5)
qp_install/_functions_dbupgrade.php (+33/-0)
qp_install/license.txt (+0/-293)
qp_rsc/css/basic.css (+244/-587)
qp_rsc/css/smoothness/jquery-ui-1.8.16.custom.css (+363/-542)
qp_rsc/css/toolbar_debug.css (+66/-0)
qp_rsc/js/html5shiv.js (+4/-0)
qp_rsc/license.txt (+0/-293)
qp_srvc/getmail.php (+109/-137)
qp_srvc/license.txt (+0/-293)
qp_templates/_403_referer_spam.main.php (+8/-5)
qp_templates/_404_blog_not_found.main.php (+8/-7)
qp_templates/_404_not_found.disp.php (+13/-20)
qp_templates/_410_stats_gone.main.php (+10/-6)
qp_templates/_arcdir.disp.php (+7/-8)
qp_templates/_atom/_template.class.php (+12/-24)
qp_templates/_atom/comments.main.php (+14/-10)
qp_templates/_atom/index.main.php (+21/-22)
qp_templates/_body_footer.inc.php (+6/-12)
qp_templates/_catdir.disp.php (+7/-8)
qp_templates/_comments.disp.php (+12/-12)
qp_templates/_contributors.php (+0/-9)
qp_templates/_credits.disp.php (+13/-15)
qp_templates/_html5_header.inc.php (+84/-0)
qp_templates/_html_header.inc.php (+0/-82)
qp_templates/_item_block.inc.php (+6/-11)
qp_templates/_item_comment.inc.php (+11/-16)
qp_templates/_item_comment_form.inc.php (+66/-66)
qp_templates/_item_content.inc.php (+26/-33)
qp_templates/_item_feedback.inc.php (+19/-21)
qp_templates/_mediaidx.disp.php (+9/-10)
qp_templates/_msgform.disp.php (+26/-27)
qp_templates/_profile.disp.php (+18/-37)
qp_templates/_rdf/_template.class.php (+12/-24)
qp_templates/_rdf/comments.main.php (+17/-11)
qp_templates/_rdf/index.main.php (+23/-34)
qp_templates/_rss/_template.class.php (+12/-24)
qp_templates/_rss/comments.main.php (+16/-11)
qp_templates/_rss/index.main.php (+18/-18)
qp_templates/_rss2/_template.class.php (+12/-24)
qp_templates/_rss2/comments.main.php (+14/-9)
qp_templates/_rss2/index.main.php (+30/-40)
qp_templates/_sitemap/_template.class.php (+13/-25)
qp_templates/_sitemap/index.main.php (+10/-9)
qp_templates/_subs.disp.php (+24/-33)
qp_templates/_toolbar.inc.php (+14/-37)
qp_templates/_user.disp.php (+18/-31)
qp_templates/_xhtml_header.inc.php (+84/-0)
qp_templates/asevo/_item_block.inc.php (+5/-11)
qp_templates/asevo/_template.class.php (+20/-31)
qp_templates/asevo/index.main.php (+7/-11)
qp_templates/asevo/print.css (+5/-18)
qp_templates/asevo/style.css (+130/-171)
qp_templates/basic/_credits.disp.php (+0/-134)
qp_templates/basic/_item_block.inc.php (+0/-108)
qp_templates/basic/_item_feedback.inc.php (+0/-142)
qp_templates/basic/_template.class.php (+0/-134)
qp_templates/basic/index.main.php (+0/-143)
qp_templates/basic/po/messages.pot (+0/-122)
qp_templates/basic/print.css (+0/-21)
qp_templates/basic/style.css (+0/-122)
qp_templates/basic/style_borders.css (+0/-132)
qp_templates/basic/style_colors.css (+0/-132)
qp_templates/basic/style_everything.css (+0/-133)
qp_templates/basic/style_outlines.css (+0/-10)
qp_templates/custom/_item_block.inc.php (+0/-126)
qp_templates/custom/_template.class.php (+0/-133)
qp_templates/custom/index.main.php (+0/-175)
qp_templates/custom/po/messages.pot (+0/-86)
qp_templates/custom/print.css (+0/-21)
qp_templates/custom/style.css (+0/-346)
qp_templates/darkdragon/_item_block.inc.php (+91/-0)
qp_templates/darkdragon/_item_block_featured.inc.php (+62/-0)
qp_templates/darkdragon/_item_content.inc.php (+163/-0)
qp_templates/darkdragon/_template.class.php (+122/-0)
qp_templates/darkdragon/font/CloisterBlack-webfont.svg (+139/-0)
qp_templates/darkdragon/font/DieterSteffmannFontLicense.txt (+1/-0)
qp_templates/darkdragon/index.main.php (+180/-0)
qp_templates/darkdragon/po/messages.pot (+85/-0)
qp_templates/darkdragon/print.css (+17/-0)
qp_templates/darkdragon/style.css (+77/-0)
qp_templates/evocamp/_body_footer.inc.php (+7/-11)
qp_templates/evocamp/_body_header.inc.php (+7/-11)
qp_templates/evocamp/_item_block.inc.php (+7/-11)
qp_templates/evocamp/_sidebar.inc.php (+7/-11)
qp_templates/evocamp/_sidebar_2.inc.php (+7/-11)
qp_templates/evocamp/_template.class.php (+23/-32)
qp_templates/evocamp/index.main.php (+8/-11)
qp_templates/evocamp/page.main.php (+8/-12)
qp_templates/evocamp/posts.main.php (+8/-12)
qp_templates/evocamp/print.css (+5/-18)
qp_templates/evocamp/single.main.php (+8/-12)
qp_templates/evocamp/style.css (+219/-330)
qp_templates/evopress/_body_footer.inc.php (+6/-11)
qp_templates/evopress/_body_header.inc.php (+6/-11)
qp_templates/evopress/_item_block.inc.php (+6/-11)
qp_templates/evopress/_sidebar.inc.php (+6/-11)
qp_templates/evopress/_template.class.php (+21/-31)
qp_templates/evopress/index.main.php (+7/-11)
qp_templates/evopress/page.main.php (+7/-12)
qp_templates/evopress/posts.main.php (+7/-12)
qp_templates/evopress/print.css (+5/-18)
qp_templates/evopress/single.main.php (+7/-12)
qp_templates/evopress/style.css (+224/-369)
qp_templates/glossyblue/_body_footer.inc.php (+7/-11)
qp_templates/glossyblue/_body_header.inc.php (+7/-11)
qp_templates/glossyblue/_item_block.inc.php (+7/-11)
qp_templates/glossyblue/_item_feedback.inc.php (+31/-39)
qp_templates/glossyblue/_sidebar.inc.php (+7/-11)
qp_templates/glossyblue/_template.class.php (+23/-32)
qp_templates/glossyblue/index.main.php (+8/-11)
qp_templates/glossyblue/page.main.php (+8/-12)
qp_templates/glossyblue/posts.main.php (+8/-12)
qp_templates/glossyblue/print.css (+5/-18)
qp_templates/glossyblue/single.main.php (+8/-12)
qp_templates/glossyblue/style.css (+335/-371)
qp_templates/intense/_body_footer.inc.php (+5/-11)
qp_templates/intense/_body_header.inc.php (+6/-12)
qp_templates/intense/_item_block.inc.php (+5/-11)
qp_templates/intense/_sidebar.inc.php (+5/-11)
qp_templates/intense/_template.class.php (+27/-40)
qp_templates/intense/index.main.php (+6/-11)
qp_templates/intense/page.main.php (+6/-12)
qp_templates/intense/posts.main.php (+6/-12)
qp_templates/intense/print.css (+5/-18)
qp_templates/intense/single.main.php (+6/-12)
qp_templates/intense/style.css (+273/-323)
qp_templates/license.txt (+0/-298)
qp_templates/miami_blue/_item_block.inc.php (+6/-11)
qp_templates/miami_blue/_template.class.php (+21/-31)
qp_templates/miami_blue/index.main.php (+8/-11)
qp_templates/miami_blue/print.css (+5/-18)
qp_templates/miami_blue/style.css (+198/-247)
qp_templates/natural_pink/_item_block.inc.php (+6/-11)
qp_templates/natural_pink/_template.class.php (+21/-31)
qp_templates/natural_pink/index.main.php (+8/-11)
qp_templates/natural_pink/print.css (+5/-18)
qp_templates/natural_pink/style.css (+164/-222)
qp_templates/nifty_colors/_featured_item.inc.php (+105/-0)
qp_templates/nifty_colors/_template.class.php (+103/-0)
qp_templates/nifty_colors/_xhtml_header.inc.php (+85/-0)
qp_templates/nifty_colors/index.main.php (+295/-0)
qp_templates/nifty_colors/po/messages.pot (+101/-0)
qp_templates/nifty_colors/print.css (+8/-0)
qp_templates/nifty_colors/rsc/A0C22E.css (+70/-0)
qp_templates/nifty_colors/rsc/A477A4.css (+70/-0)
qp_templates/nifty_colors/rsc/BD4D55.css (+70/-0)
qp_templates/nifty_colors/rsc/FF9933.css (+70/-0)
qp_templates/nifty_colors/rsc/left.css (+12/-0)
qp_templates/nifty_colors/rsc/nifty_corners.css (+22/-0)
qp_templates/nifty_colors/rsc/nifty_corners.js (+178/-0)
qp_templates/nifty_colors/rsc/nifty_print.css (+26/-0)
qp_templates/nifty_colors/rsc/right.css (+12/-0)
qp_templates/nifty_colors/style.css (+246/-0)
qp_templates/nifty_colors/tinymce.css (+38/-0)
qp_templates/nifty_corners/_item_block.inc.php (+6/-11)
qp_templates/nifty_corners/_template.class.php (+21/-31)
qp_templates/nifty_corners/index.main.php (+8/-11)
qp_templates/nifty_corners/print.css (+5/-18)
qp_templates/nifty_corners/rsc/nifty_corners.css (+1/-4)
qp_templates/nifty_corners/rsc/nifty_print.css (+2/-4)
qp_templates/nifty_corners/style.css (+172/-239)
qp_templates/photoblog/_html_header.inc.php (+0/-88)
qp_templates/photoblog/_item_block.inc.php (+6/-11)
qp_templates/photoblog/_template.class.php (+70/-79)
qp_templates/photoblog/_xhtml_header.inc.php (+92/-0)
qp_templates/photoblog/feedback_popup.main.php (+8/-6)
qp_templates/photoblog/index.main.php (+2/-1)
qp_templates/photoblog/print.css (+5/-18)
qp_templates/photoblog/style.css (+103/-124)
qp_templates/pixelgreen/_item_block.inc.php (+7/-11)
qp_templates/pixelgreen/_template.class.php (+22/-31)
qp_templates/pixelgreen/index.main.php (+18/-13)
qp_templates/pixelgreen/print.css (+5/-18)
qp_templates/pixelgreen/style.css (+230/-233)
qp_templates/pluralism/_body_footer.inc.php (+6/-11)
qp_templates/pluralism/_body_header.inc.php (+6/-11)
qp_templates/pluralism/_item_block.inc.php (+6/-11)
qp_templates/pluralism/_sidebar.inc.php (+6/-11)
qp_templates/pluralism/_template.class.php (+21/-31)
qp_templates/pluralism/index.main.php (+7/-11)
qp_templates/pluralism/page.main.php (+7/-12)
qp_templates/pluralism/posts.main.php (+9/-13)
qp_templates/pluralism/print.css (+5/-18)
qp_templates/pluralism/single.main.php (+7/-12)
qp_templates/pluralism/style.css (+149/-232)
qp_templates/terrafirma/_item_block.inc.php (+6/-11)
qp_templates/terrafirma/_item_comment.inc.php (+14/-17)
qp_templates/terrafirma/_template.class.php (+21/-31)
qp_templates/terrafirma/index.main.php (+16/-12)
qp_templates/terrafirma/print.css (+5/-18)
qp_templates/terrafirma/style.css (+293/-439)
qp_templates/vastitude/_item_block.inc.php (+6/-11)
qp_templates/vastitude/_template.class.php (+21/-31)
qp_templates/vastitude/index.main.php (+17/-15)
qp_templates/vastitude/print.css (+5/-18)
qp_templates/vastitude/style.css (+628/-229)
qp_view_admin/_html_header.inc.php (+89/-104)
qp_view_admin/license.txt (+0/-298)
stubfile.template.php (+16/-11)
summary.php (+17/-18)
To merge this branch: bzr merge lp:~quam-plures-core/quam-plures/qp5_html5_templates
Reviewer Review Type Date Requested Status
Quam Plures Core Team Pending
Review via email: mp+152514@code.launchpad.net

Description of the change

dunno what happened last time, but this time I can see the changes here on LP so yay merge-a-thon!

Again there is a css issue when you switch to one of the html5 templates but so what it'll get fixed fairly soon :)

http://forums.quamplures.net/viewtopic.php?f=6&t=1892

To post a comment you must log in.
7660. By EdB

fixing the only flaw I found :)

7661. By EdB

needed screenshots for the new templates, fixed a css issue when using an html5 template

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'blog2.php'
2--- blog2.php 2010-12-31 12:12:03 +0000
3+++ blog2.php 2013-03-11 07:27:21 +0000
4@@ -1,37 +1,42 @@
5 <?php
6 /**
7- * Stub File
8- *
9- * Quam Plures - {@link http://quamplures.net/}
10- * Released under GNU GPL License - {@link http://quamplures.net/license.html}
11- * @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
12- * @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
13+ * Stub File Template
14+ *
15+ * This file is used to create a new stub file when a blog is created. If the value of $blog
16+ * is not NNN then this file was created; only stubfile.template.php has that value of $blog.
17+ *
18+ * @author {@link http://wonderwinds.com/ Ed Bennett}
19+ * @copyright (c) 2010 by {@link http://quamplures.net/ the Quam Plures project}
20+ * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
21 * @package templates
22- * @subpackage stubfiles
23 */
24
25-# select which blog
26+// select which blog
27 $blog = 2;
28
29-# force a template?
30-# $template = 'custom';
31-
32-# retricts posts to published, hides drafts.
33+// retricts posts to published, hides drafts
34 $show_statuses = array();
35
36-# ignore before, unix timestamp or 'now'
37+// ignore before, unix timestamp or 'now'
38 $timestamp_min = '';
39
40-# ignore after, unix timestamp or 'now'
41+// ignore after, unix timestamp or 'now'
42 $timestamp_max = 'now';
43
44-# change order?
45+// force a template?
46+# $template = 'custom';
47+
48+// change order?
49 # $order = 'ASC';
50
51 /**
52- * That's it, now let Quam Plures do the rest! :)
53+ * Load the configuration minimum
54 */
55 require_once dirname(__FILE__).'/qp_config/_config.php';
56
57+/**
58+ * Main initialization, with the identified $blog
59+ */
60 require $inc_path.'_blog_main.inc.php';
61+
62 ?>
63
64=== modified file 'blog3.php'
65--- blog3.php 2010-12-31 12:12:03 +0000
66+++ blog3.php 2013-03-11 07:27:21 +0000
67@@ -1,37 +1,42 @@
68 <?php
69 /**
70- * Stub File
71- *
72- * Quam Plures - {@link http://quamplures.net/}
73- * Released under GNU GPL License - {@link http://quamplures.net/license.html}
74- * @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
75- * @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
76+ * Stub File Template
77+ *
78+ * This file is used to create a new stub file when a blog is created. If the value of $blog
79+ * is not NNN then this file was created; only stubfile.template.php has that value of $blog.
80+ *
81+ * @author {@link http://wonderwinds.com/ Ed Bennett}
82+ * @copyright (c) 2010 by {@link http://quamplures.net/ the Quam Plures project}
83+ * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
84 * @package templates
85- * @subpackage stubfiles
86 */
87
88-# select which blog
89+// select which blog
90 $blog = 3;
91
92-# force a template?
93-# $template = 'custom';
94-
95-# retricts posts to published, hides drafts.
96+// retricts posts to published, hides drafts
97 $show_statuses = array();
98
99-# ignore before, unix timestamp or 'now'
100+// ignore before, unix timestamp or 'now'
101 $timestamp_min = '';
102
103-# ignore after, unix timestamp or 'now'
104+// ignore after, unix timestamp or 'now'
105 $timestamp_max = 'now';
106
107-# change order?
108+// force a template?
109+# $template = 'custom';
110+
111+// change order?
112 # $order = 'ASC';
113
114 /**
115- * That's it, now let Quam Plures do the rest! :)
116+ * Load the configuration minimum
117 */
118 require_once dirname(__FILE__).'/qp_config/_config.php';
119
120+/**
121+ * Main initialization, with the identified $blog
122+ */
123 require $inc_path.'_blog_main.inc.php';
124+
125 ?>
126
127=== modified file 'blog4.php'
128--- blog4.php 2010-12-31 12:12:03 +0000
129+++ blog4.php 2013-03-11 07:27:21 +0000
130@@ -1,37 +1,42 @@
131 <?php
132 /**
133- * Stub File
134- *
135- * Quam Plures - {@link http://quamplures.net/}
136- * Released under GNU GPL License - {@link http://quamplures.net/license.html}
137- * @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
138- * @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
139+ * Stub File Template
140+ *
141+ * This file is used to create a new stub file when a blog is created. If the value of $blog
142+ * is not NNN then this file was created; only stubfile.template.php has that value of $blog.
143+ *
144+ * @author {@link http://wonderwinds.com/ Ed Bennett}
145+ * @copyright (c) 2010 by {@link http://quamplures.net/ the Quam Plures project}
146+ * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
147 * @package templates
148- * @subpackage stubfiles
149 */
150
151-# select which blog
152+// select which blog
153 $blog = 4;
154
155-# force a template?
156-# $template = 'custom';
157-
158-# retricts posts to published, hides drafts.
159+// retricts posts to published, hides drafts
160 $show_statuses = array();
161
162-# ignore before, unix timestamp or 'now'
163+// ignore before, unix timestamp or 'now'
164 $timestamp_min = '';
165
166-# ignore after, unix timestamp or 'now'
167+// ignore after, unix timestamp or 'now'
168 $timestamp_max = 'now';
169
170-# change order?
171+// force a template?
172+# $template = 'custom';
173+
174+// change order?
175 # $order = 'ASC';
176
177 /**
178- * That's it, now let Quam Plures do the rest! :)
179+ * Load the configuration minimum
180 */
181 require_once dirname(__FILE__).'/qp_config/_config.php';
182
183+/**
184+ * Main initialization, with the identified $blog
185+ */
186 require $inc_path.'_blog_main.inc.php';
187+
188 ?>
189
190=== modified file 'license.txt'
191--- license.txt 2010-01-04 17:32:41 +0000
192+++ license.txt 2013-03-11 07:27:21 +0000
193@@ -1,298 +1,674 @@
194- GNU GENERAL PUBLIC LICENSE
195- Version 2, June 1991
196+ GNU GENERAL PUBLIC LICENSE
197+ Version 3, 29 June 2007
198
199- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
200- 675 Mass Ave, Cambridge, MA 02139, USA
201+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
202 Everyone is permitted to copy and distribute verbatim copies
203 of this license document, but changing it is not allowed.
204
205- Preamble
206-
207- The licenses for most software are designed to take away your
208-freedom to share and change it. By contrast, the GNU General Public
209-License is intended to guarantee your freedom to share and change free
210-software--to make sure the software is free for all its users. This
211-General Public License applies to most of the Free Software
212-Foundation's software and to any other program whose authors commit to
213-using it. (Some other Free Software Foundation software is covered by
214-the GNU Library General Public License instead.) You can apply it to
215+ Preamble
216+
217+ The GNU General Public License is a free, copyleft license for
218+software and other kinds of works.
219+
220+ The licenses for most software and other practical works are designed
221+to take away your freedom to share and change the works. By contrast,
222+the GNU General Public License is intended to guarantee your freedom to
223+share and change all versions of a program--to make sure it remains free
224+software for all its users. We, the Free Software Foundation, use the
225+GNU General Public License for most of our software; it applies also to
226+any other work released this way by its authors. You can apply it to
227 your programs, too.
228
229 When we speak of free software, we are referring to freedom, not
230 price. Our General Public Licenses are designed to make sure that you
231 have the freedom to distribute copies of free software (and charge for
232-this service if you wish), that you receive source code or can get it
233-if you want it, that you can change the software or use pieces of it
234-in new free programs; and that you know you can do these things.
235+them if you wish), that you receive source code or can get it if you
236+want it, that you can change the software or use pieces of it in new
237+free programs, and that you know you can do these things.
238
239- To protect your rights, we need to make restrictions that forbid
240-anyone to deny you these rights or to ask you to surrender the rights.
241-These restrictions translate to certain responsibilities for you if you
242-distribute copies of the software, or if you modify it.
243+ To protect your rights, we need to prevent others from denying you
244+these rights or asking you to surrender the rights. Therefore, you have
245+certain responsibilities if you distribute copies of the software, or if
246+you modify it: responsibilities to respect the freedom of others.
247
248 For example, if you distribute copies of such a program, whether
249-gratis or for a fee, you must give the recipients all the rights that
250-you have. You must make sure that they, too, receive or can get the
251-source code. And you must show them these terms so they know their
252-rights.
253-
254- We protect your rights with two steps: (1) copyright the software, and
255-(2) offer you this license which gives you legal permission to copy,
256-distribute and/or modify the software.
257-
258- Also, for each author's protection and ours, we want to make certain
259-that everyone understands that there is no warranty for this free
260-software. If the software is modified by someone else and passed on, we
261-want its recipients to know that what they have is not the original, so
262-that any problems introduced by others will not reflect on the original
263-authors' reputations.
264-
265- Finally, any free program is threatened constantly by software
266-patents. We wish to avoid the danger that redistributors of a free
267-program will individually obtain patent licenses, in effect making the
268-program proprietary. To prevent this, we have made it clear that any
269-patent must be licensed for everyone's free use or not licensed at all.
270+gratis or for a fee, you must pass on to the recipients the same
271+freedoms that you received. You must make sure that they, too, receive
272+or can get the source code. And you must show them these terms so they
273+know their rights.
274+
275+ Developers that use the GNU GPL protect your rights with two steps:
276+(1) assert copyright on the software, and (2) offer you this License
277+giving you legal permission to copy, distribute and/or modify it.
278+
279+ For the developers' and authors' protection, the GPL clearly explains
280+that there is no warranty for this free software. For both users' and
281+authors' sake, the GPL requires that modified versions be marked as
282+changed, so that their problems will not be attributed erroneously to
283+authors of previous versions.
284+
285+ Some devices are designed to deny users access to install or run
286+modified versions of the software inside them, although the manufacturer
287+can do so. This is fundamentally incompatible with the aim of
288+protecting users' freedom to change the software. The systematic
289+pattern of such abuse occurs in the area of products for individuals to
290+use, which is precisely where it is most unacceptable. Therefore, we
291+have designed this version of the GPL to prohibit the practice for those
292+products. If such problems arise substantially in other domains, we
293+stand ready to extend this provision to those domains in future versions
294+of the GPL, as needed to protect the freedom of users.
295+
296+ Finally, every program is threatened constantly by software patents.
297+States should not allow patents to restrict development and use of
298+software on general-purpose computers, but in those that do, we wish to
299+avoid the special danger that patents applied to a free program could
300+make it effectively proprietary. To prevent this, the GPL assures that
301+patents cannot be used to render the program non-free.
302
303 The precise terms and conditions for copying, distribution and
304 modification follow.
305
306- GNU GENERAL PUBLIC LICENSE
307- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
308-
309- 0. This License applies to any program or other work which contains
310-a notice placed by the copyright holder saying it may be distributed
311-under the terms of this General Public License. The "Program", below,
312-refers to any such program or work, and a "work based on the Program"
313-means either the Program or any derivative work under copyright law:
314-that is to say, a work containing the Program or a portion of it,
315-either verbatim or with modifications and/or translated into another
316-language. (Hereinafter, translation is included without limitation in
317-the term "modification".) Each licensee is addressed as "you".
318-
319-Activities other than copying, distribution and modification are not
320-covered by this License; they are outside its scope. The act of
321-running the Program is not restricted, and the output from the Program
322-is covered only if its contents constitute a work based on the
323-Program (independent of having been made by running the Program).
324-Whether that is true depends on what the Program does.
325-
326- 1. You may copy and distribute verbatim copies of the Program's
327-source code as you receive it, in any medium, provided that you
328-conspicuously and appropriately publish on each copy an appropriate
329-copyright notice and disclaimer of warranty; keep intact all the
330-notices that refer to this License and to the absence of any warranty;
331-and give any other recipients of the Program a copy of this License
332-along with the Program.
333-
334-You may charge a fee for the physical act of transferring a copy, and
335-you may at your option offer warranty protection in exchange for a fee.
336-
337- 2. You may modify your copy or copies of the Program or any portion
338-of it, thus forming a work based on the Program, and copy and
339-distribute such modifications or work under the terms of Section 1
340-above, provided that you also meet all of these conditions:
341-
342- a) You must cause the modified files to carry prominent notices
343- stating that you changed the files and the date of any change.
344-
345- b) You must cause any work that you distribute or publish, that in
346- whole or in part contains or is derived from the Program or any
347- part thereof, to be licensed as a whole at no charge to all third
348- parties under the terms of this License.
349-
350- c) If the modified program normally reads commands interactively
351- when run, you must cause it, when started running for such
352- interactive use in the most ordinary way, to print or display an
353- announcement including an appropriate copyright notice and a
354- notice that there is no warranty (or else, saying that you provide
355- a warranty) and that users may redistribute the program under
356- these conditions, and telling the user how to view a copy of this
357- License. (Exception: if the Program itself is interactive but
358- does not normally print such an announcement, your work based on
359- the Program is not required to print an announcement.)
360-
361-These requirements apply to the modified work as a whole. If
362-identifiable sections of that work are not derived from the Program,
363-and can be reasonably considered independent and separate works in
364-themselves, then this License, and its terms, do not apply to those
365-sections when you distribute them as separate works. But when you
366-distribute the same sections as part of a whole which is a work based
367-on the Program, the distribution of the whole must be on the terms of
368-this License, whose permissions for other licensees extend to the
369-entire whole, and thus to each and every part regardless of who wrote it.
370-Thus, it is not the intent of this section to claim rights or contest
371-your rights to work written entirely by you; rather, the intent is to
372-exercise the right to control the distribution of derivative or
373-collective works based on the Program.
374-
375-In addition, mere aggregation of another work not based on the Program
376-with the Program (or with a work based on the Program) on a volume of
377-a storage or distribution medium does not bring the other work under
378-the scope of this License.
379-
380- 3. You may copy and distribute the Program (or a work based on it,
381-under Section 2) in object code or executable form under the terms of
382-Sections 1 and 2 above provided that you also do one of the following:
383-
384- a) Accompany it with the complete corresponding machine-readable
385- source code, which must be distributed under the terms of Sections
386- 1 and 2 above on a medium customarily used for software interchange; or,
387-
388- b) Accompany it with a written offer, valid for at least three
389- years, to give any third party, for a charge no more than your
390- cost of physically performing source distribution, a complete
391- machine-readable copy of the corresponding source code, to be
392- distributed under the terms of Sections 1 and 2 above on a medium
393- customarily used for software interchange; or,
394-
395- c) Accompany it with the information you received as to the offer
396- to distribute corresponding source code. (This alternative is
397- allowed only for noncommercial distribution and only if you
398- received the program in object code or executable form with such
399- an offer, in accord with Subsection b above.)
400-
401-The source code for a work means the preferred form of the work for
402-making modifications to it. For an executable work, complete source
403-code means all the source code for all modules it contains, plus any
404-associated interface definition files, plus the scripts used to
405-control compilation and installation of the executable. However, as a
406-special exception, the source code distributed need not include
407-anything that is normally distributed (in either source or binary
408-form) with the major components (compiler, kernel, and so on) of the
409-operating system on which the executable runs, unless that component
410-itself accompanies the executable.
411-
412-If distribution of executable or object code is made by offering
413-access to copy from a designated place, then offering equivalent
414-access to copy the source code from the same place counts as
415-distribution of the source code, even though third parties are not
416-compelled to copy the source along with the object code.
417-
418- 4. You may not copy, modify, sublicense, or distribute the Program
419-except as expressly provided under this License. Any attempt
420-otherwise to copy, modify, sublicense or distribute the Program is
421-void, and will automatically terminate your rights under this License.
422-However, parties who have received copies, or rights, from you under
423-this License will not have their licenses terminated so long as such
424-parties remain in full compliance.
425-
426- 5. You are not required to accept this License, since you have not
427-signed it. However, nothing else grants you permission to modify or
428-distribute the Program or its derivative works. These actions are
429-prohibited by law if you do not accept this License. Therefore, by
430-modifying or distributing the Program (or any work based on the
431-Program), you indicate your acceptance of this License to do so, and
432-all its terms and conditions for copying, distributing or modifying
433-the Program or works based on it.
434-
435- 6. Each time you redistribute the Program (or any work based on the
436-Program), the recipient automatically receives a license from the
437-original licensor to copy, distribute or modify the Program subject to
438-these terms and conditions. You may not impose any further
439-restrictions on the recipients' exercise of the rights granted herein.
440-You are not responsible for enforcing compliance by third parties to
441+ TERMS AND CONDITIONS
442+
443+ 0. Definitions.
444+
445+ "This License" refers to version 3 of the GNU General Public License.
446+
447+ "Copyright" also means copyright-like laws that apply to other kinds of
448+works, such as semiconductor masks.
449+
450+ "The Program" refers to any copyrightable work licensed under this
451+License. Each licensee is addressed as "you". "Licensees" and
452+"recipients" may be individuals or organizations.
453+
454+ To "modify" a work means to copy from or adapt all or part of the work
455+in a fashion requiring copyright permission, other than the making of an
456+exact copy. The resulting work is called a "modified version" of the
457+earlier work or a work "based on" the earlier work.
458+
459+ A "covered work" means either the unmodified Program or a work based
460+on the Program.
461+
462+ To "propagate" a work means to do anything with it that, without
463+permission, would make you directly or secondarily liable for
464+infringement under applicable copyright law, except executing it on a
465+computer or modifying a private copy. Propagation includes copying,
466+distribution (with or without modification), making available to the
467+public, and in some countries other activities as well.
468+
469+ To "convey" a work means any kind of propagation that enables other
470+parties to make or receive copies. Mere interaction with a user through
471+a computer network, with no transfer of a copy, is not conveying.
472+
473+ An interactive user interface displays "Appropriate Legal Notices"
474+to the extent that it includes a convenient and prominently visible
475+feature that (1) displays an appropriate copyright notice, and (2)
476+tells the user that there is no warranty for the work (except to the
477+extent that warranties are provided), that licensees may convey the
478+work under this License, and how to view a copy of this License. If
479+the interface presents a list of user commands or options, such as a
480+menu, a prominent item in the list meets this criterion.
481+
482+ 1. Source Code.
483+
484+ The "source code" for a work means the preferred form of the work
485+for making modifications to it. "Object code" means any non-source
486+form of a work.
487+
488+ A "Standard Interface" means an interface that either is an official
489+standard defined by a recognized standards body, or, in the case of
490+interfaces specified for a particular programming language, one that
491+is widely used among developers working in that language.
492+
493+ The "System Libraries" of an executable work include anything, other
494+than the work as a whole, that (a) is included in the normal form of
495+packaging a Major Component, but which is not part of that Major
496+Component, and (b) serves only to enable use of the work with that
497+Major Component, or to implement a Standard Interface for which an
498+implementation is available to the public in source code form. A
499+"Major Component", in this context, means a major essential component
500+(kernel, window system, and so on) of the specific operating system
501+(if any) on which the executable work runs, or a compiler used to
502+produce the work, or an object code interpreter used to run it.
503+
504+ The "Corresponding Source" for a work in object code form means all
505+the source code needed to generate, install, and (for an executable
506+work) run the object code and to modify the work, including scripts to
507+control those activities. However, it does not include the work's
508+System Libraries, or general-purpose tools or generally available free
509+programs which are used unmodified in performing those activities but
510+which are not part of the work. For example, Corresponding Source
511+includes interface definition files associated with source files for
512+the work, and the source code for shared libraries and dynamically
513+linked subprograms that the work is specifically designed to require,
514+such as by intimate data communication or control flow between those
515+subprograms and other parts of the work.
516+
517+ The Corresponding Source need not include anything that users
518+can regenerate automatically from other parts of the Corresponding
519+Source.
520+
521+ The Corresponding Source for a work in source code form is that
522+same work.
523+
524+ 2. Basic Permissions.
525+
526+ All rights granted under this License are granted for the term of
527+copyright on the Program, and are irrevocable provided the stated
528+conditions are met. This License explicitly affirms your unlimited
529+permission to run the unmodified Program. The output from running a
530+covered work is covered by this License only if the output, given its
531+content, constitutes a covered work. This License acknowledges your
532+rights of fair use or other equivalent, as provided by copyright law.
533+
534+ You may make, run and propagate covered works that you do not
535+convey, without conditions so long as your license otherwise remains
536+in force. You may convey covered works to others for the sole purpose
537+of having them make modifications exclusively for you, or provide you
538+with facilities for running those works, provided that you comply with
539+the terms of this License in conveying all material for which you do
540+not control copyright. Those thus making or running the covered works
541+for you must do so exclusively on your behalf, under your direction
542+and control, on terms that prohibit them from making any copies of
543+your copyrighted material outside their relationship with you.
544+
545+ Conveying under any other circumstances is permitted solely under
546+the conditions stated below. Sublicensing is not allowed; section 10
547+makes it unnecessary.
548+
549+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
550+
551+ No covered work shall be deemed part of an effective technological
552+measure under any applicable law fulfilling obligations under article
553+11 of the WIPO copyright treaty adopted on 20 December 1996, or
554+similar laws prohibiting or restricting circumvention of such
555+measures.
556+
557+ When you convey a covered work, you waive any legal power to forbid
558+circumvention of technological measures to the extent such circumvention
559+is effected by exercising rights under this License with respect to
560+the covered work, and you disclaim any intention to limit operation or
561+modification of the work as a means of enforcing, against the work's
562+users, your or third parties' legal rights to forbid circumvention of
563+technological measures.
564+
565+ 4. Conveying Verbatim Copies.
566+
567+ You may convey verbatim copies of the Program's source code as you
568+receive it, in any medium, provided that you conspicuously and
569+appropriately publish on each copy an appropriate copyright notice;
570+keep intact all notices stating that this License and any
571+non-permissive terms added in accord with section 7 apply to the code;
572+keep intact all notices of the absence of any warranty; and give all
573+recipients a copy of this License along with the Program.
574+
575+ You may charge any price or no price for each copy that you convey,
576+and you may offer support or warranty protection for a fee.
577+
578+ 5. Conveying Modified Source Versions.
579+
580+ You may convey a work based on the Program, or the modifications to
581+produce it from the Program, in the form of source code under the
582+terms of section 4, provided that you also meet all of these conditions:
583+
584+ a) The work must carry prominent notices stating that you modified
585+ it, and giving a relevant date.
586+
587+ b) The work must carry prominent notices stating that it is
588+ released under this License and any conditions added under section
589+ 7. This requirement modifies the requirement in section 4 to
590+ "keep intact all notices".
591+
592+ c) You must license the entire work, as a whole, under this
593+ License to anyone who comes into possession of a copy. This
594+ License will therefore apply, along with any applicable section 7
595+ additional terms, to the whole of the work, and all its parts,
596+ regardless of how they are packaged. This License gives no
597+ permission to license the work in any other way, but it does not
598+ invalidate such permission if you have separately received it.
599+
600+ d) If the work has interactive user interfaces, each must display
601+ Appropriate Legal Notices; however, if the Program has interactive
602+ interfaces that do not display Appropriate Legal Notices, your
603+ work need not make them do so.
604+
605+ A compilation of a covered work with other separate and independent
606+works, which are not by their nature extensions of the covered work,
607+and which are not combined with it such as to form a larger program,
608+in or on a volume of a storage or distribution medium, is called an
609+"aggregate" if the compilation and its resulting copyright are not
610+used to limit the access or legal rights of the compilation's users
611+beyond what the individual works permit. Inclusion of a covered work
612+in an aggregate does not cause this License to apply to the other
613+parts of the aggregate.
614+
615+ 6. Conveying Non-Source Forms.
616+
617+ You may convey a covered work in object code form under the terms
618+of sections 4 and 5, provided that you also convey the
619+machine-readable Corresponding Source under the terms of this License,
620+in one of these ways:
621+
622+ a) Convey the object code in, or embodied in, a physical product
623+ (including a physical distribution medium), accompanied by the
624+ Corresponding Source fixed on a durable physical medium
625+ customarily used for software interchange.
626+
627+ b) Convey the object code in, or embodied in, a physical product
628+ (including a physical distribution medium), accompanied by a
629+ written offer, valid for at least three years and valid for as
630+ long as you offer spare parts or customer support for that product
631+ model, to give anyone who possesses the object code either (1) a
632+ copy of the Corresponding Source for all the software in the
633+ product that is covered by this License, on a durable physical
634+ medium customarily used for software interchange, for a price no
635+ more than your reasonable cost of physically performing this
636+ conveying of source, or (2) access to copy the
637+ Corresponding Source from a network server at no charge.
638+
639+ c) Convey individual copies of the object code with a copy of the
640+ written offer to provide the Corresponding Source. This
641+ alternative is allowed only occasionally and noncommercially, and
642+ only if you received the object code with such an offer, in accord
643+ with subsection 6b.
644+
645+ d) Convey the object code by offering access from a designated
646+ place (gratis or for a charge), and offer equivalent access to the
647+ Corresponding Source in the same way through the same place at no
648+ further charge. You need not require recipients to copy the
649+ Corresponding Source along with the object code. If the place to
650+ copy the object code is a network server, the Corresponding Source
651+ may be on a different server (operated by you or a third party)
652+ that supports equivalent copying facilities, provided you maintain
653+ clear directions next to the object code saying where to find the
654+ Corresponding Source. Regardless of what server hosts the
655+ Corresponding Source, you remain obligated to ensure that it is
656+ available for as long as needed to satisfy these requirements.
657+
658+ e) Convey the object code using peer-to-peer transmission, provided
659+ you inform other peers where the object code and Corresponding
660+ Source of the work are being offered to the general public at no
661+ charge under subsection 6d.
662+
663+ A separable portion of the object code, whose source code is excluded
664+from the Corresponding Source as a System Library, need not be
665+included in conveying the object code work.
666+
667+ A "User Product" is either (1) a "consumer product", which means any
668+tangible personal property which is normally used for personal, family,
669+or household purposes, or (2) anything designed or sold for incorporation
670+into a dwelling. In determining whether a product is a consumer product,
671+doubtful cases shall be resolved in favor of coverage. For a particular
672+product received by a particular user, "normally used" refers to a
673+typical or common use of that class of product, regardless of the status
674+of the particular user or of the way in which the particular user
675+actually uses, or expects or is expected to use, the product. A product
676+is a consumer product regardless of whether the product has substantial
677+commercial, industrial or non-consumer uses, unless such uses represent
678+the only significant mode of use of the product.
679+
680+ "Installation Information" for a User Product means any methods,
681+procedures, authorization keys, or other information required to install
682+and execute modified versions of a covered work in that User Product from
683+a modified version of its Corresponding Source. The information must
684+suffice to ensure that the continued functioning of the modified object
685+code is in no case prevented or interfered with solely because
686+modification has been made.
687+
688+ If you convey an object code work under this section in, or with, or
689+specifically for use in, a User Product, and the conveying occurs as
690+part of a transaction in which the right of possession and use of the
691+User Product is transferred to the recipient in perpetuity or for a
692+fixed term (regardless of how the transaction is characterized), the
693+Corresponding Source conveyed under this section must be accompanied
694+by the Installation Information. But this requirement does not apply
695+if neither you nor any third party retains the ability to install
696+modified object code on the User Product (for example, the work has
697+been installed in ROM).
698+
699+ The requirement to provide Installation Information does not include a
700+requirement to continue to provide support service, warranty, or updates
701+for a work that has been modified or installed by the recipient, or for
702+the User Product in which it has been modified or installed. Access to a
703+network may be denied when the modification itself materially and
704+adversely affects the operation of the network or violates the rules and
705+protocols for communication across the network.
706+
707+ Corresponding Source conveyed, and Installation Information provided,
708+in accord with this section must be in a format that is publicly
709+documented (and with an implementation available to the public in
710+source code form), and must require no special password or key for
711+unpacking, reading or copying.
712+
713+ 7. Additional Terms.
714+
715+ "Additional permissions" are terms that supplement the terms of this
716+License by making exceptions from one or more of its conditions.
717+Additional permissions that are applicable to the entire Program shall
718+be treated as though they were included in this License, to the extent
719+that they are valid under applicable law. If additional permissions
720+apply only to part of the Program, that part may be used separately
721+under those permissions, but the entire Program remains governed by
722+this License without regard to the additional permissions.
723+
724+ When you convey a copy of a covered work, you may at your option
725+remove any additional permissions from that copy, or from any part of
726+it. (Additional permissions may be written to require their own
727+removal in certain cases when you modify the work.) You may place
728+additional permissions on material, added by you to a covered work,
729+for which you have or can give appropriate copyright permission.
730+
731+ Notwithstanding any other provision of this License, for material you
732+add to a covered work, you may (if authorized by the copyright holders of
733+that material) supplement the terms of this License with terms:
734+
735+ a) Disclaiming warranty or limiting liability differently from the
736+ terms of sections 15 and 16 of this License; or
737+
738+ b) Requiring preservation of specified reasonable legal notices or
739+ author attributions in that material or in the Appropriate Legal
740+ Notices displayed by works containing it; or
741+
742+ c) Prohibiting misrepresentation of the origin of that material, or
743+ requiring that modified versions of such material be marked in
744+ reasonable ways as different from the original version; or
745+
746+ d) Limiting the use for publicity purposes of names of licensors or
747+ authors of the material; or
748+
749+ e) Declining to grant rights under trademark law for use of some
750+ trade names, trademarks, or service marks; or
751+
752+ f) Requiring indemnification of licensors and authors of that
753+ material by anyone who conveys the material (or modified versions of
754+ it) with contractual assumptions of liability to the recipient, for
755+ any liability that these contractual assumptions directly impose on
756+ those licensors and authors.
757+
758+ All other non-permissive additional terms are considered "further
759+restrictions" within the meaning of section 10. If the Program as you
760+received it, or any part of it, contains a notice stating that it is
761+governed by this License along with a term that is a further
762+restriction, you may remove that term. If a license document contains
763+a further restriction but permits relicensing or conveying under this
764+License, you may add to a covered work material governed by the terms
765+of that license document, provided that the further restriction does
766+not survive such relicensing or conveying.
767+
768+ If you add terms to a covered work in accord with this section, you
769+must place, in the relevant source files, a statement of the
770+additional terms that apply to those files, or a notice indicating
771+where to find the applicable terms.
772+
773+ Additional terms, permissive or non-permissive, may be stated in the
774+form of a separately written license, or stated as exceptions;
775+the above requirements apply either way.
776+
777+ 8. Termination.
778+
779+ You may not propagate or modify a covered work except as expressly
780+provided under this License. Any attempt otherwise to propagate or
781+modify it is void, and will automatically terminate your rights under
782+this License (including any patent licenses granted under the third
783+paragraph of section 11).
784+
785+ However, if you cease all violation of this License, then your
786+license from a particular copyright holder is reinstated (a)
787+provisionally, unless and until the copyright holder explicitly and
788+finally terminates your license, and (b) permanently, if the copyright
789+holder fails to notify you of the violation by some reasonable means
790+prior to 60 days after the cessation.
791+
792+ Moreover, your license from a particular copyright holder is
793+reinstated permanently if the copyright holder notifies you of the
794+violation by some reasonable means, this is the first time you have
795+received notice of violation of this License (for any work) from that
796+copyright holder, and you cure the violation prior to 30 days after
797+your receipt of the notice.
798+
799+ Termination of your rights under this section does not terminate the
800+licenses of parties who have received copies or rights from you under
801+this License. If your rights have been terminated and not permanently
802+reinstated, you do not qualify to receive new licenses for the same
803+material under section 10.
804+
805+ 9. Acceptance Not Required for Having Copies.
806+
807+ You are not required to accept this License in order to receive or
808+run a copy of the Program. Ancillary propagation of a covered work
809+occurring solely as a consequence of using peer-to-peer transmission
810+to receive a copy likewise does not require acceptance. However,
811+nothing other than this License grants you permission to propagate or
812+modify any covered work. These actions infringe copyright if you do
813+not accept this License. Therefore, by modifying or propagating a
814+covered work, you indicate your acceptance of this License to do so.
815+
816+ 10. Automatic Licensing of Downstream Recipients.
817+
818+ Each time you convey a covered work, the recipient automatically
819+receives a license from the original licensors, to run, modify and
820+propagate that work, subject to this License. You are not responsible
821+for enforcing compliance by third parties with this License.
822+
823+ An "entity transaction" is a transaction transferring control of an
824+organization, or substantially all assets of one, or subdividing an
825+organization, or merging organizations. If propagation of a covered
826+work results from an entity transaction, each party to that
827+transaction who receives a copy of the work also receives whatever
828+licenses to the work the party's predecessor in interest had or could
829+give under the previous paragraph, plus a right to possession of the
830+Corresponding Source of the work from the predecessor in interest, if
831+the predecessor has it or can get it with reasonable efforts.
832+
833+ You may not impose any further restrictions on the exercise of the
834+rights granted or affirmed under this License. For example, you may
835+not impose a license fee, royalty, or other charge for exercise of
836+rights granted under this License, and you may not initiate litigation
837+(including a cross-claim or counterclaim in a lawsuit) alleging that
838+any patent claim is infringed by making, using, selling, offering for
839+sale, or importing the Program or any portion of it.
840+
841+ 11. Patents.
842+
843+ A "contributor" is a copyright holder who authorizes use under this
844+License of the Program or a work on which the Program is based. The
845+work thus licensed is called the contributor's "contributor version".
846+
847+ A contributor's "essential patent claims" are all patent claims
848+owned or controlled by the contributor, whether already acquired or
849+hereafter acquired, that would be infringed by some manner, permitted
850+by this License, of making, using, or selling its contributor version,
851+but do not include claims that would be infringed only as a
852+consequence of further modification of the contributor version. For
853+purposes of this definition, "control" includes the right to grant
854+patent sublicenses in a manner consistent with the requirements of
855 this License.
856
857- 7. If, as a consequence of a court judgment or allegation of patent
858-infringement or for any other reason (not limited to patent issues),
859-conditions are imposed on you (whether by court order, agreement or
860+ Each contributor grants you a non-exclusive, worldwide, royalty-free
861+patent license under the contributor's essential patent claims, to
862+make, use, sell, offer for sale, import and otherwise run, modify and
863+propagate the contents of its contributor version.
864+
865+ In the following three paragraphs, a "patent license" is any express
866+agreement or commitment, however denominated, not to enforce a patent
867+(such as an express permission to practice a patent or covenant not to
868+sue for patent infringement). To "grant" such a patent license to a
869+party means to make such an agreement or commitment not to enforce a
870+patent against the party.
871+
872+ If you convey a covered work, knowingly relying on a patent license,
873+and the Corresponding Source of the work is not available for anyone
874+to copy, free of charge and under the terms of this License, through a
875+publicly available network server or other readily accessible means,
876+then you must either (1) cause the Corresponding Source to be so
877+available, or (2) arrange to deprive yourself of the benefit of the
878+patent license for this particular work, or (3) arrange, in a manner
879+consistent with the requirements of this License, to extend the patent
880+license to downstream recipients. "Knowingly relying" means you have
881+actual knowledge that, but for the patent license, your conveying the
882+covered work in a country, or your recipient's use of the covered work
883+in a country, would infringe one or more identifiable patents in that
884+country that you have reason to believe are valid.
885+
886+ If, pursuant to or in connection with a single transaction or
887+arrangement, you convey, or propagate by procuring conveyance of, a
888+covered work, and grant a patent license to some of the parties
889+receiving the covered work authorizing them to use, propagate, modify
890+or convey a specific copy of the covered work, then the patent license
891+you grant is automatically extended to all recipients of the covered
892+work and works based on it.
893+
894+ A patent license is "discriminatory" if it does not include within
895+the scope of its coverage, prohibits the exercise of, or is
896+conditioned on the non-exercise of one or more of the rights that are
897+specifically granted under this License. You may not convey a covered
898+work if you are a party to an arrangement with a third party that is
899+in the business of distributing software, under which you make payment
900+to the third party based on the extent of your activity of conveying
901+the work, and under which the third party grants, to any of the
902+parties who would receive the covered work from you, a discriminatory
903+patent license (a) in connection with copies of the covered work
904+conveyed by you (or copies made from those copies), or (b) primarily
905+for and in connection with specific products or compilations that
906+contain the covered work, unless you entered into that arrangement,
907+or that patent license was granted, prior to 28 March 2007.
908+
909+ Nothing in this License shall be construed as excluding or limiting
910+any implied license or other defenses to infringement that may
911+otherwise be available to you under applicable patent law.
912+
913+ 12. No Surrender of Others' Freedom.
914+
915+ If conditions are imposed on you (whether by court order, agreement or
916 otherwise) that contradict the conditions of this License, they do not
917-excuse you from the conditions of this License. If you cannot
918-distribute so as to satisfy simultaneously your obligations under this
919-License and any other pertinent obligations, then as a consequence you
920-may not distribute the Program at all. For example, if a patent
921-license would not permit royalty-free redistribution of the Program by
922-all those who receive copies directly or indirectly through you, then
923-the only way you could satisfy both it and this License would be to
924-refrain entirely from distribution of the Program.
925-
926-If any portion of this section is held invalid or unenforceable under
927-any particular circumstance, the balance of the section is intended to
928-apply and the section as a whole is intended to apply in other
929-circumstances.
930-
931-It is not the purpose of this section to induce you to infringe any
932-patents or other property right claims or to contest validity of any
933-such claims; this section has the sole purpose of protecting the
934-integrity of the free software distribution system, which is
935-implemented by public license practices. Many people have made
936-generous contributions to the wide range of software distributed
937-through that system in reliance on consistent application of that
938-system; it is up to the author/donor to decide if he or she is willing
939-to distribute software through any other system and a licensee cannot
940-impose that choice.
941-
942-This section is intended to make thoroughly clear what is believed to
943-be a consequence of the rest of this License.
944-
945- 8. If the distribution and/or use of the Program is restricted in
946-certain countries either by patents or by copyrighted interfaces, the
947-original copyright holder who places the Program under this License
948-may add an explicit geographical distribution limitation excluding
949-those countries, so that distribution is permitted only in or among
950-countries not thus excluded. In such case, this License incorporates
951-the limitation as if written in the body of this License.
952-
953- 9. The Free Software Foundation may publish revised and/or new versions
954-of the General Public License from time to time. Such new versions will
955+excuse you from the conditions of this License. If you cannot convey a
956+covered work so as to satisfy simultaneously your obligations under this
957+License and any other pertinent obligations, then as a consequence you may
958+not convey it at all. For example, if you agree to terms that obligate you
959+to collect a royalty for further conveying from those to whom you convey
960+the Program, the only way you could satisfy both those terms and this
961+License would be to refrain entirely from conveying the Program.
962+
963+ 13. Use with the GNU Affero General Public License.
964+
965+ Notwithstanding any other provision of this License, you have
966+permission to link or combine any covered work with a work licensed
967+under version 3 of the GNU Affero General Public License into a single
968+combined work, and to convey the resulting work. The terms of this
969+License will continue to apply to the part which is the covered work,
970+but the special requirements of the GNU Affero General Public License,
971+section 13, concerning interaction through a network will apply to the
972+combination as such.
973+
974+ 14. Revised Versions of this License.
975+
976+ The Free Software Foundation may publish revised and/or new versions of
977+the GNU General Public License from time to time. Such new versions will
978 be similar in spirit to the present version, but may differ in detail to
979 address new problems or concerns.
980
981-Each version is given a distinguishing version number. If the Program
982-specifies a version number of this License which applies to it and "any
983-later version", you have the option of following the terms and conditions
984-either of that version or of any later version published by the Free
985-Software Foundation. If the Program does not specify a version number of
986-this License, you may choose any version ever published by the Free Software
987-Foundation.
988-
989- 10. If you wish to incorporate parts of the Program into other free
990-programs whose distribution conditions are different, write to the author
991-to ask for permission. For software which is copyrighted by the Free
992-Software Foundation, write to the Free Software Foundation; we sometimes
993-make exceptions for this. Our decision will be guided by the two goals
994-of preserving the free status of all derivatives of our free software and
995-of promoting the sharing and reuse of software generally.
996-
997- NO WARRANTY
998-
999- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
1000-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
1001-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
1002-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
1003-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1004-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
1005-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
1006-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
1007-REPAIR OR CORRECTION.
1008-
1009- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
1010-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
1011-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
1012-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
1013-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
1014-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
1015-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
1016-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
1017-POSSIBILITY OF SUCH DAMAGES.
1018-
1019---------------------------------------------------------------------------
1020-
1021- * In addition, as a special exception, the copyright holders give permission to link
1022- * the code of this program with the following code libraries or files and distribute
1023- * linked combinations including any number of these and the main code.
1024- * - Any blog skin, "evoSkin" or design elements licensed under any of the following
1025- * Creative Commons licenses:
1026- * - Attribution-Share Alike ( http://creativecommons.org/licenses/by-sa/3.0/ )
1027- * - Attribution ( http://creativecommons.org/licenses/by/3.0/ )
1028- * - The PHP/SWF Charts library by maani.us (or with modified versions of this library
1029- * that use the same license as PHP/SWF Charts library by maani.us).
1030- * You must obey the GNU General Public License in all respects for all of the code used
1031- * other than the libraries/files listed above. If you modify this file, you may extend
1032- * this exception to your version of the file, but you are not obligated to do so. If
1033- * you do not wish to do so, delete this exception statement from your version.
1034-
1035---------------------------------------------------------------------------
1036-
1037- END OF TERMS AND CONDITIONS
1038-
1039+ Each version is given a distinguishing version number. If the
1040+Program specifies that a certain numbered version of the GNU General
1041+Public License "or any later version" applies to it, you have the
1042+option of following the terms and conditions either of that numbered
1043+version or of any later version published by the Free Software
1044+Foundation. If the Program does not specify a version number of the
1045+GNU General Public License, you may choose any version ever published
1046+by the Free Software Foundation.
1047+
1048+ If the Program specifies that a proxy can decide which future
1049+versions of the GNU General Public License can be used, that proxy's
1050+public statement of acceptance of a version permanently authorizes you
1051+to choose that version for the Program.
1052+
1053+ Later license versions may give you additional or different
1054+permissions. However, no additional obligations are imposed on any
1055+author or copyright holder as a result of your choosing to follow a
1056+later version.
1057+
1058+ 15. Disclaimer of Warranty.
1059+
1060+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
1061+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
1062+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
1063+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
1064+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1065+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
1066+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
1067+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
1068+
1069+ 16. Limitation of Liability.
1070+
1071+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
1072+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
1073+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
1074+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
1075+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
1076+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
1077+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
1078+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
1079+SUCH DAMAGES.
1080+
1081+ 17. Interpretation of Sections 15 and 16.
1082+
1083+ If the disclaimer of warranty and limitation of liability provided
1084+above cannot be given local legal effect according to their terms,
1085+reviewing courts shall apply local law that most closely approximates
1086+an absolute waiver of all civil liability in connection with the
1087+Program, unless a warranty or assumption of liability accompanies a
1088+copy of the Program in return for a fee.
1089+
1090+ END OF TERMS AND CONDITIONS
1091+
1092+ How to Apply These Terms to Your New Programs
1093+
1094+ If you develop a new program, and you want it to be of the greatest
1095+possible use to the public, the best way to achieve this is to make it
1096+free software which everyone can redistribute and change under these terms.
1097+
1098+ To do so, attach the following notices to the program. It is safest
1099+to attach them to the start of each source file to most effectively
1100+state the exclusion of warranty; and each file should have at least
1101+the "copyright" line and a pointer to where the full notice is found.
1102+
1103+ <one line to give the program's name and a brief idea of what it does.>
1104+ Copyright (C) <year> <name of author>
1105+
1106+ This program is free software: you can redistribute it and/or modify
1107+ it under the terms of the GNU General Public License as published by
1108+ the Free Software Foundation, either version 3 of the License, or
1109+ (at your option) any later version.
1110+
1111+ This program is distributed in the hope that it will be useful,
1112+ but WITHOUT ANY WARRANTY; without even the implied warranty of
1113+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1114+ GNU General Public License for more details.
1115+
1116+ You should have received a copy of the GNU General Public License
1117+ along with this program. If not, see <http://www.gnu.org/licenses/>.
1118+
1119+Also add information on how to contact you by electronic and paper mail.
1120+
1121+ If the program does terminal interaction, make it output a short
1122+notice like this when it starts in an interactive mode:
1123+
1124+ <program> Copyright (C) <year> <name of author>
1125+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
1126+ This is free software, and you are welcome to redistribute it
1127+ under certain conditions; type `show c' for details.
1128+
1129+The hypothetical commands `show w' and `show c' should show the appropriate
1130+parts of the General Public License. Of course, your program's commands
1131+might be different; for a GUI interface, you would use an "about box".
1132+
1133+ You should also get your employer (if you work as a programmer) or school,
1134+if any, to sign a "copyright disclaimer" for the program, if necessary.
1135+For more information on this, and how to apply and follow the GNU GPL, see
1136+<http://www.gnu.org/licenses/>.
1137+
1138+ The GNU General Public License does not permit incorporating your program
1139+into proprietary programs. If your program is a subroutine library, you
1140+may consider it more useful to permit linking proprietary applications with
1141+the library. If this is what you want to do, use the GNU Lesser General
1142+Public License instead of this License. But first, please read
1143+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
1144
1145=== modified file 'multiblogs.php'
1146--- multiblogs.php 2012-07-29 20:36:41 +0000
1147+++ multiblogs.php 2013-03-11 07:27:21 +0000
1148@@ -1,28 +1,35 @@
1149 <?php
1150 /**
1151- * Demo file displaying multiple blogs on the same page
1152- *
1153- * Note: This is a very advanced use of Quam Plures! Most of the time, calling
1154- * your blog through index.php (or a stub file) with a template will be enough.
1155- * You should try to customize a template before trying to use this file.
1156- *
1157- * Quam Plures - {@link http://quamplures.net/}
1158- * Released under GNU GPL License - {@link http://quamplures.net/license.html}
1159- * @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
1160- * @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
1161- *
1162+ * Displays multiple blogs on the same page
1163+ *
1164+ * Note: This is a very advanced situation! Most of the time, calling your blog
1165+ * through index.php (or a stub file) with a template will be enough. You should
1166+ * try to customize a template before trying to use this file.
1167+ * @todo (1111) this needs to pick up default blog on index and use it's
1168+ * template's style sheet
1169+ * @todo (1111) actually, this needs to containerized and moved into the
1170+ * qp_templates where it belongs
1171+ * @todo (1111) does $PageCache actually do anything worth having, or can that
1172+ * whole thing go away?
1173+ * @author {@link http://wonderwinds.com/ Ed Bennett}
1174+ * @author {@link http://fplanque.net/ Francois PLANQUE}
1175+ * @copyright (c) 2009 by {@link http://quamplures.net/ the Quam Plures project}
1176+ * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
1177 * @package templates
1178- * @subpackage oddballs
1179 */
1180
1181 // select which blog you want to display here
1182 $blog = 1;
1183+
1184 // force it to ignore the blog's designated template
1185 $template = '';
1186+
1187 // restrict posts to those published, thus hiding drafts.
1188 $show_statuses = array();
1189+
1190 // set a limit before which posts will be ignored
1191 $timestamp_min = '';
1192+
1193 // set a limit after which posts will be ignored
1194 $timestamp_max = 'now';
1195
1196@@ -33,14 +40,12 @@
1197 $redir = 'no';
1198
1199 /**
1200- * Load Quam Plures configuration
1201+ * Load the configuration minimum
1202 */
1203 require_once dirname(__FILE__).'/qp_config/_config.php';
1204
1205 /**
1206- * Initialize Quam Plures
1207- *
1208- * Loads the blog identified by $blog with other params above
1209+ * Main initialization, with the identified $blog
1210 */
1211 require_once $inc_path.'_blog_main.inc.php';
1212
1213@@ -50,7 +55,6 @@
1214 // --------------------- PAGE LEVEL CACHING SUPPORT ---------------------
1215 // This is totally optional. General caching must be enabled
1216 // in Global settings, otherwise this will do nothing.
1217-load_class( '_core/model/_pagecache.class.php' );
1218 $PageCache = new PageCache( NULL );
1219
1220 // Check for cached content & Start caching if needed:
1221@@ -210,7 +214,6 @@
1222
1223 // Run the query:
1224 $BlogBList->query();
1225-
1226 while( $Item = & $BlogBList->get_item() )
1227 {
1228 ?>
1229@@ -248,7 +251,6 @@
1230
1231 // Run the query:
1232 $LinkblogList->query();
1233-
1234 while( $Item = & $LinkblogList->get_item() )
1235 {
1236 ?>
1237
1238=== removed file 'qp_config/license.txt'
1239--- qp_config/license.txt 2006-03-12 22:08:51 +0000
1240+++ qp_config/license.txt 1970-01-01 00:00:00 +0000
1241@@ -1,293 +0,0 @@
1242- GNU GENERAL PUBLIC LICENSE
1243- Version 2, June 1991
1244-
1245- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
1246- 675 Mass Ave, Cambridge, MA 02139, USA
1247- Everyone is permitted to copy and distribute verbatim copies
1248- of this license document, but changing it is not allowed.
1249-
1250- Preamble
1251-
1252- The licenses for most software are designed to take away your
1253-freedom to share and change it. By contrast, the GNU General Public
1254-License is intended to guarantee your freedom to share and change free
1255-software--to make sure the software is free for all its users. This
1256-General Public License applies to most of the Free Software
1257-Foundation's software and to any other program whose authors commit to
1258-using it. (Some other Free Software Foundation software is covered by
1259-the GNU Library General Public License instead.) You can apply it to
1260-your programs, too.
1261-
1262- When we speak of free software, we are referring to freedom, not
1263-price. Our General Public Licenses are designed to make sure that you
1264-have the freedom to distribute copies of free software (and charge for
1265-this service if you wish), that you receive source code or can get it
1266-if you want it, that you can change the software or use pieces of it
1267-in new free programs; and that you know you can do these things.
1268-
1269- To protect your rights, we need to make restrictions that forbid
1270-anyone to deny you these rights or to ask you to surrender the rights.
1271-These restrictions translate to certain responsibilities for you if you
1272-distribute copies of the software, or if you modify it.
1273-
1274- For example, if you distribute copies of such a program, whether
1275-gratis or for a fee, you must give the recipients all the rights that
1276-you have. You must make sure that they, too, receive or can get the
1277-source code. And you must show them these terms so they know their
1278-rights.
1279-
1280- We protect your rights with two steps: (1) copyright the software, and
1281-(2) offer you this license which gives you legal permission to copy,
1282-distribute and/or modify the software.
1283-
1284- Also, for each author's protection and ours, we want to make certain
1285-that everyone understands that there is no warranty for this free
1286-software. If the software is modified by someone else and passed on, we
1287-want its recipients to know that what they have is not the original, so
1288-that any problems introduced by others will not reflect on the original
1289-authors' reputations.
1290-
1291- Finally, any free program is threatened constantly by software
1292-patents. We wish to avoid the danger that redistributors of a free
1293-program will individually obtain patent licenses, in effect making the
1294-program proprietary. To prevent this, we have made it clear that any
1295-patent must be licensed for everyone's free use or not licensed at all.
1296-
1297- The precise terms and conditions for copying, distribution and
1298-modification follow.
1299-
1300- GNU GENERAL PUBLIC LICENSE
1301- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
1302-
1303- 0. This License applies to any program or other work which contains
1304-a notice placed by the copyright holder saying it may be distributed
1305-under the terms of this General Public License. The "Program", below,
1306-refers to any such program or work, and a "work based on the Program"
1307-means either the Program or any derivative work under copyright law:
1308-that is to say, a work containing the Program or a portion of it,
1309-either verbatim or with modifications and/or translated into another
1310-language. (Hereinafter, translation is included without limitation in
1311-the term "modification".) Each licensee is addressed as "you".
1312-
1313-Activities other than copying, distribution and modification are not
1314-covered by this License; they are outside its scope. The act of
1315-running the Program is not restricted, and the output from the Program
1316-is covered only if its contents constitute a work based on the
1317-Program (independent of having been made by running the Program).
1318-Whether that is true depends on what the Program does.
1319-
1320- 1. You may copy and distribute verbatim copies of the Program's
1321-source code as you receive it, in any medium, provided that you
1322-conspicuously and appropriately publish on each copy an appropriate
1323-copyright notice and disclaimer of warranty; keep intact all the
1324-notices that refer to this License and to the absence of any warranty;
1325-and give any other recipients of the Program a copy of this License
1326-along with the Program.
1327-
1328-You may charge a fee for the physical act of transferring a copy, and
1329-you may at your option offer warranty protection in exchange for a fee.
1330-
1331- 2. You may modify your copy or copies of the Program or any portion
1332-of it, thus forming a work based on the Program, and copy and
1333-distribute such modifications or work under the terms of Section 1
1334-above, provided that you also meet all of these conditions:
1335-
1336- a) You must cause the modified files to carry prominent notices
1337- stating that you changed the files and the date of any change.
1338-
1339- b) You must cause any work that you distribute or publish, that in
1340- whole or in part contains or is derived from the Program or any
1341- part thereof, to be licensed as a whole at no charge to all third
1342- parties under the terms of this License.
1343-
1344- c) If the modified program normally reads commands interactively
1345- when run, you must cause it, when started running for such
1346- interactive use in the most ordinary way, to print or display an
1347- announcement including an appropriate copyright notice and a
1348- notice that there is no warranty (or else, saying that you provide
1349- a warranty) and that users may redistribute the program under
1350- these conditions, and telling the user how to view a copy of this
1351- License. (Exception: if the Program itself is interactive but
1352- does not normally print such an announcement, your work based on
1353- the Program is not required to print an announcement.)
1354-
1355-These requirements apply to the modified work as a whole. If
1356-identifiable sections of that work are not derived from the Program,
1357-and can be reasonably considered independent and separate works in
1358-themselves, then this License, and its terms, do not apply to those
1359-sections when you distribute them as separate works. But when you
1360-distribute the same sections as part of a whole which is a work based
1361-on the Program, the distribution of the whole must be on the terms of
1362-this License, whose permissions for other licensees extend to the
1363-entire whole, and thus to each and every part regardless of who wrote it.
1364-Thus, it is not the intent of this section to claim rights or contest
1365-your rights to work written entirely by you; rather, the intent is to
1366-exercise the right to control the distribution of derivative or
1367-collective works based on the Program.
1368-
1369-In addition, mere aggregation of another work not based on the Program
1370-with the Program (or with a work based on the Program) on a volume of
1371-a storage or distribution medium does not bring the other work under
1372-the scope of this License.
1373-
1374- 3. You may copy and distribute the Program (or a work based on it,
1375-under Section 2) in object code or executable form under the terms of
1376-Sections 1 and 2 above provided that you also do one of the following:
1377-
1378- a) Accompany it with the complete corresponding machine-readable
1379- source code, which must be distributed under the terms of Sections
1380- 1 and 2 above on a medium customarily used for software interchange; or,
1381-
1382- b) Accompany it with a written offer, valid for at least three
1383- years, to give any third party, for a charge no more than your
1384- cost of physically performing source distribution, a complete
1385- machine-readable copy of the corresponding source code, to be
1386- distributed under the terms of Sections 1 and 2 above on a medium
1387- customarily used for software interchange; or,
1388-
1389- c) Accompany it with the information you received as to the offer
1390- to distribute corresponding source code. (This alternative is
1391- allowed only for noncommercial distribution and only if you
1392- received the program in object code or executable form with such
1393- an offer, in accord with Subsection b above.)
1394-
1395-The source code for a work means the preferred form of the work for
1396-making modifications to it. For an executable work, complete source
1397-code means all the source code for all modules it contains, plus any
1398-associated interface definition files, plus the scripts used to
1399-control compilation and installation of the executable. However, as a
1400-special exception, the source code distributed need not include
1401-anything that is normally distributed (in either source or binary
1402-form) with the major components (compiler, kernel, and so on) of the
1403-operating system on which the executable runs, unless that component
1404-itself accompanies the executable.
1405-
1406-If distribution of executable or object code is made by offering
1407-access to copy from a designated place, then offering equivalent
1408-access to copy the source code from the same place counts as
1409-distribution of the source code, even though third parties are not
1410-compelled to copy the source along with the object code.
1411-
1412- 4. You may not copy, modify, sublicense, or distribute the Program
1413-except as expressly provided under this License. Any attempt
1414-otherwise to copy, modify, sublicense or distribute the Program is
1415-void, and will automatically terminate your rights under this License.
1416-However, parties who have received copies, or rights, from you under
1417-this License will not have their licenses terminated so long as such
1418-parties remain in full compliance.
1419-
1420- 5. You are not required to accept this License, since you have not
1421-signed it. However, nothing else grants you permission to modify or
1422-distribute the Program or its derivative works. These actions are
1423-prohibited by law if you do not accept this License. Therefore, by
1424-modifying or distributing the Program (or any work based on the
1425-Program), you indicate your acceptance of this License to do so, and
1426-all its terms and conditions for copying, distributing or modifying
1427-the Program or works based on it.
1428-
1429- 6. Each time you redistribute the Program (or any work based on the
1430-Program), the recipient automatically receives a license from the
1431-original licensor to copy, distribute or modify the Program subject to
1432-these terms and conditions. You may not impose any further
1433-restrictions on the recipients' exercise of the rights granted herein.
1434-You are not responsible for enforcing compliance by third parties to
1435-this License.
1436-
1437- 7. If, as a consequence of a court judgment or allegation of patent
1438-infringement or for any other reason (not limited to patent issues),
1439-conditions are imposed on you (whether by court order, agreement or
1440-otherwise) that contradict the conditions of this License, they do not
1441-excuse you from the conditions of this License. If you cannot
1442-distribute so as to satisfy simultaneously your obligations under this
1443-License and any other pertinent obligations, then as a consequence you
1444-may not distribute the Program at all. For example, if a patent
1445-license would not permit royalty-free redistribution of the Program by
1446-all those who receive copies directly or indirectly through you, then
1447-the only way you could satisfy both it and this License would be to
1448-refrain entirely from distribution of the Program.
1449-
1450-If any portion of this section is held invalid or unenforceable under
1451-any particular circumstance, the balance of the section is intended to
1452-apply and the section as a whole is intended to apply in other
1453-circumstances.
1454-
1455-It is not the purpose of this section to induce you to infringe any
1456-patents or other property right claims or to contest validity of any
1457-such claims; this section has the sole purpose of protecting the
1458-integrity of the free software distribution system, which is
1459-implemented by public license practices. Many people have made
1460-generous contributions to the wide range of software distributed
1461-through that system in reliance on consistent application of that
1462-system; it is up to the author/donor to decide if he or she is willing
1463-to distribute software through any other system and a licensee cannot
1464-impose that choice.
1465-
1466-This section is intended to make thoroughly clear what is believed to
1467-be a consequence of the rest of this License.
1468-
1469- 8. If the distribution and/or use of the Program is restricted in
1470-certain countries either by patents or by copyrighted interfaces, the
1471-original copyright holder who places the Program under this License
1472-may add an explicit geographical distribution limitation excluding
1473-those countries, so that distribution is permitted only in or among
1474-countries not thus excluded. In such case, this License incorporates
1475-the limitation as if written in the body of this License.
1476-
1477- 9. The Free Software Foundation may publish revised and/or new versions
1478-of the General Public License from time to time. Such new versions will
1479-be similar in spirit to the present version, but may differ in detail to
1480-address new problems or concerns.
1481-
1482-Each version is given a distinguishing version number. If the Program
1483-specifies a version number of this License which applies to it and "any
1484-later version", you have the option of following the terms and conditions
1485-either of that version or of any later version published by the Free
1486-Software Foundation. If the Program does not specify a version number of
1487-this License, you may choose any version ever published by the Free Software
1488-Foundation.
1489-
1490- 10. If you wish to incorporate parts of the Program into other free
1491-programs whose distribution conditions are different, write to the author
1492-to ask for permission. For software which is copyrighted by the Free
1493-Software Foundation, write to the Free Software Foundation; we sometimes
1494-make exceptions for this. Our decision will be guided by the two goals
1495-of preserving the free status of all derivatives of our free software and
1496-of promoting the sharing and reuse of software generally.
1497-
1498- NO WARRANTY
1499-
1500- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
1501-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
1502-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
1503-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
1504-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1505-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
1506-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
1507-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
1508-REPAIR OR CORRECTION.
1509-
1510- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
1511-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
1512-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
1513-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
1514-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
1515-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
1516-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
1517-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
1518-POSSIBILITY OF SUCH DAMAGES.
1519-
1520---------------------------------------------------------------------------
1521-
1522- * In addition, as a special exception, the copyright holders give permission to link
1523- * the code of this program with the PHP/SWF Charts library by maani.us (or with
1524- * modified versions of this library that use the same license as PHP/SWF Charts library
1525- * by maani.us), and distribute linked combinations including the two. You must obey the
1526- * GNU General Public License in all respects for all of the code used other than the
1527- * PHP/SWF Charts library by maani.us. If you modify this file, you may extend this
1528- * exception to your version of the file, but you are not obligated to do so. If you do
1529- * not wish to do so, delete this exception statement from your version.
1530-
1531---------------------------------------------------------------------------
1532-
1533- END OF TERMS AND CONDITIONS
1534-
1535
1536=== modified file 'qp_inc/_application.php'
1537--- qp_inc/_application.php 2013-03-04 20:46:54 +0000
1538+++ qp_inc/_application.php 2013-03-11 07:27:21 +0000
1539@@ -22,7 +22,7 @@
1540 $files_version = '1.10';
1541
1542 // The database version, incrememented by 1 with each change in upgrade_dbase_tables()
1543-$app_db_version = 17;
1544+$app_db_version = 20;
1545
1546 $app_version = $files_version.'.'.$app_db_version;
1547
1548
1549=== modified file 'qp_inc/_core/__core.init.php'
1550--- qp_inc/_core/__core.init.php 2013-02-28 16:40:18 +0000
1551+++ qp_inc/_core/__core.init.php 2013-03-11 07:27:21 +0000
1552@@ -72,7 +72,8 @@
1553 'aspm_settings' => 'antispam/settings.ctrl.php',
1554 'chapters' => 'chapters/chapters.ctrl.php',
1555 'collections' => 'collections/collections.ctrl.php',
1556- 'coll_settings' => 'collections/coll_settings.ctrl.php',
1557+ 'coll_settings' => 'collections/coll_settings.ctrl.php', // old
1558+ 'blog_settings' => 'collections/coll_settings.ctrl.php', // new after monster
1559 'comments' => 'comments/_comments.ctrl.php',
1560 'crontab' => 'cron/cronjobs.ctrl.php',
1561 'dashboard' => 'dashboard/dashboard.ctrl.php',
1562
1563=== modified file 'qp_inc/_core/_param.funcs.php'
1564--- qp_inc/_core/_param.funcs.php 2013-02-28 16:40:18 +0000
1565+++ qp_inc/_core/_param.funcs.php 2013-03-11 07:27:21 +0000
1566@@ -50,33 +50,39 @@
1567 * dirty spambots or borked index bots. Saves a lot of processor time by killing invalid requests)
1568 * @return mixed Final value of Variable, or false if we don't force setting and did not set
1569 */
1570-function param( $var, $type = '', $default = '', $memorize = false,
1571- $override = false, $use_default = true, $strict_typing = 'allow_empty' )
1572+function param(
1573+ $var,
1574+ $type = '',
1575+ $default = '',
1576+ $memorize = false,
1577+ $override = false,
1578+ $use_default = true,
1579+ $strict_typing = 'allow_empty' )
1580 {
1581- global $debug, $app_charset, $io_charset;
1582- // NOTE: we use $GLOBALS[$var] instead of $$var, because otherwise it would conflict with param names which are used as function params ("var", "type", "default", ..)!
1583+ global $debug;
1584+ global $app_charset;
1585+ global $io_charset;
1586
1587- /*
1588- * STEP 1 : Set the variable
1589- *
1590- * Check if already set
1591- * WARNING: when PHP register globals is ON, COOKIES get priority over GET and POST with this!!!
1592- * dh> I never understood that comment.. does it refer to "variables_order" php.ini setting?
1593- * fp> I guess
1594- */
1595+ // STEP 1 : Set the variable
1596+ // Check if already set. NOTE: we use $GLOBALS[$var] instead of $$var, because
1597+ // otherwise it would conflict with param names which are used as function
1598+ // params ("var", "type", "default", ..)!
1599+ // WARNING: when PHP register globals is ON, COOKIES get priority over GET and
1600+ // POST with this!!! dh> I never understood that comment.. does it refer to
1601+ // "variables_order" php.ini setting? fp> I guess
1602 if( ! isset( $GLOBALS[$var] ) || $override )
1603 {
1604 if( isset( $_POST[$var] ) )
1605 {
1606 $GLOBALS[$var] = remove_magic_quotes( $_POST[$var] );
1607 }
1608- elseif( isset($_GET[$var]) )
1609+ elseif( isset( $_GET[$var] ) )
1610 {
1611- $GLOBALS[$var] = remove_magic_quotes($_GET[$var]);
1612+ $GLOBALS[$var] = remove_magic_quotes( $_GET[$var] );
1613 }
1614- elseif( isset($_COOKIE[$var]))
1615+ elseif( isset( $_COOKIE[$var] ) )
1616 {
1617- $GLOBALS[$var] = remove_magic_quotes($_COOKIE[$var]);
1618+ $GLOBALS[$var] = remove_magic_quotes( $_COOKIE[$var] );
1619 }
1620 elseif( $default === true )
1621 {
1622@@ -84,7 +90,7 @@
1623 }
1624 elseif( $use_default )
1625 {
1626- // We haven't set any value yet and we really want one: use default:
1627+ // We haven't set any value yet and we really want one: use default
1628 if( $type == 'array' && $default === '' )
1629 {
1630 // Change default '' into array() (otherwise there would be a notice with settype() below)
1631@@ -94,15 +100,14 @@
1632 }
1633 else
1634 {
1635- // param not found! don't set the variable.
1636- // Won't be memorized nor type-forced!
1637+ // param not found! don't set the variable ... won't be memorized nor type-forced!
1638 return false;
1639 }
1640 }
1641 else
1642 {
1643 // Variable was already set but we need to remove the auto quotes
1644- $GLOBALS[$var] = remove_magic_quotes($GLOBALS[$var]);
1645+ $GLOBALS[$var] = remove_magic_quotes( $GLOBALS[$var] );
1646 }
1647
1648 if( isset( $io_charset ) && ! empty( $app_charset ) )
1649@@ -110,130 +115,123 @@
1650 $GLOBALS[$var] = convert_charset( $GLOBALS[$var], $app_charset, $io_charset );
1651 }
1652
1653- // STEP 2: make sure the data fits the expected type
1654- // type will be forced even if it was set before and not overriden
1655+ // STEP 2: make sure the data fits the expected type type,
1656+ // will be forced even if it was set before and not overriden
1657 if( ! empty( $type ) && $GLOBALS[$var] !== NULL )
1658 {
1659 // Force the type
1660 switch( $type )
1661 {
1662 case 'html':
1663- // do nothing
1664- break;
1665+ // do nothing
1666+ break;
1667
1668 case 'string':
1669- // strip out any html
1670- if( ! is_scalar($GLOBALS[$var]) )
1671- {
1672- // This happens if someone uses "foo[]=x" where "foo" is expected as string
1673- // TODO: dh> debug_die() instead?
1674- $GLOBALS[$var] = '';
1675- }
1676- else
1677- {
1678- $GLOBALS[$var] = trim( strip_tags($GLOBALS[$var]) );
1679- // Make sure the string is a single line
1680- // TODO: dh> this breaks e.g. multi-line widget params (e.g. "Custom TinyMCE init")
1681- // While this example works without newlines, there are probably places
1682- // where it's more important.
1683- // fp> Someone was hiding text. Can't remember exactly where.
1684- // Make a "multiline-string" where appropriate.
1685- $GLOBALS[$var] = preg_replace( '¤\r|\n¤', '', $GLOBALS[$var] );
1686- }
1687- break;
1688+ // strip out any html
1689+ if( ! is_scalar( $GLOBALS[$var] ) )
1690+ {
1691+ // This happens if someone uses "foo[]=x" where "foo" is expected as string
1692+ $GLOBALS[$var] = '';
1693+ }
1694+ else
1695+ {
1696+ $GLOBALS[$var] = trim( strip_tags( $GLOBALS[$var] ) );
1697+ // Make sure the string is a single line. While this example works without
1698+ // newlines, there are probably places where it's more important.
1699+ // fp> Someone was hiding text. Can't remember exactly where.
1700+ // Make a "multiline-string" where appropriate.
1701+ $GLOBALS[$var] = preg_replace( '¤\r|\n¤', '', $GLOBALS[$var] );
1702+ }
1703+ break;
1704
1705 default:
1706- if( substr( $type, 0, 1 ) == '/' )
1707- {
1708- // We want to match against a REGEXP
1709- if( preg_match( $type, $GLOBALS[$var] ) )
1710- {
1711- // Okay, match
1712- }
1713- elseif( $strict_typing == 'allow_empty' && empty($GLOBALS[$var]) )
1714- {
1715- // No match but we accept empty value
1716- }
1717- elseif( $strict_typing )
1718- {
1719- // We cannot accept this MISMATCH
1720+ if( substr( $type, 0, 1 ) == '/' )
1721+ {
1722+ // We want to match against a REGEXP
1723+ if( preg_match( $type, $GLOBALS[$var] ) )
1724+ {
1725+ // Okay, match
1726+ if( isset( $Debuglog ) ) $Debuglog->add( 'param(-): <strong>'.$var.'</strong> matched against '.$type, 'params' );
1727+ }
1728+ elseif( $strict_typing == 'allow_empty' && empty( $GLOBALS[$var] ) )
1729+ {
1730+ // No match but we accept empty value
1731+ if( isset( $Debuglog ) ) $Debuglog->add( 'param(-): <strong>'.$var.'</strong> is empty: ok', 'params' );
1732+ }
1733+ elseif( $strict_typing )
1734+ {
1735+ // We cannot accept this MISMATCH
1736+ bad_request_die( sprintf( T_('Illegal value received for parameter &laquo;%s&raquo;!'), $var ) );
1737+ }
1738+ else
1739+ {
1740+ // Fall back to default
1741+ $GLOBALS[$var] = $default;
1742+ }
1743+
1744+ // From now on, consider this as a string: (we need this when memorizing)
1745+ $type = 'string';
1746+ }
1747+ elseif( $GLOBALS[$var] === '' )
1748+ {
1749+ // Special handling of empty values
1750+ if( $strict_typing === false && $use_default )
1751+ {
1752+ // We want to consider empty values as invalid and fall back to the default value
1753+ $GLOBALS[$var] = $default;
1754+ }
1755+ else
1756+ {
1757+ // We memorize the empty value as NULL. fplanque> note: there might be side effects
1758+ // to this, but we need this to distinguish between 0 and 'no input' Note: we do this
1759+ // after regexps because we may or may not want to allow empty strings in regexps
1760+ $GLOBALS[$var] = NULL;
1761+ }
1762+ }
1763+ elseif( $GLOBALS[$var] === array() )
1764+ {
1765+ if( $strict_typing === false && $use_default )
1766+ {
1767+ // We want to consider empty values as invalid and fall back to the default value
1768+ $GLOBALS[$var] = $default;
1769+ }
1770+ }
1771+ else
1772+ {
1773+ if( $strict_typing )
1774+ {
1775+ // We want to make sure the value is valid
1776+ $regexp = '';
1777+ switch( $type )
1778+ {
1779+ case 'boolean':
1780+ $regexp = '/^(0|1|false|true)$/i';
1781+ break;
1782+
1783+ case 'integer':
1784+ $regexp = '/^(\+|-)?[0-9]+$/';
1785+ break;
1786+
1787+ case 'float':
1788+ case 'double':
1789+ $regexp = '/^(\+|-)?[0-9]+(.[0-9]+)?$/';
1790+ break;
1791+ // Note: other types are not tested here
1792+ }
1793+ if( $strict_typing == 'allow_empty' && empty( $GLOBALS[$var] ) )
1794+ {
1795+ // We have an empty value and we accept it
1796+ }
1797+ elseif( ! empty( $regexp ) && ( ! is_scalar( $GLOBALS[$var] ) || ! preg_match( $regexp, $GLOBALS[$var] ) ) )
1798+ {
1799+ // Value does not match!
1800 bad_request_die( sprintf( T_('Illegal value received for parameter &laquo;%s&raquo;!'), $var ) );
1801 }
1802- else
1803- {
1804- // Fall back to default
1805- $GLOBALS[$var] = $default;
1806- }
1807-
1808- // From now on, consider this as a string: (we need this when memorizing)
1809- $type = 'string';
1810- }
1811- elseif( $GLOBALS[$var] === '' )
1812- {
1813- // Special handling of empty values.
1814- if( $strict_typing === false && $use_default )
1815- {
1816- // ADDED BY FP 2006-07-06
1817- // We want to consider empty values as invalid and fall back to the default value:
1818- $GLOBALS[$var] = $default;
1819- }
1820- else
1821- {
1822- // We memorize the empty value as NULL:
1823- // fplanque> note: there might be side effects to this, but we need
1824- // this to distinguish between 0 and 'no input'
1825- // Note: we do this after regexps because we may or may not want to allow empty strings in regexps
1826- $GLOBALS[$var] = NULL;
1827- }
1828- }
1829- elseif( $GLOBALS[$var] === array() )
1830- {
1831- if( $strict_typing === false && $use_default )
1832- {
1833- // ADDED BY FP 2006-09-07
1834- // We want to consider empty values as invalid and fall back to the default value
1835- $GLOBALS[$var] = $default;
1836- }
1837- }
1838- // TODO: dh> if a var (e.g. from POST) comes in as '' but has type "array" it does not get "converted" to array type (nor gets the default used!)
1839- else
1840- {
1841- if( $strict_typing )
1842- {
1843- // We want to make sure the value is valid
1844- $regexp = '';
1845- switch( $type )
1846- {
1847- case 'boolean':
1848- $regexp = '/^(0|1|false|true)$/i';
1849- break;
1850-
1851- case 'integer':
1852- $regexp = '/^(\+|-)?[0-9]+$/';
1853- break;
1854-
1855- case 'float':
1856- case 'double':
1857- $regexp = '/^(\+|-)?[0-9]+(.[0-9]+)?$/';
1858- break;
1859-
1860- // Note: other types are not tested here
1861- }
1862- if( $strict_typing == 'allow_empty' && empty($GLOBALS[$var]) )
1863- {
1864- // We have an empty value and we accept it
1865- // ok..
1866- }
1867- elseif( !empty( $regexp ) && ( !is_scalar($GLOBALS[$var]) || !preg_match( $regexp, $GLOBALS[$var] ) ) )
1868- {
1869- // Value does not match!
1870- bad_request_die( sprintf( T_('Illegal value received for parameter &laquo;%s&raquo;!'), $var ) );
1871- }
1872- }
1873-
1874- // Change the variable type
1875- settype( $GLOBALS[$var], $type );
1876- }
1877+ }
1878+
1879+ // Change the variable type
1880+ settype( $GLOBALS[$var], $type );
1881+ }
1882 }
1883 }
1884
1885@@ -243,16 +241,16 @@
1886 // Memorize this parameter
1887 memorize_param( $var, $type, $default );
1888 }
1889+
1890 return $GLOBALS[$var];
1891 }
1892
1893
1894 /**
1895- * Get the param from an array param's first index instead of the value.
1896+ * Get the param from an array param's first index instead of the value
1897 *
1898 * E.g., for "param[value]" as a submit button you can get the value with
1899- * <code>Request::param_arrayindex( 'param' )</code>.
1900- *
1901+ * <code>Request::param_arrayindex( 'param' )</code>.
1902 * @see param_action()
1903 * @param string Param name
1904 * @param mixed Default to use
1905@@ -262,9 +260,9 @@
1906 {
1907 $array = array_keys( param( $param_name, 'array', array() ) );
1908 $value = array_pop( $array );
1909- if( is_string($value) )
1910+ if( is_string( $value ) )
1911 {
1912- $value = substr( strip_tags($value), 0, 50 ); // sanitize it
1913+ $value = substr( strip_tags( $value ), 0, 50 ); // sanitize it
1914 }
1915 elseif( ! empty( $value ) )
1916 {
1917@@ -286,8 +284,9 @@
1918 * If we got no "action" param, we'll check for an "actionArray" param
1919 * ( <input type="submit" name="actionArray[real_action]" ...> ).
1920 * And the real $action will be found in the first key...
1921- * When there are multiple submit buttons, this is smarter than checking the value which is a translated string.
1922- * When there is an image button, this allows to work around IE not sending the value (it only sends X & Y coords of the click).
1923+ * When there are multiple submit buttons, this is smarter than checking the value
1924+ * which is a translated string. When there is an image button, this allows to work
1925+ * around IE not sending the value (it only sends X & Y coords of the click).
1926 * @param mixed Default to use.
1927 * @return string
1928 */
1929@@ -295,7 +294,7 @@
1930 {
1931 $action = param( 'action', 'string', NULL, $memorize );
1932
1933- if( is_null($action) )
1934+ if( is_null( $action ) )
1935 {
1936 // Check $actionArray
1937 $action = param_arrayindex( 'actionArray', $default );
1938@@ -310,13 +309,20 @@
1939 /**
1940 * Get a param from cookie
1941 *
1942- * This is just a wrapper around {@link param()} which unsets and restores GET and POST.
1943- * IMHO this is less hackish, at least performance wise then using a $sources param for param()
1944+ * This is just a wrapper around {@link param()} which unsets and restores GET and
1945+ * POST. IMHO this is less hackish, at least performance wise then using a $sources
1946+ * param for param()
1947 * @uses param()
1948 * @see param()
1949 */
1950-function param_cookie($var, $type = '', $default = '', $memorize = false,
1951- $override = false, $use_default = true, $strict_typing = 'allow_empty')
1952+function param_cookie(
1953+ $var,
1954+ $type = '',
1955+ $default = '',
1956+ $memorize = false,
1957+ $override = false,
1958+ $use_default = true,
1959+ $strict_typing = 'allow_empty' )
1960 {
1961 $save_GET = $_GET;
1962 $save_POST = $_POST;
1963@@ -412,7 +418,6 @@
1964
1965 /**
1966 * Gets a param and makes sure it's a decimal number (no float, e.g. 3.14) in a given range.
1967- *
1968 * @param string param name
1969 * @param integer min value
1970 * @param integer max value
1971@@ -428,7 +433,6 @@
1972
1973 /**
1974 * Checks if the param is a decimal number (no float, e.g. 3.14) in a given range
1975- *
1976 * @param string param name
1977 * @param integer min value
1978 * @param integer max value
1979@@ -496,7 +500,6 @@
1980
1981 /**
1982 * Check if the value is a file name
1983- *
1984 * @param string param name
1985 * @param string error message
1986 * @return boolean true if OK
1987@@ -514,7 +517,6 @@
1988
1989 /**
1990 * Check if the value of a param is a regular expression (syntax).
1991- *
1992 * @param string param name
1993 * @param string error message
1994 * @param string|NULL error message for form field ($err_msg gets used if === NULL).
1995@@ -533,7 +535,6 @@
1996
1997 /**
1998 * Sets a date parameter by converting locale date (if valid) to ISO date
1999- *
2000 * If the date is not valid, it is set to the param unchanged (unconverted).
2001 * @param string param name
2002 * @param string error message
2003@@ -541,7 +542,12 @@
2004 * @param string Default (in the format of $date_format)
2005 * @param string date format (php format), defaults to {@link locale_datefmt()}
2006 */
2007-function param_date( $var, $err_msg, $required, $default = '', $date_format = NULL )
2008+function param_date(
2009+ $var,
2010+ $err_msg,
2011+ $required,
2012+ $default = '',
2013+ $date_format = NULL )
2014 {
2015 param( $var, 'string', $default );
2016
2017@@ -559,7 +565,8 @@
2018 /**
2019 * Check if param is an ISO date
2020 *
2021- * NOTE: for tokens like e.g. "D" (abbr. weekday), T_() gets used and it uses the current locale!
2022+ * NOTE: for tokens like e.g. "D" (abbr. weekday), T_() gets used and it uses
2023+ * the current locale!
2024 * @param string param name
2025 * @param string error message
2026 * @param boolean Is a non-empty date required?
2027@@ -590,33 +597,56 @@
2028 if( $m[1] == "\\\" ) return $m[2]; // escaped
2029 switch( $m[2] )
2030 {
2031- case "d": return "([0-3]\\d)"; // day, 01-31
2032- case "j": return "([1-3]?\\d)"; // day, 1-31
2033- case "l": return "(".str_replace("~", "\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["weekday"])))).")";
2034- case "D": return "(".str_replace("~", "\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["weekday_abbrev"])))).")";
2035+ case "d":
2036+ return "([0-3]\\d)"; // day, 01-31
2037+
2038+ case "j":
2039+ return "([1-3]?\\d)"; // day, 1-31
2040+
2041+ case "l":
2042+ return "(".str_replace("~", "\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["weekday"])))).")";
2043+
2044+ case "D":
2045+ return "(".str_replace("~", "\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["weekday_abbrev"])))).")";
2046+
2047 case "e": // QP extension!
2048- return "(".str_replace("~", "\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["weekday_letter"])))).")";
2049- case "S": return "(st|nd|rd|th)"; // english suffix for day
2050-
2051- case "m": return "([0-1]\\d)"; // month, 01-12
2052- case "n": return "(1?\\d)"; // month, 1-12
2053- case "F": return "(".str_replace("~", "\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["month"])))).")"; // A full textual representation of a month, such as January or March
2054- case "M": return "(".str_replace("~", "\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["month_abbrev"])))).")";
2055-
2056- case "y": return "(\\d\\d)"; // year, 00-99
2057- case "Y": return "(\\d{4})"; // year, XXXX
2058+ return "(".str_replace("~", "\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["weekday_letter"])))).")";
2059+
2060+ case "S":
2061+ return "(st|nd|rd|th)"; // english suffix for day
2062+
2063+ case "m":
2064+ return "([0-1]\\d)"; // month, 01-12
2065+
2066+ case "n":
2067+ return "(1?\\d)"; // month, 1-12
2068+
2069+ case "F":
2070+ return "(".str_replace("~", "\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["month"])))).")"; // A full textual representation of a month, such as January or March
2071+
2072+ case "M":
2073+ return "(".str_replace("~", "\~", implode("|", array_map("trim", array_map("T_", $GLOBALS["month_abbrev"])))).")";
2074+
2075+ case "y":
2076+ return "(\\d\\d)"; // year, 00-99
2077+
2078+ case "Y":
2079+ return "(\\d{4})"; // year, XXXX
2080+
2081 default:
2082- return $m[0];
2083+ return $m[0];
2084 }' ), $date_format ).'$~i'; // case-insensitive?
2085- // Allow additional spaces, e.g. "03 May 2007" when format is "d F Y":
2086+
2087+ // Allow additional spaces, e.g. "03 May 2007" when format is "d F Y"
2088 $date_regexp = preg_replace( '~ +~', '\s+', $date_regexp );
2089
2090 // Check that the numbers match the date pattern
2091 if( preg_match( $date_regexp, $GLOBALS[$var], $numbers ) )
2092 {
2093- // Date does match pattern
2094- // Get all date pattern parts. We should get 3 parts!
2095- preg_match_all( '/(?<!\\\\)[A-Za-z]/', $date_format, $parts ); // "(?<!\\\\)" means that the letter is not escaped with "\"
2096+ // Date does match pattern ... Get all date pattern parts. We should get 3 parts!
2097+
2098+ // "(?<!\\\\)" means that the letter is not escaped with "\"
2099+ preg_match_all( '/(?<!\\\\)[A-Za-z]/', $date_format, $parts );
2100 $day = null;
2101 $month = null;
2102 $year = null;
2103@@ -627,46 +657,52 @@
2104 {
2105 case 'd':
2106 case 'j':
2107- $day = $numbers[$position+1];
2108- break;
2109+ $day = $numbers[$position+1];
2110+ break;
2111
2112 case 'm':
2113 case 'n':
2114- $month = $numbers[$position+1];
2115- break;
2116- case 'F': // full month name
2117- $month = array_search( strtolower($numbers[$position+1]), array_map('strtolower', array_map('trim', array_map('T_', $GLOBALS['month']))) );
2118- break;
2119+ $month = $numbers[$position+1];
2120+ break;
2121+
2122+ // full month name
2123+ case 'F':
2124+ $month = array_search(
2125+ strtolower( $numbers[$position+1] ), array_map( 'strtolower', array_map(
2126+ 'trim', array_map( 'T_', $GLOBALS['month'] ) ) ) );
2127+ break;
2128+
2129 case 'M':
2130- $month = array_search( strtolower($numbers[$position+1]), array_map('strtolower', array_map('trim', array_map('T_', $GLOBALS['month_abbrev']))) );
2131- break;
2132+ $month = array_search(
2133+ strtolower( $numbers[$position+1] ), array_map( 'strtolower', array_map(
2134+ 'trim', array_map( 'T_', $GLOBALS['month_abbrev'] ) ) ) );
2135+ break;
2136
2137 case 'y':
2138 case 'Y':
2139- $year = $numbers[$position+1];
2140- if( $year < 50 )
2141- {
2142- $year = 2000 + $year;
2143- }
2144- elseif( $year < 100 )
2145- {
2146- $year = 1900 + $year;
2147- }
2148- break;
2149+ $year = $numbers[$position+1];
2150+ if( $year < 50 )
2151+ {
2152+ $year = 2000 + $year;
2153+ }
2154+ elseif( $year < 100 )
2155+ {
2156+ $year = 1900 + $year;
2157+ }
2158+ break;
2159 }
2160 }
2161
2162 if( checkdate( $month, $day, $year ) )
2163 {
2164- // all clean! :) We convert the value to ISO:
2165+ // all clean! :) We convert the value to ISO
2166 $iso_date = substr( '0'.$year, -4 ).'-'.substr( '0'.$month, -2 ).'-'.substr( '0'.$day, -2 );
2167
2168 return $iso_date;
2169 }
2170 }
2171
2172- // Date did not pass all tests:
2173-
2174+ // Date did not pass all tests
2175 param_error( $var, $err_msg );
2176
2177 return false;
2178@@ -676,13 +712,11 @@
2179 /**
2180 * Sets a date parameter with values from the request or to provided default,
2181 * And check we have a compact date (numbers only) ( used for URL filtering )
2182- *
2183 * @param string Variable to set
2184 * @param mixed Default value or TRUE if user input required
2185 * @param boolean memorize ( see {@link param()} )
2186 * @param string error message
2187 * @param boolean 'required': Is non-empty date required? Default: true.
2188- *
2189 * @return string the compact date value ( yyyymmdd )
2190 */
2191 function param_compact_date( $var, $default = '', $memorize = false, $err_msg, $required = false )
2192@@ -712,10 +746,11 @@
2193
2194
2195 /**
2196+ * Set a time parameter with the value from the request of the var argument
2197+ *
2198 * Sets a time parameter with the value from the request of the var argument
2199 * or of the concat of the var argument_h: var argument_mn: var argument_s ,
2200 * except if param is already set!
2201- *
2202 * @param string Variable to set
2203 * @param mixed Default value or TRUE if user input required
2204 * @param boolean Do we need to memorize this to regenerate the URL for this page?
2205@@ -741,7 +776,7 @@
2206 }
2207 }
2208 elseif( ( $time_h = param( $var.'_h', 'integer', -1 ) ) != -1
2209- && ( $time_mn = param( $var.'_mn', 'integer', -1 ) ) != -1 )
2210+ && ( $time_mn = param( $var.'_mn', 'integer', -1 ) ) != -1 )
2211 {
2212 // Got a time from selects
2213 $time_s = param( $var.'_s', 'integer', 0 );
2214@@ -770,10 +805,9 @@
2215 /**
2216 * Extend a LIST parameter with an ARRAY param.
2217 *
2218- * Will be used for author/authorsel[], etc.
2219- * Note: cannot be used for catsel[], because catsel is NON-recursive.
2220+ * Will be used for author/authorsel[], etc. Note: cannot be used for catsel[]
2221+ * because catsel is NON-recursive.
2222 * @see param_compile_cat_array()
2223- *
2224 * @param string Variable to extend
2225 * @param string Name of array Variable to use as an extension
2226 * @param boolean Save non numeric prefix? ( 1 char -- can be used as a modifier, e-g: - + * )
2227@@ -813,8 +847,8 @@
2228 }
2229 }
2230
2231- // Merge values:
2232- if( empty($original_val) )
2233+ // Merge values
2234+ if( empty( $original_val ) )
2235 {
2236 $original_values_array = array();
2237 }
2238@@ -832,8 +866,9 @@
2239
2240
2241 /**
2242- * Compiles the cat array from $cat (recursive + optional modifiers) and $catsel[] (non recursive)
2243- * and keeps those values available for future reference (category widget)
2244+ * Compiles the cat array from $cat (recursive + optional modifiers) and
2245+ * $catsel[] (non recursive) and keeps those values available for future
2246+ * reference (category widget)
2247 */
2248 function param_compile_cat_array( $restrict_to_blog = 0, $cat_default = NULL, $catsel_default = array() )
2249 {
2250@@ -1511,31 +1546,6 @@
2251 }
2252
2253
2254-
2255-
2256-
2257-/**
2258- * Sets an HTML parameter and checks for sanitized code.
2259- *
2260- * WARNING: this does *NOT* (necessarilly) make the HTML code safe.
2261- * It only checks on it and produces error messages.
2262- * It is NOT (necessarily) safe to use the output.
2263- *
2264- * @todo dh> Not implemented?!
2265- *
2266- * @param string Variable to set
2267- * @param mixed Default value or TRUE if user input required
2268- * @param boolean memorize ( see {@link param()} )
2269- * @param string error message
2270- *
2271- * @return string
2272- */
2273-function param_html( $var, $default = '', $memorize = false, $err_msg )
2274-{
2275-
2276-}
2277-
2278-
2279 /**
2280 * Checks for sanitized code.
2281 *
2282@@ -1551,7 +1561,7 @@
2283 {
2284 global $Messages;
2285
2286- $altered_html = check_html_sanity( $GLOBALS[$var], 'posting', $autobr );
2287+ $altered_html = check_html_sanity( array( 'param_check_html' => '1' ), $GLOBALS[$var], 'posting', $autobr );
2288
2289 if( $altered_html === false )
2290 {
2291@@ -1581,7 +1591,7 @@
2292 */
2293 function format_to_post( $content, $autobr = 0, $is_comment = 0, $encoding = NULL )
2294 {
2295- $ret = check_html_sanity( $content, ( $is_comment ? 'commenting' : 'posting' ), $autobr, $encoding );
2296+ $ret = check_html_sanity( array( 'format_to_post' => '1' ), $content, ( $is_comment ? 'commenting' : 'posting' ), $autobr, $encoding );
2297 if( $ret === false )
2298 {
2299 // ERROR
2300@@ -1618,14 +1628,22 @@
2301 * visible HTML? Forced to true when "commenting".
2302 * @return boolean|string
2303 */
2304-function check_html_sanity( $content, $context = 'posting', $autobr = false,
2305- $encoding = NULL, $escape_comments = false )
2306+function check_html_sanity(
2307+ $source = array(),
2308+ $content,
2309+ $context = 'posting',
2310+ $autobr = false,
2311+ $encoding = NULL,
2312+ $escape_comments = false )
2313 {
2314- global $use_balanceTags, $admin_url;
2315- global $io_charset, $use_xhtmlvalidation_for_comments, $comment_allowed_tags, $comments_allow_css_tweaks;
2316+ global $admin_url;
2317+ global $balance_tags;
2318+ global $comments_allow_css_tweaks;
2319+ global $comment_allowed_tags;
2320+ global $current_User;
2321+ global $io_charset;
2322 global $Messages;
2323-
2324- global $current_User;
2325+ global $xhtml_validate_comments;
2326
2327 switch( $context )
2328 {
2329@@ -1648,7 +1666,7 @@
2330 break;
2331
2332 case 'commenting':
2333- $xhtmlvalidation = $use_xhtmlvalidation_for_comments;
2334+ $xhtmlvalidation = $xhtml_validate_comments;
2335 $allow_css_tweaks = $comments_allow_css_tweaks;
2336 $allow_javascript = false;
2337 $allow_iframes = false;
2338@@ -1700,7 +1718,7 @@
2339
2340 $content = trim( $content );
2341
2342- if( $use_balanceTags )
2343+ if( $balance_tags )
2344 {
2345 // Auto close open tags
2346 $content = balance_tags( $content );
2347@@ -1709,11 +1727,11 @@
2348 if( $context == 'commenting' || $escape_comments )
2349 {
2350 // Comments, processing instructions etc. are not allowed when commenting.
2351- $content = str_replace( array(
2352- // Comments, CDATA sections and various declarations.
2353- // Declarations end with a single '>' which makes it hard
2354- // to correctly detect their closing tags. Thus, we don't
2355- // even try to do that (FIXME).
2356+ $content = str_replace(
2357+ array(
2358+ // Comments, CDATA sections and various declarations. Declarations end with
2359+ // a single '>' which makes it hard to correctly detect their closing tags.
2360+ // Thus, we don't even try to do that (FIXME).
2361 '<!',
2362 // Closing comments
2363 '-->',
2364@@ -1721,22 +1739,80 @@
2365 ']]>',
2366 // Processing instructions
2367 '<?',
2368- '?>',
2369- ), array(
2370+ '?>', ),
2371+ array(
2372 '&lt;!',
2373 '--&gt;',
2374 ']]&gt;',
2375 '&lt;?',
2376- '?&gt;',
2377- ), $content );
2378+ '?&gt;', ),
2379+ $content );
2380 }
2381
2382 if( $xhtmlvalidation )
2383 {
2384 // We want to validate XHTML
2385- load_class( 'xhtml_validator/_xhtml_validator.class.php' );
2386-
2387- $XHTML_Validator = new XHTML_Validator( $context, $allow_css_tweaks, $allow_iframes, $allow_javascript, $allow_objects, $encoding );
2388+
2389+ // figure out what we want to validate against ($flavor)
2390+ $skip = false;
2391+ $flavor = 'xhtml';
2392+ $source = array_merge( array(
2393+ 'template_type' => '', 'main_cat_ID' => 0, 'item_ID' => 0,
2394+ ), $source );
2395+
2396+ // if we have template_type we're done
2397+ if( $source['template_type'] )
2398+ {
2399+ $flavor = $source['template_type'];
2400+ $skip = true;
2401+ }
2402+
2403+ // if we come from param_check_html() we're almost done
2404+ if( ! $skip && $source['param_check_html'] )
2405+ {
2406+ global $Blog;
2407+
2408+ // during blog creation, $Blog is NULL but template_ID has a value
2409+ if( is_null( $Blog ) )
2410+ {
2411+ $template_ID = $_POST['template_ID'];
2412+ $TemplateCache = & get_Cache( 'TemplateCache' );
2413+ $Template = $TemplateCache->get_by_ID( $template_ID, false );
2414+ $flavor = $Template->type;
2415+ $skip = true;
2416+ }
2417+ else
2418+ {
2419+ $flavor = $Blog->template_type;
2420+ $skip = true;
2421+ }
2422+ }
2423+
2424+ // okay let's get a $blog_ID value if we can
2425+ if( ! $skip && $source['main_cat_ID'] )
2426+ {
2427+ $blog_ID = get_catblog( $main_cat ); // @todo (0000) should not die, if cat does not exist!
2428+ }
2429+ elseif( $source['item_ID'] )
2430+ {
2431+ $ItemCache = & get_Cache( 'ItemCache' );
2432+ $current_Item = & $ItemCache->get_by_ID( $source['item_ID'], false );
2433+ $blog_ID = get_catblog( $current_Item->main_cat_ID ); // @todo (0000) should not die, if cat does not exist!
2434+ }
2435+ else
2436+ {
2437+ $blog_ID = 0;
2438+ }
2439+
2440+ if( ! $skip && $blog_ID != 0 )
2441+ {
2442+ // Get the appropriate blog from the cache
2443+ $BlogCache = & get_Cache( 'BlogCache' );
2444+ $Blog = & $BlogCache->get_by_ID( $blog_ID, false, false );
2445+ $flavor = $Blog->template_type;
2446+ }
2447+
2448+ $XHTML_Validator = new XHTML_Validator( $flavor, $context, $allow_css_tweaks, $allow_iframes, $allow_javascript, $allow_objects, $encoding );
2449
2450 if( ! $XHTML_Validator->check( $content ) )
2451 {
2452@@ -1746,8 +1822,9 @@
2453 else
2454 {
2455 // We do not WANT to validate XHTML, fall back to basic security checking:
2456- // This is only as strong as its regexps can parse xhtml. This is significantly inferior to the XHTML checker above.
2457- // The only advantage of this checker is that it can check for a little security without requiring VALID XHTML.
2458+ // This is only as strong as its regexps can parse xhtml. This is significantly
2459+ // inferior to the XHTML checker above. The only advantage of this checker is
2460+ // that it can check for a little security without requiring VALID XHTML.
2461
2462 if( $context == 'commenting' )
2463 {
2464@@ -1757,11 +1834,10 @@
2465 else if( ! $escape_comments
2466 && preg_match_all( '#(?:<!--|<!\[CDATA\[|<\?)#i', $content, $matches, PREG_OFFSET_CAPTURE ) )
2467 {
2468- // We are posting an item, try an el-cheapo check for unclosed
2469- // comments, processing instructions etc.
2470- // Declarations end with a single '>' which is hard to detect
2471- // correctly, so we don't try to validate them here. In theory,
2472- // this may be an issue, but apparently, it's not a big threat.
2473+ // We are posting an item, try an el-cheapo check for unclosed comments,
2474+ // processing instructions etc. Declarations end with a single '>' which
2475+ // is hard to detect correctly, so we don't try to validate them here. In
2476+ // theory this may be an issue, but apparently, it's not a big threat.
2477 static $search = array(
2478 '<!--' => '-->',
2479 '<![CDATA[' => ']]>',
2480@@ -1794,15 +1870,15 @@
2481 // No error yet?
2482 $check = $content;
2483
2484- // CHECK Styling restictions:
2485+ // CHECK Styling restictions
2486 if( ! $allow_css_tweaks
2487- && preg_match( '#\s((style|class|id)\s*=)#i', $check, $matches) )
2488+ && preg_match( '#\s((style|class|id)\s*=)#i', $check, $matches ) )
2489 {
2490 $Messages->add( T_('Illegal CSS markup found: ').htmlspecialchars( $matches[1] ), 'error' );
2491 $error = true;
2492 }
2493
2494- // CHECK JAVASCRIPT:
2495+ // CHECK JAVASCRIPT
2496 if( ! $allow_javascript
2497 && ( preg_match( '¤( < \s* //? \s* (script|noscript) )¤xi', $check, $matches )
2498 || preg_match( '#\s((on[a-z]+)\s*=)#i', $check, $matches )
2499@@ -1813,7 +1889,7 @@
2500 $error = true;
2501 }
2502
2503- // CHECK IFRAMES:
2504+ // CHECK IFRAMES
2505 if( ! $allow_iframes
2506 && preg_match( '¤( < \s* //? \s* (frame|iframe) )¤xi', $check, $matches) )
2507 {
2508@@ -1821,7 +1897,7 @@
2509 $error = true;
2510 }
2511
2512- // CHECK OBJECTS:
2513+ // CHECK OBJECTS
2514 if( ! $allow_objects
2515 && preg_match( '¤( < \s* //? \s* (applet|object|param|embed) )¤xi', $check, $matches) )
2516 {
2517@@ -1834,11 +1910,12 @@
2518 if( $error )
2519 {
2520 if( ! empty( $current_User )
2521- && ! empty( $Group ) // This one will basically prevent this case from happening when commenting
2522- && $current_User->check_perm( 'users', 'edit', false ) )
2523+ && ! empty( $Group ) // This one will basically prevent this case from happening when commenting
2524+ && $current_User->check_perm( 'users', 'edit', false ) )
2525 {
2526- $Messages->add( sprintf( T_('(Note: To get rid of the above validation warnings, you can deactivate unwanted validation rules in your <a %s>Group settings</a>.)'),
2527- 'href="'.$admin_url.'?ctrl=users&amp;grp_ID='.$Group->ID.'"' ), 'error' );
2528+ $Messages->add(
2529+ sprintf( T_('(Note: To get rid of the above validation warnings, you can deactivate unwanted validation rules in your <a %s>Group settings</a>.)'),
2530+ 'href="'.$admin_url.'?ctrl=users&amp;grp_ID='.$Group->ID.'"' ), 'error' );
2531 }
2532 return false;
2533 }
2534@@ -1850,7 +1927,6 @@
2535
2536 /**
2537 * Balances Tags of string using a modified stack.
2538- *
2539 * @param string HTML to be balanced
2540 * @return string Balanced HTML
2541 */
2542
2543=== modified file 'qp_inc/_core/_template.funcs.php'
2544--- qp_inc/_core/_template.funcs.php 2013-03-04 20:46:54 +0000
2545+++ qp_inc/_core/_template.funcs.php 2013-03-11 07:27:21 +0000
2546@@ -82,7 +82,7 @@
2547
2548 if( $redirect_to[0] == '/' )
2549 {
2550- // @todo (0000): until all calls to header_redirect are cleaned up:
2551+ // @todo (0000) until all calls to header_redirect are cleaned up:
2552 global $ReqHost;
2553 $redirect_to = $ReqHost.$redirect_to;
2554 // debug_die( '$redirect_to must be an absolute URL' );
2555@@ -202,11 +202,11 @@
2556 *
2557 * 'auto_pilot' => 'seo_title' uses the SEO title autopilot. (default: "none")
2558 *
2559- * @todo (0000): single month: Respect locales datefmt
2560- * @todo (0000): single post: posts do no get proper checking (wether they are in the requested
2561+ * @todo (0000) single month: Respect locales datefmt
2562+ * @todo (0000) single post: posts do no get proper checking (wether they are in the requested
2563 * blog or whether their permissions match user rights, thus the title sometimes gets displayed
2564 * even when it should not. We need to pre-query the ItemList instead!!
2565- * @todo (0000): make it complete with all possible params!
2566+ * @todo (0000) make it complete with all possible params!
2567 */
2568 function request_title( $params = array() )
2569 {
2570@@ -472,7 +472,7 @@
2571 '#jqueryUI_debug#' => 'jquery.ui.all.js',
2572 );
2573
2574- // @todo (0000): dh> I think dependencies should get handled where the files are included!
2575+ // @todo (0000) dh> I think dependencies should get handled where the files are included!
2576 if( in_array( $js_file, array( '#jqueryUI#', '#jqueryUI_debug#' ) ) )
2577 {
2578 // Dependency : ensure jQuery is loaded
2579@@ -676,7 +676,7 @@
2580
2581 /**
2582 * T-Tag: Registers all the javascripts needed by the toolbar menu
2583- * @todo (0000): fp> include basic.css ? -- rename to add_headlines_for* -- potential
2584+ * @todo (0000) fp> include basic.css ? -- rename to add_headlines_for* -- potential
2585 * problem with inclusion order of CSS files!! dh> would be nice to have the batch of CSS in
2586 * a separate file. basic.css would get included first always, then e.g. this toolbar.css.
2587 */
2588@@ -689,7 +689,7 @@
2589
2590 require_js( '#jquery#' );
2591 require_js( 'functions.min.js' ); // for rollovers AddEvent - TODO: change to jQuery
2592- require_js( 'rollovers.js' ); // @todo (0000): change to jQuery
2593+ require_js( 'rollovers.js' ); // @todo (0000) change to jQuery
2594 // Superfish menus:
2595 require_js( 'hoverintent.js' );
2596 require_js( 'superfish.js' );
2597@@ -709,14 +709,28 @@
2598 /**
2599 * T-Tag: Outputs the collected HTML HEAD lines.
2600 * @see add_headline()
2601+ * @param string The template's type (default is 'xthml')
2602 * @return string
2603 */
2604-function include_headlines()
2605+function include_headlines( $type = 'xhtml' )
2606 {
2607 global $headlines;
2608
2609 if( $headlines )
2610 {
2611+
2612+ if( $type == 'html5' )
2613+ {
2614+ // http://php.net/manual/en/language.types.array.php Example 3...
2615+ foreach( $headlines as &$headline )
2616+ {
2617+ $headline = str_replace( "<script type=\"text/javascript\"", "<script", $headline );
2618+ $headline = str_replace( "<style type=\"text/css\"", "<style", $headline );
2619+ $headline = str_replace( "<link rel=\"stylesheet\" type=\"text/css\"", "<link rel=\"stylesheet\"", $headline );
2620+ }
2621+ unset( $headline );
2622+ }
2623+
2624 echo "\n".implode( "\n", $headlines );
2625 echo "\n";
2626 }
2627
2628=== modified file 'qp_inc/_core/model/__core.install.php'
2629--- qp_inc/_core/model/__core.install.php 2013-03-04 07:34:42 +0000
2630+++ qp_inc/_core/model/__core.install.php 2013-03-11 07:27:21 +0000
2631@@ -53,6 +53,7 @@
2632 blog_allowblogcss TINYINT(1) NOT NULL default 1,
2633 blog_allowusercss TINYINT(1) NOT NULL default 1,
2634 blog_template_ID INT(10) UNSIGNED NOT NULL DEFAULT 1,
2635+ blog_template_type ENUM('xhtml','html5','feed','other') NOT NULL default 'xhtml',
2636 blog_in_bloglist TINYINT(1) NOT NULL DEFAULT 1,
2637 blog_links_blog_ID INT(11) NULL DEFAULT NULL,
2638 blog_media_location ENUM( 'default', 'subdir', 'custom', 'none' ) DEFAULT 'default' NOT NULL,
2639@@ -420,17 +421,18 @@
2640 "CREATE TABLE T_templates__template (
2641 template_ID INT(10) unsigned NOT NULL auto_increment,
2642 template_name VARCHAR(32) NOT NULL,
2643- template_type ENUM('xhtml','feed','other') NOT NULL default 'xhtml',
2644+ template_type ENUM('xhtml','html5','feed','other') NOT NULL default 'xhtml',
2645 template_folder VARCHAR(32) NOT NULL,
2646 PRIMARY KEY template_ID (template_ID),
2647 UNIQUE template_folder( template_folder ),
2648 KEY template_name( template_name )
2649 ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" ),
2650
2651- 'T_templates__container' => array( 'Creating table for template containers',
2652+ 'T_templates__container' => array( 'Creating template containers table',
2653 "CREATE TABLE T_templates__container (
2654 sco_template_ID INT(10) unsigned NOT NULL,
2655 sco_name VARCHAR(40) NOT NULL,
2656+ sco_order TINYINT NOT NULL default 0,
2657 PRIMARY KEY ( sco_template_ID, sco_name )
2658 ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" ),
2659
2660
2661=== modified file 'qp_inc/collections/coll_settings.ctrl.php'
2662--- qp_inc/collections/coll_settings.ctrl.php 2011-07-20 06:26:28 +0000
2663+++ qp_inc/collections/coll_settings.ctrl.php 2013-03-11 07:27:21 +0000
2664@@ -253,8 +253,8 @@
2665 break;
2666
2667 case 'template':
2668- $AdminUI->disp_view( 'templates/views/_coll_template_settings.form.php' );
2669- $AdminUI->disp_view( 'templates/views/_coll_template.view.php' );
2670+ $AdminUI->disp_view( 'templates/views/_template_settings.form.php' );
2671+ $AdminUI->disp_view( 'templates/views/_template_select.view.php' );
2672 break;
2673
2674 case 'plugin_settings':
2675
2676=== modified file 'qp_inc/collections/collections.ctrl.php'
2677--- qp_inc/collections/collections.ctrl.php 2012-07-21 09:43:31 +0000
2678+++ qp_inc/collections/collections.ctrl.php 2013-03-11 07:27:21 +0000
2679@@ -269,7 +269,7 @@
2680 $AdminUI->displayed_sub_begin = 1; // DIRTY HACK :/ replacing an even worse hack...
2681 $AdminUI->disp_payload_begin();
2682
2683- $AdminUI->disp_view( 'templates/views/_coll_sel_template.view.php' );
2684+ $AdminUI->disp_view( 'templates/views/_template_select_create.view.php' );
2685
2686 $AdminUI->disp_payload_end();
2687 break;
2688
2689=== modified file 'qp_inc/collections/model/_blog.class.php'
2690--- qp_inc/collections/model/_blog.class.php 2011-03-14 23:04:42 +0000
2691+++ qp_inc/collections/model/_blog.class.php 2013-03-11 07:27:21 +0000
2692@@ -95,6 +95,11 @@
2693 var $media_fullpath = '';
2694 var $media_url = '';
2695 var $default_cat_ID;
2696+ /**
2697+ * This blog's template type
2698+ * @var string
2699+ */
2700+ var $template_type;
2701
2702 /**
2703 * Constructor
2704@@ -125,6 +130,7 @@
2705 $this->set( 'locale', $default_locale );
2706 $this->set( 'access_type', 'index.php' );
2707 $this->template_ID = 1; // TODO: this is the DB default, but it will fail if template #1 does not exist
2708+ $this->template_type = 'xhtml';
2709 }
2710 else
2711 {
2712@@ -154,6 +160,7 @@
2713 $this->media_fullpath = $db_row->blog_media_fullpath;
2714 $this->media_url = $db_row->blog_media_url;
2715 $this->UID = $db_row->blog_UID;
2716+ $this->template_type = $db_row->blog_template_type;
2717 }
2718 }
2719
2720@@ -1405,6 +1412,11 @@
2721 $this->set_from_Request( 'template_ID' );
2722 }
2723
2724+ if( param( 'blog_template_type', 'string', NULL ) !== NULL )
2725+ {
2726+ $this->set( 'template_type', get_param( 'blog_template_type' ) );
2727+ }
2728+
2729 if( param( 'what_to_show', 'string', NULL ) !== NULL )
2730 { // Show x days or x posts?:
2731 $this->set_setting( 'what_to_show', get_param( 'what_to_show' ) );
2732
2733=== modified file 'qp_inc/comments/views/_comment.form.php'
2734--- qp_inc/comments/views/_comment.form.php 2010-12-31 12:12:03 +0000
2735+++ qp_inc/comments/views/_comment.form.php 2013-03-11 07:27:21 +0000
2736@@ -2,269 +2,245 @@
2737 /**
2738 * This file implements the Comment form.
2739 *
2740- * This file is part of the Quam Plures project - {@link http://quamplures.net/}.
2741- * See also {@link https://launchpad.net/quam-plures}.
2742- *
2743- * @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
2744- * @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}.
2745- *
2746- * @license http://quamplures.net/license.html GNU General Public License (GPL)
2747- *
2748- * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
2749- * @author fplanque: Francois PLANQUE
2750- *
2751- * @package pond
2752+ * @author {@link http://wonderwinds.com/ Ed Bennett}
2753+ * @author {@link http://fplanque.net/ Francois PLANQUE}
2754+ * @copyright (c) 2009 by {@link http://quamplures.net/ the Quam Plures project}
2755+ * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
2756+ * @package comments
2757 */
2758-if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
2759+if(!defined('QP_MAIN_INIT')) die('fail');
2760
2761-/**
2762- * @var Blog
2763- */
2764 global $Blog;
2765-/**
2766- * @var Comment
2767- */
2768+global $comments_use_autobr;
2769 global $edited_Comment;
2770-/**
2771- *
2772- */
2773+global $mode;
2774+global $month;
2775 global $Plugins;
2776-
2777-global $comments_use_autobr, $mode, $month, $tab, $redirect_to;
2778+global $redirect_to;
2779+global $tab;
2780
2781 $Form = new Form( NULL, 'comment_checkchanges', 'post' );
2782-
2783 $Form->global_icon( T_('Cancel editing!'), 'close', str_replace( '&', '&amp;', $redirect_to), T_('cancel'), 4, 1 );
2784-
2785 $Form->begin_form( 'eform' );
2786-
2787-$Form->hidden( 'ctrl', 'comments' );
2788+$Form->hidden_ctrl();
2789 $Form->hidden( 'action', 'update' );
2790 $Form->hidden( 'redirect_to', $redirect_to );
2791 $Form->hidden( 'comment_ID', $edited_Comment->ID );
2792 ?>
2793
2794 <div class="clear"></div>
2795-
2796 <div class="left_col">
2797-
2798-
2799- <?php
2800- $Form->begin_fieldset( T_('Comment contents') );
2801-
2802- echo '<table cellspacing="0" class="compose_layout">';
2803-
2804- echo '<tr><td width="1%"><strong>'.T_('In response to').':</strong></td>';
2805- echo '<td class="input">';
2806- $comment_Item = & $edited_Comment->get_Item();
2807- // display and link item title
2808- $comment_Item->title( array(
2809- 'link_type' => 'admin_view',
2810- ) );
2811- echo '</td></tr>';
2812-
2813- if( ! $edited_Comment->get_author_User() )
2814- { // This is not a member comment
2815- $Form->switch_layout( 'none' );
2816-
2817- echo '<tr><td width="1%"><strong>'.T_('Author').':</strong></td>';
2818- echo '<td class="input">';
2819- $Form->text_input( 'newcomment_author', $edited_Comment->author, 20, '', '', array('maxlength'=>100, 'style'=>'width: 100%;') );
2820- echo '</td></tr>';
2821-
2822- echo '<tr><td width="1%"><strong>'.T_('Email').':</strong></td>';
2823- echo '<td class="input">';
2824- $Form->text_input( 'newcomment_author_email', $edited_Comment->author_email, 20, '', '', array('maxlength'=>100, 'style'=>'width: 100%;') );
2825- echo '</td></tr>';
2826-
2827- echo '<tr><td width="1%"><strong>'.T_('Website URL').':</strong></td>';
2828- echo '<td class="input">';
2829- $Form->text_input( 'newcomment_author_url', $edited_Comment->author_url, 20, '', '', array('maxlength'=>100, 'style'=>'width: 100%;') );
2830- echo '</td></tr>';
2831-
2832- $Form->switch_layout( NULL );
2833- }
2834- else
2835- {
2836- echo '<tr><td width="1%"><strong>'.T_('Author').':</strong></td>';
2837- echo '<td class="input">';
2838- // display comment author's name
2839- $edited_Comment->author( array() );
2840- echo '</td></tr>';
2841- }
2842-
2843- echo '</table>';
2844- ?>
2845+<?php
2846+$Form->begin_fieldset( T_('Comment contents') );
2847+echo '<table cellspacing="0" class="compose_layout">';
2848+echo '<tr><td width="1%"><strong>'.T_('In response to').':</strong></td>';
2849+echo '<td class="input">';
2850+$comment_Item = & $edited_Comment->get_Item();
2851+// display and link item title
2852+$comment_Item->title( array(
2853+ 'link_type' => 'admin_view',
2854+) );
2855+echo '</td></tr>';
2856+
2857+if( ! $edited_Comment->get_author_User() )
2858+{
2859+ // This is not a member comment
2860+ $Form->switch_layout( 'none' );
2861+
2862+ echo '<tr><td width="1%"><strong>'.T_('Author').':</strong></td>';
2863+ echo '<td class="input">';
2864+ $Form->text_input( 'newcomment_author', $edited_Comment->author, 20, '', '', array('maxlength' => 100, 'style' => 'width: 100%;') );
2865+ echo '</td></tr>';
2866+
2867+ echo '<tr><td width="1%"><strong>'.T_('Email').':</strong></td>';
2868+ echo '<td class="input">';
2869+ $Form->text_input( 'newcomment_author_email', $edited_Comment->author_email, 20, '', '', array('maxlength' => 100, 'style' => 'width: 100%;') );
2870+ echo '</td></tr>';
2871+
2872+ echo '<tr><td width="1%"><strong>'.T_('Website URL').':</strong></td>';
2873+ echo '<td class="input">';
2874+ $Form->text_input( 'newcomment_author_url', $edited_Comment->author_url, 20, '', '', array('maxlength' => 100, 'style' => 'width: 100%;') );
2875+ echo '</td></tr>';
2876+
2877+ $Form->switch_layout( NULL );
2878+}
2879+else
2880+{
2881+ echo '<tr><td width="1%"><strong>'.T_('Author').':</strong></td>';
2882+ echo '<td class="input">';
2883+ // display comment author's name
2884+ $edited_Comment->author( array() );
2885+ echo '</td></tr>';
2886+}
2887+
2888+echo '</table>';
2889+?>
2890
2891 <div class="edit_toolbars">
2892 <?php
2893 // spark the plugin manager
2894 $Plugins->trigger_event( 'AdminDisplayToolbarAbove', array(
2895 'target_type' => 'Comment',
2896+ 'template_type' => $Blog->template_type,
2897 ) );
2898 ?>
2899 </div>
2900
2901- <?php // ---------------------------- TEXTAREA -------------------------------------
2902- $content = $edited_Comment->content;
2903- if( $comments_use_autobr == 'always' || $comments_use_autobr == 'opt-out' )
2904- {
2905- $content = unautobrize($content);
2906- }
2907+<?php // TEXTAREA
2908+$content = $edited_Comment->content;
2909+if( $comments_use_autobr == 'always' || $comments_use_autobr == 'opt-out' )
2910+{
2911+ $content = unautobrize( $content );
2912+}
2913
2914- $Form->fieldstart = '<div class="edit_area">';
2915- $Form->fieldend = "</div>\n";
2916- $Form->textarea( 'content', $content, 16, '', '', 40 , '' );
2917- $Form->fieldstart = '<div class="tile">';
2918- $Form->fieldend = '</div>';
2919- ?>
2920- <script type="text/javascript">
2921- <!--
2922- // This is for toolbar plugins
2923- var app_Canvas = document.getElementById('content');
2924- //-->
2925- </script>
2926+$Form->fieldstart = '<div class="edit_area">';
2927+$Form->fieldend = "</div>\n";
2928+$Form->textarea( 'content', $content, 16, '', '', 40, '' );
2929+$Form->fieldstart = '<div class="tile">';
2930+$Form->fieldend = '</div>';
2931+?>
2932+<script type="text/javascript">
2933+<!--
2934+// This is for toolbar plugins
2935+var app_Canvas = document.getElementById('content');
2936+//-->
2937+</script>
2938
2939 <div class="edit_toolbars">
2940 <?php
2941 // spark the plugin manager
2942 $Plugins->trigger_event( 'AdminDisplayToolbarBelow', array(
2943 'target_type' => 'Comment',
2944-) );
2945-?>
2946-</div>
2947-
2948- <div class="edit_actions">
2949- <input type="submit" value="<?php /* TRANS: This is the value of an input submit button */ echo T_('Save !'); ?>" class="SaveButton" tabindex="10" />
2950- <?php
2951- // ---------- DELETE ----------
2952- if( $action == 'editcomment' )
2953- {
2954- // display a link to delete a comment
2955- $edited_Comment->delete_link( array(
2956- 'class' => 'DeleteButton',
2957- ) );
2958- }
2959-
2960- // spark the plugin manager
2961- $Plugins->trigger_event( 'AdminDisplayEditorButton', array(
2962- 'target_type' => 'Comment',
2963- ) );
2964- ?>
2965- </div>
2966-
2967- <?php
2968- $Form->end_fieldset();
2969-
2970- $Form->begin_fieldset( T_('Advanced properties') );
2971-
2972- $Form->switch_layout( 'linespan' );
2973-
2974- if( $current_User->check_perm( 'edit_timestamp' ) )
2975- { // ------------------------------------ TIME STAMP -------------------------------------
2976- echo '<div id="itemform_edit_timestamp">';
2977- $Form->date( 'comment_issue_date', $edited_Comment->date, T_('Comment date') );
2978- echo ' '; // allow wrapping!
2979- $Form->time( 'comment_issue_time', $edited_Comment->date, '' );
2980- echo '</div>';
2981- }
2982-
2983- // --------------------------- AUTOBR --------------------------------------
2984- // fp> TODO: this should be Auto-P and handled by the Auto-P plugin
2985- ?>
2986- <input type="checkbox" class="checkbox" name="post_autobr" value="1"
2987- <?php if( $comments_use_autobr == 'always' || $comments_use_autobr == 'opt-out' ) echo ' checked="checked"' ?>
2988- id="autobr" tabindex="6" />
2989- <label for="autobr"><strong><?php echo T_('Auto-BR') ?></strong></label>
2990-
2991- <?php
2992-
2993- $Form->switch_layout( NULL );
2994-
2995- $Form->end_fieldset();
2996-
2997- // ####################### PLUGIN FIELDSETS #########################
2998- // spark the plugin manager
2999- $Plugins->trigger_event( 'AdminDispCommentFormField', array(
3000- 'Form' => & $Form,
3001- 'Comment' => & $edited_Comment,
3002- ) );
3003- ?>
3004-
3005+ 'template_type' => $Blog->template_type,
3006+) );
3007+?>
3008+</div>
3009+
3010+<div class="edit_actions">
3011+<input type="submit" value="<?php /* TRANS: This is the value of an input submit button */ echo T_('Save !'); ?>" class="SaveButton" tabindex="10" />
3012+<?php
3013+if( $action == 'editcomment' )
3014+{
3015+ // display a link to delete a comment
3016+ $edited_Comment->delete_link( array(
3017+ 'class' => 'DeleteButton',
3018+ ) );
3019+}
3020+
3021+// spark the plugin manager
3022+$Plugins->trigger_event( 'AdminDisplayEditorButton', array(
3023+ 'target_type' => 'Comment',
3024+) );
3025+?>
3026+</div>
3027+
3028+<?php
3029+$Form->end_fieldset();
3030+
3031+$Form->begin_fieldset( T_('Advanced properties') );
3032+$Form->switch_layout( 'linespan' );
3033+
3034+if( $current_User->check_perm( 'edit_timestamp' ) )
3035+{
3036+ // TIME STAMP
3037+ echo '<div id="itemform_edit_timestamp">';
3038+ $Form->date( 'comment_issue_date', $edited_Comment->date, T_('Comment date') );
3039+ echo ' '; // allow wrapping!
3040+ $Form->time( 'comment_issue_time', $edited_Comment->date, '' );
3041+ echo '</div>';
3042+}
3043+
3044+// AUTOBR ... fp> TODO: this should be Auto-P and handled by the Auto-P plugin
3045+?>
3046+<input type="checkbox" class="checkbox" name="post_autobr" value="1"
3047+<?php if( $comments_use_autobr == 'always' || $comments_use_autobr == 'opt-out' )
3048+{
3049+ echo ' checked="checked"';
3050+}
3051+?>
3052+ id="autobr" tabindex="6" />
3053+<label for="autobr"><strong><?php echo T_('Auto-BR') ?></strong></label>
3054+<?php
3055+$Form->switch_layout( NULL );
3056+
3057+$Form->end_fieldset();
3058+
3059+// spark the plugin manager
3060+$Plugins->trigger_event( 'AdminDispCommentFormField', array(
3061+ 'Form' => & $Form,
3062+ 'Comment' => & $edited_Comment,
3063+) );
3064+?>
3065 </div>
3066
3067 <div class="right_col">
3068-
3069 <div class="edit_toolbars">
3070 <?php
3071 // spark the plugin manager
3072 $Plugins->trigger_event( 'AdminDisplayToolbarSidebar', array(
3073 'target_type' => 'Comment',
3074+ 'template_type' => $Blog->template_type,
3075 ) );
3076 ?>
3077 </div>
3078
3079 <?php
3080- if( $Blog->get_setting('allow_rating') != 'never'
3081- || !empty( $edited_Comment->rating ) )
3082- { // Rating is editable
3083- $Form->begin_fieldset( T_('Rating') );
3084-
3085- // display options to rate a comment
3086- $edited_Comment->rating_input( array(
3087- 'before' => '<p>',
3088- 'after' => '</p>',
3089- ) );
3090-
3091- // display option to reset rating
3092- $edited_Comment->rating_none_input( array(
3093- 'before' => '<p>',
3094- 'after' => '</p>',
3095- ) );
3096-
3097- $Form->end_fieldset();
3098- }
3099- else
3100- {
3101- $Form->hidden( 'comment_rating', 0 );
3102- }
3103-
3104- /*
3105- $Form->begin_fieldset( T_('Properties') );
3106- echo '<p>';
3107- $Form->checkbox_basic_input( 'comment_featured', $edited_Comment->featured, T_('Featured') );
3108- echo '</p>';
3109- $Form->end_fieldset();
3110- */
3111-
3112- $Form->begin_fieldset( T_('Visibility'), array( 'id' => 'commentform_visibility' ) );
3113-
3114- $sharing_options[] = array( 'published', T_('Published (Public)') );
3115- $sharing_options[] = array( 'draft', T_('Draft (Not published!)') );
3116- $sharing_options[] = array( 'deprecated', T_('Deprecated (Not published!)') );
3117- $Form->radio( 'comment_status', $edited_Comment->status, $sharing_options, '', true );
3118-
3119- $Form->end_fieldset();
3120-
3121- $Form->begin_fieldset( T_('Links') );
3122- echo '<p>';
3123- $Form->checkbox_basic_input( 'comment_nofollow', $edited_Comment->nofollow, T_('Nofollow website URL') );
3124- // TODO: apply to all links -- note: see basic antispam plugin that does this for x hours
3125- echo '</p>';
3126- $Form->end_fieldset();
3127-
3128- $Form->begin_fieldset( T_('Feedback info') );
3129- ?>
3130-
3131- <p><strong><?php echo T_('Type') ?>:</strong> <?php echo $edited_Comment->type; ?></p>
3132- <p><strong><?php echo T_('IP address') ?>:</strong> <?php
3133- // Display IP address and allow plugins to filter it, e.g. the DNSBL plugin will add a link to check the IP:
3134- echo $Plugins->get_trigger_event( 'FilterIpAddress', array('format'=>'htmlbody', 'data'=>$edited_Comment->author_IP), 'data' ); ?></p>
3135- <p><strong><?php echo T_('Spam Karma') ?>:</strong> <?php $edited_Comment->spam_karma(); ?></p>
3136-
3137- <?php
3138- $Form->end_fieldset();
3139- ?>
3140+if( $Blog->get_setting( 'allow_rating' ) != 'never' || ! empty( $edited_Comment->rating ) )
3141+{
3142+ // Rating is editable
3143+ $Form->begin_fieldset( T_('Rating') );
3144+
3145+ // display options to rate a comment
3146+ $edited_Comment->rating_input( array(
3147+ 'before' => '<p>',
3148+ 'after' => '</p>',
3149+ ) );
3150+
3151+ // display option to reset rating
3152+ $edited_Comment->rating_none_input( array(
3153+ 'before' => '<p>',
3154+ 'after' => '</p>',
3155+ ) );
3156+
3157+ $Form->end_fieldset();
3158+}
3159+else
3160+{
3161+ $Form->hidden( 'comment_rating', 0 );
3162+}
3163+
3164+/*
3165+$Form->begin_fieldset( T_('Properties') );
3166+echo '<p>';
3167+$Form->checkbox_basic_input( 'comment_featured', $edited_Comment->featured, T_('Featured') );
3168+echo '</p>';
3169+$Form->end_fieldset();
3170+*/
3171+
3172+$Form->begin_fieldset( T_('Visibility'), array( 'id' => 'commentform_visibility' ) );
3173+$sharing_options[] = array( 'published', T_('Published (Public)') );
3174+$sharing_options[] = array( 'draft', T_('Draft (Not published!)') );
3175+$sharing_options[] = array( 'deprecated', T_('Deprecated (Not published!)') );
3176+$Form->radio( 'comment_status', $edited_Comment->status, $sharing_options, '', true );
3177+$Form->end_fieldset();
3178+
3179+$Form->begin_fieldset( T_('Links') );
3180+echo '<p>';
3181+$Form->checkbox_basic_input( 'comment_nofollow', $edited_Comment->nofollow, T_('Nofollow website URL') );
3182+echo '</p>';
3183+$Form->end_fieldset();
3184+$Form->begin_fieldset( T_('Feedback info') );
3185+?>
3186+
3187+<p><strong><?php echo T_('Type') ?>:</strong> <?php echo $edited_Comment->type; ?></p>
3188+<p><strong><?php echo T_('IP address') ?>:</strong> <?php
3189+// Display IP address and allow plugins to filter it, e.g. the DNSBL plugin will add a link to check the IP
3190+echo $Plugins->get_trigger_event( 'FilterIpAddress', array('format' => 'htmlbody', 'data' => $edited_Comment->author_IP), 'data' ); ?></p>
3191+<p><strong><?php echo T_('Spam Karma') ?>:</strong> <?php $edited_Comment->spam_karma(); ?></p>
3192+
3193+<?php
3194+$Form->end_fieldset();
3195+?>
3196 </div>
3197
3198 <div class="clear"></div>
3199
3200=== modified file 'qp_inc/items/views/_item_expert.form.php'
3201--- qp_inc/items/views/_item_expert.form.php 2011-09-01 16:29:34 +0000
3202+++ qp_inc/items/views/_item_expert.form.php 2013-03-11 07:27:21 +0000
3203@@ -1,75 +1,66 @@
3204 <?php
3205 /**
3206- * This file implements the Post form.
3207- *
3208- * This file is part of the Quam Plures project - {@link http://quamplures.net/}.
3209- * See also {@link https://launchpad.net/quam-plures}.
3210- *
3211- * @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
3212- * @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}.
3213- *
3214- * @license http://quamplures.net/license.html GNU General Public License (GPL)
3215- *
3216- * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
3217- * @author fplanque: Francois PLANQUE
3218- * @author fsaya: Fabrice SAYA-GASNIER / PROGIDISTRI
3219- * @author blueyed: Daniel HAHLER
3220+ * This file implements the Post form
3221+ *
3222+ * @author {@link http://wonderwinds.com/ Ed Bennett}
3223+ * @author {@link http://daniel.hahler.de/ Daniel HAHLER}
3224+ * @author {@link http://progidistri.com/ PROGIDISTRI}
3225+ * @author {@link http://fplanque.net/ Francois PLANQUE}
3226 * @author gorgeb: Bertrand GORGE / EPISTEMA
3227- *
3228- * @todo blueyed>> IMHO it's not good to use CSS class .line here (mainly white-space:nowrap),
3229- * because on a smaller screen you'll cut things off! (and not every browser
3230- * allows "marking and moving" of text then).
3231- *
3232+ * @copyright (c) 2009 by {@link http://quamplures.net/ the Quam Plures project}
3233+ * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
3234 * @package items
3235 */
3236-if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
3237+if(!defined('QP_MAIN_INIT')) die('fail');
3238
3239-/**
3240- * @var User
3241- */
3242+global $admin_url;
3243+global $app_allow_dbase_reset;
3244+global $basepath;
3245+global $Blog;
3246+global $bozo_start_modified;
3247+global $creating;
3248 global $current_User;
3249-/**
3250- * @var Item
3251- */
3252 global $edited_Item;
3253-/**
3254- * @var Blog
3255- */
3256-global $Blog;
3257-/**
3258- * @var Plugins
3259- */
3260+global $install_subdir;
3261+global $item_content;
3262+global $item_tags;
3263+global $item_title;
3264+global $mode;
3265+global $pagenow;
3266 global $Plugins;
3267-/**
3268- * @var GeneralSettings
3269- */
3270+global $post_comment_status;
3271+global $redirect_to;
3272 global $Settings;
3273-
3274-global $pagenow;
3275-global $mode;
3276-global $admin_url;
3277-global $post_comment_status;
3278 global $trackback_url;
3279-global $item_tags;
3280-global $bozo_start_modified;
3281-global $creating;
3282-global $item_title;
3283-global $item_content;
3284-global $redirect_to;
3285+
3286+// security notice on dashboard
3287+if( is_file( $basepath.$install_subdir.'index.php' ) )
3288+{
3289+ echo '<div class="action_messages"><div class="log_error">'.T_('Your /qp_install/index.php file is still there. That\'s not good. You need to delete that file OR delete the entire /qp_install/ folder!').'</div></div>';
3290+ if( $app_allow_dbase_reset )
3291+ {
3292+ echo '<div class="action_messages"><div class="log_error">'.T_('Additionally, your /qp_config/_main_config.php file allows your database to be reset ($app_allow_dbase_reset is set to \'1\').');
3293+ echo '<ul><li><strong>'.T_('You will not be able to use use this program until you').'</strong>';
3294+ echo '<ul><li>'.T_('delete the file "/qp_install/index.php" OR delete the folder "/qp_install/"').'</li>';
3295+ echo '<li>'.T_('OR change $app_allow_dbase_reset to 0 in your /qp_config/_main_config.php file.').'</li></ul>';
3296+ echo '</ul></div></div>';
3297+ die();
3298+ }
3299+}
3300
3301 // Determine if we are creating or updating...
3302 $creating = is_create_action( $action );
3303
3304-// ================================ START OF EDIT FORM ================================
3305+// ====== START OF EDIT FORM ======
3306 $Form = new Form( NULL, 'item_checkchanges', 'post' );
3307 $Form->labelstart = '<strong>';
3308 $Form->labelend = "</strong>\n";
3309
3310 $params = array();
3311
3312-if( !empty( $bozo_start_modified ) )
3313+if( ! empty( $bozo_start_modified ) )
3314 {
3315- $params['bozo_start_modified'] = true;
3316+ $params['bozo_start_modified'] = false;
3317 }
3318
3319 $Form->begin_form( '', '', $params );
3320@@ -90,33 +81,32 @@
3321 'Form' => & $Form, 'Item' => & $edited_Item,
3322 ) );
3323
3324-// ############################ POST CONTENTS #############################
3325-
3326-$Form->begin_fieldset( get_manual_link( 'post-contents' ).T_('Post contents') );
3327+// ====== POST CONTENTS ======
3328+$Form->begin_fieldset( T_('Post contents') );
3329
3330 echo '<table cellspacing="0" class="compose_layout"><tr>';
3331
3332 // Title input:
3333-$require_title = $Blog->get_setting('require_title');
3334+$require_title = $Blog->get_setting( 'require_title' );
3335 if( $require_title != 'none' )
3336 {
3337 echo '<td width="1%"><strong>'.T_('Title').':</strong></td>';
3338 echo '<td width="97%" class="input">';
3339 $Form->switch_layout( 'none' );
3340- $Form->text_input( 'post_title', $item_title, 20, '', '', array('maxlength'=>255, 'style'=>'width: 100%;', 'required' => $Blog->get_setting('require_title') == 'required') );
3341+ $Form->text_input( 'post_title', $item_title, 20, '', '', array( 'maxlength' => 255, 'style' => 'width: 100%;', 'required' => $Blog->get_setting( 'require_title' ) == 'required' ) );
3342 echo '</td>';
3343 }
3344
3345 // -- Language chooser
3346 $locale_options = locale_options( $edited_Item->get( 'locale' ), false, true );
3347-if ( is_array( $locale_options ) )
3348-{ // We've only one enabled locale.
3349+if( is_array( $locale_options ) )
3350+{ // We've only one enabled locale.
3351 // Tblue> The locale name is not really needed here, but maybe we
3352 // want to display the name of the only locale?
3353 $Form->hidden( 'post_locale', $locale_options[0] );
3354 }
3355 else
3356-{ // More than one locale => select field.
3357+{ // More than one locale => select field.
3358 echo '<td width="1%">';
3359 if( $require_title != 'none' )
3360 {
3361@@ -129,6 +119,18 @@
3362 }
3363 echo '</tr></table>';
3364
3365+// -- item url & type selector fields
3366+echo '<table cellspacing="0" class="compose_layout" style="width:100%"><tr>';
3367+echo '<td width="1%"><strong>'.T_('Link to url').':</strong></td>';
3368+echo '<td class="input">';
3369+$Form->text_input( 'post_url', $edited_Item->get( 'url' ), 20, '', '', array('maxlength' => 255, 'style' => 'width: 100%;') );
3370+echo '</td>';
3371+echo '<td width="1%">&nbsp;&nbsp;<strong>'.T_('Type').':</strong></td>';
3372+echo '<td width="1%" class="select">';
3373+$ItemTypeCache = & get_Cache( 'ItemTypeCache' );
3374+$Form->select_object( 'item_typ_ID', $edited_Item->ptyp_ID, $ItemTypeCache, '', '', false, '', 'get_option_list_unreserved_only' );
3375+echo '</td></tr></table>'."\n";
3376+
3377 $Form->switch_layout( NULL );
3378 ?>
3379
3380@@ -137,14 +139,15 @@
3381 // spark the plugin manager
3382 $Plugins->trigger_event( 'AdminDisplayToolbarAbove', array(
3383 'target_type' => 'Item',
3384+ 'template_type' => $Blog->template_type,
3385 ) );
3386 ?>
3387 </div>
3388
3389-<?php // ---------------------------- TEXTAREA -------------------------------------
3390+<?php // ====== TEXTAREA ======
3391 $Form->fieldstart = '<div class="edit_area">';
3392 $Form->fieldend = "</div>\n";
3393-$Form->textarea_input( 'content', $item_content, 16, '', array( 'cols' => 40 , 'id' => 'itemform_post_content' ) );
3394+$Form->textarea_input( 'content', $item_content, 16, '', array( 'cols' => 40, 'id' => 'itemform_post_content' ) );
3395 $Form->switch_layout( 'linespan' );
3396 ?>
3397 <script type="text/javascript">
3398@@ -159,12 +162,13 @@
3399 // spark the plugin manager
3400 $Plugins->trigger_event( 'AdminDisplayToolbarBelow', array(
3401 'target_type' => 'Item',
3402+ 'template_type' => $Blog->template_type,
3403 ) );
3404 ?>
3405 </div>
3406
3407 <?php
3408-// ------------------------------- ACTIONS ----------------------------------
3409+// ====== ACTIONS ======
3410 echo '<div class="edit_actions">';
3411
3412 // spark the plugin manager
3413@@ -181,7 +185,7 @@
3414 if( $current_User->check_perm( 'files', 'view' ) )
3415 {
3416 $fm_url_params = 'mode=upload';
3417- if( !empty($edited_Item->ID) )
3418+ if( ! empty( $edited_Item->ID ) )
3419 {
3420 $fm_url_params .= '&amp;fm_mode=link_item&amp;item_ID='.$edited_Item->ID;
3421 }
3422@@ -191,21 +195,21 @@
3423 }
3424 }
3425
3426-// ---------- PREVIEW ----------
3427+// ====== PREVIEW ======
3428 $url = url_same_protocol( $Blog->get( 'url' ) ); // was dynurl
3429 $Form->button( array( 'button', '', T_('Preview'), 'PreviewButton', 'b2edit_open_preview(this.form, \''.$url.'\');' ) );
3430
3431-// ---------- SAVE ----------
3432-$next_action = ($creating ? 'create' : 'update');
3433+// ====== SAVE ======
3434+$next_action = ( $creating ? 'create' : 'update' );
3435 $Form->submit( array( 'actionArray['.$next_action.']', /* TRANS: This is the value of an input submit button */ T_('Save'), 'SaveButton' ) );
3436 $Form->submit( array( 'actionArray['.$next_action.'_edit]', /* TRANS: This is the value of an input submit button */ T_('Save & edit'), 'SaveEditButton' ) );
3437
3438-// ----- PUBLISH NOW --------
3439+// ====== PUBLISH NOW ======
3440 $publishnow_displayed = false;
3441 if( $edited_Item->status == 'draft'
3442- && $current_User->check_perm( 'blog_post!published', 'edit', false, $Blog->ID ) // TODO: if we actually set the primary cat to another blog, we may still get an ugly perm die
3443+ && $current_User->check_perm( 'blog_post!published', 'edit', false, $Blog->ID )
3444 && $current_User->check_perm( 'edit_timestamp', 'edit', false ) )
3445-{ // Only allow publishing if in draft mode. Other modes are too special to run the risk of 1 click publication.
3446+{ // Only allow publishing if in draft mode. Other modes are too special to run the risk of 1 click publication.
3447 $Form->submit( array(
3448 'actionArray['.$next_action.'_publish]',
3449 /* TRANS: This is the value of an input submit button */ T_('Publish NOW !'),
3450@@ -225,71 +229,47 @@
3451 'Item' => & $edited_Item,
3452 ) );
3453
3454-// ####################### ATTACHMENTS/LINKS #########################
3455+// ====== ATTACHMENTS/LINKS ======
3456 attachment_iframe( $Form, $creating, $edited_Item, $Blog );
3457
3458-// ############################ ADVANCED #############################
3459+// ====== ADVANCED ======
3460 $Form->switch_layout( 'linespan' );
3461
3462-$Form->begin_fieldset( get_manual_link( 'advanced-properties' ).T_('Advanced properties'), array( 'id' => 'itemform_adv_props' ) );
3463-
3464-// -- item url & type selector fields
3465-
3466-echo '<table cellspacing="0" class="compose_layout" style="width:100%">';
3467-echo '<tr><td class="label"><strong>'.T_('Type').'</strong></td>';
3468-echo '<td style="padding:0 1em; text-align:center;">:</td><td width="1%" class="select">';
3469-$ItemTypeCache = & get_Cache( 'ItemTypeCache' );
3470-$Form->select_object( 'item_typ_ID', $edited_Item->ptyp_ID, $ItemTypeCache, '', '', false, '', 'get_option_list_unreserved_only' );
3471-echo '</td>';
3472-echo '</tr>'."\n";
3473-
3474-/* old code
3475-echo '<tr><td class="label"><label for="item_tags"><strong>'.T_('Tags').'</strong> <span class="notes">'.T_('sep by ,').'</span></label></td>';
3476-echo '<td style="padding:0 1em; text-align:center;">:</td><td class="input" >';
3477-$Form->text_input( 'item_tags', $item_tags, 40, '', '', array('maxlength'=>255, 'style'=>'width: 100%;') );
3478-echo '</td><td width="1"><!-- for IE7 --></td></tr>';
3479-//*/
3480-
3481-echo '<tr><td class="label" style="vertical-align:top"><label for="post_excerpt"><strong>'.T_('Excerpt').'</strong>
3482-<span class="notes">'.T_('(for XML feeds)').'</span></label></td>';
3483-echo '<td style="padding:0 1em; text-align:center;vertical-align:top">:</td><td class="input" ><textarea name="post_excerpt" rows="2" cols="25" style="width:100%" id="post_excerpt">';
3484-$edited_Item->disp( 'excerpt', 'formvalue' );
3485-echo '</textarea></td><td width="1"><!-- for IE7 --></td></tr>';
3486-
3487-echo '<tr><td class="label"><strong>'.T_('Link to url').'</strong></td>';
3488-echo '<td style="padding:0 1em; text-align:center;">:</td><td class="input" >';
3489-$Form->text_input( 'post_url', $edited_Item->get( 'url' ), 20, '', '', array('maxlength'=>255, 'style'=>'width: 100%;') );
3490-echo '</td></tr>'."\n";
3491-
3492-
3493+$Form->begin_fieldset( T_('Advanced properties'), array( 'id' => 'itemform_adv_props' ) );
3494+
3495+echo '<table cellspacing="0" class="compose_layout">';
3496 echo '<tr><td class="label"><label for="post_urltitle" title="'.T_('&quot;slug&quot; to be used in permalinks').'"><strong>'.T_('URL title "slug"').'</strong></label></td>';
3497 echo '<td style="padding:0 1em; text-align:center;">:</td><td class="input" >';
3498-$Form->text_input( 'post_urltitle', $edited_Item->get('urltitle'), 40, '', '', array('maxlength'=>210, 'style'=>'width: 100%;') );
3499+$Form->text_input( 'post_urltitle', $edited_Item->get( 'urltitle' ), 40, '', '', array('maxlength' => 210, 'style' => 'width: 100%;') );
3500 echo '</td><td width="1"><!-- for IE7 --></td></tr>';
3501
3502 echo '<tr><td class="label"><label for="titletag"><strong>'.T_('&lt;title&gt; tag').'</strong></label></td>';
3503 echo '<td style="padding:0 1em; text-align:center;">:</td><td class="input" >';
3504-$Form->text_input( 'titletag', $edited_Item->get('titletag'), 40, '', '', array('maxlength'=>255, 'style'=>'width: 100%;') );
3505+$Form->text_input( 'titletag', $edited_Item->get( 'titletag' ), 40, '', '', array('maxlength' => 255, 'style' => 'width: 100%;') );
3506 echo '</td><td width="1"><!-- for IE7 --></td></tr>';
3507
3508 echo '<tr><td class="label"><label for="metadesc" title="&lt;meta name=&quot;description&quot;&gt;"><strong>'.T_('&lt;meta&gt; desc').'</strong></label></td>';
3509 echo '<td style="padding:0 1em; text-align:center;">:</td><td class="input" >';
3510-$Form->text_input( 'metadesc', $edited_Item->get('metadesc'), 40, '', '', array('maxlength'=>255, 'style'=>'width: 100%;') );
3511+$Form->text_input( 'metadesc', $edited_Item->get( 'metadesc' ), 40, '', '', array('maxlength' => 255, 'style' => 'width: 100%;') );
3512 echo '</td><td width="1"><!-- for IE7 --></td></tr>';
3513
3514 echo '<tr><td class="label"><label for="metakeywords" title="&lt;meta name=&quot;keywords&quot;&gt;"><strong>'.T_('&lt;meta&gt; keywords').'</strong></label></td>';
3515 echo '<td style="padding:0 1em; text-align:center;">:</td><td class="input" >';
3516-$Form->text_input( 'metakeywords', $edited_Item->get('metakeywords'), 40, '', '', array('maxlength'=>255, 'style'=>'width: 100%;') );
3517+$Form->text_input( 'metakeywords', $edited_Item->get( 'metakeywords' ), 40, '', '', array('maxlength' => 255, 'style' => 'width: 100%;') );
3518 echo '</td><td width="1"><!-- for IE7 --></td></tr>';
3519
3520+echo '<tr><td class="label" style="vertical-align:top"><label for="post_excerpt"><strong>'.T_('Excerpt').'</strong><span class="notes">'.T_('(for XML feeds)').'</span></label></td>';
3521+echo '<td style="padding:0 1em; text-align:center;vertical-align:top">:</td><td class="input" ><textarea name="post_excerpt" rows="2" cols="25" style="width:100%" id="post_excerpt">';
3522+$edited_Item->disp( 'excerpt', 'formvalue' );
3523+echo '</textarea></td><td width="1"><!-- for IE7 --></td></tr>';
3524 echo '</table>';
3525
3526 $Form->end_fieldset();
3527
3528-// ############################ WORKFLOW #############################
3529+// ====== WORKFLOW ======
3530 if( $Blog->get_setting( 'use_workflow' ) )
3531-{ // We want to use workflow properties for this blog:
3532- $Form->begin_fieldset( get_manual_link( 'workflow-properties' ).T_('Workflow properties'), array( 'id' => 'itemform_workflow_props' ) );
3533+{ // We want to use workflow properties for this blog:
3534+ $Form->begin_fieldset( T_('Workflow properties'), array( 'id' => 'itemform_workflow_props' ) );
3535 echo '<div id="itemform_edit_timestamp" class="edit_fieldgroup">';
3536 $Form->select_object( 'item_priority', NULL, $edited_Item, T_('Priority'), '', true, '', 'priority_options' );
3537 echo ' '; // allow wrapping!
3538@@ -298,16 +278,16 @@
3539 $ItemStatusCache = & get_Cache( 'ItemStatusCache' );
3540 $Form->select_options( 'item_st_ID', $ItemStatusCache->get_option_list( $edited_Item->pst_ID, true ), T_('Task status') );
3541 echo ' '; // allow wrapping!
3542- $Form->date( 'item_deadline', $edited_Item->get('datedeadline'), T_('Deadline') );
3543+ $Form->date( 'item_deadline', $edited_Item->get( 'datedeadline' ), T_('Deadline') );
3544 echo '</div>';
3545 $Form->end_fieldset();
3546 }
3547
3548-// ####################### ADDITIONAL ACTIONS #########################
3549-if( isset( $Blog ) && $Blog->get('allowtrackbacks') )
3550+// ====== ADDITIONAL ACTIONS ======
3551+if( isset( $Blog ) && $Blog->get( 'allowtrackbacks' ) )
3552 {
3553- $Form->begin_fieldset( get_manual_link( 'additional-actions' ).T_('Additional actions'), array( 'id' => 'itemform_additional_actions' ) );
3554- // --------------------------- TRACKBACK --------------------------------------
3555+ $Form->begin_fieldset( T_('Additional actions'), array( 'id' => 'itemform_additional_actions' ) );
3556+ // ====== TRACKBACK ======
3557 ?>
3558 <div id="itemform_trackbacks">
3559 <label for="trackback_url"><strong><?php echo T_('Trackback URLs') ?>:</strong>
3560@@ -335,24 +315,29 @@
3561 // spark the plugin manager
3562 $Plugins->trigger_event( 'AdminDisplayToolbarSidebar', array(
3563 'target_type' => 'Item',
3564+ 'template_type' => $Blog->template_type,
3565 ) );
3566 ?>
3567 </div>
3568
3569 <?php
3570-// ################### CATEGORIES ###################
3571+// ====== CATEGORIES ======
3572 cat_select( $Form );
3573
3574 $Form->switch_layout( 'linespan' );
3575-
3576-// ################### TAGS ##################
3577+// ====== TAGS ======
3578 $Form->begin_fieldset( T_('Tags'), array( 'id' => 'itemform_tags' ) );
3579-$Form->textarea_input( 'item_tags', $item_tags, 4, '', array( 'note' => T_('separated by' ).' <strong>,</strong>', 'cols' => 10, 'style'=>'width: 90%;margin:0 auto;display:block;') );
3580-$Form->end_fieldset();
3581-
3582-// ################### PROPERTIES ###################
3583-$Form->begin_fieldset( T_('Properties'), array( 'id' => 'itemform_extra' ) );
3584-$Form->checkbox_basic_input( 'item_featured', $edited_Item->featured, '<strong>'.T_('Featured post').'</strong>' );
3585+$Form->textarea_input( 'item_tags', $item_tags, 4, '', array( 'note' => T_('separated by' ).' <strong>,</strong>', 'cols' => 10, 'style' => 'width: 98%;margin:0 auto;display:block;') );
3586+$Form->end_fieldset();
3587+
3588+// ====== VISIBILITY / SHARING ======
3589+$Form->begin_fieldset( T_('Visibility / Sharing'), array( 'id' => 'itemform_visibility' ) );
3590+visibility_select( $Form, $edited_Item->status );
3591+$Form->end_fieldset();
3592+
3593+// ====== ISSUE DATE ======
3594+$Form->switch_layout( 'linespan' );
3595+$Form->begin_fieldset( T_('Item issue date'), array( 'id' => 'itemform_iss_date' ) );
3596 if( $current_User->check_perm( 'edit_timestamp' ) )
3597 { // ------------------------------------ TIME STAMP -------------------------------------
3598 echo '<div id="itemform_edit_timestamp" class="edit_fieldgroup">';
3599@@ -360,29 +345,27 @@
3600 echo '</div>';
3601 }
3602
3603-echo '<table>';
3604-echo '<tr><td><strong>'.T_('Order').':</strong></td><td>';
3605-$Form->text( 'item_order', $edited_Item->order, 10, '', T_('can be decimal') );
3606-echo '</td></tr>';
3607-echo '</table>';
3608-
3609-$Form->end_fieldset();
3610-
3611-// ################### VISIBILITY / SHARING ###################
3612-$Form->begin_fieldset( T_('Visibility / Sharing'), array( 'id' => 'itemform_visibility' ) );
3613-visibility_select( $Form, $edited_Item->status );
3614-$Form->end_fieldset();
3615-
3616-// ################### TEXT RENDERERS ###################
3617-$Form->begin_fieldset( get_manual_link( 'text-renderers' ).T_('Text Renderers'), array( 'id' => 'itemform_renderers' ) );
3618+/**
3619+ * commented out because I don't like this "order" thing
3620+ * echo '<table>';
3621+ * echo '<tr><td><strong>'.T_('Order').':</strong></td><td>';
3622+ * $Form->text( 'item_order', $edited_Item->order, 10, '', T_('can be decimal') );
3623+ * echo '</td></tr>';
3624+ * echo '</table>';
3625+ */
3626+
3627+$Form->end_fieldset();
3628+
3629+// ====== TEXT RENDERERS ======
3630+$Form->begin_fieldset( T_('Text Renderers'), array( 'id' => 'itemform_renderers' ) );
3631 // fp> TODO: there should be no param call here (shld be in controller)
3632 $edited_Item->renderer_checkboxes( param('renderers', 'array', NULL) );
3633 $Form->end_fieldset();
3634
3635-// ################### COMMENT STATUS ###################
3636+// ====== COMMENT STATUS ======
3637 if( $Blog->allowcomments == 'post_by_post' )
3638 {
3639- $Form->begin_fieldset( get_manual_link( 'comments' ).T_('Comments'), array( 'id' => 'itemform_comments' ) );
3640+ $Form->begin_fieldset( T_('Comments'), array( 'id' => 'itemform_comments' ) );
3641 ?>
3642 <label title="<?php echo T_('Visitors can leave comments on this post.') ?>"><input type="radio" name="post_comment_status" value="open" class="checkbox" <?php if( $post_comment_status == 'open' ) echo 'checked="checked"'; ?> />
3643 <?php echo T_('Open') ?></label><br />
3644@@ -398,11 +381,11 @@
3645 <div class="clear"></div>
3646
3647 <?php
3648-// ================================== END OF EDIT FORM ==================================
3649+// ====== END OF EDIT FORM ======
3650 $Form->end_form();
3651
3652 if( $publishnow_displayed )
3653-{ // fp> TODO: ideally this should not be hacked in *here*
3654+{ // fp> TODO: ideally this should not be hacked in *here*
3655 echo_publishnowbutton_js( $next_action );
3656 }
3657 ?>
3658@@ -453,7 +436,7 @@
3659 $closed_panels = array(
3660 'itemform_createlinks',
3661 'itemform_adv_props',
3662- 'itemform_extra',
3663+ 'itemform_iss_date',
3664 'itemform_renderers',
3665 'itemform_comments',
3666 );
3667
3668=== removed file 'qp_inc/license.txt'
3669--- qp_inc/license.txt 2006-03-12 22:08:51 +0000
3670+++ qp_inc/license.txt 1970-01-01 00:00:00 +0000
3671@@ -1,293 +0,0 @@
3672- GNU GENERAL PUBLIC LICENSE
3673- Version 2, June 1991
3674-
3675- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
3676- 675 Mass Ave, Cambridge, MA 02139, USA
3677- Everyone is permitted to copy and distribute verbatim copies
3678- of this license document, but changing it is not allowed.
3679-
3680- Preamble
3681-
3682- The licenses for most software are designed to take away your
3683-freedom to share and change it. By contrast, the GNU General Public
3684-License is intended to guarantee your freedom to share and change free
3685-software--to make sure the software is free for all its users. This
3686-General Public License applies to most of the Free Software
3687-Foundation's software and to any other program whose authors commit to
3688-using it. (Some other Free Software Foundation software is covered by
3689-the GNU Library General Public License instead.) You can apply it to
3690-your programs, too.
3691-
3692- When we speak of free software, we are referring to freedom, not
3693-price. Our General Public Licenses are designed to make sure that you
3694-have the freedom to distribute copies of free software (and charge for
3695-this service if you wish), that you receive source code or can get it
3696-if you want it, that you can change the software or use pieces of it
3697-in new free programs; and that you know you can do these things.
3698-
3699- To protect your rights, we need to make restrictions that forbid
3700-anyone to deny you these rights or to ask you to surrender the rights.
3701-These restrictions translate to certain responsibilities for you if you
3702-distribute copies of the software, or if you modify it.
3703-
3704- For example, if you distribute copies of such a program, whether
3705-gratis or for a fee, you must give the recipients all the rights that
3706-you have. You must make sure that they, too, receive or can get the
3707-source code. And you must show them these terms so they know their
3708-rights.
3709-
3710- We protect your rights with two steps: (1) copyright the software, and
3711-(2) offer you this license which gives you legal permission to copy,
3712-distribute and/or modify the software.
3713-
3714- Also, for each author's protection and ours, we want to make certain
3715-that everyone understands that there is no warranty for this free
3716-software. If the software is modified by someone else and passed on, we
3717-want its recipients to know that what they have is not the original, so
3718-that any problems introduced by others will not reflect on the original
3719-authors' reputations.
3720-
3721- Finally, any free program is threatened constantly by software
3722-patents. We wish to avoid the danger that redistributors of a free
3723-program will individually obtain patent licenses, in effect making the
3724-program proprietary. To prevent this, we have made it clear that any
3725-patent must be licensed for everyone's free use or not licensed at all.
3726-
3727- The precise terms and conditions for copying, distribution and
3728-modification follow.
3729-
3730- GNU GENERAL PUBLIC LICENSE
3731- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
3732-
3733- 0. This License applies to any program or other work which contains
3734-a notice placed by the copyright holder saying it may be distributed
3735-under the terms of this General Public License. The "Program", below,
3736-refers to any such program or work, and a "work based on the Program"
3737-means either the Program or any derivative work under copyright law:
3738-that is to say, a work containing the Program or a portion of it,
3739-either verbatim or with modifications and/or translated into another
3740-language. (Hereinafter, translation is included without limitation in
3741-the term "modification".) Each licensee is addressed as "you".
3742-
3743-Activities other than copying, distribution and modification are not
3744-covered by this License; they are outside its scope. The act of
3745-running the Program is not restricted, and the output from the Program
3746-is covered only if its contents constitute a work based on the
3747-Program (independent of having been made by running the Program).
3748-Whether that is true depends on what the Program does.
3749-
3750- 1. You may copy and distribute verbatim copies of the Program's
3751-source code as you receive it, in any medium, provided that you
3752-conspicuously and appropriately publish on each copy an appropriate
3753-copyright notice and disclaimer of warranty; keep intact all the
3754-notices that refer to this License and to the absence of any warranty;
3755-and give any other recipients of the Program a copy of this License
3756-along with the Program.
3757-
3758-You may charge a fee for the physical act of transferring a copy, and
3759-you may at your option offer warranty protection in exchange for a fee.
3760-
3761- 2. You may modify your copy or copies of the Program or any portion
3762-of it, thus forming a work based on the Program, and copy and
3763-distribute such modifications or work under the terms of Section 1
3764-above, provided that you also meet all of these conditions:
3765-
3766- a) You must cause the modified files to carry prominent notices
3767- stating that you changed the files and the date of any change.
3768-
3769- b) You must cause any work that you distribute or publish, that in
3770- whole or in part contains or is derived from the Program or any
3771- part thereof, to be licensed as a whole at no charge to all third
3772- parties under the terms of this License.
3773-
3774- c) If the modified program normally reads commands interactively
3775- when run, you must cause it, when started running for such
3776- interactive use in the most ordinary way, to print or display an
3777- announcement including an appropriate copyright notice and a
3778- notice that there is no warranty (or else, saying that you provide
3779- a warranty) and that users may redistribute the program under
3780- these conditions, and telling the user how to view a copy of this
3781- License. (Exception: if the Program itself is interactive but
3782- does not normally print such an announcement, your work based on
3783- the Program is not required to print an announcement.)
3784-
3785-These requirements apply to the modified work as a whole. If
3786-identifiable sections of that work are not derived from the Program,
3787-and can be reasonably considered independent and separate works in
3788-themselves, then this License, and its terms, do not apply to those
3789-sections when you distribute them as separate works. But when you
3790-distribute the same sections as part of a whole which is a work based
3791-on the Program, the distribution of the whole must be on the terms of
3792-this License, whose permissions for other licensees extend to the
3793-entire whole, and thus to each and every part regardless of who wrote it.
3794-Thus, it is not the intent of this section to claim rights or contest
3795-your rights to work written entirely by you; rather, the intent is to
3796-exercise the right to control the distribution of derivative or
3797-collective works based on the Program.
3798-
3799-In addition, mere aggregation of another work not based on the Program
3800-with the Program (or with a work based on the Program) on a volume of
3801-a storage or distribution medium does not bring the other work under
3802-the scope of this License.
3803-
3804- 3. You may copy and distribute the Program (or a work based on it,
3805-under Section 2) in object code or executable form under the terms of
3806-Sections 1 and 2 above provided that you also do one of the following:
3807-
3808- a) Accompany it with the complete corresponding machine-readable
3809- source code, which must be distributed under the terms of Sections
3810- 1 and 2 above on a medium customarily used for software interchange; or,
3811-
3812- b) Accompany it with a written offer, valid for at least three
3813- years, to give any third party, for a charge no more than your
3814- cost of physically performing source distribution, a complete
3815- machine-readable copy of the corresponding source code, to be
3816- distributed under the terms of Sections 1 and 2 above on a medium
3817- customarily used for software interchange; or,
3818-
3819- c) Accompany it with the information you received as to the offer
3820- to distribute corresponding source code. (This alternative is
3821- allowed only for noncommercial distribution and only if you
3822- received the program in object code or executable form with such
3823- an offer, in accord with Subsection b above.)
3824-
3825-The source code for a work means the preferred form of the work for
3826-making modifications to it. For an executable work, complete source
3827-code means all the source code for all modules it contains, plus any
3828-associated interface definition files, plus the scripts used to
3829-control compilation and installation of the executable. However, as a
3830-special exception, the source code distributed need not include
3831-anything that is normally distributed (in either source or binary
3832-form) with the major components (compiler, kernel, and so on) of the
3833-operating system on which the executable runs, unless that component
3834-itself accompanies the executable.
3835-
3836-If distribution of executable or object code is made by offering
3837-access to copy from a designated place, then offering equivalent
3838-access to copy the source code from the same place counts as
3839-distribution of the source code, even though third parties are not
3840-compelled to copy the source along with the object code.
3841-
3842- 4. You may not copy, modify, sublicense, or distribute the Program
3843-except as expressly provided under this License. Any attempt
3844-otherwise to copy, modify, sublicense or distribute the Program is
3845-void, and will automatically terminate your rights under this License.
3846-However, parties who have received copies, or rights, from you under
3847-this License will not have their licenses terminated so long as such
3848-parties remain in full compliance.
3849-
3850- 5. You are not required to accept this License, since you have not
3851-signed it. However, nothing else grants you permission to modify or
3852-distribute the Program or its derivative works. These actions are
3853-prohibited by law if you do not accept this License. Therefore, by
3854-modifying or distributing the Program (or any work based on the
3855-Program), you indicate your acceptance of this License to do so, and
3856-all its terms and conditions for copying, distributing or modifying
3857-the Program or works based on it.
3858-
3859- 6. Each time you redistribute the Program (or any work based on the
3860-Program), the recipient automatically receives a license from the
3861-original licensor to copy, distribute or modify the Program subject to
3862-these terms and conditions. You may not impose any further
3863-restrictions on the recipients' exercise of the rights granted herein.
3864-You are not responsible for enforcing compliance by third parties to
3865-this License.
3866-
3867- 7. If, as a consequence of a court judgment or allegation of patent
3868-infringement or for any other reason (not limited to patent issues),
3869-conditions are imposed on you (whether by court order, agreement or
3870-otherwise) that contradict the conditions of this License, they do not
3871-excuse you from the conditions of this License. If you cannot
3872-distribute so as to satisfy simultaneously your obligations under this
3873-License and any other pertinent obligations, then as a consequence you
3874-may not distribute the Program at all. For example, if a patent
3875-license would not permit royalty-free redistribution of the Program by
3876-all those who receive copies directly or indirectly through you, then
3877-the only way you could satisfy both it and this License would be to
3878-refrain entirely from distribution of the Program.
3879-
3880-If any portion of this section is held invalid or unenforceable under
3881-any particular circumstance, the balance of the section is intended to
3882-apply and the section as a whole is intended to apply in other
3883-circumstances.
3884-
3885-It is not the purpose of this section to induce you to infringe any
3886-patents or other property right claims or to contest validity of any
3887-such claims; this section has the sole purpose of protecting the
3888-integrity of the free software distribution system, which is
3889-implemented by public license practices. Many people have made
3890-generous contributions to the wide range of software distributed
3891-through that system in reliance on consistent application of that
3892-system; it is up to the author/donor to decide if he or she is willing
3893-to distribute software through any other system and a licensee cannot
3894-impose that choice.
3895-
3896-This section is intended to make thoroughly clear what is believed to
3897-be a consequence of the rest of this License.
3898-
3899- 8. If the distribution and/or use of the Program is restricted in
3900-certain countries either by patents or by copyrighted interfaces, the
3901-original copyright holder who places the Program under this License
3902-may add an explicit geographical distribution limitation excluding
3903-those countries, so that distribution is permitted only in or among
3904-countries not thus excluded. In such case, this License incorporates
3905-the limitation as if written in the body of this License.
3906-
3907- 9. The Free Software Foundation may publish revised and/or new versions
3908-of the General Public License from time to time. Such new versions will
3909-be similar in spirit to the present version, but may differ in detail to
3910-address new problems or concerns.
3911-
3912-Each version is given a distinguishing version number. If the Program
3913-specifies a version number of this License which applies to it and "any
3914-later version", you have the option of following the terms and conditions
3915-either of that version or of any later version published by the Free
3916-Software Foundation. If the Program does not specify a version number of
3917-this License, you may choose any version ever published by the Free Software
3918-Foundation.
3919-
3920- 10. If you wish to incorporate parts of the Program into other free
3921-programs whose distribution conditions are different, write to the author
3922-to ask for permission. For software which is copyrighted by the Free
3923-Software Foundation, write to the Free Software Foundation; we sometimes
3924-make exceptions for this. Our decision will be guided by the two goals
3925-of preserving the free status of all derivatives of our free software and
3926-of promoting the sharing and reuse of software generally.
3927-
3928- NO WARRANTY
3929-
3930- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
3931-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
3932-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
3933-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
3934-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
3935-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
3936-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
3937-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
3938-REPAIR OR CORRECTION.
3939-
3940- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
3941-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
3942-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
3943-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
3944-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
3945-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
3946-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
3947-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
3948-POSSIBILITY OF SUCH DAMAGES.
3949-
3950---------------------------------------------------------------------------
3951-
3952- * In addition, as a special exception, the copyright holders give permission to link
3953- * the code of this program with the PHP/SWF Charts library by maani.us (or with
3954- * modified versions of this library that use the same license as PHP/SWF Charts library
3955- * by maani.us), and distribute linked combinations including the two. You must obey the
3956- * GNU General Public License in all respects for all of the code used other than the
3957- * PHP/SWF Charts library by maani.us. If you modify this file, you may extend this
3958- * exception to your version of the file, but you are not obligated to do so. If you do
3959- * not wish to do so, delete this exception statement from your version.
3960-
3961---------------------------------------------------------------------------
3962-
3963- END OF TERMS AND CONDITIONS
3964-
3965
3966=== modified file 'qp_inc/plugins/_plugin.class.php'
3967--- qp_inc/plugins/_plugin.class.php 2013-03-05 23:34:17 +0000
3968+++ qp_inc/plugins/_plugin.class.php 2013-03-11 07:27:21 +0000
3969@@ -4,11 +4,11 @@
3970 *
3971 * Real plugins should be derived from this class.
3972 *
3973- * @todo (1111): var $code needs to be checked for duplicity upon installation and a note thrown
3974+ * @todo (1111) var $code needs to be checked for duplicity upon installation and a note thrown
3975 * to the installing user indicating a potential conflict ... if it isn't already checked ;)
3976- * @todo (1111): var $group needs to be an enum with "other" as the default. There is no need
3977+ * @todo (1111) var $group needs to be an enum with "other" as the default. There is no need
3978 * for a plugin author to jack up the plugins display page with their own group name!
3979- * @todo (1111): var $priority needs to not apply to "install widget". Actually, it needs to not
3980+ * @todo (1111) var $priority needs to not apply to "install widget". Actually, it needs to not
3981 * apply to everything except rendering ... and it needs a rename to $render_priority
3982 * @author {@link http://wonderwinds.com/ Ed Bennett}
3983 * @author {@link http://daniel.hahler.de/ Daniel HAHLER}
3984@@ -435,7 +435,10 @@
3985 * 'my_param' => array(
3986 * 'label' => $this->T_('My Param'),
3987 * 'defaultvalue' => '10',
3988- * 'valid_pattern' => array( 'pattern' => '[1-9]\d+', $this->T_('The value must be >= 10.') ),
3989+ * 'valid_pattern' => array(
3990+ * 'pattern' => '[1-9]\d+',
3991+ * $this->T_('The value must be >= 10.')
3992+ * ),
3993 * 'note' => $this->T_('Quite cool, eh?'),
3994 * ),
3995 * 'another_param' => array( // this one has no 'note'
3996@@ -2579,7 +2582,7 @@
3997 * {@link $srvc_url_sensitive} (if {@link $ReqHost} is on https). NOTE: AJAX callbacks are
3998 * required to be on the same domain/protocol, so if you're using absolute blog URLs on
3999 * different domains you must set {@link $srvc_url} dynamically, to use the same domain!
4000- * @todo (0000): dh> we might want to provide whitelisting of methods through {@link
4001+ * @todo (0000) dh> we might want to provide whitelisting of methods through {@link
4002 * $Session} here and check for it in the srvc handler.
4003 * @param string Method to call. This must be listed in {@link GetSrvcMethods()}.
4004 * @param array Array of optional parameters passed to the method.
4005
4006=== modified file 'qp_inc/plugins/_plugin.funcs.php'
4007--- qp_inc/plugins/_plugin.funcs.php 2013-02-28 16:40:18 +0000
4008+++ qp_inc/plugins/_plugin.funcs.php 2013-03-11 07:27:21 +0000
4009@@ -163,7 +163,7 @@
4010 switch( $set_type )
4011 {
4012 case 'CollSettings':
4013- $set_value = $Obj->get_blog_setting( $parname, $set_target );
4014+ $set_value = $Obj->get_coll_setting( $parname, $set_target );
4015 $error_value = NULL;
4016 break;
4017
4018
4019=== modified file 'qp_inc/plugins/model/_plugins.class.php'
4020--- qp_inc/plugins/model/_plugins.class.php 2013-02-21 11:49:06 +0000
4021+++ qp_inc/plugins/model/_plugins.class.php 2013-03-11 07:27:21 +0000
4022@@ -1,207 +1,146 @@
4023 <?php
4024 /**
4025- * This file implements the PluginS class.
4026+ * This file implements the Plugins base class
4027 *
4028 * This is where you can plug in some {@link Plugin plugins} :D
4029 *
4030- * This file is part of Quam Plures - {@link http://quamplures.net/}
4031- * See also {@link https://launchpad.net/quam-plures}.
4032- *
4033- * @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
4034- * @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
4035- * Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
4036- *
4037- * {@internal License choice
4038- * - If you have received this file as part of a package, please find the license.txt file in
4039- * the same folder or the closest folder above for complete license terms.
4040- * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
4041- * then you must choose one of the following licenses before using the file:
4042- * - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
4043- * - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
4044- * }}
4045- *
4046- * {@internal Open Source relicensing agreement:
4047- * Daniel HAHLER grants Francois PLANQUE the right to license
4048- * Daniel HAHLER's contributions to this file and the b2evolution project
4049- * under any OSI approved OSS license (http://www.opensource.org/licenses/).
4050- * }}
4051- *
4052- * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
4053- * @author fplanque: Francois PLANQUE - {@link http://fplanque.net/}
4054- * @author blueyed: Daniel HAHLER
4055- *
4056+ * @todo (1111) vars here are missing a title - they only have an at-var tag :(
4057+ * @author {@link http://wonderwinds.com/ Ed Bennett}
4058+ * @author {@link http://daniel.hahler.de/ Daniel HAHLER}
4059+ * @author {@link http://fplanque.net/ Francois PLANQUE}
4060+ * @copyright (c) 2009 by {@link http://quamplures.net/ the Quam Plures project}
4061+ * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License v3
4062 * @package plugins
4063 */
4064-if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
4065-
4066-load_class('plugins/_plugin.class.php');
4067-
4068+if(!defined('QP_MAIN_INIT')) die('fail');
4069
4070 /**
4071- * Plugins Class
4072- *
4073- * This is where you can plug in some {@link Plugin plugins} :D
4074- *
4075- * @todo dh> Currently when a plugin goes into "broken" status (e.g. file not readable), it is "disabled" afterwards.
4076- * This should rather remember the old status (e.g. "enabled") and make it enabled again.
4077- *
4078+ * Plugins base class
4079 * @package plugins
4080 */
4081 class Plugins
4082 {
4083- /**#@+
4084- * @access private
4085- */
4086-
4087 /**
4088- * @var array of plugin_code => Plugin
4089+ * FIX THIS
4090+ * @var array Array of plugin_code => Plugin
4091 */
4092 var $index_code_Plugins = array();
4093-
4094 /**
4095- * @var array of plugin_ID => Plugin
4096+ * FIX THIS
4097+ * @var array Array of plugin_ID => Plugin
4098 */
4099 var $index_ID_Plugins = array();
4100-
4101 /**
4102+ * FIX THIS
4103 * @see Plugins::load_events()
4104- * @var array of event => plug_ID. IDs are sorted by priority.
4105+ * @var array Array of event => plug_ID, IDs are sorted by priority
4106 */
4107 var $index_event_IDs = array();
4108-
4109 /**
4110- * @var array of plug_ID => DB row from T_plugins. Used to lazy-instantiate Plugins.
4111+ * FIX THIS
4112+ * @var array Array of plug_ID => DB row from T_plugins, used to lazy-instantiate Plugins
4113 */
4114 var $index_ID_rows = array();
4115-
4116 /**
4117- * @var array of plug_code => plug_ID. Used to lazy-instantiate by code.
4118+ * FIX THIS
4119+ * @var array Array of plug_code => plug_ID, used to lazy-instantiate by code
4120 */
4121 var $index_code_ID = array();
4122-
4123 /**
4124- * Cache Plugin codes by apply_rendering setting.
4125- * @var array of apply_rendering => plug_code
4126+ * Cache Plugin codes by apply_rendering setting
4127+ * @var array Array of apply_rendering => plug_code
4128 */
4129 var $index_apply_rendering_codes = array();
4130-
4131 /**
4132- * Path to plugins.
4133- *
4134- * The preferred method is to have a sub-directory for each plugin (named
4135- * after the plugin's classname), but they can be supplied just in this
4136- * directory.
4137+ * Path to plugins
4138+ * @var string The preferred method is to have a sub-directory for each plugin (named
4139+ * after the plugin's classname), but they can be supplied just in this directory.
4140 */
4141 var $plugins_path;
4142-
4143 /**
4144- * Have we loaded the plugins table (T_plugins)?
4145- * @var boolean
4146+ * FIX THIS
4147+ * @var boolean Have we loaded the plugins table (T_plugins)?
4148 */
4149 var $loaded_plugins_table = false;
4150-
4151 /**
4152- * Current object index in {@link $sorted_IDs} array.
4153- * @var integer
4154+ * FIX THIS
4155+ * @var integer Current object index in {@link $sorted_IDs} array
4156 */
4157 var $current_idx = -1;
4158-
4159 /**
4160- * List of IDs, sorted. This gets used to lazy-instantiate a Plugin.
4161- *
4162- * @var array
4163+ * FIX THIS
4164+ * @var array List of IDs, sorted, used to lazy-instantiate a Plugin
4165 */
4166 var $sorted_IDs = array();
4167-
4168 /**
4169- * The smallest internal/auto-generated Plugin ID.
4170- * @var integer
4171+ * FIX THIS
4172+ * @var integer The smallest internal/auto-generated Plugin ID
4173 */
4174 var $smallest_internal_ID = 0;
4175-
4176- /**#@-*/
4177-
4178-
4179- /**#@+
4180- * @access protected
4181- */
4182-
4183- /**
4184- * SQL to use in {@link load_plugins_table()}. Gets overwritten for {@link Plugins_admin}.
4185- * @var string
4186- * @static
4187- */
4188- var $sql_load_plugins_table = '
4189- SELECT plug_ID, plug_priority, plug_classname, plug_code, plug_name, plug_shortdesc, plug_apply_rendering, plug_status, plug_version, plug_spam_weight
4190- FROM T_plugins
4191- WHERE plug_status = \'enabled\'
4192- ORDER BY plug_priority, plug_classname';
4193-
4194- /**#@-*/
4195-
4196-
4197- /**
4198+ /**
4199+ * FIX THIS
4200+ * @var string SQL to use in {@link load_plugins_table()}, gets overwritten for {@link Plugins_admin}
4201+ */
4202+ var $sql_load_plugins_table = 'SELECT plug_ID, plug_priority, plug_classname, plug_code, plug_name, plug_shortdesc, plug_apply_rendering, plug_status, plug_version, plug_spam_weight
4203+ FROM T_plugins WHERE plug_status = \'enabled\' ORDER BY plug_priority, plug_classname';
4204+ /**
4205+ * Plugin Errors
4206+ *
4207 * Errors associated to plugins (during loading), indexed by plugin_ID and
4208 * error class ("register").
4209- *
4210- * @var array
4211+ * @var array Errors associated to plugins (during loading), indexed by plugin_ID and error class ("register")
4212 */
4213 var $plugin_errors = array();
4214
4215-
4216 /**
4217- * Constructor. Sets {@link $plugins_path} and load events.
4218+ * Constructor
4219+ *
4220+ * Sets {@link $plugins_path} and load events.
4221 */
4222 function Plugins()
4223 {
4224- global $basepath, $plugins_subdir, $Timer;
4225+ global $basepath;
4226+ global $plugins_subdir;
4227+ global $Timer;
4228
4229 // Set plugin path:
4230 $this->plugins_path = $basepath.$plugins_subdir;
4231-
4232 $Timer->resume( 'plugin_init' );
4233
4234 // Load events for enabled plugins:
4235 $this->load_events();
4236-
4237 $Timer->pause( 'plugin_init' );
4238 }
4239
4240
4241 /**
4242- * Get a list of available Plugin groups.
4243- *
4244+ * Get a list of available Plugin groups
4245 * @return array
4246 */
4247 function get_plugin_groups()
4248 {
4249 $result = array();
4250-
4251 foreach( $this->sorted_IDs as $plugin_ID )
4252 {
4253 $Plugin = & $this->get_by_ID( $plugin_ID );
4254-
4255- if( empty($Plugin->group) || in_array( $Plugin->group, $result ) )
4256+ if( empty( $Plugin->group ) || in_array( $Plugin->group, $result ) )
4257 {
4258 continue;
4259 }
4260-
4261 $result[] = $Plugin->group;
4262 }
4263-
4264 return $result;
4265 }
4266
4267
4268 /**
4269+ * Get Plugins in group
4270 * Will return an array that contents are references to plugins that have the same group.
4271- *
4272 * @return array
4273 */
4274 function get_Plugins_in_group( $group )
4275 {
4276 $result = array();
4277-
4278 foreach( $this->sorted_IDs as $plugin_ID )
4279 {
4280 $Plugin = & $this->get_by_ID( $plugin_ID );
4281@@ -210,39 +149,35 @@
4282 $result[] = & $Plugin;
4283 }
4284 }
4285-
4286 return $result;
4287 }
4288
4289
4290 /**
4291- * Sets the status of a Plugin in DB and registers it into the internal indices when "enabled".
4292- * Otherwise it gets unregistered, but only when we're not in {@link Plugins_admin}, because we
4293- * want to keep it in then in our indices.
4294- *
4295- * {@internal
4296- * Note: this should probably always get called on the {@link $Plugins} object,
4297- * not {@link $admin_Plugins}.
4298- * }}
4299- *
4300+ * Get Plugin status
4301+ *
4302+ * Sets the status of a Plugin in DB and registers it into the internal indices
4303+ * when "enabled". Otherwise it gets unregistered, but only when we're not in
4304+ * {@link Plugins_admin}, because we want to keep it in then in our indices. Note:
4305+ * this should probably always get called on the {@link $Plugins} object, not
4306+ * {@link $admin_Plugins}.
4307 * @param Plugin
4308 * @param string New status ("enabled", "disabled", "needs_config", "broken")
4309 * @return boolean True on success, false on failure.
4310 */
4311 function set_Plugin_status( & $Plugin, $status )
4312 {
4313- global $DB, $Debuglog;
4314+ global $DB;
4315
4316 if( $Plugin->status == $status
4317- && $DB->query( "SELECT plug_status FROM T_plugins WHERE plug_ID = ".$DB->quote($Plugin->ID), 'set_Plugin_status safety net' ) == $status )
4318+ && $DB->query( "SELECT plug_status FROM T_plugins WHERE plug_ID = ".$DB->quote( $Plugin->ID ), 'set_Plugin_status safety net' ) == $status )
4319 {
4320 return true;
4321 }
4322-
4323 $DB->query( "UPDATE T_plugins SET plug_status = '".$status."' WHERE plug_ID = '".$Plugin->ID."'" );
4324-
4325 if( $status == 'enabled' )
4326- { // Reload plugins tables, which includes the plugin in further requests
4327+ {
4328+ // Reload plugins tables, which includes the plugin in further requests
4329 $this->loaded_plugins_table = false;
4330 $this->load_plugins_table();
4331 $this->load_events();
4332@@ -251,77 +186,62 @@
4333 {
4334 // Notify the plugin that it has been disabled:
4335 $Plugin->BeforeDisable();
4336-
4337 $this->unregister( $Plugin );
4338 }
4339-
4340 $Plugin->status = $status;
4341-
4342- $Debuglog->add( 'Set status for plugin #'.$Plugin->ID.' to "'.$status.'"!', 'plugins' );
4343-
4344 return true;
4345 }
4346
4347
4348 /**
4349- * Register a plugin.
4350- *
4351- * This handles the indexes, dynamically unregisters a Plugin that does not exist (anymore)
4352- * and instantiates the Plugin's (User)Settings.
4353- *
4354- * Attention: The code of the plugin is set to NULL if it is found to be not unique!
4355- * To get the original code, use the $orig_code parameter.
4356- *
4357- * @access protected
4358+ * Register a plugin
4359+ *
4360+ * This handles the indexes, dynamically unregisters a Plugin that does not exist
4361+ * (anymore) and instantiates the Plugin's (User)Settings. Attention: The code of
4362+ * the plugin is set to NULL if it is found to be not unique! To get the original
4363+ * code, use the $orig_code parameter.
4364 * @param string name of plugin class to instantiate and register
4365 * @param int ID in database (0 if not installed)
4366 * @param int Priority in database (-1 to keep default)
4367 * @param array When should rendering apply? (NULL to keep default)
4368 * @param string Path of the .php class file of the plugin.
4369- * @param boolean Must the plugin exist (classfile_path and classname)?
4370- * This is used internally to be able to unregister a non-existing plugin.
4371- * @param NULL|string If a reference to a variable is given here, it will receive
4372- * the code of the plugin we are registering, even if the code
4373- * is found to be not unique.
4374+ * @param boolean Must the plugin exist (classfile_path and classname)? This is used internally
4375+ * to be able to unregister a non-existing plugin.
4376+ * @param NULL|string If a reference to a variable is given here, it will receive the code
4377+ * of the plugin we are registering, even if the code is found to be not unique.
4378 * @return Plugin Plugin ref to newly created plugin; string in case of error
4379 */
4380 function & register( $classname, $ID = 0, $priority = -1, $apply_rendering = NULL,
4381- $classfile_path = NULL, $must_exists = true, & $orig_code = NULL )
4382+ $classfile_path = NULL, $must_exists = true, & $orig_code = NULL )
4383 {
4384- global $Debuglog, $Messages, $Timer;
4385+ global $Messages;
4386+ global $Timer;
4387
4388- if( $ID && isset($this->index_ID_Plugins[$ID]) )
4389+ if( $ID && isset( $this->index_ID_Plugins[$ID] ) )
4390 {
4391 debug_die( 'Tried to register already registered Plugin (ID '.$ID.')' ); // should never happen!
4392 }
4393-
4394 $Timer->resume( 'plugins_register' );
4395-
4396- if( empty($classfile_path) )
4397+ if( empty( $classfile_path ) )
4398 {
4399 $plugin_filename = '_'.str_replace( '_plugin', '.plugin', $classname ).'.php';
4400 // Try <plug_classname>/<plug_classname>.php (subfolder) first
4401 $classfile_path = $this->plugins_path.$classname.'/'.$plugin_filename;
4402- /**
4403- * @todo EdB: next two lines makes folders be plugin_feature intead of feature_plugin
4404- * $plugin_foldername = 'plugin_'.str_replace( '_plugin', '', $classname );
4405- * $classfile_path = $this->plugins_path.$plugin_foldername.'/'.$plugin_filename;
4406- */
4407-
4408+ # NOTE: next two lines makes folders be plugin_feature intead of feature_plugin
4409+ # $plugin_foldername = 'plugin_'.str_replace( '_plugin', '', $classname );
4410+ # $classfile_path = $this->plugins_path.$plugin_foldername.'/'.$plugin_filename;
4411 if( ! is_readable( $classfile_path ) )
4412- { // Look directly in $plugins_path
4413+ {
4414+ // Look directly in $plugins_path
4415 $classfile_path = $this->plugins_path.$plugin_filename;
4416 }
4417 }
4418-
4419- $Debuglog->add( 'register(): '.$classname.', ID: '.$ID.', priority: '.$priority.', classfile_path: ['.$classfile_path.']', 'plugins' );
4420-
4421 if( ! is_readable( $classfile_path ) )
4422- { // Plugin file not found!
4423+ {
4424+ // Plugin file not found!
4425 if( $must_exists )
4426 {
4427- $r = 'Plugin class file ['.rel_path_to_base($classfile_path).'] is not readable!';
4428- $Debuglog->add( $r, array( 'plugins', 'error' ) );
4429+ $r = 'Plugin class file ['.rel_path_to_base( $classfile_path ).'] is not readable!';
4430
4431 // Get the Plugin object (must not exist)
4432 $Plugin = & $this->register( $classname, $ID, $priority, $apply_rendering, $classfile_path, false );
4433@@ -331,7 +251,7 @@
4434 // unregister:
4435 if( $this->unregister( $Plugin ) )
4436 {
4437- $Debuglog->add( 'Unregistered plugin ['.$classname.']!', array( 'plugins', 'error' ) );
4438+ // debuglog-add removed
4439 }
4440 else
4441 {
4442@@ -339,33 +259,29 @@
4443 $Timer->pause( 'plugins_register' );
4444 return $Plugin;
4445 }
4446-
4447 $Timer->pause( 'plugins_register' );
4448 return $r;
4449 }
4450 }
4451- elseif( ! class_exists($classname) ) // If there are several copies of one plugin for example..
4452+ elseif( ! class_exists( $classname ) ) // If there are several copies of one plugin for example..
4453 {
4454- $Debuglog->add( 'Loading plugin class file: '.$classname, 'plugins' );
4455 require_once $classfile_path;
4456 }
4457
4458 if( ! class_exists( $classname ) )
4459- { // the given class does not exist
4460+ {
4461+ // the given class does not exist
4462 if( $must_exists )
4463 {
4464- $r = sprintf( 'Plugin class for &laquo;%s&raquo; in file &laquo;%s&raquo; not defined.', $classname, rel_path_to_base($classfile_path) );
4465- $Debuglog->add( $r, array( 'plugins', 'error' ) );
4466-
4467- // Get the Plugin object (must not exist) fp> why is this recursive?
4468+ $r = sprintf( 'Plugin class for &laquo;%s&raquo; in file &laquo;%s&raquo; not defined.', $classname, rel_path_to_base( $classfile_path ) );
4469+ // Get the Plugin object (must not exist) fp> why is this recursive?
4470 $Plugin = & $this->register( $classname, $ID, $priority, $apply_rendering, $classfile_path, false );
4471 $this->plugin_errors[$ID]['register'] = $r;
4472 $this->set_Plugin_status( $Plugin, 'broken' );
4473-
4474 // unregister:
4475 if( $this->unregister( $Plugin ) )
4476 {
4477- $Debuglog->add( 'Unregistered plugin ['.$classname.']!', array( 'plugins', 'error' ) );
4478+ // debuglog-add removed
4479 }
4480 else
4481 {
4482@@ -373,24 +289,21 @@
4483 $Timer->pause( 'plugins_register' );
4484 return $Plugin;
4485 }
4486-
4487 $Timer->pause( 'plugins_register' );
4488 return $r;
4489 }
4490 else
4491 {
4492- $Plugin = new Plugin; // COPY !
4493+ $Plugin = new Plugin; // COPY !
4494 $Plugin->code = NULL;
4495 $Plugin->apply_rendering = 'never';
4496 }
4497 }
4498 else
4499 {
4500- $Plugin = new $classname; // COPY !
4501+ $Plugin = new $classname; // COPY !
4502 }
4503-
4504 $Plugin->classfile_path = $classfile_path;
4505-
4506 // Tell him his ID :)
4507 if( $ID == 0 )
4508 {
4509@@ -399,9 +312,9 @@
4510 else
4511 {
4512 $Plugin->ID = $ID;
4513-
4514 if( $ID > 0 )
4515- { // Properties from T_plugins
4516+ {
4517+ // Properties from T_plugins
4518 // Code
4519 $Plugin->code = $this->index_ID_rows[$Plugin->ID]['plug_code'];
4520 // Status
4521@@ -413,30 +326,33 @@
4522 // Tell him his priority:
4523 if( $priority > -1 ) { $Plugin->priority = $priority; }
4524
4525- if( isset($apply_rendering) )
4526+ if( isset( $apply_rendering ) )
4527 {
4528 $Plugin->apply_rendering = $apply_rendering;
4529 }
4530
4531- if( empty($Plugin->name) )
4532+ if( empty( $Plugin->name ) )
4533 {
4534 $Plugin->name = $Plugin->classname;
4535 }
4536
4537 $orig_code = $Plugin->code;
4538- if( ! empty($this->index_code_ID[ $Plugin->code ]) && $this->index_code_ID[ $Plugin->code ] != $Plugin->ID )
4539- { // The plugin's default code is already in use!
4540+ if( ! empty( $this->index_code_ID[$Plugin->code] ) && $this->index_code_ID[$Plugin->code] != $Plugin->ID )
4541+ {
4542+ // The plugin's default code is already in use!
4543 $Plugin->code = NULL;
4544 }
4545 else
4546 {
4547- $this->index_code_Plugins[ $Plugin->code ] = & $Plugin;
4548- $this->index_code_ID[ $Plugin->code ] = & $Plugin->ID;
4549+ $this->index_code_Plugins[$Plugin->code] = & $Plugin;
4550+ $this->index_code_ID[$Plugin->code] = & $Plugin->ID;
4551 }
4552- $this->index_ID_Plugins[ $Plugin->ID ] = & $Plugin;
4553+ $this->index_ID_Plugins[$Plugin->ID] = & $Plugin;
4554
4555- if( ! in_array( $Plugin->ID, $this->sorted_IDs ) ) // TODO: check if this extra check is required..
4556- { // not in our sort index yet
4557+ // @todo (0000) check if this extra check is required...
4558+ if( ! in_array( $Plugin->ID, $this->sorted_IDs ) )
4559+ {
4560+ // not in our sort index yet
4561 $this->sorted_IDs[] = & $Plugin->ID;
4562 }
4563
4564@@ -449,56 +365,56 @@
4565 $tmp_params = array( 'db_row' => $this->index_ID_rows[$Plugin->ID], 'is_installed' => true );
4566 if( $Plugin->PluginInit( $tmp_params ) === false && $this->unregister( $Plugin ) )
4567 {
4568- $Debuglog->add( 'Unregistered plugin, because PluginInit returned false.', 'plugins' );
4569 $Plugin = '';
4570 }
4571 // Version check:
4572 elseif( $Plugin->version != $this->index_ID_rows[$Plugin->ID]['plug_version'] && $must_exists )
4573- { // Version has changed since installation or last update
4574+ {
4575+ // Version has changed since installation or last update
4576 $db_deltas = array();
4577
4578 // Tell the Plugin that we've detected a version change:
4579- $tmp_params = array( 'old_version'=>$this->index_ID_rows[$Plugin->ID]['plug_version'], 'db_row'=>$this->index_ID_rows[$Plugin->ID] );
4580+ $tmp_params = array( 'old_version' => $this->index_ID_rows[$Plugin->ID]['plug_version'], 'db_row' => $this->index_ID_rows[$Plugin->ID] );
4581
4582 if( $this->call_method( $Plugin->ID, 'PluginVersionChanged', $tmp_params ) === false )
4583 {
4584- $Debuglog->add( 'Set plugin status to "needs_config", because PluginVersionChanged returned false.', 'plugins' );
4585 $this->set_Plugin_status( $Plugin, 'needs_config' );
4586 if( $this->unregister( $Plugin ) )
4587- { // only unregister the Plugin, if it's not the admin list's class:
4588+ {
4589+ // only unregister the Plugin, if it's not the admin list's class:
4590 $Plugin = '';
4591 }
4592 }
4593 else
4594 {
4595 // Check if there are DB deltas required (also when downgrading!), without excluding any query type:
4596- load_funcs('_core/model/db/_upgrade.funcs.php');
4597+ load_funcs( '_core/model/db/_upgrade.funcs.php' );
4598 $db_deltas = db_delta( $Plugin->GetDbLayout() );
4599
4600- if( empty($db_deltas) )
4601- { // No DB changes needed, update (bump or decrease) the version
4602+ if( empty( $db_deltas ) )
4603+ {
4604 global $DB;
4605+
4606+ // No DB changes needed, update (bump or decrease) the version
4607 $Plugins_admin = & get_Cache('Plugins_admin');
4608
4609 // Update version in DB:
4610- $DB->query( '
4611- UPDATE T_plugins
4612- SET plug_version = '.$DB->quote($Plugin->version).'
4613- WHERE plug_ID = '.$Plugin->ID );
4614+ $DB->query( 'UPDATE T_plugins
4615+ SET plug_version = '.$DB->quote( $Plugin->version ).'
4616+ WHERE plug_ID = '.$Plugin->ID );
4617
4618 // Update "plug_version" in indexes:
4619 $this->index_ID_rows[$Plugin->ID]['plug_version'] = $Plugin->version;
4620- if( isset($Plugins_admin->index_ID_rows[$Plugin->ID]) )
4621+ if( isset( $Plugins_admin->index_ID_rows[$Plugin->ID] ) )
4622 {
4623 $Plugins_admin->index_ID_rows[$Plugin->ID]['plug_version'] = $Plugin->version;
4624 }
4625
4626 // Remove any prerenderered content for the Plugins renderer code:
4627- if( ! empty($Plugin->code) )
4628+ if( ! empty( $Plugin->code ) )
4629 {
4630- $DB->query( '
4631- DELETE FROM T_items__prerendering
4632- WHERE itpr_renderers REGEXP "^(.*\.)?'.$DB->escape($Plugin->code).'(\..*)?$"' );
4633+ $DB->query( 'DELETE FROM T_items__prerendering
4634+ WHERE itpr_renderers REGEXP "^(.*\.)?'.$DB->escape( $Plugin->code ).'(\..*)?$"' );
4635 }
4636
4637 // Detect new events (and delete obsolete ones - in case of downgrade):
4638@@ -506,26 +422,22 @@
4639 {
4640 $this->load_events(); // re-load for the current request
4641 }
4642-
4643- $Debuglog->add( 'Version for '.$Plugin->classname.' changed from '.$this->index_ID_rows[$Plugin->ID]['plug_version'].' to '.$Plugin->version, 'plugins' );
4644 }
4645 else
4646- { // If there are DB schema changes needed, set the Plugin status to "needs_config"
4647-
4648- // TODO: automatic upgrade in some cases (e.g. according to query types)?
4649-
4650+ {
4651+ // If there are DB schema changes needed, set the Plugin status to "needs_config"
4652 $this->set_Plugin_status( $Plugin, 'needs_config' );
4653- $Debuglog->add( 'Set plugin status to "needs_config", because version DB schema needs upgrade.', 'plugins' );
4654
4655 if( $this->unregister( $Plugin ) )
4656- { // only unregister the Plugin, if it's not the admin list's class:
4657+ {
4658+ // only unregister the Plugin, if it's not the admin list's class:
4659 $Plugin = '';
4660 }
4661 }
4662 }
4663 }
4664
4665- if( $Plugin && isset($this->index_ID_rows[$Plugin->ID]) ) // may have been unregistered above
4666+ if( $Plugin && isset( $this->index_ID_rows[$Plugin->ID] ) ) // may have been unregistered above
4667 {
4668 if( $this->index_ID_rows[$Plugin->ID]['plug_name'] !== NULL )
4669 {
4670@@ -538,13 +450,12 @@
4671 }
4672 }
4673 else
4674- { // This gets called for non-installed Plugins:
4675+ {
4676+ // This gets called for non-installed Plugins:
4677 // We're not instantiating UserSettings/Settings, since that needs a DB backend.
4678-
4679 $tmp_params = array( 'db_row' => array(), 'is_installed' => false );
4680 if( $Plugin->PluginInit( $tmp_params ) === false && $this->unregister( $Plugin ) )
4681 {
4682- $Debuglog->add( 'Unregistered plugin, because PluginInit returned false.', 'plugins' );
4683 $Plugin = '';
4684 }
4685 }
4686@@ -556,22 +467,19 @@
4687
4688
4689 /**
4690- * Un-register a plugin.
4691+ * Un-register a plugin
4692 *
4693 * This does not un-install it from DB, just from the internal indexes.
4694- *
4695 * @param Plugin
4696 * @param boolean Force unregistering (ignored here, but used in Plugins_admin)
4697 * @return boolean True, if unregistered
4698 */
4699 function unregister( & $Plugin, $force = false )
4700 {
4701- global $Debuglog;
4702-
4703 $this->forget_events( $Plugin->ID );
4704
4705 // Unset apply-rendering index:
4706- if( isset( $this->index_apply_rendering_codes[ $Plugin->apply_rendering ] ) )
4707+ if( isset( $this->index_apply_rendering_codes[$Plugin->apply_rendering] ) )
4708 {
4709 while( ( $key = array_search( $Plugin->code, $this->index_apply_rendering_codes[$Plugin->apply_rendering] ) ) !== false )
4710 {
4711@@ -579,25 +487,27 @@
4712 }
4713 }
4714
4715- unset( $this->index_code_Plugins[ $Plugin->code ] );
4716- unset( $this->index_ID_Plugins[ $Plugin->ID ] );
4717+ unset( $this->index_code_Plugins[$Plugin->code] );
4718+ unset( $this->index_ID_Plugins[$Plugin->ID] );
4719
4720- if( isset($this->index_ID_rows[ $Plugin->ID ]) )
4721- { // It has an associated DB row (load_plugins_table() was called)
4722- unset($this->index_ID_rows[ $Plugin->ID ]);
4723+ if( isset( $this->index_ID_rows[$Plugin->ID] ) )
4724+ {
4725+ // It has an associated DB row (load_plugins_table() was called)
4726+ unset( $this->index_ID_rows[$Plugin->ID] );
4727 }
4728
4729 $sort_key = array_search( $Plugin->ID, $this->sorted_IDs );
4730 if( $sort_key === false )
4731- { // this may happen if a Plugin has unregistered itself
4732- $Debuglog->add( 'Tried to unregister not-installed plugin (not in $sorted_IDs)!', 'plugins' );
4733+ {
4734+ // this may happen if a Plugin has unregistered itself
4735 return false;
4736 }
4737 unset( $this->sorted_IDs[$sort_key] );
4738 $this->sorted_IDs = array_values( $this->sorted_IDs );
4739
4740 if( $this->current_idx >= $sort_key )
4741- { // We have removed a file before or at the $sort_key'th position
4742+ {
4743+ // We have removed a file before or at the $sort_key'th position
4744 $this->current_idx--;
4745 }
4746
4747@@ -606,20 +516,19 @@
4748
4749
4750 /**
4751- * Forget the events a Plugin has registered.
4752+ * Forget the events a Plugin has registered
4753 *
4754 * This gets used when {@link unregister() unregistering} a Plugin or if
4755 * {@link Plugin::PluginInit()} returned false, which means
4756 * "do not use it for subsequent events in the request".
4757- *
4758 * @param integer Plugin ID
4759 */
4760 function forget_events( $plugin_ID )
4761 {
4762 // Forget events:
4763- foreach( array_keys($this->index_event_IDs) as $l_event )
4764+ foreach( array_keys( $this->index_event_IDs ) as $l_event )
4765 {
4766- while( ($key = array_search( $plugin_ID, $this->index_event_IDs[$l_event] )) !== false )
4767+ while( ( $key = array_search( $plugin_ID, $this->index_event_IDs[$l_event] ) ) !== false )
4768 {
4769 unset( $this->index_event_IDs[$l_event][$key] );
4770 }
4771@@ -628,49 +537,29 @@
4772
4773
4774 /**
4775- * Init {@link Plugin::$Settings} and {@link Plugin::$UserSettings}, either by
4776- * unsetting them for PHP5's overloading or instantiating them for PHP4.
4777- *
4778- * This only gets used for installed plugins, but we're initing it for PHP 5.1,
4779- * to trigger a helpful error, when e.g. Plugin::Settings gets accessed in PluginInit().
4780- *
4781+ * Init {@link Plugin::$Settings} and {@link Plugin::$UserSettings}
4782 * @param Plugin
4783 */
4784 function init_settings( & $Plugin )
4785 {
4786- if( version_compare( PHP_VERSION, '5.1', '>=' ) )
4787- { // we use overloading for PHP5, therefor the member has to be unset:
4788- // Note: this is somehow buggy at least in PHP 5.0.5, therefor we use it from 5.1 on.
4789- // see http://forums.b2evolution.net/viewtopic.php?p=49031#49031
4790- unset( $Plugin->Settings );
4791- unset( $Plugin->UserSettings );
4792-
4793- // Nothing to do here, will get called through Plugin::__get() when accessed
4794- return;
4795- }
4796-
4797- // PHP < 5.1: instantiate now, but only for installed plugins (needs DB).
4798- if( $Plugin->ID > 0 )
4799- {
4800- $this->instantiate_Settings( $Plugin, 'Settings' );
4801- $this->instantiate_Settings( $Plugin, 'UserSettings' );
4802- }
4803+ unset( $Plugin->Settings );
4804+ unset( $Plugin->UserSettings );
4805+ return;
4806 }
4807
4808
4809 /**
4810- * Instantiate Settings object (class {@link PluginSettings}) for the given plugin.
4811+ * Instantiate Settings object (class {@link PluginSettings}) for the given plugin
4812 *
4813 * The plugin must provide setting definitions (through {@link Plugin::GetDefaultSettings()}
4814 * OR {@link Plugin::GetDefaultUserSettings()}).
4815- *
4816 * @param Plugin
4817 * @param string settings type: "Settings" or "UserSettings"
4818 * @return boolean NULL, if no Settings
4819 */
4820 function instantiate_Settings( & $Plugin, $set_type )
4821 {
4822- global $Debuglog, $Timer;
4823+ global $Timer;
4824
4825 $Timer->resume( 'plugins_inst_'.$set_type );
4826
4827@@ -679,35 +568,34 @@
4828 // This may happen, if Plugin(User)Settings get accessed in PluginInit (which is allowed
4829 // when is_installed=true).
4830 $method = 'GetDefault'.$set_type;
4831- $params = array('for_editing'=>false);
4832+ $params = array( 'for_editing' => false );
4833 $Timer->resume( $Plugin->classname.'_(#'.$Plugin->ID.')' );
4834 $defaults = $Plugin->$method( $params );
4835 $Timer->pause( $Plugin->classname.'_(#'.$Plugin->ID.')' );
4836
4837- if( empty($defaults) )
4838- { // No settings, no need to instantiate.
4839+ if( empty( $defaults ) )
4840+ {
4841+ // No settings, no need to instantiate.
4842 $Timer->pause( 'plugins_inst_'.$set_type );
4843 return NULL;
4844 }
4845
4846- if( ! is_array($defaults) )
4847- { // invalid data
4848- $Debuglog->add( $Plugin->classname.'::GetDefault'.$set_type.'() did not return array!', array('plugins', 'error') );
4849+ if( ! is_array( $defaults ) )
4850+ {
4851+ // invalid data
4852 return NULL; // fp> correct me if I'm wrong.
4853 }
4854
4855 if( $set_type == 'UserSettings' )
4856- { // User specific settings:
4857- load_class('plugins/model/_pluginusersettings.class.php');
4858-
4859+ {
4860+ // User specific settings
4861 $Plugin->UserSettings = new PluginUserSettings( $Plugin->ID );
4862
4863 $set_Obj = & $Plugin->UserSettings;
4864 }
4865 else
4866- { // Global settings:
4867- load_class('plugins/model/_pluginsettings.class.php');
4868-
4869+ {
4870+ // Global settings
4871 $Plugin->Settings = new PluginSettings( $Plugin->ID );
4872
4873 $set_Obj = & $Plugin->Settings;
4874@@ -716,13 +604,14 @@
4875 // Register default values:
4876 foreach( $defaults as $l_name => $l_meta )
4877 {
4878- if( isset($l_meta['layout']) )
4879- { // Skip non-value entries
4880+ if( isset( $l_meta['layout'] ) )
4881+ {
4882+ // Skip non-value entries
4883 continue;
4884 }
4885
4886 // Register settings as _defaults into Settings:
4887- if( isset($l_meta['defaultvalue']) )
4888+ if( isset( $l_meta['defaultvalue'] ) )
4889 {
4890 $set_Obj->_defaults[$l_name] = $l_meta['defaultvalue'];
4891 }
4892@@ -743,7 +632,7 @@
4893
4894
4895 /**
4896- * Load plugins table and rewind iterator used by {@link get_next()}.
4897+ * Load plugins table and rewind iterator used by {@link get_next()}
4898 */
4899 function restart()
4900 {
4901@@ -754,36 +643,30 @@
4902
4903
4904 /**
4905- * Get next plugin in the list.
4906+ * Get next plugin in the list
4907 *
4908 * NOTE: You'll have to call {@link restart()} or {@link load_plugins_table()}
4909 * before using it.
4910- *
4911 * @return Plugin (false if no more plugin).
4912 */
4913 function & get_next()
4914 {
4915- global $Debuglog;
4916-
4917 ++$this->current_idx;
4918
4919- $Debuglog->add( 'get_next() ('.$this->current_idx.')..', 'plugins' );
4920-
4921- if( isset($this->sorted_IDs[$this->current_idx]) )
4922+ if( isset( $this->sorted_IDs[$this->current_idx] ) )
4923 {
4924 $Plugin = & $this->get_by_ID( $this->sorted_IDs[$this->current_idx] );
4925
4926 if( ! $Plugin )
4927- { // recurse until we've been through whole $sorted_IDs!
4928+ {
4929+ // recurse until we've been through whole $sorted_IDs!
4930 return $this->get_next();
4931 }
4932
4933- $Debuglog->add( 'return: '.$Plugin->classname.' ('.$Plugin->ID.')', 'plugins' );
4934 return $Plugin;
4935 }
4936 else
4937 {
4938- $Debuglog->add( 'return: false', 'plugins' );
4939 --$this->current_idx;
4940 $r = false;
4941 return $r;
4942@@ -801,32 +684,26 @@
4943
4944
4945 /**
4946- * Call all plugins for a given event.
4947- *
4948+ * Call all plugins for a given event
4949 * @param string event name, see {@link Plugins_admin::get_supported_events()}
4950 * @param array Associative array of parameters for the Plugin
4951 * @return boolean True, if at least one plugin has been called.
4952 */
4953 function trigger_event( $event, $params = array() )
4954 {
4955- global $Debuglog;
4956-
4957- $Debuglog->add( 'Trigger event '.$event, 'plugins' );
4958-
4959- if( empty($this->index_event_IDs[$event]) )
4960- { // No events registered
4961- $Debuglog->add( 'No registered plugins.', 'plugins' );
4962+ if( empty( $this->index_event_IDs[$event] ) )
4963+ {
4964+ // No events registered
4965 return false;
4966 }
4967
4968- $Debuglog->add( 'Registered plugin IDs: '.implode( ', ', $this->index_event_IDs[$event]), 'plugins' );
4969-
4970 foreach( $this->index_event_IDs[$event] as $l_plugin_ID )
4971 {
4972 $this->call_method( $l_plugin_ID, $event, $params );
4973
4974- if( ! empty($this->_stop_propagation) )
4975- { // A plugin has requested to stop propagation.
4976+ if( ! empty( $this->_stop_propagation ) )
4977+ {
4978+ // A plugin has requested to stop propagation.
4979 $this->_stop_propagation = false;
4980 break;
4981 }
4982@@ -836,32 +713,25 @@
4983
4984
4985 /**
4986- * Call all plugins for a given event, until the first one returns true.
4987- *
4988+ * Call all plugins for a given event, until the first one returns true
4989 * @param string event name, see {@link Plugins_admin::get_supported_events()}
4990 * @param array Associative array of parameters for the Plugin
4991 * @return array The (modified) params array with key "plugin_ID" set to the last called plugin;
4992- * Empty array if no Plugin returned true or no Plugin has this event registered.
4993+ * Empty array if no Plugin returned true or no Plugin has this event registered.
4994 */
4995 function trigger_event_first_true( $event, $params = NULL )
4996 {
4997- global $Debuglog;
4998-
4999- $Debuglog->add( 'Trigger event '.$event.' (first true)', 'plugins' );
5000-
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches