Changeset 12918

Show
Ignore:
Timestamp:
10/20/07 22:25:48 (1 year ago)
Author:
solt
Message:

Asgardizing. Initial...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.admin.settings/editor.php

    r12730 r12918  
    4949     * for usage within the style listing. 
    5050     */ 
    51     function _prepare_request_data(
     51    function _prepare_request_data(&$data
    5252    { 
    5353        $this->_request_data['datamanager'] =& $this->_datamanager; 
    5454        $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    } 
    5882 
    5983    /** 
     
    6387    { 
    6488        parent::midcom_baseclasses_components_handler(); 
    65          
    6689        $this->_config_storage = new midcom_db_page($_MIDGARD['page']); 
    6790 
    6891        require_once MIDCOM_ROOT . '/midcom/helper/hostconfig.php'; 
    6992        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'); 
    7294        $_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 
    73105    } 
    74106 
     
    77109        return Array 
    78110        ( 
     111            'index' => Array 
     112            ( 
     113                'handler' => Array('midcom_admin_settings_editor', 'edit'), 
     114            ), 
    79115            'edit' => Array 
    80116            ( 
    81117                'handler' => Array('midcom_admin_settings_editor', 'edit'), 
    82                 'fixed_args' => 'edit'
     118                'variable_args' => 1
    83119            ), 
    84120        ); 
     
    130166    function _handler_edit($handler_id, $args, &$data) 
    131167    { 
     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 
    132188        $_MIDCOM->auth->require_admin_user(); 
    133189         
     
    181237         
    182238 
    183         $this->_prepare_request_data(); 
     239        $this->_prepare_request_data($data); 
    184240         
    185241        $_MIDCOM->set_pagetitle("{$this->_topic->extra}: {$this->_config_storage->title}"); 
     
    203259        ( 
    204260            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'), 
    206262        ); 
    207263        $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp); 
    208264         
    209265        // 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']); 
    211267 
    212268        return true; 
     
    219275    function _show_edit ($handler_id, &$data) 
    220276    { 
    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(); 
    222287    } 
    223288 
     
    272337    } 
    273338 
     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 
    274367} 
    275368 
  • trunk/midcom/midcom.admin.settings/locale/default.en.txt

    r11718 r12918  
    316316---STRINGEND 
    317317 
     318---STRING host "%s" not found. try using menu. 
     319Host "%s" not found. Try using menu. 
     320---STRINGEND 
     321 
  • trunk/midcom/midcom.admin.settings/locale/default.pl.txt

    r11718 r12918  
    44---LANGUAGE pl 
    55 
     6---STRING allowed components (leave empty to allow all) 
     7Dozwolone komponenty (pozostaw puste aby zezwolić na uÅŒywanie wszystkich) 
     8---STRINGEND 
     9 
    610---STRING auth_allow_sudo 
    711Zezwalaj na uruchamianie modułów w trybie SUDO 
     
    117121---STRINGEND 
    118122 
     123---STRING excluded components (leave empty to allow all) 
     124Zablokowane komponenty (pozostaw puste aby zezwolić na uÅŒywanie wszystkich) 
     125---STRINGEND 
     126 
    119127---STRING failed to save settings, reason %s 
    120128BłĠ
     
    319327---STRINGEND 
    320328 
    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. 
     330Brak 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  
    44?> 
    55 
    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> 
    77 
    88<?php