typo 5.4.4 → 5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (292) hide show
  1. data/CHANGELOG +59 -28
  2. data/MAINTAINERS +9 -17
  3. data/README +28 -20
  4. data/UPGRADE +6 -2
  5. data/app/controllers/accounts_controller.rb +1 -1
  6. data/app/controllers/admin/content_controller.rb +1 -1
  7. data/app/controllers/admin/feedback_controller.rb +3 -3
  8. data/app/controllers/admin/pages_controller.rb +2 -0
  9. data/app/controllers/application_controller.rb +6 -1
  10. data/app/controllers/articles_controller.rb +13 -1
  11. data/app/helpers/application_helper.rb +5 -2
  12. data/app/helpers/authors_helper.rb +14 -3
  13. data/app/models/article.rb +6 -4
  14. data/app/models/blog.rb +0 -4
  15. data/app/models/blog_sweeper.rb +1 -1
  16. data/app/models/content.rb +10 -5
  17. data/app/models/page_cache.rb +6 -7
  18. data/app/models/user.rb +1 -0
  19. data/app/views/admin/content/_form.html.erb +13 -11
  20. data/app/views/admin/content/_images.html.erb +1 -1
  21. data/app/views/admin/content/_simple_editor.html.erb +1 -0
  22. data/app/views/admin/content/_visual_editor.html.erb +1 -0
  23. data/app/views/admin/dashboard/_overview.html.erb +7 -7
  24. data/app/views/admin/pages/_form.html.erb +1 -0
  25. data/app/views/admin/pages/_images.html.erb +18 -0
  26. data/app/views/admin/pages/_simple_editor.html.erb +1 -2
  27. data/app/views/admin/pages/_visual_editor.html.erb +2 -1
  28. data/app/views/admin/pages/index.html.erb +1 -1
  29. data/app/views/admin/settings/feedback.html.erb +2 -1
  30. data/app/views/admin/tags/edit.html.erb +1 -1
  31. data/app/views/articles/_article.html.erb +17 -13
  32. data/app/views/articles/_article_content.html.erb +1 -0
  33. data/app/views/articles/_comment_box.html.erb +1 -1
  34. data/app/views/articles/_password_form.html.erb +10 -0
  35. data/app/views/articles/groupings.html.erb +1 -1
  36. data/app/views/articles/index.html.erb +1 -2
  37. data/app/views/articles/read.html.erb +1 -4
  38. data/app/views/articles/search.html.erb +1 -1
  39. data/app/views/layouts/administration.html.erb +1 -1
  40. data/app/views/shared/_search.html.erb +1 -1
  41. data/config/ckeditor.yml +14 -0
  42. data/config/environment.rb +13 -25
  43. data/config/environments/test.rb +1 -3
  44. data/config/filemanager.yml +16 -0
  45. data/config/initializers/access_rules.rb +5 -0
  46. data/config/routes.rb +5 -1
  47. data/db/migrate/004_add_sidebars.rb +3 -9
  48. data/db/migrate/089_drop_cache_information_table.rb +31 -0
  49. data/db/migrate/090_remove_keywords_from_posts.rb +9 -0
  50. data/db/migrate/091_adds_password_protection_to_posts.rb +9 -0
  51. data/doc/CACHE.SETUP.README +36 -0
  52. data/lang/de_DE.rb +6 -1
  53. data/lang/pl_PL.rb +221 -89
  54. data/lib/filemanager.rb +53 -0
  55. data/lib/filemanager/controller.rb +217 -0
  56. data/lib/i18n_interpolation_deprecation.rb +26 -0
  57. data/lib/rails_patch/active_support.rb +4 -0
  58. data/lib/tasks/release.rake +4 -131
  59. data/lib/typo_version.rb +1 -1
  60. data/public/.htaccess +6 -5
  61. data/public/filemanager/images/avi.gif +0 -0
  62. data/public/filemanager/images/box.gif +0 -0
  63. data/public/filemanager/images/bullet.gif +0 -0
  64. data/public/filemanager/images/close.gif +0 -0
  65. data/public/filemanager/images/closelabel.gif +0 -0
  66. data/public/filemanager/images/doc.gif +0 -0
  67. data/public/filemanager/images/donate-button.gif +0 -0
  68. data/public/filemanager/images/download-icon.gif +0 -0
  69. data/public/filemanager/images/folder.gif +0 -0
  70. data/public/filemanager/images/gif.gif +0 -0
  71. data/public/filemanager/images/htm.gif +0 -0
  72. data/public/filemanager/images/html.gif +0 -0
  73. data/public/filemanager/images/image-1.jpg +0 -0
  74. data/public/filemanager/images/image.gif +0 -0
  75. data/public/filemanager/images/jpg.gif +0 -0
  76. data/public/filemanager/images/loading.gif +0 -0
  77. data/public/filemanager/images/mov.gif +0 -0
  78. data/public/filemanager/images/nextlabel.gif +0 -0
  79. data/public/filemanager/images/pdf.gif +0 -0
  80. data/public/filemanager/images/png.gif +0 -0
  81. data/public/filemanager/images/ppt.gif +0 -0
  82. data/public/filemanager/images/prevlabel.gif +0 -0
  83. data/public/filemanager/images/rar.gif +0 -0
  84. data/public/filemanager/images/rm.gif +0 -0
  85. data/public/filemanager/images/rmvb.gif +0 -0
  86. data/public/filemanager/images/separator.gif +0 -0
  87. data/public/filemanager/images/spacer.gif +0 -0
  88. data/public/filemanager/images/swf.gif +0 -0
  89. data/public/filemanager/images/thumb-1.jpg +0 -0
  90. data/public/filemanager/images/tool_copy.gif +0 -0
  91. data/public/filemanager/images/tool_cut.gif +0 -0
  92. data/public/filemanager/images/tool_del.gif +0 -0
  93. data/public/filemanager/images/tool_folder.gif +0 -0
  94. data/public/filemanager/images/tool_imagemanager.gif +0 -0
  95. data/public/filemanager/images/tool_new.gif +0 -0
  96. data/public/filemanager/images/tool_paste.gif +0 -0
  97. data/public/filemanager/images/tool_props.gif +0 -0
  98. data/public/filemanager/images/tool_refresh.gif +0 -0
  99. data/public/filemanager/images/tool_unzip.gif +0 -0
  100. data/public/filemanager/images/tool_upload.gif +0 -0
  101. data/public/filemanager/images/tool_zip.gif +0 -0
  102. data/public/filemanager/images/txt.gif +0 -0
  103. data/public/filemanager/images/unknown.gif +0 -0
  104. data/public/filemanager/images/wmv.gif +0 -0
  105. data/public/filemanager/images/xls.gif +0 -0
  106. data/public/filemanager/images/zip.gif +0 -0
  107. data/public/filemanager/javascripts/filemanager.js +6 -0
  108. data/public/filemanager/javascripts/lang/en.js +31 -0
  109. data/public/filemanager/javascripts/lang/zh_CN.js +31 -0
  110. data/public/filemanager/javascripts/lightbox.js +497 -0
  111. data/public/filemanager/javascripts/translate.js +42 -0
  112. data/public/filemanager/resources/resources.txt +1 -0
  113. data/public/filemanager/stylesheets/filelist.css +147 -0
  114. data/public/filemanager/stylesheets/general.css +135 -0
  115. data/public/filemanager/stylesheets/lightbox.css +27 -0
  116. data/public/javascripts/prototype_ext.js +117 -0
  117. data/public/stylesheets/administration.css +19 -2
  118. data/themes/dirtylicious/views/articles/_article.html.erb +16 -12
  119. data/themes/dirtylicious/views/articles/_article_content.html.erb +1 -0
  120. data/themes/dirtylicious/views/articles/_password_form.html.erb +10 -0
  121. data/themes/scribbish/views/articles/_article.html.erb +18 -14
  122. data/themes/scribbish/views/articles/_article_content.html.erb +1 -0
  123. data/themes/scribbish/views/articles/_password_form.html.erb +10 -0
  124. data/themes/standard_issue/views/articles/_article.html.erb +16 -12
  125. data/themes/standard_issue/views/articles/_article_content.html.erb +1 -0
  126. data/themes/standard_issue/views/articles/_password_form.html.erb +10 -0
  127. data/themes/true-blue-3/helpers/theme_helper.rb +2 -2
  128. data/themes/true-blue-3/images/submit_form.jpg +0 -0
  129. data/themes/true-blue-3/stylesheets/style.css +27 -3
  130. data/themes/true-blue-3/views/articles/_article.html.erb +13 -8
  131. data/themes/true-blue-3/views/articles/_article_content.html.erb +1 -0
  132. data/themes/true-blue-3/views/articles/_comment_form.html.erb +1 -1
  133. data/themes/true-blue-3/views/articles/_password_form.html.erb +10 -0
  134. data/themes/true-blue-3/views/categories/_article.html.erb +5 -0
  135. data/themes/true-blue-3/views/tags/_article.html.erb +4 -0
  136. data/themes/typographic/views/articles/_article.html.erb +16 -12
  137. data/themes/typographic/views/articles/_article_content.html.erb +1 -0
  138. data/themes/typographic/views/articles/_password_form.html.erb +10 -0
  139. data/vendor/plugins/easy-ckeditor/app/controllers/ckeditor_controller.rb +2 -1
  140. data/vendor/plugins/easy-ckeditor/lib/ckeditor.rb +1 -20
  141. data/vendor/plugins/easy-ckeditor/{tasks → lib/tasks}/ckeditor_tasks.rake +0 -0
  142. data/vendor/plugins/filemanager/app/controllers/fm/filemanager_controller.rb +22 -0
  143. data/vendor/plugins/filemanager/app/views/fm/filemanager/index.html.erb +512 -0
  144. data/vendor/plugins/filemanager/app/views/fm/filemanager/view.html.erb +67 -0
  145. data/vendor/plugins/filemanager/filemanager.yml +16 -0
  146. data/vendor/plugins/static_sidebar/lib/static_sidebar.rb +4 -2
  147. data/vendor/plugins/typo_converter/{tasks → lib/tasks}/typo_converters_tasks.rake +0 -0
  148. data/vendor/plugins/typo_login_system/lib/access_control.rb +24 -1
  149. data/vendor/plugins/typo_textfilter_code/{tasks → lib/tasks}/typo_textfilter_code_tasks.rake +0 -0
  150. data/vendor/plugins/typo_textfilter_code/lib/typo_textfilter_code.rb +4 -3
  151. data/vendor/plugins/typo_textfilter_flickr/{tasks → lib/tasks}/typo_textfilter_flickr_tasks.rake +0 -0
  152. data/vendor/plugins/typo_textfilter_htmlfilter/{tasks → lib/tasks}/typo_textfilter_htmlfilter_tasks.rake +0 -0
  153. data/vendor/plugins/typo_textfilter_lightbox/{tasks → lib/tasks}/typo_textfilter_lightbox_tasks.rake +0 -0
  154. data/vendor/plugins/typo_textfilter_markdown/{tasks → lib/tasks}/typo_textfilter_markdown_tasks.rake +0 -0
  155. data/vendor/plugins/typo_textfilter_none/{tasks → lib/tasks}/typo_textfilter_none_tasks.rake +0 -0
  156. data/vendor/plugins/typo_textfilter_smartypants/{tasks → lib/tasks}/typo_textfilter_smartypants_tasks.rake +0 -0
  157. data/vendor/plugins/typo_textfilter_textile/{tasks → lib/tasks}/typo_textfilter_textile_tasks.rake +0 -0
  158. data/vendor/plugins/typo_textfilter_textile_and_markdown/{tasks → lib/tasks}/typo_textfilter_textile_and_markdown_tasks.rake +0 -0
  159. data/vendor/plugins/xml_sidebar/views/content.rhtml +1 -1
  160. metadata +190 -195
  161. data/app/controllers/admin/cache_controller.rb +0 -9
  162. data/app/models/cache_information.rb +0 -19
  163. data/db/schema.rb +0 -242
  164. data/doc/test_themes.rb +0 -50
  165. data/public/javascripts/ckeditor/config.js +0 -27
  166. data/spec/controllers/accounts_controller_spec.rb +0 -414
  167. data/spec/controllers/admin/cache_controller_spec.rb +0 -18
  168. data/spec/controllers/admin/categories_controller_spec.rb +0 -73
  169. data/spec/controllers/admin/content_controller_spec.rb +0 -443
  170. data/spec/controllers/admin/dashboard_controller_spec.rb +0 -13
  171. data/spec/controllers/admin/feedback_controller_spec.rb +0 -308
  172. data/spec/controllers/admin/pages_controller_spec.rb +0 -80
  173. data/spec/controllers/admin/profiles_controller_spec.rb +0 -22
  174. data/spec/controllers/admin/resources_controller_spec.rb +0 -53
  175. data/spec/controllers/admin/settings_controller_spec.rb +0 -80
  176. data/spec/controllers/admin/tags_controller_spec.rb +0 -64
  177. data/spec/controllers/admin/textfilters_controller_spec.rb +0 -20
  178. data/spec/controllers/admin/themes_controller_spec.rb +0 -30
  179. data/spec/controllers/admin/users_controller_spec.rb +0 -109
  180. data/spec/controllers/application_controller_spec.rb +0 -18
  181. data/spec/controllers/articles_controller_spec.rb +0 -440
  182. data/spec/controllers/authors_controller_spec.rb +0 -42
  183. data/spec/controllers/backend_controller_spec.rb +0 -337
  184. data/spec/controllers/categories_controller_spec.rb +0 -117
  185. data/spec/controllers/comments_controller_spec.rb +0 -137
  186. data/spec/controllers/routes/articles_routing_spec.rb +0 -31
  187. data/spec/controllers/routes/xml_routing_spec.rb +0 -71
  188. data/spec/controllers/setup_controller_spec.rb +0 -24
  189. data/spec/controllers/tags_controller_spec.rb +0 -147
  190. data/spec/controllers/textfilter_controller_spec.rb +0 -192
  191. data/spec/controllers/theme_controller_spec.rb +0 -39
  192. data/spec/controllers/xml_controller_spec.rb +0 -185
  193. data/spec/factories.rb +0 -69
  194. data/spec/helpers/application_helper_spec.rb +0 -25
  195. data/spec/helpers/content_helper_spec.rb +0 -28
  196. data/spec/lib/text_filter_plugin_spec.rb +0 -15
  197. data/spec/models/amazon_sidebar_spec.rb +0 -40
  198. data/spec/models/article_closing_spec.rb +0 -42
  199. data/spec/models/article_spec.rb +0 -515
  200. data/spec/models/blog_spec.rb +0 -116
  201. data/spec/models/cache_information_spec.rb +0 -42
  202. data/spec/models/cache_support_spec.rb +0 -51
  203. data/spec/models/category_spec.rb +0 -44
  204. data/spec/models/comment_spec.rb +0 -240
  205. data/spec/models/configuration_spec.rb +0 -91
  206. data/spec/models/content_state/feedback_states_spec.rb +0 -64
  207. data/spec/models/notification_spec.rb +0 -8
  208. data/spec/models/page_cache_spec.rb +0 -30
  209. data/spec/models/page_spec.rb +0 -91
  210. data/spec/models/ping_pinger_spec.rb +0 -33
  211. data/spec/models/ping_spec.rb +0 -154
  212. data/spec/models/redirect_spec.rb +0 -17
  213. data/spec/models/resource_spec.rb +0 -39
  214. data/spec/models/route_cache_spec.rb +0 -11
  215. data/spec/models/sidebar_spec.rb +0 -7
  216. data/spec/models/static_sidebar_spec.rb +0 -17
  217. data/spec/models/tag_spec.rb +0 -65
  218. data/spec/models/text_filter_spec.rb +0 -34
  219. data/spec/models/theme_spec.rb +0 -45
  220. data/spec/models/trackback_spec.rb +0 -60
  221. data/spec/models/trigger_spec.rb +0 -40
  222. data/spec/models/user_spec.rb +0 -198
  223. data/spec/rcov.opts +0 -2
  224. data/spec/spec.opts +0 -4
  225. data/spec/spec_helper.rb +0 -133
  226. data/spec/views/articles/index_spec.rb +0 -63
  227. data/spec/views/articles/read_spec.rb +0 -67
  228. data/spec/views/comments/html_sanitization_spec.rb +0 -119
  229. data/test/fixtures/blogs.yml +0 -27
  230. data/test/fixtures/categories.yml +0 -29
  231. data/test/fixtures/categorizations.yml +0 -31
  232. data/test/fixtures/contents.yml +0 -231
  233. data/test/fixtures/feedback.yml +0 -180
  234. data/test/fixtures/notification_mailer/article +0 -3
  235. data/test/fixtures/notification_mailer/comment +0 -3
  236. data/test/fixtures/notification_mailer/trackback +0 -3
  237. data/test/fixtures/notifications.yml +0 -0
  238. data/test/fixtures/page_caches.yml +0 -7
  239. data/test/fixtures/profiles.yml +0 -27
  240. data/test/fixtures/redirects.yml +0 -10
  241. data/test/fixtures/resources.yml +0 -21
  242. data/test/fixtures/sidebars.yml +0 -10
  243. data/test/fixtures/tags.yml +0 -10
  244. data/test/fixtures/text_filters.yml +0 -37
  245. data/test/fixtures/triggers.yml +0 -1
  246. data/test/fixtures/users.yml +0 -101
  247. data/test/mocks/test/dns_mock.rb +0 -13
  248. data/test/mocks/test/flickr_mock.rb +0 -30
  249. data/test/mocks/test/http_mock.rb +0 -39
  250. data/test/mocks/test/theme_mock.rb +0 -5
  251. data/test/mocks/test/xmlrpc_mock.rb +0 -28
  252. data/test/mocks/themes/123-numbers-in-path/about.markdown +0 -0
  253. data/test/mocks/themes/CamelCaseDirectory/about.markdown +0 -0
  254. data/test/mocks/themes/i-have-special-chars/about.markdown +0 -0
  255. data/test/mocks/themes/typographic/about.markdown +0 -7
  256. data/test/mocks/themes/typographic/images/Thumbs.db +0 -0
  257. data/test/mocks/themes/typographic/images/accept.png +0 -0
  258. data/test/mocks/themes/typographic/images/accept50.png +0 -0
  259. data/test/mocks/themes/typographic/images/bg_body.jpg +0 -0
  260. data/test/mocks/themes/typographic/images/bg_white.png +0 -0
  261. data/test/mocks/themes/typographic/images/bg_wrapper.jpg +0 -0
  262. data/test/mocks/themes/typographic/images/bullet_bottom.png +0 -0
  263. data/test/mocks/themes/typographic/images/bullet_right.png +0 -0
  264. data/test/mocks/themes/typographic/images/email_open.png +0 -0
  265. data/test/mocks/themes/typographic/images/email_open50.png +0 -0
  266. data/test/mocks/themes/typographic/images/meta.png +0 -0
  267. data/test/mocks/themes/typographic/images/page_edit.png +0 -0
  268. data/test/mocks/themes/typographic/images/page_edit50.png +0 -0
  269. data/test/mocks/themes/typographic/images/tag.png +0 -0
  270. data/test/mocks/themes/typographic/images/user.png +0 -0
  271. data/test/mocks/themes/typographic/images/user50.png +0 -0
  272. data/test/mocks/themes/typographic/images/world_link.png +0 -0
  273. data/test/mocks/themes/typographic/images/world_link50.png +0 -0
  274. data/test/mocks/themes/typographic/layouts/default.html.erb +0 -42
  275. data/test/mocks/themes/typographic/preview.png +0 -0
  276. data/test/mocks/themes/typographic/stylesheets/colors.css +0 -51
  277. data/test/mocks/themes/typographic/stylesheets/layout.css +0 -346
  278. data/test/mocks/themes/typographic/stylesheets/reset.css +0 -5
  279. data/test/mocks/themes/typographic/stylesheets/style.css +0 -36
  280. data/test/mocks/themes/typographic/views/articles/_article.html.erb +0 -41
  281. data/test/mocks/themes/typographic/views/articles/_comment.html.erb +0 -14
  282. data/test/mocks/themes/typographic/views/articles/_comment_form.html.erb +0 -48
  283. data/test/mocks/themes/typographic/views/articles/_comment_list.html.erb +0 -7
  284. data/test/mocks/themes/typographic/views/articles/_trackback.html.erb +0 -9
  285. data/test/mocks/themes/typographic/views/articles/comment_preview.html.erb +0 -10
  286. data/test/mocks/themes/typographic/views/articles/index.html.erb +0 -5
  287. data/test/mocks/themes/typographic/views/articles/read.html.erb +0 -42
  288. data/test/mocks/themes/typographic/views/shared/_search.html.erb +0 -17
  289. data/test/mocks/themes/typographic/views/theme/static_view_test.html.erb +0 -1
  290. data/test/test_helper.rb +0 -13
  291. data/themes/true-blue-3/images/frederic-de-villamil.jpg +0 -0
  292. data/themes/true-blue-3/images/textarea_bg.jpg +0 -0
