Просмотр файла modules/padmin/settings.php

Размер файла: 6.12Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.pp.ua *
  7. **********************************/
  8. $locate = 'in_padmin';
  9. if(isset($user) && $user['level'] >= 6) {
  10.  
  11. $title = $lang->word('padmin_settings');
  12. require_once(SYS.'/view/header.php');
  13. $tpl->div('title', $lang->word('padmin_settings'));
  14. if(isset($_POST['save']) && $_GET['act']== 'save') {
  15. $lnges = input($_POST['lang']);
  16. $theme_w = input($_POST['theme']);
  17. $open_reg = input($_POST['open_reg']);
  18. $open_site = input($_POST['open_site']);
  19. $public_site = input($_POST['public_site']);
  20. $timezone = input($_POST['timezone']);
  21. $title_s = substr(input($_POST['title']), 0, 20);
  22. $keywords = substr(input($_POST['keywords']), 0, 500);
  23. $description = substr(input($_POST['description']), 0, 1500);
  24. $copyright = substr(input($_POST['copyright']), 0, 20);
  25. $ames = substr(abs(intval($_POST['ames'])), 0, 2);
  26. $db->query("UPDATE `system` SET `lang` = '". $lnges."', `theme` = '". $theme_w."', `open_reg` = '". $open_reg."', `ames` = '". $ames."', `open_site` = '". $open_site."', `public_site` = '". $public_site."', `title` = '". $title_s."', `keywords` = '". $keywords."', `description` = '". $description."', `copyright` = '". $copyright."', `timezone` = '$timezone'");
  27. $tpl->div('menu', $lang->word('succ_save'));
  28. $tpl->div('block', img('settings.png') . '<a href="/padmin/settings/">'.$lang->word('padmin_settings').'</a><br/>'. img('admin.png') .'<a href="/padmin/">'. $lang->word('padmin') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
  29. require_once(SYS.'/view/footer.php');
  30. exit;
  31. }
  32. echo '<div class="post">
  33. <form action="/padmin/settings/?act=save" method="post">
  34. <b>'. $lang->word('slang') .'</b>:<br/>
  35. <select name="lang" size="1">';
  36. $langs_dir = opendir(SYS .'/lang');
  37. while ($langs = readdir($langs_dir)) {
  38. if ($langs == '.' || $langs == '..')
  39. continue;
  40. $lngs = parse_ini_file(SYS .'/lang/'.$langs.'/lang.ini');
  41. echo '<option value="'. $langs .'" '. ($system['lang'] == $langs?' selected="selected"':NULL) .'>'. $lngs['lang_name'] .'</option>';
  42. }
  43. echo '</select><br />
  44. <b>'. $lang->word('stheme') .'</b>:<br/>
  45. <select name="theme" size="1">';
  46. $themes_dir = opendir(TPL .'/themes/wap');
  47. while ($themes = readdir($themes_dir)) {
  48. if ($themes == '.' || $themes == '..')
  49. continue;
  50. $thems = parse_ini_file(TPL .'/themes/wap/'.$themes.'/manifest.ini');
  51. echo '<option value="'. $themes .'" '. ($system['theme'] == $themes?' selected="selected"':NULL) .'>'. $thems['name'] .'</option>';
  52. }
  53. echo '</select><br/>
  54. <b>'. $lang->word('timezone') .'</b>:<br />
  55. <select name="timezone">';
  56. $zonelist =
  57. array
  58. (
  59. 'Kwajalein' => '-12:00',
  60. 'Pacific/Midway' => '-11:00',
  61. 'Pacific/Honolulu' => '-10:00',
  62. 'America/Anchorage' => '-09:00',
  63. 'America/Los_Angeles' => '-08:00',
  64. 'America/Denver' => '-07:00',
  65. 'America/Tegucigalpa' => '-06:00',
  66. 'America/New_York' => '-05:00',
  67. 'America/Caracas' => '-04:30',
  68. 'America/Halifax' => '-04:00',
  69. 'America/St_Johns' => '-03:30',
  70. 'America/Argentina/Buenos_Aires' => '-03:00',
  71. 'America/Sao_Paulo' => '-03:00',
  72. 'Atlantic/South_Georgia' => '-02:00',
  73. 'Atlantic/Azores' => '-01:00',
  74. 'Europe/Dublin' => '0',
  75. 'Europe/Belgrade' => '+01:00',
  76. 'Europe/Kiev' => '+02:00',
  77. 'Asia/Kuwait' => '+03:00',
  78. 'Asia/Tehran' => '+03:30',
  79. 'Asia/Muscat' => '+04:00',
  80. 'Asia/Yekaterinburg' => '+05:00',
  81. 'Asia/Kolkata' => '+05:30',
  82. 'Asia/Katmandu' => '+05:45',
  83. 'Asia/Dhaka' => '+06:00',
  84. 'Asia/Rangoon' => '+06:00',
  85. 'Asia/Krasnoyarsk' => '+07:00',
  86. 'Asia/Brunei' => '+08:00',
  87. 'Asia/Seoul' => '+09:00',
  88. 'Australia/Darwin' => '+09:30',
  89. 'Australia/Canberra' => '+10:00',
  90. 'Asia/Magadan' => '+11:00',
  91. 'Pacific/Fiji' => '+12:00',
  92. 'Pacific/Tongatapu' => '+13:00'
  93. );
  94. foreach($zonelist as $zone => $timez) {
  95. echo '<option value="'.$zone.'" '.($zone == $system['timezone'] ? 'selected="selected"' : NULL).'>'.$timez.'</option>'."\n";
  96. }
  97. echo '</select><br/>
  98. <b>'. $lang->word('open_reg') .'</b>:<br />
  99. <input type="radio" name="open_reg" value="yes"'. ($system['open_reg'] == 'yes'?' checked="checked"':NULL) .' />'. $lang->word('yyes') .'
  100. <input type="radio" name="open_reg" value="no"'. ($system['open_reg'] == 'no'?' checked="checked"':NULL) .' />'. $lang->word('yno') .'<br />
  101. <b>'. $lang->word('open_site') .'</b>:<br />
  102. <input type="radio" name="open_site" value="yes"'. ($system['open_site'] == 'yes'?' checked="checked"':NULL) .' />'. $lang->word('yyes') .'
  103. <input type="radio" name="open_site" value="no"'. ($system['open_site'] == 'no'?' checked="checked"':NULL) .' />'. $lang->word('yno') .'<br />
  104. <b>'. $lang->word('public_site') .'</b>:<br />
  105. <input type="radio" name="public_site" value="yes"'. ($system['public_site'] == 'yes'?' checked="checked"':NULL) .' />'. $lang->word('yyes') .'
  106. <input type="radio" name="public_site" value="no"'. ($system['public_site'] == 'no'?' checked="checked"':NULL) .' />'. $lang->word('yno') .'<br />
  107. <b>'. $lang->word('title') .'</b>:<br />
  108. <input type="text" name="title" value="'. $system['title'] .'" /><br/>
  109. <b>'. $lang->word('copyright') .'</b>:<br />
  110. <input type="text" name="copyright" value="'. $system['copyright'] .'" /><br/>
  111. <b>'. $lang->word('keywords') .'</b>:<br />
  112. <textarea rows="5" cols="26" name="keywords">'. $system['keywords'] .'</textarea><br/>
  113. <b>'. $lang->word('description') .'</b>:<br />
  114. <textarea rows="5" cols="26" name="description">'. $system['description'] .'</textarea><br/>
  115. <b>'. $lang->word('amess') .'</b>:<br />
  116. <input type="text" size="2" name="ames" value="'. $system['ames'] .'" /><br />
  117. <input type="submit" name="save" value="'. $lang->word('save') .'" />
  118. </form>
  119. </div>';
  120. $tpl->div('block', img('admin.png') .'<a href="/padmin/">'. $lang->word('padmin') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
  121. require_once(SYS.'/view/footer.php');
  122. } else { header('Location: /'); }
  123. ?>