Archived
1
0

Compare commits

...

181 Commits

Author SHA1 Message Date
Garvin Hicking 262c9174f0 prepare release 2013-07-26 16:59:11 +02:00
Matthias Gutjahr cda50f40fa Added fix for comment_author_self (cp. http://board.s9y.org/viewtopic.php?f=10&t=19115) 2013-07-26 12:48:13 +02:00
Matthias Mees 61a85c28f8 Bump 2k11 update date. 2013-07-24 16:23:58 +02:00
Matthias Mees 81d1a77c66 Remove protocol from google webfonts in 2k11's preview. 2013-07-23 10:47:53 +02:00
Matthias Mees 28d8a0fb34 Remove protocol from google webfonts in 2k11. 2013-07-23 10:46:17 +02:00
Garvin Hicking e283ba69b3 backport 2013-07-23 10:03:53 +02:00
Garvin Hicking 1ea154b028 fix parse error, sorry 2013-07-23 09:34:39 +02:00
Garvin Hicking 3d7f4dc250 switch to mysqli if php5.5 is detected (mysql deprecated) 2013-07-23 09:32:42 +02:00
Ian dfcd778001 Update serendipity_event_spartacus.php
disabled todo note 
Serendipity version check is working
2013-07-21 16:47:09 +02:00
Ian 39e8dbe05c upgrader note BP template change 2013-07-16 15:20:40 +02:00
Ian 694a81a286 accessify throw new ErrorException to PHP >= 5.3 only
since 5.2.x (sometimes?) may create strange errors, see http://board.s9y.org/viewtopic.php?f=10&t=19436

I think we don't need to upport this to 2.0, since we will need to bump Serendipity's PHP version to need 5.3 or even up, because of namespaces, security and others soon. PHP 5.2 support has stopped and the PHP 5.3 series has reached end-of-life this summer and will receive only security fixes for the next year.
2013-07-15 20:11:47 +02:00
Ian 34de15298d document 2013-06-28 18:06:58 +02:00
Ian a68f57498b upgrade Smarty to 3.1.14 - see changelog 2013-06-28 17:01:48 +02:00
Garvin Hicking 33a649d624 thanks, ian 2013-06-09 20:07:28 +02:00
Garvin Hicking 16a14d2965 Upgrade will now remove browsercompat plugin (hopefully, needs testing) ;) 2013-06-09 13:33:39 +02:00
Ian e2bad7dd50 revisited 1082a5c
better use the hook, if available, but still left .htaccess file and .thumbs dir exludement where this was necessary
2013-06-05 11:34:18 +02:00
Ian 1082a5c266 Fixed ML exclude path to not show/proceed ckeditor/kcfinders .thumbs dir
this also did some tab2whitespace cleanup
and also fixed serendipity_fetchImages() to skip .htaccess files for ckeditor/kcfinder usage
2013-06-04 19:23:21 +02:00
Ian 230175edd4 respect github sourcecode prettify 2013-05-31 21:05:05 +02:00
Ian e7c93ad835 plugin API method parseTemplate() is 1.7 ready 2013-05-31 12:11:33 +02:00
Ian f2c6983139 catch up add 2013-05-30 21:23:54 +02:00
Ian 4efc4c0ac1 catch up with "2.0" 2013-05-30 21:18:05 +02:00
Ian 7182b48991 use USERLEVEL_ADMIN 2013-05-29 15:43:16 +02:00
Ian 68fbc2112e bind production mode view errors to admin users 2013-05-29 15:05:16 +02:00
Ian b0af9f201a some more verbose doc notes in 2aab3f 2013-05-29 12:52:44 +02:00
Ian 2aab3f9ca4 production mode error accessment 2013-05-28 14:41:09 +02:00
Ian 3f2f853f23 document 2013-05-28 12:37:09 +02:00
Ian fc184b815f bump date for 4883824 2013-05-27 19:39:35 +02:00
Ian 4883824238 fixed categorytemplates in colorset bulletproof 2013-05-27 19:37:09 +02:00
Ian f743546d3b ixed some missing ending strong tags 2013-05-22 15:53:41 +02:00
Matthias Mees 4eaa36608b Properly encoded German translation for stable archives. 2013-05-21 10:10:15 +02:00
Matthias Mees 81ae9c9b21 German translation for stable archives added. 2013-05-20 19:01:08 +02:00
Ian 702663cae9 document 2013-05-16 17:47:46 +02:00
Ian 4db855dc40 spartacus - fixed curl result bug 2013-05-16 17:30:30 +02:00
Ian 07ef469c12 document rc meaning "in time of" 2013-05-15 12:05:43 +02:00
Ian 3b07311d9a document 2013-05-15 11:51:04 +02:00
Garvin Hicking 684ef4d3d1 document 2013-05-15 09:40:04 +02:00
onli 78f044c421 also copy baseURL if defaultBaseURL empty but set 2013-05-14 15:31:06 +02:00
onli 84eff93dec Merge branch 'master' of github.com:s9y/Serendipity 2013-05-14 00:52:35 +02:00
onli bc0519a453 copy baseURL to defaultBaseURL on upgrade 2013-05-14 00:52:18 +02:00
Ian 07493279ea logicals, thanks to Jos
http://board.s9y.org/viewtopic.php?f=4&t=19296
2013-05-13 19:50:33 +02:00
Ian 242520bb50 fixed statistics sidebar querys for PostgreSQL 2013-05-13 19:29:09 +02:00
Ian a12c4f306d fixed to UTF-8 w/o BOM and debug typo 2013-05-12 15:29:01 +02:00
Garvin Hicking 659ea22c58 1.7.1 2013-05-12 12:41:21 +02:00
Ian 61a51e10f8 typo 2013-05-11 19:21:20 +02:00
Ian 2c7af59f5f fixed bug in commit 9ce7e73 2013-05-11 18:53:27 +02:00
Garvin Hicking 2609304ab4 release doc 2013-05-11 16:17:35 +02:00
Garvin Hicking 5ff6793e55 release hints 2013-05-11 15:30:48 +02:00
Garvin Hicking f191883708 prepare release 2013-05-11 15:24:22 +02:00
Garvin Hicking 50322c9f63 merge to deployment 2013-05-11 15:23:37 +02:00
Garvin Hicking 8055e954ee fix typo 2013-05-09 12:38:34 +02:00
Ian 7fb6b5a305 serendipity_emit_htmlarea_code() does not need to return true
which can note badly as 1 in 'backend_wysiwyg' hooks
2013-05-08 20:10:38 +02:00
Ian 3a5af56fc9 note ckeditor plugin ready 2013-05-07 17:31:59 +02:00
Garvin Hicking 4fe1491eaf Merge pull request #16 from rlerdorf/master
Fix a bunch of typos and minor mistakes
2013-05-06 00:49:12 -07:00
Rasmus Lerdorf b79ab865c7 Fix a bunch of typos and minor mistakes 2013-05-05 23:45:38 -07:00
Ian 961add3ff6 disabled ckeditor source mode fallback 2013-05-05 19:08:55 +02:00
Ian b959adf5c8 get JS ready for CKEDITOR plugin 2013-05-05 17:06:00 +02:00
Ian 2f8e0a75d4 note 53ed3ab issue 2013-05-05 15:49:07 +02:00
Ian 53ed3ab139 fixed plugin-hooks staticpage form textarea element objects in non-wysiwyg mode 2013-05-05 15:34:42 +02:00
Matthias Mees 9f671a47b1 Forgot to bump the date. 2013-05-04 13:28:24 +02:00
Matthias Mees 214bbfdc22 Updated 2k11 to v1.2.7. 2013-05-04 13:26:26 +02:00
Garvin Hicking c498dee9fd document 2013-04-29 13:25:05 +02:00
Garvin Hicking 90cc96fd7d htaccess fix by dlange 2013-04-29 13:22:20 +02:00
Ian b54d5f9693 fixed testing checksum empty 2013-04-25 11:11:38 +02:00
Ian ae2414134e fixed spamblock PHP 5.4 warning 2013-04-23 09:56:53 +02:00
Vladimir Ajgl 8d0f3db5ba big cleanup of czech language file - unification of used terms, fix of wrongly translated terms 2013-04-13 15:12:07 +02:00
Ian 1b53092a21 enhance 7548e68c31 to better check null first 2013-04-08 18:38:16 +02:00
Ian 7548e68c31 better exception switch for db connect errors 2013-04-08 17:56:43 +02:00
Ian 0c0367ceab fixed 1e5c38d065 doc typo 2013-04-07 18:38:54 +02:00
Ian 1e5c38d065 avoid SPL exception display db connect data 2013-04-07 17:23:10 +02:00
Vladimir Ajgl 9d8829f0df update of czech translation for 2k11 template 2013-03-31 20:53:18 +02:00
Matthias Mees 59676677b9 Missed a JS file due to friggin' permissions. Grrr. 2013-03-30 12:54:38 +01:00
Matthias Mees cf4b76ee21 Updated 2k11 to v1.2.6. 2013-03-30 12:53:18 +01:00
Matthias Mees cf2f7c1528 Fixes static page date format. 2013-03-26 18:44:15 +01:00
Ian 4c483e7f73 fixed upgrader typo 2013-03-21 17:36:19 +01:00
Ian df505a4d93 news update 2013-03-13 09:58:17 +01:00
Ian 1d1a68aa17 entryproperties userlevel check var has strictly changed...
this old var (and the new) did work before, but what made it change?
2013-03-10 10:38:40 +01:00
Vladimir Ajgl 1c302acb5e czech translation update 2013-03-03 12:54:14 +01:00
Ian 5fbe6850f4 stick to constant string and revert 412359a 2013-02-20 17:18:01 +01:00
Ian cac6e0f0e2 fixed media_items wrong th tag 2013-02-18 15:34:50 +01:00
Ian f107736a41 fixed media pane redundant </td> 2013-02-18 15:32:40 +01:00
Ian 412359adf7 fixed echo mixed array name constant/vars in groups 2013-02-18 14:44:13 +01:00
Ian 8f168c8665 debug_backtrace >= php 5.3.6 only 2013-02-12 09:16:36 +01:00
Garvin Hicking 6de3d6c5b6 rc4 (not to be released right now though) 2013-02-08 08:40:39 +01:00
Garvin Hicking e846b0ea8c backport 2013-02-08 08:40:03 +01:00
Garvin Hicking 54e044ff09 escape hotlinked image 2013-02-08 08:28:22 +01:00
Matthias Mees 75ab019136 Escaping. Final version. Hopefully. 2013-02-07 23:46:12 +01:00
Matthias Mees 7d2febdb22 Escaping JS instead of HTML. 2013-02-07 19:35:27 +01:00
Matthias Mees 8966e1605d Escape emitted template option HTML. 2013-02-07 17:01:30 +01:00
Matthias Mees ce09949de9 Escape emitted template option HTML. 2013-02-07 16:29:39 +01:00
Garvin Hicking 3a20602939 prep rc3 2013-02-07 13:26:23 +01:00
Garvin Hicking da58de906e Merge branch 'master' of github.com:s9y/Serendipity
Conflicts:
	docs/NEWS
2013-02-07 12:42:28 +01:00
Garvin Hicking e983c31ee4 Port missing from 2.0 2013-02-07 12:40:24 +01:00
Garvin Hicking 2962760352 better value escaping (please check) 2013-02-07 12:37:06 +01:00
Ian 8215d0dbcd typo 2013-02-07 12:07:33 +01:00
Ian ff4d511a2f reset verbosity in testing environments back to original intention
and be more strict to $serendipity['production']
2013-02-07 12:01:37 +01:00
Ian b72f6d98d9 fix double slash in target 2013-02-07 11:07:54 +01:00
Matthias Gutjahr aadc851bf1 Fix for "Illegal string offset 'tag'" error 2013-02-06 11:42:20 +01:00
Ian 2554e3cc6e temporary workaround "Illegal string offset 'tag'" error
until better idea, as using isset() here, ends up with count($files)
DEBUG: ERROR: XML tree did not contain requested plugin: error.
2013-02-04 14:21:27 +01:00
Ian b7e6952b36 added empty $template_config_groups var
for template changes, if previous template had these set
2013-02-03 11:20:28 +01:00
Ian fa53301283 smarty bugfix
as might be related to the microformat error reason (~?)
2013-01-25 09:16:58 +01:00
Ian 8c9f8d2a66 fixed explode 2cd param to string 2013-01-24 17:57:14 +01:00
Ian 95a21fea7d added smarty BC function get_template_vars()
relies on some additional plugins like serendipity_event_autotitle.php, serendipity_event_multilingual, serendipity_event_sidebarhider, serendipity_event_downloadmanager, serendipity_event_microformats and possibly also more plugins by custom developers.
2013-01-24 15:40:22 +01:00
Ian 4174a8f7fc bump date in changed BP template 2013-01-23 12:22:00 +01:00
Ian 985d8d29ca reflect POST in BP template configs re-set situations 2013-01-23 11:08:33 +01:00
Ian 16cf06e60e Update include/serendipity_smarty_class.inc.php
re-add prev removed disabled config switch
2013-01-21 17:11:44 +01:00
Matthias Mees 568bba8ade Note changed to reflect safer version. 2013-01-21 16:54:46 +01:00
Matthias Mees a55fd284c2 Safer version of Smarty3 compatibility. 2013-01-21 16:51:16 +01:00
Garvin Hicking b608d63e35 Smarty3 compatibility to promote $entry to sub-templates 2013-01-21 10:06:44 +01:00
Garvin Hicking fdeefd2cf7 Merge branch 'master' of https://github.com/s9y/Serendipity 2013-01-21 09:27:12 +01:00
Garvin Hicking edc8c35be2 browsercompat note 2013-01-20 13:10:46 +01:00
Garvin Hicking fef75b3f9f Merge branch 'master' of https://github.com/s9y/Serendipity 2013-01-20 13:09:08 +01:00
garvinhicking 10fddac2d8 add note about browsercompat 2013-01-20 13:07:39 +01:00
Garvin Hicking f704375a2c I guess I will never understand bitmasks.
This now seems to work in both PHP 5.2 and PHP 5.4, and I might even udnerstand why ;)
2013-01-20 11:04:14 +01:00
Garvin Hicking 6f2858ad27 Fix the error_reporting somewhat; until now, prevent E_STRICT errors were not correctly surpressed, but
we need to do this, because otherwise older plugins will prevent Serendipity from loading.

I actually wanted to at least "break" stuff and report errors, when $serendipity['production'] is set to "debug".

However, this does NOT work for me (PHP 5.2); even when set to "debug", E_STRICT errors do not seem to show up.
I'm quite at a loss here, so anyone reading this, go ahead and inspect.

At least it makes this version work when "older" plugins exists. It would be great if the code could be made to show the debug errors in debug mode.

I shuffled around the error_reporting() position because when someone sets the variable in serendipity_config_local.inc.php it would be too early to affect code flow; now it should evaluate the variable properly.
2013-01-20 01:24:23 +01:00
Garvin Hicking e952791bb1 Bump version, also add some upgrader notices for people to see 2013-01-19 15:52:41 +01:00
Garvin Hicking de2188ed0b This at least fixes some issues in the frontend.
I get errors only in my PHP 5.2 installation, PHP 5.4 is different.
In my backend now I do get a STRICT STANDARDS error still, even if it should be muted.
I don't understand this, needs more thorough investigation.
2013-01-19 15:49:42 +01:00
Ian 7143f43cf0 fixed Illegal string offset 'tag' 2013-01-19 12:42:23 +01:00
Garvin Hicking a4e14b62c2 Label as 1.7-rc1 2013-01-19 11:35:05 +01:00
Ian ba993f66de fixed some old markup missing tags
fixed non ending div tag with uneven radio buttons
fixed non ending ol and tr in sequence

please double check!
2013-01-16 17:55:37 +01:00
Ian 9012161c8b Smarty 3.1.13 - see changelog 2013-01-16 17:39:51 +01:00
Matthias Mees 9674ffb106 Updated 2k11 to v1.2.5. 2013-01-13 21:21:17 +01:00
Ian 82e8a44cf0 entry form toolbar document.write replacement 2013-01-13 13:49:22 +01:00
Matthias Mees 6716590c91 Added .editorconfig to .gitignore. 2013-01-06 16:32:07 +01:00
Garvin Hicking 511004af24 typo fix by qbi 2013-01-01 21:20:29 +01:00
Ian e2bec8a1d6 moved script part to head and some indent cleanup 2012-12-30 10:35:31 +01:00
Ian 6d8590c44b convert document.write and removed some wrong closing tags 2012-12-30 10:26:12 +01:00
Ian 326929d67d imageCrop now opens via window.open 2012-12-30 09:55:42 +01:00
Ian a5064dba23 fixed old bug with non closings tags which modern browser didn't mind 2012-12-17 13:22:16 +01:00
Ian a5d03bfb56 reverted last commit to only clear errored line 1512
"Only variables should be assigned by reference"
2012-12-13 15:10:44 +01:00
Ian 6a147be2cd Merge branch 'master' of github.com:s9y/Serendipity 2012-12-13 15:02:38 +01:00
Ian 6a796ebe93 Revert to 78cb307b73 2012-12-13 14:49:51 +01:00
Ian 78cb307b7e Only variables should be assigned by reference 2012-12-13 13:41:50 +01:00
Ian 57f5e8d48b fixUrl fix 2012-12-10 10:12:53 +01:00
Ian dd4a1d97ba fixed note typo and shorten param 2012-12-08 14:23:54 +01:00
Ian 4028ac265b backport 9aebc99 - fixed doubled slashes without breaking URI
also fixing some tabs to spaces
2012-12-08 14:08:04 +01:00
Matthias Mees b3365c4a0d Updated 2k11 to v1.2.4. 2012-12-04 12:42:54 +01:00
Garvin Hicking e4530d4ae0 backport (hopefully alright) 2012-11-29 16:03:01 +01:00
Ian 41f5f0aea7 added renaming description constant to backend media upload 2012-11-29 14:02:08 +01:00
Ian 28a30ce050 added new constant PLAIN_ASCII_NAMES 2012-11-29 14:00:41 +01:00
Garvin Hicking 7aab7dde09 Merge pull request #11 from weltling/master
Support port config for postgres
2012-11-26 00:19:47 -08:00
Anatoliy Belsky b55e516651 Support port config for postgres db connection 2012-11-25 14:56:52 +01:00
Matthias Gutjahr 10a1a5c565 Added check for non-existing 'tag' key 2012-11-14 18:34:19 +01:00
Matthias Mees 64adea2cee Updated jQuery to v1.8.3. 2012-11-13 15:19:08 +01:00
Ian 9c7b579a1e strip down double slashes in prev & next links
see http://board.s9y.org/viewtopic.php?f=10&t=18944
2012-11-12 13:23:47 +01:00
Ian d4d24c4c31 fixed last commits array to string 2012-11-12 11:41:49 +01:00
Garvin Hicking b3755bcb28 one more try 2012-11-06 14:50:12 +01:00
Garvin Hicking 3b00ba8767 try to circumvent a problem 2012-11-06 12:39:19 +01:00
Garvin Hicking e354ecdd3e Bugfix, wrong variable. 2012-11-06 11:24:29 +01:00
Garvin Hicking 5a33a7c8d0 * Allow entryproperties plugin to define defaults for custom fields 2012-10-30 11:35:40 +01:00
Garvin Hicking d887078a3d PHP5 compat 2012-10-18 11:19:44 +02:00
Garvin Hicking 48861c5505 More PHP5 compatibility (this constructor thing order did not remove the error for me)
Also be able to set $serendipity['production'] in serendipity_config_local.inc.php
2012-10-18 10:13:11 +02:00
Ian a8ffe23890 another str_repeat math issue 2012-10-17 18:05:15 +02:00
Ian 22ab2433c7 another php5 combat assign reference issue 2012-10-17 18:04:07 +02:00
Ian 8a42ed74c4 fixed wrong paranthesis in media_upload.tpl 2012-10-17 15:00:08 +03:00
Matthias Mees 71ca3cd6de Updated 2k11 to v1.2.3. 2012-10-15 08:37:35 +02:00
Don Chambers 1889a7d248 Update bulletproof with staticpage breadcrumb nav 2012-10-13 14:34:40 -05:00
Ian 84b1569fe5 fixed PHP5 only variables should be assigned by reference 2012-10-09 20:16:10 +02:00
Ian 1087a75cf1 fix str_repeat modifier use
A Smarty3 modifier has higher priority than multiplication, so we have to use () to execute math first
2012-10-07 10:25:00 +02:00
Matthias Mees 614a9abe29 Oops, screwed up file permissions reverted. 2012-10-03 15:38:50 +02:00
Matthias Mees 3526eb6ab3 Updated 2k11 to v1.2. 2012-10-03 15:35:30 +02:00
Ian dae8075e47 some document.write replacements with better method 2012-09-27 15:45:06 +02:00
Ian 0644cd803c Smarty 3.1.12 has been released.
3.1.12 has minor bug fixes and improvements. Smarty also received a security fix regarding the escapement of Smarty error messages. ie. an unrealistic but testable case where you call $smarty->display($_GET['id']); and the GET value is passed directly to the error message. To resolve any probable concern, error messages are now escaped.

For details please read the Smarty 3.1.12 Change Log.
2012-09-26 08:59:16 +02:00
Ian 10af3cf189 Update plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php
empty entries caused error in alpha versions.
2012-09-24 19:49:58 +03:00
Matthias Mees 0df4069928 Updated jQuery to v1.8.2. 2012-09-21 11:21:56 +02:00
Vladimir Ajgl 388e0bf67c update of czech translation 2012-09-09 20:23:17 +02:00
Matthias Mees 1d2380ca65 Updated jQuery to 1.8.1. 2012-09-01 20:54:34 +02:00
Matthias Mees ab4a8da625 Added OS X hidden files to ignore file. 2012-08-24 14:24:35 +02:00
Ian 36b9441af0 cleared whitespace missmatch in serendipity_die() 2012-08-23 17:16:35 +02:00
Ian 71c1011eb5 fixed github preview image path 2012-08-22 20:41:58 +02:00
Matthias Mees 66f84cfee7 Updated jQuery to 1.8.0. 2012-08-10 00:12:21 +02:00
Matthias Mees 8bd891bc80 Updated 2k11 to v1.1.8. 2012-08-01 14:23:28 +02:00
Garvin Hicking 1593395f21 issue fix 2012-07-27 11:46:58 +02:00
Ian 81c3de9a3d Smarty 3.1.11 2012-07-01 18:25:01 +02:00
Grischa Brockhaus 823e39f22e ESTRICT double constructor (wrong order of them) 2012-06-22 19:16:58 +02:00
Grischa Brockhaus 8f87205cdd E_STRICT fix. :-/ (this really starts to get annoying..) 2012-06-14 14:03:51 +02:00
Grischa Brockhaus dd6ab83600 E_STRICT fixes 2012-06-14 13:12:51 +02:00
Grischa Brockhaus 001ea42d96 Fixed simplepie to make it work with E_STRICT. 2012-06-14 12:05:52 +02:00
Grischa Brockhaus f951f4498f ESTRICT compatibility fixes 2012-06-13 15:35:02 +02:00
Grischa Brockhaus d6c4f8a4de Merge branch 'master' of git+ssh://git@github.com/s9y/Serendipity.git 2012-06-13 15:27:35 +02:00
Grischa Brockhaus a8112cecac ESTRICT compatibility fixes 2012-06-13 15:27:13 +02:00
Garvin Hicking 6a3904b599 backport 2012-06-13 15:23:51 +02:00
333 changed files with 9889 additions and 15826 deletions
+1
View File
@@ -13,3 +13,4 @@ plugins/additional_plugins*
/.buildpath
/.project
.DS_Store
.editorconfig
-6
View File
@@ -1,9 +1,3 @@
# Serendipity - a PHP Weblog/Blog software
[Serendipity](http://s9y.org) is a PHP-powered weblog application which gives the user an easy way to maintain an online diary, weblog or even a complete homepage. While the default package is designed for the casual blogger, Serendipity offers a flexible, expandable and easy-to-use framework with the power for professional applications.
This is a testing branch to mainly support the new backend smartification.
Use with care!
https://github.com/ophian/s9y-admin-tpl forked from https://github.com/yellowled/s9y-admin-tpl
+1 -1
View File
@@ -166,7 +166,7 @@ class ONYX_RSS
clearstatcache();
if (!($fp = @fopen($file, 'r')))
{
$this->raiseError((__LINE__-2), 'Could not read contents of cache file (<em>'.$cache_file.'</em>).');
$this->raiseError((__LINE__-2), 'Could not read contents of cache file (<em>'.$file.'</em>).');
return false;
}
$this->data = unserialize(fread($fp, filesize($file)));
+2 -2
View File
@@ -1,4 +1,4 @@
Smarty 3.1.12
Smarty 3.1.14
Author: Monte Ohrt <monte at ohrt dot com >
Author: Uwe Tews
@@ -120,7 +120,7 @@ $smarty->unregisterObject($object_name)
$smarty->unregisterFilter($type, $function_name)
$smarty->unregisterResource($resource_type)
$smarty->compileAllTemplates($extention = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
$smarty->compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
$smarty->clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)
$smarty->testInstall()
+1 -1
View File
@@ -199,7 +199,7 @@ Relative paths are available with {include file="..."} and
$smarty->fetch('./foo.tpl') cannot be relative to a template, an
exception is thrown.
Adressing a specific $template_dir
Addressing a specific $template_dir
Smarty 3.1 introduces the $template_dir index notation.
$smarty->fetch('[foo]bar.tpl') and {include file="[foo]bar.tpl"}
+73 -9
View File
@@ -1,4 +1,68 @@
===== Smarty-3.1.12 =====
===== Smarty-3.1.14 =====
27.06.2013
- bugfix removed PHP 5.5 deprecated preg_replace /e option in modifier capitalize (forum topic 24389)
17.06.2013
- fixed spelling in sources and documentation (from smarty-developers forum Veres Lajos)
- enhancement added constant SMARTY::CLEAR_EXPIRED for the change of 26.05.2013 (forum topic 24310)
- bugfix added smarty_security.php to composer.json (Issue 135)
26.05.2013
- enhancement an expire_time of -1 in clearCache() and clearAllCache() will delete outdated cache files
by their individual cache_lifetime used at creation (forum topic 24310)
21.05.2013
- bugfix modifier strip_tags:true was compiled into wrong code (Forum Topic 24287)
- bugfix /n after ?> in Smarty.class.php did start output buffering (Issue 138)
25.04.2013
- bugfix escape and wordrap modifier could be compiled into wrong code when used in {nocache}{/nocache}
section but caching is disabled (Forum Topic 24260)
05.04.2013
- bugfix post filter must not run when compiling inheritance child blocks (Forum Topic 24094)
- bugfix after the fix for Issue #130 compiler exceptions got double escaped (Forum Topic 24199)
28.02.2013
- bugfix nocache blocks could be lost when using CACHING_LIFETIME_SAVED (Issue #133)
- bugfix Compile ID gets nulled when compiling child blocks (Issue #134)
24.01.2013
- bugfix wrong tag type in smarty_internal_templatecompilerbase.php could cause wrong plugin search order (Forum Topic 24028)
===== Smarty-3.1.13 =====
13.01.2013
- enhancement allow to disable exception message escaping by SmartyException::$escape = false; (Issue #130)
09.01.2013
- bugfix compilation did fail when a prefilter did modify an {extends} tag c
- bugfix template inheritance could fail if nested {block} tags in childs did contain {$smarty.block.child} (Issue #127)
- bugfix template inheritance could fail if {block} tags in childs did have similar name as used plugins (Issue #128)
- added abstract method declaration doCompile() in Smarty_Internal_TemplateCompilerBase (Forum Topic 23969)
06.01.2013
- Allow '://' URL syntax in template names of stream resources (Issue #129)
27.11.2012
- bugfix wrong variable usage in smarty_internal_utility.php (Issue #125)
26.11.2012
- bugfix global variable assigned within template function are not seen after template function exit (Forum Topic 23800)
24.11.2012
- made SmartyBC loadable via composer (Issue #124)
20.11.2012
- bugfix assignGlobal() called from plugins did not work (Forum Topic 23771)
13.11.2012
- adding attribute "strict" to html_options, html_checkboxes, html_radios to only print disabled/readonly attributes if their values are true or "disabled"/"readonly" (Issue #120)
01.11.2012
- bugfix muteExcpetedErrors() would screw up for non-readable paths (Issue #118)
===== Smarty-3.1.12 =====
14.09.2012
- bugfix template inheritance failed to compile with delimiters {/ and /} (Forum Topic 23008)
@@ -386,7 +450,7 @@
03/09/2011
- bugfix createTemplate() must default to cache_id and compile_id of Smarty object
- bugfix Smarty_CacheResource_KeyValueStore must include $source->uid in cache filepath to keep templates with same
name but different folders seperated
name but different folders separated
- added cacheresource.apc.php example in demo folder
02/09/2011
@@ -577,7 +641,7 @@
- changed ./ and ../ behaviour
14/02/2011
- added {block ... hide} option to supress block if no child is defined
- added {block ... hide} option to suppress block if no child is defined
13/02/2011
- update handling of recursive subtemplate calls
@@ -691,7 +755,7 @@
- bugfix on compiler object destruction. compiler_object property was by mistake unset.
09/03/2011
-bugfix a variable filter should run before modifers on an output tag (see change of 23/07/2010)
-bugfix a variable filter should run before modifiers on an output tag (see change of 23/07/2010)
08/03/2011
- bugfix loading config file without section should load only defaults
@@ -995,10 +1059,10 @@ request_use_auto_globals
- bugfix passing scope attributes in doublequoted strings did not work at {include} {assign} and {append}
25/07/2010
- another bugfix of change from 23/07/2010 when compiling modifer
- another bugfix of change from 23/07/2010 when compiling modifier
24/07/2010
- bugfix of change from 23/07/2010 when compiling modifer
- bugfix of change from 23/07/2010 when compiling modifier
23/07/2010
- changed execution order. A variable filter does now run before modifiers on output of variables
@@ -1305,7 +1369,7 @@ request_use_auto_globals
- bugfix on {if} tags
01/12/2010
- changed back modifer handling in parser. Some restrictions still apply:
- changed back modifier handling in parser. Some restrictions still apply:
if modifiers are used in side {if...} expression or in mathematical expressions
parentheses must be used.
- bugfix the {function..} tag did not accept the name attribute in double quotes
@@ -1917,7 +1981,7 @@ NOTICE: existing compiled template and cache files must be deleted
- fixed exceptions in function plugins
- fixed notice error in Smarty.class.php
- allow chained objects to span multiple lines
- fixed error in modifers
- fixed error in modifiers
03/20/2009
- moved /plugins folder into /libs folder
@@ -1925,7 +1989,7 @@ NOTICE: existing compiled template and cache files must be deleted
- autoappend a directory separator if the xxxxx_dir definition have no trailing one
03/19/2009
- allow array definition as modifer parameter
- allow array definition as modifier parameter
- changed modifier to use multi byte string funktions.
03/17/2009
+25 -12
View File
@@ -2,7 +2,7 @@
/**
* Project: Smarty: the PHP compiling template engine
* File: Smarty.class.php
* SVN: $Id: Smarty.class.php 4658 2012-09-11 16:23:30Z uwe.tews@googlemail.com $
* SVN: $Id: Smarty.class.php 4742 2013-06-17 13:30:49Z Uwe.Tews@googlemail.com $
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -28,7 +28,7 @@
* @author Uwe Tews
* @author Rodney Rehm
* @package Smarty
* @version 3.1.12
* @version 3.1-DEV
*/
/**
@@ -113,7 +113,7 @@ class Smarty extends Smarty_Internal_TemplateBase {
/**
* smarty version
*/
const SMARTY_VERSION = 'Smarty-3.1.12';
const SMARTY_VERSION = 'Smarty-3.1.14';
/**
* define variable scopes
@@ -128,6 +128,11 @@ class Smarty extends Smarty_Internal_TemplateBase {
const CACHING_OFF = 0;
const CACHING_LIFETIME_CURRENT = 1;
const CACHING_LIFETIME_SAVED = 2;
/**
* define constant for clearing cache files be saved expiration datees
*/
const CLEAR_EXPIRED = -1;
/**
* define compile check modes
*/
@@ -1323,9 +1328,9 @@ class Smarty extends Smarty_Internal_TemplateBase {
* @param int $max_errors
* @return integer number of template files recompiled
*/
public function compileAllTemplates($extention = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
public function compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
{
return Smarty_Internal_Utility::compileAllTemplates($extention, $force_compile, $time_limit, $max_errors, $this);
return Smarty_Internal_Utility::compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, $this);
}
/**
@@ -1337,9 +1342,9 @@ class Smarty extends Smarty_Internal_TemplateBase {
* @param int $max_errors
* @return integer number of template files recompiled
*/
public function compileAllConfig($extention = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null)
public function compileAllConfig($extension = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null)
{
return Smarty_Internal_Utility::compileAllConfig($extention, $force_compile, $time_limit, $max_errors, $this);
return Smarty_Internal_Utility::compileAllConfig($extension, $force_compile, $time_limit, $max_errors, $this);
}
/**
@@ -1392,10 +1397,12 @@ class Smarty extends Smarty_Internal_TemplateBase {
// add the SMARTY_DIR to the list of muted directories
if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) {
$smarty_dir = realpath(SMARTY_DIR);
Smarty::$_muted_directories[SMARTY_DIR] = array(
'file' => $smarty_dir,
'length' => strlen($smarty_dir),
);
if ($smarty_dir !== false) {
Smarty::$_muted_directories[SMARTY_DIR] = array(
'file' => $smarty_dir,
'length' => strlen($smarty_dir),
);
}
}
// walk the muted directories and test against $errfile
@@ -1403,6 +1410,11 @@ class Smarty extends Smarty_Internal_TemplateBase {
if (!$dir) {
// resolve directory and length for speedy comparisons
$file = realpath($key);
if ($file === false) {
// this directory does not exist, remove and skip it
unset(Smarty::$_muted_directories[$key]);
continue;
}
$dir = array(
'file' => $file,
'length' => strlen($file),
@@ -1481,8 +1493,9 @@ if (Smarty::$_CHARSET !== 'UTF-8') {
* @package Smarty
*/
class SmartyException extends Exception {
public static $escape = true;
public function __construct($message) {
$this->message = htmlentities($message);
$this->message = self::$escape ? htmlentities($message) : $message;
}
}
@@ -116,6 +116,23 @@ function smarty_function_html_checkboxes($params, $template)
case 'assign':
break;
case 'strict': break;
case 'disabled':
case 'readonly':
if (!empty($params['strict'])) {
if (!is_scalar($_val)) {
trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE);
}
if ($_val === true || $_val === $_key) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"';
}
break;
}
// omit break; to fall through!
default:
if(!is_array($_val)) {
$extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
@@ -90,7 +90,24 @@ function smarty_function_html_options($params, $template)
$selected = smarty_function_escape_special_chars((string) $_val);
}
break;
case 'strict': break;
case 'disabled':
case 'readonly':
if (!empty($params['strict'])) {
if (!is_scalar($_val)) {
trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE);
}
if ($_val === true || $_val === $_key) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"';
}
break;
}
// omit break; to fall through!
default:
if (!is_array($_val)) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
@@ -102,6 +102,23 @@ function smarty_function_html_radios($params, $template)
case 'assign':
break;
case 'strict': break;
case 'disabled':
case 'readonly':
if (!empty($params['strict'])) {
if (!is_scalar($_val)) {
trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE);
}
if ($_val === true || $_val === $_key) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"';
}
break;
}
// omit break; to fall through!
default:
if (!is_array($_val)) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
@@ -30,7 +30,7 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals
$upper_string = mb_convert_case( $string, MB_CASE_TITLE, Smarty::$_CHARSET );
} else {
// uppercase word breaks
$upper_string = preg_replace("!(^|[^\p{L}'])([\p{Ll}])!eS" . Smarty::$_UTF8_MODIFIER, "stripslashes('\\1').mb_convert_case(stripslashes('\\2'),MB_CASE_UPPER, '" . addslashes(Smarty::$_CHARSET) . "')", $string);
$upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).mb_convert_case(stripslashes($matches[2]),MB_CASE_UPPER, "' . addslashes(Smarty::$_CHARSET) . '");'), $string);
}
// check uc_digits case
if (!$uc_digits) {
@@ -40,7 +40,7 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals
}
}
}
$upper_string = preg_replace("!((^|\s)['\"])(\w)!e" . Smarty::$_UTF8_MODIFIER, "stripslashes('\\1').mb_convert_case(stripslashes('\\3'),MB_CASE_UPPER, '" . addslashes(Smarty::$_CHARSET) . "')", $upper_string);
$upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).mb_convert_case(stripslashes($matches[3]),MB_CASE_UPPER, "' . addslashes(Smarty::$_CHARSET) . '");'), $upper_string);
return $upper_string;
}
@@ -49,7 +49,7 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals
$string = strtolower($string);
}
// uppercase (including hyphenated words)
$upper_string = preg_replace("!(^|[^\p{L}'])([\p{Ll}])!eS" . Smarty::$_UTF8_MODIFIER, "stripslashes('\\1').ucfirst(stripslashes('\\2'))", $string);
$upper_string = preg_replace_callback("!(^|[^\p{L}'])([\p{Ll}])!S" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).ucfirst(stripslashes($matches[2]));'), $string);
// check uc_digits case
if (!$uc_digits) {
if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!" . Smarty::$_UTF8_MODIFIER, $string, $matches, PREG_OFFSET_CAPTURE)) {
@@ -58,7 +58,7 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals
}
}
}
$upper_string = preg_replace("!((^|\s)['\"])(\w)!e" . Smarty::$_UTF8_MODIFIER, "stripslashes('\\1').strtoupper(stripslashes('\\3'))", $upper_string);
$upper_string = preg_replace_callback("!((^|\s)['\"])(\w)!" . Smarty::$_UTF8_MODIFIER, create_function ('$matches', 'return stripslashes($matches[1]).ucfirst(stripslashes($matches[3]));'), $upper_string);
return $upper_string;
}
@@ -112,7 +112,7 @@ function smarty_modifiercompiler_escape($params, $compiler)
}
// could not optimize |escape call, so fallback to regular plugin
if ($compiler->tag_nocache | $compiler->nocache) {
if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) {
$compiler->template->required_plugins['nocache']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php';
$compiler->template->required_plugins['nocache']['escape']['modifier']['function'] = 'smarty_modifier_escape';
} else {
@@ -20,14 +20,9 @@
*/
function smarty_modifiercompiler_strip_tags($params, $compiler)
{
if (!isset($params[1])) {
$params[1] = true;
}
if ($params[1] === true) {
return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})";
if (!isset($params[1]) || $params[1] === true || trim($params[1],'"') == 'true') {
return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})";
} else {
return 'strip_tags(' . $params[0] . ')';
}
}
?>
@@ -31,7 +31,7 @@ function smarty_modifiercompiler_wordwrap($params, $compiler)
}
$function = 'wordwrap';
if (Smarty::$_MBSTRING) {
if ($compiler->tag_nocache | $compiler->nocache) {
if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) {
$compiler->template->required_plugins['nocache']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php';
$compiler->template->required_plugins['nocache']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap';
} else {
@@ -91,4 +91,4 @@ function smarty_outputfilter_trimwhitespace($source, Smarty_Internal_Template $s
return $source;
}
?>
?>
@@ -224,7 +224,7 @@ class Smarty_Template_Cached {
public $timestamp = false;
/**
* Source Existance
* Source Existence
* @var boolean
*/
public $exists = false;
@@ -1,266 +1,275 @@
<?php
/**
* Smarty Internal Plugin CacheResource File
*
* @package Smarty
* @subpackage Cacher
* @author Uwe Tews
* @author Rodney Rehm
*/
/**
* This class does contain all necessary methods for the HTML cache on file system
*
* Implements the file system as resource for the HTML cache Version ussing nocache inserts.
*
* @package Smarty
* @subpackage Cacher
*/
class Smarty_Internal_CacheResource_File extends Smarty_CacheResource {
/**
* Smarty Internal Plugin CacheResource File
*
* @package Smarty
* @subpackage Cacher
* @author Uwe Tews
* @author Rodney Rehm
*/
/**
* populate Cached Object with meta data from Resource
*
* @param Smarty_Template_Cached $cached cached object
* @param Smarty_Internal_Template $_template template object
* @return void
*/
public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
{
$_source_file_path = str_replace(':', '.', $_template->source->filepath);
$_cache_id = isset($_template->cache_id) ? preg_replace('![^\w\|]+!', '_', $_template->cache_id) : null;
$_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
$_filepath = $_template->source->uid;
// if use_sub_dirs, break file into directories
if ($_template->smarty->use_sub_dirs) {
$_filepath = substr($_filepath, 0, 2) . DS
* This class does contain all necessary methods for the HTML cache on file system
*
* Implements the file system as resource for the HTML cache Version ussing nocache inserts.
*
* @package Smarty
* @subpackage Cacher
*/
class Smarty_Internal_CacheResource_File extends Smarty_CacheResource {
/**
* populate Cached Object with meta data from Resource
*
* @param Smarty_Template_Cached $cached cached object
* @param Smarty_Internal_Template $_template template object
* @return void
*/
public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
{
$_source_file_path = str_replace(':', '.', $_template->source->filepath);
$_cache_id = isset($_template->cache_id) ? preg_replace('![^\w\|]+!', '_', $_template->cache_id) : null;
$_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
$_filepath = $_template->source->uid;
// if use_sub_dirs, break file into directories
if ($_template->smarty->use_sub_dirs) {
$_filepath = substr($_filepath, 0, 2) . DS
. substr($_filepath, 2, 2) . DS
. substr($_filepath, 4, 2) . DS
. $_filepath;
}
$_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^';
if (isset($_cache_id)) {
$_cache_id = str_replace('|', $_compile_dir_sep, $_cache_id) . $_compile_dir_sep;
} else {
$_cache_id = '';
}
if (isset($_compile_id)) {
$_compile_id = $_compile_id . $_compile_dir_sep;
} else {
$_compile_id = '';
}
$_cache_dir = $_template->smarty->getCacheDir();
if ($_template->smarty->cache_locking) {
// create locking file name
// relative file name?
if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_cache_dir)) {
$_lock_dir = rtrim(getcwd(), '/\\') . DS . $_cache_dir;
}
$_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^';
if (isset($_cache_id)) {
$_cache_id = str_replace('|', $_compile_dir_sep, $_cache_id) . $_compile_dir_sep;
} else {
$_lock_dir = $_cache_dir;
$_cache_id = '';
}
$cached->lock_id = $_lock_dir.sha1($_cache_id.$_compile_id.$_template->source->uid).'.lock';
}
$cached->filepath = $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_source_file_path) . '.php';
$cached->timestamp = @filemtime($cached->filepath);
$cached->exists = !!$cached->timestamp;
}
/**
* populate Cached Object with timestamp and exists from Resource
*
* @param Smarty_Template_Cached $cached cached object
* @return void
*/
public function populateTimestamp(Smarty_Template_Cached $cached)
{
$cached->timestamp = @filemtime($cached->filepath);
$cached->exists = !!$cached->timestamp;
}
/**
* Read the cached template and process its header
*
* @param Smarty_Internal_Template $_template template object
* @param Smarty_Template_Cached $cached cached object
* @return booelan true or false if the cached content does not exist
*/
public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null)
{
$_smarty_tpl = $_template;
return @include $_template->cached->filepath;
}
/**
* Write the rendered template output to cache
*
* @param Smarty_Internal_Template $_template template object
* @param string $content content to cache
* @return boolean success
*/
public function writeCachedContent(Smarty_Internal_Template $_template, $content)
{
if (Smarty_Internal_Write_File::writeFile($_template->cached->filepath, $content, $_template->smarty) === true) {
$_template->cached->timestamp = @filemtime($_template->cached->filepath);
$_template->cached->exists = !!$_template->cached->timestamp;
if ($_template->cached->exists) {
return true;
}
}
return false;
}
/**
* Empty cache
*
* @param Smarty_Internal_Template $_template template object
* @param integer $exp_time expiration time (number of seconds, not timestamp)
* @return integer number of cache files deleted
*/
public function clearAll(Smarty $smarty, $exp_time = null)
{
return $this->clear($smarty, null, null, null, $exp_time);
}
/**
* Empty cache for a specific template
*
* @param Smarty $_template template object
* @param string $resource_name template name
* @param string $cache_id cache id
* @param string $compile_id compile id
* @param integer $exp_time expiration time (number of seconds, not timestamp)
* @return integer number of cache files deleted
*/
public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
{
$_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null;
$_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
$_dir_sep = $smarty->use_sub_dirs ? '/' : '^';
$_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;
$_dir = $smarty->getCacheDir();
$_dir_length = strlen($_dir);
if (isset($_cache_id)) {
$_cache_id_parts = explode('|', $_cache_id);
$_cache_id_parts_count = count($_cache_id_parts);
if ($smarty->use_sub_dirs) {
foreach ($_cache_id_parts as $id_part) {
$_dir .= $id_part . DS;
}
}
}
if (isset($resource_name)) {
$_save_stat = $smarty->caching;
$smarty->caching = true;
$tpl = new $smarty->template_class($resource_name, $smarty);
$smarty->caching = $_save_stat;
// remove from template cache
$tpl->source; // have the template registered before unset()
if ($smarty->allow_ambiguous_resources) {
$_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
if (isset($_compile_id)) {
$_compile_id = $_compile_id . $_compile_dir_sep;
} else {
$_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
$_compile_id = '';
}
if (isset($_templateId[150])) {
$_templateId = sha1($_templateId);
}
unset($smarty->template_objects[$_templateId]);
if ($tpl->source->exists) {
$_resourcename_parts = basename(str_replace('^', '/', $tpl->cached->filepath));
} else {
return 0;
}
}
$_count = 0;
$_time = time();
if (file_exists($_dir)) {
$_cacheDirs = new RecursiveDirectoryIterator($_dir);
$_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($_cache as $_file) {
if (substr(basename($_file->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false) continue;
// directory ?
if ($_file->isDir()) {
if (!$_cache->isDot()) {
// delete folder if empty
@rmdir($_file->getPathname());
}
$_cache_dir = $_template->smarty->getCacheDir();
if ($_template->smarty->cache_locking) {
// create locking file name
// relative file name?
if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_cache_dir)) {
$_lock_dir = rtrim(getcwd(), '/\\') . DS . $_cache_dir;
} else {
$_parts = explode($_dir_sep, str_replace('\\', '/', substr((string)$_file, $_dir_length)));
$_parts_count = count($_parts);
// check name
if (isset($resource_name)) {
if ($_parts[$_parts_count-1] != $_resourcename_parts) {
continue;
}
}
// check compile id
if (isset($_compile_id) && (!isset($_parts[$_parts_count-2 - $_compile_id_offset]) || $_parts[$_parts_count-2 - $_compile_id_offset] != $_compile_id)) {
continue;
}
// check cache id
if (isset($_cache_id)) {
// count of cache id parts
$_parts_count = (isset($_compile_id)) ? $_parts_count - 2 - $_compile_id_offset : $_parts_count - 1 - $_compile_id_offset;
if ($_parts_count < $_cache_id_parts_count) {
continue;
}
for ($i = 0; $i < $_cache_id_parts_count; $i++) {
if ($_parts[$i] != $_cache_id_parts[$i]) continue 2;
}
}
// expired ?
if (isset($exp_time) && $_time - @filemtime($_file) < $exp_time) {
continue;
}
$_count += @unlink((string) $_file) ? 1 : 0;
$_lock_dir = $_cache_dir;
}
$cached->lock_id = $_lock_dir.sha1($_cache_id.$_compile_id.$_template->source->uid).'.lock';
}
$cached->filepath = $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_source_file_path) . '.php';
$cached->timestamp = @filemtime($cached->filepath);
$cached->exists = !!$cached->timestamp;
}
/**
* populate Cached Object with timestamp and exists from Resource
*
* @param Smarty_Template_Cached $cached cached object
* @return void
*/
public function populateTimestamp(Smarty_Template_Cached $cached)
{
$cached->timestamp = @filemtime($cached->filepath);
$cached->exists = !!$cached->timestamp;
}
/**
* Read the cached template and process its header
*
* @param Smarty_Internal_Template $_template template object
* @param Smarty_Template_Cached $cached cached object
* @return booelan true or false if the cached content does not exist
*/
public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null)
{
$_smarty_tpl = $_template;
return @include $_template->cached->filepath;
}
/**
* Write the rendered template output to cache
*
* @param Smarty_Internal_Template $_template template object
* @param string $content content to cache
* @return boolean success
*/
public function writeCachedContent(Smarty_Internal_Template $_template, $content)
{
if (Smarty_Internal_Write_File::writeFile($_template->cached->filepath, $content, $_template->smarty) === true) {
$_template->cached->timestamp = @filemtime($_template->cached->filepath);
$_template->cached->exists = !!$_template->cached->timestamp;
if ($_template->cached->exists) {
return true;
}
}
return false;
}
return $_count;
}
/**
* Check is cache is locked for this template
*
* @param Smarty $smarty Smarty object
* @param Smarty_Template_Cached $cached cached object
* @return booelan true or false if cache is locked
*/
public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
clearstatcache(true, $cached->lock_id);
} else {
clearstatcache();
/**
* Empty cache
*
* @param Smarty_Internal_Template $_template template object
* @param integer $exp_time expiration time (number of seconds, not timestamp)
* @return integer number of cache files deleted
*/
public function clearAll(Smarty $smarty, $exp_time = null)
{
return $this->clear($smarty, null, null, null, $exp_time);
}
$t = @filemtime($cached->lock_id);
return $t && (time() - $t < $smarty->locking_timeout);
}
/**
* Lock cache for this template
*
* @param Smarty $smarty Smarty object
* @param Smarty_Template_Cached $cached cached object
*/
public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
$cached->is_locked = true;
touch($cached->lock_id);
}
/**
* Empty cache for a specific template
*
* @param Smarty $_template template object
* @param string $resource_name template name
* @param string $cache_id cache id
* @param string $compile_id compile id
* @param integer $exp_time expiration time (number of seconds, not timestamp)
* @return integer number of cache files deleted
*/
public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
{
$_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null;
$_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
$_dir_sep = $smarty->use_sub_dirs ? '/' : '^';
$_compile_id_offset = $smarty->use_sub_dirs ? 3 : 0;
$_dir = $smarty->getCacheDir();
$_dir_length = strlen($_dir);
if (isset($_cache_id)) {
$_cache_id_parts = explode('|', $_cache_id);
$_cache_id_parts_count = count($_cache_id_parts);
if ($smarty->use_sub_dirs) {
foreach ($_cache_id_parts as $id_part) {
$_dir .= $id_part . DS;
}
}
}
if (isset($resource_name)) {
$_save_stat = $smarty->caching;
$smarty->caching = true;
$tpl = new $smarty->template_class($resource_name, $smarty);
$smarty->caching = $_save_stat;
/**
* Unlock cache for this template
*
* @param Smarty $smarty Smarty object
* @param Smarty_Template_Cached $cached cached object
*/
public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
$cached->is_locked = false;
@unlink($cached->lock_id);
// remove from template cache
$tpl->source; // have the template registered before unset()
if ($smarty->allow_ambiguous_resources) {
$_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
} else {
$_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
}
if (isset($_templateId[150])) {
$_templateId = sha1($_templateId);
}
unset($smarty->template_objects[$_templateId]);
if ($tpl->source->exists) {
$_resourcename_parts = basename(str_replace('^', '/', $tpl->cached->filepath));
} else {
return 0;
}
}
$_count = 0;
$_time = time();
if (file_exists($_dir)) {
$_cacheDirs = new RecursiveDirectoryIterator($_dir);
$_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
foreach ($_cache as $_file) {
if (substr(basename($_file->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false) continue;
// directory ?
if ($_file->isDir()) {
if (!$_cache->isDot()) {
// delete folder if empty
@rmdir($_file->getPathname());
}
} else {
$_parts = explode($_dir_sep, str_replace('\\', '/', substr((string)$_file, $_dir_length)));
$_parts_count = count($_parts);
// check name
if (isset($resource_name)) {
if ($_parts[$_parts_count-1] != $_resourcename_parts) {
continue;
}
}
// check compile id
if (isset($_compile_id) && (!isset($_parts[$_parts_count-2 - $_compile_id_offset]) || $_parts[$_parts_count-2 - $_compile_id_offset] != $_compile_id)) {
continue;
}
// check cache id
if (isset($_cache_id)) {
// count of cache id parts
$_parts_count = (isset($_compile_id)) ? $_parts_count - 2 - $_compile_id_offset : $_parts_count - 1 - $_compile_id_offset;
if ($_parts_count < $_cache_id_parts_count) {
continue;
}
for ($i = 0; $i < $_cache_id_parts_count; $i++) {
if ($_parts[$i] != $_cache_id_parts[$i]) continue 2;
}
}
// expired ?
if (isset($exp_time)) {
if ($exp_time < 0) {
preg_match('#\'cache_lifetime\' =>\s*(\d*)#', file_get_contents($_file), $match);
if ($_time < (@filemtime($_file) + $match[1])) {
continue;
}
} else {
if ($_time - @filemtime($_file) < $exp_time) {
continue;
}
}
}
$_count += @unlink((string) $_file) ? 1 : 0;
}
}
}
return $_count;
}
/**
* Check is cache is locked for this template
*
* @param Smarty $smarty Smarty object
* @param Smarty_Template_Cached $cached cached object
* @return booelan true or false if cache is locked
*/
public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
clearstatcache(true, $cached->lock_id);
} else {
clearstatcache();
}
$t = @filemtime($cached->lock_id);
return $t && (time() - $t < $smarty->locking_timeout);
}
/**
* Lock cache for this template
*
* @param Smarty $smarty Smarty object
* @param Smarty_Template_Cached $cached cached object
*/
public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
$cached->is_locked = true;
touch($cached->lock_id);
}
/**
* Unlock cache for this template
*
* @param Smarty $smarty Smarty object
* @param Smarty_Template_Cached $cached cached object
*/
public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
{
$cached->is_locked = false;
@unlink($cached->lock_id);
}
}
}
?>
@@ -84,13 +84,13 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
$al = '';
}
if (0 == preg_match("!({$_ldl}{$al}block\s+)(name=)?(\w+|'.*'|\".*\")(\s*?)?((append|prepend|nocache)?(\s*)?(hide)?)?(\s*{$_rdl})!", $block_tag, $_match)) {
$error_text = 'Syntax Error in template "' . $template->source->filepath . '" "' . htmlspecialchars($block_tag) . '" illegal options';
$error_text = 'Syntax Error in template "' . $template->source->filepath . '" "' . $block_tag . '" illegal options';
throw new SmartyCompilerException($error_text);
} else {
$_name = trim($_match[3], '\'"');
if ($_match[8] != 'hide' || isset($template->block_data[$_name])) { // replace {$smarty.block.child}
// do we have {$smart.block.child} in nested {block} tags?
if (0 != preg_match_all("!({$_ldl}{$al}block\s+)(name=)?(\w+|'.*'|\".*\")([\s\S]*?)(hide)?(\s*{$_rdl})([\s\S]*?)({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})([\s\S]*?{$_ldl}{$al}/block\s*{$_rdl})!", $block_content, $_match2)) {
// get nested block tags
if (0 != preg_match_all("!({$_ldl}{$al}block\s+)(name=)?(\w+|'.*'|\".*\")([\s\S]*?)(hide)?(\s*{$_rdl})([\s\S]*?)(.*)?({$_ldl}{$al}/block\s*{$_rdl})!", $block_content, $_match2)) {
foreach ($_match2[3] as $key => $name) {
// get it's replacement
$_name2 = trim($name, '\'"');
@@ -101,12 +101,17 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
$replacement = '';
}
// replace {$smarty.block.child} tag
$search = array("!({$_ldl}{$al}block[\s\S]*?{$name}[\s\S]*?{$_rdl})([\s\S]*?)({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})([\s\S]*?)({$_ldl}{$al}/block\s*{$_rdl})!", "/§§§child§§§/");
$replace = array('\2§§§child§§§\4', $replacement);
$block_content = preg_replace($search, $replace, $block_content);
if (preg_match("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!",$_match2[7][$key])) {
$replacement = preg_replace("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $replacement, $_match2[7][$key]);
$block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl}[\s\S]*?{$_ldl}{$al}/block\s*{$_rdl}))!", $replacement, $block_content);
}
if (preg_match("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!",$_match2[8][$key])) {
$replacement = preg_replace("!{$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl}!", $replacement, $_match2[8][$key]);
$block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl})(.*)?({$_ldl}{$al}/block\s*{$_rdl}))!", $replacement, $block_content);
}
} else {
// remove hidden blocks
$block_content = preg_replace("!({$_ldl}{$al}block[\s\S]*?{$name}[\s\S]*?{$_rdl}[\s\S]*?{$_ldl}{$al}/block\s*{$_rdl})!", '', $block_content);
$block_content = preg_replace("!(({$_ldl}{$al}block)(.*)?{$name}(.*)?({$_rdl}[\s\S]*?{$_ldl}{$al}/block\s*{$_rdl}))!", '', $block_content);
}
}
}
@@ -174,7 +179,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
return '';
}
$_tpl = new Smarty_Internal_template('string:' . $compiler->template->block_data[$_name]['source'], $compiler->smarty, $compiler->template, $compiler->template->cache_id,
$compiler->template->compile_id = null, $compiler->template->caching, $compiler->template->cache_lifetime);
$compiler->template->compile_id, $compiler->template->caching, $compiler->template->cache_lifetime);
$_tpl->variable_filters = $compiler->template->variable_filters;
$_tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash'];
$_tpl->source->filepath = $compiler->template->block_data[$_name]['file'];
@@ -185,6 +190,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
$_tpl->compiler->forceNocache = 1;
}
$_tpl->compiler->suppressHeader = true;
$_tpl->compiler->suppressFilter = true;
$_tpl->compiler->suppressTemplatePropertyHeader = true;
$_tpl->compiler->suppressMergedTemplates = true;
if (strpos($compiler->template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
@@ -82,7 +82,7 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
$compiler->trigger_template_error("illegal recursive call of \"{$include_file}\"", $compiler->lex->line - 1);
}
$compiler->template->properties['file_dependency'][$template_sha1] = array($_template->source->filepath, $_template->source->timestamp, $_template->source->type);
$_content = ($this->mbstring_overload ? mb_substr($compiler->template->source->content, $compiler->lex->counter - 1, 20000000, 'latin1') : substr($compiler->template->source->content, $compiler->lex->counter - 1));
$_content = ($this->mbstring_overload ? mb_substr($compiler->lex->data, $compiler->lex->counter - 1, 20000000, 'latin1') : substr($compiler->lex->data, $compiler->lex->counter - 1));
if (preg_match_all("!({$this->_ldl}{$al}block\s(.+?)\s*{$this->_rdl})!", $_content, $s) !=
preg_match_all("!({$this->_ldl}{$al}/block\s*{$this->_rdl})!", $_content, $c)) {
$compiler->trigger_template_error('unmatched {block} {/block} pairs');
@@ -149,7 +149,8 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
$compiler->has_code = false;
$output = true;
} else {
$output = $plugins_string . $compiler->parser->current_buffer->to_smarty_php() . "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;}}?>\n";
$output = $plugins_string . $compiler->parser->current_buffer->to_smarty_php() . "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;
foreach (Smarty::\$global_tpl_vars as \$key => \$value) if(!isset(\$_smarty_tpl->tpl_vars[\$key])) \$_smarty_tpl->tpl_vars[\$key] = \$value;}}?>\n";
}
// reset flag that we are compiling a template function
$compiler->compiles_template_function = false;
@@ -77,7 +77,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
$compiler->trigger_template_error("(secure mode) constants not permitted");
break;
}
return '@' . trim($_index[1], "'");
return "@constant({$_index[1]})";
case 'config':
if (isset($_index[2])) {
@@ -80,6 +80,11 @@ class Smarty_Internal_Data {
{
if ($varname != '') {
Smarty::$global_tpl_vars[$varname] = new Smarty_variable($value, $nocache);
$ptr = $this;
while ($ptr instanceof Smarty_Internal_Template) {
$ptr->tpl_vars[$varname] = clone Smarty::$global_tpl_vars[$varname];
$ptr = $ptr->parent;
}
}
return $this;
@@ -1,36 +1,40 @@
<?php
/**
* Smarty Internal Plugin Resource Stream
*
* Implements the streams as resource for Smarty template
*
* @package Smarty
* @subpackage TemplateResources
* @author Uwe Tews
* @author Rodney Rehm
*/
* Smarty Internal Plugin Resource Stream
*
* Implements the streams as resource for Smarty template
*
* @package Smarty
* @subpackage TemplateResources
* @author Uwe Tews
* @author Rodney Rehm
*/
/**
* Smarty Internal Plugin Resource Stream
*
* Implements the streams as resource for Smarty template
*
* @link http://php.net/streams
* @package Smarty
* @subpackage TemplateResources
*/
* Smarty Internal Plugin Resource Stream
*
* Implements the streams as resource for Smarty template
*
* @link http://php.net/streams
* @package Smarty
* @subpackage TemplateResources
*/
class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled {
/**
* populate Source Object with meta data from Resource
*
* @param Smarty_Template_Source $source source object
* @param Smarty_Internal_Template $_template template object
* @return void
*/
* populate Source Object with meta data from Resource
*
* @param Smarty_Template_Source $source source object
* @param Smarty_Internal_Template $_template template object
* @return void
*/
public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
{
$source->filepath = str_replace(':', '://', $source->resource);
if(strpos($source->resource, '://') !== false) {
$source->filepath = $source->resource;
} else {
$source->filepath = str_replace(':', '://', $source->resource);
}
$source->uid = false;
$source->content = $this->getContent($source);
$source->timestamp = false;
@@ -38,12 +42,12 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled {
}
/**
* Load template's source from stream into current template object
*
* @param Smarty_Template_Source $source source object
* @return string template source
* @throws SmartyException if source cannot be loaded
*/
* Load template's source from stream into current template object
*
* @param Smarty_Template_Source $source source object
* @return string template source
* @throws SmartyException if source cannot be loaded
*/
public function getContent(Smarty_Template_Source $source)
{
$t = '';
@@ -59,18 +63,16 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled {
return false;
}
}
/**
* modify resource_name according to resource handlers specifications
*
* @param Smarty $smarty Smarty instance
* @param string $resource_name resource_name to make unique
* @return string unique resource name
*/
* modify resource_name according to resource handlers specifications
*
* @param Smarty $smarty Smarty instance
* @param string $resource_name resource_name to make unique
* @return string unique resource name
*/
protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
{
return get_class($this) . '#' . $resource_name;
}
}
?>
@@ -467,10 +467,15 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
}
}
if ($cache) {
// CACHING_LIFETIME_SAVED cache expiry has to be validated here since otherwise we'd define the unifunc
if ($this->caching === Smarty::CACHING_LIFETIME_SAVED &&
$this->properties['cache_lifetime'] >= 0 &&
(time() > ($this->cached->timestamp + $this->properties['cache_lifetime']))) {
$is_valid = false;
}
$this->cached->valid = $is_valid;
} else {
$this->mustCompile = !$is_valid;
}
$this->mustCompile = !$is_valid; }
// store data in reusable Smarty_Template_Compiled
if (!$cache) {
$this->compiled->_properties = $properties;
@@ -106,6 +106,12 @@ abstract class Smarty_Internal_TemplateCompilerBase {
*/
public $suppressTemplatePropertyHeader = false;
/**
* suppress pre and post filter
* @var bool
*/
public $suppressFilter = false;
/**
* flag if compiled template file shall we written
* @var bool
@@ -136,6 +142,14 @@ abstract class Smarty_Internal_TemplateCompilerBase {
*/
public $known_modifier_type = array();
/**
* Methode to compile a Smarty template
*
* @param mixed $_content template source
* @return bool true if compiling succeeded, false if it failed
*/
abstract protected function doCompile($_content);
/**
* Initialize compiler
*/
@@ -176,7 +190,7 @@ abstract class Smarty_Internal_TemplateCompilerBase {
// get template source
$_content = $template->source->content;
// run prefilter if required
if (isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) {
if ((isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) && !$this->suppressFilter) {
$_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content, $template);
}
// on empty template just return header
@@ -201,13 +215,9 @@ abstract class Smarty_Internal_TemplateCompilerBase {
foreach ($this->merged_templates as $code) {
$merged_code .= $code;
}
// run postfilter if required on merged code
if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) {
$merged_code = Smarty_Internal_Filter_Handler::runFilter('post', $merged_code, $template);
}
}
// run postfilter if required on compiled template code
if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) {
if ((isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) && !$this->suppressFilter) {
$_compiled_code = Smarty_Internal_Filter_Handler::runFilter('post', $_compiled_code, $template);
}
if ($this->suppressTemplatePropertyHeader) {
@@ -323,7 +333,7 @@ abstract class Smarty_Internal_TemplateCompilerBase {
}
// check plugins from plugins folder
foreach ($this->smarty->plugin_search_order as $plugin_type) {
if ($plugin_type == Smarty::PLUGIN_BLOCK && $this->smarty->loadPlugin('smarty_compiler_' . $tag) && (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this))) {
if ($plugin_type == Smarty::PLUGIN_COMPILER && $this->smarty->loadPlugin('smarty_compiler_' . $tag) && (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this))) {
$plugin = 'smarty_compiler_' . $tag;
if (is_callable($plugin)) {
// convert arguments format for old compiler plugins
@@ -597,7 +607,7 @@ abstract class Smarty_Internal_TemplateCompilerBase {
$_output = addcslashes($content,'\'\\');
$_output = str_replace("^#^", "'", $_output);
$_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>\n";
// make sure we include modifer plugins for nocache code
// make sure we include modifier plugins for nocache code
foreach ($this->modifier_plugins as $plugin_name => $dummy) {
if (isset($this->template->required_plugins['compiled'][$plugin_name]['modifier'])) {
$this->template->required_plugins['nocache'][$plugin_name]['modifier'] = $this->template->required_plugins['compiled'][$plugin_name]['modifier'];
@@ -633,7 +643,7 @@ abstract class Smarty_Internal_TemplateCompilerBase {
$line = $this->lex->line;
}
$match = preg_split("/\n/", $this->lex->data);
$error_text = 'Syntax Error in template "' . $this->template->source->filepath . '" on line ' . $line . ' "' . htmlspecialchars(trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1]))) . '" ';
$error_text = 'Syntax Error in template "' . $this->template->source->filepath . '" on line ' . $line . ' "' . trim(preg_replace('![\t\r\n]+!', ' ', $match[$line - 1])) . '" ';
if (isset($args)) {
// individual error message
$error_text .= $args;
@@ -58,7 +58,7 @@ class Smarty_Internal_Utility {
* @param Smarty $smarty Smarty instance
* @return integer number of template files compiled
*/
public static function compileAllTemplates($extention, $force_compile, $time_limit, $max_errors, Smarty $smarty)
public static function compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty)
{
// switch off time limit
if (function_exists('set_time_limit')) {
@@ -72,9 +72,9 @@ class Smarty_Internal_Utility {
$_compileDirs = new RecursiveDirectoryIterator($_dir);
$_compile = new RecursiveIteratorIterator($_compileDirs);
foreach ($_compile as $_fileinfo) {
if (substr(basename($_file->getPathname()),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
$_file = $_fileinfo->getFilename();
if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
if (substr(basename($_fileinfo->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false) continue;
if (!substr_compare($_file, $extension, - strlen($extension)) == 0) continue;
if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
$_template_file = $_file;
} else {
@@ -122,7 +122,7 @@ class Smarty_Internal_Utility {
* @param Smarty $smarty Smarty instance
* @return integer number of config files compiled
*/
public static function compileAllConfig($extention, $force_compile, $time_limit, $max_errors, Smarty $smarty)
public static function compileAllConfig($extension, $force_compile, $time_limit, $max_errors, Smarty $smarty)
{
// switch off time limit
if (function_exists('set_time_limit')) {
@@ -136,9 +136,9 @@ class Smarty_Internal_Utility {
$_compileDirs = new RecursiveDirectoryIterator($_dir);
$_compile = new RecursiveIteratorIterator($_compileDirs);
foreach ($_compile as $_fileinfo) {
if (substr(basename($_fileinfo->getPathname()),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
$_file = $_fileinfo->getFilename();
if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
if (substr(basename($_fileinfo->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false) continue;
if (!substr_compare($_file, $extension, - strlen($extension)) == 0) continue;
if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
$_config_file = $_file;
} else {
@@ -308,7 +308,7 @@ class Smarty_Internal_Utility {
foreach($smarty->getTemplateDir() as $template_dir) {
$_template_dir = $template_dir;
$template_dir = realpath($template_dir);
// resolve include_path or fail existance
// resolve include_path or fail existence
if (!$template_dir) {
if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_template_dir)) {
// try PHP include_path
@@ -429,7 +429,7 @@ class Smarty_Internal_Utility {
foreach($smarty->getPluginsDir() as $plugin_dir) {
$_plugin_dir = $plugin_dir;
$plugin_dir = realpath($plugin_dir);
// resolve include_path or fail existance
// resolve include_path or fail existence
if (!$plugin_dir) {
if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {
// try PHP include_path
@@ -561,7 +561,7 @@ class Smarty_Internal_Utility {
foreach($smarty->getConfigDir() as $config_dir) {
$_config_dir = $config_dir;
$config_dir = realpath($config_dir);
// resolve include_path or fail existance
// resolve include_path or fail existence
if (!$config_dir) {
if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_config_dir)) {
// try PHP include_path
@@ -584,7 +584,7 @@ abstract class Smarty_Resource {
* @author Rodney Rehm
*
* @property integer $timestamp Source Timestamp
* @property boolean $exists Source Existance
* @property boolean $exists Source Existence
* @property boolean $template Extended Template reference
* @property string $content Source Content
*/
@@ -811,7 +811,7 @@ class Smarty_Template_Compiled {
public $timestamp = null;
/**
* Compiled Existance
* Compiled Existence
* @var boolean
*/
public $exists = false;
@@ -77,7 +77,7 @@ class Smarty_Security {
'nl2br',
);
/**
* This is an array of trusted PHP modifers.
* This is an array of trusted PHP modifiers.
*
* If empty all modifiers are allowed.
* To disable all modifier set $modifiers = null.
+1 -1
View File
@@ -132,4 +132,4 @@ else
echo ""
fi
echo "REMEMBER TO UPDATE docs/RELEASE and commit SVN branch"
echo "REMEMBER TO UPDATE docs/RELEASE and commit github branch: git tag -a X.Y ; git push --tags"
+29 -6
View File
@@ -176,8 +176,20 @@ function serendipity_imageSelector_addToElement (str, el)
function serendipity_imageSelector_addToBody (str, textarea)
{
// check for CKEDITOR usage
if (typeof(CKEDITOR) != 'undefined') {
// if here the blog uses CKEDITOR
var oEditor = isinstance; // build-in by ckeditor plugin
if (oEditor.mode == "wysiwyg") {
// if here the editior is in WYSIWYG mode so use the insert html function
oEditor.insertHtml(str);
// CKEDITOR.editor.mode = "source" disables function buttons, so using the fallback is redundant and could even confuse
}
// check for FCKEditor usage
if (typeof(FCKeditorAPI) != 'undefined') {
} else if (typeof(FCKeditorAPI) != 'undefined') {
// if here the blog uses FCK editor
var oEditor = FCKeditorAPI.GetInstance('serendipity[' + textarea + ']') ;
@@ -189,7 +201,7 @@ function serendipity_imageSelector_addToBody (str, textarea)
// if here just insert the text to the textarea ( named with the value of textarea variable )
noWysiwygAdd( str, textarea );
}
} else if(typeof(xinha_editors) != 'undefined') {
// if here the blog uses Xinha editor
@@ -245,7 +257,7 @@ function serendipity_imageSelector_addToBody (str, textarea)
// if here just insert the text to the textarea ( named with the value of textarea variable )
noWysiwygAdd(str, textarea);
}
} else if(typeof(TinyMCE) != 'undefined') {
// for the TinyMCE editor we do not have a text mode insert
@@ -256,6 +268,12 @@ function serendipity_imageSelector_addToBody (str, textarea)
}
}
function urldecode(url)
{
return decodeURIComponent(url.replace(/\+/g, ' '));
}
// The noWysiwygAdd JS function is the vanila serendipity_imageSelector_addToBody js function which works fine in NO WYSIWYG mode
// NOTE: the serendipity_imageSelector_addToBody could add any valid HTML string to the textarea
function noWysiwygAdd( str, textarea )
@@ -263,13 +281,18 @@ function noWysiwygAdd( str, textarea )
// default case: no wysiwyg editor
eltarget = '';
if (document.forms['serendipityEntry'] && document.forms['serendipityEntry']['serendipity['+ textarea +']']) {
eltarget = document.forms['serendipityEntry']['serendipity['+ textarea +']']
eltarget = document.forms['serendipityEntry']['serendipity['+ textarea +']'];
} else if (document.forms['serendipityEntry'] && document.forms['serendipityEntry'][textarea]) {
eltarget = document.forms['serendipityEntry'][textarea];
} else {
eltarget = document.forms[0].elements[0];
//eltarget = document.forms[0].elements[0]; // this did not work in staticpages textareas
var elements = document.getElementsByTagName("textarea");
for (var i = 0; i < elements.length; ++i) {
if (elements[i].getAttribute("name") == urldecode(textarea)) {
eltarget = elements[i];
}
} if (eltarget=='') eltarget = document.forms[0].elements[0];
}
wrapSelection(eltarget, str, '');
eltarget.focus();
}
+67 -9
View File
@@ -1,28 +1,86 @@
# $Id$
Version 2.0 ()
Version 1.7.1 (July 26th 2013)
------------------------------------------------------------------------
* Use Smarty for backend display output
* Added new event hooks "backend_plugins_install", "backend_plugins_update"
and "backend_templates_install".
* Serendipity will switch to mysqli if PHP >= 5.5 is used (mysql
is deprecated)
* Smarty upgrade to 3.1.14 (read changeLog and the README for API changes since Smarty 2)
Version 1.7 ()
* Upgrader will now remove/delete the browsercompatibility plugin
* Fixed Media Library exclude path to not show/proceed ckeditor/kcfinders .thumbs dir
* Fixed bulletproof->colorset GET mismatch with categorytemplates plugin
config.inc.php [Line 29]
* German translation for stable archives added (YL)
* Fixed curl result bug in spartacus plugin
* Create new migration task for propagate defaultBaseURL when
currently empty (onli)
* Fixed statistics sidebar querys ( & for PostgreSQL ) [242520b]
and added some missing html end tags
* Added missing current group name when editing usergroups
Version 1.7 (May 11th 2013)
------------------------------------------------------------------------
* rc4: Get ready for CKEDITOR-wysiwyg Plugin mode
* rc4: Fixed fetching javascript object (for nugget textareas) in non-wysiwyg-mode
* rc4: Change .htaccess blocking mechanism by spamblock plugin to not fetch
too many datarows, thanks to DLange from the forums. (The .htaccess
feature is still considered experimental, use at your own risk ;))
* rc4: Fixed entryproperties backend 'cache now' link
* rc3 + rc4: Media database: Escape more Cookie values to prevent storing
possible XSS (http://board.s9y.org/viewtopic.php?f=3&t=19142).
Escape hotlinked media filename. Escape importer host name error
Thanks to GreenSun from the forums for bringing this to attention,
originally reported by Dshellnoi Unix
* rc2: Alter entries.tpl to add the line:
{assign var="entry" value=$entry scope="parent"}
for proper propagation of $entry to sub-templates.
* rc2: Alter error reporting to only fail when 'debug' mode is enabled,
so that "normal" blog installations will not fail on specific
E_STRICT warnings that are not important.
* rc2: temporary added empty $template_config_groups into templates with config,
to avoid display troubles for template changes, if previous template had these set.
Please check your template.
* rc2: reflect POST submitted changes in Bulletproof template configs re-set situations
* various PHP 5 compatibility fixes in core and plugins
* Allow entryproperties plugin to define defaults for custom fields
* Onyx, Net_URL classes: Remove PHP4 style constructor due to
PHP5 error "Constructor already defined"
* Improved RSS sidebarplugin to support Atom
* Bundled simplepie
* For Blogs running on a non-UTF-8 language, set a Smarty constant
to indicate the actually used charset.
to indicate the actually used charset.
* Added to use MyISAM handler for s9y tables (we do not use InnoDB
features, but rely on MyISAM fulltext)
* fixed defaultBaseURL did not show up installer. Thanks to onli.
Follow up from c292bad
@@ -83,7 +141,7 @@ Version 1.7 ()
Version 1.6.2 (May 16th, 2012)
------------------------------------------------------------------------
* Fix SQL injection for comment.php used in read-context.
* Fix SQL injection for comment.php used in read-context.
(Thanks to High-Tech Bridge SA Security Release Lab, Advisory HTB23092)
Version 1.6.1 (May 8th, 2012)
+2 -2
View File
@@ -1,2 +1,2 @@
stable:1.6
beta:1.6
stable:1.7
beta:1.7
@@ -177,7 +177,7 @@ Class Image_Transform_Driver_NetPBM extends Image_Transform
."$size -x $x -y ".$y+$size." -text \"$text\"";
} // End addText
function _postProcess($type, $quality, $save_type)
function _postProcess($type, $quality, $save_type=null)
{
$type = is_null($type) || $type==''? $this->type : $type;
$save_type = is_null($save_type) || $save_type==''? $this->type : $save_type;
+1 -1
View File
@@ -64,7 +64,7 @@ die('disabled in s9y');
$socket = fsockopen($Host, 80, $errno, $errstr);
if (!$socket) {
$result = "($errno) $errstr";
return $Result;
return $result;
}
fputs($socket, $ReqHeader);
+181 -89
View File
@@ -11,12 +11,12 @@ if (!serendipity_checkPermission('adminCategories')) {
}
$admin_category = (!serendipity_checkPermission('adminCategoriesMaintainOthers') ? "AND (authorid = 0 OR authorid = " . (int)$serendipity['authorid'] . ")" : '');
$data = array();
/* Add a new category */
if (isset($_POST['SAVE']) && serendipity_checkFormToken()) {
$name = $serendipity['POST']['cat']['name'];
$desc = $serendipity['POST']['cat']['description'];
$data['post_save'] = true;
if (is_array($serendipity['POST']['cat']['write_authors']) && in_array(0, $serendipity['POST']['cat']['write_authors'])) {
$authorid = 0;
} else {
@@ -27,7 +27,6 @@ if (isset($_POST['SAVE']) && serendipity_checkFormToken()) {
$parentid = (isset($serendipity['POST']['cat']['parent_cat']) && is_numeric($serendipity['POST']['cat']['parent_cat'])) ? $serendipity['POST']['cat']['parent_cat'] : 0;
if ($serendipity['GET']['adminAction'] == 'new') {
$data['new'] = true;
if ($parentid != 0) {
// TODO: This doesn't seem to work as expected, serendipity_rebuildCategoryTree(); is still needed! Only activate this optimization function when it's really working :)
// TODO: This works if only one subcategory exists. Otherwise, the first query will return an array.
@@ -40,10 +39,12 @@ if (isset($_POST['SAVE']) && serendipity_checkFormToken()) {
$catid = serendipity_addCategory($name, $desc, $authorid, $icon, $parentid);
serendipity_ACLGrant($catid, 'category', 'read', $serendipity['POST']['cat']['read_authors']);
serendipity_ACLGrant($catid, 'category', 'write', $serendipity['POST']['cat']['write_authors']);
echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . CATEGORY_SAVED .'</div>';
} elseif ($serendipity['GET']['adminAction'] == 'edit') {
$data['edit'] = true;
if (!serendipity_checkPermission('adminCategoriesMaintainOthers') && !serendipity_ACLCheck($serendipity['authorid'], $serendipity['GET']['cid'], 'category', 'write')) {
$data['editPermission'] = false;
echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />'. PERM_DENIED .'</div>';
} else {
/* Check to make sure parent is not a child of self */
$r = serendipity_db_query("SELECT categoryid FROM {$serendipity['dbPrefix']}category c
@@ -52,11 +53,12 @@ if (isset($_POST['SAVE']) && serendipity_checkFormToken()) {
if (is_array($r)) {
$r = serendipity_db_query("SELECT category_name FROM {$serendipity['dbPrefix']}category
WHERE categoryid = ". (int)$parentid);
$data['subcat'] = sprintf(ALREADY_SUBCATEGORY, htmlspecialchars($r[0]['category_name']), htmlspecialchars($name));
echo sprintf(ALREADY_SUBCATEGORY, htmlspecialchars($r[0]['category_name']), htmlspecialchars($name));
} else {
serendipity_updateCategory($serendipity['GET']['cid'], $name, $desc, $authorid, $icon, $parentid, $serendipity['POST']['cat']['sort_order'], $serendipity['POST']['cat']['hide_sub']);
serendipity_updateCategory($serendipity['GET']['cid'], $name, $desc, $authorid, $icon, $parentid, $serendipity['POST']['cat']['sort_order'], $serendipity['POST']['cat']['hide_sub'], $admin_category);
serendipity_ACLGrant($serendipity['GET']['cid'], 'category', 'read', $serendipity['POST']['cat']['read_authors']);
serendipity_ACLGrant($serendipity['GET']['cid'], 'category', 'write', $serendipity['POST']['cat']['write_authors']);
echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . CATEGORY_SAVED .'</div>';
}
}
}
@@ -67,7 +69,6 @@ if (isset($_POST['SAVE']) && serendipity_checkFormToken()) {
/* Delete a category */
if ($serendipity['GET']['adminAction'] == 'doDelete' && serendipity_checkFormToken()) {
$data['doDelete'] = true;
if ($serendipity['GET']['cid'] != 0) {
$remaining_cat = (int)$serendipity['POST']['cat']['remaining_catid'];
$category_ranges = serendipity_fetchCategoryRange((int)$serendipity['GET']['cid']);
@@ -102,107 +103,198 @@ if ($serendipity['GET']['adminAction'] == 'doDelete' && serendipity_checkFormTok
serendipity_ACLGrant($cid, 'category', 'write', array());
}
}
$data['deleteSuccess'] = true;
$data['remaining_cat'] = $remaining_cat;
$data['cid'] = (int)$serendipity['GET']['cid'];
echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . ($remaining_cat ? sprintf(CATEGORY_DELETED_ARTICLES_MOVED, (int)$serendipity['GET']['cid'], $remaining_cat) : sprintf(CATEGORY_DELETED,(int)$serendipity['GET']['cid'])) .'</div>';
$serendipity['GET']['adminAction'] = 'view';
}
} else {
$data['deleteSuccess'] = false;
echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />'. INVALID_CATEGORY .'</div>';
}
}
?>
if ( $serendipity['GET']['adminAction'] == 'delete' ) {
$data['delete'] = true;
$this_cat = serendipity_fetchCategoryInfo($serendipity['GET']['cid']);
if ( (serendipity_checkPermission('adminCategoriesDelete') && serendipity_checkPermission('adminCategoriesMaintainOthers'))
|| (serendipity_checkPermission('adminCategoriesDelete') && ($serendipity['authorid'] == $this_cat['authorid'] || $this_cat['authorid'] == '0'))
|| (serendipity_checkPermission('adminCategoriesDelete') && serendipity_ACLCheck($serendipity['authorid'], $serendipity['GET']['cid'], 'category', 'write'))) {
$data['deletePermission'] = true;
$data['cid'] = (int)$serendipity['GET']['cid'];
$data['formToken'] = serendipity_setFormToken();
$data['categoryName'] = $this_cat['category_name'];
$cats = serendipity_fetchCategories('all');
$data['cats'] = array();
/* TODO, show dropdown as nested categories */
foreach ($cats as $cat_data) {
if ($cat_data['categoryid'] != $serendipity['GET']['cid'] && (serendipity_checkPermission('adminCategoriesMaintainOthers') || $cat_data['authorid'] == '0' || $cat_data['authorid'] == $serendipity['authorid'])) {
$data['cats'][] = $cat_data;
}
<?php
if ( $serendipity['GET']['adminAction'] == 'delete' ) {
$this_cat = serendipity_fetchCategoryInfo($serendipity['GET']['cid']);
if ( (serendipity_checkPermission('adminCategoriesDelete') && serendipity_checkPermission('adminCategoriesMaintainOthers'))
|| (serendipity_checkPermission('adminCategoriesDelete') && ($serendipity['authorid'] == $this_cat['authorid'] || $this_cat['authorid'] == '0'))
|| (serendipity_checkPermission('adminCategoriesDelete') && serendipity_ACLCheck($serendipity['authorid'], $serendipity['GET']['cid'], 'category', 'write'))) {
?>
<form method="POST" name="serendipityCategory" action="?serendipity[adminModule]=category&amp;serendipity[adminAction]=doDelete&amp;serendipity[cid]=<?php echo (int)$serendipity['GET']['cid'] ?>">
<?php echo serendipity_setFormToken(); ?>
<h3><?php echo htmlspecialchars($this_cat['category_name']); ?></h3>
<?php echo CATEGORY_REMAINING ?>:
<select name="serendipity[cat][remaining_catid]">
<option value="0">- <?php echo NO_CATEGORY ?> -</option>
<?php
$cats = serendipity_fetchCategories('all');
/* TODO, show dropdown as nested categories */
foreach ($cats as $cat_data) {
if ($cat_data['categoryid'] != $serendipity['GET']['cid'] && (serendipity_checkPermission('adminCategoriesMaintainOthers') || $cat_data['authorid'] == '0' || $cat_data['authorid'] == $serendipity['authorid'])) {
echo '<option value="' . $cat_data['categoryid'] . '">' . htmlspecialchars($cat_data['category_name']) . '</option>' . "\n";
}
}
}
if ( $serendipity['GET']['adminAction'] == 'edit' || $serendipity['GET']['adminAction'] == 'new' ) {
if ( $serendipity['GET']['adminAction'] == 'edit' ) {
$data['edit'] = true;
$cid = (int)$serendipity['GET']['cid'];
$this_cat = serendipity_fetchCategoryInfo($cid);
$data['category_name'] = $this_cat['category_name'];
$save = SAVE;
$read_groups = serendipity_ACLGet($cid, 'category', 'read');
$write_groups = serendipity_ACLGet($cid, 'category', 'write');
} else {
$data['new'] = true;
$cid = false;
$this_cat = array();
echo '<strong>'. CREATE_NEW_CAT .'</strong>';
$save = CREATE;
$read_groups = array(0 => 0);
$write_groups = array(0 => 0);
?>
</select>
<input type="submit" name="REMOVE" value="<?php echo GO ?>" class="serendipityPrettyButton input_button">
</form>
<?php
}
}
$data['cid'] = $cid;
$data['this_cat'] = $this_cat;
$data['save'] = $save;
$groups = serendipity_getAllGroups();
$data['groups'] = $groups;
$data['read_groups'] = $read_groups;
$data['write_groups'] = $write_groups;
?>
$data['formToken'] = serendipity_setFormToken();
$data['cat'] = $this_cat;
if (!is_array($this_cat) || (isset($this_cat['authorid']) && $this_cat['authorid'] == '0') || isset($read_groups[0])) {
$data['selectAllReadAuthors'] = true;
}
if (!is_array($this_cat) || (isset($this_cat['authorid']) && $this_cat['authorid'] == '0') || isset($write_groups[0])) {
$data['selectAllWriteAuthors'] = true;
}
$categories = serendipity_fetchCategories('all');
$categories = serendipity_walkRecursive($categories, 'categoryid', 'parentid', VIEWMODE_THREADED);
$data['categories'] = $categories;
serendipity_plugin_api::hook_event('backend_category_showForm', $cid, $this_cat);
}
<?php if ( $serendipity['GET']['adminAction'] == 'edit' || $serendipity['GET']['adminAction'] == 'new' ) {
if ( $serendipity['GET']['adminAction'] == 'edit' ) {
$cid = (int)$serendipity['GET']['cid'];
$this_cat = serendipity_fetchCategoryInfo($cid);
echo '<strong>'. sprintf(EDIT_THIS_CAT, htmlspecialchars($this_cat['category_name'])) .'</strong>';
$save = SAVE;
$read_groups = serendipity_ACLGet($cid, 'category', 'read');
$write_groups = serendipity_ACLGet($cid, 'category', 'write');
} else {
$cid = false;
$this_cat = array();
echo '<strong>'. CREATE_NEW_CAT .'</strong>';
$save = CREATE;
$read_groups = array(0 => 0);
$write_groups = array(0 => 0);
}
$groups = serendipity_getAllGroups();
?>
<form method="POST" name="serendipityCategory">
<?php echo serendipity_setFormToken(); ?>
<table cellpadding="5" width="100%">
<tr>
<td><?php echo NAME; ?></td>
<td><input class="input_textbox" type="text" name="serendipity[cat][name]" value="<?php echo isset($this_cat['category_name']) ? htmlspecialchars($this_cat['category_name']) : ''; ?>" /></td>
<td rowspan="5" align="center" valign="middle" width="200" style="border: 1px solid #ccc"><img src="<?php echo isset($this_cat['category_icon']) ? htmlspecialchars($this_cat['category_icon']) : '' ?>" id="imagepreview" <?php echo empty($this_cat['category_icon']) ? 'style="display: none"' : '' ?> /></td>
</tr>
<tr>
<td><?php echo DESCRIPTION; ?></td>
<td><input class="input_textbox" type="text" name="serendipity[cat][description]" value="<?php echo isset($this_cat['category_description']) ? htmlspecialchars($this_cat['category_description']) : ''; ?>" /></td>
</tr>
<tr>
<td><?php echo IMAGE; ?></td>
<td>
<script type="text/javascript" language="JavaScript" src="serendipity_editor.js"></script>
<input class="input_textbox" type="text" id="img_icon" name="serendipity[cat][icon]" value="<?php echo isset($this_cat['category_icon']) ? htmlspecialchars($this_cat['category_icon']) : ''; ?>" onchange="document.getElementById('imagepreview').src = this.value; document.getElementById('imagepreview').style.display = '';" />
<script type="text/javascript" language="JavaScript">
var img_icon = document.getElementById('img_icon');
var imgBtn = document.createElement('div');
imgBtn.id = "category_ml_popup";
imgBtn.innerHTML = '<input type="button" name="insImage" value="<?php echo IMAGE ; ?>" onclick="window.open(\'serendipity_admin_image_selector.php?serendipity[htmltarget]=img_icon&amp;serendipity[filename_only]=true\', \'ImageSel\', \'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1\');" class="serendipityPrettyButton input_button" />';
img_icon.parentNode.insertBefore(imgBtn, img_icon.nextSibling);
</script>
</td>
</tr>
<tr>
<td><label for="read_authors"><?php echo PERM_READ; ?></label></td>
<td>
<select size="6" id="read_authors" multiple="multiple" name="serendipity[cat][read_authors][]">
<option value="0" <?php echo (!is_array($this_cat) || (isset($this_cat['authorid']) && $this_cat['authorid'] == '0') || isset($read_groups[0])) ? 'selected="selected"' : ''; ?>><?php echo ALL_AUTHORS; ?></option>
<?php
foreach($groups AS $group) {
echo '<option value="' . $group['confkey'] . '" ' . (isset($read_groups[$group['confkey']]) ? 'selected="selected"' : '') . '>' . htmlspecialchars($group['confvalue']) . '</option>' . "\n";
}
?>
</select>
</td>
</tr>
<tr>
<td><label for="write_authors"><?php echo PERM_WRITE; ?></label></td>
<td>
<select size="6" id="write_authors" multiple="multiple" name="serendipity[cat][write_authors][]">
<option value="0" <?php echo (!is_array($this_cat) || (isset($this_cat['authorid']) && $this_cat['authorid'] == '0') || isset($write_groups[0])) ? 'selected="selected"' : ''; ?>><?php echo ALL_AUTHORS; ?></option>
<?php
foreach($groups AS $group) {
echo '<option value="' . $group['confkey'] . '" ' . (isset($write_groups[$group['confkey']]) ? 'selected="selected"' : '') . '>' . htmlspecialchars($group['confvalue']) . '</option>' . "\n";
}
?>
</select>
</td>
</tr>
<tr>
<td><label for="parent_cat"><?php echo PARENT_CATEGORY; ?></label></td>
<td>
<select id="parent_cat" name="serendipity[cat][parent_cat]">
<option value="0"<?php if ( (int)$serendipity['GET']['cid'] == 0 ) echo ' selected="selected"'; ?>>[ <?php echo NO_CATEGORY; ?> ]</option>
<?php
$categories = serendipity_fetchCategories('all');
$categories = serendipity_walkRecursive($categories, 'categoryid', 'parentid', VIEWMODE_THREADED);
foreach ( $categories as $cat ) {
/* We can't be our own parent, the universe will collapse */
if ( $cat['categoryid'] == $serendipity['GET']['cid'] ) {
continue;
}
echo '<option value="'. $cat['categoryid'] .'"'. ($this_cat['parentid'] == $cat['categoryid'] ? ' selected="selected"' : '') .'>'. str_repeat('&nbsp;', $cat['depth']) . $cat['category_name'] .'</option>' . "\n";
}
?>
</select>
</td>
</tr>
<tr>
<td><?php echo CATEGORY_HIDE_SUB ?><br /><em><?php echo CATEGORY_HIDE_SUB_DESC; ?></em></td>
<td valign="top">
<input class="input_radio" type="radio" name="serendipity[cat][hide_sub]" value="0" <?php echo ($this_cat['hide_sub'] == 0 ? 'checked="checked"' : ''); ?> id="hide_sub_no" /> <label for="hide_sub_no"><?php echo NO; ?></label>
<input class="input_radio" type="radio" name="serendipity[cat][hide_sub]" value="1" <?php echo ($this_cat['hide_sub'] == 1 ? 'checked="checked"' : ''); ?> id="hide_sub_yes" /> <label for="hide_sub_yes"><?php echo YES; ?></label>
</td>
</tr>
<?php serendipity_plugin_api::hook_event('backend_category_showForm', $cid, $this_cat); ?>
</table>
<div><input type="submit" name="SAVE" value="<?php echo $save; ?>" class="serendipityPrettyButton input_button" /></div>
</form>
<?php } ?>
<?php
if ( $serendipity['GET']['adminAction'] == 'view' ) {
if (empty($admin_category)) {
$cats = serendipity_fetchCategories('all');
} else {
$cats = serendipity_fetchCategories(null, null, null, 'write');
}
$data['view'] = true;
$data['viewCats'] = $cats;
if ( is_array($cats) ) {
$categories = serendipity_walkRecursive($cats, 'categoryid', 'parentid', VIEWMODE_THREADED);
$data['viewCategories'] = $categories;
if ( is_array($cats) && sizeof($cats) > 0 ) {
echo CATEGORY_INDEX .':';
} else {
echo '<div align="center">- '. NO_CATEGORIES .' -</div>';
}
}
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/category.inc.tpl";
$content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up
echo $content;
?>
<br /><br />
<table cellspacing="0" cellpadding="4" width="100%" border=0>
<?php
if ( is_array($cats) ) {
$categories = serendipity_walkRecursive($cats, 'categoryid', 'parentid', VIEWMODE_THREADED);
foreach ( $categories as $category ) {
?>
<tr>
<td width="16"><a title="<?php echo EDIT ?>" href="?serendipity[adminModule]=category&amp;serendipity[adminAction]=edit&amp;serendipity[cid]=<?php echo $category['categoryid'] ?>"><img src="<?php echo serendipity_getTemplateFile('admin/img/edit.png') ?>" border="0" alt="<?php echo EDIT ?>" /></a></td>
<td width="16"><a title="<?php echo DELETE ?>" href="?serendipity[adminModule]=category&amp;serendipity[adminAction]=delete&amp;serendipity[cid]=<?php echo $category['categoryid'] ?>"><img src="<?php echo serendipity_getTemplateFile('admin/img/delete.png') ?>" border="0" alt="<?php echo DELETE ?>" /></a></td>
<td width="16"><?php if ( !empty($category['category_icon']) ) {?><img src="<?php echo serendipity_getTemplateFile('admin/img/thumbnail.png') ?>" alt="" /><?php } else echo '&nbsp;' ?></td>
<td width="300" style="padding-left: <?php echo ($category['depth']*15)+20 ?>px"><img src="<?php echo serendipity_getTemplateFile('admin/img/folder.png') ?>" style="vertical-align: bottom;"> <?php echo htmlspecialchars($category['category_name']) ?></td>
<td><?php echo htmlspecialchars($category['category_description']) ?></td>
<td align="right"><?php echo ($category['authorid'] == '0' ? ALL_AUTHORS : htmlspecialchars($category['realname'])); ?></td>
</tr>
<?php }
} ?>
<tr>
<td colspan="6" align="right">
<a href="?serendipity[adminModule]=category&serendipity[adminAction]=new" class="serendipityPrettyButton input_button"><?php echo CREATE_NEW_CAT ?></a>
</td>
</tr>
</table>
<?php }
/* vim: set sts=4 ts=4 expandtab : */
+347 -178
View File
@@ -1,4 +1,6 @@
<?php # $Id$
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
if (IN_serendipity !== true) {
die ("Don't hack!");
@@ -8,8 +10,6 @@ if (!serendipity_checkPermission('adminComments')) {
return;
}
$data = array();
$commentsPerPage = (int)(!empty($serendipity['GET']['filter']['perpage']) ? $serendipity['GET']['filter']['perpage'] : 10);
$summaryLength = 200;
@@ -17,20 +17,20 @@ $errormsg = '';
if ($serendipity['POST']['formAction'] == 'multiDelete' && sizeof($serendipity['POST']['delete']) != 0 && serendipity_checkFormToken()) {
if ($serendipity['POST']['togglemoderate'] != '') {
foreach ( $serendipity['POST']['delete'] as $k => $v ) {
$ac = serendipity_approveComment($k, $v, false, 'flip');
if ($ac > 0) {
$errormsg .= DONE . ': '. sprintf(COMMENT_APPROVED, (int)$k);
} else {
$errormsg .= DONE . ': '. sprintf(COMMENT_MODERATED, (int)$k);
}
}
foreach ( $serendipity['POST']['delete'] as $k => $v ) {
$ac = serendipity_approveComment($k, $v, false, 'flip');
if ($ac > 0) {
$errormsg .= DONE . ': '. sprintf(COMMENT_APPROVED, (int)$k) . '<br />';
} else {
$errormsg .= DONE . ': '. sprintf(COMMENT_MODERATED, (int)$k) . '<br />';
}
}
} else {
foreach ( $serendipity['POST']['delete'] as $k => $v ) {
serendipity_deleteComment($k, $v);
$errormsg .= DONE . ': '. sprintf(COMMENT_DELETED, (int)$k);
}
}
foreach ( $serendipity['POST']['delete'] as $k => $v ) {
serendipity_deleteComment($k, $v);
$errormsg .= DONE . ': '. sprintf(COMMENT_DELETED, (int)$k) . '<br />';
}
}
}
@@ -62,7 +62,7 @@ if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminActio
if (!empty($comment['comment'])) {
if (serendipity_saveComment($serendipity['POST']['entry_id'], $comment, 'NORMAL')) {
echo '<script type="text/javascript">alert("' . COMMENT_ADDED . '"); parent.focus(); this.close();</script>';
echo '<noscript><p class="serendipityAdminMsgError msg_error"><img class="img_error" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . COMMENT_ADDED . '</p></noscript>';
echo '<noscript><p class="serendipityAdminMsgError serendipity_backend_msg_notice"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . COMMENT_ADDED . '</p></noscript>';
return true;
} else {
$errormsg .= COMMENT_NOT_ADDED;
@@ -120,7 +120,7 @@ if (isset($serendipity['GET']['adminAction']) && ($serendipity['GET']['adminActi
serendipity_smarty_init();
if ($serendipity['GET']['adminAction'] == 'reply' || $serendipity['GET']['adminAction'] == 'doReply') {
$c = serendipity_fetchComments($serendipity['GET']['entry_id'], 1, 'co.id', false, 'NORMAL', ' AND co.id=' . (int)$serendipity['GET']['id']);
$c = serendipity_fetchComments($serendipity['GET']['entry_id'], 1, 'co.id', false, 'NORMAL', ' AND co.id=' . (int)$serendipity['GET']['id']);
if (isset($serendipity['POST']['preview'])) {
$c[] = array(
@@ -134,37 +134,37 @@ if (isset($serendipity['GET']['adminAction']) && ($serendipity['GET']['adminActi
}
$target_url = '?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=doReply&amp;serendipity[id]=' . (int)$serendipity['GET']['id'] . '&amp;serendipity[entry_id]=' . (int)$serendipity['GET']['entry_id'] . '&amp;serendipity[noBanner]=true&amp;serendipity[noSidebar]=true&amp;' . serendipity_setFormToken('url');
$codata = $serendipity['POST'];
$codata['replyTo'] = (int)$serendipity['GET']['id'];
$data = $serendipity['POST'];
$data['replyTo'] = (int)$serendipity['GET']['id'];
$out = serendipity_printComments($c);
$serendipity['smarty']->display(serendipity_getTemplateFile('comments.tpl', 'serendipityPath'));
if (!isset($codata['name'])) {
$codata['name'] = $serendipity['serendipityRealname'];
if (!isset($data['name'])) {
$data['name'] = $serendipity['serendipityRealname'];
}
if (!isset($codata['email'])) {
$codata['email'] = $serendipity['serendipityEmail'];
if (!isset($data['email'])) {
$data['email'] = $serendipity['serendipityEmail'];
}
} else {
$target_url = '?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=doEdit&amp;serendipity[id]=' . (int)$serendipity['GET']['id'] . '&amp;serendipity[entry_id]=' . (int)$serendipity['GET']['entry_id'] . '&amp;' . serendipity_setFormToken('url');
/* If we are not in preview, we need comment data from our database */
/* If we are not in preview, we need data from our database */
if (!isset($serendipity['POST']['preview'])) {
$comment = serendipity_db_query("SELECT * FROM {$serendipity['dbPrefix']}comments WHERE id = ". (int)$serendipity['GET']['id']);
$codata['name'] = $comment[0]['author'];
$codata['email'] = $comment[0]['email'];
$codata['url'] = $comment[0]['url'];
$codata['replyTo'] = $comment[0]['parent_id'];
$codata['comment'] = $comment[0]['body'];
$data['name'] = $comment[0]['author'];
$data['email'] = $comment[0]['email'];
$data['url'] = $comment[0]['url'];
$data['replyTo'] = $comment[0]['parent_id'];
$data['comment'] = $comment[0]['body'];
/* If we are in preview, we get comment data from our form */
/* If we are in preview, we get data from our form */
} elseif (isset($serendipity['POST']['preview'])) {
$codata['name'] = $serendipity['POST']['name'];
$codata['email'] = $serendipity['POST']['email'];
$codata['url'] = $serendipity['POST']['url'];
$codata['replyTo'] = $serendipity['POST']['replyTo'];
$codata['comment'] = $serendipity['POST']['comment'];
$data['name'] = $serendipity['POST']['name'];
$data['email'] = $serendipity['POST']['email'];
$data['url'] = $serendipity['POST']['url'];
$data['replyTo'] = $serendipity['POST']['replyTo'];
$data['comment'] = $serendipity['POST']['comment'];
$pc_data = array(
array(
'email' => $serendipity['POST']['email'],
@@ -180,16 +180,16 @@ if (isset($serendipity['GET']['adminAction']) && ($serendipity['GET']['adminActi
}
}
if (!empty($codata['url']) && substr($codata['url'], 0, 7) != 'http://' &&
substr($codata['url'], 0, 8) != 'https://') {
$codata['url'] = 'http://' . $codata['url'];
if (!empty($data['url']) && substr($data['url'], 0, 7) != 'http://' &&
substr($data['url'], 0, 8) != 'https://') {
$data['url'] = 'http://' . $data['url'];
}
serendipity_displayCommentForm(
$serendipity['GET']['entry_id'],
$target_url,
NULL,
$codata,
$data,
false,
false
);
@@ -264,161 +264,330 @@ if ( $page == 0 || $page > $pages ) {
}
$linkPrevious = 'serendipity_admin.php?serendipity[adminModule]=comments&amp;serendipity[page]='. ($page-1) . $searchString;
$linkNext = 'serendipity_admin.php?serendipity[adminModule]=comments&amp;serendipity[page]='. ($page+1) . $searchString;
$filter_vals = array(10, 20, 50, COMMENTS_FILTER_ALL);
$linkNext = 'serendipity_admin.php?serendipity[adminModule]=comments&amp;serendipity[page]='. ($page+1) . $searchString;
if ($commentsPerPage == COMMENTS_FILTER_ALL) {
$limit = '';
} else {
}else {
$limit = serendipity_db_limit_sql(serendipity_db_limit(($page-1)*(int)$commentsPerPage, (int)$commentsPerPage));
}
$sql = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPrefix']}comments c
LEFT JOIN {$serendipity['dbPrefix']}entries e ON (e.id = c.entry_id)
WHERE 1 = 1 " . ($c_type !== null ? " AND c.type = '$c_type' " : '') . $and
. (!serendipity_checkPermission('adminEntriesMaintainOthers') ? 'AND e.authorid = ' . (int)$serendipity['authorid'] : '') . "
$sql = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPrefix']}comments c
LEFT JOIN {$serendipity['dbPrefix']}entries e ON (e.id = c.entry_id)
WHERE 1 = 1 " . ($c_type !== null ? " AND c.type = '$c_type' " : '') . $and
. (!serendipity_checkPermission('adminEntriesMaintainOthers') ? 'AND e.authorid = ' . (int)$serendipity['authorid'] : '') . "
ORDER BY c.id DESC $limit");
$data['commentsPerPage'] = $commentsPerPage;
$data['totalComments'] = $totalComments;
$data['pages'] = $pages;
$data['page'] = $page;
$data['linkPrevious'] = $linkPrevious;
$data['linkNext'] = $linkNext;
$data['searchString'] = $searchString;
$data['filter_vals'] = $filter_vals;
$data['sql'] = $sql;
$data['c_type'] = $c_type;
if(!empty($errormsg)) echo '<p class="serendipityAdminMsgError serendipity_backend_msg_notice"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . $errormsg . '</p>'; // closing admin messages
?>
<script type="text/javascript">
function FT_toggle(id) {
if ( document.getElementById(id + '_full').style.display == '' ) {
document.getElementById(id + '_full').style.display='none';
document.getElementById(id + '_summary').style.display='';
document.getElementById(id + '_text').innerHTML = '<?php echo VIEW_FULL ?>';
} else {
document.getElementById(id + '_full').style.display='';
document.getElementById(id + '_summary').style.display='none';
document.getElementById(id + '_text').innerHTML = '<?php echo HIDE ?>';
}
return false;
}
function invertSelection() {
var f = document.formMultiDelete;
for (var i = 0; i < f.elements.length; i++) {
if( f.elements[i].type == 'checkbox' ) {
f.elements[i].checked = !(f.elements[i].checked);
f.elements[i].onclick();
}
}
}
var origborder = '';
var origwidth = '';
function highlightComment(id, checkvalue) {
var comment = document.getElementById(id);
if (origborder == '') {
origborder = comment.style.borderColor;
if (origborder == '') {
origborder = '#FFFFFF';
}
}
if (origwidth == '') {
origwidth = comment.style.borderWidth;
if (origwidth == '' || origwidth == 0) {
origwidth = 1;
}
}
if (checkvalue) {
comment.style.borderColor = '#FF0000';
comment.style.borderWidth = origwidth;
} else {
comment.style.borderColor = '';
comment.style.borderWidth = origwidth;
}
}
</script>
<form action="" method="GET" style="margin: 0">
<?php echo serendipity_setFormToken(); ?>
<input type="hidden" name="serendipity[adminModule]" value="comments" />
<input type="hidden" name="serendipity[page]" value="<?php echo $page ?>" />
<table class="serendipity_admin_filters" width="100%">
<tr>
<td colspan="6" class="serendipity_admin_filters_headline"><strong><?php echo FILTERS ?></strong> - <?php echo FIND_COMMENTS ?></td>
</tr>
<tr>
<td><?php echo AUTHOR ?>:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][author]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['author']) ?>" /></td>
<td><?php echo EMAIL ?>:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][email]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['email']) ?>" /></td>
<td><?php echo URL ?>:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][url]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['url']) ?>" /></td>
</tr>
<tr>
<td>IP:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][ip]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['ip']) ?>" /></td>
<td><?php echo CONTENT ?>:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][body]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['body']) ?>" /></td>
<td><?php echo REFERER ?>:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][referer]" size="15" value="<?php echo htmlspecialchars($serendipity['GET']['filter']['referer']) ?>" /></td>
</tr>
<tr>
<td><?php echo COMMENTS; ?>:</td>
<td><select name="serendipity[filter][perpage]">
<?php
$filter_vals = array(10, 20, 50, COMMENTS_FILTER_ALL);
foreach($filter_vals AS $filter_val) { ?>
<option value="<?php echo $filter_val; ?>" <?php echo ($commentsPerPage == $filter_val ? ' selected="selected"' : ''); ?>><?php echo $filter_val; ?></option>
<?php
}
?>
</select></td>
<td><?php echo COMMENTS_FILTER_SHOW ?>:</td>
<td><select name="serendipity[filter][show]">
<option value="all"<?php if ( $serendipity['GET']['filter']['show'] == 'all' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_ALL ?></option>
<option value="approved"<?php if ( $serendipity['GET']['filter']['show'] == 'approved' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_APPROVED_ONLY ?></option>
<option value="pending"<?php if ( $serendipity['GET']['filter']['show'] == 'pending' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_NEED_APPROVAL ?></option>
<option value="confirm"<?php if ( $serendipity['GET']['filter']['show'] == 'confirm' ) echo ' selected="selected"' ?>><?php echo COMMENTS_FILTER_NEED_CONFIRM ?></option>
</select></td>
<td><?php echo TYPE; ?></td>
<td><select name="serendipity[filter][type]">
<option value=""><?php echo COMMENTS_FILTER_ALL ?></option>
<option value="NORMAL"<?php if ($c_type == 'NORMAL') echo ' selected="selected"' ?>><?php echo COMMENTS; ?></option>
<option value="TRACKBACK"<?php if ($c_type == 'TRACKBACK') echo ' selected="selected"' ?>><?php echo TRACKBACKS; ?></option>
<option value="PINGBACK"<?php if ($c_type == 'PINGBACK') echo ' selected="selected"' ?>><?php echo PINGBACKS; ?></option>
</select></td>
</tr>
<tr>
<td colspan="6" align="right"><input type="submit" name="submit" value=" - <?php echo GO ?> - " class="serendipityPrettyButton input_button" /> <?php serendipity_plugin_api::hook_event('backend_comments_top', $sql); ?></td>
</tr>
</table>
</form>
<hr noshade="noshade" /><br />
<?php
if (!is_array($sql)) {
echo '<div align="center">- '. NO_COMMENTS .' -</div>';
} else {
?>
<form action="" method="POST" name="formMultiDelete" id="formMultiDelete">
<?php echo serendipity_setFormToken(); ?>
<input type="hidden" name="serendipity[formAction]" value="multiDelete" />
<table width="100%" cellpadding="3" border="0" cellspacing="0">
<tr>
<td align="center">
<table width="100%" cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
<?php if ( $page != 1 && $page <= $pages ) { ?>
<a href="<?php echo $linkPrevious; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/previous.png') ?>" /><?php echo PREVIOUS ?></a>
<?php } ?>
</td>
<td align="center"><?php printf(PAGE_BROWSE_COMMENTS, $page, $pages, $totalComments); ?></td>
<td align="right">
<?php if ( $page != $pages ) { ?>
<a href="<?php echo $linkNext; ?>" class="serendipityIconLinkRight"><?php echo NEXT ?><img src="<?php echo serendipity_getTemplateFile('admin/img/next.png') ?>" /></a>
<?php } ?>
</td>
</tr>
</table>
</td>
</tr>
<?php
$i = 0;
$comments = array();
foreach ($sql as $rs) {
$i++;
$comment = array(
'fullBody' => $rs['body'],
'summary' => serendipity_mb('substr', $rs['body'], 0, $summaryLength),
'status' => $rs['status'],
'type' => $rs['type'],
'id' => $rs['id'],
'title' => $rs['title'],
'timestamp' => $rs['timestamp'],
'referer' => $rs['referer'],
'url' => $rs['url'],
'ip' => $rs['ip'],
'entry_url' => serendipity_archiveURL($rs['entry_id'], $rs['title']),
'email' => $rs['email'],
'author' => (empty($rs['author']) ? ANONYMOUS : $rs['author']),
'entry_id' => $rs['entry_id'],
'subscribed'=> $rs['subscribed']
);
if(is_array($sql)) {
foreach ($sql as $rs) {
$i++;
$comment = array(
'fullBody' => $rs['body'],
'summary' => serendipity_mb('substr', $rs['body'], 0, $summaryLength),
'status' => $rs['status'],
'type' => $rs['type'],
'id' => $rs['id'],
'title' => $rs['title'],
'timestamp' => $rs['timestamp'],
'pubdate' => date("c", (int)$rs['timestamp']), /* added to comment array to support HTML5 time tags in tpl */
'referer' => $rs['referer'],
'url' => $rs['url'],
'ip' => $rs['ip'],
'entry_url' => serendipity_archiveURL($rs['entry_id'], $rs['title']),
'email' => $rs['email'],
'author' => (empty($rs['author']) ? ANONYMOUS : $rs['author']),
'entry_id' => $rs['entry_id'],
'subscribed'=> $rs['subscribed']
);
$entrylink = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id'];
if (strlen($comment['fullBody']) > strlen($comment['summary']) ) {
$comment['summary'] .= ' ...';
$comment['excerpt'] = true;
$entrylink = serendipity_archiveURL($comment['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $comment['id'];
$comment['entrylink'] = $entrylink;
// When summary is not the full body, strip HTML tags from summary, as it might break and leave unclosed HTML.
$comment['fullBody'] = nl2br(htmlspecialchars($comment['fullBody']));
$comment['summary'] = nl2br(strip_tags($comment['summary']));
} else {
$comment['excerpt'] = false;
if (strlen($comment['fullBody']) > strlen($comment['summary']) ) {
$comment['summary'] .= ' ...';
$comment['excerpt'] = true;
// When summary is not the full body, strip HTML tags from summary, as it might break and leave unclosed HTML.
$comment['fullBody'] = nl2br(htmlspecialchars($comment['fullBody']));
$comment['summary'] = nl2br(strip_tags($comment['summary']));
} else {
$comment['excerpt'] = false;
$comment['fullBody'] = $comment['summary'] = nl2br(htmlspecialchars($comment['fullBody']));
}
serendipity_plugin_api::hook_event('backend_view_comment', $comment, '&amp;serendipity[page]='. $page . $searchString);
$class = 'serendipity_admin_list_item_' . (($i % 2 == 0 ) ? 'even' : 'uneven');
if ($comment['status'] == 'pending') {
$class .= ' serendipity_admin_comment_pending';
$header_class = 'serendipityAdminMsgNote serendipity_admin_comment_pending_header';
} elseif (strstr($comment['status'], 'confirm')) {
$class .= ' serendipity_admin_comment_pending serendipity_admin_comment_confirm';
$header_class = 'serendipityAdminMsgNote serendipity_admin_comment_pending_header serendipity_admin_comment_confirm_header';
} else {
$header_class = '';
}
$comment['class'] = $class;
$comment['header_class'] = $header_class;
if (!empty($comment['url']) && substr($comment['url'], 0, 7) != 'http://' && substr($comment['url'], 0, 8) != 'https://') {
$comment['url'] = 'http://' . $comment['url'];
}
// include all comment vars back into upper array to assign to Smarty
$comments[] = $comment;
$comment['fullBody'] = $comment['summary'] = nl2br(htmlspecialchars($comment['fullBody']));
}
}
/* This could be used instead, as i.e. there is no need for summary body here, as strip_tags, nl2br, etc could be done via smarty in the tpl - see dashboard PoC */
/* $class and $header_class would not be needed either, ... */
/**
function buildCommentList($limit) {
global $serendipity;
$comments = serendipity_fetchComments(null, $limit, 'co.id DESC', true, 'NORMAL', '');
if (!is_array($comments) || count($comments) == 0) {
return;
}
$comment = array();
foreach ($sql as $rs) {
$comment[] = array(
'body' => htmlspecialchars($rs['body']),
'status' => $rs['status'],
'type' => $rs['type'],
'id' => $rs['id'],
'title' => htmlspecialchars($rs['title']),
'timestamp' => $rs['timestamp'],
'pubdate' => date("c", (int)$rs['timestamp']),
'referer' => htmlspecialchars($rs['referer']),
'url' => htmlspecialchars($rs['url']),
'ip' => htmlspecialchars($rs['ip']),
'entry_url' => serendipity_archiveURL($rs['entry_id'], htmlspecialchars($rs['title'])),
'email' => htmlspecialchars($rs['email']),
'author' => (empty($rs['author']) ? ANONYMOUS : htmlspecialchars($rs['author'])),
'entry_id' => $rs['entry_id'],
'subscribed' => $rs['subscribed'],
'entrylink' => serendipity_archiveURL($rs['entry_id'], 'comments', 'serendipityHTTPPath', true) . '#c' . $rs['id'],
'excerpt' => ((strlen($rs['body']) > serendipity_mb('substr', $rs['body'], 0, $summaryLength) ) ? true : false),
'delete_id' => sprintf(COMMENT_DELETE_CONFIRM, $rs['id'], htmlspecialchars($rs['author']))
);
if (!empty($comment['url']) && substr($comment['url'], 0, 7) != 'http://' && substr($comment['url'], 0, 8) != 'https://') {
$comment['url'] = 'http://' . $comment['url'];
}
}
serendipity_plugin_api::hook_event('backend_view_comment', $comment, '&amp;serendipity[page]='. $page . $searchString);
$serendipity['smarty']->assign(
array( 'urltoken' => serendipity_setFormToken('url'),
'formtoken' => serendipity_setFormToken()
));
return $comment;
serendipity_plugin_api::hook_event('backend_view_comment', $comment, '&amp;serendipity[page]='. $page . $searchString);
$class = 'serendipity_admin_list_item_' . (($i % 2 == 0 ) ? 'even' : 'uneven');
if ($comment['status'] == 'pending') {
$class .= ' serendipity_admin_comment_pending';
$header_class = 'serendipityAdminMsgNote serendipity_admin_comment_pending_header';
} elseif (strstr($comment['status'], 'confirm')) {
$class .= ' serendipity_admin_comment_pending serendipity_admin_comment_confirm';
$header_class = 'serendipityAdminMsgNote serendipity_admin_comment_pending_header serendipity_admin_comment_confirm_header';
} else {
$header_class = '';
}
**/
$data['comments'] = $comments;
$data['errormsg'] = $errormsg;
$data['urltoken'] = serendipity_setFormToken('url');
$data['formtoken'] = serendipity_setFormToken();
$data['get']['filter'] = $serendipity['GET']['filter']; // don't trust {$smarty.get.vars} if not proofed, as we often change GET vars via serendipty['GET'] by runtime
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
if (!empty($comment['url']) && substr($comment['url'], 0, 7) != 'http://' &&
substr($comment['url'], 0, 8) != 'https://') {
$comment['url'] = 'http://' . $comment['url'];
}
?>
<tr>
<td class="<?php echo $header_class; ?>">
<?php if (!empty($header_class)) { ?>
<img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="<?php echo serendipity_getTemplateFile('admin/img/admin_msg_note.png'); ?>" alt="" />
<?php }?>
<a name="c<?php echo $comment['id'] ?>"></a>
<?php echo ($comment['type'] == 'NORMAL' ? COMMENT : ($comment['type'] == 'TRACKBACK' ? TRACKBACK : PINGBACK )) . ' #'. $comment['id'] .', '. IN_REPLY_TO .' <strong><a href="' . $comment['entry_url'] . '">'. htmlspecialchars($comment['title']) .'</a></strong>, '. ON . ' ' . serendipity_formatTime('%b %e %Y, %H:%M', $comment['timestamp'])?>
</td>
</tr>
<tr>
<td class="serendipity_admin_list_item <?php echo $class ?>" id="comment_<?php echo $comment['id'] ?>">
<table width="100%" cellspacing="0" cellpadding="3" border="0">
<tr>
<td rowspan="3" width="20" align="center"><input class="input_checkbox" type="checkbox" name="serendipity[delete][<?php echo $comment['id'] ?>]" value="<?php echo $comment['entry_id'] ?>" onclick="highlightComment('comment_<?php echo $comment['id'] ?>', this.checked)" tabindex="<?php echo $i ?>" /></td>
<td width="40%"><strong><?php echo AUTHOR ?></strong>: <?php echo htmlspecialchars(serendipity_truncateString($comment['author'],30)) . $comment['action_author']; ?></td>
<td><strong><?php echo EMAIL ?></strong>:
<?php
if ( empty($comment['email']) ) {
echo 'N/A';
} else {
?>
<a href="mailto:<?php echo htmlspecialchars($comment['email']) ?>" title="<?php echo htmlspecialchars($comment['email']) ?>"><?php echo htmlspecialchars(serendipity_truncateString($comment['email'],30)) ?></a>
<?php if ($comment['subscribed'] == 'true') { echo '<span class="serendipity_subscription_on">(' . ACTIVE_COMMENT_SUBSCRIPTION . ')</span>'; } ?>
<?php } ?>
<?php echo $comment['action_email']; ?>
</td>
</tr>
<tr>
<td width="40%"><strong>IP</strong>:
<?php
if ( empty($comment['ip']) ) {
echo '0.0.0.0';
} else {
echo htmlspecialchars($comment['ip']);
}
?>
<?php echo $comment['action_ip']; ?>
</td>
<td><strong><?php echo URL; ?></strong>:
<?php
if ( empty($comment['url']) ) {
echo 'N/A';
} else {
?>
<a href="<?php echo htmlspecialchars($comment['url']) ?>" title="<?php echo htmlspecialchars($comment['url']) ?>" target="_blank"><?php echo htmlspecialchars(serendipity_truncateString($comment['url'],30)) ?></a>
<?php } ?>
<?php echo $comment['action_url']; ?>
</td>
</tr>
<tr>
<td width="40%">&nbsp;</td>
<td><strong><?php echo REFERER; ?></strong>:
<?php
if ( empty($comment['referer']) ) {
echo 'N/A';
} else {
?>
<a href="<?php echo htmlspecialchars($comment['referer']) ?>" title="<?php echo htmlspecialchars($comment['referer']) ?>" target="_blank"><?php echo htmlspecialchars(serendipity_truncateString($comment['referer'],30)) ?></a>
<?php } ?>
<?php echo $comment['action_referer']; ?>
</td>
<tr>
<td style="border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC" colspan="3">
<div id="<?php echo $comment['id'] ?>_summary"><?php echo $comment['summary'] ?></div>
<div id="<?php echo $comment['id'] ?>_full" style="display: none"><?php echo $comment['fullBody'] ?></div>
</td>
</tr>
</table>
<?php if ($comment['status'] == 'pending' || strstr($comment['status'], 'confirm')) { ?>
<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=approve&amp;serendipity[id]=<?php echo $comment['id'] ?>&amp;<?php echo serendipity_setFormToken('url'); ?>" class="serendipityIconLink" title="<?php echo APPROVE; ?>"><img src="<?php echo serendipity_getTemplateFile('admin/img/accept.png'); ?>" alt="<?php echo APPROVE ?>" /><?php echo APPROVE ?></a>
<?php } ?>
<?php if ($comment['status'] == 'approved') { ?>
<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=pending&amp;serendipity[id]=<?php echo $comment['id'] ?>&amp;<?php echo serendipity_setFormToken('url'); ?>" class="serendipityIconLink" title="<?php echo SET_TO_MODERATED; ?>"><img src="<?php echo serendipity_getTemplateFile('admin/img/clock.png'); ?>" alt="<?php echo SET_TO_MODERATED ?>" /><?php echo SET_TO_MODERATED ?></a>
<?php } ?>
<?php if ($comment['excerpt']) { ?>
<a href="#c<?php echo $comment['id'] ?>" onclick="FT_toggle(<?php echo $comment['id'] ?>); return false;" title="<?php echo VIEW; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo TOGGLE_ALL; ?>" /><span id="<?php echo $comment['id'] ?>_text"><?php echo TOGGLE_ALL ?></span></a>
<?php } ?>
<a target="_blank" href="<?php echo $entrylink; ?>" title="<?php echo VIEW; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo VIEW; ?>" /><?php echo VIEW ?></a>
<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=edit&amp;serendipity[id]=<?php echo $comment['id'] ?>&amp;serendipity[entry_id]=<?php echo $comment['entry_id'] ?>&amp;<?php echo serendipity_setFormToken('url'); ?>" title="<?php echo EDIT; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/edit.png'); ?>" alt="<?php echo EDIT; ?>" /><?php echo EDIT ?></a>
<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=delete&amp;serendipity[id]=<?php echo $comment['id'] ?>&amp;serendipity[entry_id]=<?php echo $comment['entry_id'] ?>&amp;<?php echo serendipity_setFormToken('url'); ?>" onclick='return confirm("<?php echo sprintf(COMMENT_DELETE_CONFIRM, $comment['id'], htmlspecialchars($comment['author'])) ?>")' title="<?php echo DELETE ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/delete.png'); ?>" alt="<?php echo DELETE; ?>" /><?php echo DELETE ?></a>
<a target="_blank" onclick="cf = window.open(this.href, 'CommentForm', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1'); cf.focus(); return false;" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=reply&amp;serendipity[id]=<?php echo $comment['id'] ?>&amp;serendipity[entry_id]=<?php echo $comment['entry_id'] ?>&amp;serendipity[noBanner]=true&amp;serendipity[noSidebar]=true&amp;<?php echo serendipity_setFormToken('url'); ?>" title="<?php echo REPLY ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/user_editor.png'); ?>" alt="<?php echo REPLY; ?>" /><?php echo REPLY ?></a>
<?php echo $comment['action_more']; ?>
</td>
</tr>
<tr>
<td><hr noshade="noshade" /></td>
</tr>
<?php } ?>
<tr>
<td><input type="button" name="toggle" value="<?php echo INVERT_SELECTIONS ?>" onclick="invertSelection()" class="serendipityPrettyButton input_button" />
<input type="submit" name="toggle" value="<?php echo DELETE_SELECTED_COMMENTS ?>" onclick="return confirm('<?php echo COMMENTS_DELETE_CONFIRM ?>')" tabindex="<?php echo ($i+1) ?>" class="serendipityPrettyButton input_button" />
<input type="submit" name="serendipity[togglemoderate]" value="<?php echo MODERATE_SELECTED_COMMENTS ?>" class="serendipityPrettyButton input_button" />
</td>
</tr>
</table>
<table width="100%" cellpadding="3" border="0" cellspacing="0">
<tr>
<td align="center">
<table width="100%" cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
<?php if ( $page != 1 && $page <= $pages ) { ?>
<a href="<?php echo $linkPrevious; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/previous.png') ?>" /><?php echo PREVIOUS ?></a>
<?php } ?>
</td>
<td align="center"><?php printf(PAGE_BROWSE_COMMENTS, $page, $pages, $totalComments); ?></td>
<td align="right">
<?php if ( $page != $pages ) { ?>
<a href="<?php echo $linkNext; ?>" class="serendipityIconLinkRight"><?php echo NEXT ?><img src="<?php echo serendipity_getTemplateFile('admin/img/next.png') ?>" /></a>
<?php } ?>
</td>
</tr>
</table>
</td>
</tr>
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/comments.inc.tpl";
$content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up
echo $content;
/* vim: set sts=4 ts=4 expandtab : */
</form>
<?php } ?>
+12 -21
View File
@@ -18,16 +18,13 @@ if (!serendipity_checkPermission('siteConfiguration') && !serendipity_checkPermi
return;
}
$data = array();
switch ($_POST['installAction'] && serendipity_checkFormToken()) {
case 'check':
$data['installAction'] = 'check';
$oldConfig = $serendipity;
$res = serendipity_updateConfiguration();
$data['res'] = $res;
if (is_array($res)) {
$data['diagnosticError'] = true;
echo DIAGNOSTIC_ERROR;
echo '<div class="serendipityAdminMsgError">- <img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . implode('<br />', $res) . '</div><br /><br />';
} else {
/* If we have new rewrite rules, then install them */
$permalinkOld = array(
@@ -54,13 +51,20 @@ switch ($_POST['installAction'] && serendipity_checkFormToken()) {
}
}
if (serendipity_checkPermission('siteConfiguration') && serialize($permalinkOld) != serialize($permalinkNew)) {
$data['htaccessRewrite'] = true;
$data['serendipityPath'] = $serendipity['serendipityPath'];
printf(ATTEMPT_WRITE_FILE, $serendipity['serendipityPath'] . '.htaccess');
$res = serendipity_installFiles($serendipity['serendipityPath']);
$data['res'] = $res;
if (is_array($res)) {
echo implode('<br />', $res);
} else {
echo DONE . '<br />';
}
serendipity_buildPermalinks();
}
echo '<br /><div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . WRITTEN_N_SAVED .'</div>';
}
break;
@@ -68,22 +72,9 @@ switch ($_POST['installAction'] && serendipity_checkFormToken()) {
default:
$from = &$serendipity;
$t = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE);
ob_start();
serendipity_printConfigTemplate($t, $from, false, true);
$data['config'] = ob_get_contents();
ob_end_clean();
break;
}
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/configuration.inc.tpl";
$content = $serendipity['smarty']->fetch('file:'. $tfile);
echo $content;
/* vim: set sts=4 ts=4 expandtab : */
?>
+276 -98
View File
@@ -1,4 +1,6 @@
<?php # $Id$
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
if (IN_serendipity !== true) {
die ("Don't hack!");
@@ -17,7 +19,6 @@ $sort_order = array('timestamp' => DATE,
'id' => 'ID');
$per_page = array('12', '16', '50', '100');
$data = array();
/**
* Shows the entry panel overview
@@ -28,7 +29,7 @@ $data = array();
* @return null
*/
function serendipity_drawList() {
global $serendipity, $sort_order, $per_page, $data;
global $serendipity, $sort_order, $per_page;
$filter_import = array('author', 'category', 'isdraft');
$sort_import = array('perPage', 'ordermode', 'order');
@@ -96,26 +97,94 @@ function serendipity_drawList() {
$orderby,
$filter_sql
);
?>
<div class="serendipity_admin_list">
<form action="?" method="get">
<input type="hidden" name="serendipity[action]" value="admin" />
<input type="hidden" name="serendipity[adminModule]" value="entries" />
<input type="hidden" name="serendipity[adminAction]" value="editSelect" />
<table width="100%" class="serendipity_admin_filters">
<tr>
<td class="serendipity_admin_filters_headline" colspan="6"><strong><?php echo FILTERS ?></strong> - <?php echo FIND_ENTRIES ?></td>
</tr>
<tr>
<td valign="top" width="80"><?php echo AUTHOR ?></td>
<td valign="top">
<select name="serendipity[filter][author]">
<option value="">--</option>
<?php
$users = serendipity_fetchUsers('', 'hidden', true);
if (is_array($users)) {
foreach ($users AS $user) {
if (isset($user['artcount']) && $user['artcount'] < 1) continue;
echo '<option value="' . $user['authorid'] . '" ' . (isset($serendipity['GET']['filter']['author']) && $serendipity['GET']['filter']['author'] == $user['authorid'] ? 'selected="selected"' : '') . '>' . htmlspecialchars($user['realname']) . '</option>' . "\n";
}
}
?> </select> <select name="serendipity[filter][isdraft]">
<option value="all"><?php echo COMMENTS_FILTER_ALL; ?></option>
<option value="draft" <?php echo (isset($serendipity['GET']['filter']['isdraft']) && $serendipity['GET']['filter']['isdraft'] == 'draft' ? 'selected="selected"' : ''); ?>><?php echo DRAFT; ?></option>
<option value="publish" <?php echo (isset($serendipity['GET']['filter']['isdraft']) && $serendipity['GET']['filter']['isdraft'] == 'publish' ? 'selected="selected"' : ''); ?>><?php echo PUBLISH; ?></option>
</select>
</td>
<td valign="top" width="80"><?php echo CATEGORY ?></td>
<td valign="top">
<select name="serendipity[filter][category]">
<option value="">--</option>
<?php
$categories = serendipity_fetchCategories();
$categories = serendipity_walkRecursive($categories, 'categoryid', 'parentid', VIEWMODE_THREADED);
foreach ( $categories as $cat ) {
echo '<option value="'. $cat['categoryid'] .'"'. ($serendipity['GET']['filter']['category'] == $cat['categoryid'] ? ' selected="selected"' : '') .'>'. str_repeat('&nbsp;', $cat['depth']) . htmlspecialchars($cat['category_name']) .'</option>' . "\n";
}
?> </select>
</td>
<td valign="top" width="80"><?php echo CONTENT ?></td>
<td valign="top"><input class="input_textbox" size="10" type="text" name="serendipity[filter][body]" value="<?php echo (isset($serendipity['GET']['filter']['body']) ? htmlspecialchars($serendipity['GET']['filter']['body']) : '') ?>" /></td>
</tr>
<tr>
<td class="serendipity_admin_filters_headline" colspan="6"><strong><?php echo SORT_ORDER ?></strong></td>
</tr>
<tr>
<td>
<?php echo SORT_BY ?>
</td>
<td>
<select name="serendipity[sort][order]">
<?php
foreach($sort_order as $so_key => $so_val) {
echo '<option value="' . $so_key . '" ' . (isset($serendipity['GET']['sort']['order']) && $serendipity['GET']['sort']['order'] == $so_key ? 'selected="selected"': '') . '>' . $so_val . '</option>' . "\n";
}
?> </select>
</td>
<td><?php echo SORT_ORDER ?></td>
<td>
<select name="serendipity[sort][ordermode]">
<option value="DESC" <?php echo (isset($serendipity['GET']['sort']['ordermode']) && $serendipity['GET']['sort']['ordermode'] == 'DESC' ? 'selected="selected"' : '') ?>><?php echo SORT_ORDER_DESC ?></option>
<option value="ASC" <?php echo (isset($serendipity['GET']['sort']['ordermode']) && $serendipity['GET']['sort']['ordermode'] == 'ASC' ? 'selected="selected"' : '') ?>><?php echo SORT_ORDER_ASC ?></option>
</select>
</td>
<td><?php echo ENTRIES_PER_PAGE ?></td>
<td>
<select name="serendipity[sort][perPage]">
<?php
foreach($per_page AS $per_page_nr) {
echo '<option value="' . $per_page_nr . '" ' . (isset($serendipity['GET']['sort']['perPage']) && $serendipity['GET']['sort']['perPage'] == $per_page_nr ? 'selected="selected"' : '') . '>' . $per_page_nr . '</option>' . "\n";
}
$users = serendipity_fetchUsers('', 'hidden', true);
$categories = serendipity_fetchCategories();
$categories = serendipity_walkRecursive($categories, 'categoryid', 'parentid', VIEWMODE_THREADED);
$data['drawList'] = true;
$data['sort_order'] = $sort_order;
$data['perPage'] = $perPage;
$data['per_page'] = $per_page;
$data['urltoken'] = serendipity_setFormToken('url');
$data['formtoken'] = serendipity_setFormToken();
$data['users'] = $users;
$data['categories'] = $categories;
$data['offSet'] = $offSet;
$data['use_iframe'] = $serendipity['use_iframe'];
?>
</select>
</td>
</tr>
<tr>
<td align="right" colspan="6"><input type="submit" name="go" value="<?php echo GO ?>" class="serendipityPrettyButton input_button" /></td>
</tr>
</table>
</form>
<table class="serendipity_admin_list" cellpadding="5" width="100%">
<?php
if (is_array($entries)) {
$data['is_entries'] = true;
$data['count'] = count($entries);
$count = count($entries);
$qString = '?serendipity[adminModule]=entries&amp;serendipity[adminAction]=editSelect';
foreach ((array)$serendipity['GET']['sort'] as $k => $v) {
$qString .= '&amp;serendipity[sort]['. $k .']='. $v;
@@ -123,57 +192,175 @@ function serendipity_drawList() {
foreach ((array)$serendipity['GET']['filter'] as $k => $v) {
$qString .= '&amp;serendipity[filter]['. $k .']='. $v;
}
$data['linkPrevious'] = $qString . '&amp;serendipity[page]=' . ($page-1);
$data['linkNext'] = $qString . '&amp;serendipity[page]=' . ($page+1);
$linkPrevious = $qString . '&amp;serendipity[page]=' . ($page-1);
$linkNext = $qString . '&amp;serendipity[page]=' . ($page+1);
?>
<tr>
<td>
<?php if ($offSet > 0) { ?>
<a href="<?php echo $linkPrevious ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/previous.png') ?>" /><?php echo PREVIOUS ?></a>
<?php } ?>
</td>
<td align="right">
<?php if ($count > $perPage) { ?>
<a href="<?php echo $linkNext ?>" class="serendipityIconLinkRight"><?php echo NEXT ?><img src="<?php echo serendipity_getTemplateFile('admin/img/next.png') ?>" /></a>
<?php } ?>
</td>
</tr>
</table>
<script type="text/javascript">
function invertSelection() {
var f = document.formMultiDelete;
for (var i = 0; i < f.elements.length; i++) {
if (f.elements[i].type == 'checkbox') {
f.elements[i].checked = !(f.elements[i].checked);
}
}
}
</script>
<form action="?" method="post" name="formMultiDelete" id="formMultiDelete">
<?php echo serendipity_setFormToken(); ?>
<input type="hidden" name="serendipity[action]" value="admin" />
<input type="hidden" name="serendipity[adminModule]" value="entries" />
<input type="hidden" name="serendipity[adminAction]" value="multidelete" />
<?php
// Print the entries
$smartentries = array();
foreach ($entries as $ey) {
if (count($ey['categories'])) {
$cats = array();
foreach ($ey['categories'] as $cat) {
$cats[] = '<a href="' . serendipity_categoryURL($cat) . '">' . htmlspecialchars($cat['category_name']) . '</a>';
}
$entry_cats = implode(', ', $cats);
$rows = 0;
foreach ($entries as $entry) {
$rows++;
if ($rows > $perPage) {
continue;
}
// Find out if the entry has been modified later than 30 minutes after creation
if ($entry['timestamp'] <= ($entry['last_modified'] - 60*30)) {
$lm = '<a href="#" title="' . LAST_UPDATED . ': ' . serendipity_formatTime(DATE_FORMAT_SHORT, $entry['last_modified']) . '" onclick="alert(this.title)"><img src="'. serendipity_getTemplateFile('admin/img/clock.png') .'" alt="*" style="border: 0px none ; vertical-align: bottom;" /></a>';
} else {
$lm = '';
}
$smartentries[] = array(
'id' => $ey['id'],
'title' => htmlspecialchars($ey['title']),
'timestamp' => (int)$ey['timestamp'],
'last_modified' => (int)$ey['last_modified'],
'isdraft' => serendipity_db_bool($ey['isdraft']),
'ep_is_sticky' => (serendipity_db_bool($ey['properties']['ep_is_sticky']) ? true : false),
'pubdate' => date("c", (int)$ey['timestamp']),
'author' => htmlspecialchars($ey['author']),
'cats' => $entry_cats,
'preview' => ((serendipity_db_bool($ey['isdraft']) || (!$serendipity['showFutureEntries'] && $ey['timestamp'] >= serendipity_serverOffsetHour())) ? true : false),
'archive_link' => serendipity_archiveURL($ey['id'], $ey['title'], 'serendipityHTTPPath', true, array('timestamp' => $ey['timestamp'])),
'preview_link' => '?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=preview&amp;' . serendipity_setFormToken('url') . '&amp;serendipity[id]=' . $ey['id']
);
if (!$serendipity['showFutureEntries'] && $entry['timestamp'] >= serendipity_serverOffsetHour()) {
$entry_pre = '<a href="#" title="' . ENTRY_PUBLISHED_FUTURE . '" onclick="alert(this.title)"><img src="'. serendipity_getTemplateFile('admin/img/clock_future.png') .'" alt="*" style="border: 0px none ; vertical-align: bottom;" /></a> ';
} else {
$entry_pre = '';
}
if (serendipity_db_bool($entry['properties']['ep_is_sticky'])) {
$entry_pre .= ' ' . STICKY_POSTINGS . ': ';
}
if (serendipity_db_bool($entry['isdraft'])) {
$entry_pre .= ' ' . DRAFT . ': ';
}
?>
<!-- <div class="serendipity_admin_list_item serendipity_admin_list_item_<?php echo ($rows % 2 ? 'even' : 'uneven'); ?>"> -->
<div class="serendipity_admin_list_item serendipity_admin_list_item_<?php echo ($rows % 2) ? 'even' : 'uneven'; ?>">
<table width="100%" cellspacing="0" cellpadding="3">
<tr>
<td>
<strong><?php echo $entry_pre; ?><a href="?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=edit&amp;serendipity[id]=<?php echo $entry['id']; ?>" title="#<?php echo $entry['id']; ?>"><?php echo serendipity_truncateString(htmlspecialchars($entry['title']),50) ?></a></strong>
</td>
<td align="right">
<?php echo serendipity_formatTime(DATE_FORMAT_SHORT, $entry['timestamp']) . ' ' .$lm; ?>
</td>
</tr>
<tr>
<td>
<?php
echo POSTED_BY . ' ' . htmlspecialchars($entry['author']);
if (count($entry['categories'])) {
echo ' ' . IN . ' ';
$cats = array();
foreach ($entry['categories'] as $cat) {
$caturl = serendipity_categoryURL($cat);
$cats[] = '<a href="' . $caturl . '">' . htmlspecialchars($cat['category_name']) . '</a>';
}
echo implode(', ', $cats);
}
$entry['link'] = serendipity_archiveURL($entry['id'], $entry['title'], 'serendipityHTTPPath', true, array('timestamp' => $entry['timestamp']));
$entry['preview_link'] = '?serendipity[noBanner]=true&amp;serendipity[noSidebar]=true&amp;serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=preview&amp;serendipity[id]=' . $entry['id'];
?>
</td>
<td align="right">
<?php if (serendipity_db_bool($entry['isdraft']) || (!$serendipity['showFutureEntries'] && $entry['timestamp'] >= serendipity_serverOffsetHour())) { ?>
<a target="_blank" href="<?php echo $entry['preview_link']; ?>&amp;<?php echo serendipity_setFormToken('url'); ?>" title="<?php echo PREVIEW . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo PREVIEW; ?>" /><?php echo PREVIEW ?></a>
<?php } else { ?>
<a target="_blank" href="<?php echo $entry['link']; ?>" title="<?php echo VIEW . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo VIEW; ?>" /><?php echo VIEW ?></a>
<?php } ?>
<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=edit&amp;serendipity[id]=<?php echo $entry['id']; ?>" title="<?php echo EDIT . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/edit.png'); ?>" alt="<?php echo EDIT; ?>" /><?php echo EDIT ?></a>
<a href="?<?php echo serendipity_setFormToken('url'); ?>&amp;serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=delete&amp;serendipity[id]=<?php echo $entry['id']; ?>" title="<?php echo DELETE . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/delete.png'); ?>" alt="<?php echo DELETE; ?>" /><?php echo DELETE ?></a>
<input class="input_checkbox" type="checkbox" name="serendipity[multiDelete][]" value="<?php echo $entry['id']; ?>" />
</td>
</tr>
</table>
</div>
<?php
} // end entries output
$data['entries'] = $smartentries;
$data['urltoken'] = serendipity_setFormToken('url');
$data['formtoken'] = serendipity_setFormToken();
$data['serverOffsetHour'] = serendipity_serverOffsetHour();
$data['showFutureEntries'] = $serendipity['showFutureEntries'];
?>
<table class="serendipity_admin_list" cellpadding="5" width="100%">
<tr>
<td>
<?php if ($offSet > 0) { ?>
<a href="<?php echo $linkPrevious ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/previous.png') ?>" /><?php echo PREVIOUS ?></a>
<?php } ?>
</td>
<td align="right">
<?php if ($count > $perPage) { ?>
<a href="<?php echo $linkNext ?>" class="serendipityIconLinkRight"><?php echo NEXT ?><img src="<?php echo serendipity_getTemplateFile('admin/img/next.png') ?>" /></a>
<?php } ?>
</td>
</tr>
</table>
<table class="serendipity_admin_list" cellpadding="0" width="100%">
<tr>
<td align="right">
<input type="button" name="toggle" value="<?php echo INVERT_SELECTIONS ?>" onclick="invertSelection()" class="serendipityPrettyButton input_button" />
<input type="submit" name="toggle" value="<?php echo DELETE_SELECTED_ENTRIES ?>" class="serendipityPrettyButton input_button" />
</td>
</tr>
</table>
</form>
<div class="serendipity_admin_list_item serendipity_admin_list_item_<?php echo (($rows+1) % 2 ? 'even' : 'uneven'); ?>">
<table width="100%" cellspacing="0" cellpadding="3">
<tr>
<td>
<form action="?" method="get">
<input type="hidden" name="serendipity[action]" value="admin" />
<input type="hidden" name="serendipity[adminModule]" value="entries" />
<input type="hidden" name="serendipity[adminAction]" value="editSelect" />
<?php echo EDIT_ENTRY ?>: #<input class="input_textbox" type="text" size="3" name="serendipity[id]" /> <input type="submit" name="serendipity[editSubmit]" value="<?php echo GO ?>" class="serendipityPrettyButton input_button" />
</form>
</td>
</tr>
</table>
</div>
<?php
} else {
$data['no_entries'] = true;
} // if entries end
// We've got nothing
?>
<tr>
<td align="center" class="serendipityAdminMsgNote">
<img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="<?php echo serendipity_getTemplateFile('admin/img/admin_msg_note.png'); ?>" alt="" />
<?php echo NO_ENTRIES_TO_PRINT ?>
</td>
</tr>
</table>
<?php
}
?>
</div>
<?php
} // End function serendipity_drawList()
if (!empty($serendipity['GET']['editSubmit'])) {
$serendipity['GET']['adminAction'] = 'edit'; // does this change smarty.get vars?
$serendipity['GET']['adminAction'] = 'edit';
}
$preview_only = false;
// very sticky smartification to origin, could be done better, I assume!
switch($serendipity['GET']['adminAction']) {
case 'preview':
$entry = serendipity_fetchEntry('id', $serendipity['GET']['id'], 1, 1);
@@ -212,8 +399,7 @@ switch($serendipity['GET']['adminAction']) {
$entry['timestamp'] = strtotime($serendipity['POST']['new_timestamp']);
if ($entry['timestamp'] == -1) {
$data['switched_output'] = true;
$data['dateval'] = false;
echo DATE_INVALID . '<br />';
// The date given by the user is not convertable. Reset the timestamp.
$entry['timestamp'] = $serendipity['POST']['timestamp'];
}
@@ -225,19 +411,18 @@ switch($serendipity['GET']['adminAction']) {
}
// Save the entry, or just display a preview
$data['use_legacy'] = $use_legacy = true;
$use_legacy = true;
serendipity_plugin_api::hook_event('backend_entry_iframe', $use_legacy);
if ($use_legacy) {
$data['switched_output'] = true;
if ($serendipity['POST']['preview'] != 'true') {
/* We don't need an iframe to save a draft */
if ( $serendipity['POST']['isdraft'] == 'true' ) {
$data['is_draft'] = true;
echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . IFRAME_SAVE_DRAFT . '</div><br />';
serendipity_updertEntry($entry);
} else {
if ($serendipity['use_iframe']) {
$data['is_iframe'] = true;
echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . IFRAME_SAVE . '</div><br />';
serendipity_iframe_create('save', $entry);
} else {
serendipity_iframe($entry, 'save');
@@ -294,7 +479,7 @@ switch($serendipity['GET']['adminAction']) {
}
if ($serendipity['use_iframe']) {
$data['is_iframepreview'] = true;
echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . IFRAME_PREVIEW . '</div><br />';
serendipity_iframe_create('preview', $entry);
} else {
serendipity_iframe($entry, 'preview');
@@ -319,6 +504,7 @@ switch($serendipity['GET']['adminAction']) {
'serendipity[adminAction]' => 'save',
'serendipity[timestamp]' => $entry['timestamp']
),
$entry
);
}
@@ -332,9 +518,8 @@ switch($serendipity['GET']['adminAction']) {
$entry = serendipity_fetchEntry('id', $serendipity['GET']['id'], 1, 1);
serendipity_deleteEntry((int)$serendipity['GET']['id']);
$data['switched_output'] = true;
$data['is_doDelete'] = true;
$data['del_entry'] = sprintf(RIP_ENTRY, $entry['id'] . ' - ' . htmlspecialchars($entry['title']));
printf(RIP_ENTRY, $entry['id'] . ' - ' . htmlspecialchars($entry['title']));
echo '<br />';
$cont_draw = true;
case 'doMultiDelete':
@@ -344,21 +529,18 @@ switch($serendipity['GET']['adminAction']) {
}
$parts = explode(',', $serendipity['GET']['id']);
$data['switched_output'] = true;
$data['del_entry'] = array();
foreach($parts AS $id) {
$id = (int)$id;
if ($id > 0) {
$entry = serendipity_fetchEntry('id', $id, 1, 1);
serendipity_deleteEntry((int)$id);
$data['is_doMultiDelete'] = true;
$data['del_entry'][] = sprintf(RIP_ENTRY, $entry['id'] . ' - ' . htmlspecialchars($entry['title']));
printf(RIP_ENTRY, $entry['id'] . ' - ' . htmlspecialchars($entry['title']));
echo '<br />';
}
}
}
case 'editSelect':
$data['switched_output'] = false;
serendipity_drawList();
break;
@@ -369,11 +551,16 @@ switch($serendipity['GET']['adminAction']) {
$newLoc = '?' . serendipity_setFormToken('url') . '&amp;serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=doDelete&amp;serendipity[id]=' . (int)$serendipity['GET']['id'];
$entry = serendipity_fetchEntry('id', $serendipity['GET']['id'], 1, 1);
$data['switched_output'] = true;
$data['is_delete'] = true;
$data['newLoc'] = $newLoc;
// for smartification printf had to turn into sprintf!!
$data['rip_entry'] = sprintf(DELETE_SURE, $entry['id'] . ' - ' . htmlspecialchars($entry['title']));
printf(DELETE_SURE, $entry['id'] . ' - ' . htmlspecialchars($entry['title']));
?>
<br />
<br />
<div>
<a href="<?php echo htmlspecialchars($_SERVER["HTTP_REFERER"]); ?>" class="serendipityPrettyButton input_button"><?php echo NOT_REALLY; ?></a>
<?php echo str_repeat('&nbsp;', 10); ?>
<a href="<?php echo $newLoc; ?>" class="serendipityPrettyButton input_button"><?php echo DUMP_IT; ?></a>
</div>
<?php
break;
case 'multidelete':
@@ -382,16 +569,22 @@ switch($serendipity['GET']['adminAction']) {
}
$ids = '';
$data['rip_entry'] = array();
foreach($serendipity['POST']['multiDelete'] AS $idx => $id) {
$ids .= (int)$id . ',';
$entry = serendipity_fetchEntry('id', $id, 1, 1);
$data['is_multidelete'] = true;
$data['rip_entry'][] = sprintf(DELETE_SURE, $entry['id'] . ' - ' . htmlspecialchars($entry['title']));
printf(DELETE_SURE, $entry['id'] . ' - ' . htmlspecialchars($entry['title']));
echo '<br />';
}
$newLoc = '?' . serendipity_setFormToken('url') . '&amp;serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=doMultiDelete&amp;serendipity[id]=' . $ids;
$data['switched_output'] = true;
$data['newLoc'] = $newLoc;
?>
<br />
<br />
<div>
<a href="<?php echo htmlspecialchars($_SERVER["HTTP_REFERER"]); ?>" class="serendipityPrettyButton input_button "><?php echo NOT_REALLY; ?></a>
<?php echo str_repeat('&nbsp;', 10); ?>
<a href="<?php echo $newLoc; ?>" class="serendipityPrettyButton input_button"><?php echo DUMP_IT; ?></a>
</div>
<?php
break;
case 'edit':
@@ -399,7 +592,7 @@ switch($serendipity['GET']['adminAction']) {
default:
include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
// edit entry mode
serendipity_printEntryForm(
'?',
array(
@@ -410,20 +603,5 @@ switch($serendipity['GET']['adminAction']) {
(isset($entry) ? $entry : array())
);
}
$data['get'] = $serendipity['GET']; // don't trust {$smarty.get.vars} if not proofed, as we often change GET vars via serendipty['GET'] by runtime
// make sure we've got these
if(!isset($data['urltoken'])) $data['urltoken'] = serendipity_setFormToken('url');
if(!isset($data['formtoken'])) $data['formtoken'] = serendipity_setFormToken();
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/entries.inc.tpl";
$content = $serendipity['smarty']->fetch('file:'. $tfile);
echo $content;
/* vim: set sts=4 ts=4 expandtab : */
?>
+5 -8
View File
@@ -1,15 +1,12 @@
<?php # $Id$
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
/* vim: set sts=4 ts=4 expandtab : */
if (IN_serendipity !== true) {
die ('Don\'t hack!');
}
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
echo WELCOME_BACK . ' ' . htmlspecialchars($_SESSION['serendipityUser']);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/entries_overview.inc.tpl";
$serendipity['smarty']->display('file:'. $tfile);
/* vim: set sts=4 ts=4 expandtab : */
?>
+8 -8
View File
@@ -1,15 +1,15 @@
<?php # $Id$
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
if (IN_serendipity !== true) {
die ("Don't hack!");
}
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/export.inc.tpl";
$serendipity['smarty']->display('file:'. $tfile);
?>
<div>
<a href="<?php echo $serendipity['baseURL'] ?>rss.php?version=2.0&all=1" class="serendipityPrettyButton input_button"><?php echo EXPORT_FEED; ?></a>
</div>
<?php
/* vim: set sts=4 ts=4 expandtab : */
?>
+206 -79
View File
@@ -1,4 +1,6 @@
<?php # $Id:$
<?php # $Id: users.inc.php 114 2005-05-22 15:37:11Z garvinhicking $
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
if (IN_serendipity !== true) {
die ('Don\'t hack!');
@@ -8,14 +10,11 @@ if (!serendipity_checkPermission('adminUsersGroups')) {
return;
}
$data = array();
/* Delete a group */
if (isset($_POST['DELETE_YES']) && serendipity_checkFormToken()) {
$group = serendipity_fetchGroup($serendipity['POST']['group']);
serendipity_deleteGroup($serendipity['POST']['group']);
$data['delete_yes'] = true;
$data['group_id'] = $serendipity['POST']['group'];
$data['group'] = $group;
printf('<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . DELETED_GROUP . '</div>', htmlspecialchars($serendipity['POST']['group']), htmlspecialchars($group['name']));
}
/* Save new group */
@@ -23,9 +22,7 @@ if (isset($_POST['SAVE_NEW']) && serendipity_checkFormToken()) {
$serendipity['POST']['group'] = serendipity_addGroup($serendipity['POST']['name']);
$perms = serendipity_getAllPermissionNames();
serendipity_updateGroupConfig($serendipity['POST']['group'], $perms, $serendipity['POST'], false, $serendipity['POST']['forbidden_plugins'], $serendipity['POST']['forbidden_hooks']);
$data['save_new'] = true;
$data['group_id'] = $serendipity['POST']['group'];
$data['group'] = $group;
printf('<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . CREATED_GROUP . '</div>', '#' . htmlspecialchars($serendipity['POST']['group']) . ', ' . htmlspecialchars($serendipity['POST']['name']));
}
@@ -33,103 +30,233 @@ if (isset($_POST['SAVE_NEW']) && serendipity_checkFormToken()) {
if (isset($_POST['SAVE_EDIT']) && serendipity_checkFormToken()) {
$perms = serendipity_getAllPermissionNames();
serendipity_updateGroupConfig($serendipity['POST']['group'], $perms, $serendipity['POST'], false, $serendipity['POST']['forbidden_plugins'], $serendipity['POST']['forbidden_hooks']);
$data['save_edit'] = true;
$data['name'] = $serendipity['POST']['name'];
printf('<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . MODIFIED_GROUP . '</div>', htmlspecialchars($serendipity['POST']['name']));
}
if ( $serendipity['GET']['adminAction'] != 'delete' ) {
$data['delete'] = false;
?>
<table width="100%">
<tr>
<td><strong><?php echo GROUP; ?></strong></td>
<td width="200">&nbsp;</td>
</tr>
<tr>
<td colspan="3">
<?php
if (serendipity_checkPermission('adminUsersMaintainOthers')) {
$groups = serendipity_getAllGroups();
} elseif (serendipity_checkPermission('adminUsersMaintainSame')) {
$groups = serendipity_getAllGroups($serendipity['authorid']);
} else {
$groups = array();
}
$i = 0;
foreach($groups as $group) {
?>
<div class="serendipity_admin_list_item serendipity_admin_list_item_<?php echo ($i++ % 2) ? 'even' : 'uneven' ?>">
<table width="100%">
<tr>
<td><?php echo htmlspecialchars($group['name']); ?></td>
<td width="200" align="right"> <a href="?serendipity[adminModule]=groups&amp;serendipity[adminAction]=edit&amp;serendipity[group]=<?php echo $group['id'] ?>" title="<?php echo EDIT . " " . htmlspecialchars($group['name']); ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/edit.png'); ?>" alt="<?php echo EDIT . " " . htmlspecialchars($group['name']); ?>" /><?php echo EDIT ?></a>
<a href="?<?php echo serendipity_setFormToken('url'); ?>&amp;serendipity[adminModule]=groups&amp;serendipity[adminAction]=delete&amp;serendipity[group]=<?php echo $group['id'] ?>" title="<?php echo DELETE . " " . htmlspecialchars($group['name']); ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/delete.png'); ?>" alt="<?php echo DELETE . " " . htmlspecialchars($group['name']); ?>" /><?php echo DELETE ?></a></td>
</tr>
</table>
</div>
<?php
}
?>
</td>
</tr>
<?php if ( !isset($_POST['NEW']) ) { ?>
<tr>
<td colspan="3" align="right">
<form action="?serendipity[adminModule]=groups" method="post">
<input type="submit" name="NEW" value="<?php echo CREATE_NEW_GROUP; ?>" class="serendipityPrettyButton input_button" />
</form>
</td>
</tr>
<?php } ?>
</table>
if (serendipity_checkPermission('adminUsersMaintainOthers')) {
$groups = serendipity_getAllGroups();
} elseif (serendipity_checkPermission('adminUsersMaintainSame')) {
$groups = serendipity_getAllGroups($serendipity['authorid']);
} else {
$groups = array();
}
$data['groups'] = $groups;
if ( !isset($_POST['NEW']) ) {
$data['start'] = true;
}
$data['deleteFormToken'] = serendipity_setFormToken('url');
<?php
}
if ($serendipity['GET']['adminAction'] == 'edit' || isset($_POST['NEW'])) {
if (isset($_POST['NEW'])) {
$data['new'] = true;
} else {
$data['edit'] = true;
}
$data['formToken'] = serendipity_setFormToken();
if ($serendipity['GET']['adminAction'] == 'edit') {
$group = serendipity_fetchGroup($serendipity['GET']['group']);
$from = &$group;
} else {
$from = array();
}
$data['from'] = $from;
?>
<br />
<br />
<hr noshade="noshade">
<form action="?serendipity[adminModule]=groups" method="post">
<?php echo serendipity_setFormToken(); ?>
<div>
<h3>
<?php
if ($serendipity['GET']['adminAction'] == 'edit') {
$group = serendipity_fetchGroup($serendipity['GET']['group']);
echo EDIT;
$from = &$group;
echo '<input type="hidden" name="serendipity[group]" value="' . $from['id'] . '" />';
} else {
echo CREATE;
$from = array();
}
?>
</h3>
<table>
<tr>
<td><?php echo NAME; ?></td>
<td><input class="input_textbox" type="text" name="serendipity[name]" value="<?php echo htmlspecialchars($from['name']); ?>" /></td>
</tr>
<tr>
<td valign="top"><?php echo USERCONF_GROUPS; ?></td>
<td><select name="serendipity[members][]" multiple="multiple" size="5">
<?php
$allusers = serendipity_fetchUsers();
$users = serendipity_getGroupUsers($from['id']);
$allusers = serendipity_fetchUsers();
$users = serendipity_getGroupUsers($from['id']);
$selected = array();
foreach((array)$users AS $user) {
$selected[$user['id']] = true;
}
$data['selected'] = $selected;
$data['allusers'] = $allusers;
$selected = array();
foreach((array)$users AS $user) {
$selected[$user['id']] = true;
}
foreach($allusers AS $user) {
echo '<option value="' . (int)$user['authorid'] . '" ' . (isset($selected[$user['authorid']]) ? 'selected="selected"' : '') . '>' . htmlspecialchars($user['realname']) . '</option>' . "\n";
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<?php
$perms = serendipity_getAllPermissionNames();
ksort($perms);
$data['perms'] = $perms;
foreach($perms AS $perm => $userlevels) {
if (defined('PERMISSION_' . strtoupper($perm))) {
$data['perms'][$perm]['permission_name'] = constant('PERMISSION_' . strtoupper($perm));
} else {
$data['perms'][$perm]['permission_name'] = $perm;
if (substr($perm, 0, 2) == 'f_') {
continue;
}
if (!serendipity_checkPermission($perm) && $perm != 'hiddenGroup') {
$data['perms'][$perm]['permission'] = false;
if (isset($from[$perm]) && $from[$perm] === 'true') {
$selected = 'checked="checked"';
} else {
$data['perms'][$perm]['permission'] = true;
$selected = '';
}
if (!isset($section)) {
$section = $perm;
}
if ($section != $perm && substr($perm, 0, strlen($section)) == $section) {
$indent = '&nbsp;&nbsp;';
$indentB = '';
} elseif ($section != $perm) {
$indent = '<br />';
$indentB = '<br />';
$section = $perm;
}
if (defined('PERMISSION_' . strtoupper($perm))) {
$permname = constant('PERMISSION_' . strtoupper($perm));
} else {
$permname = $perm;
}
if (!serendipity_checkPermission($perm) && $perm != 'hiddenGroup') {
echo "<tr>\n";
echo "<td>$indent" . htmlspecialchars($permname) . "</td>\n";
echo '<td>' . $indentB . ' ' . (!empty($selected) ? YES : NO) . '</td>' . "\n";
echo "</tr>\n";
} else {
echo "<tr>\n";
echo "<td>$indent<label for=\"" . htmlspecialchars($perm) . "\">" . htmlspecialchars($permname) . "</label></td>\n";
echo '<td>' . $indentB . '<input class="input_checkbox" id="' . htmlspecialchars($perm) . '" type="checkbox" name="serendipity[' . htmlspecialchars($perm) . ']" value="true" ' . $selected . ' /></td>' . "\n";
echo "</tr>\n";
}
}
if ($serendipity['enablePluginACL']) {
$data['enablePluginACL'] = true;
$allplugins =& serendipity_plugin_api::get_event_plugins();
$allhooks = array();
$data['allplugins'] = $allplugins;
foreach($allplugins AS $plugid => $currentplugin) {
foreach($currentplugin['b']->properties['event_hooks'] AS $hook => $set) {
$allhooks[$hook] = true;
}
$data['allplugins'][$plugid]['has_permission'] = serendipity_hasPluginPermissions($plugid, $from['id']);
}
ksort($allhooks);
$data['allhooks'] = $allhooks;
foreach($allhooks AS $hook => $set) {
$data['allhooks'][$hook]['has_permission'] = serendipity_hasPluginPermissions($hook, $from['id']);
}
?>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td valign="top"><?php echo PERMISSION_FORBIDDEN_PLUGINS; ?></td>
<td>
<select name="serendipity[forbidden_plugins][]" multiple="multiple" size="5">
<?php
foreach($allplugins AS $plugid => $currentplugin) {
foreach($currentplugin['b']->properties['event_hooks'] AS $hook => $set) {
$allhooks[$hook] = true;
}
echo '<option value="' . urlencode($plugid) . '" ' . (serendipity_hasPluginPermissions($plugid, $from['id']) ? '' : 'selected="selected"') . '>' . htmlspecialchars($currentplugin['b']->properties['name']) . '</option>' . "\n";
}
ksort($allhooks);
?>
</select>
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td valign="top"><?php echo PERMISSION_FORBIDDEN_HOOKS; ?></td>
<td>
<select name="serendipity[forbidden_hooks][]" multiple="multiple" size="5">
<?php
foreach($allhooks AS $hook => $set) {
echo '<option value="' . urlencode($hook) . '" ' . (serendipity_hasPluginPermissions($hook, $from['id']) ? '' : 'selected="selected"') . '>' . htmlspecialchars($hook) . '</option>' . "\n";
}
?>
</select>
</td>
</tr>
<?php
} else {
?>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><?php echo PERMISSION_FORBIDDEN_ENABLE_DESC; ?></td>
</tr>
<?php
}
?>
</table>
<?php
if ($serendipity['GET']['adminAction'] == 'edit') { ?>
<input type="submit" name="SAVE_EDIT" value="<?php echo SAVE; ?>" class="serendipityPrettyButton input_button" />
<?php echo ' - ' . WORD_OR . ' - ' ?>
<input type="submit" name="SAVE_NEW" value="<?php echo CREATE_NEW_GROUP; ?>" class="serendipityPrettyButton input_button" />
<?php } else { ?>
<input type="submit" name="SAVE_NEW" value="<?php echo CREATE_NEW_GROUP; ?>" class="serendipityPrettyButton input_button" />
<?php } ?>
</div>
</form>
<?php
} elseif ($serendipity['GET']['adminAction'] == 'delete') {
$data['delete'] = true;
$group = serendipity_fetchGroup($serendipity['GET']['group']);
$data['group_id'] = $serendipity['GET']['group'];
$data['group'] = $group;
$data['formToken'] = serendipity_setFormToken();
?>
<form action="?serendipity[adminModule]=groups" method="post">
<div>
<?php printf(DELETE_GROUP, (int)$serendipity['GET']['group'], htmlspecialchars($group['name'])); ?>
<br /><br />
<?php echo serendipity_setFormToken(); ?>
<input type="hidden" name="serendipity[group]" value="<?php echo htmlspecialchars($serendipity['GET']['group']); ?>" />
<input type="submit" name="DELETE_YES" value="<?php echo DUMP_IT; ?>" class="serendipityPrettyButton input_button" />
<input type="submit" name="NO" value="<?php echo NOT_REALLY; ?>" class="serendipityPrettyButton input_button" />
</div>
</form>
<?php
}
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/groups.inc.tpl";
$content = $serendipity['smarty']->fetch('file:'. $tfile);
echo $content;
/* vim: set sts=4 ts=4 expandtab : */
?>
File diff suppressed because it is too large Load Diff
+68 -44
View File
@@ -6,8 +6,6 @@ if (IN_serendipity !== true) {
die ("Don't hack!");
}
$data = array();
if (!serendipity_checkPermission('adminImport')) {
return;
}
@@ -198,41 +196,62 @@ class Serendipity_Import {
}
}
if (isset($serendipity['GET']['importFrom']) && serendipity_checkFormToken()) {
$data['importForm'] = true;
/* Include the importer */
$class = @require_once(S9Y_INCLUDE_PATH . 'include/admin/importers/'. basename($serendipity['GET']['importFrom']) .'.inc.php');
if ( !class_exists($class) ) {
$data['die'] = true;
} else {
/* Init the importer with form data */
$importer = new $class($serendipity['POST']['import']);
/* Yes sir, we are importing if we have valid data */
if ( $importer->validateData() ) {
$data['validateData'] = true;
/* import() MUST return (bool)true, otherwise we assume it failed */
if ( ($result = $importer->import()) !== true ) {
$data['result'] = $result;
}
/* Apprently we do not have valid data, ask for some */
} else {
$data['formToken'] = serendipity_setFormToken();
$fields = $importer->getInputFields();
foreach ($fields as &$field ) {
ob_start();
serendipity_guessInput($field['type'], 'serendipity[import]['. $field['name'] .']', (isset($serendipity['POST']['import'][$field['name']]) ? $serendipity['POST']['import'][$field['name']] : $field['default']), $field['default']);
$field['guessedInput'] = ob_get_contents();
ob_end_clean();
}
$data['fields'] = $fields;
$data['notes'] = $importer->getImportNotes();
}
die('FAILURE: Unable to require import module, possible syntax error?');
}
/* Init the importer with form data */
$importer = new $class($serendipity['POST']['import']);
/* Yes sir, we are importing if we have valid data */
if ( $importer->validateData() ) {
echo IMPORT_STARTING . '<br />';
/* import() MUST return (bool)true, otherwise we assume it failed */
if ( ($result = $importer->import()) !== true ) {
echo IMPORT_FAILED .': '. $result . '<br />';
} else {
echo IMPORT_DONE . '<br />';
}
/* Apprently we do not have valid data, ask for some */
} else {
?>
<?php echo IMPORT_PLEASE_ENTER ?>:<br />
<br />
<form action="" method="POST" enctype="multipart/form-data">
<?php echo serendipity_setFormToken(); ?>
<table cellpadding="3" cellspacing="2">
<?php foreach ( $importer->getInputFields() as $field ) { ?>
<tr>
<td><?php echo $field['text'] ?></td>
<td><?php serendipity_guessInput($field['type'], 'serendipity[import]['. $field['name'] .']', (isset($serendipity['POST']['import'][$field['name']]) ? $serendipity['POST']['import'][$field['name']] : $field['default']), $field['default']) ?></td>
</tr>
<?php } ?>
<?php if ($notes = $importer->getImportNotes()){ ?>
<tr>
<td colspan="2">
<b><?php echo IMPORT_NOTES; ?></b><br />
<?php echo $notes ?>
</td>
</tr>
<?php } ?>
<tr>
<td colspan="2" align="right"><input type="submit" value="<?php echo IMPORT_NOW ?>" class="serendipityPrettyButton input_button"></td>
</tr>
</table>
</form>
<?php
}
} else {
$importpath = S9Y_INCLUDE_PATH . 'include/admin/importers/';
$dir = opendir($importpath);
$list = array();
@@ -250,19 +269,24 @@ if (isset($serendipity['GET']['importFrom']) && serendipity_checkFormToken()) {
}
closedir($dir);
ksort($list);
$data['formToken'] = serendipity_setFormToken();
$data['list'] = $list;
?>
<?php echo IMPORT_WELCOME ?>.<br />
<?php echo IMPORT_WHAT_CAN ?>. <br />
<br />
<?php echo IMPORT_SELECT ?>:<br />
<br />
<form action="" method="GET">
<input type="hidden" name="serendipity[adminModule]" value="import">
<?php echo serendipity_setFormToken(); ?>
<strong><?php echo IMPORT_WEBLOG_APP ?>: </strong>
<select name="serendipity[importFrom]">
<?php foreach ($list as $v=>$k) { ?>
<option value="<?php echo $v ?>"><?php echo $k ?></option>
<?php } ?>
</select>
<input type="submit" value="<?php echo GO ?>" class="serendipityPrettyButton input_button">
</form>
<?php
}
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/import.inc.tpl";
$content = $serendipity['smarty']->fetch('file:'. $tfile);
echo $content;
/* vim: set sts=4 ts=4 expandtab : */
+1 -1
View File
@@ -81,7 +81,7 @@ class Serendipity_Import_b2evolution extends Serendipity_Import {
$b2db = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$b2db) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -1
View File
@@ -83,7 +83,7 @@ class Serendipity_Import_bblog extends Serendipity_Import {
$bblogdb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$bblogdb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -1
View File
@@ -184,7 +184,7 @@ class Serendipity_Import_Blogger extends Serendipity_Import {
'realname' => $author,
'username' => $author,
'userlevel' => 0,
'password' => md5($defaultpass))
'password' => md5($this->data['defaultpass']))
);
$authorid = serendipity_db_insert_id('authors', 'authorid');
$authorList[$authorid] = $author;
+1 -1
View File
@@ -81,7 +81,7 @@ class Serendipity_Import_bmachine extends Serendipity_Import {
$txpdb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$txpdb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -1
View File
@@ -87,7 +87,7 @@ class Serendipity_Import_geeklog extends Serendipity_Import {
$gdb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$gdb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -1
View File
@@ -81,7 +81,7 @@ class Serendipity_Import_lifetype extends Serendipity_Import {
$ltdb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$ltdb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -2
View File
@@ -156,9 +156,8 @@ class Serendipity_Import_LiveJournalXML extends Serendipity_Import {
}
function gatherComments($entrydata) {
$comments;
$comments = array();
if (is_array($entrydata['children'])) {
$comments = array();
foreach($entrydata['children'] AS $idx3 => $commententry) {
if ($commententry['tag'] == 'comment' && is_array($commententry['children'])) {
$comment = array(
+2 -2
View File
@@ -9,7 +9,7 @@
switch ($serendipity['lang']) {
case 'de':
@define('IMPORTER_MT_WARN_PLUGIN', 'Bitte installieren Sie das Plugin "%s"');
@define('IMPORTER_MT_NOTE', 'Falls Sie weiter machen, ohne die Plugins zu installieren, werden möglicherweise Zeilenumbrüche falsch importiert (verdoppelt oder entfernt)');
@define('IMPORTER_MT_NOTE', 'Falls Sie weiter machen, ohne die Plugins zu installieren, werden möglicherweise Zeilenumbrüche falsch importiert (verdoppelt oder entfernt)');
break;
case 'en':
@@ -427,7 +427,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
if ( !sizeof($tasks) || $force == true ) {
serendipity_db_begin_transaction();
foreach ($entries as $entry) {
#echo '<pre>' . printR_($entry, true) . '</pre>';
#echo '<pre>' . print_r($entry, true) . '</pre>';
#continue;
if (empty($entry['authorid'])) {
$entry['authorid'] = $serendipity['authorid'];
+1 -1
View File
@@ -84,7 +84,7 @@ class Serendipity_Import_Nucleus extends Serendipity_Import {
$nucdb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$nucdb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -1
View File
@@ -81,7 +81,7 @@ class Serendipity_Import_nuke extends Serendipity_Import {
$nukedb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$nukedb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -1
View File
@@ -83,7 +83,7 @@ class Serendipity_Import_phpbb extends Serendipity_Import {
$gdb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$gdb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+2 -2
View File
@@ -69,7 +69,7 @@ class Serendipity_Import_Pivot extends Serendipity_Import {
if (!is_dir($this->data['pivot_path']) || !is_readable($this->data['pivot_path'])) {
$check_dir = $serendipity['serendipityPath'] . $this->data['pivot_path'];
if (!is_dir($check_dir) || !is_readable($check_dir)) {
return sprintf(ERROR_NO_DIRECTORY, $this->data['pivot_path']);
return sprintf(ERROR_NO_DIRECTORY, htmlspecialchars($this->data['pivot_path']));
}
$this->data['pivot_path'] = $check_dir;
}
@@ -191,7 +191,7 @@ class Serendipity_Import_Pivot extends Serendipity_Import {
}
echo '</ul>';
} else {
return sprintf(ERROR_NO_DIRECTORY, $this->data['pivot_path']);
return sprintf(ERROR_NO_DIRECTORY, htmlspecialchars($this->data['pivot_path']));
}
return true;
+1 -1
View File
@@ -84,7 +84,7 @@ class Serendipity_Import_pMachine extends Serendipity_Import {
$pmdb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$pmdb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -1
View File
@@ -448,7 +448,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
$s9ydb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$s9ydb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -1
View File
@@ -87,7 +87,7 @@ class Serendipity_Import_smf extends Serendipity_Import {
$gdb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$gdb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -1
View File
@@ -88,7 +88,7 @@ class Serendipity_Import_sunlog extends Serendipity_Import {
$sunlogdb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$sunlogdb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -1
View File
@@ -87,7 +87,7 @@ class Serendipity_Import_textpattern extends Serendipity_Import {
$txpdb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$txpdb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+1 -1
View File
@@ -87,7 +87,7 @@ class Serendipity_Import_WordPress_PG extends Serendipity_Import {
$wpdb = pg_connect("$this->data['host'], $this->data['port'], $this->data['user'], $this->data['pass'], $this->data['name']");
if ( !$wpdb ) {
return sprintf(PGSQL_COULDNT_CONNECT, $this->data['pass']);
return sprintf(PGSQL_COULDNT_CONNECT, htmlspecialchars($this->data['pass']));
}
/* Users */
+1 -1
View File
@@ -94,7 +94,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
$wpdb = @mysql_connect($this->data['host'], $this->data['user'], $this->data['pass']);
if (!$wpdb) {
return sprintf(COULDNT_CONNECT, $this->data['host']);
return sprintf(COULDNT_CONNECT, htmlspecialchars($this->data['host']));
}
if (!@mysql_select_db($this->data['name'])) {
+455 -285
View File
@@ -1,4 +1,6 @@
<?php # $Id$
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
if (IN_serendipity !== true) {
die ("Don't hack!");
@@ -12,11 +14,6 @@ define('S9Y_I_ERROR', -1);
define('S9Y_I_WARNING', 0);
define('S9Y_I_SUCCESS', 1);
// smartification needs to pull everything first for installation and db purposes
//include(S9Y_INCLUDE_PATH . 'serendipity_config.inc.php');
$data = array();
if (defined('S9Y_DATA_PATH')) {
// Shared installation. S9Y_INCLUDE_PATH points to repository,
// S9Y_DATA_PATH points to the local directory.
@@ -26,8 +23,6 @@ if (defined('S9Y_DATA_PATH')) {
$basedir = serendipity_query_default('serendipityPath', false);
}
$data['basedir'] = $basedir;
/**
* Checks a return code constant if it's successfull or an error and return HTML code
*
@@ -40,19 +35,16 @@ $data['basedir'] = $basedir;
* @return string returned String
*/
function serendipity_installerResultDiagnose($result, $s) {
global $errorCount, $data;
global $errorCount;
if ( $result === S9Y_I_SUCCESS ) {
$data['i_success'] = true; // we dont need data here explicitely, but we keep it for possible future purposes
return '<span class="msg_success">'. $s .'</span>';
return '<span class="serendipityAdminMsgSuccessInstall" style="color: green; font-weight: bold">'. $s .'</span>';
}
if ( $result === S9Y_I_WARNING ) {
$data['i_warning'] = true;
return '<span class="msg_notice">'. $s .' [?]</span>';
return '<span class="serendipityAdminMsgWarningInstall" style="color: orange; font-weight: bold">'. $s .' [?]</span>';
}
if ( $result === S9Y_I_ERROR ) {
$errorCount++;
$data['i_error'] = true;
return '<span class="msg_error">'. $s .' [!]</span>';
return '<span class="serendipityAdminMsgErrorInstall" style="color: red; font-weight: bold">'. $s .' [!]</span>';
}
}
@@ -64,7 +56,7 @@ if (!empty($serendipity['POST']['getstep']) && is_numeric($serendipity['POST']['
}
/* From configuration to install */
if ( sizeof($_POST) > 1 && (int)$serendipity['GET']['step'] == 3 ) {
if ( sizeof($_POST) > 1 && $serendipity['GET']['step'] == 3 ) {
/* One problem, if the user chose to do an easy install, not all config vars has been transfered
Therefore we fetch all config vars with their default values, and merge them with our POST data */
@@ -78,8 +70,10 @@ if ( sizeof($_POST) > 1 && (int)$serendipity['GET']['step'] == 3 ) {
}
if ( is_array($errors = serendipity_checkInstallation()) ) {
$data['is_errors'] = true;
$data['errors'] = $errors;
foreach ( $errors as $error ) {
echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />'. $error .'</div>';
}
$from = $_POST;
/* Back to configuration, user did something wrong */
$serendipity['GET']['step'] = $serendipity['POST']['step'];
@@ -89,266 +83,451 @@ if ( sizeof($_POST) > 1 && (int)$serendipity['GET']['step'] == 3 ) {
}
}
$data['s9yGETstep'] = $serendipity['GET']['step'];
if ( (int)$serendipity['GET']['step'] == 0 ) {
$data['getstepint0'] = true;
$data['print_ERRORS_ARE_DISPLAYED_IN'] = sprintf(ERRORS_ARE_DISPLAYED_IN, serendipity_installerResultDiagnose(S9Y_I_ERROR, RED), serendipity_installerResultDiagnose(S9Y_I_WARNING, YELLOW), serendipity_installerResultDiagnose(S9Y_I_SUCCESS, GREEN));
$data['s9yversion'] = $serendipity['version'];
?>
<?php echo WELCOME_TO_INSTALLATION ?>.
<br /><?php echo FIRST_WE_TAKE_A_LOOK ?>.
<br /><?php echo sprintf(ERRORS_ARE_DISPLAYED_IN, serendipity_installerResultDiagnose(S9Y_I_ERROR, RED), serendipity_installerResultDiagnose(S9Y_I_WARNING, YELLOW), serendipity_installerResultDiagnose(S9Y_I_SUCCESS, GREEN)); ?>.
<br />
<br>
<div align="center">- <?php echo sprintf(PRE_INSTALLATION_REPORT, $serendipity['version']) ?> -</div><br />
$errorCount = 0;
if (is_readable(S9Y_INCLUDE_PATH . 'checksums.inc.php')) {
$badsums = serendipity_verifyFTPChecksums();
if (empty($badsums)) {
$data['installerResultDiagnose_CHECKSUMS'][] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, CHECKSUMS_PASS);
} else {
foreach ($badsums as $file => $sum) {
$data['installerResultDiagnose_CHECKSUMS'][] = serendipity_installerResultDiagnose(S9Y_I_WARNING, sprintf(CHECKSUM_FAILED, $file));
}
}
} else {
$data['installerResultDiagnose_CHECKSUMS'][] = serendipity_installerResultDiagnose(S9Y_I_WARNING, CHECKSUMS_NOT_FOUND);
<?php $errorCount = 0 ?>
<div align="center">
<table class="serendipity_admin_list_item serendipity_admin_list_item_even" width="90%" align="center">
<tr>
<td colspan="2" style="font-weight: bold"><?php echo INTEGRITY ?></td>
</tr>
<?php if (is_readable(S9Y_INCLUDE_PATH . 'checksums.inc.php')) {
$badsums = serendipity_verifyFTPChecksums();
?>
<?php if (empty($badsums)) {?>
<tr>
<td colspan="2"><?php echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, CHECKSUMS_PASS); ?></td>
</tr>
<?php } else {
foreach ($badsums as $file => $sum) {
?>
<tr>
<td colspan="2"><?php echo serendipity_installerResultDiagnose(S9Y_I_WARNING, sprintf(CHECKSUM_FAILED, $file)); ?></td>
</tr>
<?php }
}
$data['php_uname'] = php_uname('s') .' '. php_uname('r') .', '. php_uname('m');
$data['php_sapi_name'] = php_sapi_name();
if ( version_compare(phpversion(), '5.2.6', '>=') ) {
$data['installerResultDiagnose_VERSION'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES .', '. phpversion());
} else {
$data['installerResultDiagnose_VERSION'] = serendipity_installerResultDiagnose(S9Y_I_ERROR, NO);
}
if ( sizeof(($_res = serendipity_probeInstallation('dbType'))) == 0 ) {
$data['installerResultDiagnose_DBTYPE'] = serendipity_installerResultDiagnose(S9Y_I_ERROR, NONE);
} else {
$data['installerResultDiagnose_DBTYPE'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, implode(', ', $_res));
}
if ( extension_loaded('session') ) {
$data['installerResultDiagnose_SESSION'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
$data['installerResultDiagnose_SESSION'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, NO);
}
if ( extension_loaded('pcre') ) {
$data['installerResultDiagnose_PCRE'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
$data['installerResultDiagnose_PCRE'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, NO);
}
if ( extension_loaded('gd') ) {
$data['installerResultDiagnose_GD'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
$data['installerResultDiagnose_GD'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
}
if ( extension_loaded('openssl') ) {
$data['installerResultDiagnose_OPENSSL'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
$data['installerResultDiagnose_OPENSSL'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
}
if ( extension_loaded('mbstring') ) {
$data['installerResultDiagnose_MBSTR'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
$data['installerResultDiagnose_MBSTR'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
}
if ( extension_loaded('iconv') ) {
$data['installerResultDiagnose_ICONV'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
$data['installerResultDiagnose_ICONV'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
}
if ( extension_loaded('zlib') ) {
$data['installerResultDiagnose_ZLIB'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
$data['installerResultDiagnose_ZLIB'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
}
if ($binary = serendipity_query_default('convert', false)) {
$data['installerResultDiagnose_IM'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, $binary);
} else {
$data['installerResultDiagnose_IM'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, NOT_FOUND);
}
if ( !serendipity_ini_bool(ini_get('safe_mode')) ) {
$data['installerResultDiagnose_SSM'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
} else {
$data['installerResultDiagnose_SSM'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
}
if ( serendipity_ini_bool(ini_get('register_globals')) ) {
$data['installerResultDiagnose_SRG'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
} else {
$data['installerResultDiagnose_SRG'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
}
if ( !serendipity_ini_bool(ini_get('magic_quotes_gpc')) ) {
$data['installerResultDiagnose_SMQG'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
} else {
$data['installerResultDiagnose_SMQG'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
}
if ( !serendipity_ini_bool(ini_get('magic_quotes_runtime')) ) {
$data['installerResultDiagnose_SMQR'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
} else {
$data['installerResultDiagnose_SMQR'] = serendipity_installerResultDiagnose(S9Y_I_ERROR, 'ON');
}
if ( !serendipity_ini_bool(ini_get('session.use_trans_sid')) ) {
$data['installerResultDiagnose_SSUTS'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
} else {
$data['installerResultDiagnose_SSUTS'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
}
if ( serendipity_ini_bool(ini_get('allow_url_fopen')) ) {
$data['installerResultDiagnose_SAUF'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'ON');
} else {
$data['installerResultDiagnose_SAUF'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, 'OFF');
}
if ( serendipity_ini_bool(ini_get('file_uploads')) ) {
$data['installerResultDiagnose_SFU'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'ON');
} else {
$data['installerResultDiagnose_SFU'] = serendipity_installerResultDiagnose(S9Y_I_ERROR, 'OFF');
}
if ( serendipity_ini_bytesize(ini_get('post_max_size')) >= (10*1024*1024) ) {
$data['installerResultDiagnose_SPMS'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, ini_get('post_max_size'));
} else {
$data['installerResultDiagnose_SPMS'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, ini_get('post_max_size'));
}
if ( serendipity_ini_bytesize(ini_get('upload_max_filesize')) >= (10*1024*1024) ) {
$data['installerResultDiagnose_SUMF'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, ini_get('upload_max_filesize'));
} else {
$data['installerResultDiagnose_SUMF'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, ini_get('upload_max_filesize'));
}
if ( serendipity_ini_bytesize(ini_get('memory_limit')) >= ((PHP_INT_SIZE == 4 ? 8 : 16)*1024*1024) ) {
$data['installerResultDiagnose_SML'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, ini_get('memory_limit'));
} else {
$data['installerResultDiagnose_SML'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, ini_get('memory_limit'));
}
$basewritable = False;
if ( is_writable($basedir) ) {
$data['installerResultDiagnose_WRITABLE'][] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
$basewritable = True;
} else {
#Figure out if we already have all we need
#PATH_SMARTY_COMPILE/
#uploads/
#archives/
#.htaccess
#serendipity_config_local.inc.php
# For completeness we could test to make sure the directories
# really are directories, but that's probably overkill
foreach (array('archives/', PATH_SMARTY_COMPILE . '/', 'uploads/', '.htaccess', 'serendipity_config_local.inc.php') as $path) {
if (!is_writeable($basedir . $path)) {
$data['installerResultDiagnose_WRITABLE'][] = serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
$showWritableNote = true;
break;
}
}
if (!$showWritableNote) {
$data['installerResultDiagnose_WRITABLE'][] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
}
}
if ( is_writable($basedir . PATH_SMARTY_COMPILE) ) {
$data['installerResultDiagnose_COMPILE'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
} else {
if ($basewritable && !is_dir($basedir . PATH_SMARTY_COMPILE)) {
$data['installerResultDiagnose_COMPILE'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
#This directory will be created later in the process
} else {
$data['installerResultDiagnose_COMPILE'] = serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
$showWritableNote = true;
}
}
if ( is_writable($basedir . 'archives/') ) {
$data['installerResultDiagnose_ARCHIVES'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
} else {
if ($basewritable && !is_dir($basedir . 'archives/')) {
$data['installerResultDiagnose_ARCHIVES'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
#This directory will be created later in the process
} else {
$data['installerResultDiagnose_ARCHIVES'] = serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
$showWritableNote = true;
}
}
if ( is_writable($basedir . 'plugins/') ) {
$data['installerResultDiagnose_PLUGINS'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
} else {
$data['installerResultDiagnose_PLUGINS'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, NOT_WRITABLE . NOT_WRITABLE_SPARTACUS);
}
if ( is_dir($basedir .'uploads/') ) {
$data['is_dir_uploads'] = true;
if ( is_writable($basedir . 'uploads/') ) {
$data['installerResultDiagnose_UPLOADS'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
} else {
if ($basewritable && !is_dir($basedir . 'uploads/')) {
$data['installerResultDiagnose_UPLOADS'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
#This directory will be created later in the process
} else { ?>
<tr>
<td colspan="2"><?php echo serendipity_installerResultDiagnose(S9Y_I_WARNING, CHECKSUMS_NOT_FOUND); ?></td>
</tr>
<?php } ?>
</table>
<table class="serendipity_admin_list_item serendipity_admin_list_item_even" width="90%" align="center">
<tr>
<td colspan="2" style="font-weight: bold"><?php echo PHP_INSTALLATION ?></td>
</tr>
<tr>
<td><?php echo OPERATING_SYSTEM ?></td>
<td><?php echo php_uname('s') .' '. php_uname('r') .', '. php_uname('m') ?></td>
</tr>
<tr>
<td><?php echo WEBSERVER_SAPI ?></td>
<td><?php echo php_sapi_name() ?></td>
</tr>
<tr>
<td>PHP version >= 5.2.6</td>
<td width="200"><?php
if ( version_compare(phpversion(), '5.2.6', '>=') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES .', '. phpversion());
} else {
$data['installerResultDiagnose_UPLOADS'] = serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
$showWritableNote = true;
echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NO);
}
}
}
?></td>
</tr>
<tr>
<td>Database extensions</td>
<td width="200"><?php
if (function_exists('is_executable')) {
$data['is_imb_executable'] = true;
if ($binary = serendipity_query_default('convert', false)) {
if (is_executable($binary)) {
$data['installerResultDiagnose_IMB'] = serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
if ( sizeof(($_res = serendipity_probeInstallation('dbType'))) == 0 ) {
echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NONE);
} else {
$data['installerResultDiagnose_IMB'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, implode(', ', $_res));
}
} else {
$data['installerResultDiagnose_IMB'] = serendipity_installerResultDiagnose(S9Y_I_WARNING, NOT_FOUND);
}
}
?></td>
</tr>
<tr>
<td>Session extension</td>
<td width="200"><?php
if ( extension_loaded('session') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, NO);
}
?></td>
</tr>
<tr>
<td>PCRE extension</td>
<td width="200"><?php
if ( extension_loaded('pcre') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, NO);
}
?></td>
</tr>
<tr>
<td>GDlib extension</td>
<td width="200"><?php
if ( extension_loaded('gd') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
}
?></td>
</tr>
<tr>
<td>OpenSSL extension</td>
<td><?php
if ( extension_loaded('openssl') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
}
?></td>
</tr>
<tr>
<td>mbstring extension</td>
<td width="200"><?php
if ( extension_loaded('mbstring') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
}
?></td>
</tr>
<tr>
<td>iconv extension</td>
<td width="200"><?php
if ( extension_loaded('iconv') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
}
?></td>
</tr>
<tr>
<td>zlib extension</td>
<td width="200"><?php
if ( extension_loaded('zlib') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
}
?></td>
</tr>
<tr>
<td>Imagemagick binary </td>
<td><?php
if ($binary = serendipity_query_default('convert', false)) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, $binary);
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NOT_FOUND);
}
?></td>
</tr>
</table>
<br />
<table class="serendipity_admin_list_item serendipity_admin_list_item_even" width="90%" align="center">
<tr>
<td colspan="3" style="font-weight: bold"><?PHP echo PHPINI_CONFIGURATION ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td width="150"><em><?php echo RECOMMENDED ?></em></td>
<td width="150"><em><?php echo ACTUAL ?></em></td>
</tr>
<tr>
<td>safe_mode</td>
<td width="150"><strong><?php echo 'OFF' ?></strong></td>
<td width="150"><?php
if ( !serendipity_ini_bool(ini_get('safe_mode')) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
}
?></td>
</tr>
<tr>
<td>register_globals</td>
<td width="150"><strong><?php echo 'OFF' ?></strong></td>
<td width="150"><?php
if ( serendipity_ini_bool(ini_get('register_globals')) ) {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
} else {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
}
?></td>
</tr>
<tr>
<td>magic_quotes_gpc</td>
<td width="150"><strong><?php echo 'OFF' ?></strong></td>
<td width="150"><?php
if ( !serendipity_ini_bool(ini_get('magic_quotes_gpc')) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
}
?></td>
</tr>
<tr>
<td>magic_quotes_runtime</td>
<td width="150"><strong><?php echo 'OFF' ?></strong></td>
<td width="150"><?php
if ( !serendipity_ini_bool(ini_get('magic_quotes_runtime')) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
} else {
echo serendipity_installerResultDiagnose(S9Y_I_ERROR, 'ON');
}
?></td>
</tr>
<tr>
<td>session.use_trans_sid</td>
<td width="150"><strong><?php echo 'OFF' ?></strong></td>
<td width="150"><?php
if ( !serendipity_ini_bool(ini_get('session.use_trans_sid')) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'OFF');
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, 'ON');
}
?></td>
</tr>
<tr>
<td>allow_url_fopen</td>
<td width="150"><strong><?php echo 'ON' ?></strong></td>
<td width="150"><?php
if ( serendipity_ini_bool(ini_get('allow_url_fopen')) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'ON');
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, 'OFF');
}
?></td>
</tr>
<tr>
<td>file_uploads</td>
<td width="150"><strong><?php echo 'ON' ?></strong></td>
<td width="150"><?php
if ( serendipity_ini_bool(ini_get('file_uploads')) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, 'ON');
} else {
echo serendipity_installerResultDiagnose(S9Y_I_ERROR, 'OFF');
}
?></td>
</tr>
<tr>
<td>post_max_size</td>
<td width="150"><strong>10M</strong></td>
<td width="150"><?php
if ( serendipity_ini_bytesize(ini_get('post_max_size')) >= (10*1024*1024) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, ini_get('post_max_size'));
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, ini_get('post_max_size'));
}
?></td>
</tr>
<tr>
<td>upload_max_filesize</td>
<td width="150"><strong>10M</strong></td>
<td width="150"><?php
if ( serendipity_ini_bytesize(ini_get('upload_max_filesize')) >= (10*1024*1024) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, ini_get('upload_max_filesize'));
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, ini_get('upload_max_filesize'));
}
?></td>
</tr>
<tr>
<td>memory_limit</td>
<td width="150"><strong><?php echo (PHP_INT_SIZE == 4 ? '8M' : '16M'); ?></strong></td>
<td width="150"><?php
if ( serendipity_ini_bytesize(ini_get('memory_limit')) >= ((PHP_INT_SIZE == 4 ? 8 : 16)*1024*1024) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, ini_get('memory_limit'));
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, ini_get('memory_limit'));
}
?></td>
</tr>
$data['showWritableNote'] = $showWritableNote;
$data['errorCount'] = $errorCount;
</table>
} elseif ( $serendipity['GET']['step'] == '2a' ) {
<br />
<table class="serendipity_admin_list_item serendipity_admin_list_item_even" width="90%" align="center">
<tr>
<td colspan="2" style="font-weight: bold"><?php echo PERMISSIONS ?></td>
</tr>
<tr>
<td style="vertical-align: top"><?php echo $basedir ?></td>
<td width="200"><?php
$basewritable = False;
if ( is_writable($basedir) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
$basewritable = True;
} else {
#Figure out if we already have all we need
#PATH_SMARTY_COMPILE/
#uploads/
#archives/
#.htaccess
#serendipity_config_local.inc.php
# For completeness we could test to make sure the directories
# really are directories, but that's probably overkill
foreach (array('archives/', PATH_SMARTY_COMPILE . '/', 'uploads/', '.htaccess', 'serendipity_config_local.inc.php') as $path) {
if (!is_writeable($basedir . $path)) {
echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
$showWritableNote = true;
break;
}
}
if (!$showWritableNote) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
}
}
?></td>
</tr>
<tr>
<td style="vertical-align: top"><?php echo $basedir . PATH_SMARTY_COMPILE?></td>
<td width="200"><?php
if ( is_writable($basedir . PATH_SMARTY_COMPILE) ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
} else {
if ($basewritable && !is_dir($basedir . PATH_SMARTY_COMPILE)) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
#This directory will be created later in the process
} else {
echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
$showWritableNote = true;
}
}
?></td>
</tr>
<tr>
<td style="vertical-align: top"><?php echo $basedir . 'archives/'?></td>
<td width="200"><?php
if ( is_writable($basedir . 'archives/') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
} else {
if ($basewritable && !is_dir($basedir . 'archives/')) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
#This directory will be created later in the process
} else {
echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
$showWritableNote = true;
}
}
?></td>
</tr>
<tr>
<td style="vertical-align: top"><?php echo $basedir . 'plugins/'?></td>
<td width="200"><?php
if ( is_writable($basedir . 'plugins/') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NOT_WRITABLE . NOT_WRITABLE_SPARTACUS);
}
?></td>
</tr>
<?php if ( is_dir($basedir .'uploads/') ) { ?>
<tr>
<td style="vertical-align: top"><?php echo $basedir . 'uploads/'?></td>
<td width="200"><?php
if ( is_writable($basedir . 'uploads/') ) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
} else {
if ($basewritable && !is_dir($basedir . 'uploads/')) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
#This directory will be created later in the process
} else {
echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
$showWritableNote = true;
}
}
?></td>
</tr>
<?php } ?>
<?php if (function_exists('is_executable')) { ?>
<tr>
<td style="vertical-align: top">Execute Imagemagick binary </td>
<td><?php
if ($binary = serendipity_query_default('convert', false)) {
if (is_executable($binary)) {
echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, YES);
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NO);
}
} else {
echo serendipity_installerResultDiagnose(S9Y_I_WARNING, NOT_FOUND);
}
?></td>
</tr>
<?php } ?>
</table>
<?php if ( $showWritableNote === true ) { ?>
<div class="serendipityAdminMsgNote"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="<?php echo serendipity_getTemplateFile('admin/img/admin_msg_note.png'); ?>" alt="" /><?php echo sprintf(PROBLEM_PERMISSIONS_HOWTO, 'chmod 1777') ?></div>
<?php } ?>
<div align="center">
<?php if ( $errorCount > 0 ) { ?>
<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="<?php echo serendipity_getTemplateFile('admin/img/admin_msg_error.png'); ?>" alt="" /><?php echo PROBLEM_DIAGNOSTIC ?></div>
<h2><a href="serendipity_admin.php"><?php echo RECHECK_INSTALLATION ?></a></h2>
<?php } else { ?>
<?php echo SELECT_INSTALLATION_TYPE ?>:
<h2><a href="?serendipity[step]=2a"><?php echo SIMPLE_INSTALLATION ?></a> - <a href="?serendipity[step]=2b"><?php echo EXPERT_INSTALLATION ?></a></h2>
<?php } ?>
</div>
</div>
<?php } elseif ( $serendipity['GET']['step'] == '2a' ) { ?>
<form action="?" method="post">
<input type="hidden" name="serendipity[step]" value="<?php echo $serendipity['GET']['step'] ?>">
<input type="hidden" name="serendipity[getstep]" value="3">
<?php
$config = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE, null, array('simpleInstall'));
ob_start();
serendipity_printConfigTemplate($config, $from, true, false, false);
$data['ob_serendipity_printConfigTemplate'] = ob_get_contents();
ob_end_clean();
?>
<div align="center"><input name="submit" type="submit" value="<?php echo COMPLETE_INSTALLATION ?>" class="serendipityPrettyButton input_button"></div>
</form>
} elseif ( $serendipity['GET']['step'] == '2b' ) {
<?php } elseif ( $serendipity['GET']['step'] == '2b' ) { ?>
<form action="?" method="post">
<input type="hidden" name="serendipity[step]" value="<?php echo $serendipity['GET']['step'] ?>">
<input type="hidden" name="serendipity[getstep]" value="3">
<?php
$config = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE);
ob_start();
serendipity_printConfigTemplate($config, $from, true, false, false);
$data['ob_serendipity_printConfigTemplate'] = ob_get_contents();
ob_end_clean();
?>
<div align="center"><input name="submit" type="submit" value="<?php echo COMPLETE_INSTALLATION ?>" class="serendipityPrettyButton input_button"></div>
</form>
} elseif ( (int)$serendipity['GET']['step'] == 3 ) {
<?php } elseif ( (int)$serendipity['GET']['step'] == 3 ) { ?>
<?php
$data['getstepint3'] = true;
$serendipity['dbPrefix'] = $_POST['dbPrefix'];
echo CHECK_DATABASE_EXISTS .'...';
$t = serendipity_db_query("SELECT * FROM {$serendipity['dbPrefix']}authors", false, 'both', false, false, false, true);
$data['authors_query'] = $t;
if ( is_array($t) ) {
// void
echo ' <strong>'. THEY_DO .'</strong>, '. WONT_INSTALL_DB_AGAIN;
echo '<br />';
echo '<br />';
} else {
serendipity_installDatabase();
$data['install_DB'] = true;
echo ' <strong>'. THEY_DONT .'</strong>';
echo '<br />';
echo CREATE_DATABASE;
serendipity_installDatabase();
echo ' <strong>' . DONE . '</strong><br />';
echo sprintf(CREATING_PRIMARY_AUTHOR, htmlspecialchars($_POST['user'])) .'...';
$authorid = serendipity_addAuthor($_POST['user'], $_POST['pass'], $_POST['realname'], $_POST['email'], USERLEVEL_ADMIN, 1);
$mail_comments = (serendipity_db_bool($_POST['want_mail']) ? 1 : 0);
serendipity_set_user_var('mail_comments', $mail_comments, $authorid);
@@ -357,47 +536,38 @@ if ( (int)$serendipity['GET']['step'] == 0 ) {
serendipity_addDefaultGroup('USERLEVEL_EDITOR_DESC', USERLEVEL_EDITOR);
serendipity_addDefaultGroup('USERLEVEL_CHIEF_DESC', USERLEVEL_CHIEF);
serendipity_addDefaultGroup('USERLEVEL_ADMIN_DESC', USERLEVEL_ADMIN);
$data['add_authors'] = true;
echo ' <strong>' . DONE . '</strong><br />';
echo SETTING_DEFAULT_TEMPLATE .'... ';
serendipity_set_config_var('template', $serendipity['defaultTemplate']);
$data['set_template_vars'] = true;
echo ' <strong>' . DONE . '</strong><br />';
echo INSTALLING_DEFAULT_PLUGINS .'... ';
include_once S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php';
serendipity_plugin_api::register_default_plugins();
$data['register_default_plugins'] = true;
echo ' <strong>' . DONE . '</strong><br />';
}
echo sprintf(ATTEMPT_WRITE_FILE, '.htaccess') . '... ';
$errors = serendipity_installFiles($basedir);
$data['errors_sif'] = $errors;
if ( $errors === true ) {
echo ' <strong>' . DONE . '</strong><br />';
} else {
echo ' <strong>' . FAILED . '</strong><br />';
foreach ( $errors as $error ) {
echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . $error .'</div>';
}
}
if ( serendipity_updateConfiguration() ) {
$data['s9y_installed'] = true;
}
echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png'). '" alt="" />' . SERENDIPITY_INSTALLED .'</div>';
echo '<div align="center" style="font-size: large"><a href="'. $_POST['serendipityHTTPPath'] .'">'. VISIT_BLOG_HERE .'</a></div>';
echo '<div align="center">'. THANK_YOU_FOR_CHOOSING .'</div>';
} else {
echo '<div class="serendipityAdminMsgError"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />'. ERROR_DETECTED_IN_INSTALL .'</div>';
}
}
if (!defined('S9Y_FRAMEWORK_FUNCTIONS')) {
include dirname(dirname(__FILE__)) . "/functions.inc.php";
}
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/installer.inc.tpl";
ob_start();
include $tfile;
$content = ob_get_contents();
ob_end_clean();
#$content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up
#echo $content;
// eval a string template and do not store compiled code
echo $serendipity['smarty']->display('eval:'.$content);
/* vim: set sts=4 ts=4 expandtab : */
+16 -13
View File
@@ -1,4 +1,7 @@
<?php # $Id$
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
/* vim: set sts=4 ts=4 expandtab : */
if (IN_serendipity !== true) {
die ("Don't hack!");
@@ -25,7 +28,7 @@ $output = array(
'<a href="http://www.s9y.org/33.html">' . FURTHER_LINKS_S9Y_DOCS . '</a>',
'<a href="http://blog.s9y.org/">' . FURTHER_LINKS_S9Y_BLOG . '</a>',
'<a href="http://www.s9y.org/forums/">' . FURTHER_LINKS_S9Y_FORUMS . '</a>',
'<a href="http://spartacus.s9y.org/">' . FURTHER_LINKS_S9Y_SPARTACUS . '</a>',
'<a href="http://php-blog.sf.net/">' . FURTHER_LINKS_S9Y_SPARTACUS . '</a>',
'<a href="' . $bookmarklet . '" onclick="alert(\'' . FURTHER_LINKS_S9Y_BOOKMARKLET_DESC . '\'); return false;" title="' . FURTHER_LINKS_S9Y_BOOKMARKLET_DESC . '">' . FURTHER_LINKS_S9Y_BOOKMARKLET . '</a>'
),
'links_css' => 'further_links',
@@ -34,16 +37,16 @@ $output = array(
serendipity_plugin_api::hook_event('backend_frontpage_display', $output);
$data['output'] = $output;
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
if ($output['show_links']) {
echo '<div class="' . $output['links_css'] . '">' . "\n";
echo '<p class="further_links_head">' . $output['links_title'] . '</p>' . "\n";
echo '<ul>' . "\n";
foreach($output['links'] AS $link) {
echo '<li>' . $link . '</li>' . "\n";
}
echo '</ul>' . "\n";
echo '<p class="further_links_foot" style="display: none"></p>' . "\n";
echo '</div>' . "\n";
}
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/overview.inc.tpl";
$content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up
echo $content;
/* vim: set sts=4 ts=4 expandtab : */
echo '<h3 class="serendipityWelcomeBack">' . $output['welcome'] . '</h3>';
echo $output['more'];
+17 -26
View File
@@ -6,8 +6,6 @@ if (IN_serendipity !== true) {
die ("Don't hack!");
}
$data = array();
if (!serendipity_checkPermission('personalConfiguration')) {
return;
}
@@ -16,17 +14,16 @@ $from = array();
if ($serendipity['GET']['adminAction'] == 'save' && serendipity_checkFormToken()) {
$config = serendipity_parseTemplate(S9Y_CONFIG_USERTEMPLATE);
$data['adminAction'] = "save";
if ( (!serendipity_checkPermission('adminUsersEditUserlevel') || !serendipity_checkPermission('adminUsersMaintainOthers') )
&& (int)$_POST['userlevel'] > $serendipity['serendipityUserlevel']) {
$data['not_authorized'] = true;
echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . CREATE_NOT_AUTHORIZED_USERLEVEL . '</div>';
} elseif (empty($_POST['username'])) {
$data['empty_username'] = true;
echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . USERCONF_CHECK_USERNAME_ERROR . '</div>';
} elseif (!empty($_POST['password']) && $_POST['check_password'] != $_SESSION['serendipityPassword'] && serendipity_passwordhash($_POST['check_password']) != $_SESSION['serendipityPassword']) {
$data['password_check_fail'] = true;
echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . USERCONF_CHECK_PASSWORD_ERROR . '</div>';
} else {
$valid_groups = serendipity_getGroups($serendipity['authorid'], true);
$data['realname'] = $_POST['realname'];
foreach($config as $category) {
foreach ($category['items'] as $item) {
if (in_array('groups', $item['flags'])) {
@@ -59,7 +56,7 @@ if ($serendipity['GET']['adminAction'] == 'save' && serendipity_checkFormToken()
}
/*
if (count($_POST[$item['var']]) < 1) {
echo '<div class="serendipityAdminMsgError msg_error"><img class="img_error" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . WARNING_NO_GROUPS_SELECTED . '</div>';
echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . WARNING_NO_GROUPS_SELECTED . '</div>';
} else {
serendipity_updateGroups($_POST[$item['var']], $serendipity['authorid'], false);
}
@@ -96,32 +93,26 @@ if ($serendipity['GET']['adminAction'] == 'save' && serendipity_checkFormToken()
}
}
$from = $_POST;
}
}
?>
<div class="serendipityAdminMsgSuccess"><img width="22px" height="22px" style="border: 0px; padding-right: 4px; vertical-align: middle" src="<?php echo serendipity_getTemplateFile('admin/img/admin_msg_success.png'); ?>" alt="" /><?php echo sprintf(MODIFIED_USER, htmlspecialchars($_POST['realname'])) ?></div>
<?php }
} ?>
$data['formToken'] = serendipity_setFormToken();
<form action="?serendipity[adminModule]=personal&amp;serendipity[adminAction]=save" method="post">
<?php
echo serendipity_setFormToken();
$template = serendipity_parseTemplate(S9Y_CONFIG_USERTEMPLATE);
$user = serendipity_fetchUsers($serendipity['authorid']);
$from = $user[0];
$from['groups'] = serendipity_getGroups($serendipity['authorid']);
unset($from['password']);
ob_start();
serendipity_printConfigTemplate($template, $from, true, false);
$data['config'] = ob_get_contents();
ob_get_clean();
?>
<div align="right"><input class="serendipityPrettyButton input_button" type="submit" name="SAVE" value="<?php echo SAVE; ?>" /></div>
</form>
<?php
$add = array('internal' => true);
serendipity_plugin_api::hook_event('backend_sidebar_entries_event_display_profiles', $from, $add);
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/personal.inc.tpl";
$content = $serendipity['smarty']->fetch('file:'. $tfile);
echo $content;
/* vim: set sts=4 ts=4 expandtab : */
+238 -102
View File
@@ -1,4 +1,6 @@
<?php # $Id$
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
if (IN_serendipity !== true) {
die ('Don\'t hack!');
@@ -8,8 +10,6 @@ if (!serendipity_checkPermission('adminPlugins')) {
return;
}
$data = array();
include_once S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php';
include_once S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php';
include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
@@ -63,8 +63,7 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
if (!($plugin->protected === FALSE || $plugin->serendipity_owner == '0' || $plugin->serendipity_owner == $serendipity['authorid'] || serendipity_checkPermission('adminPluginsMaintainOthers'))) {
return;
}
$data['plugin_to_conf'] = true;
$bag = new serendipity_property_bag;
$plugin->introspect($bag);
@@ -121,44 +120,78 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
$plugin->cleanup();
}
?>
if ( isset($save_errors) && is_array($save_errors) && count($save_errors) > 0 ) {
$data['save_errors'] = $save_errors;
} elseif ( isset($_POST['SAVECONF'])) {
$data['saveconf'] = true;
$data['timestamp'] = serendipity_strftime('%H:%M:%S');
}
$data['formToken'] = serendipity_setFormToken();
$data['name'] = $name;
$data['class'] = get_class($plugin);
$data['desc'] = $desc;
$data['documentation'] = $documentation;
$data['plugin'] = $plugin;
if (@file_exists(dirname($plugin->pluginFile) . '/ChangeLog')) {
$data['changelog'] = true;
<?php if ( isset($save_errors) && is_array($save_errors) && count($save_errors) > 0 ) { ?>
<div class="serendipityAdminMsgError">
<img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="<?php echo serendipity_getTemplateFile('admin/img/admin_msg_error.png'); ?>" alt="" />
<?php
echo ERROR . ":<br />\n";
echo "<ul>\n";
foreach($save_errors AS $save_error) {
echo '<li>' . $save_error . "</li>\n";
}
echo "</ul>\n";
?>
</div>
<?php } elseif ( isset($_POST['SAVECONF'])) { ?>
<div class="serendipityAdminMsgSuccess"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="<?php echo serendipity_getTemplateFile('admin/img/admin_msg_success.png'); ?>" alt="" /><?php echo DONE .': '. sprintf(SETTINGS_SAVED_AT, serendipity_strftime('%H:%M:%S')); ?></div>
<?php } ?>
if (@file_exists(dirname($plugin->pluginFile) . '/documentation_' . $serendipity['lang'] . '.html')) {
$data['documentation_local'] = '/documentation_' . $serendipity['lang'] . '.html';
} elseif (@file_exists(dirname($plugin->pluginFile) . '/documentation_en.html')) {
$data['documentation_local'] = '/documentation_en.html';
} elseif (@file_exists(dirname($plugin->pluginFile) . '/documentation.html')) {
$data['documentation_local'] = '/documentation.html';
} elseif (@file_exists(dirname($plugin->pluginFile) . '/README')) {
$data['documentation_local'] = '/README';
}
<form method="post" name="serendipityPluginConfigure">
<?php echo serendipity_setFormToken(); ?>
<table cellpadding="5" style="border: 1px dashed" width="90%" align="center">
<tr>
<th width="100"><?php echo NAME; ?></th>
<td><?php echo $name; ?> (<em><?php echo get_class($plugin); ?></em>)</td>
</tr>
$data['license'] = $license;
ob_start();
serendipity_plugin_config($plugin, $bag, $name, $desc, $config_names, true, true, true, true, 'plugin', $config_groups);
$data['config'] = ob_get_contents();
ob_end_clean();
<tr>
<th style="vertical-align: top"><?php echo DESCRIPTION; ?></th>
<td>
<?php
echo $desc;
if (!empty($documentation)) {
echo '<br /><a href="' . htmlspecialchars($documentation) . '">' . PLUGIN_DOCUMENTATION . '</a>';
}
if (@file_exists(dirname($plugin->pluginFile) . '/ChangeLog')) {
echo '<br /><a href="plugins/' . $plugin->act_pluginPath . '/ChangeLog">' . PLUGIN_DOCUMENTATION_CHANGELOG . '</a>';
}
if (@file_exists(dirname($plugin->pluginFile) . '/documentation_' . $serendipity['lang'] . '.html')) {
echo '<br /><a href="plugins/' . $plugin->act_pluginPath . '/documentation_' . $serendipity['lang'] . '.html">' . PLUGIN_DOCUMENTATION_LOCAL . '</a>';
} elseif (@file_exists(dirname($plugin->pluginFile) . '/documentation_en.html')) {
echo '<br /><a href="plugins/' . $plugin->act_pluginPath . '/documentation_en.html">' . PLUGIN_DOCUMENTATION_LOCAL . '</a>';
} elseif (@file_exists(dirname($plugin->pluginFile) . '/documentation.html')) {
echo '<br /><a href="plugins/' . $plugin->act_pluginPath . '/documentation.html">' . PLUGIN_DOCUMENTATION_LOCAL . '</a>';
} elseif (@file_exists(dirname($plugin->pluginFile) . '/README')) {
echo '<br /><a href="plugins/' . $plugin->act_pluginPath . '/README">' . PLUGIN_DOCUMENTATION_LOCAL . '</a>';
}
?>
</td>
</tr>
<?php
if (!empty($license)) {
echo '<tr><th>'.MEDIA_PROPERTY_COPYRIGHT.'</th><td>'.$license.'</td></tr>';
}
?>
</table>
<br />
<?php serendipity_plugin_config($plugin, $bag, $name, $desc, $config_names, true, true, true, true, 'plugin', $config_groups); ?>
</form>
<?php
} elseif ( $serendipity['GET']['adminAction'] == 'addnew' ) {
$data['adminAction'] = 'addnew';
$data['type'] = $serendipity['GET']['type'];
?>
<?php if ( $serendipity['GET']['type'] == 'event' ) { ?>
<h2><?php echo EVENT_PLUGINS ?></h2>
<?php } else { ?>
<h2><?php echo SIDEBAR_PLUGINS ?></h2>
<?php } ?>
<br />
<?php
$foreignPlugins = $pluginstack = $errorstack = array();
serendipity_plugin_api::hook_event('backend_plugins_fetchlist', $foreignPlugins);
$pluginstack = array_merge((array)$foreignPlugins['pluginstack'], $pluginstack);
@@ -243,49 +276,157 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
}
ksort($pluggroups);
$data['errorstack'] = $errorstack;
foreach($errorstack as $e_idx => $e_name) {
echo ERROR . ': ' . $e_name . '<br />';
}
if ($serendipity['GET']['only_group'] == 'UPGRADE') {
serendipity_plugin_api::hook_event('backend_pluginlisting_header_upgrade', $pluggroups);
}
?>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<?php
$available_groups = array_keys($pluggroups);
$data['available_groups'] = $available_groups;
$groupnames = array();
foreach($available_groups as $available_group) {
$groupnames[$available_group] = serendipity_groupname($available_group);
}
$data['groupnames'] = $groupnames;
$data['pluggroups'] = $pluggroups;
$data['formToken'] = serendipity_setFormToken();
$data['only_group'] = $serendipity['GET']['only_group'];
$requirement_failures = array();
foreach($pluggroups AS $pluggroup => $groupstack) {
if (empty($pluggroup)) {
?>
<tr>
<td colspan="2" class="serendipity_pluginlist_header">
<form action="serendipity_admin.php" method="get">
<?php echo serendipity_setFormToken(); ?>
<input type="hidden" name="serendipity[adminModule]" value="plugins" />
<input type="hidden" name="serendipity[adminAction]" value="addnew" />
<input type="hidden" name="serendipity[type]" value="<?php echo htmlspecialchars($serendipity['GET']['type']); ?>" />
<?php echo FILTERS; ?>: <select name="serendipity[only_group]">
<?php foreach((array)$available_groups AS $available_group) {
?>
<option value="<?php echo $available_group; ?>" <?php echo ($serendipity['GET']['only_group'] == $available_group ? 'selected="selected"' : ''); ?>><?php echo serendipity_groupname($available_group); ?>
<?php } ?>
<option value="ALL" <?php echo ($serendipity['GET']['only_group'] == 'ALL' ? 'selected="selected"' : ''); ?>><?php echo ALL_CATEGORIES; ?>
<option value="UPGRADE" <?php echo ($serendipity['GET']['only_group'] == 'UPGRADE' ? 'selected="selected"' : ''); ?>><?php echo WORD_NEW; ?>
</select>
<input class="serendipityPrettyButton input_button" type="submit" value="<?php echo GO; ?>" />
</form>
</td>
</tr>
<?php
if (!empty($serendipity['GET']['only_group'])) {
continue;
}
} elseif (!empty($serendipity['GET']['only_group']) && $pluggroup != $serendipity['GET']['only_group']) {
continue;
} else {
?>
<tr>
<td colspan="2" class="serendipity_pluginlist_section"><strong><?php echo serendipity_groupname($pluggroup); ?></strong></td>
</tr>
<?php
}
?>
<tr>
<td><strong>Plugin</strong></td>
<td width="100" align="center"><strong>Action</strong></td>
</tr>
<?php
foreach ($groupstack as $plug) {
$jsLine = " onmouseout=\"document.getElementById('serendipity_plugin_". $plug['class_name'] ."').className='';\"";
$jsLine .= " onmouseover=\"document.getElementById('serendipity_plugin_". $plug['class_name'] ."').className='serendipity_PluginAdminHighlight';\"";
$pluginInfo = $notice = array();
if (!empty($plug['author'])) {
$pluginInfo[] = AUTHOR . ': ' . $plug['author'];
}
if (!empty($plug['version'])) {
$pluginInfo[] = VERSION . ': ' . $plug['version'];
}
if (!empty($plug['website'])) {
$pluginInfo[] = '<a href="' . htmlspecialchars($plug['website']) . '">' . PLUGIN_DOCUMENTATION . '</a>';
}
if (!empty($plug['local_documentation'])) {
$pluginInfo[] = '<a href="' . htmlspecialchars($plug['local_documentation']) . '">' . PLUGIN_DOCUMENTATION_LOCAL . '</a>';
}
if (!empty($plug['changelog'])) {
$pluginInfo[] = '<a href="' . htmlspecialchars($plug['changelog']) . '">' . PLUGIN_DOCUMENTATION_CHANGELOG . '</a>';
}
if (!empty($plug['upgrade_version']) && $plug['upgrade_version'] != $plug['version']) {
$pluginInfo[] = sprintf(UPGRADE_TO_VERSION, $plug['upgrade_version']);
}
if (!empty($plug['pluginlocation']) && $plug['pluginlocation'] != 'local') {
$pluginInfo[] = '(' . htmlspecialchars($plug['pluginlocation']) . ')';
$installimage = serendipity_getTemplateFile('admin/img/install_now_' . strtolower($plug['pluginlocation']) . '.png');
} else {
$installimage = serendipity_getTemplateFile('admin/img/install_now.png');
}
if (!isset($plug['customURI'])) {
$plug['customURI'] = '';
}
if ( !empty($plug['requirements']['serendipity']) && version_compare($plug['requirements']['serendipity'], serendipity_getCoreVersion($serendipity['version']), '>') ) {
$requirement_failures[$plug['class_name']] = array("s9y" => true);
$notice['requirements_failures'][] = 's9y ' . $plug['requirements']['serendipity'];
}
if ( !empty($plug['requirements']['php']) && version_compare($plug['requirements']['php'], phpversion(), '>') ) {
if (isset($requirement_failures[$plug['class_name']])) {
$requirement_failures[$plug['class_name']] = array_merge($requirement_failures[$plug['class_name']] , array("php" => true));
} else {
$requirement_failures[$plug['class_name']] = array("php" => true);
}
$notice['requirements_failures'][] = 'PHP ' . $plug['requirements']['php'];
}
/* Enable after Smarty 2.6.7 upgrade.
* TODO: How can we get current Smarty version here? $smarty is not created!
if ( !empty($plug['requirements']['smarty']) && version_compare($plug['requirements']['smarty'], '2.6.7', '>') ) {
if (isset($requirement_failures[$plug['class_name']])) {
$requirement_failures[$plug['class_name']] = array_merge($requirement_failures[$plug['class_name']] , array("smarty" => true));
} else {
$requirement_failures[$plug['class_name']] = array("smarty" => true);
}
$notice['requirements_failures'][] = 'Smarty: ' . $plug['requirements']['smarty'];
}
*/
if (count($notice['requirements_failures']) > 0) {
$plug['requirements_fail'] = true;
}
?>
<tr id="serendipity_plugin_<?php echo $plug['class_name']; ?>">
<td colspan="2" <?php echo $jsLine ?>>
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr>
<td><strong><?php echo $plug['name'] ?></strong></td>
<td width="100" align="center" valign="middle" rowspan="3">
<?php if ( $plug['requirements_fail'] == true ) { ?>
<span style="color: #cccccc"><?php printf(UNMET_REQUIREMENTS, implode(', ', $notice['requirements_failures'])); ?></span>
<?php } elseif ( $plug['upgradable'] == true ) { ?>
<a href="?serendipity[adminModule]=plugins&amp;serendipity[pluginPath]=<?php echo $plug['pluginPath']; ?>&amp;serendipity[install_plugin]=<?php echo $plug['plugin_class'] . $plug['customURI'] ?>"><img src="<?php echo serendipity_getTemplateFile('admin/img/upgrade_now.png') ?>" title="<?php echo UPGRADE ?>" alt="<?php echo UPGRADE ?>" border="0" /></a>
<?php } elseif ($plug['installable'] == true) { ?>
<a href="?serendipity[adminModule]=plugins&amp;serendipity[pluginPath]=<?php echo $plug['pluginPath']; ?>&amp;serendipity[install_plugin]=<?php echo $plug['plugin_class'] . $plug['customURI'] ?>"><img src="<?php echo $installimage ?>" title="<?php echo INSTALL ?>" alt="<?php echo INSTALL ?>" border="0" /></a>
<?php } else { ?>
<span style="color: #cccccc"><?php echo ALREADY_INSTALLED ?></span>
<?php } ?>
</td>
</tr>
<tr>
<td style="padding-left: 10px"><?php echo $plug['description'] ?></td>
</tr>
<?php if (count($pluginInfo) > 0) { ?>
<tr>
<td style="padding-left: 10px; font-size: x-small">(<?php echo $plug['class_name']; ?>) <?php echo implode('; ', $pluginInfo); ?></td>
</tr>
<?php } ?>
</table>
</td>
</tr>
<?php
}
}
$data['requirements_failues'] = $requirement_failures;
?>
<tr>
<td colspan="2" align="right"><?php printf(PLUGIN_AVAILABLE_COUNT, count($pluginstack)); ?></td>
</tr>
</table>
<?php
} else {
/* show general plugin list */
@@ -372,12 +513,14 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
/* Load the new plugin */
$plugin = &serendipity_plugin_api::load_plugin($inst);
if (!is_object($plugin)) {
echo "<dl><dt>DEBUG: Plugin $inst not an object: " . print_r($plugin, true) . ".</dt><dd>Input: " . print_r($serendipity['GET'], true) . ".</dd><dd>This error can happen if a plugin was not properly downloaded (check your plugins directory if the requested plugin was downloaded) or the inclusion of a file failed (permissions?)</dd>";
echo "<dt>Backtrace:</dt><dd>" . implode("<br />\n", $serendipity['debug']['pluginload']) . "<br /></dd></dl>";
echo "DEBUG: Plugin $inst not an object: " . print_r($plugin, true) . ".<br />Input: " . print_r($serendipity['GET'], true) . ".<br /><br />\n\nThis error can happen if a plugin was not properly downloaded (check your plugins directory if the requested plugin was downloaded) or the inclusion of a file failed (permissions?)<br />\n";
echo "Backtrace:<br />\n" . implode("<br />\n", $serendipity['debug']['pluginload']) . "<br />";
}
$bag = new serendipity_property_bag;
$plugin->introspect($bag);
serendipity_plugin_api::hook_event('backend_plugins_install', $serendipity['GET']['install_plugin'], $fetchplugin_data);
if ($bag->is_set('configuration')) {
/* Only play with the plugin if there is something to play with */
echo '<script type="text/javascript">location.href = \'' . $serendipity['baseurl'] . '?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]=' . $inst . '\';</script>';
@@ -387,6 +530,8 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
echo '<script type="text/javascript">location.href = \'' . $serendipity['baseurl'] . '?serendipity[adminModule]=plugins\';</script>';
die();
}
} else {
serendipity_plugin_api::hook_event('backend_plugins_update', $serendipity['GET']['install_plugin'], $fetchplugin_data);
}
}
@@ -401,51 +546,42 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
}
}
}
if (isset($_POST['SAVE'])) {
$data['save'] = true;
$data['timestamp'] = serendipity_strftime('%H:%M:%S');
}
?>
<?php if (isset($_POST['SAVE'])) { ?>
<div class="serendipityAdminMsgSuccess"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="<?php echo serendipity_getTemplateFile('admin/img/admin_msg_success.png'); ?>" alt="" /><?php echo DONE .': '. sprintf(SETTINGS_SAVED_AT, serendipity_strftime('%H:%M:%S')); ?></div>
<?php } ?>
<div><?php echo BELOW_IS_A_LIST_OF_INSTALLED_PLUGINS ?></div>
<?php
if (!isset($serendipity['eyecandy']) || serendipity_db_bool($serendipity['eyecandy'])) {
$data['eyecandy'] = true;
echo '<script src="' . serendipity_getTemplateFile('dragdrop.js') . '" type="text/javascript"></script>';
echo '<div class="warning js_warning"><em>' . PREFERENCE_USE_JS_WARNING . '</em></div>';
}
serendipity_plugin_api::hook_event("backend_pluginlisting_header" ,$eyecandy);
serendipity_plugin_api::hook_event('backend_pluginlisting_header', $serendipity['eyecandy']);
?>
<br />
ob_start();
serendipity_plugin_api::hook_event('backend_plugins_sidebar_header', $serendipity);
$data['backend_plugins_sidebar_header'] = ob_get_contents();
ob_end_clean();
<h3><?php echo SIDEBAR_PLUGINS ?></h3>
<a href="?serendipity[adminModule]=plugins&amp;serendipity[adminAction]=addnew" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/install.png') ?>" style="border: 0px none ; vertical-align: middle; display: inline;" alt="" /><?php echo sprintf(CLICK_HERE_TO_INSTALL_PLUGIN, SIDEBAR_PLUGIN) ?></a>
<?php serendipity_plugin_api::hook_event('backend_plugins_sidebar_header', $serendipity); ?>
<?php show_plugins(false, $sidebars); ?>
ob_start();
show_plugins(false, $sidebars);
$data['sidebar_plugins'] = ob_get_contents();
ob_end_clean();
<br />
<br />
ob_start();
serendipity_plugin_api::hook_event('backend_plugins_event_header', $serendipity);
$data['backend_plugins_event_header'] = ob_get_contents();
ob_end_clean();
<h3><?php echo EVENT_PLUGINS ?></h3>
<a href="?serendipity[adminModule]=plugins&amp;serendipity[adminAction]=addnew&amp;serendipity[type]=event" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/install.png') ?>" style="border: 0px none ; vertical-align: middle; display: inline;" alt="" /><?php echo sprintf(CLICK_HERE_TO_INSTALL_PLUGIN, EVENT_PLUGIN) ?></a>
<?php serendipity_plugin_api::hook_event('backend_plugins_event_header', $serendipity); ?>
<?php show_plugins(true); ?>
ob_start();
show_plugins(true);
$data['event_plugins'] = ob_get_contents();
ob_end_clean();
if (count($serendipity['memSnaps']) > 0) {
$data['$memsnaps'] = $serendipity['memSnaps'];
}
<?php if (count($serendipity['memSnaps']) > 0) { ?>
<h3>Memory Usage</h3>
<div>
<pre><?php print_r($serendipity['memSnaps']); ?></pre>
</div>
<?php } ?>
<?php
}
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/plugins.inc.tpl";
$content = $serendipity['smarty']->fetch('file:'. $tfile);
echo $content;
/* vim: set sts=4 ts=4 expandtab : */
+75 -37
View File
@@ -56,27 +56,27 @@ class template_option {
}
}
$data = array();
if ($serendipity['GET']['adminAction'] == 'install' ) {
serendipity_plugin_api::hook_event('backend_templates_fetchtemplate', $serendipity);
$themeInfo = serendipity_fetchTemplateInfo(htmlspecialchars($serendipity['GET']['theme']));
// A separate hook is used post installation, for plugins to possibly perform some actions
serendipity_plugin_api::hook_event('backend_templates_install', $serendipity['GET']['theme'], $themeInfo);
serendipity_set_config_var('template', htmlspecialchars($serendipity['GET']['theme']));
serendipity_set_config_var('template_engine', isset($themeInfo['engine']) ? $themeInfo['engine'] : 'default');
$data["adminAction"] = "install";
$data["install_template"] = htmlspecialchars($serendipity['GET']['theme']);
echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . sprintf(TEMPLATE_SET, htmlspecialchars($serendipity['GET']['theme'])) .'</div>';
}
?>
<?php
if ( @file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template'] .'/layout.php') ) {
$data["deprecated"] = true;
echo '<div class="serendipityAdminMsgNote"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_note.png') . '" alt="" />'. WARNING_TEMPLATE_DEPRECATED .'</div>';
}
$data["cur_template"] = $serendipity['template'];
echo '<h3>' . STYLE_OPTIONS . ' (' . $serendipity['template'] . ')</h3>';
if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template'] . '/config.inc.php')) {
serendipity_smarty_init();
include_once $serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template'] . '/config.inc.php';
@@ -84,7 +84,6 @@ if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] .
if (is_array($template_config)) {
serendipity_plugin_api::hook_event('backend_templates_configuration_top', $template_config);
$data["has_config"] = true;
if ($serendipity['POST']['adminAction'] == 'configure' && serendipity_checkFormToken()) {
$storage = new template_option();
@@ -92,11 +91,13 @@ if (is_array($template_config)) {
foreach($serendipity['POST']['template'] AS $option => $value) {
$storage->set_config($option, $value);
}
$data["adminAction"] = "configure";
$data["save_time"] = sprintf(SETTINGS_SAVED_AT, serendipity_strftime('%H:%M:%S'));
echo '<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . DONE .': '. sprintf(SETTINGS_SAVED_AT, serendipity_strftime('%H:%M:%S')) . '</div>';
}
$data["form_token"] = serendipity_setFormToken();
echo '<form method="post" action="serendipity_admin.php">';
echo '<input type="hidden" name="serendipity[adminModule]" value="templates" />';
echo '<input type="hidden" name="serendipity[adminAction]" value="configure" />';
echo serendipity_setFormToken();
include S9Y_INCLUDE_PATH . 'include/functions_plugins_admin.inc.php';
@@ -106,7 +107,6 @@ if (is_array($template_config)) {
$template_options->import($template_config);
$template_options->values =& $template_vars;
ob_start();
serendipity_plugin_config(
$template_options,
$template_vars,
@@ -120,62 +120,100 @@ if (is_array($template_config)) {
'template',
$template_config_groups
);
$data["configuration"] = ob_get_contents();
ob_end_clean();
echo '</form><br />';
serendipity_plugin_api::hook_event('backend_templates_configuration_bottom', $template_config);
} else {
echo '<p>' . STYLE_OPTIONS_NONE . '</p>';
serendipity_plugin_api::hook_event('backend_templates_configuration_none', $template_config);
}
echo '<h3>' . SELECT_TEMPLATE . '</h3>';
?>
<br />
<?php
$i = 0;
$stack = array();
serendipity_plugin_api::hook_event('backend_templates_fetchlist', $stack);
$themes = serendipity_fetchTemplates();
$data['templates'] = array();
$data['templates'][$theme] = array();
foreach($themes AS $theme) {
$stack[$theme] = serendipity_fetchTemplateInfo($theme);
}
ksort($stack);
foreach ($stack as $theme => $info) {
$data['templates'][$theme]['info'] = $info;
$i++;
/* Sorry, but we don't display engines */
if ( strtolower($info['engine']) == 'yes' ) {
continue;
}
$preview = '';
$preview_link = false;
if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $theme . '/preview_fullsize.jpg')) {
$data['templates'][$theme]['fullsize_preview'] = $serendipity['baseURL'] . $serendipity['templatePath'] . $theme . '/preview_fullsize.jpg';
$preview .= '<a href="' . $serendipity['baseURL'] . $serendipity['templatePath'] . $theme . '/preview_fullsize.jpg" target="_blank">';
$preview_link = true;
} elseif (!empty($info['preview_fullsizeURL'])) {
$data['templates'][$theme]['fullsize_preview'] = $info['preview_fullsizeURL'];
$preview .= '<a href="' . $info['preview_fullsizeURL'] . '" target="_blank">';
$preview_link = true;
# } else {
# echo "No large preview";
}
if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $theme . '/preview.png')) {
$data['templates'][$theme]['preview'] = $serendipity['templatePath'] . $theme . '/preview.png';
$preview .= '<img src="' . $serendipity['templatePath'] . $theme . '/preview.png" width="100" style="border: 1px #000000 solid" />';
} elseif (!empty($info['previewURL'])) {
$data['templates'][$theme]['preview'] = $info['previewURL'] ;
$preview .= '<img src="' . $info['previewURL'] . '" width="100" style="border: 1px #000000 solid" />';
} else {
$preview .= '&nbsp;';
}
if ($preview_link) {
$preview .= '</a>';
}
if (empty($info['customURI'])) {
$info['customURI'] = '';
}
$unmetRequirements = array();
if ( isset($info['require serendipity']) && version_compare($info['require serendipity'], serendipity_getCoreVersion($serendipity['version']), '>') ) {
$unmetRequirements[] = 'Serendipity '. $info['require serendipity'];
$data['templates'][$theme]['unmetRequirements'] = sprintf(UNMET_REQUIREMENTS, implode(', ', $unmetRequirements));
}
/* TODO: Smarty versioncheck */
$class = (($i % 2 == 0) ? 'even' : 'uneven');
?>
<div class="serendipity_admin_list_item serendipity_admin_list_item_<?php echo $class ?>">
<table width="100%" id="serendipity_theme_<?php echo $theme; ?>">
<tr>
<td colspan="2"><span class="serendipityTemplateSelectName"><strong><?php echo $info['name']; ?></strong></span></td>
<td valign="middle" align="center" width="70" rowspan="2">
<?php
if ( $serendipity['template'] != $theme ) {
if ( !sizeof($unmetRequirements) ) {
?>
<a href="?serendipity[adminModule]=templates&amp;serendipity[adminAction]=install&amp;serendipity[theme]=<?php echo $theme . $info['customURI']; ?>"><img src="<?php echo serendipity_getTemplateFile('admin/img/install_now' . $info['customIcon'] . '.png') ?>" alt="<?php echo SET_AS_TEMPLATE ?>" title="<?php echo SET_AS_TEMPLATE ?>" border="0" /></a>
<?php } else { ?>
<span class="serendipityTemplateSelectUnmetRequirements" style="color: #cccccc"><?php echo sprintf(UNMET_REQUIREMENTS, implode(', ', $unmetRequirements)); ?></span>
<?php
}
} ?>
</td>
</tr>
<tr>
<td width="100" style="padding-left: 10px"><?php echo $preview; ?></td>
<td valign="top">
<span class="serendipityTemplateSelectDetails"><?php echo AUTHOR; ?>: <?php echo $info['author'];?></span><br />
<span class="serendipityTemplateSelectDetails"><?php echo LAST_UPDATED; ?>: <?php echo $info['date']; ?></span><br />
<span class="serendipityTemplateSelectDetails"><?php echo CUSTOM_ADMIN_INTERFACE; ?>: <?php echo $info['custom_admin_interface']; ?></span><br />
</td>
</tr>
</table>
</div>
<?php
}
if (!is_object($serendipity['smarty'])) {
serendipity_smarty_init();
}
$serendipity['smarty']->assign($data);
$tpldir = ( !defined('SWITCH_TEMPLATE_VERSION') ) ? 'tplold' : 'tpl';
$tfile = dirname(__FILE__) . "/$tpldir/templates.inc.tpl";
$content = $serendipity['smarty']->fetch('file:'. $tfile); // short notation with Smarty3 in S9y 1.7 and up
echo $content;
/* vim: set sts=4 ts=4 expandtab : */
-161
View File
@@ -1,161 +0,0 @@
{* HTML5: Yes *}
{* jQuery: No *}
{if $post_save}
{if $new}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.CATEGORY_SAVED}</span>
{/if}
{if $edit}
{if isset($editPermission) && $editPermission == false}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.PERM_DENIED}</span>
{else}
{if $subcat}{$subcat}{else}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.CATEGORY_SAVED}</span>
{/if}
{/if}
{/if}
{/if}
{if $doDelete}
{if $deleteSuccess}
<span class="msg_success"><span class="icon-ok-circle"></span> {if $remainingCat}{$CONST.CATEGORY_DELETED_ARTICLES_MOVED|sprintf:$remainingCat:$cid}{else}{$cid|string_format:"{$CONST.CATEGORY_DELETED}"}{/if}</span>
{else}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.INVALID_CATEGORY}</span>
{/if}
{/if}
{if $delete}
{if $deletePermission == true}
<h2>{$categoryName|escape:"html"}</h2>
<form method="POST" name="serendipityCategory" action="?serendipity[adminModule]=category&amp;serendipity[adminAction]=doDelete&amp;serendipity[cid]={$cid}">
{$formToken}
<div class="form_select">
<label for="remaining_cat">{$CONST.CATEGORY_REMAINING}:</label>
<select id="remaining_cat" name="serendipity[cat][remaining_catid]">
<option value="0">{$CONST.NO_CATEGORY}</option>
{foreach $cats as $cat_data}
<option value="{$cat_data.categoryid}">{$cat_data.category_name|escape:"html"}</option>
{/foreach}
</select>
</div>
<input name="REMOVE" type="submit" value="{$CONST.GO}">
</form>
{/if}
{/if}
{if (! $post_save) && ($edit || $new)}
{if $edit}
<h2>{$category_name|escape:"html"|string_format:"{$CONST.EDIT_THIS_CAT}"}</h2>
{/if}
<form id="serendipity_category" method="POST" name="serendipityCategory">
{$formToken}
<div class="form_field">
<label for="category_name">{$CONST.NAME}</label>
<input id="category_name" name="serendipity[cat][name]" type="text" value="{$this_cat.category_name|default:""|escape:"html"}">
</div>
<div class="form_field">
<label for="category_description">{$CONST.DESCRIPTION}</label>
<input id="category_description" name="serendipity[cat][description]" type="text" value="{$this_cat.category_description|default:""|escape:"html"}">
</div>
<div class="form_field">
<label for="category_icon">{$CONST.IMAGE}</label>
{* TODO: this should probably become/fallback to input[type=file] *}
<input id="category_icon" name="serendipity[cat][icon]" type="text" value="{$this_cat.category_icon|default:""|escape:"html"}" onchange="document.getElementById('imagepreview').src = this.value; document.getElementById('imagepreview').style.display = '';">
<script>
var category_icon = document.getElementById('category_icon');
var imgBtn = document.createElement('div');
imgBtn.id = "insert_image";
imgBtn.innerHTML = '<input type="button" name="insImage" value="{$CONST.IMAGE}" onclick="window.open(\'serendipity_admin_image_selector.php?serendipity[htmltarget]=category_icon&amp;serendipity[filename_only]=true\', \'ImageSel\', \'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1\');">';
category_icon.parentNode.insertBefore(imgBtn, category_icon.nextSibling);
</script>
<!-- noscript>FIXXME: Emit a warning if JS is disabled</noscript -->
</div>
<figure id="preview">
<figcaption>{$CONST.PREVIEW}</figcaption>
<img id="imagepreview" src="{$this_cat.category_icon|default:""|escape:"html"}" alt="">
</figure>
<div class="form_multiselect">
<label for="read_authors">{$CONST.PERM_READ}</label>
<select id="read_authors" size="6" multiple name="serendipity[cat][read_authors][]">
<option value="0"{if $selectAllReadAuthors} selected{/if}>{$CONST.ALL_AUTHORS}</option>
{foreach $groups as $group}
<option value="{$group.confkey}"{if isset($read_groups.{$group.confkey})} selected{/if} >{$group.confvalue|escape:"html"}</option>
{/foreach}
</select>
</div>
<div class="form_multiselect">
<label for="write_authors">{$CONST.PERM_WRITE}</label>
<select id="write_authors"size="6" multiple name="serendipity[cat][write_authors][]">
<option value="0"{if $selectAllReadAuthors} selected{/if}>{$CONST.ALL_AUTHORS}</option>
{foreach $groups as $group}
<option value="{$group.confkey}"{if isset($read_groups.{$group.confkey})} selected{/if}>{$group.confvalue|escape:"html"}</option>
{/foreach}
</select>
</div>
<div class="form_select">
<label for="parent_cat">{$CONST.PARENT_CATEGORY}</label>
<select id="parent_cat" name="serendipity[cat][parent_cat]">
<option value="0"{if $cid == 0} selected{/if}>{$CONST.NO_CATEGORY}</option>
{foreach $categories as $cat}
{if $cat.categoryid == $cid}{continue}{/if}
<option value="{$cat.categoryid}"{if $this_cat.parentid == $cat.categoryid} selected{/if}>{for $i=1 to $cat.depth}&nbsp{/for} {$cat.category_name}</option>
{/foreach}
</select>
</div>
<fieldset>
<legend><span>{$CONST.CATEGORY_HIDE_SUB}</span></legend>
<p>{$CONST.CATEGORY_HIDE_SUB_DESC}</p>
<div class="clearfix">
<div class="form_radio">
<input id="hide_sub_yes" name="serendipity[cat][hide_sub]" type="radio" value="1"{if $this_cat.hide_sub== 1} checked="checked"{/if}>
<label for="hide_sub_yes">{$CONST.YES}</label>
</div>
<div class="form_radio">
<input id="hide_sub_no" name="serendipity[cat][hide_sub]" type="radio" value="0"{if $this_cat.hide_sub == 0} checked="checked"{/if}>
<label for="hide_sub_no">{$CONST.NO}</label>
</div>
</div>
</fieldset>
<input name="SAVE" type="submit" value="{$save}">
</form>
<script src="serendipity_editor.js"></script>
{/if}
{if $view}
<h2>{$CONST.CATEGORY_INDEX}:</h2>
{if is_array($viewCats)}
<ul id="categories" class="plainList">
{foreach $viewCategories as $category}
{* TODO: Ideally, this should use true nesting, i.e. nested lists instead of a level class. *}
<li class="clearfix level_{$category.depth}">
<details class="category_data">
<summary class="category_name{if $category.category_icon} category_hasicon{/if}"><span class="icon-folder-open"></span> {$category.category_name|escape:"html"}</summary>
<div class="category_info clearfix">
{if $category.category_description != ''}
<span class="category_desc">{$category.category_description|escape:"html"}</span>
{/if}
<span class="category_author">{if $category.authorid == 0}{$CONST.ALL_AUTHORS}{else}{$category.realname|escape:"html"}{/if}</span>
</div>
</details>
<ul class="plainList edit_actions">
<li><a class="icon_link" href="?serendipity[adminModule]=category&amp;serendipity[adminAction]=edit&amp;serendipity[cid]={$category.categoryid}" title="{$CONST.EDIT}"><span class="icon-edit"></span><span class="visuallyhidden"> {$CONST.EDIT}</span></a></li>
<li><a class="icon_link" href="?serendipity[adminModule]=category&amp;serendipity[adminAction]=delete&amp;serendipity[cid]={$category.categoryid}" title="{$CONST.DELETE}"><span class="icon-trash"></span><span class="visuallyhidden"> {$CONST.DELETE}</span></a></li>
</ul>
</li>
{/foreach}
</ul>
{else}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.NO_CATEGORIES}</span>
{/if}
<a class="link_create" href="?serendipity[adminModule]=category&serendipity[adminAction]=new">{$CONST.CREATE_NEW_CAT}</a>
{/if}
-178
View File
@@ -1,178 +0,0 @@
{* HTML5: Yes *}
{* jQuery: No *}
{if !empty($errormsg)}
<span class="msg_error"><span class="attention"></span> {$errormsg}</span>
{/if}
<script type="text/javascript">
var view_full = '{$CONST.VIEW_FULL}';
var view_hide = '{$CONST.HIDE}';
</script>
<script src="serendipity_editor.js"></script>
<h2>{$CONST.COMMENTS}</h2>
<form action="" method="GET">
{$formtoken}
<input name="serendipity[adminModule]" type="hidden" value="comments">
<input name="serendipity[page]" type="hidden" value="{$page}">
<fieldset id="filter_comments">
<legend><span>{$CONST.FILTERS} ({$CONST.FIND_COMMENTS})</span></legend>
<div class="clearfix">
<div class="form_field">
<label for="filter_author">{$CONST.AUTHOR}</label>
<input id="filter_author" name="serendipity[filter][author]" type="text" value="{$get.filter.author|escape}">
</div>
<div class="form_field">
<label for="filter_email">{$CONST.EMAIL}</label>
<input id="filter_email" name="serendipity[filter][email]" type="text" value="{$get.filter.email|escape}">
</div>
<div class="form_field">
<label for="filter_url">{$CONST.URL}</label>
<input id="filter_url" name="serendipity[filter][url]" type="text" value="{$get.filter.url|escape}">
</div>
<div class="form_field">
<label for="filter_ip">IP</label>
<input id="filter_ip" name="serendipity[filter][ip]" type="text" value="{$get.filter.ip|escape}">
</div>
<div class="form_field">
<label for="filter_body">{$CONST.CONTENT}</label>
<input id="filter_body" name="serendipity[filter][body]" type="text" value="{$get.filter.body|escape}">
</div>
<div class="form_field">
<label for="filter_referer">{$CONST.REFERER}</label>
<input id="filter_referer" name="serendipity[filter][referer]" type="text" value="{$get.filter.referer|escape}">
</div>
<div class="form_select">
<label for="filter_perpage">{$CONST.COMMENTS}</label>
<select id="filter_perpage" name="serendipity[filter][perpage]">
{foreach $filter_vals AS $filter}
<option value="{$filter}" {($commentsPerPage == $filter) ? ' selected' : ''}>{$filter}</option>
{/foreach}
</select>
</div>
<div class="form_select">
<label for="filter_show">{$CONST.COMMENTS_FILTER_SHOW}</label>
<select id="filter_show" name="serendipity[filter][show]">
<option value="all"{if $get.filter.show == 'all'} selected{/if}>{$CONST.COMMENTS_FILTER_ALL}</option>
<option value="approved"{if $get.filter.show == 'approved'} selected{/if}>{$CONST.COMMENTS_FILTER_APPROVED_ONLY}</option>
<option value="pending"{if $get.filter.show == 'pending'} selected{/if}>{$CONST.COMMENTS_FILTER_NEED_APPROVAL}</option>
<option value="confirm"{if $get.filter.show == 'confirm'} selected{/if}>{$CONST.COMMENTS_FILTER_NEED_CONFIRM}</option>
</select>
</div>
<div class="form_select">
<label for="filter_type">{$CONST.TYPE}</label>
<select id="filter_type" name="serendipity[filter][type]">
<option value="">{$CONST.COMMENTS_FILTER_ALL}</option>
<option value="NORMAL"{if $c_type == 'NORMAL'} selected{/if}>{$CONST.COMMENTS}</option>
<option value="TRACKBACK"{if $c_type == 'TRACKBACK'} selected{/if}>{$CONST.TRACKBACKS}</option>
<option value="PINGBACK"{if $c_type == 'PINGBACK'} selected{/if}>{$CONST.PINGBACKS}</option>
</select>
</div>
</div>
</fieldset>
<div class="form_buttons">
<input name="submit" type="submit" value="{$CONST.GO}">
{serendipity_hookPlugin hookAll=true hook="backend_comments_top" addData=$sql}
</div>
</form>
{if !is_array($sql)}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.NO_COMMENTS}</span>
<a class="block_level" href="serendipity_admin.php?serendipity[adminModule]=comments">Return to default comment list</a> {* l18n *}
{else}
<form id="formMultiDelete" action="" method="POST" name="formMultiDelete">
{$formtoken}
<input name="serendipity[formAction]" type="hidden" value="multiDelete">
<h3>{$CONST.PAGE_BROWSE_COMMENTS|sprintf:$page:$pages:$totalComments}</h3>
{if ($page != 1 && $page <= $pages)||$page != $pages}
<nav class="pagination">
<h4 class="visuallyhidden">Comments pagination</h4> {* i18n *}
<ul class="clearfix">
{if ($page != 1 && $page <= $pages)}
<li><a class="icon_link" href="{$linkPrevious}" title="{$CONST.PREVIOUS}"><span class="icon-left-circled"></span><span class="visuallyhidden"> {$CONST.PREVIOUS}</span></a></li>
{/if}
{if $page != $pages}
<li><a class="icon_link" href="{$linkNext}" title="{$CONST.NEXT}"><span class="icon-right-circled"></span><span class="visuallyhidden"> {$CONST.NEXT}</span></a></li>
{/if}
</ul>
</nav>
{/if}
{if is_array($comments)}
<ul id="serendipity_comments_list" class="clearfix plainList">
{foreach $comments AS $comment}
<li class="clearfix">
<div class="form_check">
<input id="serendipity_multidelete_comment_{$comment.id}" type="checkbox" name="serendipity[delete][{$comment.id}]" value="{$comment.entry_id}" onclick="highlightComment('comment_{$comment.id}', this.checked)" tabindex="{$i}">
<label for="serendipity_multidelete_comment_{$comment.id}" class="visuallyhidden">Multiselect this comment</label> {* i18n *}
</div>
<h4 id="c{$comment.id}">{($comment.type == 'NORMAL') ? $CONST.COMMENT : (($comment.type == 'TRACKBACK') ? $CONST.TRACKBACK : $CONST.PINGBACK )} #{$comment.id}, {$CONST.IN_REPLY_TO} <a href="{$comment.entry_url}">{$comment.title|escape}</a> {$CONST.ON} {$comment.timestamp|@formatTime:'%b %e %Y, %H:%M'}</h4>
<div id="comment_{$comment.id}">
<dl class="comment_data clearfix">
<dt>{$CONST.AUTHOR}:</dt>
<dd>{$comment.author|escape|truncate:30:"&hellip;"} {$comment.action_author}</dd>
<dt>{$CONST.EMAIL}:</dt>
<dd>{if empty($comment.email)}N/A{else}<a href="mailto:{$comment.email|escape}" title="{$comment.email|escape}">{$comment.email|escape|truncate:30:"&hellip;"}</a>{if $comment.subscribed == 'true'} <span class="serendipity_subscription_on">({$CONST.ACTIVE_COMMENT_SUBSCRIPTION})</span>{/if}{/if}</dd>
{* TODO: This should not emit an img *}
<dd class="action_email">{$comment.action_email}</dd>
<dt>IP:</dt>
<dd>{if empty($comment.ip)}N/A{else}{$comment.ip|escape}{/if}</dd>
{* TODO: This should not emit an img *}
<dd class="action_ip">{$comment.action_ip}</dd>
<dt>{$CONST.URL}:</dt>
<dd>{if empty($comment.url)}N/A{else}<a class="icon_link" href="{$comment.url|escape}" title="{$comment.url|escape}"><span class="icon-link"></span> {$comment.url|escape|truncate:30:"&hellip;"}</a> {/if}</dd>
<dd class="action_url">{$comment.action_url}</dd>
<dt>{$CONST.REFERER}:</dt>
<dd>{if empty($comment.referer)}N/A{else}<a class="icon_link" href="{$comment.referer|escape}" title="{$comment.referer|escape}"><span class="icon-link"></span> {$comment.referer|escape|truncate:30:"&hellip;"}</a>{/if}</dd>
<dd class="action_referer">{$comment.action_referer}</dd>
</dl>
<div id="{$comment.id}_summary" class="comment_summary">{$comment.fullBody|truncate:120:"&hellip;"}</div>
<div id="{$comment.id}_full" class="comment_full hidden">{$comment.fullBody}</div>
<ul class="actions clearfix">
{if ($comment.status == 'pending') || ($comment.status == 'confirm')}
<li><a class="icon_link" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=approve&amp;serendipity[id]={$comment.id}&amp;{$urltoken}" title="{$CONST.APPROVE}"><span class="icon-lock-open"></span><span class="visuallyhidden">{$CONST.APPROVE}</span></a></li>
{/if}
{if ($comment.status == 'approved')}
<li><a class="icon_link" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=pending&amp;serendipity[id]={$comment.id}&amp;{$urltoken}" title="{$CONST.SET_TO_MODERATED}"><span class="icon-lock"></span><span class="visuallyhidden"> {$CONST.SET_TO_MODERATED}</span></a></li>
{/if}
{if $comment.excerpt}
<li><a class="icon_link" href="#c{$comment.id}" onclick="FT_toggle({$comment.id}); return false;" title="{$CONST.TOGGLE_ALL}"><span id="{$comment.id}_text">{$CONST.TOGGLE_ALL}</span></a></li>
{/if}
<li><a class="icon_link" href="{$comment.entrylink}" title="{$CONST.VIEW}"><span class="icon-eye"></span><span class="visuallyhidden"> {$CONST.VIEW}</span></a></li>
<li><a class="icon_link" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=edit&amp;serendipity[id]={$comment.id}&amp;serendipity[entry_id]={$comment.entry_id}&amp;{$urltoken}" title="{$CONST.EDIT}"><span class="icon-edit"></span><span class="visuallyhidden"> {$CONST.EDIT}</span></a></li>
<li><a class="icon_link" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=delete&amp;serendipity[id]={$comment.id}&amp;serendipity[entry_id]={$comment.entry_id}&amp;{$urltoken}" onclick='return confirm("{($CONST.COMMENT_DELETE_CONFIRM|sprintf:$comment.id:$comment.author)|escape}")' title="{$CONST.DELETE}"><span class="icon-trash"></span><span class="visuallyhidden"> {$CONST.DELETE}</span></a></li>
<li><a class="icon_link" onclick="cf = window.open(this.href, 'CommentForm', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1'); cf.focus(); return false;" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=reply&amp;serendipity[id]={$comment.id}&amp;serendipity[entry_id]={$comment.entry_id}&amp;serendipity[noBanner]=true&amp;serendipity[noSidebar]=true&amp;{$urltoken}" title="{$CONST.REPLY}"><span class="icon-chat"></span><span class="visuallyhidden"> {$CONST.REPLY}</span></a></li>
</ul>
{$comment.action_more}
</div>
</li>
{/foreach}
</ul>
{/if}
<div class="multidelete_actions form_buttons">
<input name="toggle" type="button" value="{$CONST.INVERT_SELECTIONS}" onclick="invertSelection()">
<input name="toggle" type="submit" value="{$CONST.DELETE_SELECTED_COMMENTS}" onclick="return confirm('{$CONST.COMMENTS_DELETE_CONFIRM}')" tabindex="{($i+1)}">
<input name="serendipity[togglemoderate]" type="submit" value="{$CONST.MODERATE_SELECTED_COMMENTS}">
</div>
{* TODO: Clone pagination using JS *}
</form>
{/if}
-25
View File
@@ -1,25 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
{if $installAction == 'check'}
{if $diagnosticError}
<h2>{$CONST.DIAGNOSTIC_ERROR}</h2>
{foreach $res as $r}
<span class="msg_error"><span class="icon-attention"></span> {$r}</span>
{/foreach}
{else}
{if $htaccessRewrite}
<h2>{$CONST.ATTEMPT_WRITE_FILE|sprintf:"{$serendipityPath}htaccess"}</h2>
{if is_array($res)}
{foreach $res as $r}
<span class="msg_notice"><span class="icon-info-circle"></span> {$r}</span>
{/foreach}
{else}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.DONE}</span>
{/if}
{/if}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.WRITTEN_N_SAVED}</span>
{/if}
{else}
{$config}
{/if}
-206
View File
@@ -1,206 +0,0 @@
{* HTML5: Yes *}
{* jQuery: No *}
{if $drawList}
<form action="?" method="get">
<input name="serendipity[action]" type="hidden" value="admin">
<input name="serendipity[adminModule]" type="hidden" value="entries">
<input name="serendipity[adminAction]" type="hidden" value="editSelect">
<fieldset id="filter_entries">
<legend><span>{$CONST.FILTERS} ({$CONST.FIND_ENTRIES})</span></legend>
<div class="clearfix">
<div class="form_select">
<label for="filter_author">{$CONST.AUTHOR}</label>
<select id="filter_author" name="serendipity[filter][author]">
<option value="">-</option>
{if is_array($users)}
{foreach $users AS $user}
{if isset($user.artcount) && $user.artcount < 1}{continue}{/if}
<option value="{$user.authorid}" {(isset($get.filter.author) && ($get.filter.author == $user.authorid)) ? 'selected' : ''}>{$user.realname|escape}</option>
{/foreach}
{/if}
</select>
</div>
<div class="form_select">
<label for="filter_draft">Entry status</label> {* i18n *}
<select id="filter_draft" name="serendipity[filter][isdraft]">
<option value="all">{$CONST.COMMENTS_FILTER_ALL}</option>
<option value="draft" {(isset($get.filter.isdraft) && ($get.filter.isdraft == 'draft') ? 'selected' : '')}>{$CONST.DRAFT}</option>
<option value="publish" {(isset($get.filter.isdraft) && ($get.filter.isdraft == 'publish') ? 'selected' : '')}>{$CONST.PUBLISH}</option>
</select>
</div>
<div class="form_select">
<label for="filter_category">{$CONST.CATEGORY}</label>
<select id="filter_category" name="serendipity[filter][category]">
<option value="">-</option>
{foreach $categories as $cat}
<option value="{$cat.categoryid}"{($get.filter.category == $cat.categoryid) ? ' selected' : ''}>{'&nbsp;'|str_repeat:$cat.depth} {$cat.category_name|escape}</option>
{/foreach}
</select>
</div>
<div class="form_field">
<label for="filter_content">{$CONST.CONTENT}</label>
<input id="filter_content" name="serendipity[filter][body]" type="text" value="{(isset($get.filter.body)) ? "{$get.filter.body|escape}" : ''}">
</div>
</div>
</fieldset>
<fieldset id="sort_entries">
<legend><span>{$CONST.SORT_ORDER}</span></legend>
<div class="clearfix">
<div class="form_select">
<label for="sort_order">{$CONST.SORT_BY}</label>
<select id="sort_order" name="serendipity[sort][order]">
{foreach $sort_order as $so_key => $so_val}
<option value="{$so_key}" {(isset($get.sort.order) && ($get.sort.order == $so_key) ? 'selected': '')}>{$so_val}</option>
{/foreach}
</select>
</div>
<div class="form_select">
<label for="sort_ordermode">{$CONST.SORT_ORDER}</label>
<select id="sort_ordermode" name="serendipity[sort][ordermode]">
<option value="DESC" {(isset($get.sort.ordermode) && ($get.sort.ordermode == 'DESC') ? 'selected' : '')}>{$CONST.SORT_ORDER_DESC}</option>
<option value="ASC" {(isset($get.sort.ordermode) && ($get.sort.ordermode == 'ASC') ? 'selected' : '')}>{$CONST.SORT_ORDER_ASC}</option>
</select>
</div>
<div class="form_select">
<label for="sort_perpage">{$CONST.ENTRIES_PER_PAGE}</label>
<select id="sort_perpage" name="serendipity[sort][perPage]">
{foreach $per_page AS $per_page_nr}
<option value="{$per_page_nr}" {((isset($get.sort.perPage) && ($get.sort.perPage == $per_page_nr)) ? 'selected' : '')}> {$per_page_nr}</option>
{/foreach}
</select>
</div>
</div>
</fieldset>
<input name="go" type="submit" value="{$CONST.GO}">
</form>
{if $is_entries}
{if ($offSet > 0) || ($count > $perPage)}
<nav class="pagination">
<ul class="clearfix">
{if ($offSet > 0)}
<li><a class="icon_link" href="{$linkPrevious}" title="{$CONST.PREVIOUS}"><span class="icon-left-circled"></span><span class="visuallyhidden"> {$CONST.PREVIOUS}</span></a></li>
{/if}
{if ($count > $perPage)}
<li><a class="icon_link" href="{$linkNext}" title="{$CONST.NEXT}"><span class="icon-right-circled"></span><span class="visuallyhidden"> {$CONST.NEXT}</span></a></li>
{/if}
</ul>
</nav>
{/if}
<script src="{serendipity_getFile file='admin/admin_scripts.js'}"></script>
<form id="formMultiDelete" action="?" method="post" name="formMultiDelete">
{$formtoken}
<input name="serendipity[action]" type="hidden" value="admin">
<input name="serendipity[adminModule]" type="hidden" value="entries">
<input name="serendipity[adminAction]" type="hidden" value="multidelete">
<ul id="entries_list" class="plainList">
{foreach $entries as $entry}
{if ($entry@index > $perPage)}{continue}{/if}
<li class="clearfix"><div class="form_check">
<input id="multidelete_entry{$entry.id}" name="serendipity[multiDelete][]" type="checkbox" value="{$entry.id}"><label for="multidelete_entry{$entry.id}" class="visuallyhidden">Select #{$entry_id} for multidelete</label> {* i18n *}
</div>
<h3><a href="?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=edit&amp;serendipity[id]={$entry.id}" title="#{$entry.id}">{$entry.title|escape|truncate:50:"&hellip;"}</a></h3>
<div class="entry_status">
{if !$showFutureEntries && ($entry.timestamp >= $serverOffsetHour)}
<span class="status_future">{$CONST.ENTRY_PUBLISHED_FUTURE}</span>
{/if}
{if $entry.ep_is_sticky}
<span class="status_sticky">{$CONST.STICKY_POSTINGS}</span>
{/if}
{if $entry.isdraft}
<span class="status_draft">{$CONST.DRAFT}</span>
{/if}
<span class="status_timestamp">
{$entry.timestamp|@formatTime:"{$CONST.DATE_FORMAT_SHORT}"}{if $entry.timestamp <= ($entry.last_modified - 1800)} <a class="icon_link" href="#" title="{$CONST.LAST_UPDATED}: {$entry.last_modified|@formatTime:"{$CONST.DATE_FORMAT_SHORT}"}" onclick="alert(this.title)"><span class="icon-info-circle"></span><span class="visuallyhidden"> {$CONST.LAST_UPDATED}</span></a>{/if}
</span>
</div>
<span class="entry_meta">{$CONST.POSTED_BY} {$entry.author|escape}
{if count($entry.cats)} {$CONST.IN}
{foreach $entry.cats AS $cat}
{$cat}{if (count($entry.cats) > 1) && !$cat@last}, {/if}
{/foreach}
{/if}
</span>
<ul class="actions">
{if $entry.preview || (!$showFutureEntries && ($entry.timestamp >= $serverOffsetHour))}
<li><a class="icon_link" href="{$entry.preview_link}" title="{$CONST.PREVIEW} #{$entry.id}"><span class="icon-eye"></span><span class="visuallyhidden"> {$CONST.PREVIEW}</span></a></li>
{else}
<li><a class="icon_link" href="{$entry.archive_link}" title="{$CONST.VIEW} #{$entry.id}"><span class="icon-eye"></span><span class="visuallyhidden"> {$CONST.VIEW}</span></a></li>
{/if}
<li><a class="icon_link" href="?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=edit&amp;serendipity[id]={$entry.id}" title="{$CONST.EDIT} #{$entry.id}"><span class="icon-edit"></span><span class="visuallyhidden"> {$CONST.EDIT}</span></a></li>
<li><a class="icon_link" href="?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=delete&amp;serendipity[id]={$entry.id}&amp;{$urltoken}" title="{$CONST.DELETE} #{$entry.id}" title="{$CONST.DELETE}"><span class="icon-trash"></span><span class="visuallyhidden"> {$CONST.DELETE}</span></a></li>
</ul>
</li>
{/foreach}
</ul>
{/if}
<div id="multidelete_tools" class="form_buttons">
<input name="toggle" type="button" value="{$CONST.INVERT_SELECTIONS}" onclick="invertSelection()">
<input name="toggle" type="submit" value="{$CONST.DELETE_SELECTED_ENTRIES}">
</div>
</form>
<form action="?" method="get">
<input name="serendipity[action]" type="hidden" value="admin">
<input name="serendipity[adminModule]" type="hidden" value="entries">
<input name="serendipity[adminAction]" type="hidden" value="editSelect">
<div id="entry_skip" class="form_field">
<label for="skipto_entry">{$CONST.EDIT_ENTRY} #</label>
<input id="skipto_entry" name="serendipity[id]" type="text" size="3">
</div>
<input name="serendipity[editSubmit]" type="submit" value="{$CONST.GO}">
</form>
{/if}
{if $no_entries}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.NO_ENTRIES_TO_PRINT}</span>
{/if}
{if $switched_output}
{if ($get.adminAction && $dateval)}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.DATE_INVALID}</span>
{/if}
{if ($get.adminAction && $use_legacy)}
{if $is_draft}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.IFRAME_SAVE_DRAFT}</span>
{/if}
{if $is_iframe}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.IFRAME_SAVE}</span>
{/if}
{if $is_iframepreview}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.IFRAME_PREVIEW}</span>
{/if}
{/if}
{if ($is_doDelete || $is_doMultiDelete )}
{foreach $del_entry AS $delent}
<span class="msg_dialogue"><span class="icon-help-circle"></span> {$delent}</span>
{/foreach}
{/if}
{if ( $is_delete || $is_multidelete )}
{foreach $rip_entry AS $ripent}
<span class="msg_dialogue"><span class="icon-help-circle"></span> {$ripent}</span>
{/foreach}
<ul class="dialogue_delrip plainList clearfix">
<li><a class="link_abort" href="{$smarty.server.HTTP_REFERER|escape}">{$CONST.NOT_REALLY}</a></li>
<li><a class="link_confirm" href="{$newLoc}">{$CONST.DUMP_IT}</a></li>
</ul>
{/if}
{/if}
@@ -1,4 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
<p><strong>{$CONST.WELCOME_BACK} {$smarty.session.serendipityUser|escape}</strong></p>
-4
View File
@@ -1,4 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
<span class="block_level standalone"><span class="icon-rss"></span> <a id="export_rss" href="{$serendipityBaseURL}rss.php?version=2.0&all=1">{$CONST.EXPORT_FEED}</a></span>
-126
View File
@@ -1,126 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
{if $delete_yes}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.DELETED_GROUP|sprintf:"{$group_id|escape:"html"}":"{$group.name|escape:"html"}"}</span>
{/if}
{if $save_new}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.CREATED_GROUP|sprintf:"{$group_id|escape:"html"}":"{$group.name|escape:"html"}"}</span>
{/if}
{if $save_edit}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.MODIFIED_GROUP|sprintf:"{$name|escape:"html"}"}</span>
{/if}
{if !$delete}
<h2>{$CONST.GROUP}</h2>
<ul id="serendipity_groups" class="plainList">
{foreach $groups as $group}
<li class="clearfix">
<span class="group_name"><span class="icon-users"></span> {$group.name|escape:"html"}</span>
<ul class="plainList edit_actions">
<li><a class="icon_link" href="?serendipity[adminModule]=groups&amp;serendipity[adminAction]=edit&amp;serendipity[group]={$group.id}" title="{$CONST.EDIT} {$group.name|escape:"html"}"><span class="icon-edit"></span><span class="visuallyhidden"> {$CONST.EDIT}</span></a></li>
<li><a class="icon_link" href="?{$deleteFormToken}&amp;serendipity[adminModule]=groups&amp;serendipity[adminAction]=delete&amp;serendipity[group]={$group.id}" title="{$CONST.DELETE} {$group.name|escape:"html"}"><span class="icon-trash"></span><span class="visuallyhidden"> {$CONST.DELETE}</span></a></li>
</ul>
</li>
{/foreach}
</ul>
{if $start}
<form action="?serendipity[adminModule]=groups" method="post">
<input name="NEW" type="submit" value="{$CONST.CREATE_NEW_GROUP}">
</form>
{/if}
{/if}
{if $edit || $new}
<form action="?serendipity[adminModule]=groups" method="post">
{$formToken}
{if $edit}
<h3>{$CONST.EDIT}</h3>
<input name="serendipity[group]" type="hidden" value="{$from.id}">
{else}
<h3>{$CONST.CREATE}</h3>
{/if}
<div class="form_field">
<label for="group_name">{$CONST.NAME}</label>
{* BUG: Doesn't correctly pull the group name *}
<input id="group_name" name="serendipity[name]" type="text" value="{$from.name|escape:"html"}">
</div>
<div class="form_select">
<label for="group_members">{$CONST.USERCONF_GROUPS}</label>
<select id="group_members" name="serendipity[members][]" multiple size="5">
{foreach $allusers as $user}
<option value="{$user.authorid}" {if isset($selected.{$user.authorid})} selected{/if} >{$user.realname|escape:"html"}</option>
{/foreach}
</select>
</div>
{foreach $perms as $perm}
{* TODO: major rewrite *}
{if {{$perm@key}|truncate:"2":""} == 'f_'}{continue}{/if}
{if !isset($section)}
{$section=$perm@key}
{/if}
{if $section != {$perm@key} && {{$perm@key}|truncate:"{$section|count_characters}":""} == $section}
{$indent="&nbsp;&nbsp;"}
{else}
{if $section != {$perm@key}}
{$indent="<br>"}
{$section="{$perm@key}"}
{/if}
{/if}
{if !$perm.permission}
<div>
<span class="perm_name">{$indent} {$perm.permission_name|escape:"html"}</span>
<span class="perm_status">{(isset($from.{$perm@key}) && $from.{$perm@key} == "true") ? $CONST.YES : $CONST.NO}</span>
</div>
{else}
<div class="form_check">
{$indent} <label for="{{$perm@key}|escape:"html"}">{$perm.permission_name|escape:"html"}</label>
<input id="{{$perm@key}|escape:"html"}" name="serendipity[{{$perm@key}|escape:"html"}]" type="checkbox" value="true"{if isset({$from.{$perm@key}}) && {$from.{$perm@key}} == "true"} checked="checked"{/if}>
</div>
{/if}
{/foreach}
{if $enablePluginACL}
<div class="form_select">
<label for="forbidden_plugins">{$CONST.PERMISSION_FORBIDDEN_PLUGINS}</label>
<select id="forbidden_plugins" name="serendipity[forbidden_plugins][]" multiple size="5">
{foreach $allplugins as $plugin}
<option value="{{$plugin@key}|escape:"url"}{if $plugin.has_permission == false} selected{/if}">{$plugin.b->properties.name|escape:"html"}</option>
{/foreach}
</select>
</div>
<div class="form_select">
<label for="forbidden_hooks">{$CONST.PERMISSION_FORBIDDEN_HOOKS}</label>
<select name="serendipity[forbidden_hooks][]" multiple size="5">
{foreach $allhooks as $hook}
<option value="{{$hook@key}|escape:"url"}"{$hook.has_permission == false} 'selected'}>{{$hook@key}|escape:"html"}</option>
{/foreach}
</select>
</div>
{else}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.PERMISSION_FORBIDDEN_ENABLE_DESC}</span>
{/if}
{if $edit}
<input name="SAVE_EDIT" type="submit" value="{$CONST.SAVE}"> {$CONST.WORD_OR} <input name="SAVE_NEW" type="submit" value="{$CONST.CREATE_NEW_GROUP}">
{else}
<input name="SAVE_NEW" type="submit" value="{$CONST.CREATE_NEW_GROUP}">
{/if}
</form>
{else}
{if $delete}
<form action="?serendipity[adminModule]=groups" method="post">
{$formToken}
<input name="serendipity[group]" type="hidden" value="{$group_id|escape:"html"}">
<h2>{$CONST.DELETE_GROUP|sprintf:"{$group_id}":"{$group.name|escape:"html"}"}</h2>
<div id="groups_delete_action">
<input name="DELETE_YES" type="submit" value="{$CONST.DUMP_IT}">
<input name="NO" type="submit" value="{$CONST.NOT_REALLY}">
</div>
</form>
{/if}
{/if}
-301
View File
@@ -1,301 +0,0 @@
{* HTML5: Yes *}
{* jQuery: No *}
{if $case_imgedit}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.PREFERENCE_USE_JS_WARNING}</span>
{/if}
{if $case_sync}
{if !$perm_adminImagesSync}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.PERM_DENIED}</span>
{else}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.WARNING_THIS_BLAHBLAH|replace:'\\n':'<br>'}</span>
<form method="POST" action="serendipity_admin.php?serendipity[adminModule]=media&amp;serendipity[adminAction]=doSync">
<fieldset>
<legend><span>{$CONST.SYNC_OPTION_LEGEND}</span></legend>
<div class="clearfix">
<div class="form_radio">
<input id="keepthumbs" name="serendipity[deleteThumbs]" type="radio" value="no" checked="checked">
<label for="keepthumbs">{$CONST.SYNC_OPTION_KEEPTHUMBS}</label>
</div>
<div class="form_radio">
<input id="sizecheckthumbs" name="serendipity[deleteThumbs]" type="radio" value="check">
<label for="sizecheckthumbs">{$CONST.SYNC_OPTION_SIZECHECKTHUMBS}</label>
</div>
<div class="form_radio">
<input id="deletethumbs" name="serendipity[deleteThumbs]" type="radio" value="yes">
<label for="deletethumbs">{$CONST.SYNC_OPTION_DELETETHUMBS}</label>
</div>
</div>
</fieldset>
<div class="form_buttons">
<input name="doSync" type="submit" value="{$CONST.CREATE_THUMBS}">
<a href="serendipity_admin.php">{$CONST.ABORT_NOW}</a>
</div>
</form>
{/if}
{/if}
{if $case_doSync}
{if !$perm_adminImagesSync}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.PERM_DENIED}</span>
{else}
<h2>{$CONST.SYNCING}</h2>
<span class="msg_success"><span class="icon-ok-circle"></span> {$print_SYNC_DONE}</span>
<h2>{$CONST.RESIZING}</h2>
<span class="msg_success"><span class="icon-ok-circle"></span> {$print_RESIZE_DONE}</span>
{/if}
{/if}
{if $case_delete}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.ABOUT_TO_DELETE_FILE|sprintf:"$file"}</span>
<form id="delete_image" method="get">
<div class="form_buttons">
<a href="{$newLoc}">{$CONST.DUMP_IT}</a>
<a href="{$abortLoc}">{$CONST.ABORT_NOW}</a>
</div>
</form>
{/if}
{if $switched_output}
<form id="delete_image" method="get">
{if ( $is_delete || $is_multidelete )}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.ABOUT_TO_DELETE_FILES}</span>
{foreach $rip_image AS $ripimg}
<span class="msg_dialogue"><span class="icon-help-circle"></span> {$ripimg}</span>
{/foreach}
<ul class="dialogue_delrip plainList clearfix">
<li><a class="link_abort" href="{$smarty.server.HTTP_REFERER|escape}">{$CONST.NOT_REALLY}</a></li>
<li><a class="link_confirm" href="{$newLoc}">{$CONST.DUMP_IT}</a></li>
</ul>
{/if}
</form>
{/if}
{if $case_rename}
{if $go_back}
<input type="button" value="{$CONST.BACK}" onclick="history.go(-1);">
{else}
<script>location.href="?serendipity[adminModule]=images&serendipity[adminAction]=default";</script>
<noscript><a href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=default">{$CONST.DONE}</a></noscript>
{/if}
{/if}
{* TODO: obsolete? *}
{if $case_properties}
{** serendipity_showPropertyForm($new_media) **}
{/if}
{* END TODO *}
{if $case_add}
{if $smarty.post.adminSubAction == 'properties'}
<script>location.href="?serendipity[adminModule]=images&serendipity[adminAction]=default";</script>
<noscript><a href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=default">{$CONST.DONE}</a></noscript>
{else}
{$showML_add}
{/if}
{/if}
{if $case_directoryDoDelete}
{if $print_DIRECTORY_WRITE_ERROR}{$print_DIRECTORY_WRITE_ERROR}{/if}
{if $ob_serendipity_killPath}{$ob_serendipity_killPath}{/if}
{if $print_ERROR_NO_DIRECTORY}{$print_ERROR_NO_DIRECTORY}{/if}
{/if}
{if $case_directoryEdit}
{if !empty($smarty.post.save)}
{if $ob_serendipity_moveMediaDirectory}{$ob_serendipity_moveMediaDirectory}{/if}
<span class="msg_notice"><span class="icon-info-circle"></span> {$print_CONST.SETTINGS_SAVED_AT}</span>
{/if}
<h2>{$CONST.MANAGE_DIRECTORIES}</h2>
<form id="image_directory_edit_form" method="POST" action="?serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryEdit&amp;serendipity[dir]={$dir|escape:'html'}">
{$formtoken}
<input name="serendipity[oldDir]" type="hidden" value="{$use_dir}">
<div class="form_field">
<label for="diredit_new">{$CONST.NAME}</label>
<input id="diredit_new" name="serendipity[newDir]" type="text" value="{$use_dir}">
</div>
<div class="form_select">
<label for="read_authors">{$CONST.PERM_READ}</label>
<select id="read_authors" name="serendipity[read_authors][]" multiple size="6">
<option value="0"{if $rgroups} selected{/if}>{$CONST.ALL_AUTHORS}</option>
{foreach $groups AS $group}
<option value="{$group.confkey}"{if isset($read_groups.{$group.confkey})} selected{/if}>{$group.confvalue|escape:'html'}</option>
{/foreach}
</select>
</div>
<div class="form_select">
<label for="write_authors">{$CONST.PERM_WRITE}</label>
<select id="write_authors" name="serendipity[write_authors][]" multiple size="6">
<option value="0"{if $wgroups} selected{/if}>{$CONST.ALL_AUTHORS}</option>
{foreach $groups AS $group}
<option value="{$group.confkey}"{if isset($write_groups.{$group.confkey})} selected{/if}>{$group.confvalue|escape:'html'}</option>
{/foreach}
</select>
</div>
<div class="form_check">
<input id="setchild" name="serendipity[update_children]" type="checkbox" value="true"{if !empty($smarty.post.update_children) == 'on'} checked="checked"{/if}><label for="setchild">{$CONST.PERM_SET_CHILD}</label>
</div>
<input name="serendipity[save]" type="submit" value="{$CONST.SAVE}">
</form>
{/if}
{if $case_directoryDelete}
<h2>{$CONST.DELETE_DIRECTORY}</h2>
<p>{$CONST.DELETE_DIRECTORY_DESC}</p>
<form id="image_directory_delete_form" method="POST" action="?serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryDoDelete&amp;serendipity[dir]={$dir|escape:'html'}">
{$formtoken}
<div class="form_check">
<input id="diredit_delete" name="serendipity[nuke]" type="checkbox" value="true">
<label for="diredit_delete"><b>{$basename_dir}</b> - {$CONST.FORCE_DELETE}</label>
</div>
{* I think this is redudant: <p>{$CONST.CONFIRM_DELETE_DIRECTORY|sprintf:$dir|escape:'html'}</p> *}
<input name="SAVE" type="submit" value="{$CONST.DELETE_DIRECTORY}">
</form>
{/if}
{if $case_directoryDoCreate}
{if $print_DIRECTORY_CREATED}{$print_DIRECTORY_CREATED}{/if}
{if $print_DIRECTORY_WRITE_ERROR}{$print_DIRECTORY_WRITE_ERROR}{/if}
{/if}
{if $case_directoryCreate}
<h2>{$CONST.CREATE_DIRECTORY}</h2>
<p>{$CONST.CREATE_DIRECTORY_DESC}</p>
<form id="image_directory_create_form" method="POST" action="?serendipity[step]=directoryDoCreate&amp;serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryDoCreate">
{$formtoken}
<div class="form_field">
<label for="dircreate_name">{$CONST.NAME}</label>
<input id="dircreate_name" name="serendipity[name]" type="text" value="">
</div>
<div class="form_select">
<label for="dircreate_parent">{$CONST.PARENT_DIRECTORY}</label>
<select id="dircreate_parent" name="serendipity[parent]">
<option value="">{$CONST.BASE_DIRECTORY}</option>
{foreach $folders as $folder}
<option{if $folder.relpath == $get.only_path} selected{/if} value="{$folder.relpath}">{'&nbsp;'|str_repeat:($folder.depth*2)} {$folder.name}</option>
{/foreach}
</select>
</div>
{serendipity_hookPlugin hookAll=true hook="backend_directory_createoptions" addData=$folders}
<input name="SAVE" type="submit" value="{$CONST.CREATE_DIRECTORY}">
</form>
{/if}
{if $case_directorySelect}
<h2>{$CONST.MANAGE_DIRECTORIES}</h2>
<p>{$CONST.DIRECTORIES_AVAILABLE}</p>
<h3>{$CONST.BASE_DIRECTORY}</h3>
<ul class="plainList">
{foreach $folders as $folder}
<li class="level_{$folder.depth} clearfix">
<span class="folder_name"><span class="icon-folder-open"></span> {$folder.name}</span>
<a class="icon_link" href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryEdit&amp;serendipity[dir]={$folder.relpath|escape:'html'}" title="{$CONST.EDIT}"><span class="icon-edit"></span><span class="visuallyhidden"> {$CONST.EDIT}</span></a>
<a class="icon_link" href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryDelete&amp;serendipity[dir]={$folder.relpath|escape:'html'}" title="{$CONST.DELETE}"><span class="icon-trash"></span><span class="visuallyhidden"> {$CONST.DELETE}</span></a>
</li>
{/foreach}
</ul>
<a class="link_create block_level" href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryCreate">{$CONST.CREATE_NEW_DIRECTORY}</a>
{/if}
{* TODO: obsolete? *}
{if $case_addSelect}
{** smarty display 'admin/media_upload.tpl' **}
{/if}
{* END TODO *}
{if $case_rotateCW}
{if $rotate_img_done}
<script>location.href="{$adminFile_redirect}";</script>
<noscript><a href="{$adminFile_redirect}">{$CONST.DONE}</a></noscript>
{/if}
{/if}
{if $case_rotateCCW}
{if $rotate_img_done}
<script>location.href="{$adminFile_redirect}";</script>
<noscript><a href="{$adminFile_redirect}">{$CONST.DONE}</a></noscript>
{/if}
{/if}
{if $case_scale}
{if $print_SCALING_IMAGE}<span class="msg_notice"><span class="icon-info-circle"></span> {$print_SCALING_IMAGE}</span>{/if}
{if $print_serendipity_scaleImg}<span class="msg_notice"><span class="icon-info-circle"></span> {$print_serendipity_scaleImg}</span>{/if}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.DONE}</span>
<script>location.href="?serendipity[adminModule]=images&serendipity[adminAction]=default";</script>
<noscript><a href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=default">{$CONST.DONE}</a></noscript>
{/if}
{if $case_scaleSelect}
<script>
<!--
function rescale(dim, newval) {ldelim}
var originalWidth = {$img_width};
var originalHeight = {$img_height};
var ratio = originalHeight/originalWidth;
var trans = new Array();
trans['width'] = new Array('serendipity[height]', ratio);
trans['height'] = new Array('serendipity[width]', 1/ratio);
if (document.serendipityScaleForm.elements['auto'].checked == true) {ldelim}
document.serendipityScaleForm.elements[trans[dim][0]].value=Math.round(trans[dim][1]*newval);
{rdelim}
document.getElementsByName('serendipityScaleImg')[0].style.width =
document.serendipityScaleForm.elements['serendipity[width]'].value+'px';
document.getElementsByName('serendipityScaleImg')[0].style.height =
document.serendipityScaleForm.elements['serendipity[height]'].value+'px';
{rdelim}
//-->
</script>
{if $print_RESIZE_BLAHBLAH}<span class="msg_notice"><span class="icon-info-circle"></span> {$print_RESIZE_BLAHBLAH}</span>{/if}
{if $print_ORIGINAL_SIZE}<span class="msg_notice"><span class="icon-info-circle"></span> {$print_ORIGINAL_SIZE}</span>{/if}
<h2>{$CONST.HERE_YOU_CAN_ENTER_BLAHBLAH}</h2>
<form name="serendipityScaleForm" action="?" method="GET">
{$formtoken}
<input name="serendipity[adminModule]" type="hidden" value="images">
<input name="serendipity[adminAction]" type="hidden" value="scale">
<input name="serendipity[fid]" type="hidden" value="{$get.fid}">
<fieldset>
<legend><span>{$CONST.NEWSIZE}</span></legend>
<div class="form_field">
<label for="resize_width">Width</label> {* i18n *}
<input id="resize_width" name="serendipity[width]" type="text" onchange="rescale('width' , value);" value="{$img_width}">
</div>
<div class="form_field">
<label for="resize_height">Height</label> {* i18n *}
<input id="resize_height" name="serendipity[height]" type="text" onchange="rescale('height', value);" value="{$img_height}">
</div>
</fieldset>
<div class="form_check">
<input id="resize_keepprops" name="auto" type="checkbox" checked="checked">
<label for="resize_keepprops">{$CONST.KEEP_PROPORTIONS}</label>
</div>
<input name="scale" type="button" value="{$CONST.IMAGE_RESIZE}" onclick="if (confirm('{$CONST.REALLY_SCALE_IMAGE}')) document.serendipityScaleForm.submit();">
</form>
<img src="{$file}" name="serendipityScaleImg" style="width: {$img_width}px; height: {$img_height}px;" alt="">
{/if}
{if $case_default}
{if $showML_def}{$showML_def}{/if}
{/if}
-55
View File
@@ -1,55 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
{if $importForm}
{if $die}
<span class="msg_error"><span class="icon-attention"></span> FAILURE: Unable to require import module, possible syntax error?</span>
{else}
{if $validateData}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.IMPORT_STARTING}</span>
{if $result != true}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.IMPORT_FAILED}: {$result}</span>
{else}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.IMPORT_DONE}</span>
{/if}
{else}
<h2>{$CONST.IMPORT_PLEASE_ENTER}</h2>
<form action="" method="POST" enctype="multipart/form-data">
{$formToken}
<dl>
{foreach $fields as $field}
<dt>{$field.text}</dt>
<dd>{$field.guessedInput}</dd>
{/foreach}
</dl>
{if $notes}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.IMPORT_NOTES}: {$notes}</span>
{/if}
<input type="submit" value="{$CONST.IMPORT_NOW}">
</form>
{/if}
{/if}
{else}
<h2>{$CONST.IMPORT_WELCOME}</h2>
<p>{$CONST.IMPORT_WHAT_CAN}</p>
<h3>{$CONST.IMPORT_SELECT}:</h3>
<form action="" method="GET">
<input name="serendipity[adminModule]" type="hidden" value="import">
{$formToken}
<div class="form_select">
<label for="import_from">{$CONST.IMPORT_WEBLOG_APP}:</label>
<select id="import_from" name="serendipity[importFrom]">
{foreach $list as $v => $k}
<option value="{$v}">{$k}</option>
{/foreach}
</select>
</div>
<input type="submit" value="{$CONST.GO}">
</form>
{/if}
-264
View File
@@ -1,264 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
{if $is_errors && is_array($errors)}
{foreach $errors AS $error}
<span class="msg_error"><span class="icon-attention"></span> {$error}</span>
{/foreach}
{/if}
{if $getstepint0}
<h2>{$CONST.WELCOME_TO_INSTALLATION}</h2>
<h3>{$CONST.FIRST_WE_TAKE_A_LOOK}</h3>
<p>{$print_ERRORS_ARE_DISPLAYED_IN}</p>
<h3>{$CONST.PRE_INSTALLATION_REPORT|sprintf:$s9yversion}</h3>
<div id="diagnose">
<h4>{$CONST.INTEGRITY}</h4>
<ul class="plainList">
{foreach $installerResultDiagnose_CHECKSUMS AS $cksum}
<li>{$cksum}</li>
{/foreach}
</ul>
<table>
<caption>{$CONST.PHP_INSTALLATION}</caption>
<thead>
<tr>
{* TODO: These are probably poorly labelled, needs to be checked *}
<th>Key</th> {* i18n *}
<th>Value</th> {* i18n *}
</tr>
</thead>
<tbody>
<tr>
<td>{$CONST.OPERATING_SYSTEM}</td>
<td>{$php_uname}</td>
</tr>
<tr>
<td>{$CONST.WEBSERVER_SAPI}</td>
<td>{$php_sapi_name}</td>
</tr>
<tr>
<td>PHP version >= 5.2.6</td>
<td>{$installerResultDiagnose_VERSION}</td>
</tr>
<tr>
<td>Database extensions</td>
<td>{$installerResultDiagnose_DBTYPE}</td>
</tr>
<tr>
<td>Session extension</td>
<td>{$installerResultDiagnose_SESSION}</td>
</tr>
<tr>
<td>PCRE extension</td>
<td>{$installerResultDiagnose_PCRE}</td>
</tr>
<tr>
<td>GDlib extension</td>
<td>{$installerResultDiagnose_GD}</td>
</tr>
<tr>
<td>OpenSSL extension</td>
<td>{$installerResultDiagnose_OPENSSL}</td>
</tr>
<tr>
<td>mbstring extension</td>
<td>{$installerResultDiagnose_MBSTR}</td>
</tr>
<tr>
<td>iconv extension</td>
<td>{$installerResultDiagnose_ICONV}</td>
</tr>
<tr>
<td>zlib extension</td>
<td>{$installerResultDiagnose_ZLIB}</td>
</tr>
<tr>
<td>Imagemagick binary </td>
<td>{$installerResultDiagnose_IM}</td>
</tr>
</tbody>
</table>
<table>
<caption>{$CONST.PHPINI_CONFIGURATION}</caption>
<thead>
<tr>
<th>&nbsp;</th>
<th>{$CONST.RECOMMENDED}</th>
<th>{$CONST.ACTUAL}</th>
</tr>
</thead>
<tbody>
<tr>
<td>safe_mode</td>
<td><strong>OFF</strong></td>
<td>{$installerResultDiagnose_SSM}</td>
</tr>
<tr>
<td>register_globals</td>
<td><strong>OFF</strong></td>
<td>{$installerResultDiagnose_SRG}</td>
</tr>
<tr>
<td>magic_quotes_gpc</td>
<td><strong>OFF</strong></td>
<td>{$installerResultDiagnose_SMQG}</td>
</tr>
<tr>
<td>magic_quotes_runtime</td>
<td><strong>OFF</strong></td>
<td>{$installerResultDiagnose_SMQR}</td>
</tr>
<tr>
<td>session.use_trans_sid</td>
<td><strong>OFF</strong></td>
<td>{$installerResultDiagnose_SSUTS}</td>
</tr>
<tr>
<td>allow_url_fopen</td>
<td><strong>ON</strong></td>
<td>{$installerResultDiagnose_SAUF}</td>
</tr>
<tr>
<td>file_uploads</td>
<td><strong>ON</strong></td>
<td>{$installerResultDiagnose_SFU}</td>
</tr>
<tr>
<td>post_max_size</td>
<td><strong>10M</strong></td>
<td>{$installerResultDiagnose_SPMS}</td>
</tr>
<tr>
<td>upload_max_filesize</td>
<td><strong>10M</strong></td>
<td>{$installerResultDiagnose_SUMF}</td>
</tr>
<tr>
<td>memory_limit</td>
<td><strong>{($CONST.PHP_INT_SIZE == 4) ? '8M' : '16M'}</strong></td>
<td>{$installerResultDiagnose_SML}</td>
</tr>
</tbody>
</table>
<h4>{$CONST.PERMISSIONS}</h4>
<h5>{$basedir}</h5>
<ul class="plainList">
{foreach $installerResultDiagnose_WRITABLE AS $fwrite}
<li>{$fwrite}</li>
{/foreach}
</ul>
<h5>{$basedir} {$CONST.PATH_SMARTY_COMPILE}</h5>
<ul class="plainList">
{foreach $installerResultDiagnose_COMPILE AS $compile}
<li>{$compile}</li>
{/foreach}
</ul>
<h5>{$basedir}archives/</h5>
<ul class="plainList">
{foreach $installerResultDiagnose_ARCHIVES AS $archives}
<li>{$archives}</li>
{/foreach}
</ul>
<h5>{$basedir}plugins/</h5>
<ul class="plainList">
{foreach $installerResultDiagnose_PLUGINS AS $plugins}
<li>{$plugins}</li>
{/foreach}
</ul>
{if $is_dir_uploads}
<h5>{$basedir}uploads/</h5>
<ul class="plainList">
{foreach $installerResultDiagnose_UPLOADS AS $uploads}
<li>{$uploads}</li>
{/foreach}
</ul>
{/if}
{if $is_imb_executable}
<h5>Execute Imagemagick binary</h5>
<ul class="plainList">
{foreach $installerResultDiagnose_IMB AS $im_binary}
<li>{$im_binary}</li>
{/foreach}
</ul>
{/if}
{if $showWritableNote}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.PROBLEM_PERMISSIONS_HOWTO|sprintf:'chmod 1777'}</span>
{/if}
{if $errorCount > 0}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.PROBLEM_DIAGNOSTIC}</span>
<a class="block_level" href="serendipity_admin.php">{$CONST.RECHECK_INSTALLATION}</a>
{else}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.SELECT_INSTALLATION_TYPE}:</span>
<div><a href="?serendipity[step]=2a">{$CONST.SIMPLE_INSTALLATION}</a> - <a href="?serendipity[step]=2b">{$CONST.EXPERT_INSTALLATION}</a></div>
{/if}
</div>
{elseif $s9yGETstep == '2a'}
<form action="?" method="post">
<input name="serendipity[step]" type="hidden" value="{$s9yGETstep}">
<input name="serendipity[getstep]" type="hidden" value="3">
{if $ob_serendipity_printConfigTemplate}{$ob_serendipity_printConfigTemplate}{/if}
<input name="submit" type="submit" value="{$CONST.COMPLETE_INSTALLATION}">
</form>
{elseif $s9yGETstep == '2b'}
<form action="?" method="post">
<input name="serendipity[step]" type="hidden" value="{$s9yGETstep}">
<input name="serendipity[getstep]" type="hidden" value="3">
{if $ob_serendipity_printConfigTemplate}{$ob_serendipity_printConfigTemplate}{/if}
<input name="submit" type="submit" value="{$CONST.COMPLETE_INSTALLATION}">
</form>
{elseif $getstepint3}
<h3>{$CONST.CHECK_DATABASE_EXISTS}</h3>
{if is_array($authors_query)}
<span class="msg_success"><span class="icon-ok-circle"></span> <strong>{$CONST.THEY_DO}</strong>, {$CONST.WONT_INSTALL_DB_AGAIN}</span>
{else}
<span class="msg_error"><span class="icon-attention"></span> <strong>{$CONST.THEY_DONT}</strong></span>
<ol>
<li>{$CONST.CREATE_DATABASE}{if $install_DB} <strong>{$CONST.DONE}</strong>{/if}</li>
<li>{$CONST.CREATING_PRIMARY_AUTHOR|sprintf:"{$smarty.post.user|escape}"}{if $add_authors} <strong>{$CONST.DONE}</strong>{/if}</li>
<li>{$CONST.SETTING_DEFAULT_TEMPLATE}{if $set_template_vars} <strong>{$CONST.DONE}</strong>{/if}</li>
<li>{$CONST.INSTALLING_DEFAULT_PLUGINS}{if $register_default_plugins} <strong>{$CONST.DONE}</strong>{/if}</li>
</ol>
{/if}
<h3>{$CONST.ATTEMPT_WRITE_FILE|sprintf:'.htaccess'}</h3>
{if $errors_sif === true}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.DONE}</span>
{else}
<h4>{$CONST.FAILED}</h4>
<ul class="plainList">
{foreach $errors_sif AS $error_f}
<li><span class="msg_error"><span class="icon-attention"></span> {$error_f}</span></li>
{/foreach}
</ul>
{/if}
{if $s9y_installed}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.SERENDIPITY_INSTALLED}</span>
<p><strong>{$CONST.THANK_YOU_FOR_CHOOSING}</strong></p>
<a class="block_level" href="{$smarty.post.serendipityHTTPPath}">{$CONST.VISIT_BLOG_HERE}</a>
{else}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.ERROR_DETECTED_IN_INSTALL}</span>
{/if}
{/if}
-183
View File
@@ -1,183 +0,0 @@
{* HTML5: Yes *}
{* jQuery: No *}
{* serendipity_plugins_admin.inc.php::serendipity_plugin_config() - the OUT_STACK loop *}
{if $ctype == 'seperator'}
{* This could just as well be replaced by a CSS-only solution … *}
<hr>
{* … then again, hr has new meaning in HTML5. *}
{/if}
{if $ctype == 'select'}
<div class="clearfix form_select">
<label for="serendipity_{$config_item}">{$cname}
{if $cdesc != ''}<span>{$cdesc}</span>{/if}
</label>
{* Make sure id creation actually produces unique identifiers *}
<select id="serendipity_{$config_item}" class="direction_{$lang_direction}" name="serendipity[{$postKey}][{$config_item}]{($is_multi_select) ? '[]' : ''}" {($is_multi_select) ? 'multiple' : ''} {($is_multi_select && ($select_size > 0)) ? "size='{$select_size}'" : ''}>
{foreach $select AS $select_value => $select_desc}
{assign var="id" value="{$config_item|escape}_{$select_value|escape}"}
<!-- case select assign id={$id} -->
<option value="{$select_value}" {(in_array($select_value, $selected_options) || in_array($select_value, $pre_selected)) ? 'selected' : ''} title="{$select_desc|escape}">{$select_desc|escape}</option>
{/foreach}
</select>
</div>
{/if}
{if $ctype == 'radio'}
<div class="clearfix">
<fieldset>
<legend><span>{$cname}</span></legend>
{if $cdesc != ''}<p>{$cdesc}</p>{/if}
<div class="clearfix">
{foreach $radio_button AS $r}
<div class="form_radio">
<input id="serendipity_plugin_{$r['id']}" class="direction_{$lang_direction}" name="serendipity[{$postKey}][{$config_item}]" type="radio" value="{$r['value']}" {(!empty($r['checked'])) ? 'checked="checked"' : ''} title="{$r['index']|escape}">
<label for="serendipity_plugin_{$r['id']}">{$r['index']}{* escapement is already done *}</label>
{assign var="r" value="counter[0]"}
</div>
{/foreach}
</div>
</fieldset>
</div>
{/if}
{if $ctype == 'string'}
<div class="clearfix form_field">
<label for="serendipity_{$config_item}">{$cname}
{if $cdesc != ''}<span>{$cdesc}</span>{/if}
</label>
{* TODO: Make sure id creation actually produces unique identifiers *}
<input id="serendipity_{$config_item}" class="direction_{$lang_direction}" name="serendipity[{$postKey}][{$config_item}]" type="{$input_type}" value="{$hvalue}">
</div>
{/if}
{if (($ctype == 'html') || ($ctype == 'text'))}
<div class="clearfix form_area">
<label for="nuggets{$elcount}">{$cname}
{if $cdesc != ''}<span>{$cdesc}</span>{/if}
</label>
<textarea id="nuggets{$elcount}" class="direction_{$lang_direction}" name="serendipity[{$postKey}][{$config_item}]" rows="{$text_rows}">{$hvalue}</textarea>
</div>
{/if}
{if $ctype == 'content'}
<div class="clearfix">
{$cbag_default}
</div>
{/if}
{if $ctype == 'custom'}
<div class="clearfix">
<input id="config_{$postKey}_{$config_item}" name="serendipity[{$postKey}][{$config_item}]" type="hidden" value="{$hvalue}">
{$cbag_custom}
</div>
{/if}
{if $ctype == 'hidden'}
<div class="clearfix">
<input name="serendipity[{$postKey}][{$config_item}]" type="hidden" value="{$cbag_value}">
</div>
{/if}
{if $ctype == 'media'}
<div class="clearfix">
{if !$mediajs_output}
<script src="serendipity_editor.js"></script>
<script src="{serendipity_getFile file='admin/image_selector.js'}"></script>
{/if}
<label for="serendipity[{$postKey}][{$config_item}]">{$cname}
{if $cdesc != ''}<span>{$cdesc}</span>{/if}
</label>
<div id="{$config_item}_preview" style="background-image: url({$value}); width: {$preview_width}; height: {$preview_height}; background-repeat: no-repeat;">&nbsp;</div>
{* This should be input[type=file] … *}
<input id="serendipity[{$postKey}][{$config_item}]" name="serendipity[{$postKey}][{$config_item}]" type="text" value="{$value}" onchange="change_preview('{$config_item}')">
<a href="#" onclick="choose_media('serendipity[{$postKey}][{$config_item}]')">{$CONST.MEDIA_LIBRARY}</a>
{* … not touching it in order to not break it for now. *}
</div>
{/if}
{if $ctype == 'sequence'}
<div class="clearfix">
{if !$sequencejs_output}
<script src="{serendipity_getFile file='dragdrop.js'}"></script>
{/if}
<fieldset>
<legend><span>{$cname}</span></legend>
{if $cdesc != ''}
<p>{$cdesc}</p>
{/if}
<input id="{$config_item}_value" name="serendipity[{$postKey}][{$config_item}]" type="hidden" value="{$value}">
<noscript>
<!-- Replace standard submit button when using up/down submits -->
<input name="SAVECONF" type="hidden" value="Save">
</noscript>
<ol id="{$config_item}" class="sequence_container pluginmanager_container">
{foreach $order_id as $orid}
<li id="{$orid['id']}" class="sequence_item pluginmanager_item_even">
<a id="g{$orid['id']}" class="icon_link" href="#" title="Move"><span class="icon-move"></span><span class="visuallyhidden"> Move</span></a>{* i18n *}
{* <div id="g{$orid['id']}" class="pluginmanager_grablet sequence_grablet"><a href="#"></a></div> *}
{if $checkable}
<div class="form_check">
<input id="activate_{$orid['id']}" name="serendipity[{$postKey}][activate][{$config_item}][{$orid['id']}]" {(in_array($orid['id'], $store_order)) ? ' checked="checked" ' : ''} type="checkbox" onclick="sort_{$config_item}_Sequence();" value="true">
{* TODO: needs label *}
</div>
{/if}
<span>{$items[{$orid['id']}]['display']}</span>
{if isset($items[{$orid['id']}]['img'])}
<img src="{$items[{$orid['id']}]['img']}">
{/if}
<noscript>
<div>
{if ($orid['sort_idx'] == 0)}
&nbsp;
{else}
<button id="{$postKey}_{$config_item}_{$orid['sort_idx']}_up" class="icon_link" name="serendipity[{$postKey}][override][{$config_item}]" type="submit" value="{$orid['oneup']}"><span class="icon-up-circled"></span><span class="visuallyhidden"> Move Up</span></button> {* i18n *}
{/if}
{if ($orid['sort_idx'] == $last)}
&nbsp;
{else}
<button id="{$postKey}_{$config_item}_{$orid['sort_idx']}_down" class="icon_link" name="serendipity[{$postKey}][override][{$config_item}]" type="submit" value="{$orid['onedown']}"><span class="icon-down-circled"></span><span class="visuallyhidden"> Move Down</span></button> {* i18n *}
{/if}
</div>
</noscript>
</li>
{/foreach}
</ol>
{if isset($no_sequence)}
{$no_sequence}
{/if}
</fieldset>
{*** Smarty 3 has a new auto literal option which is enabled by default.
When the { is surrounded by whitespace it is not interpreted as smarty delimiter but literal. e.g. ' } ;'
AS tests have proofed, ending javascript delimiters " } ;" and " };" and even "};" work fine as well. So back to origin. ***}
<script>
function sort_{$config_item}_Sequence() {
//var seq = DragDrop.serData('{$config_item}_group', null);
var seq = DragDrop.serData(null, '{$config_item}');
var start = seq.indexOf("(");
var end = seq.indexOf(")");
seq = seq.slice((start + 1), end);
checkable_seq = seq.split(",");
out_seq = '';
for (i in checkable_seq) {
if (document.getElementById('activate_' + checkable_seq[i]) && !document.getElementById('activate_' + checkable_seq[i]).checked) {
continue;
} else {
if (out_seq != '') {
out_seq += ',';
}
out_seq += checkable_seq[i];
}
}
var order = document.getElementById("{$config_item}_value");
order.value = out_seq;
}
function init_{$config_item}_Sequence() {
var lst = document.getElementById("{$config_item}");
DragDrop.makeListContainer(lst, '{$config_item}_group');
lst.onDragOut = function() {
sort_{$config_item}_Sequence();
};
}
addLoadEvent(init_{$config_item}_Sequence);
</script>
</div>
{/if}
-16
View File
@@ -1,16 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN*}
<h2>{$output.welcome}</h2>
{$output.more}
{if $output.show_links}
<aside class="{$output.links_css}">
<h3>{$output.links_title}</h3>
<ul class="plainList">
{foreach $output.links AS $link}
<li>{$link}</li>
{/foreach}
</ul>
</aside>
{/if}
-19
View File
@@ -1,19 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
{if $adminAction == 'save'}
{if $not_authorized}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.CREATE_NOT_AUTHORIZED_USERLEVEL}</span>
{elseif $empty_username}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.USERCONF_CHECK_USERNAME_ERROR}</span>
{elseif $password_check_fail}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.USERCONF_CHECK_PASSWORD_ERROR}</span>
{else}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.MODIFIED_USER|sprintf:"{$realname|escape:"html"}"} ?></span>
{/if}
{/if}
<form action="?serendipity[adminModule]=personal&amp;serendipity[adminAction]=save" method="post">
{$formToken}
{$config}
<input name="SAVE" type="submit" value="{$CONST.SAVE}">
</form>
-149
View File
@@ -1,149 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
{if $plugin_to_conf}
{if is_array($save_errors)}
<div class="msg_error">
<h2><span class="icon-attention"></span> {$CONST.ERROR}:</h2>
<ul class="plainList">
{foreach $save_errors as $save_error}
<li>$save_error</li>
{/foreach}
</ul>
</div>
{elseif $saveconf}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.DONE}: {$CONST.SETTINGS_SAVED_AT|sprintf:"$timestamp"}</span>
{/if}
<form method="post" name="serendipityPluginConfigure">
{$formToken}
<div class="plugin_info">
<h2>{$name} (<span class="plugin_class">{$class}</span>)</h2>
<p><strong>{$CONST.DESCRIPTION}:</strong> {$desc}</p>
{if !empty($license)}
<p><strong>{$CONST.MEDIA_PROPERTY_COPYRIGHT}:</strong> {$license}</p>
{/if}
{if ! empty($documentation) || $changelog || $documentation_local}
<ul class="plainList">
{if !empty($documentation)}
<li><a href="{$documentation|escape:"html"}">{$CONST.PLUGIN_DOCUMENTATION}</a></li>
{/if}
{if $changelog}
<li><a href="plugins/{$plugin->act_pluginPath}/ChangeLog">{$CONST.PLUGIN_DOCUMENTATION_CHANGELOG}</a></li>
{/if}
{if $documentation_local}
<li><a href="plugins/{$plugin->act_pluginPath}{$documentation}">{$CONST.PLUGIN_DOCUMENTATION_LOCAL}</a></li>
{/if}
</ul>
{/if}
</div>
{$config}
</form>
{elseif $adminAction == 'addnew'}
<h3>{if $type == 'event'}{$CONST.EVENT_PLUGINS}{else}{$CONST.SIDEBAR_PLUGINS}{/if} <span class="plugins_available">{$CONST.PLUGIN_AVAILABLE_COUNT|sprintf:"count({$pluginstack})"}</span></h3>
{foreach $errorstack as $e_idx => $e_name}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.ERROR}: {$e_name}</span>
{/foreach}
<form action="serendipity_admin.php" method="get">
{$formToken}
<input name="serendipity[adminModule]" type="hidden" value="plugins">
<input name="serendipity[adminAction]" type="hidden" value="addnew">
<input name="serendipity[type]" type="hidden" value="{$type|escape:"html"}">
<div class="form_select">
<label for="only_group">{$CONST.FILTERS}</label>
<select id="only_group" name="serendipity[only_group]">
{foreach $groupnames as $available_group => $available_name}
<option value="{$available_group}"{if $only_group == $available_group} selected{/if}>{$available_name}</option>
{/foreach}
<option value="ALL"{if $only_group == ALL} selected{/if}>{$CONST.ALL_CATEGORIES}</option>
<option value="UPGRADE"{if $only_group == UPGRADE} selected{/if}>{$CONST.WORD_NEW}</option>
</select>
</div>
<input type="submit" value="{$CONST.GO}">
</form>
{foreach $pluggroups AS $pluggroup => $groupstack}
{if empty($pluggroup)}
{if !empty($only_group)}{continue}{/if}
{elseif !empty($only_group) && $pluggroup != $only_group}{continue}{else}
<h4>{foreach $groupnames as $available_group => $available_name}{if $pluggroup == $available_group}{$available_name}{/if}{/foreach}</h4>
{/if}
<ul class="plainList">
{foreach $groupstack as $plug}
<li><h5>{$plug.name} ({$plug.class_name})</h5>
<p class="plugin_desc">{$plug.description}</p>
<ul class="plugin_info">
{if ! empty($plug.author)}
<li class="plugin_author">{$CONST.AUTHOR}: {$plug.author}</li>
{/if}
{if ! empty($plug.version)}
<li class="plugin_version">{$CONST.VERSION}: {$plug.version}</li>
{/if}
{if ! empty($plug.website)}
<li class="plugin_web"><a href="{$plug.website|escape:"html"}">{$CONST.PLUGIN_DOCUMENTATION}</a></li>
{/if}
{if ! empty($plug.local_documentation)}
<li class="plugin_localdoc"><a href="{$plug.local_documentation|escape:"html"}">{$CONST.PLUGIN_DOCUMENTATION_LOCAL}</a></li>
{/if}
{if ! empty($plug.changelog)}
<li class="plugin_changelog"><a href="{$plug.changelog|escape:"html"}">{$CONST.PLUGIN_DOCUMENTATION_CHANGELOG}</a></li>
{/if}
{if ! empty({$plug.upgrade_version}) && $plug.upgrade_version != $plug.version}
<li class="plugin_toversion">{$CONST.UPGRADE_TO_VERSION|sprintf:"{$plug.upgrade_version}"}{if ! empty($plug.pluginlocation) && $plug.pluginlocation != 'local'} ({$plug.pluginlocation|escape:"html"}){/if}</li>
{/if}
</ul>
<div class="plugin_status">
{if isset($requirements_failures.{$plug.class_name})}
<span class="unmet_requirements">{$CONST.UNMET_REQUIREMENTS|sprintf:"{if $requirements_failures.{$plug.class_name}.s9y}s9y $plug.requirements..serendipity,{/if} {if $requirements_failures.{$plug.class_name}.php}PHP $plug.requirements.php,{/if} {if $requirements_failures.{$plug.class_name}.smarty}Smarty $plug.requirements.smarty{/if}"}</span>
{elseif $plug['upgradable'] == true}
<a class="upgradable" href="?serendipity[adminModule]=plugins&amp;serendipity[pluginPath]={$plug.pluginPath}&amp;serendipity[install_plugin]={$plug.plugin_class}{if isset($plug['customURI'])}{$plug.customURI}{/if}">{$CONST.UPGRADE}</a>
{elseif $plug.installable == true}
<a class="installable" href="?serendipity[adminModule]=plugins&amp;serendipity[pluginPath]={$plug.pluginPath}&amp;serendipity[install_plugin]={$plug.plugin_class}{if isset($plug.customURI)}{$plug.customURI}{/if}">{$CONST.INSTALL}</a>
{else}
<span class="installed">{$CONST.ALREADY_INSTALLED}</span>
{/if}
</div>
</li>
{/foreach}
</ul>
{/foreach}
{else}
{if $save}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.DONE}:{$CONST.SETTINGS_SAVED_AT|sprintf:"$timestamp"}</span>
{/if}
<h2>{$CONST.BELOW_IS_A_LIST_OF_INSTALLED_PLUGINS}</h2>
{if $eyecandy}
<script src="{serendipity_getFile file="dragdrop.js"}"></script>
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.PREFERENCE_USE_JS_WARNING}</span>
{/if}
<section id="pluginlist_sidebar">
<h3>{$CONST.SIDEBAR_PLUGINS}</h3>
<a class="install_plugins block_level" href="?serendipity[adminModule]=plugins&amp;serendipity[adminAction]=addnew">{$CONST.CLICK_HERE_TO_INSTALL_PLUGIN|sprintf:"{$CONST.SIDEBAR_PLUGIN}"}</a>
{$backend_plugins_sidebar_header}
{$sidebar_plugins}
</section>
<section id="pluginlist_event">
<h3>{$CONST.EVENT_PLUGINS}</h3>
<a class="install_plugins block_level" href="?serendipity[adminModule]=plugins&amp;serendipity[adminAction]=addnew&amp;serendipity[type]=event">{$CONST.CLICK_HERE_TO_INSTALL_PLUGIN|sprintf:"{$CONST.EVENT_PLUGIN}"}</a>
{$backend_plugins_event_header}
{$event_plugins}
</section>
{if $memsnaps}
<section>
<h3>Memory Usage</h3>
<pre>{$memSnaps|print_r}</pre>
</section>
{/if}
{/if}
@@ -1,66 +0,0 @@
{* HTML5: Yes *}
{* jQuery: No *}
{* serendipity_plugins_admin.inc.php::serendipity_plugin_config() *}
<script>
var const_view = '{$CONST.VIEW_FULL}';
var const_hide = '{$CONST.HIDE}';
var img_plus = '{serendipity_getFile file="img/plus.png"}';
var img_minus = '{serendipity_getFile file="img/minus.png"}';
</script>
{if $allow_admin_scripts}
<script src="{serendipity_getFile file='admin/admin_scripts.js'}"></script>
{/if}
{if $showSubmit_head}
<div class="save_conf">
<input name="SAVECONF" type="submit" value="{$CONST.SAVE}">
</div>
{/if}
{if $showTable}
<div id="serendipity_plugin_config">
{/if}
{if is_array($config_groups)}
<a id="optionall" href="#" onClick="showConfigAll({sizeof($config_groups)}); return false" title="{$CONST.TOGGLE_ALL}">{$CONST.TOGGLE_ALL}</a>
{foreach $config_groups AS $config_header => $config_groupkeys}
<h2><a id="optionel{$config_groupkeys@iteration}" href="#" onClick="showConfig('el{$config_groupkeys@iteration}'); return false" title="{$CONST.TOGGLE_OPTION}">{$config_header}</a></h2>
<div id="el{$config_groupkeys@iteration}" class="plugin_optiongroup">
{foreach $config_groupkeys AS $config_groupkey}
{$OUT_STACK[$config_groupkey]}
{/foreach}
</div>
<script>document.getElementById('el{$config_groupkeys@iteration}').style.display = "none";</script>
{/foreach}
{* Is this really necessary? What for? *}
<div id="configuration_footer">&nbsp;</div>
{* If it is not, drop the inline style from CSS. *}
{/if} {* foreach config_groups end *}
{foreach $OUT_STACK_REST as $out_stack_config_item}
{$out_stack_config_item}
{/foreach}
{if $showTable}
</div>
{/if}
{* $serendipity_printConfigJS *}{* outsourced to templates/default/admin/admin_scripts.js - see passed vars on top *}
{if $showSubmit_foot}
<div class="save_conf">
<input name="SAVECONF" type="submit" value="{$CONST.SAVE}">
</div>
{/if}
{if $showExample}
<div>{$plugin_example}</div>
{/if}
{if $spawnNuggets}
{serendipity_hookPlugin hook="backend_wysiwyg_nuggets" eventData=$ev hookAll=true}
{if ($ev['skip_nuggets'] === false)}
<script>
function Spawnnugget() {
{foreach $htmlnugget AS $htmlnuggetid}
Spawnnuggets('{$htmlnuggetid}');
{/foreach}
}
</script>
{/if}
{/if}
-23
View File
@@ -1,23 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
{* functions_plugins_admin.inc.php::function ownership() *}
{if $show_ownership}
{if $is_plugin_owner}
<select name="serendipity[ownership][{$name}]">
<option value="0">{$CONST.ALL_AUTHORS}</option>
{/if}
{foreach $users AS $user}
{if (!$is_plugin_owner && ($user['authorid'] == $authorid))}
{assign var="realname" value="{$user['realname']|escape}"}
{elseif $is_plugin_owner}
<option value="{$user['authorid']}"{($user['authorid'] == $authorid) ? ' selected' : ''}>{$user['realname']|escape}</option>
{/if}
{/foreach}
{if $is_plugin_owner}
</select>
{else}
{(empty($realname)) ? $CONST.ALL_AUTHORS : $realname}
{/if}
{/if}
-83
View File
@@ -1,83 +0,0 @@
{* HTML5: Yes *}
{* jQuery: No *}
{* functions_plugins_admin.inc.php::function_show_plugins() including output of functions_plugins_admin.inc.php::function ownership() *}
{if !$eyecandy}
<form action="?serendipity[adminModule]=plugins" method="post">
{elseif !$event_only}
{* Smarty 3 has a new auto literal option which is enabled by default.
When the { is followed by a space it's not interpreted as smarty delimiter but literal. *}
<script>
function templatePluginMoverInit() {
{foreach $plugin_placements AS $sidebar}
{($is_first) ? 'var ' : ''}list = document.getElementById("{$sidebar}_col");
DragDrop.makeListContainer(list, 'g1');
list.onDragOver = function() { this.style["border"] = "1px solid #4d759b"; };
list.onDragOut = function() { this.style["border"] = "none"; };
{assign var="is_first" value=false}
{/foreach}
}
addLoadEvent(templatePluginMoverInit);
</script>
<form action="?serendipity[adminModule]=plugins" method="post" onsubmit="pluginMovergetSort(); return true">
<input id="order" name="serendipity[pluginorder]" type="hidden" value="">
{else}
<script>addLoadEvent(pluginMoverInitEvent);</script>
<form action="?serendipity[adminModule]=plugins" method="post" onsubmit="pluginMovergetSortEvent(); return true">
<input id="eventorder" name="serendipity[pluginorder]" type="hidden" value="">
{/if}
{$serendipity_setFormToken}
<div class="clearfix pluginmanager">
{foreach $placement as $plugin_placement}
<div class="pluginmanager_side pluginmanager_{($event_only) ? 'event' : 'sidebar'}">
<h4>{$plugin_placement['ptitle']}</h4>
<ol id="{$plugin_placement['pid']}_col" class="pluginmanager_container plainList">
{foreach $plugin_placement['plugin_data'] as $plugin_data}
<li id="{$plugin_data['css_key']}" class="pluginmanager_item_{cycle values="even,uneven"}">
<div id="g{$plugin_data['css_key']}" class="pluginmanager_grablet">
<a id="grab{$plugin_data['css_key']}" class="icon_link" href="#" title="Move"><span class="icon-move"></span><span class="visuallyhidden"> Move</span></a>{* i18n *}
</div>
{if $plugin_data['is_plugin_editable']}
<div class="form_check">
<input id="remove_{$plugin_data['name']}" name="serendipity[plugin_to_remove][]" type="checkbox" value="{$plugin_data['name']}">
<label for="remove_{$plugin_data['name']}" class="visuallyhidden">Remove this plugin</label>{* i18n *}
</div>
{/if}
{if $plugin_data['can_configure']}
<a class="pluginmanager_configure icon_link" href="?serendipity[adminModule]=plugins&amp;serendipity[plugin_to_conf]={$plugin_data['key']}" title="{$CONST.CONFIGURATION}"><span class="icon-cog-alt"></span><span class="visuallyhidden"> {$CONST.CONFIGURATION}</span></a>
{/if}
<h5>
{if $plugin_data['can_configure']}
<a title="{$plugin_data['name']}" href="?serendipity[adminModule]=plugins&amp;serendipity[plugin_to_conf]={$plugin_data['key']}">{$plugin_data['title']}</a>
{else}
{$plugin_data['title']}
{/if}
</h5>
<ul class="pluginmanager_plugininfo plainList">
<li class="pluginmanager_description">{$plugin_data['desc']}</li>
<li class="pluginmanager_ownership">{$plugin_data['ownership']}</li>
{($eyecandy) ? '<noscript>' : ''}
<li class="pluginmanager_place">{$plugin_data['place']}</li>
<li class="pluginmanager_move">{$plugin_data['moveup']} {$plugin_data['movedown']}</li>
{($eyecandy) ? '</noscript>' : ''}
</ul>
</li>
{/foreach}
</ol>
</div>
{/foreach}
<span class="plugin_count block_level">{$CONST.PLUGIN_AVAILABLE_COUNT|sprintf:$total}</span>
</div>
<div class="form_buttons">
<input name="REMOVE" type="submit" title="{$CONST.DELETE}" value="{$CONST.REMOVE_TICKED_PLUGINS}">
<input name="SAVE" type="submit" title="{$CONST.SAVE_CHANGES_TO_LAYOUT}" value="{$CONST.SAVE}">
</div>
</form>
-71
View File
@@ -1,71 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
{if $adminAction == 'install'}
<span class="msg_success"><span class="icon-ok-circle"></span> {$install_template|string_format:"{$CONST.TEMPLATE_SET}"}</span>
{/if}
{if $deprecated}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.WARNING_TEMPLATE_DEPRECATED}</span>
{/if}
<section id="template_options">
<h2>{$CONST.STYLE_OPTIONS} ({$cur_template})</h2>
{if $has_config}
{if $adminAction == 'configure'}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.DONE}: {$save_time}</span>
{/if}
<form method="post" action="serendipity_admin.php">
<input name="serendipity[adminModule]" type="hidden" value="templates">
<input name="serendipity[adminAction]" type="hidden" value="configure">
{$form_token}
{$configuration}
</form>
{else}
<p>{$CONST.STYLE_OPTIONS_NONE}</p>
{/if}
</section>
<section id="template_select">
<h2>{$CONST.SELECT_TEMPLATE}</h2>
<ul class="plainList clearfix">
{foreach $templates as $template=>$info}
{if $info.info.engine == 'yes'}{continue}{/if}
{if !empty($template)}
<li><article class="clearfix">
<h3>{$info.info.name}</h3>
{if $info.fullsize_preview || $info.preview}
<div class="preview_image">
{if $info.fullsize_preview}<a href="{$info.fullsize_preview}">{/if}
{if $info.preview}<img src="{$info.preview}" alt="{$CONST.PREVIEW}" >{/if}
{if $info.fullsize_preview}</a>{/if}
</div>
{/if}
<details class="template_info">
<summary>Template info</summary> {* i18n *}
<dl class="clearfix">
<dt class="template_author">{$CONST.AUTHOR}:</dt>
<dd>{$info.info.author}</dd>
<dt class="template_date">{$CONST.LAST_UPDATED}:</dt>
<dd>{$info.info.date}</dd>
<dt class="template_admin">{$CONST.CUSTOM_ADMIN_INTERFACE}:</dt>
<dd>{$info.info.custom_admin_interface}</dd>
</dl>
</details>
<div class="template_status">
{if $template != $cur_template}
{if !$info.unmetRequirements}
<a class="set_as_template" href="?serendipity[adminModule]=templates&amp;serendipity[adminAction]=install&amp;serendipity[theme]={$template}{$info.info.customURI}">{$CONST.SET_AS_TEMPLATE}</a>
{else}
<span class="unmet_requirements block_level">{$info.unmetRequirements}></span>
{/if}
{else}
<span class="installed block_level">{$CONST.ALREADY_INSTALLED}</span>
{/if}
</div>
</article>
</li>
{/if}
{/foreach}
</ul>
</section>
-116
View File
@@ -1,116 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
{if ($get.action == 'ignore')}
{* TODO: don't know what to put here? *}
{elseif ($get.action == 'upgrade')}
{foreach $call_tasks AS $ctask}
{if $is_callable_task}
{$ctasks}
{/if}
{/foreach}
{if $errors}
<h2>{$CONST.DIAGNOSTIC_ERROR}</h2>
<div class="msg_error">
{foreach $errors AS $implode_err}
<p><span class="icon-attention"></span> {$implode_err}</p>
{/foreach}
</div>
{/if}
{/if}
{if (($showAbort && $get.action == 'ignore') || $get.action == 'upgrade')}
{if $get.action == 'ignore'}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.SERENDIPITY_UPGRADER_YOU_HAVE_IGNORED}</span>
{elseif $get.action == 'upgrade'}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.SERENDIPITY_UPGRADER_NOW_UPGRADED|sprintf:$s9y_version}</span>
{/if}
{if $return_here}
{$print_UPGRADER_RETURN_HERE}
{* could also be used as: {$CONST.SERENDIPITY_UPGRADER_RETURN_HERE|sprintf:"<a href='$serendipityHTTPPath'>":'</a>'} *}
{/if}
{else}
<h2>{$CONST.SERENDIPITY_UPGRADER_WELCOME}</h2>
<p>{$CONST.SERENDIPITY_UPGRADER_PURPOSE|sprintf:$s9y_version_installed}</p>
<p>{$CONST.SERENDIPITY_UPGRADER_WHY|sprintf:$s9y_version}</p>
<h3>{$CONST.FIRST_WE_TAKE_A_LOOK}</h3>
<div class="diagnose">
<span class="msg_notice"><span class="icon-info-circle"></span> {$result_diagnose}.</span>
{if $checksums}
<h4>{$CONST.INTEGRITY}</h4>
<ul>
{foreach $upgraderResultDiagnose1 AS $urd1}
<li>{$urd1}</li>
{/foreach}
</ul>
{/if}
<h4>{$CONST.PERMISSIONS}</h4>
<dl>
<dt>{$basedir}</dt>
{foreach $upgraderResultDiagnose2 AS $urd2}
<dd>{$urd2}</dd>
{/foreach}
<dt>{$basedir}{$CONST.PATH_SMARTY_COMPILE}</dt>
{foreach $upgraderResultDiagnose3 AS $urd3}
<dd>{$urd3}</dd>
{/foreach}
{if $isdir_uploadpath}
<dt>{$basedir}{$uploadHTTPPath}</dt>
{foreach $upgraderResultDiagnose4 AS $urd4}
<dd>{$urd4}</dd>
{/foreach}
{/if}
</dl>
{if $showWritableNote}
<span class="msg_notice"><span class="icon-info-circle"></span> {$CONST.PROBLEM_PERMISSIONS_HOWTO|sprintf:'chmod 1777'}</span>
{/if}
{if ($errorCount > 0)}
<span class="msg_error"><span class="icon-ok-circle"></span> {$CONST.PROBLEM_DIAGNOSTIC}</span>
<a class="icon_link block_level" href="serendipity_admin.php"><span class="icon-help-circle"></span> {$CONST.RECHECK_INSTALLATION}</a>
{/if}
</div>
{if ($errorCount < 1)}
{if (sizeof($sqlfiles) > 0)}
<h3>{$database_update_types}:</h3>
<p>{$CONST.SERENDIPITY_UPGRADER_FOUND_SQL_FILES}:</p>
{if is_array($sqlfiles) && !empty($sqlfiles)}
<ul>
{foreach $sqlfiles as $sqlfile}
<li>{$sqlfile}</li>
{/foreach}
</ul>
{/if}
{/if}
<h3>{$CONST.SERENDIPITY_UPGRADER_VERSION_SPECIFIC}:</h3>
{if is_array($tasks) && !empty($tasks)}
<dl>
{foreach $tasks as $task}
<dt>{$task.version} - {$task.title}</dl>
<dd>{$task.desc|nl2br}</dd>
{/foreach}
</dl>
{/if}
{if ($taskCount == 0)}
<p>{$CONST.SERENDIPITY_UPGRADER_NO_VERSION_SPECIFIC}</p>
{/if}
{if (($taskCount > 0) || (sizeof($sqlfiles) > 0))}
<h3>{$CONST.SERENDIPITY_UPGRADER_PROCEED_QUESTION}</h3>
<a class="block_level" href="{$upgradeLoc}">{$CONST.SERENDIPITY_UPGRADER_PROCEED_DOIT}</a>{if $showAbort} <a href="{$abortLoc}">{$CONST.SERENDIPITY_UPGRADER_PROCEED_ABORT}</a>{/if}
{else}
<h3>{$CONST.SERENDIPITY_UPGRADER_NO_UPGRADES}</h3>
<a class="block_level" href="{$upgradeLoc}">{$CONST.SERENDIPITY_UPGRADER_CONSIDER_DONE}</a>
{/if}
{/if}
{/if}
-91
View File
@@ -1,91 +0,0 @@
{* HTML5: Yes *}
{* jQuery: NN *}
{if $delete_yes}
{if $no_delete_permission}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.CREATE_NOT_AUTHORIZED}</span>
{else}
{if $no_delete_permission_userlevel}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.CREATE_NOT_AUTHORIZED_USERLEVEL}</span>
{else}
{if $delete_permission}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.DELETED_USER|sprintf:"{$user|escape:"html"}":"{$realname|escape:"html"}"}</span>
{else}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.CREATE_NOT_AUTHORIZED_USERLEVEL}</span>
{/if}
{/if}
{/if}
{/if}
{if $save_new}
{if $no_save_permission}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.CREATE_NOT_AUTHORIZED}</span>
{else}
{if $no_group_selected}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.WARNING_NO_GROUPS_SELECTED}</span>
{/if}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.CREATED_USER|sprintf:"# {$user|escape:"html"}":"{$realname|escape:"html"}"}</span>
{/if}
{/if}
{if $save_edit}
{if $no_edit_permission}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.CREATE_NOT_AUTHORIZED}</span>
{else}
{if $no_edit_permission_userlevel}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.CREATE_NOT_AUTHORIZED_USERLEVEL}</span>
{else}
{if $no_group_selected}
<span class="msg_error"><span class="icon-attention"></span> {$CONST.WARNING_NO_GROUPS_SELECTED}</span>
{/if}
<span class="msg_success"><span class="icon-ok-circle"></span> {$CONST.MODIFIED_USER|sprintf:"{$realname|escape:"html"}"}</span>
{/if}
{/if}
{/if}
{if $delete == false}
<h2>{$CONST.USER} ({$CONST.USER_LEVEL})</h2>
<ul id="serendipity_users" class="plainList">
{foreach $users as $user}
{if $user.isEditable}
<li class="clearfix">
<span class="user_name user_{if $user.userlevel >= {$CONST.USERLEVEL_ADMIN}}admin{else}{if $user.userlevel >= {$CONST.USERLEVEL_CHIEF}}chief{else}editor{/if}{/if}"><span class="icon-user"></span> {$user.realname|escape:"html"} ({$user.userlevel})</span>
<ul class="plainList edit_actions">
<li><a class="icon_link" href="{$user.authorUrl}" title="{$CONST.PREVIEW} {$user.realname}"><span class="icon-eye"></span><span class="visuallyhidden"> {$CONST.PREVIEW}</span></a></li>
<li><a class="icon_link" href="?serendipity[adminModule]=users&amp;serendipity[adminAction]=edit&amp;serendipity[userid]={$user.authorid}#editform" title="{$CONST.EDIT} {$user.realname|escape:"html"}"><span class="icon-edit"></span><span class="visuallyhidden"> {$CONST.EDIT}</span></a></li>
<li><a class="icon_link" href="?{$urlFormToken}&amp;serendipity[adminModule]=users&amp;serendipity[adminAction]=delete&amp;serendipity[userid]=$user.authorid" title="{$CONST.DELETE} {$user.realname|escape:"html"}"><span class="icon-trash"></span><span class="visuallyhidden"> {$CONST.DELETE}</span></a></li>
</ul>
</li>
{/if}
{/foreach}
</ul>
{if $new}
<form action="?serendipity[adminModule]=users" method="post">
<input name="NEW" type="submit" value="{$CONST.CREATE_NEW_USER}">
</form>
{/if}
{/if}
{if $show_form}
<form{if $adminAction == 'edit'} id="editform"{/if} action="?serendipity[adminModule]=users#editform" method="post">
{$formToken}
{if $adminAction == 'edit'}{if $create_permission}<input name="serendipity[user]" type="hidden" value="{$from.authorid}">{/if}{/if}
<h3>{if $adminAction == 'edit'}{if $no_create_permission}{$CONST.CREATE_NOT_AUTHORIZED}: {$CONST.EDIT}{else}{if $create_permission}{$CONST.EDIT}{else}{$CONST.CREATE_NOT_AUTHORIZED}: {$CONST.EDIT}{/if}{/if}{else}{$CONST.CREATE}{/if}</h3>
{$config}
{if $adminAction == 'edit'}
<input name="SAVE_EDIT" type="submit" value="{$CONST.SAVE}">
{else}
<input name="SAVE_NEW" type="submit" value="{$CONST.CREATE_NEW_USER}">
{/if}
</form>
{else}
{if $delete}
<form action="?serendipity[adminModule]=users" method="post">
{$formToken}
<input name="serendipity[user]" type="hidden" value="{$userid}">
<fieldset class="users_delete_action">
<legend><span>{$CONST.DELETE_USER|sprintf:"{$userid}":"{$realname|escape:"html"}"}</span></legend>
<input name="DELETE_YES" type="submit" value="{$CONST.DUMP_IT}">
<input name="NO" type="submit" value="{$CONST.NOT_REALLY}">
</fieldset>
</form>
{/if}
{/if}
-207
View File
@@ -1,207 +0,0 @@
{if $post_save}
{if $new}
<div class="serendipityAdminMsgSuccess msg_success">
<img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_success.png'}" alt="" />
{$CONST.CATEGORY_SAVED}
</div>
{/if}
{if $edit}
{if isset($editPermission) && $editPermission == false}
<div class="serendipityAdminMsgError msg_error">
<img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_error.png'}" alt="" />
{$CONST.PERM_DENIED}
</div>
{else}
{if $subcat}
{$subcat}
{else}
<div class="serendipityAdminMsgSuccess msg_success">
<img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_success.png'}" alt="" />
{$CONST.CATEGORY_SAVED}
</div>
{/if}
{/if}
{/if}
{/if}
{if $doDelete}
{if $deleteSuccess}
<div class="serendipityAdminMsgSuccess msg_success">
<img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_success.png'}" alt="" />
{if $remainingCat}
{$CONST.CATEGORY_DELETED_ARTICLES_MOVED|sprintf:$remainingCat:$cid}
{else}
{$cid|string_format:"{$CONST.CATEGORY_DELETED}"}
{/if}
</div>
{else}
<div class="serendipityAdminMsgError msg_error">
<img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_error.png'}" alt="" />
{$CONST.INVALID_CATEGORY}
</div>
{/if}
{/if}
{if $delete}
{if $deletePermission == true}
<form method="POST" name="serendipityCategory" action="?serendipity[adminModule]=category&amp;serendipity[adminAction]=doDelete&amp;serendipity[cid]={$cid}">
{$formToken}
<h3>{$categoryName|escape:"html"}</h3>
{$CONST.CATEGORY_REMAINING}:
<select name="serendipity[cat][remaining_catid]">
<option value="0">- {$CONST.NO_CATEGORY} -</option>
{foreach $cats as $cat_data}
<option value="{$cat_data.categoryid}">{$cat_data.category_name|escape:"html"}</option>
{/foreach}
</select>
<input type="submit" name="REMOVE" value="{$CONST.GO}" class="serendipityPrettyButton input_button">
</form>
{/if}
{/if}
{if (! $post_save) && ($edit || $new)}
{if $edit}
<strong>{$category_name|escape:"html"|string_format:"{$CONST.EDIT_THIS_CAT}"}</strong>
{/if}
<form method="POST" name="serendipityCategory">
{$formToken}
<table cellpadding="5" width="100%">
<tr>
<td>{$CONST.NAME}</td>
<td><input class="input_textbox" type="text" name="serendipity[cat][name]" value="{$this_cat.category_name|default:""|escape:"html"}" /></td>
<td rowspan="5" align="center" valign="middle" width="200" style="border: 1px solid #ccc">
<img src="{$this_cat.category_icon|default:""|escape:"html"}" id="imagepreview" {if ! $this_cat.category_icon} style="display: none" {/if} />
</td>
</tr>
<tr>
<td>{$CONST.DESCRIPTION}</td>
<td><input class="input_textbox" type="text" name="serendipity[cat][description]" value="{$this_cat.category_description|default:""|escape:"html"}" /></td>
</tr>
<tr>
<td>{$CONST.IMAGE}</td>
<td>
<script type="text/javascript" language="JavaScript" src="serendipity_editor.js"></script>
<input class="input_textbox" type="text" id="img_icon" name="serendipity[cat][icon]" value="{$this_cat.category_icon|default:""|escape:"html"}" onchange="document.getElementById('imagepreview').src = this.value; document.getElementById('imagepreview').style.display = '';" />
<script type="text/javascript" language="JavaScript">
var img_icon = document.getElementById('img_icon');
var imgBtn = document.createElement('div');
imgBtn.id = "category_ml_popup";
imgBtn.innerHTML = '<input type="button" name="insImage" value="{$CONST.IMAGE}" onclick="window.open(\'serendipity_admin_image_selector.php?serendipity[htmltarget]=img_icon&amp;serendipity[filename_only]=true\', \'ImageSel\', \'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1\');" class="serendipityPrettyButton input_button" />';
img_icon.parentNode.insertBefore(imgBtn, img_icon.nextSibling);
</script>
</td>
</tr>
<tr>
<td><label for="read_authors">{$CONST.PERM_READ}</label></td>
<td>
<select size="6" id="read_authors" multiple="multiple" name="serendipity[cat][read_authors][]">
<option value="0" {if $selectAllReadAuthors}selected="selected"{/if}>{$CONST.ALL_AUTHORS}</option>
{foreach $groups as $group}
<option value="{$group.confkey}"
{if isset($read_groups.{$group.confkey})}
selected="selected"
{/if} >
{$group.confvalue|escape:"html"}
</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td><label for="write_authors"><{$CONST.PERM_WRITE}</label></td>
<td>
<select size="6" id="write_authors" multiple="multiple" name="serendipity[cat][write_authors][]">
<option value="0" {if $selectAllReadAuthors}selected="selected"{/if}>{$CONST.ALL_AUTHORS}</option>
{foreach $groups as $group}
<option value="{$group.confkey}" {if isset($read_groups.{$group.confkey})} selected="selected" {/if} > {$group.confvalue|escape:"html"}</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td><label for="parent_cat">{$CONST.PARENT_CATEGORY}</label></td>
<td>
<select id="parent_cat" name="serendipity[cat][parent_cat]">
<option value="0" {if $cid == 0} selected="selected" {/if}>[ {$CONST.NO_CATEGORY} ]</option>
{foreach $categories as $cat}
{* We can't be our own parent, the universe will collapse *}
{if $cat.categoryid == $cid}{continue}{/if}
<option value="{$cat.categoryid}" {if $this_cat.parentid == $cat.categoryid} selected="selected"{/if} >
{for $i=1 to $cat.depth}&nbsp{/for} $cat.category_name
</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td><{$CONST.CATEGORY_HIDE_SUB}<br /><em>{$CONST.CATEGORY_HIDE_SUB_DESC}</em></td>
<td valign="top">
<input class="input_radio" type="radio" name="serendipity[cat][hide_sub]" value="0"
{if $this_cat.hide_sub == 0}
checked="checked"
{/if}
id="hide_sub_no" />
<label for="hide_sub_no">
{$CONST.NO}
</label>
<input class="input_radio" type="radio" name="serendipity[cat][hide_sub]" value="1" {if $this_cat.hide_sub== 1} checked="checked"{/if} id="hide_sub_yes" /> <label for="hide_sub_yes">{$CONST.YES}</label>
</td>
</tr>
</table>
<div><input type="submit" name="SAVE" value="{$save}" class="serendipityPrettyButton input_button" /></div>
</form>
{/if}
{if $view}
{if is_array($viewCats)}
{$CONST.CATEGORY_INDEX}:
{else}
<div align="center">- {$CONST.NO_CATEGORIES} -</div>
{/if}
<br /><br />
<table cellspacing="0" cellpadding="4" width="100%" border=0>
{foreach $viewCategories as $category}
<tr>
<td width="16">
<a title="{$CONST.EDIT}" href="?serendipity[adminModule]=category&amp;serendipity[adminAction]=edit&amp;serendipity[cid]={$category.categoryid}">
<img src="{serendipity_getFile file='admin/img/edit.png'}" border="0" alt="{$CONST.EDIT}" />
</a>
</td>
<td width="16">
<a title="{$CONST.DELETE}" href="?serendipity[adminModule]=category&amp;serendipity[adminAction]=delete&amp;serendipity[cid]={$category.categoryid}">
<img src="{serendipity_getFile file='admin/img/delete.png'}" border="0" alt="{$CONST.DELETE}" />
</a>
</td>
<td width="16">
{if $category.category_icon}
<img src="{serendipity_getFile file='admin/img/thumbnail.png'}" alt="" />
{else}
&nbsp;
{/if}
</td>
<td width="300" style="padding-left: {$category.depth*15+20}px">
<img src="{serendipity_getFile file='admin/img/folder.png'}" style="vertical-align: bottom;">
{$category.category_name|escape:"html"}
</td>
<td>
{$category.category_description|escape:"html"}
</td>
<td align="right">
{if $category.authorid == 0}
{$CONST.ALL_AUTHORS}
{else}
{$category.realname|escape:"html"}
{/if}
</td>
</tr>
{/foreach}
<tr>
<td colspan="6" align="right">
<a href="?serendipity[adminModule]=category&serendipity[adminAction]=new" class="serendipityPrettyButton input_button">{$CONST.CREATE_NEW_CAT}</a>
</td>
</tr>
</table>
{/if}
-202
View File
@@ -1,202 +0,0 @@
{if !empty($errormsg)}
<p class="serendipityAdminMsgNote msg_notice"><img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_note.png'}" alt="" />{$errormsg}</p>
{/if}
<script type="text/javascript">
var view_full = '{$CONST.VIEW_FULL}';
var view_hide = '{$CONST.HIDE}';
</script>
<script src="serendipity_editor.js"></script>
<form action="" method="GET" style="margin: 0">
{$formtoken}
<input type="hidden" name="serendipity[adminModule]" value="comments" />
<input type="hidden" name="serendipity[page]" value="{$page}" />
<table class="serendipity_admin_filters" width="100%">
<tr>
<td colspan="6" class="serendipity_admin_filters_headline"><strong>{$CONST.FILTERS}</strong> - {$CONST.FIND_COMMENTS}</td>
</tr>
<tr>
<td>{$CONST.AUTHOR}:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][author]" size="15" value="{$get.filter.author|escape}" /></td>
<td>{$CONST.EMAIL}:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][email]" size="15" value="{$get.filter.email|escape}" /></td>
<td>{$CONST.URL}:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][url]" size="15" value="{$get.filter.url|escape}" /></td>
</tr>
<tr>
<td>IP:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][ip]" size="15" value="{$get.filter.ip|escape}" /></td>
<td>{$CONST.CONTENT}:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][body]" size="15" value="{$get.filter.body|escape}" /></td>
<td>{$CONST.REFERER}:</td>
<td><input class="input_textbox" type="text" name="serendipity[filter][referer]" size="15" value="{$get.filter.referer|escape}" /></td>
</tr>
<tr>
<td>{$CONST.COMMENTS}:</td>
<td>
{* Smarty 3 does support ternary syntax e.g. {('N'==$foo)?'Yes':'No'} *}
<select name="serendipity[filter][perpage]">
{foreach $filter_vals AS $filter}
<option value="{$filter}" {($commentsPerPage == $filter) ? ' selected="selected"' : ''}>{$filter}</option>
{/foreach}
</select>
</td>
<td>{$CONST.COMMENTS_FILTER_SHOW}:</td>
<td>
<select name="serendipity[filter][show]">
<option value="all"{if $get.filter.show == 'all'} selected="selected"{/if}>{$CONST.COMMENTS_FILTER_ALL}</option>
<option value="approved"{if $get.filter.show == 'approved'} selected="selected"{/if}>{$CONST.COMMENTS_FILTER_APPROVED_ONLY}</option>
<option value="pending"{if $get.filter.show == 'pending'} selected="selected"{/if}>{$CONST.COMMENTS_FILTER_NEED_APPROVAL}</option>
<option value="confirm"{if $get.filter.show == 'confirm'} selected="selected"{/if}>{$CONST.COMMENTS_FILTER_NEED_CONFIRM}</option>
</select>
</td>
<td>{$CONST.TYPE}</td>
<td>
<select name="serendipity[filter][type]">
<option value="">{$CONST.COMMENTS_FILTER_ALL}</option>
<option value="NORMAL"{if $c_type == 'NORMAL'} selected="selected"{/if}>{$CONST.COMMENTS}</option>
<option value="TRACKBACK"{if $c_type == 'TRACKBACK'} selected="selected"{/if}>{$CONST.TRACKBACKS}</option>
<option value="PINGBACK"{if $c_type == 'PINGBACK'} selected="selected"{/if}>{$CONST.PINGBACKS}</option>
</select>
</td>
</tr>
<tr>
<td colspan="6" align="right"><input type="submit" name="submit" value=" - {$CONST.GO} - " class="serendipityPrettyButton input_button" /> {serendipity_hookPlugin hookAll=true hook="backend_comments_top" addData=$sql}</td>
</tr>
</table>
</form>
<hr noshade="noshade" /><br />
{if !is_array($sql)}
<div align="center">- {$CONST.NO_COMMENTS} -</div>
<div align="center">- Return to default comment list <a href="serendipity_admin.php?serendipity[adminModule]=comments">"here"</a>. -</div>
{else}
<form action="" method="POST" name="formMultiDelete" id="formMultiDelete">
{$formtoken}
<input type="hidden" name="serendipity[formAction]" value="multiDelete" />
<table width="100%" cellpadding="3" border="0" cellspacing="0">
<tr>
<td align="center">
<table width="100%" cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
{if ( $page != 1 && $page <= $pages )}
<a href="{$linkPrevious}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/previous.png'}" />{$CONST.PREVIOUS}</a>
{/if}
</td>
<td align="center">{$CONST.PAGE_BROWSE_COMMENTS|sprintf:$page:$pages:$totalComments}</td>
<td align="right">
{if $page != $pages}
<a href="{$linkNext}" class="serendipityIconLinkRight">{$CONST.NEXT}<img src="{serendipity_getFile file='admin/img/next.png'}" /></a>
{/if}
</td>
</tr>
</table>
</td>
</tr>
{if is_array($comments)}
{* see dashboard PoC :: block_comments_pending.tpl or block_comments.tpl as example *}
{foreach $comments AS $comment}
<tr>
<td class="{$comment.header_class}">
{if !empty($comment.header_class)}
<img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_note.png'}" alt="" />
{/if}
<a name="c{$comment.id}"></a>{* NOTE: a $comment.pubdate with 'c' is available *}
{($comment.type == 'NORMAL') ? $CONST.COMMENT : (($comment.type == 'TRACKBACK') ? $CONST.TRACKBACK : $CONST.PINGBACK )} #{$comment.id}, {$CONST.IN_REPLY_TO} <strong><a href="{$comment.entry_url}">{$comment.title|escape}</a></strong>{$CONST.ON} {$comment.timestamp|@formatTime:'%b %e %Y, %H:%M'}
</td>
</tr>
<tr>
<td class="serendipity_admin_list_item {$comment.class}" id="comment_{$comment.id}">
<table width="100%" cellspacing="0" cellpadding="3" border="0">
<tr>
<td rowspan="3" width="20" align="center"><input class="input_checkbox" type="checkbox" name="serendipity[delete][{$comment.id}]" value="{$comment.entry_id}" onclick="highlightComment('comment_{$comment.id}', this.checked)" tabindex="{$i}" /></td>
<td width="40%"><strong>{$CONST.AUTHOR}</strong>: {$comment.author|escape|truncate:30:"&hellip;"} {$comment.action_author}</td>
<td><strong>{$CONST.EMAIL}</strong>:
{if empty($comment.email)} N/A {else}
<a href="mailto:{$comment.email|escape}" title="{$comment.email|escape}">{$comment.email|escape|truncate:30:"&hellip;"}</a>
{if $comment.subscribed == 'true'} <span class="serendipity_subscription_on">({$CONST.ACTIVE_COMMENT_SUBSCRIPTION})</span>{/if}
{/if}
{$comment.action_email}
</td>
</tr>
<tr>
<td width="40%"><strong>IP</strong>:
{if empty($comment.ip)} 0.0.0.0 {else} {$comment.ip|escape} {/if}
{$comment.action_ip}
</td>
<td><strong>{$CONST.URL}</strong>:
{if empty($comment.url)} N/A {else} <a href="{$comment.url|escape}" title="{$comment.url|escape}" target="_blank">{$comment.url|escape|truncate:30:"&hellip;"}</a> {/if}
{$comment.action_url}
</td>
</tr>
<tr>
<td width="40%">&nbsp;</td>
<td><strong>{$CONST.REFERER}</strong>:
{if empty($comment.referer)} N/A {else} <a href="{$comment.referer|escape}" title="{$comment.referer|escape}" target="_blank">{$comment.referer|escape|truncate:30:"&hellip;"}</a> {/if}
{$comment.action_referer}
</td>
<tr>
<td style="border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC" colspan="3">
<div id="{$comment.id}_summary">{$comment.summary}</div>
<div id="{$comment.id}_full" style="display: none">{$comment.fullBody}</div>
</td>
</tr>
</table>
{if ($comment.status == 'pending') || ($comment.status == 'confirm')}
<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=approve&amp;serendipity[id]={$comment.id}&amp;{$urltoken}" class="serendipityIconLink" title="{$CONST.APPROVE}"><img src="{serendipity_getFile file='admin/img/accept.png'}" alt="{$CONST.APPROVE}" />{$CONST.APPROVE}</a>
{/if}
{if ($comment.status == 'approved')}
<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=pending&amp;serendipity[id]={$comment.id}&amp;{$urltoken}" class="serendipityIconLink" title="{$CONST.SET_TO_MODERATED}"><img src="{serendipity_getFile file='admin/img/clock.png'}" alt="{$CONST.SET_TO_MODERATED}" />{$CONST.SET_TO_MODERATED}</a>
{/if}
{if $comment.excerpt}
<a href="#c{$comment.id}" onclick="FT_toggle({$comment.id}); return false;" title="{$CONST.VIEW}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/zoom.png'}" alt="{$CONST.TOGGLE_ALL}" /><span id="{$comment.id}_text">{$CONST.TOGGLE_ALL}</span></a>
{/if}
<a target="_blank" href="{$comment.entrylink}" title="{$CONST.VIEW}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/zoom.png'}" alt="{$CONST.VIEW}" />{$CONST.VIEW}</a>
<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=edit&amp;serendipity[id]={$comment.id}&amp;serendipity[entry_id]={$comment.entry_id}&amp;{$urltoken}" title="{$CONST.EDIT}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/edit.png'}" alt="{$CONST.EDIT}" />{$CONST.EDIT}</a>
<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=delete&amp;serendipity[id]={$comment.id}&amp;serendipity[entry_id]={$comment.entry_id}&amp;{$urltoken}" onclick='return confirm("{($CONST.COMMENT_DELETE_CONFIRM|sprintf:$comment.id:$comment.author)|escape}")' title="{$CONST.DELETE}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/delete.png'}" alt="{$CONST.DELETE}" />{$CONST.DELETE}</a>
<a target="_blank" onclick="cf = window.open(this.href, 'CommentForm', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1'); cf.focus(); return false;" href="?serendipity[action]=admin&amp;serendipity[adminModule]=comments&amp;serendipity[adminAction]=reply&amp;serendipity[id]={$comment.id}&amp;serendipity[entry_id]={$comment.entry_id}&amp;serendipity[noBanner]=true&amp;serendipity[noSidebar]=true&amp;{$urltoken}" title="{$CONST.REPLY}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/user_editor.png'}" alt="{$CONST.REPLY}" />{$CONST.REPLY}</a>
{$comment.action_more}
</td>
</tr>
<tr>
<td><hr noshade="noshade" /></td>
</tr>
{/foreach}
{/if}{* array $comments end *}
<tr>
<td>
<input type="button" name="toggle" value="{$CONST.INVERT_SELECTIONS}" onclick="invertSelection()" class="serendipityPrettyButton input_button" />
<input type="submit" name="toggle" value="{$CONST.DELETE_SELECTED_COMMENTS}" onclick="return confirm('{$CONST.COMMENTS_DELETE_CONFIRM}')" tabindex="{($i+1)}" class="serendipityPrettyButton input_button" />
<input type="submit" name="serendipity[togglemoderate]" value="{$CONST.MODERATE_SELECTED_COMMENTS}" class="serendipityPrettyButton input_button" />
</td>
</tr>
</table>
<table width="100%" cellpadding="3" border="0" cellspacing="0">
<tr>
<td align="center">
<table width="100%" cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
{if ( $page != 1 && $page <= $pages )}
<a href="{$linkPrevious}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/previous.png'}" />{$CONST.PREVIOUS}</a>
{/if}
</td>
<td align="center">{$CONST.PAGE_BROWSE_COMMENTS|sprintf:$page:$pages:$totalComments}</td>
<td align="right">
{if $page != $pages}
<a href="{$linkNext}" class="serendipityIconLinkRight">{$CONST.NEXT}<img src="{serendipity_getFile file='admin/img/next.png'}" /></a>
{/if}
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
{/if} {* if no comments else comments end *}
@@ -1,31 +0,0 @@
{if $installAction == "check"}
{if $diagnosticError}
{$CONST.DIAGNOSTIC_ERROR}
<div class="serendipityAdminMsgError msg_error">-
<img class="img_error" src="{serendipity_getFile file="admin/img/admin_msg_error.png"}" alt="" />
{foreach $res as $r}
{$r} <br />
{/foreach}
</div>
<br />
<br />
{else}
{if $htaccessRewrite}
{$CONST.ATTEMPT_WRITE_FILE|sprintf:"{$serendipityPath}htaccess"}
{if is_array($res)}
{foreach $res as $r}
{$r} <br />
{/foreach}
{else}
{$CONST.DONE} <br />
{/if}
{/if}
<br />
<div class="serendipityAdminMsgSuccess msg_success">
<img class="img_error" src="{serendipity_getFile file="admin/img/admin_msg_success.png"}" alt="" />
{$CONST.WRITTEN_N_SAVED}
</div>
{/if}
{else}
{$config}
{/if}
-252
View File
@@ -1,252 +0,0 @@
{if $drawList}
<div class="serendipity_admin_list">
<form action="?" method="get">
<input type="hidden" name="serendipity[action]" value="admin" />
<input type="hidden" name="serendipity[adminModule]" value="entries" />
<input type="hidden" name="serendipity[adminAction]" value="editSelect" />
<table width="100%" class="serendipity_admin_filters">
<tr>
<td class="serendipity_admin_filters_headline" colspan="6"><strong>{$CONST.FILTERS}</strong> - {$CONST.FIND_ENTRIES}</td>
</tr>
<tr>
<td valign="top" width="80">{$CONST.AUTHOR}</td>
<td valign="top">
<select name="serendipity[filter][author]">
<option value="">--</option>
{if is_array($users)}
{foreach $users AS $user}
{if isset($user.artcount) && $user.artcount < 1}{continue}{/if}
<option value="{$user.authorid}" {(isset($get.filter.author) && ($get.filter.author == $user.authorid)) ? 'selected="selected"' : ''}>{$user.realname|escape}</option>
{/foreach}
{/if}
</select>
<select name="serendipity[filter][isdraft]">
<option value="all">{$CONST.COMMENTS_FILTER_ALL}</option>
<option value="draft" {(isset($get.filter.isdraft) && ($get.filter.isdraft == 'draft') ? 'selected="selected"' : '')}>{$CONST.DRAFT}</option>
<option value="publish" {(isset($get.filter.isdraft) && ($get.filter.isdraft == 'publish') ? 'selected="selected"' : '')}>{$CONST.PUBLISH}</option>
</select>
</td>
<td valign="top" width="80">{$CONST.CATEGORY}</td>
<td valign="top">
<select name="serendipity[filter][category]">
<option value="">--</option>
{foreach $categories as $cat}
<option value="{$cat.categoryid}"{($get.filter.category == $cat.categoryid) ? ' selected="selected"' : ''}>{'&nbsp;'|str_repeat:$cat.depth} {$cat.category_name|escape}</option>
{/foreach}
</select>
</td>
<td valign="top" width="80">{$CONST.CONTENT}</td>
<td valign="top"><input class="input_textbox" size="10" type="text" name="serendipity[filter][body]" value="{(isset($get.filter.body)) ? "{$get.filter.body|escape}" : ''}" /></td>
</tr>
<tr>
<td class="serendipity_admin_filters_headline" colspan="6"><strong>{$CONST.SORT_ORDER}</strong></td>
</tr>
<tr>
<td>
{$CONST.SORT_BY}
</td>
<td>
<select name="serendipity[sort][order]">
{foreach $sort_order as $so_key => $so_val}
<option value="{$so_key}" {(isset($get.sort.order) && ($get.sort.order == $so_key) ? 'selected="selected"': '')}>{$so_val}</option>
{/foreach}
</select>
</td>
<td>{$CONST.SORT_ORDER}</td>
<td>
<select name="serendipity[sort][ordermode]">
<option value="DESC" {(isset($get.sort.ordermode) && ($get.sort.ordermode == 'DESC') ? 'selected="selected"' : '')}>{$CONST.SORT_ORDER_DESC}</option>
<option value="ASC" {(isset($get.sort.ordermode) && ($get.sort.ordermode == 'ASC') ? 'selected="selected"' : '')}>{$CONST.SORT_ORDER_ASC}</option>
</select>
</td>
<td>{$CONST.ENTRIES_PER_PAGE}</td>
<td>
<select name="serendipity[sort][perPage]">
{foreach $per_page AS $per_page_nr}
<option value="{$per_page_nr}" {((isset($get.sort.perPage) && ($get.sort.perPage == $per_page_nr)) ? 'selected="selected"' : '')}>{$per_page_nr}</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td align="right" colspan="6"><input type="submit" name="go" value="{$CONST.GO}" class="serendipityPrettyButton input_button" /></td>
</tr>
</table>
</form>
{if $is_entries}
<table class="serendipity_admin_list" cellpadding="5" width="100%">
<tr>
<td>
{if $offSet > 0}
<a href="{$linkPrevious}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/previous.png'}" />{$CONST.PREVIOUS}</a>
{/if}
</td>
<td align="right">
{if $count > $perPage}
<a href="{$linkNext}" class="serendipityIconLinkRight">{$CONST.NEXT}<img src="{serendipity_getFile file='admin/img/next.png'}" /></a>
{/if}
</td>
</tr>
</table>
<script type="text/javascript" language="JavaScript" src="{serendipity_getFile file='admin/admin_scripts.js'}"></script>
<form action="?" method="post" name="formMultiDelete" id="formMultiDelete">
{$formtoken}
<input type="hidden" name="serendipity[action]" value="admin" />
<input type="hidden" name="serendipity[adminModule]" value="entries" />
<input type="hidden" name="serendipity[adminAction]" value="multidelete" />
{foreach $entries as $entry}
{if ($entry@index > $perPage)}{continue}{/if}
<div class="serendipity_admin_list_item serendipity_admin_list_item_{($entry@index % 2) ? 'even' : 'uneven'}">
<table width="100%" cellspacing="0" cellpadding="3">
<tr>
<td>
<strong>{if (!$showFutureEntries) && ($entry.timestamp >= $serverOffsetHour)}<a href="#" title="{$CONST.ENTRY_PUBLISHED_FUTURE}" onclick="alert(this.title)"><img src="{serendipity_getFile file='admin/img/clock_future.png'}" alt="*" style="border: 0px none ; vertical-align: bottom;" /></a> {else}{/if}{if $entry.ep_is_sticky} {$CONST.STICKY_POSTINGS}: {/if}{if $entry.isdraft}{$CONST.DRAFT}: {/if}<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=edit&amp;serendipity[id]={$entry.id}" title="#{$entry.id}">{$entry.title|escape|truncate:50:"&hellip;"}</a></strong>
</td>
<td align="right">
{* Find out if the entry has been modified later than 30 minutes after creation *}
{$entry.timestamp|@formatTime:"{$CONST.DATE_FORMAT_SHORT}"} {if $entry.timestamp <= ($entry.last_modified - (60*30))}<a href="#" title="{$CONST.LAST_UPDATED}: {$entry.last_modified|@formatTime:"{$CONST.DATE_FORMAT_SHORT}"}" onclick="alert(this.title)"><img src="{serendipity_getFile file='admin/img/clock.png'}" alt="*" style="border: 0px none ; vertical-align: bottom;" /></a>{else}{/if}
</td>
</tr>
<tr>
<td>
{$CONST.POSTED_BY} {$entry.author|escape}
{if count($entry.cats)}
{$CONST.IN}
{foreach $entry.cats AS $cat}
{$cat}{if (count($entry.cats) > 1) && !$cat@last}, {/if}
{/foreach}
{/if}
</td>
<td align="right">
{if $entry.preview || (!$showFutureEntries && ($entry.timestamp >= $serverOffsetHour))}
<a href="{$entry.preview_link}" title="{$CONST.PREVIEW} #{$entry.id}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/zoom.png'}" alt="{$CONST.PREVIEW}" />{$CONST.PREVIEW}</a>
{else}
<a href="{$entry.archive_link}" title="{$CONST.VIEW} #{$entry.id}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/zoom.png'}" alt="{$CONST.VIEW}" />{$CONST.VIEW}</a>
{/if}
<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=edit&amp;serendipity[id]={$entry.id}" title="{$CONST.EDIT} #{$entry.id}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/edit.png'}" alt="{$CONST.EDIT}" />{$CONST.EDIT}</a>
<a href="?serendipity[action]=admin&amp;serendipity[adminModule]=entries&amp;serendipity[adminAction]=delete&amp;serendipity[id]={$entry.id}&amp;{$urltoken}" title="{$CONST.DELETE} #{$entry.id}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/delete.png'}" alt="{$CONST.DELETE}" />{$CONST.DELETE}</a>
<input class="input_checkbox" type="checkbox" name="serendipity[multiDelete][]" value="{$entry.id}" />
</td>
</tr>
</table>
</div>
{/foreach}
{/if} {* end is_entries *}
<table class="serendipity_admin_list" cellpadding="5" width="100%">
<tr>
<td>
{if $offSet > 0}
<a href="{$linkPrevious}" class="serendipityIconLink"><img src="{serendipity_getFile file='admin/img/previous.png'}" />{$CONST.PREVIOUS}</a>
{/if}
</td>
<td align="right">
{if $count > $perPage}
<a href="{$linkNext}" class="serendipityIconLinkRight">{$CONST.NEXT}<img src="{serendipity_getFile file='admin/img/next.png'}" /></a>
{/if}
</td>
</tr>
</table>
<table class="serendipity_admin_list" cellpadding="0" width="100%">
<tr>
<td align="right">
<input type="button" name="toggle" value="{$CONST.INVERT_SELECTIONS}" onclick="invertSelection()" class="serendipityPrettyButton input_button" />
<input type="submit" name="toggle" value="{$CONST.DELETE_SELECTED_ENTRIES}" class="serendipityPrettyButton input_button" />
</td>
</tr>
</table>
</form>
<div class="serendipity_admin_list_item serendipity_admin_list_item_{(($entry@index+1) % 2) ? 'even' : 'uneven'}">
<table width="100%" cellspacing="0" cellpadding="3">
<tr>
<td>
<form action="?" method="get">
<input type="hidden" name="serendipity[action]" value="admin" />
<input type="hidden" name="serendipity[adminModule]" value="entries" />
<input type="hidden" name="serendipity[adminAction]" value="editSelect" />
{$CONST.EDIT_ENTRY}: #<input class="input_textbox" type="text" size="3" name="serendipity[id]" /> <input type="submit" name="serendipity[editSubmit]" value="{$CONST.GO}" class="serendipityPrettyButton input_button" />
</form>
</td>
</tr>
</table>
</div>
</div><!-- // div.serendipity_admin_list drawList end -->
{/if}{* $drawList end *}
{if $no_entries}
<div class="serendipity_admin_list">
{* We've got nothing *}
<table class="serendipity_admin_list" cellpadding="0" width="100%">
<tr>
<td align="center" class="serendipityAdminMsgNote msg_notice">
<img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_note.png'}" alt="" />
{$CONST.NO_ENTRIES_TO_PRINT}
</td>
</tr>
</table>
</div><!-- // div.serendipity_admin_list no entries end -->
{/if}
{if $switched_output}
{if ($get.adminAction && $dateval)}
{$CONST.DATE_INVALID}
<br />
{/if}
{if ($get.adminAction && $use_legacy)}
{if $is_draft}
<div class="serendipityAdminMsgSuccess msg_success"><img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_success.png'}" alt="" />{$CONST.IFRAME_SAVE_DRAFT}</div><br />
{/if}
{if $is_iframe}
<div class="serendipityAdminMsgSuccess msg_success"><img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_success.png'}" alt="" />{$CONST.IFRAME_SAVE}</div><br />
{/if}
{if $is_iframepreview}
<div class="serendipityAdminMsgSuccess msg_success"><img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_success.png'}" alt="" />{$CONST.IFRAME_PREVIEW}</div><br />
{/if}
{/if}
{if ($is_doDelete || $is_doMultiDelete )}
{foreach $del_entry AS $delent}
{$delent}
<br />
{/foreach}
{/if}
{if ( $is_delete || $is_multidelete )}
{* delent and ripent look like $CONST.DELETE_SURE|sprintf:"$del_entry_id - $del_entry_title" *}
{foreach $rip_entry AS $ripent}
{$ripent}
<br />
{/foreach}
<br />
<br />
<div>
<a href="{$smarty.server.HTTP_REFERER|escape}" class="serendipityPrettyButton input_button">{$CONST.NOT_REALLY}</a>
{'&nbsp;'|str_repeat:10}
<a href="{$newLoc}" class="serendipityPrettyButton input_button">{$CONST.DUMP_IT}</a>
</div>
{/if}
{/if}
@@ -1,3 +0,0 @@
{$CONST.WELCOME_BACK} {$smarty.session.serendipityUser|escape}
-3
View File
@@ -1,3 +0,0 @@
<div>
<a href="{$serendipityBaseURL}rss.php?version=2.0&all=1" class="serendipityPrettyButton input_button">{$CONST.EXPORT_FEED}</a>
</div>
-190
View File
@@ -1,190 +0,0 @@
{if $delete_yes}
<div class="serendipityAdminMsgSuccess msg_success">
<img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="{serendipity_getFile file="admin/img/admin_msg_success.png"}" alt="" />
{$CONST.DELETED_GROUP|sprintf:"{$group_id|escape:"html"}":"{$group.name|escape:"html"}"}
</div>
{/if}
{if $save_new}
<div class="serendipityAdminMsgSuccess msg_success">
<img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="{serendipity_getFile file="admin/img/admin_msg_success.png"}" alt="" />
{$CONST.CREATED_GROUP|sprintf:"{$group_id|escape:"html"}":"{$group.name|escape:"html"}"}
</div>
{/if}
{if $save_edit}
<div class="serendipityAdminMsgSuccess msg_success">
<img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="{serendipity_getFile file="admin/img/admin_msg_success.png"}" alt="" />
{$CONST.MODIFIED_GROUP|sprintf:"{$name|escape:"html"}"}
</div>
{/if}
{if !$delete}
<table width="100%">
<tr>
<td><strong>{$CONST.GROUP}</strong></td>
<td width="200">&nbsp;</td>
</tr>
<tr>
<td colspan="3">
{foreach $groups as $group}
<div class="serendipity_admin_list_item serendipity_admin_list_item_{if $group@iteration is even} even {else} uneven {/if}">
<table width="100%">
<tr>
<td>{$group.name|escape:"html"}</td>
<td width="200" align="right">
<a href="?serendipity[adminModule]=groups&amp;serendipity[adminAction]=edit&amp;serendipity[group]={$group.id}" title="{$CONST.EDIT} {$group.name|escape:"html"}" class="serendipityIconLink">
<img src="{serendipity_getFile file="admin/img/edit.png"}" alt="{$CONST.EDIT} {$group.name|escape:"html"}" />
{$CONST.EDIT}
</a>
<a href="?{$deleteFormToken}&amp;serendipity[adminModule]=groups&amp;serendipity[adminAction]=delete&amp;serendipity[group]={$group.id}" title="{$CONST.DELETE} {$group.name|escape:"html"}" class="serendipityIconLink">
<img src="{serendipity_getFile file="admin/img/delete.png"}" alt="{$CONST.DELETE} {$group.name|escape:"html"}" />
{$CONST.DELETE}
</a>
</td>
</tr>
</table>
</div>
{/foreach}
</td>
</tr>
{if $start}
<tr>
<td colspan="3" align="right">
<form action="?serendipity[adminModule]=groups" method="post">
<input type="submit" name="NEW" value="{$CONST.CREATE_NEW_GROUP}" class="serendipityPrettyButton input_button" />
</form>
</td>
</tr>
{/if}
</table>
{/if}
{if $edit || $new}
<br />
<br />
<hr noshade="noshade">
<form action="?serendipity[adminModule]=groups" method="post">
{$formToken}
<div>
<h3>
{if $edit}
{$CONST.EDIT}
<input type="hidden" name="serendipity[group]" value="{$from.id}" />
{else}
{$CONST.CREATE}
{/if}
</h3>
<table>
<tr>
<td>{$CONST.NAME}</td>
<td><input class="input_textbox" type="text" name="serendipity[name]" value="{$from.name|escape:"html"}" /></td>
</tr>
<tr>
<td valign="top">{$CONST.USERCONF_GROUPS}</td>
<td>
<select name="serendipity[members][]" multiple="multiple" size="5">
{foreach $allusers as $user}
<option value="{$user.authorid}" {if isset($selected.{$user.authorid})} selected="selected"{/if} >{$user.realname|escape:"html"}</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
{foreach $perms as $perm}
{if {{$perm@key}|truncate:"2":""} == "f_"}{continue}{/if}
{if !isset($section)}
{$section=$perm@key}
{/if}
{if $section != {$perm@key} && {{$perm@key}|truncate:"{$section|count_characters}":""} == $section}
{$indent="&nbsp;&nbsp;"}
{$indentB=""}
{else}
{if $section != {$perm@key}}
{$indent="<br />"}
{$indentB="<br />"}
{$section="{$perm@key}"}
{/if}
{/if}
{if !$perm.permission}
<tr>
<td>{$indent} {$perm.permission_name|escape:"html"}</td>
<td>{$indentB} {(isset($from.{$perm@key}) && $from.{$perm@key} == "true") ? $CONST.YES : $CONST.NO} </td>
</tr>
{else}
<tr>
<td>{$indent} <label for="{{$perm@key}|escape:"html"}">{$perm.permission_name|escape:"html"}</label></td>
<td>{$indentB} <input class="input_checkbox" id="{{$perm@key}|escape:"html"}" type="checkbox" name="serendipity[{{$perm@key}|escape:"html"}]" value="true" {if isset({$from.{$perm@key}}) && {$from.{$perm@key}} == "true"} checked="checked" {/if} /></td>
</tr>
{/if}
{/foreach}
{if $enablePluginACL}
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td valign="top">{$CONST.PERMISSION_FORBIDDEN_PLUGINS}</td>
<td>
<select name="serendipity[forbidden_plugins][]" multiple="multiple" size="5">
{foreach $allplugins as $plugin}
<option value="{{$plugin@key}|escape:"url"} {if $plugin.has_permission == false} selected="selected" {/if} >{$plugin.b->properties.name|escape:"html"}</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td valign="top">{$CONST.PERMISSION_FORBIDDEN_HOOKS}</td>
<td>
<select name="serendipity[forbidden_hooks][]" multiple="multiple" size="5">
{foreach $allhooks as $hook}
<option value="{{$hook@key}|escape:"url"}" {$hook.has_permission == false} 'selected="selected"}>{{$hook@key}|escape:"html"}</option>
{/foreach}
</select>
</td>
</tr>
{else}
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">{$CONST.PERMISSION_FORBIDDEN_ENABLE_DESC}</td>
</tr>
{/if}
</table>
{if $edit}
<input type="submit" name="SAVE_EDIT" value="{$CONST.SAVE}" class="serendipityPrettyButton input_button" />
{$CONST.WORD_OR} -
<input type="submit" name="SAVE_NEW" value="{$CONST.CREATE_NEW_GROUP}" class="serendipityPrettyButton input_button" />
{else}
<input type="submit" name="SAVE_NEW" value="{$CONST.CREATE_NEW_GROUP}" class="serendipityPrettyButton input_button" />
{/if}
</div>
</form>
{else}
{if $delete}
<form action="?serendipity[adminModule]=groups" method="post">
<div>
{$CONST.DELETE_GROUP|sprintf:"{$group_id}":"{$group.name|escape:"html"}"}
<br /><br />
{$formToken}
<input type="hidden" name="serendipity[group]" value="{$group_id|escape:"html"}" />
<input type="submit" name="DELETE_YES" value="{$CONST.DUMP_IT}" class="serendipityPrettyButton input_button" />
<input type="submit" name="NO" value="{$CONST.NOT_REALLY}" class="serendipityPrettyButton input_button" />
</div>
</form>
{/if}
{/if}
-347
View File
@@ -1,347 +0,0 @@
{if $case_imgedit}
<div class="warning js_warning"><em>{$CONST.PREFERENCE_USE_JS_WARNING}</em></div>
{** Let the IMGEditor do its magic. It will parse its results straightly into a template variable array.
serendipity_smarty_fetch('IMGEDIT', $img->output_template);
**}
{/if}
{if $case_sync}
{if !$perm_adminImagesSync}
<div class="warning"><em>{$CONST.PERM_DENIED}</em></div>
{else}
<div class="serendipityAdminMsgNote">{$CONST.WARNING_THIS_BLAHBLAH|replace:'\\n':'<br />'}</div>
<form method="POST" action="serendipity_admin.php?serendipity[adminModule]=media&amp;serendipity[adminAction]=doSync">
<p>
<fieldset>
<legend>{$CONST.SYNC_OPTION_LEGEND}</legend>
<input type="radio" name="serendipity[deleteThumbs]" value="no" checked="checked" id="keepthumbs" />
<label for="keepthumbs">{$CONST.SYNC_OPTION_KEEPTHUMBS}</label><br />
<input type="radio" name="serendipity[deleteThumbs]" value="check" id="sizecheckthumbs" />
<label for="sizecheckthumbs">{$CONST.SYNC_OPTION_SIZECHECKTHUMBS}</label><br />
<input type="radio" name="serendipity[deleteThumbs]" value="yes" />
<label for="deletethumbs">{$CONST.SYNC_OPTION_DELETETHUMBS}</label><br />
</fieldset>
</p>
<input name="doSync" value="{$CONST.CREATE_THUMBS}" class="serendipityPrettyButton input_button" type="submit" />
<a href="serendipity_admin.php" class="serendipityPrettyButton">{$CONST.ABORT_NOW}</a>
</form>
{/if}
{/if}
{if $case_doSync}
{if !$perm_adminImagesSync}
<div class="warning"><em>{$CONST.PERM_DENIED}</em></div>
{else}
<p class="image_synch"><b>{$CONST.SYNCING}</b></p><br />
{$print_SYNC_DONE}
<p class="image_resize"><b>{$CONST.RESIZING}</b></p><br />
{$print_RESIZE_DONE}
{/if}
{/if}
{if $case_delete}
<div class="image_notify_delete">{$CONST.ABOUT_TO_DELETE_FILE|sprintf:"$file"}</div>
<form method="get" id="delete_image">
<div>
<a href="{$newLoc}" class="serendipityPrettyButton input_button">{$CONST.DUMP_IT}</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="{$abortLoc}" class="serendipityPrettyButton input_button">{$CONST.ABORT_NOW}</a>
</div>
</form>
{/if}
{if $switched_output}
<form method="get" id="delete_images">
{if ( $is_delete || $is_multidelete )}
<p><span class="msg_notice">{$CONST.ABOUT_TO_DELETE_FILES}</span></p>
{foreach $rip_image AS $ripimg}
<span class="msg_dialog_ripentry">{$ripimg}</span><br />
{/foreach}
<ul class="dialog_delrip">
<li><a class="link_abort" href="{$smarty.server.HTTP_REFERER|escape}">{$CONST.NOT_REALLY}</a></li>
<li><a class="link_confirm" href="{$newLoc}">{$CONST.DUMP_IT}</a></li>
</ul>
{/if}
</form>
{/if}
{if $case_rename}
{if $go_back}
<br />
<input type="button" onclick="history.go(-1);" value="{$CONST.BACK}" class="serendipityPrettyButton input_button" />
{else}
<script language="javascript" type="text/javascript">
location.href="?serendipity[adminModule]=images&serendipity[adminAction]=default";
</script>
<noscript>
<a href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=default">{$CONST.DONE}</a>
</noscript>
{/if}
{/if}
{if $case_properties}
{** serendipity_showPropertyForm($new_media) **}
{/if}
{if $case_add}
{if $smarty.post.adminSubAction == 'properties'}
<script language="javascript" type="text/javascript">
location.href="?serendipity[adminModule]=images&serendipity[adminAction]=default";
</script>
<noscript>
<a href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=default">{$CONST.DONE}</a>
</noscript>
{else}
{** showMediaLibrary($messages) **}
{$showML_add}
{/if}
{/if}
{if $case_directoryDoDelete}
{if $print_DIRECTORY_WRITE_ERROR}{$print_DIRECTORY_WRITE_ERROR}{/if}
{if $ob_serendipity_killPath}{$ob_serendipity_killPath}{/if}
{if $print_ERROR_NO_DIRECTORY}{$print_ERROR_NO_DIRECTORY}{/if}
{** serendipity_plugin_api::hook_event('backend_directory_delete', $new_dir); **}
{/if}
{if $case_directoryEdit}
{if !empty($smarty.post.save)}
{if $ob_serendipity_moveMediaDirectory}{$ob_serendipity_moveMediaDirectory}{/if}
<div>{$print_CONST.SETTINGS_SAVED_AT}</div>
{/if}
<div class="image_directory_edit"><strong>{$CONST.MANAGE_DIRECTORIES}</strong></div>
<br />
<form id="image_directory_edit_form" method="POST" action="?serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryEdit&amp;serendipity[dir]={$dir|escape:'html'}">
{$formtoken}
<input type="hidden" name="serendipity[oldDir]" value="{$use_dir}" />
<table cellpadding="5">
<tr>
<td width="100"><strong>{$CONST.NAME}</strong></td>
<td><input class="input_textbox" type="text" name="serendipity[newDir]" value="{$use_dir}" /></td>
</tr>
<tr>
<td><label for="read_authors">{$CONST.PERM_READ}</label></td>
<td>
<select size="6" id="read_authors" multiple="multiple" name="serendipity[read_authors][]">
<option value="0" {if $rgroups}selected="selected"{/if}>{$CONST.ALL_AUTHORS}</option>
{foreach $groups AS $group}
<option value="{$group.confkey}" {if isset($read_groups.{$group.confkey})}selected="selected"{/if}>{$group.confvalue|escape:'html'}</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td><label for="write_authors">{$CONST.PERM_WRITE}</label></td>
<td>
<select size="6" id="write_authors" multiple="multiple" name="serendipity[write_authors][]">
<option value="0" {if $wgroups}selected="selected"{/if}>{$CONST.ALL_AUTHORS}</option>
{foreach $groups AS $group}
<option value="{$group.confkey}" {if isset($write_groups.{$group.confkey})}selected="selected"{/if}>{$group.confvalue|escape:'html'}</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td>
<input class="input_checkbox" id="setchild" value="true" type="checkbox" name="serendipity[update_children]" {if !empty($smarty.post.update_children) == 'on'}checked="checked"{/if} /> <label for="setchild">{$CONST.PERM_SET_CHILD}</label>
<td>
</tr>
</table>
<br />
<br />
<div align="center">
<input name="serendipity[save]" value="{$CONST.SAVE}" class="serendipityPrettyButton input_button" type="submit" />
</div>
</form>
{/if}
{if $case_directoryDelete}
<div class="image_directory_delete"><strong>{$CONST.DELETE_DIRECTORY}</strong></div>
<div class="image_directory_delete_desc">{$CONST.DELETE_DIRECTORY_DESC}</div>
<br />
<br />
<form id="image_directory_delete_form" method="POST" action="?serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryDoDelete&amp;serendipity[dir]={$dir|escape:'html'}">
{$formtoken}
<table cellpadding="5">
<tr>
<td width="100"><strong>{$CONST.NAME}</strong></td>
<td>{$basename_dir}</td>
</tr>
<tr>
<td colspan="2"><input class="input_checkbox" type="checkbox" name="serendipity[nuke]" value="true" style="margin: 0"> {$CONST.FORCE_DELETE}</td>
</tr>
</table>
<br />
<br />
<div align="center">
{$CONST.CONFIRM_DELETE_DIRECTORY|sprintf:$dir|escape:'html'}<br />
<input name="SAVE" value="{$CONST.DELETE_DIRECTORY}" class="serendipityPrettyButton input_button" type="submit" />
</div>
</form>
{/if}
{if $case_directoryDoCreate}
{** serendipity_plugin_api::hook_event('backend_directory_create', $nd); **}
{if $print_DIRECTORY_CREATED}{$print_DIRECTORY_CREATED}{/if}
{if $print_DIRECTORY_WRITE_ERROR}{$print_DIRECTORY_WRITE_ERROR}{/if}
{/if}
{if $case_directoryCreate}
<div class="image_directory_create"><strong>{$CONST.CREATE_DIRECTORY}</strong></div>
<div class="image_directory_create_desc">{$CONST.CREATE_DIRECTORY_DESC}</div>
<br />
<br />
<form id="image_directory_create_form" method="POST" action="?serendipity[step]=directoryDoCreate&amp;serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryDoCreate">
{$formtoken}
<table cellpadding="5">
<tr>
<td>{$CONST.NAME}</td>
<td><input class="input_textbox" type="text" name="serendipity[name]" value="" /></td>
</tr>
<tr>
<td>{$CONST.PARENT_DIRECTORY}</td>
<td>
<select name="serendipity[parent]">
<option value="">{$CONST.BASE_DIRECTORY}</option>
{foreach $folders as $folder}
<option {if $folder.relpath == $get.only_path}selected="selected"{/if} value="{$folder.relpath}">{'&nbsp;'|str_repeat:($folder.depth*2)} {$folder.name}</option>
{/foreach}
</select>
</td>
</tr>
{** IS this **}
{serendipity_hookPlugin hookAll=true hook="backend_directory_createoptions" addData=$folders}
{** the right smarty template translation for
<?php serendipity_plugin_api::hook_event('backend_directory_createoptions', $folders); ?> **}
</table>
<div>
<input name="SAVE" value="{$CONST.CREATE_DIRECTORY}" class="serendipityPrettyButton input_button" type="submit">
</div>
</form>
{/if}
{if $case_directorySelect}
<div class="image_directory_list">{$CONST.DIRECTORIES_AVAILABLE}</div>
<br />
<table id="image_directory_listing" border="0" cellspacing="0" cellpadding="4" width="100%">
<tr>
<td colspan="4"><strong>{$CONST.BASE_DIRECTORY}</strong></td>
</tr>
{foreach $folders as $folder}
<tr>
<td width="16"><a href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryEdit&amp;serendipity[dir]={$folder.relpath|escape:'html'}"><img src="{serendipity_getFile file='admin/img/edit.png'}" border="0" alt="{$CONST.EDIT}" /></a></td>
<td width="16"><a href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryDelete&amp;serendipity[dir]={$folder.relpath|escape:'html'}"><img src="{serendipity_getFile file='admin/img/delete.png'}" alt="{$CONST.DELETE}" border="0"></a></td>
<td style="padding-left: {$folder.depth*10}">{$folder.name}</td>
</tr>
{/foreach}
</table>
<br />
<div><a href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=directoryCreate" class="serendipityPrettyButton input_button">{$CONST.CREATE_NEW_DIRECTORY}</a></div>
{/if}
{if $case_addSelect}
{** smarty display 'admin/media_upload.tpl' **}
{/if}
{if $case_rotateCW}
{if $rotate_img_done}
<script language="javascript" type="text/javascript">
location.href="{$adminFile_redirect}";
</script>
<noscript><a href="{$adminFile_redirect}">{$CONST.DONE}</a></noscript>
{/if}
{/if}
{if $case_rotateCCW}
{if $rotate_img_done}
<script language="javascript" type="text/javascript">
location.href="{$adminFile_redirect}";
</script>
<noscript><a href="{$adminFile_redirect}">{$CONST.DONE}</a></noscript>
{/if}
{/if}
{if $case_scale}
{if $print_SCALING_IMAGE}{$print_SCALING_IMAGE}{/if}
{if $print_serendipity_scaleImg}{$print_serendipity_scaleImg}<br />{/if}
{$CONST.DONE}<br />
{** Forward user to overview (we don't want the user's back button to rename things again) **}
<script language="javascript" type="text/javascript">
location.href="?serendipity[adminModule]=images&serendipity[adminAction]=default";
</script>
<noscript><a href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=default">{$CONST.DONE}</a></noscript>
{/if}
{if $case_scaleSelect}
<script type="text/javascript" language="javascript">
<!--
function rescale(dim, newval) {ldelim}
var originalWidth = {$img_width};
var originalHeight = {$img_height};
var ratio = originalHeight/originalWidth;
var trans = new Array();
trans['width'] = new Array('serendipity[height]', ratio);
trans['height'] = new Array('serendipity[width]', 1/ratio);
if (document.serendipityScaleForm.elements['auto'].checked == true) {ldelim}
document.serendipityScaleForm.elements[trans[dim][0]].value=Math.round(trans[dim][1]*newval);
{rdelim}
document.getElementsByName('serendipityScaleImg')[0].style.width =
document.serendipityScaleForm.elements['serendipity[width]'].value+'px';
document.getElementsByName('serendipityScaleImg')[0].style.height =
document.serendipityScaleForm.elements['serendipity[height]'].value+'px';
{rdelim}
//-->
</script>
{if $print_RESIZE_BLAHBLAH}{$print_RESIZE_BLAHBLAH}{/if}
{if $print_ORIGINAL_SIZE}{$print_ORIGINAL_SIZE}{/if}
{$CONST.HERE_YOU_CAN_ENTER_BLAHBLAH}
<form name="serendipityScaleForm" action="?" method="GET">
<div>
{$CONST.NEWSIZE}
{$formtoken}
<input type="hidden" name="serendipity[adminModule]" value="images" />
<input type="hidden" name="serendipity[adminAction]" value="scale" />
<input type="hidden" name="serendipity[fid]" value="{$get.fid}" />
<input class="input_textbox" type="text" size="4" name="serendipity[width]" onchange="rescale('width' , value);" value="{$img_width}" />
<input class="input_textbox" type="text" size="4" name="serendipity[height]" onchange="rescale('height', value);" value="{$img_height}" />
<br />
{$CONST.KEEP_PROPORTIONS}:
<!-- <input type='button' value='preview'>-->
<input class="input_checkbox" type="checkbox" name="auto" checked="checked" /><br />
<input type="button" name="scale" value="{$CONST.IMAGE_RESIZE}" onclick="if (confirm('{$CONST.REALLY_SCALE_IMAGE}')) document.serendipityScaleForm.submit();" class="serendipityPrettyButton input_button" />
</div>
</form>
<img src="{$file}" name="serendipityScaleImg" style="width: {$img_width}px; height: {$img_height}px;" alt="" />
{/if}
{if $case_default}
{if $showML_def}{$showML_def}{/if}
{/if}
-58
View File
@@ -1,58 +0,0 @@
{if $importForm}
{if $die}
FAILURE: Unable to require import module, possible syntax error?
{else}
{if $validateData}
{$CONST.IMPORT_STARTING}<br />
{if $result != true}
{$CONST.IMPORT_FAILED}: {$result}<br />
{else}
{$CONST.IMPORT_DONE}<br />
{/if}
{else}
{$CONST.IMPORT_PLEASE_ENTER}
<br />
<form action="" method="POST" enctype="multipart/form-data">
{$formToken}
<table cellpadding="3" cellspacing="2">
{foreach $fields as $field}
<tr>
<td>{$field.text}</td>
<td>{$field.guessedInput}</td>
</tr>
{/foreach}
{if $notes}
<tr>
<td colspan="2">
<b>{$CONST.IMPORT_NOTES}</b><br />
{$notes}
</td>
</tr>
{/if}
<tr>
<td colspan="2" align="right"><input type="submit" value="{$CONST.IMPORT_NOW}" class="serendipityPrettyButton input_button"></td>
</tr>
</table>
</form>
{/if}
{/if}
{else}
{$CONST.IMPORT_WELCOME}.<br />
{$CONST.IMPORT_WHAT_CAN}. <br />
<br />
{$CONST.IMPORT_SELECT}:<br />
<br />
<form action="" method="GET">
<input type="hidden" name="serendipity[adminModule]" value="import">
{$formToken}
<strong>{$CONST.IMPORT_WEBLOG_APP}: </strong>
<select name="serendipity[importFrom]">
{foreach $list as $v => $k}
<option value="{$v}">{$k}</option>
{/foreach}
</select>
<input type="submit" value="{$CONST.GO}" class="serendipityPrettyButton input_button">
</form>
{/if}
-289
View File
@@ -1,289 +0,0 @@
{* From configuration to install *}
{if $is_errors && is_array($errors)}
{foreach $errors AS $error}
<div class="serendipityAdminMsgError msg_error"><img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_error.png'}" alt="" />{$error}</div>
{/foreach}
{/if}
{if $getstepint0}
{$CONST.WELCOME_TO_INSTALLATION}.
<br />{$CONST.FIRST_WE_TAKE_A_LOOK}.
<br />{$print_ERRORS_ARE_DISPLAYED_IN}.
<br />
<br>
<div align="center">- {$CONST.PRE_INSTALLATION_REPORT|sprintf:$s9yversion} -</div><br />
<div align="center">
<table class="serendipity_admin_list_item serendipity_admin_list_item_even" width="90%" align="center">
<tr>
<td colspan="2" style="font-weight: bold">{$CONST.INTEGRITY}</td>
</tr>
{foreach $installerResultDiagnose_CHECKSUMS AS $cksum}
<tr>
<td colspan="2">{$cksum}</td>
</tr>
{/foreach}
</table>
<table class="serendipity_admin_list_item serendipity_admin_list_item_even" width="90%" align="center">
<tr>
<td colspan="2" style="font-weight: bold">{$CONST.PHP_INSTALLATION}</td>
</tr>
<tr>
<td>{$CONST.OPERATING_SYSTEM}</td>
<td>{$php_uname}</td>
</tr>
<tr>
<td>{$CONST.WEBSERVER_SAPI}</td>
<td>{$php_sapi_name}</td>
</tr>
<tr>
<td>PHP version >= 5.2.6</td>
<td width="200">{$installerResultDiagnose_VERSION}</td>
</tr>
<tr>
<td>Database extensions</td>
<td width="200">{$installerResultDiagnose_DBTYPE}</td>
</tr>
<tr>
<td>Session extension</td>
<td width="200">{$installerResultDiagnose_SESSION}</td>
</tr>
<tr>
<td>PCRE extension</td>
<td width="200">{$installerResultDiagnose_PCRE}</td>
</tr>
<tr>
<td>GDlib extension</td>
<td width="200">{$installerResultDiagnose_GD}</td>
</tr>
<tr>
<td>OpenSSL extension</td>
<td>{$installerResultDiagnose_OPENSSL}</td>
</tr>
<tr>
<td>mbstring extension</td>
<td width="200">{$installerResultDiagnose_MBSTR}</td>
</tr>
<tr>
<td>iconv extension</td>
<td width="200">{$installerResultDiagnose_ICONV}</td>
</tr>
<tr>
<td>zlib extension</td>
<td width="200">{$installerResultDiagnose_ZLIB}</td>
</tr>
<tr>
<td>Imagemagick binary </td>
<td>{$installerResultDiagnose_IM}</td>
</tr>
</table>
<br />
<table class="serendipity_admin_list_item serendipity_admin_list_item_even" width="90%" align="center">
<tr>
<td colspan="3" style="font-weight: bold">{$CONST.PHPINI_CONFIGURATION}</td>
</tr>
<tr>
<td>&nbsp;</td>
<td width="150"><em>{$CONST.RECOMMENDED}</em></td>
<td width="150"><em>{$CONST.ACTUAL}</em></td>
</tr>
<tr>
<td>safe_mode</td>
<td width="150"><strong>OFF</strong></td>
<td width="150">{$installerResultDiagnose_SSM}</td>
</tr>
<tr>
<td>register_globals</td>
<td width="150"><strong>OFF</strong></td>
<td width="150">{$installerResultDiagnose_SRG}</td>
</tr>
<tr>
<td>magic_quotes_gpc</td>
<td width="150"><strong>OFF</strong></td>
<td width="150">{$installerResultDiagnose_SMQG}</td>
</tr>
<tr>
<td>magic_quotes_runtime</td>
<td width="150"><strong>OFF</strong></td>
<td width="150">{$installerResultDiagnose_SMQR}</td>
</tr>
<tr>
<td>session.use_trans_sid</td>
<td width="150"><strong>OFF</strong></td>
<td width="150">{$installerResultDiagnose_SSUTS}</td>
</tr>
<tr>
<td>allow_url_fopen</td>
<td width="150"><strong>ON</strong></td>
<td width="150">{$installerResultDiagnose_SAUF}</td>
</tr>
<tr>
<td>file_uploads</td>
<td width="150"><strong>ON</strong></td>
<td width="150">{$installerResultDiagnose_SFU}</td>
</tr>
<tr>
<td>post_max_size</td>
<td width="150"><strong>10M</strong></td>
<td width="150">{$installerResultDiagnose_SPMS}</td>
</tr>
<tr>
<td>upload_max_filesize</td>
<td width="150"><strong>10M</strong></td>
<td width="150">{$installerResultDiagnose_SUMF}</td>
</tr>
<tr>
<td>memory_limit</td>
<td width="150"><strong>{($CONST.PHP_INT_SIZE == 4) ? '8M' : '16M'}</strong></td>
<td width="150">{$installerResultDiagnose_SML}</td>
</tr>
</table>
<br />
<table class="serendipity_admin_list_item serendipity_admin_list_item_even" width="90%" align="center">
<tr>
<td colspan="2" style="font-weight: bold">{$CONST.PERMISSIONS}</td>
</tr>
<tr>
<td style="vertical-align: top">{$basedir}</td>
<td width="200">
{foreach $installerResultDiagnose_WRITABLE AS $fwrite}
{$fwrite}
{/foreach}
</td>
</tr>
<tr>
<td style="vertical-align: top">{$basedir}{$CONST.PATH_SMARTY_COMPILE}</td>
<td width="200">
{foreach $installerResultDiagnose_COMPILE AS $compile}
{$compile}
{/foreach}
</td>
</tr>
<tr>
<td style="vertical-align: top">{$basedir}archives/</td>
<td width="200">
{foreach $installerResultDiagnose_ARCHIVES AS $archives}
{$archives}
{/foreach}
</td>
</tr>
<tr>
<td style="vertical-align: top">{$basedir}plugins/</td>
<td width="200">
{foreach $installerResultDiagnose_PLUGINS AS $plugins}
{$plugins}
{/foreach}
</td>
</tr>
{if $is_dir_uploads}
<tr>
<td style="vertical-align: top">{$basedir}uploads/</td>
<td width="200">
{foreach $installerResultDiagnose_UPLOADS AS $uploads}
{$uploads}
{/foreach}
</td>
</tr>
{/if}
{if $is_imb_executable}
<tr>
<td style="vertical-align: top">Execute Imagemagick binary </td>
<td>
{foreach $installerResultDiagnose_IMB AS $im_binary}
{$im_binary}
{/foreach}
</td>
</tr>
{/if}
</table>
{if $showWritableNote}
<div class="serendipityAdminMsgNote msg_notice"><img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_note.png'}" alt="" />{$CONST.PROBLEM_PERMISSIONS_HOWTO|sprintf:'chmod 1777'}</div>
{/if}
<div align="center">
{if $errorCount > 0}
<div class="serendipityAdminMsgError msg_error"><img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_error.png'}" alt="" />{$CONST.PROBLEM_DIAGNOSTIC}</div>
<h2><a href="serendipity_admin.php">{$CONST.RECHECK_INSTALLATION}</a></h2>
{else}
{$CONST.SELECT_INSTALLATION_TYPE}:
<h2><a href="?serendipity[step]=2a">{$CONST.SIMPLE_INSTALLATION}</a> - <a href="?serendipity[step]=2b">{$CONST.EXPERT_INSTALLATION}</a></h2>
{/if}
</div>
</div> <!-- // div end -->
{elseif $s9yGETstep == '2a'}
<form action="?" method="post">
<input type="hidden" name="serendipity[step]" value="{$s9yGETstep}">
<input type="hidden" name="serendipity[getstep]" value="3">
{if $ob_serendipity_printConfigTemplate}{$ob_serendipity_printConfigTemplate}{/if}
<div align="center"><input name="submit" type="submit" value="{$CONST.COMPLETE_INSTALLATION}" class="serendipityPrettyButton input_button"></div>
</form>
{elseif $s9yGETstep == '2b'}
<form action="?" method="post">
<input type="hidden" name="serendipity[step]" value="{$s9yGETstep}">
<input type="hidden" name="serendipity[getstep]" value="3">
{if $ob_serendipity_printConfigTemplate}{$ob_serendipity_printConfigTemplate}{/if}
<div align="center"><input name="submit" type="submit" value="{$CONST.COMPLETE_INSTALLATION}" class="serendipityPrettyButton input_button"></div>
</form>
{elseif $getstepint3}
{$CONST.CHECK_DATABASE_EXISTS}&hellip;
{if is_array($authors_query)}
<strong>{$CONST.THEY_DO}</strong>, {$CONST.WONT_INSTALL_DB_AGAIN}
<br />
<br />
{else}
<strong>{$CONST.THEY_DONT}</strong>
<br />
{$CONST.CREATE_DATABASE}
{if $install_DB}
<strong>{$CONST.DONE}</strong><br />
{/if}
{$CONST.CREATING_PRIMARY_AUTHOR|sprintf:"{$smarty.post.user|escape}"}&hellip;
{if $add_authors}
<strong>{$CONST.DONE}</strong><br />
{/if}
{$CONST.SETTING_DEFAULT_TEMPLATE}&hellip;
{if $set_template_vars}
<strong>{$CONST.DONE}</strong><br />
{/if}
{$CONST.INSTALLING_DEFAULT_PLUGINS}&hellip;
{if $register_default_plugins}
<strong>{$CONST.DONE}</strong><br />
{/if}
{/if}
{$CONST.ATTEMPT_WRITE_FILE|sprintf:'.htaccess'}&hellip;
{if $errors_sif === true}
<strong>{$CONST.DONE}</strong><br />
{else}
<strong>{$CONST.FAILED}</strong><br />
{foreach $errors_sif AS $error_f}
<div class="serendipityAdminMsgError msg_error"><img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_error.png'}" alt="" />{$error_f}</div>
{/foreach}
{/if}
{if $s9y_installed}
<div class="serendipityAdminMsgSuccess msg_success"><img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_success.png'}" alt="" />{$CONST.SERENDIPITY_INSTALLED}</div>
<div align="center" style="font-size: large"><a href="{$smarty.post.serendipityHTTPPath}">{$CONST.VISIT_BLOG_HERE}</a></div>
<div align="center">{$CONST.THANK_YOU_FOR_CHOOSING}</div>
{else}
<div class="serendipityAdminMsgError msg_error"><img class="img_error" src="{serendipity_getFile file='admin/img/admin_msg_error.png'}" alt="" />{$CONST.ERROR_DETECTED_IN_INSTALL}</div>
{/if}
{/if}{* getstepint3 end *}
-204
View File
@@ -1,204 +0,0 @@
{* serendipity_plugins_admin.inc.php::serendipity_plugin_config() - the OUT_STACK loop *}
{if $ctype == 'seperator'}
<tr>
<td colspan="2"><hr noshade="noshade" size="1" /></td>
</tr>
{/if}
{if $ctype == 'select'}
<tr>
<td style="border-bottom: 1px solid #000000; vertical-align: top"><strong>{$cname}</strong>
{if $cdesc != ''}
<br><span style="color: #5E7A94; font-size: 8pt;">&nbsp;{$cdesc}</span>
{/if}
</td>
<td style="border-bottom: 1px solid #000000; vertical-align: middle" width="250">
<div>
<select class="direction_{$lang_direction}" name="serendipity[{$postKey}][{$config_item}]{($is_multi_select) ? '[]' : ''}" {($is_multi_select) ? 'multiple="multiple"' : ''} {($is_multi_select && ($select_size > 0)) ? "size='{$select_size}'" : ''}>
{foreach $select AS $select_value => $select_desc}
{assign var="id" value="{$config_item|escape}_{$select_value|escape}"}
<!-- case select assign id={$id} -->
<option value="{$select_value}" {(in_array($select_value, $selected_options) || in_array($select_value, $pre_selected)) ? 'selected="selected"' : ''} title="{$select_desc|escape}">
{$select_desc|escape}
</option>
{/foreach}
</select>
</div>
</td>
</tr>
{/if}
{if $ctype == 'radio'}
<tr>
<td style="border-bottom: 1px solid #000000; vertical-align: top"><strong>{$cname}</strong>
{if $cdesc != ''}
<br /><span style="color: #5E7A94; font-size: 8pt;">&nbsp;{$cdesc}</span>
{/if}
</td>
<td style="border-bottom: 1px solid #000000; vertical-align: middle;" width="250">
{foreach $radio_button AS $r}
{if $r['counter'] == 1}
<div class="clearfix">
{/if}
<input class="direction_{$lang_direction} input_radio" type="radio" id="serendipity_plugin_{$r['id']}" name="serendipity[{$postKey}][{$config_item}]" value="{$r['value']}" {(!empty($r['checked'])) ? 'checked="checked"' : ''} title="{$r['index']|escape}" />
<label for="serendipity_plugin_{$r['id']}">{$r['index']}{* escapement is already done *}</label>
{if ($r['counter'] == $per_row)}
{assign var="r" value="counter[0]"}
</div>
{/if}
{/foreach}
</td>
</tr>
{/if}
{if $ctype == 'string'}
<tr>
<td style="border-bottom: 1px solid #000000">
<strong>{$cname}</strong>
<br><span style="color: #5E7A94; font-size: 8pt;">&nbsp;{$cdesc}</span>
</td>
<td style="border-bottom: 1px solid #000000" width="250">
<div>
<input class="direction_{$lang_direction} input_textbox" type="{$input_type}" name="serendipity[{$postKey}][{$config_item}]" value="{$hvalue}" size="30" />
</div>
</td>
</tr>
{/if}
{if (($ctype == 'html') || ($ctype == 'text'))}
<tr>
<td colspan="2"><strong>{$cname}</strong>
&nbsp;<span style="color: #5E7A94; font-size: 8pt;">&nbsp;{$cdesc}</span>
</td>
</tr>
<tr>
<td colspan="2">
<div>
<textarea class="direction_{$lang_direction}" style="width: 100%" id="nuggets{$elcount}" name="serendipity[{$postKey}][{$config_item}]" rows="{$text_rows}" cols="80">{$hvalue}</textarea>
</div>
</td>
</tr>
{/if}
{if $ctype == 'content'}
<tr>
<td colspan="2">{$cbag_default}</td>
</tr>
{/if}
{if $ctype == 'custom'}
<tr>
<td colspan="2">
<input type="hidden" id="config_{$postKey}_{$config_item}" name="serendipity[{$postKey}][{$config_item}]" value="{$hvalue}" size="30" />
{$cbag_custom}
</td>
</tr>
{/if}
{if $ctype == 'hidden'}
<tr>
<td colspan="2">
<input class="direction_{$lang_direction}" type="hidden" name="serendipity[{$postKey}][{$config_item}]" value="{$cbag_value}" />
</td>
</tr>
{/if}
{if $ctype == 'media'}
{if !$mediajs_output}
<script type="text/javascript" language="JavaScript" src="serendipity_editor.js"></script>
<script type="text/javascript" language="JavaScript" src="{serendipity_getFile file='admin/image_selector.js'}"></script>
{/if}
<tr>
<td colspan="2">
<strong>{$cname}</strong>
<br /><span style="color: #5E7A94; font-size: 8pt;">{$cdesc}</span>
</td>
</tr>
<tr>
<td style="border-bottom: 1px solid #000000">
<div id="{$config_item}_preview" style="background-image: url({$value}); width: {$preview_width}; height: {$preview_height}; background-repeat: no-repeat;">&nbsp;</div>
</td>
<td style="border-bottom: 1px solid #000000">
<input class="input_textbox" type="text" id="serendipity[{$postKey}][{$config_item}]" name="serendipity[{$postKey}][{$config_item}]" value="{$value}" onchange="change_preview('{$config_item}')"/>
<br /><a href="#" onclick="choose_media('serendipity[{$postKey}][{$config_item}]')">{$CONST.MEDIA_LIBRARY}</a>
</td>
</tr>
{/if}
{if $ctype == 'sequence'}
{if !$sequencejs_output}
<script src="{serendipity_getFile file='dragdrop.js'}" type="text/javascript"></script>
{/if}
<tr>
<td style="border-bottom: 1px solid #000000; vertical-align: top">
<strong>{$cname}</strong>
<br /><span style="color: #5E7A94; font-size: 8pt;">{$cdesc}</span>
</td>
<td style="border-bottom: 1px solid #000000; vertical-align: middle">
<input type="hidden" name="serendipity[{$postKey}][{$config_item}]" id="{$config_item}_value" value="{$value}" />
<noscript>
<!-- Replace standard submit button when using up/down submits -->
<input type="hidden" name="SAVECONF" value="Save" />
</noscript>
<ol id="{$config_item}" class="sequence_container pluginmanager_container">
{foreach $order_id as $orid}
<li id="{$orid['id']}" class="sequence_item pluginmanager_item_even">
<div id="g{$orid['id']}" class="pluginmanager_grablet sequence_grablet"><a href="#"></a></div>
{if $checkable}
<input type="checkbox" onclick="sort_{$config_item}_Sequence();" name="serendipity[{$postKey}][activate][{$config_item}][{$orid['id']}]" {(in_array($orid['id'], $store_order)) ? ' checked="checked" ' : ''} value="true" id="activate_{$orid['id']}" />
{/if}
<span>{$items[{$orid['id']}]['display']}</span>
{if isset($items[{$orid['id']}]['img'])}
<img src="{$items[{$orid['id']}]['img']}" />
{/if}
<noscript><div>
{if ($orid['sort_idx'] == 0)}
&nbsp;
{else}
<button id="{$postKey}_{$config_item}_{$orid['sort_idx']}_up" type="submit" name="serendipity[{$postKey}][override][{$config_item}]" value="{$orid['oneup']}">
<img src="{serendipity_getFile file='admin/img/uparrow.png'}" alt="Move Up" />
</button>
{/if}
{if ($orid['sort_idx'] == $last)}
&nbsp;
{else}
<button id="{$postKey}_{$config_item}_{$orid['sort_idx']}_down" type="submit" name="serendipity[{$postKey}][override][{$config_item}]" value="{$orid['onedown']}">
<img src="{serendipity_getFile file='admin/img/downarrow.png'}" alt="Move Down" />
</button>
{/if}
</div></noscript>
</li>
{/foreach}
</ol>
{if isset($no_sequence)}
{$no_sequence}
{/if}
{*** Smarty 3 has a new auto literal option which is enabled by default.
When the { is surrounded by whitespace it is not interpreted as smarty delimiter but literal. e.g. ' } ;'
AS tests have proofed, ending javascript delimiters " } ;" and " };" and even "};" work fine as well. So back to origin. ***}
<script type="text/javascript">
function sort_{$config_item}_Sequence() {
//var seq = DragDrop.serData('{$config_item}_group', null);
var seq = DragDrop.serData(null, '{$config_item}');
var start = seq.indexOf("(");
var end = seq.indexOf(")");
seq = seq.slice((start + 1), end);
checkable_seq = seq.split(",");
out_seq = '';
for (i in checkable_seq) {
if (document.getElementById('activate_' + checkable_seq[i]) && !document.getElementById('activate_' + checkable_seq[i]).checked) {
continue;
} else {
if (out_seq != '') {
out_seq += ',';
}
out_seq += checkable_seq[i];
}
}
var order = document.getElementById("{$config_item}_value");
order.value = out_seq;
}
function init_{$config_item}_Sequence() {
var lst = document.getElementById("{$config_item}");
DragDrop.makeListContainer(lst, '{$config_item}_group');
lst.onDragOut = function() {
sort_{$config_item}_Sequence();
};
}
addLoadEvent(init_{$config_item}_Sequence);
</script>
</td>
{/if}
-13
View File
@@ -1,13 +0,0 @@
{if $output.show_links}
<div class="{$output.links_css}">
<p class="further_links_head">{$output.links_title}</p>
<ul>
{foreach $output.links AS $link}
<li>{$link}</li>
{/foreach}
</ul>
<p class="further_links_foot" style="display: none"></p>
</div>
{/if}
<h3 class="serendipityWelcomeBack">{$output.welcome}</h3>
{$output.more}
-19
View File
@@ -1,19 +0,0 @@
{if $adminAction == "save"}
{if $not_authorized}
<div class="serendipityAdminMsgError msg_error"><img class="img_error" src="{serendipity_getFile file="admin/img/admin_msg_error.png"}" alt="" />{$CONST.CREATE_NOT_AUTHORIZED_USERLEVEL}</div>
{elseif $empty_username}
<div class="serendipityAdminMsgError msg_error"><img class="img_error" src="{serendipity_getFile file="admin/img/admin_msg_error.png"}" alt="" />{$CONST.USERCONF_CHECK_USERNAME_ERROR}</div>
{elseif $password_check_fail}
<div class="serendipityAdminMsgError msg_error"><img class="img_error" src="{serendipity_getFile file="admin/img/admin_msg_error.png"}" alt="" />{$CONST.USERCONF_CHECK_PASSWORD_ERROR}</div>
{else}
<div class="serendipityAdminMsgSuccess msg_success"><img class="img_error" src="{serendipity_getFile file="admin/img/admin_msg_success.png"}" alt="" />{$CONST.MODIFIED_USER|sprintf:"{$realname|escape:"html"}"} ?></div>
{/if}
{/if}
<form action="?serendipity[adminModule]=personal&amp;serendipity[adminAction]=save" method="post">
{$formToken}
{$config}
<div align="right">
<input class="serendipityPrettyButton input_button" type="submit" name="SAVE" value="{$CONST.SAVE}" /></div>
</form>

Some files were not shown because too many files have changed in this diff Show More