@@ -0,0 +1,22 @@
1
+ =begin
2
+ filemanager_controller.rb
3
+ Copyright (C) 2008 Leon Li
4
+
5
+ You may redistribute it and/or modify it under the same
6
+ license terms as Ruby.
7
+ =end
8
+
9
+ require 'iconv'
10
+ require 'fileutils'
11
+ require 'filemanager/controller'
12
+
13
+ class Fm::FilemanagerController < ApplicationController
14
+
15
+ include Filemanager::Controller
16
+
17
+ layout false
18
+ before_filter :set_up
19
+ after_filter :tear_off
20
+ skip_before_filter :verify_authenticity_token
21
+ unloadable
22
+ end
@@ -0,0 +1,512 @@
1
+ <html>
2
+ <head>
3
+ <title>Filemanager</title>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <%= javascript_include_tag 'prototype', 'scriptaculous', 'effetcs', 'builder', 'lightbox', 'prototype_ext', :cache => true %>
6
+
7
+ <script src="<%= this_blog.base_url %>/javascripts/prototype.js" type="text/javascript"></script>
8
+ <script src="<%= this_blog.base_url %>/javascript/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
9
+ <script src="/filemanager/javascripts/lang/<%= this_blog.lang %>.js" type="text/javascript"></script>
10
+ <script src="/filemanager/javascripts/translate.js" type="text/javascript"></script>
11
+ <script src="/filemanager/javascripts/filemanager.js" type="text/javascript"></script>
12
+ <script language=javascript type=text/javascript>
13
+ var currentFile = null;
14
+ function showControl(file) {
15
+ setCssClass($('imageControl'), "hidelayer");
16
+ setCssClass($('viewControl'), "showlayer");
17
+ currentFile = file;
18
+ if(file.length > 4) {
19
+ var suffix = file.substring(file.length -3).toLowerCase();
20
+ if (suffix == 'jpg' || suffix == 'gif' || suffix == 'png') {
21
+ setCssClass($('imageControl'), "showlayer");
22
+ }
23
+ }
24
+ }
25
+ </script>
26
+ <link href="/filemanager/stylesheets/general.css" media="screen" rel="stylesheet" type="text/css" />
27
+ <link href="/filemanager/stylesheets/filelist.css" media="screen" rel="stylesheet" type="text/css" />
28
+ <link href="/filemanager/stylesheets/lightbox.css" media="screen" rel="stylesheet" type="text/css" />
29
+ <style type="text/css">
30
+ body, select, textarea, div {
31
+ margin:0;
32
+ padding:0;
33
+ font-family: "Arial";
34
+ font-size: 9pt;
35
+ line-height:1.5em;
36
+ }
37
+ input{
38
+ margin:0;
39
+ padding:0;
40
+ font-family: "Arial";
41
+ font-size:9pt;
42
+ line-height: 1.5em;
43
+ vertical-align:middle;
44
+ }
45
+
46
+
47
+ img {
48
+ border:0px;
49
+ vertical-align:middle;
50
+ }
51
+ form {
52
+ margin:0px;
53
+ padding:0px;
54
+ }
55
+ a {
56
+ color:#000000;
57
+ text-decoration: none;
58
+ }
59
+ a:hover {
60
+ color:#FF0000
61
+ }
62
+
63
+ .hidelayer {
64
+ display:none;
65
+ visibility:hidden;
66
+ }
67
+ .showlayer {
68
+ display:block;
69
+ visibility:visible;
70
+ }
71
+ .hideMenu {
72
+ position:absolute;
73
+ list-style:none;
74
+ margin:0;
75
+ padding:0;
76
+ display:none;
77
+ border:1px solid #DDDDDD;
78
+ background-color:#EEEEEE;
79
+ }
80
+ .hideMenu li{
81
+ padding:1px;
82
+ }
83
+ .hideMenu li a{
84
+ padding:3px;
85
+ display:block;
86
+ text-decoration:none;
87
+ cursor:default;
88
+ }
89
+ .hideMenu li a:link, a:visited{
90
+ color:black;
91
+ }
92
+ .hideMenu li a:hover{
93
+ color:white;
94
+ background-color:#039;
95
+ }
96
+ </style>
97
+ </head>
98
+ <body >
99
+ <div id="loading" style="display:none">Loading...</div>
100
+ <ul id='foldMenu' class="hideMenu">
101
+ <li><a href="javascript:rename()"><span fmLang="rename">Rename</span></a></li>
102
+ <li><a href="javascript:copyFile()"><span fmLang="copy">Copy</span></a></li>
103
+ <li><a href="javascript:cutFile()"><span fmLang="cut">Cut</span></a></li>
104
+ <li><a href="javascript:pasteFile()"><span fmLang="paste">Paste</span></a></li>
105
+ <li><a href="javascript:removeFile()"><span fmLang="remove">Remove</span></a></li>
106
+ <li><a href="javascript:zipDownload();"><span fmLang="download">Download</span></a></li>
107
+ </ul>
108
+ <ul id='fileMenu' class="hideMenu">
109
+ <li><a href="javascript:selectFile()"><span fmLang="selectFile">Select File</span></a></li>
110
+ <li id="unzip"><a href="javascript:unzipFile()"><span fmLang="unzipFile">Unzip File</span></a></li>
111
+ <li><a href="javascript:rename()"><span fmLang="rename">Rename</span></a></li>
112
+ <li><a href="javascript:copyFile()"><span fmLang="copy">Copy</span></a></li>
113
+ <li><a href="javascript:cutFile()"><span fmLang="cut">Cut</span></a></li>
114
+ <li><a href="javascript:removeFile()"><span fmLang="remove">Remove</span></a></li>
115
+ <li><a href="javascript:zipDownload();"><span fmLang="download">Download</span></a></li>
116
+ </ul>
117
+ <ul id='blankMenu' class="hideMenu">
118
+ <li><a href="javascript:newFolder()"><span fmLang="new_folder">New Folder</span></a></li>
119
+ <li><a href="javascript:newFile()"><span fmLang="new_file">New File</span></a></li>
120
+ <li><a href="javascript:pasteFile()"><span fmLang="paste">Paste</span></a></li>
121
+ <li><a href="javascript:;" onmouseover="setCssClass($('uploadForm'), 'showlayer');"><span fmLang="upload_file">Upload File</span></a>
122
+ <div id="uploadForm" align="right" class="hidelayer">
123
+ <form id="fileForm" method="post" enctype="multipart/form-data">
124
+ <input type="file" name="upload" class="file" />
125
+ <input type="button" fmLang="upload" value="Upload" onclick="uploadFile();"/>
126
+ </form>
127
+ </div>
128
+ </li>
129
+ </ul>
130
+ <div id=filelist>
131
+ <table cellspacing=0 cellpadding=3 width="100%" height="100%" border=0>
132
+ <tr>
133
+ <td valign="top">
134
+ <hr style="height:1px">
135
+ <form name=filelistform action=filelist.php method=post>
136
+ <table cellspacing=0 cellpadding=2 width="100%" border=0>
137
+ <tbody>
138
+ <tr height=0>
139
+ <td nowrap width=1></td>
140
+ <td nowrap width=1></td>
141
+ <td nowrap width="100%"></td>
142
+ <td nowrap width=1></td>
143
+ <td nowrap width="1%"></td>
144
+ <td id=spacercol width=0></td>
145
+ </tr>
146
+ <tr class=filelistheadrow id=filelistheadreal>
147
+ <td id=selectcol1 valign=center nowrap align=middle width=1><a onmousedown="return false;" title="toggle all" href="javascript:checkAll();"><img id=toggleall height=10 alt="toggle all" hspace=3 src="/filemanager/images/box.gif" width=10 border=0></a></td>
148
+ <td id=iconcol1 nowrap width=20><img height=1 src="/filemanager/images/spacer.gif" width=10></td>
149
+ <td class=filelistheadcol id=fnamecol1 nowrap width="100%"> <span fmLang="file_name">File Name</span> </td>
150
+ <td class=filelistheadcol id=fsizecol1 nowrap width="2%"> <span fmLang="file_size">File Size</span> </td>
151
+ <td class=filelistheadcol id=fmodcol1 nowrap width="2%" align="center"> <span fmLang="modification_date">Modification Date</span> </td>
152
+ </tr>
153
+ <%
154
+ path = @controller.encode(@path)
155
+ unless @parent_path.nil?
156
+ %>
157
+ <tr class=filelistroweven>
158
+ <td width=1></td>
159
+ <td><a onmousedown="return false;" href="#"><img class="" title=directory height=16 alt=directory src="/filemanager/images/folder.gif" width=16 border=0></a></td>
160
+ <td class=filelistfilename><a onmousedown="return false;" href="?path=<%= @controller.encode(@parent_path) %>">..</a></td>
161
+ <td nowrap></td>
162
+ <td nowrap><%= File.ctime(@resource_path + @parent_path).strftime("%Y-%m-%d %H:%M:%S") %></td>
163
+ </tr>
164
+ <%
165
+ end
166
+ unless @directories.nil?
167
+ @directories.each do |i|
168
+ next if i == '.' || i == '..'
169
+ old_i = i
170
+ i = @controller.encode(i)
171
+ %>
172
+ <tr class=filelistroweven id="tr_<%= i %>">
173
+ <td width=1><input onclick="triggerselect(this)" type="checkbox" name="fileCheck" value="<%= i %>"></td>
174
+ <td><a onmousedown="return false;" href="#"><img class="" title=directory height=16 alt=directory src="/filemanager/images/folder.gif" width=16 border=0></a></td>
175
+ <td class=filelistfilename>
176
+ <a id="context_fold_<%= i %>" onmousedown="return false;" title="<%= path + '/' + i %>" href="?path=<%= URI.encode(path + '/' + i) %>"><%= i %></a>
177
+ </td>
178
+ <td nowrap>
179
+ </td>
180
+ <td nowrap><%= File.ctime(@current_path + '/' + old_i).strftime("%Y-%m-%d %H:%M:%S") %></td>
181
+ </tr>
182
+ <%
183
+ end
184
+ end
185
+ unless @files.nil?
186
+ @files.each do |i|
187
+ old_i = i
188
+ i = @controller.encode(i)
189
+ %>
190
+ <tr class=filelistroweven id="tr_<%= i %>">
191
+ <td width=1><input onclick="triggerselect(this)" type="checkbox" name="fileCheck" value="<%= i %>"></td>
192
+ <td><a onmousedown="return false;" name="<%= i %>"></a><a href="#"><img class="" height=16 src="/filemanager/images/<%= @controller.get_file_type(i) %>.gif" width=16 border=0></a></td>
193
+ <td class=filelistfilename>
194
+ <!-- <a id="context_file_<%= i %>" title="<%= path + '/' + i %>" href="javascript:ajaxLink('/fm/filemanager/view?path=<%= path + '/' + i %>', 'view', 'none');" onmousedown="hideMenu();" onclick="showControl('<%= path + '/' + i %>')" ><%= i %></a> -->
195
+ <a id="context_file_<%= i %>" title="<%= path + '/' + i %>" href="javascript:selectFile('<%= path + '/' + i %>')" onmouseover="ajaxLink('/fm/filemanager/view?path=<%= URI.encode(path + '/' + i).gsub("#","%23") %>', 'view', 'none');" onmousedown="hideMenu();" onclick="showControl('<%= path + '/' + i %>')" ><%= i %></a>
196
+ </td>
197
+ <td nowrap><%= @controller.hsize(File.size(@current_path + '/' + old_i).to_f) %></td>
198
+ <td nowrap><%= File.ctime(@current_path + '/' + old_i).strftime("%Y-%m-%d %H:%M:%S") %></td>
199
+ </tr>
200
+ <%
201
+ end
202
+ end
203
+ %>
204
+ </tbody>
205
+ </table>
206
+ </form>
207
+ </td>
208
+ <td width="300" valign="top">
209
+ <fieldset style="margin:0px">
210
+ <legend align=left><span fmLang="directory_information">Directory Information</span></legend>
211
+ <div style="margin: 2px; overflow: hidden; width: 100%">
212
+ <div class=previewsubtitle><span fmLang="directory_name">Directory Name</span></div>
213
+ <div class=previewtext><%= @controller.encode(File.basename(@current_path)) %></div>
214
+ </div>
215
+ <div style="float: left; margin: 2px; width: 45%">
216
+ <div class=previewsubtitle><span fmLang="sub_directories">Sub-directories</span>:</div>
217
+ <div class=previewtext><%= @directories.size - 2 %></div>
218
+ <div class=previewsubtitle><span fmLang="modification_date">Modification Date</span>:</div>
219
+ <div class=previewtext><%= File.ctime(@current_path).strftime("%Y-%m-%d %H:%M:%S") %></div>
220
+ </div>
221
+ <div style="float: right; margin: 2px; width: 45%">
222
+ <div class=previewsubtitle><span fmLang="files">Files</span>:</div>
223
+ <div class=previewtext><%= @files.size %></div>
224
+ <div class=previewsubtitle><span fmLang="file_total_size">File Total Size</span>:</div>
225
+ <div class=previewtext><%= @controller.hsize(@file_total_size) %></div>
226
+
227
+ </div>
228
+ <br style="clear: both">
229
+ </fieldset>
230
+
231
+ <div id="view" style="width:300px; height:300px;overflow:auto;border:1px solid #aaaaaa">
232
+ <div align="center">
233
+ <br><br>
234
+ <span fmLang="preview_area">Preview Area</span>
235
+ </div>
236
+ </div>
237
+
238
+ <div id="viewControl" align="right" class="hidelayer">
239
+
240
+ <div id="imageControl" class="hidelayer">
241
+ <!--
242
+ <form id="sizeForm" >
243
+ <span fmLang="width">Width</span>:<input type="text" name="width" value="" size="3" maxlength="4"/> * <span fmLang="height">Height</span>:<input type="text" name="height" value="" size="3" maxlength="4"/>
244
+ <br>
245
+ <input type="checkbox" name="keepRadioFlag" value="true"/><span fmLang="keep_radio">Keep Radio</span>
246
+ <input type="checkbox" name="thumbFlag" value="true"/><span fmLang="thumb">Thumb</span>
247
+ <input type="button" class="button" fmLang="submit" value="Submit" onclick="adjustSize(currentFile);"/>
248
+ </form>
249
+ <form id="rotateForm" >
250
+ <span fmLang="angle">Angle</span>:<input type="text" name="rotateNum" value="" size="4" maxlength="4"/>
251
+ <input type="button" class="button" fmLang="submit" value="Submit" onclick="rotate(currentFile);"/>
252
+ </form>
253
+ -->
254
+ </div>
255
+ <div>
256
+
257
+ <input type="button" class="button" fmLang="view" value="View" onclick="window.open('<%= @lock_path %>'+currentFile,'','')"/>
258
+ </div>
259
+ </div>
260
+ </td>
261
+ </tr>
262
+ </table>
263
+ </div>
264
+ <script language="javascript">
265
+
266
+ var foldMenu = $("foldMenu");
267
+ var fileMenu = $("fileMenu");
268
+ var blankMenu = $("blankMenu");
269
+ var selectedName = "";
270
+ var lastObject = false;
271
+ var old_name = "";
272
+ var lastMenu = false;
273
+ function hideMenu() {
274
+ if (lastMenu) {
275
+ lastMenu.style.visibility = "hidden";
276
+ lastMenu.style.display = "none";
277
+ }
278
+ setCssClass($('uploadForm'), 'hidelayer');
279
+ }
280
+ function showMenu(obj) {
281
+ obj.style.visibility = "visible";
282
+ obj.style.display = "block";
283
+ }
284
+ document.oncontextmenu = function(e){
285
+ hideMenu();
286
+ lastObject = false;
287
+ e = window.event || e;
288
+ var target = (e.target) ? e.target : e.srcElement;
289
+ var menu = false;
290
+ if (target && target.id.length > 8 && target.id.substring(0,8) == 'context_') {
291
+ old_name = target.innerHTML;
292
+ lastObject = target;
293
+ if (target.id.substring(8, 12) == 'fold') {
294
+ menu = foldMenu;
295
+ } else if (target.id.substring(8, 12) == 'file') {
296
+ var upzipStr = target.id.substring(target.id.length-3, target.id.length);
297
+ if (upzipStr == 'zip') {
298
+ $('unzip').show();
299
+ } else {
300
+ $('unzip').hide();
301
+ }
302
+ menu = fileMenu;
303
+ }
304
+ currentFile = target.title;
305
+ } else {
306
+ menu = blankMenu;
307
+ }
308
+ lastMenu = menu;
309
+ x = e.x || e.layerX;
310
+ y = e.y || e.layerY;
311
+ menu.style.left = x + "px";
312
+ menu.style.top = y + "px";
313
+ showMenu(menu) ;
314
+ return false;
315
+ }
316
+ document.onclick = function(e){
317
+ e = window.event || e;
318
+ var target = (e.target) ? e.target : e.srcElement;
319
+
320
+ if (target) {
321
+ try {
322
+ if (target.type == 'undefined' || target.type == null) {
323
+ hideMenu();
324
+ } else if (target.type == "file") {
325
+ } else {
326
+ hideMenu();
327
+ }
328
+ } catch(e1) {
329
+ hideMenu();
330
+ }
331
+ } else {
332
+ hideMenu();
333
+ }
334
+ }
335
+ var refreshLink;
336
+ function refreshPage() {
337
+ refreshLink = '/fm/filemanager?path=<%= path %>' + "&randomid=" + new Date().toJSON();
338
+ setTimeout(waitFefresh, 500);
339
+ }
340
+ function waitFefresh() {
341
+ location.href = refreshLink;
342
+ }
343
+ function gotoPage(link) {
344
+ location.href = link;
345
+ }
346
+ function updateHtml(obj, content) {
347
+ obj.innerHTML = content;
348
+ }
349
+ function rename() {
350
+ var new_name = prompt(getText("prompt_input_new_name", "Please input new name"), old_name);
351
+ if (new_name != null && new_name != "" && new_name != old_name) {
352
+ ajaxLink("/fm/filemanager/rename?path=<%= path %>&old_name=" + old_name + "&new_name=" + new_name, $("view"), null, refreshPage());
353
+ }
354
+ }
355
+ function markObject(obj) {obj.style.color='#aaaaaa';};
356
+ function unmarkObject(obj) {obj.style.color='#000000';};
357
+ function unzipFile() {
358
+ ajaxLink("/fm/filemanager/unzip?path=<%= path %>&old_name=" + old_name, $("view"), null, refreshPage());
359
+ }
360
+ function removeFile() {
361
+ if (selectedName.length == 0) {
362
+ if (confirm(getText("remove", "Remove") + ' ' + old_name)) {
363
+ ajaxLink("/fm/filemanager/remove?path=<%= path %>&source[]=" + old_name, $("view"), null, refreshPage());
364
+ }
365
+ } else {
366
+ if (confirm(getText("remove", "Remove"))) {
367
+ var nameArray = new Array();
368
+ nameArray = selectedName.split('*');
369
+ var parameter = "";
370
+ for (var i = 0; i < nameArray.length; i++) {
371
+ parameter += "&source[]=" + nameArray[i];
372
+ }
373
+ ajaxLink("/fm/filemanager/remove?path=<%= path %>" + parameter, $("view"), null, refreshPage());
374
+ }
375
+ }
376
+ }
377
+ function copyFile() {
378
+ if (selectedName.length == 0) {
379
+ ajaxLink("/fm/filemanager/copy?path=<%= path %>&source[]=" + old_name, $("view"), null);
380
+ } else {
381
+ var nameArray=new Array();
382
+ nameArray = selectedName.split('*');
383
+ var parameter = "";
384
+ for (var i = 0; i < nameArray.length; i++) {
385
+ parameter += "&source[]=" + nameArray[i];
386
+ }
387
+ ajaxLink("/fm/filemanager/copy?path=<%= path %>" + parameter, $("view"), null);
388
+ }
389
+ }
390
+ function cutFile() {
391
+ if (selectedName.length == 0) {
392
+ ajaxLink("/fm/filemanager/cut?path=<%= path %>&source[]=" + old_name, $("view"), null, markObject(lastObject));
393
+ } else {
394
+ var nameArray=new Array();
395
+ nameArray = selectedName.split('*');
396
+ var parameter = "";
397
+ for (var i = 0; i < nameArray.length; i++) {
398
+ parameter += "&source[]=" + nameArray[i];
399
+ }
400
+ ajaxLink("/fm/filemanager/cut?path=<%= path %>" + parameter, $("view"), null);
401
+ }
402
+ }
403
+ function checkAll() {
404
+ var inputs=document.getElementsByTagName("input");
405
+ if (selectedName.length != 0) {
406
+ for(var i=0;i<inputs.length;i++){
407
+ var input=inputs[i];
408
+ if("checkbox" == input.type && input.name == "fileCheck") {
409
+ input.checked = false;
410
+ }
411
+ }
412
+ selectedName = "";
413
+ } else {
414
+ for(var i=0;i<inputs.length;i++){
415
+ var input=inputs[i];
416
+ if("checkbox" == input.type && input.name == "fileCheck") {
417
+ input.checked = true;
418
+ if (selectedName.length == 0) {
419
+ selectedName = input.value;
420
+ } else {
421
+ selectedName += "*" + input.value;
422
+ }
423
+ }
424
+ }
425
+ }
426
+ }
427
+ function pasteFile() {
428
+ if (lastObject) {
429
+ if (confirm(getText("prompt_pasteTo", "Paste to") + ' ' + old_name)) {
430
+ ajaxLink("/fm/filemanager/paste?path=<%= path %>/" + old_name, $("view"), null, refreshPage());
431
+ }
432
+ } else {
433
+ if (confirm(getText("prompt_pasteToCurrent", "Paste to current"))) {
434
+ ajaxLink("/fm/filemanager/paste?path=<%= path %>", $("view"), null, refreshPage());
435
+ }
436
+ }
437
+ }
438
+ function newFile() {
439
+ var new_name = prompt(getText("prompt_input_name", "Please input name"), "");
440
+ if (new_name != null && new_name.length > 0) {
441
+ ajaxLink("/fm/filemanager/new_file?path=<%= path %>&new_name=" + new_name, $("view"), null, refreshPage());
442
+ }
443
+ }
444
+ function newFolder() {
445
+ var new_name = prompt(getText("prompt_input_name", "Please input name"), "");
446
+ if (new_name != null && new_name.length > 0) {
447
+ ajaxLink("/fm/filemanager/new_folder?path=<%= path %>&new_name=" + new_name, $("view"), null, refreshPage());
448
+ }
449
+ }
450
+ function zipDownload(){
451
+ if(confirm(getText("prompt_zip_download", "Zip and download") + ' ' + old_name))
452
+ if (selectedName.length == 0) {
453
+ window.location.href = "/fm/filemanager/download?path=<%= path %>&source[]=" + old_name;
454
+ } else {
455
+ var nameArray=new Array();
456
+ nameArray = selectedName.split('*');
457
+ var parameter = "";
458
+ for (var i = 0; i < nameArray.length; i++) {
459
+ parameter += "&source[]=" + nameArray[i];
460
+ }
461
+ window.location.href = "/fm/filemanager/download?path=<%= path %>" + parameter;
462
+ }
463
+ }
464
+ function triggerselect(obj) {
465
+ var name = "*" + obj.value;
466
+ if (selectedName.indexOf(name) == -1 && (selectedName.length < obj.value.length || selectedName.substring(0, obj.value.length) != obj.value)) {
467
+ if (obj.checked) {
468
+ if (selectedName.length == 0) {
469
+ selectedName += obj.value;
470
+ } else {
471
+ selectedName += name;
472
+ }
473
+ }
474
+ } else if (!obj.checked) {
475
+ var pos = selectedName.indexOf(obj.value);
476
+ if (pos == 0) {
477
+ if (selectedName.length > obj.value.length) {
478
+ selectedName = selectedName.substring(obj.value.length + 1);
479
+ } else {
480
+ selectedName = "";
481
+ }
482
+ } else {
483
+ if (selectedName.length > (pos + obj.value.length)) {
484
+ selectedName = selectedName.substring(0, pos-1) + selectedName.substring(pos + obj.value.length);
485
+ } else {
486
+ selectedName = selectedName.substring(0, pos-1);
487
+ }
488
+ }
489
+ }
490
+ }
491
+
492
+ function selectFile() {
493
+ if (opener) {
494
+ window.opener.CKEDITOR.tools.callFunction(<%= params[:CKEditorFuncNum] %>, ('<%= @lock_path %>' + currentFile).replace( '#', '%23' ));
495
+ window.close();
496
+ window.top.opener.focus() ;
497
+ }
498
+ }
499
+ function uploadFile() {
500
+ $("fileForm").action = "/fm/filemanager/upload?path=<%= path %>";
501
+ $("fileForm").submit();
502
+ }
503
+ function adjustSize(file) {
504
+ ajaxPost("/fm/filemanager/adjust_size?path=" + file, $("sizeForm"), $("view"), null, refreshPage());
505
+ }
506
+ function rotate(file) {
507
+ ajaxPost("/fm/filemanager/rotate?path=" + file, $("rotateForm"), $("view"), null, refreshPage());
508
+ }
509
+
510
+ </script>
511
+ </body>
512
+ </html>