Changeset 11667 for extensions/pwgCumulus/include
- Timestamp:
- Jul 8, 2011, 5:58:37 PM (13 years ago)
- Location:
- extensions/pwgCumulus/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/pwgCumulus/include/admin_menu.inc.php
r11344 r11667 20 20 // +-----------------------------------------------------------------------+ 21 21 22 if (!defined('PHPWG_ROOT_PATH')) { 23 die('Hacking attempt!'); 24 } 25 26 $save_config = false; 22 27 $Positions = array('before' => l10n('Before'), 23 28 'after' => l10n('After') 24 29 ); 25 26 $position_order = $me->position_order;27 $position_block_id = $me->position_block_id;28 30 29 31 include_once(PHPWG_ROOT_PATH.'include/block.class.php'); … … 37 39 } 38 40 39 if (!empty($_POST['pwg_cumulus_in_main_menu']) && !$me->pwg_cumulus_in_main_menu) { 40 $me->pwg_cumulus_in_main_menu = true; 41 $page['infos'][] = l10n('Tags cloud added in main menu'); 42 $save_config = true; 43 } elseif (empty($_POST['pwg_cumulus_in_main_menu']) && $me->pwg_cumulus_in_main_menu) { 44 $me->pwg_cumulus_in_main_menu = false; 45 $page['infos'][] = l10n('Tags cloud removed from main menu'); 46 $save_config = true; 47 } 41 if (!empty($_POST['submit'])) { 42 if (!empty($_POST['pwg_cumulus_in_main_menu']) && $_POST['pwg_cumulus_in_main_menu']!=$me->pwg_cumulus_in_main_menu) { 43 $me->pwg_cumulus_in_main_menu = true; 44 $page['infos'][] = l10n('Tags cloud added in main menu'); 45 $save_config = true; 46 } elseif (empty($_POST['pwg_cumulus_in_main_menu']) && $me->pwg_cumulus_in_main_menu) { 47 $me->pwg_cumulus_in_main_menu = false; 48 $page['infos'][] = l10n('Tags cloud removed from main menu'); 49 $save_config = true; 50 } 48 51 49 if (!empty($_POST['position_order']) && isset($Positions[$_POST['position_order']])) { 50 $position_order = $_POST['position_order']; 51 } 52 if (!empty($_POST['position_order']) && isset($Positions[$_POST['position_order']]) 53 && !empty($_POST['position_block_id']) && isset($Blocks[$_POST['position_block_id']]) 54 && ($_POST['position_order']!=$me->position_order || $_POST['position_block_id']!=$me->position_block_id)) { 55 56 $me->position_order = $_POST['position_order']; 57 $me->position_block_id = $_POST['position_block_id']; 58 $page['infos'][] = l10n('Block\'s position has been updated'); 59 $save_config = true; 60 } 52 61 53 if (!empty($_POST['position_block_id']) && isset($Blocks[$_POST['position_block_id']])) { 54 $position_block_id = $_POST['position_block_id']; 55 } 56 57 if ($position_order!=null && $position_block_id!=null) { 58 $me->position_order = $position_order; 59 $me->position_block_id = $position_block_id; 60 $page['infos'][] = l10n('Position in main menu has been updated'); 61 $me->save_config(); 62 if ($save_config) { 63 $me->save_config(); 64 } 62 65 } 63 66 64 67 $template->assign('MENUBAR_BLOCKS', $Blocks); 65 $template->assign('POSITION_ORDER', $ position_order);68 $template->assign('POSITION_ORDER', $me->position_order); 66 69 $template->assign('POSITIONS', $Positions); 67 $template->assign('POSITION_BLOCK_ID', $ position_block_id);70 $template->assign('POSITION_BLOCK_ID', $me->position_block_id); 68 71 $template->assign('PWG_CUMULUS_IN_MAIN_MENU', $me->pwg_cumulus_in_main_menu); 69 72 ?> -
extensions/pwgCumulus/include/pwgCumulusConfig.class.php
r11344 r11667 35 35 36 36 if (!file_exists($this->get_config_filename())) { 37 $this->setDefaults(); 37 38 $this->save_config(); 38 39 } … … 45 46 $this->config = $c; 46 47 } 47 $this->setDefaults();48 48 } 49 49 … … 79 79 80 80 private function setDefaults() { 81 include _once$this->plugin_dir.'/default_values.inc.php';81 include $this->plugin_dir.'/default_values.inc.php'; 82 82 83 83 foreach ($default_values as $key => $value) {
Note: See TracChangeset
for help on using the changeset viewer.