Changeset 13809

Show
Ignore:
Timestamp:
12/10/07 13:56:43 (10 months ago)
Author:
bergie
Message:

Some quick fixes to libconfig: it almost works now

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.admin.libconfig/handler/edit.php

    r13249 r13809  
    116116 
    117117        //schemadb 
    118         $schema = $this->_libconfig->_global['schemadb_config']; 
    119  
    120         if ($schema) 
     118        if (isset($this->_libconfig->_global['schemadb_config'])) 
    121119        { 
    122120            // We rely on config schema. Hope that schema covers all fields 
    123             $schemadb = midcom_helper_datamanager2_schema::load_database($schema); 
     121            $schemadb = midcom_helper_datamanager2_schema::load_database($this->_libconfig->_global['schemadb_config']); 
    124122        } 
    125123        else 
     
    145143 
    146144 
    147             if (!$this->_libconfig->_local[$key]) 
     145            if (   !isset($this->_libconfig->_local[$key]) 
     146                || !$this->_libconfig->_local[$key]) 
    148147            { 
    149148                $schemadb['default']->fields[$key]['static_prepend'] = "<div class='global'><span>Global value</span>"; 
     
    357356 
    358357                default: 
     358                    $data = ''; 
    359359                    if (is_numeric($val)) 
    360360                    { 
  • trunk/midcom/midcom.admin.libconfig/handler/view.php

    r13250 r13809  
    149149            $data['key'] = $_MIDCOM->i18n->get_string($key,$data['name']); 
    150150            $data['global'] = $this->_detect($data['config']->_global[$key]); 
    151             $data['local'] = $this->_detect($data['config']->_local[$key]);; 
     151             
     152            if (isset($data['config']->_local[$key])) 
     153            { 
     154                $data['local'] = $this->_detect($data['config']->_local[$key]); 
     155            } 
     156            else 
     157            { 
     158                $data['local'] = $this->_detect(null); 
     159            } 
    152160 
    153161            midcom_show_style('midcom-admin-libs-view-item'); 
     
    187195                break; 
    188196            case "array": 
    189                  
     197                $content = ''; 
    190198                foreach ($value as $key => $val) 
    191199                { 
  • trunk/midcom/midcom.admin.libconfig/midcom/interfaces.php

    r13230 r13809  
    1515    { 
    1616        parent::midcom_baseclasses_components_interface(); 
    17         $this->_component = 'midcom.helper.libconfig'; 
     17        $this->_component = 'midcom.admin.libconfig'; 
    1818        $this->_purecode = true; 
    1919    } 
  • trunk/midcom/midcom.admin.libconfig/plugin.php

    r13249 r13809  
    9191            if ($manifest->purecode) 
    9292            { 
     93                $_MIDCOM->componentloader->load_graceful($name); 
    9394                $configpath = MIDCOM_ROOT . $_MIDCOM->componentloader->path_to_snippetpath($name)."/config/config.inc"; 
    9495                $lib = midcom_baseclasses_components_interface::read_array_from_file("{$configpath}"); 
    9596 
    96                 if (!$lib) continue; 
     97                if (!$lib)  
     98                { 
     99                    continue; 
     100                } 
    97101 
    98102                $libs[$name] = $manifest; 
  • trunk/midcom/midcom.core/midcom/baseclasses/components/interface.php

    r13625 r13809  
    460460     * @see read_array_from_snippet() 
    461461     */ 
    462     private function read_array_from_file ($filename) 
     462    public function read_array_from_file ($filename) 
    463463    { 
    464464        $data = @file_get_contents($filename); 
     
    489489     * @see read_array_from_file() 
    490490     */ 
    491     private function read_array_from_snippet ($snippetpath) 
     491    public function read_array_from_snippet ($snippetpath) 
    492492    { 
    493493        $snippet = new midcom_baseclasses_database_snippet(); 
  • trunk/midcom/midcom.helper.schemaapi/midcom/interfaces.php

    r5029 r13809  
    2727        $this->_autoload_files = array 
    2828        ( 
    29             'viewer.php',  
    30             'admin.php',  
    31             'navigation.php' 
    3229        ); 
    3330         
  • trunk/midcom/no.bergfald.rcs/midcom/interfaces.php

    r3858 r13809  
    2020            'handler.php', 
    2121            'backends/aegirrcs.php', 
    22             'aegir_handler.php' 
     22            /*'aegir_handler.php'*/ 
    2323        ); 
    2424        $this->_autoload_libraries = array(