Changeset 15913

Show
Ignore:
Timestamp:
04/01/08 14:41:17 (7 months ago)
Author:
rambo
Message:

made a few options actually configurable at least on the SG level, made styles and style elements require approval by default in staging/live

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/MidCOM_2_8/midcom.helper.replicator/config/config.inc

    r15780 r15913  
    11'queue_root_dir' => '/var/spool/midgard/replicator_queue/', 
    22'log_filename'   => "{$GLOBALS['midcom_config']['log_filename']}.replicator", 
     3'exporter_staging2live_check_approvals_for' => array 
     4( 
     5    'midgard_topic', 
     6    'midgard_article', 
     7    'midgard_style', 
     8    'midgard_element', // Style-elements 
     9), 
     10'exporter_staging2live_typefilter_pass_types' => array 
     11( 
     12    0, 
     13), 
     14'exporter_staging2live_typefilter_check_types_for' => array 
     15( 
     16    'midgard_article', 
     17), 
  • branches/MidCOM_2_8/midcom.helper.replicator/exporter/mirror.php

    r14775 r15913  
    137137    function serialize_component_dependencies(&$node) 
    138138    { 
     139        // FIXME: components interface class should have a method to return dependencies 
    139140        switch ($node->component) 
    140141        { 
  • branches/MidCOM_2_8/midcom.helper.replicator/exporter/staging2live.php

    r14775 r15913  
    2626     * array of classes for which to check the approval for 
    2727     * 
    28      * @todo make configurable 
     28     * @see configuration key exporter_staging2live_check_approvals_for 
     29     * @todo configurable on per subscription basis ? 
    2930     */ 
    30     var $check_approvals_for = array 
    31     ( 
    32         'midgard_topic', 
    33         'midgard_article', 
    34     ); 
     31    var $check_approvals_for = array(); 
    3532 
    3633    function midcom_helper_replicator_exporter_staging2live($subscription) 
    3734    { 
    3835        parent::midcom_helper_replicator_exporter_mirror($subscription); 
     36        $this->check_approvals_for = $this->_config->get('exporter_staging2live_check_approvals_for'); 
     37        if (!is_array($this->check_approvals_for)) 
     38        { 
     39            // Safety 
     40            $this->check_approvals_for = array(); 
     41        } 
    3942    } 
    4043 
     
    219222 
    220223        if (   is_a($object, 'midgard_article') 
    221             && $object->up
     224            && !empty($object->up)
    222225        { 
    223226            // Child articles don't currently have any approval UI, skip approval 
     
    311314            $serializations = array_merge($serializations, $dependency_serializations); 
    312315            unset($dependency_serializations); 
    313  
    314             /* FIXME: This contradicts general tree logic where children *must not* be exported if parent 
    315                is not approved  
    316             // We should export child articles and topics as they may have been approved 
    317             // even while their parent topic wasn't 
    318             $qb = midcom_db_article::new_query_builder(); 
    319             $qb->add_constraint('topic', '=', $object->id); 
    320             $articles = $qb->execute(); 
    321             foreach ($articles as $article) 
    322             { 
    323                 $child_serializations = $this->serialize_object($article); 
    324                 $serializations = array_merge($serializations, $child_serializations); 
    325                 unset($child_serializations); 
    326             } 
    327              
    328             $qb = midcom_db_topic::new_query_builder(); 
    329             $qb->add_constraint('up', '=', $object->id); 
    330             $topics = $qb->execute(); 
    331             foreach ($topics as $topic) 
    332             { 
    333                 $child_serializations = $this->serialize_object($topic); 
    334                 $serializations = array_merge($serializations, $child_serializations); 
    335                 unset($child_serializations); 
    336             } 
    337             */ 
    338316        } 
    339317         
  • branches/MidCOM_2_8/midcom.helper.replicator/exporter/staging2live_typefilter.php

    r11103 r15913  
    2424     * array of $object->type values to allow replication for 
    2525     * 
    26      * @todo make configurable 
     26     * @see configuration key exporter_staging2live_typefilter_pass_types 
     27     * @todo configurable on per subscription basis ? 
    2728     */ 
    28     var $pass_types = array 
    29     ( 
    30         0, 
    31     ); 
     29    var $pass_types = array(); 
    3230 
    3331    /** 
    3432     * array of classes for which to check the type for 
    3533     * 
    36      * @todo make configurable 
     34     * @see configuration key exporter_staging2live_typefilter_check_types_for 
     35     * @todo configurable on per subscription basis ? 
    3736     */ 
    38     var $check_types_for = array 
    39     ( 
    40         'midgard_article', 
    41     ); 
     37    var $check_types_for = array(); 
    4238 
    4339    function midcom_helper_replicator_exporter_staging2live_typefilter($subscription) 
    4440    { 
    4541        parent::midcom_helper_replicator_exporter_staging2live($subscription); 
     42        $this->pass_types = $this->_config->get('exporter_staging2live_typefilter_pass_types'); 
     43        if (!is_array($this->pass_types)) 
     44        { 
     45            // Safety 
     46            $this->pass_types = array(); 
     47        } 
     48        $this->check_types_for = $this->_config->get('exporter_staging2live_typefilter_check_types_for'); 
     49        if (!is_array($this->check_types_for)) 
     50        { 
     51            // Safety 
     52            $this->check_types_for = array(); 
     53        } 
    4654    } 
    4755