inter_wiki.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. from .tool.func import *
  2. def inter_wiki_2(conn, tools):
  3. curs = conn.cursor()
  4. div = '<table id="main_table_set">'
  5. div += '<tr id="main_table_top_tr">'
  6. div += '<td id="main_table_width">A</td>'
  7. div += '<td id="main_table_width">B</td>'
  8. div += '<td id="main_table_width">C</td>'
  9. div += '</tr>'
  10. admin = admin_check()
  11. if tools == 'inter_wiki':
  12. plus_link = 'plus_inter_wiki'
  13. title = load_lang('interwiki_list')
  14. curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'inter_wiki'"))
  15. elif tools == 'email_filter':
  16. plus_link = 'plus_email_filter'
  17. title = load_lang('email_filter_list')
  18. curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'email'"))
  19. elif tools == 'name_filter':
  20. plus_link = 'plus_name_filter'
  21. title = load_lang('id_filter_list')
  22. curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'name'"))
  23. elif tools == 'edit_filter':
  24. plus_link = 'plus_edit_filter'
  25. title = load_lang('edit_filter_list')
  26. curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'regex_filter'"))
  27. elif tools == 'file_filter':
  28. plus_link = 'plus_file_filter'
  29. title = load_lang('file_filter_list')
  30. curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'file'"))
  31. elif tools == 'file_filter':
  32. plus_link = 'plus_file_filter'
  33. title = load_lang('file_filter_list')
  34. curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'file'"))
  35. elif tools == 'image_license':
  36. plus_link = 'plus_image_license'
  37. title = load_lang('image_license_list')
  38. curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'image_license'"))
  39. elif tools == 'extension_filter':
  40. plus_link = 'plus_extension_filter'
  41. title = load_lang('extension_filter_list')
  42. curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'extension'"))
  43. else:
  44. plus_link = 'plus_edit_top'
  45. title = load_lang('edit_tool_list')
  46. curs.execute(db_change("select html, plus, plus_t from html_filter where kind = 'edit_top'"))
  47. db_data = curs.fetchall()
  48. for data in db_data:
  49. div += '<tr>'
  50. div += '<td>'
  51. div += data[0]
  52. if admin == 1:
  53. div += ' <a href="/' + tools + '/add/' + url_pas(data[0]) + '">(' + load_lang('edit') + ')</a>'
  54. div += ' <a href="/' + tools + '/del/' + url_pas(data[0]) + '">(' + load_lang('delete') + ')</a>'
  55. div += '</td>'
  56. if tools == 'inter_wiki':
  57. div += '<td><a id="out_link" href="' + data[1] + '">' + data[1] + '</a></td>'
  58. else:
  59. div += '<td>' + data[1] + '</td>'
  60. div += '<td>' + data[2] + '</td>'
  61. div += '</tr>'
  62. div += '</table>'
  63. if admin == 1:
  64. div += '<hr class="main_hr">'
  65. div += '<a href="/' + tools + '/add">(' + load_lang('add') + ')</a>'
  66. return easy_minify(flask.render_template(skin_check(),
  67. imp = [title, wiki_set(), wiki_custom(), wiki_css([0, 0])],
  68. data = div,
  69. menu = [['manager/1', load_lang('return')]]
  70. ))