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