admincp_grid.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: admincp_grid.php 31813 2012-10-11 08:13:23Z zhengqingpeng $
  7. */
  8. if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
  9. exit('Access Denied');
  10. }
  11. cpheader();
  12. if(!submitcheck('gridssubmit')) {
  13. $grid = C::t('common_setting')->fetch('grid', true);
  14. shownav('forum', 'forums_grid');
  15. showsubmenu('forums_grid');
  16. showtips('forums_grid_tips');
  17. showformheader('grid');
  18. showtableheader('');
  19. showsetting('forums_grid_show_grid', 'grid[showgrid]', $grid['showgrid'], 'radio', '', 1);
  20. showsetting('forums_grid_style_type', array(0 => 'grid[gridtype]', array(array('0', $lang['forums_grid_style_image']), array(1, $lang['forums_grid_style_text']))), $grid['gridtype'], 'select');
  21. showsetting('forums_grid_text_length', 'grid[textleng]', $grid['textleng'], 'text');
  22. include_once libfile('function/forumlist');
  23. $forumselect = '<select name="grid[fids][]" multiple="multiple" size="10"><option value="0"'.(in_array(0, $grid['fids']) ? ' selected' : '').'>'.$lang['all'].'</option>'.forumselect(FALSE, 0, $grid['fids'], TRUE).'</select>';
  24. showsetting('forums_grid_data_source', '', '', $forumselect);
  25. showsetting('forums_grid_high_light', 'grid[highlight]', $grid['highlight'], 'radio');
  26. showsetting('forums_grid_target_blank', 'grid[targetblank]', $grid['targetblank'], 'radio');
  27. showsetting('forums_grid_show_tips', 'grid[showtips]', $grid['showtips'], 'radio');
  28. showsetting('forums_grid_cache_life', 'grid[cachelife]', $grid['cachelife'], 'text');
  29. showtagfooter('tbody');
  30. showsubmit('gridssubmit');
  31. showtablefooter();
  32. showformfooter();
  33. } else {
  34. $_POST['grid']['fids'] = in_array(0, $_POST['grid']['fids']) ? array(0) : $_POST['grid']['fids'];
  35. C::t('common_setting')->update('grid', $_POST['grid']);
  36. updatecache('setting');
  37. C::t('common_syscache')->delete('grids');
  38. cpmsg('setting_update_succeed', 'action=grid', 'succeed');
  39. }
  40. ?>