inter_wiki.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. from .tool.func import *
  2. def inter_wiki_2(conn, tools):
  3. curs = conn.cursor()
  4. div = ''
  5. admin = admin_check()
  6. if tools == 'inter_wiki':
  7. del_link = 'del_inter_wiki'
  8. plus_link = 'plus_inter_wiki'
  9. title = load_lang('interwiki_list')
  10. div = ''
  11. curs.execute(db_change('select title, link from inter'))
  12. elif tools == 'email_filter':
  13. del_link = 'del_email_filter'
  14. plus_link = 'plus_email_filter'
  15. title = load_lang('email_filter_list')
  16. div = ''
  17. curs.execute(db_change("select html from html_filter where kind = 'email'"))
  18. elif tools == 'name_filter':
  19. del_link = 'del_name_filter'
  20. plus_link = 'plus_name_filter'
  21. title = load_lang('id_filter_list')
  22. div = ''
  23. curs.execute(db_change("select html from html_filter where kind = 'name'"))
  24. elif tools == 'edit_filter':
  25. del_link = 'del_edit_filter'
  26. plus_link = 'manager/9'
  27. title = load_lang('edit_filter_list')
  28. div = ''
  29. curs.execute(db_change("select name from filter"))
  30. elif tools == 'file_filter':
  31. del_link = 'del_file_filter'
  32. plus_link = 'plus_file_filter'
  33. title = load_lang('file_filter_list')
  34. div = ''
  35. curs.execute(db_change("select html from html_filter where kind = 'file'"))
  36. elif tools == 'file_filter':
  37. del_link = 'del_file_filter'
  38. plus_link = 'plus_file_filter'
  39. title = load_lang('file_filter_list')
  40. div = ''
  41. curs.execute(db_change("select html from html_filter where kind = 'file'"))
  42. elif tools == 'image_license':
  43. del_link = 'del_image_license'
  44. plus_link = 'plus_image_license'
  45. title = load_lang('image_license_list')
  46. div = ''
  47. curs.execute(db_change("select html from html_filter where kind = 'image_license'"))
  48. else:
  49. del_link = 'del_edit_top'
  50. plus_link = 'plus_edit_top'
  51. title = load_lang('edit_tool_list')
  52. div = ''
  53. curs.execute(db_change("select html, plus from html_filter where kind = 'edit_top'"))
  54. db_data = curs.fetchall()
  55. if db_data:
  56. div += '<ul>'
  57. for data in db_data:
  58. if tools == 'inter_wiki':
  59. div += '<li>' + data[0] + ' : <a id="out_link" href="' + data[1] + '">' + data[1] + '</a>'
  60. elif tools == 'edit_filter':
  61. div += '<li><a href="/plus_edit_filter/' + url_pas(data[0]) + '">' + data[0] + '</a>'
  62. else:
  63. div += '<li>' + data[0]
  64. if tools == 'edit_top':
  65. div += ' : ' + data[1]
  66. if admin == 1:
  67. div += ' <a href="/' + plus_link + '/' + url_pas(data[0]) + '">(' + load_lang('edit') + ')</a>'
  68. div += ' <a href="/' + del_link + '/' + url_pas(data[0]) + '">(' + load_lang('delete') + ')</a>'
  69. div += '</li>'
  70. div += '</ul>'
  71. if admin == 1:
  72. div += '<hr class=\"main_hr\"><a href="/' + plus_link + '">(' + load_lang('add') + ')</a>'
  73. else:
  74. if admin == 1:
  75. div += '<a href="/' + plus_link + '">(' + load_lang('add') + ')</a>'
  76. return easy_minify(flask.render_template(skin_check(),
  77. imp = [title, wiki_set(), custom(), other2([0, 0])],
  78. data = div,
  79. menu = [['manager/1', load_lang('return')]]
  80. ))