Changeset 12918
- Timestamp:
- 10/20/07 22:25:48 (1 year ago)
- Files:
-
- trunk/midcom/midcom.admin.settings/editor.php (modified) (8 diffs)
- trunk/midcom/midcom.admin.settings/locale/default.en.txt (modified) (1 diff)
- trunk/midcom/midcom.admin.settings/locale/default.pl.txt (modified) (3 diffs)
- trunk/midcom/midcom.admin.settings/style/midcom-admin-settings-edit.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.admin.settings/editor.php
r12730 r12918 49 49 * for usage within the style listing. 50 50 */ 51 function _prepare_request_data( )51 function _prepare_request_data(&$data) 52 52 { 53 53 $this->_request_data['datamanager'] =& $this->_datamanager; 54 54 $this->_request_data['controller'] =& $this->_controller; 55 56 } 57 55 $this->_l10n = $_MIDCOM->i18n->get_l10n('midcom.admin.settings'); 56 57 $data['l10n'] = $this->_l10n; 58 $data['view_title'] = $this->_l10n->get('midcom.admin.settings'); 59 60 $data['asgard_toolbar'] = new midcom_helper_toolbar(); 61 62 $data['asgard_toolbar']->add_item 63 ( 64 array 65 ( 66 MIDCOM_TOOLBAR_URL => $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX), 67 MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('back to site', 'midgard.admin.asgard'), 68 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/gohome.png', 69 ) 70 ); 71 72 $data['asgard_toolbar']->add_item 73 ( 74 array 75 ( 76 MIDCOM_TOOLBAR_URL => $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX)."midcom-logout-", 77 MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('logout','midcom'), 78 MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/exit.png', 79 ) 80 ); 81 } 58 82 59 83 /** … … 63 87 { 64 88 parent::midcom_baseclasses_components_handler(); 65 66 89 $this->_config_storage = new midcom_db_page($_MIDGARD['page']); 67 90 68 91 require_once MIDCOM_ROOT . '/midcom/helper/hostconfig.php'; 69 92 require_once MIDCOM_ROOT . '/midcom/admin/folder/folder_management.php'; 70 71 $_MIDCOM->load_library('midcom.helper.datamanager2'); 93 $_MIDCOM->load_library('midgard.admin.asgard'); 72 94 $_MIDCOM->load_library('midcom.admin.folder'); 95 96 $_MIDCOM->style->prepend_component_styledir('midgard.admin.asgard'); 97 $_MIDCOM->style->prepend_component_styledir('midcom.admin.settings'); 98 $_MIDCOM->skip_page_style = true; 99 100 $this->_l10n = $_MIDCOM->i18n->get_l10n('midcom.admin.settings'); 101 102 $this->_debug_prefix = "midcom_admin_settings::"; 103 104 73 105 } 74 106 … … 77 109 return Array 78 110 ( 111 'index' => Array 112 ( 113 'handler' => Array('midcom_admin_settings_editor', 'edit'), 114 ), 79 115 'edit' => Array 80 116 ( 81 117 'handler' => Array('midcom_admin_settings_editor', 'edit'), 82 ' fixed_args' => 'edit',118 'variable_args' => 1, 83 119 ), 84 120 ); … … 130 166 function _handler_edit($handler_id, $args, &$data) 131 167 { 168 169 $data['hostname'] = $_SERVER['SERVER_NAME']; 170 171 if ($args[0]) 172 { 173 $host = new midcom_db_host($args[0]); 174 if ($host->root) 175 { 176 $data['hostname'] = $host->name; 177 $this->_config_storage = new midcom_db_page($host->root); 178 } 179 else 180 { 181 $this->_prepare_request_data($data); 182 $this->_config_storage = null; 183 $data['hostname'] = $args[0]; 184 return true; 185 } 186 } 187 132 188 $_MIDCOM->auth->require_admin_user(); 133 189 … … 181 237 182 238 183 $this->_prepare_request_data( );239 $this->_prepare_request_data($data); 184 240 185 241 $_MIDCOM->set_pagetitle("{$this->_topic->extra}: {$this->_config_storage->title}"); … … 203 259 ( 204 260 MIDCOM_NAV_URL => '__ais/midcom-settings/edit.html', 205 MIDCOM_NAV_NAME => $ _MIDCOM->i18n->get_string('host configuration', 'midcom.admin.settings'),261 MIDCOM_NAV_NAME => $this->_l10n->get('host configuration'), 206 262 ); 207 263 $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp); 208 264 209 265 // Set page title 210 $_MIDCOM->set_pagetitle($ _MIDCOM->i18n->get_string('host configuration', 'midcom.admin.settings'));266 $_MIDCOM->set_pagetitle($this->_l10n->get('host configuration')." : ".$data['hostname']); 211 267 212 268 return true; … … 219 275 function _show_edit ($handler_id, &$data) 220 276 { 221 midcom_show_style('midcom-admin-settings-edit'); 277 midgard_admin_asgard_plugin::asgard_header(); 278 if(is_null($this->_config_storage)) 279 { 280 midcom_show_style('midcom-admin-settings-empty'); 281 } 282 else 283 { 284 midcom_show_style('midcom-admin-settings-edit'); 285 } 286 midgard_admin_asgard_plugin::asgard_footer(); 222 287 } 223 288 … … 272 337 } 273 338 339 function navigation() 340 { 341 $qb = midcom_db_host::new_query_builder(); 342 $qb->add_order('name'); 343 $rst = $qb->execute(); 344 345 $prefix = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX); 346 347 echo '<ul class="midgard_admin_asgard_navigation">'; 348 349 foreach ($rst as $host) 350 { 351 $mc = midcom_db_pageelement::new_collector('page',$host->root); 352 $mc->add_constraint('name', '=', 'code-init'); 353 $mc->execute(); 354 $codeinits = $mc->list_keys(); 355 356 if (count ($codeinits) && $host->can_do("midgard:update")) 357 { 358 //TODO: detect only midcom hosts 359 echo " <li class=\"status\"><a href=\"{$prefix}__mfa/asgard_midcom.admin.settings/{$host->guid}.html\">{$host->name}{$host->prefix}/</a></li>"; 360 } 361 } 362 363 echo "</ul>"; 364 365 } 366 274 367 } 275 368 trunk/midcom/midcom.admin.settings/locale/default.en.txt
r11718 r12918 316 316 ---STRINGEND 317 317 318 ---STRING host "%s" not found. try using menu. 319 Host "%s" not found. Try using menu. 320 ---STRINGEND 321 trunk/midcom/midcom.admin.settings/locale/default.pl.txt
r11718 r12918 4 4 ---LANGUAGE pl 5 5 6 ---STRING allowed components (leave empty to allow all) 7 Dozwolone komponenty (pozostaw puste aby zezwoliÄ na uÅŒywanie wszystkich) 8 ---STRINGEND 9 6 10 ---STRING auth_allow_sudo 7 11 Zezwalaj na uruchamianie moduÅów w trybie SUDO … … 117 121 ---STRINGEND 118 122 123 ---STRING excluded components (leave empty to allow all) 124 Zablokowane komponenty (pozostaw puste aby zezwoliÄ na uÅŒywanie wszystkich) 125 ---STRINGEND 126 119 127 ---STRING failed to save settings, reason %s 120 128 BÅÄ … … 319 327 ---STRINGEND 320 328 321 ---STRING allowed components (leave empty to allow all) 322 Dozwolone komponenty (pozostaw puste aby zezwoliÄ na uÅŒywanie wszystkich) 323 ---STRINGEND 324 325 ---STRING excluded components (leave empty to allow all) 326 Zablokowane komponenty (pozostaw puste aby zezwoliÄ na uÅŒywanie wszystkich) 327 ---STRINGEND 328 329 ---STRING host "%s" not found. try using menu. 330 Brak serwisu GUID: "%s". UÅŒyj menu aby wybraÄ serwis. 331 ---STRINGEND 332 trunk/midcom/midcom.admin.settings/style/midcom-admin-settings-edit.php
r5048 r12918 4 4 ?> 5 5 6 <h1><?php echo $_MIDCOM->i18n->get_string('host configuration', 'midcom.admin.settings'); ?> </h1>6 <h1><?php echo $_MIDCOM->i18n->get_string('host configuration', 'midcom.admin.settings'); ?>: &(data['hostname']);</h1> 7 7 8 8 <?php
