config.js 904 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. Config.js
  3. This script handle the save and restore of the
  4. 1) Blog post source
  5. 2) Blog post release (Merged with template)
  6. */
  7. //Create the blog table if not exists
  8. requirelib("filelib");
  9. newDBTableIfNotExists("blog");
  10. function getBlogPostStore(){
  11. var blogPostStorage = readDBItem("blog", "post-store");
  12. if (blogPostStorage == ""){
  13. //The blog post storage is not set. Use default
  14. blogPostStorage = "user:/Document/Blog/";
  15. }
  16. //Create folder if not exists
  17. if (!filelib.fileExists(blogPostStorage)){
  18. filelib.mkdir(blogPostStorage)
  19. }
  20. return blogPostStorage;
  21. }
  22. function setBlogPostStore(newpath){
  23. return writeDBItem("blog", "post-store", newpath);
  24. }
  25. function getBlogReleasePath(){
  26. return readDBItem("blog", "post-release");
  27. }
  28. function setBlogReleasePath(newpath){
  29. return writeDBItem("blog", "post-release", newpath);
  30. }