Changeset 1482
- Timestamp:
- 12.03.2008 14:32:47 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pylucid/media/PyLucid/internal_page/filemanager/edit_file.html
r1449 r1482 5 5 <input onclick="self.location.href='{{ url_abort }}'" name="abort" value="{% trans 'abort' %}" type="reset" /> 6 6 </form> 7 <p>{% blocktrans %}(used charset: '{{ charset }}'){% endblocktrans %}</p> 7 8 </fieldset> trunk/pylucid/PyLucid/plugins_internal/filemanager/filemanager.py
r1411 r1482 58 58 from PyLucid.models import Page 59 59 from PyLucid.system.BasePlugin import PyLucidBasePlugin 60 61 FILE_CHARSET = getattr(settings, "FILE_CHARSET", "UTF-8") 60 62 61 63 #______________________________________________________________________________ … … 456 458 content = f.read() 457 459 f.close() 460 content = content.decode(FILE_CHARSET) 458 461 except Exception, e: 459 462 self.page_msg.red("Error, reading file:", e) … … 462 465 if self.request.method != 'POST': 463 466 form = EditFileForm({ 464 "content": c gi.escape(content),467 "content": content, 465 468 "filename": self.path["filename"], 466 469 }) … … 473 476 abs_file_path = os.path.join(self.path["abs_path"], filename) 474 477 try: 478 content = content.encode(FILE_CHARSET) 475 479 f = file(abs_file_path, "w") 476 480 f.write(content) … … 505 509 "filename": self.path["filename"], 506 510 "form": form, 507 511 "charset": FILE_CHARSET, 508 512 } 509 513 self._render_template("edit_file", context)#, debug=True)
