Changeset 15916

Show
Ignore:
Timestamp:
04/01/08 16:02:37 (6 months ago)
Author:
rambo
Message:

forward porting r15913, r15914 & r15915

Files:

Legend:

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

    r15779 r15916  
    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), 
  • trunk/midcom/midcom.helper.replicator/exporter/mirror.php

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

    r14773 r15916  
    2727class midcom_helper_replicator_exporter_staging2live extends midcom_helper_replicator_exporter_mirror 
    2828{ 
    29  
    30     var $check_approvals_for = array 
    31     ( 
    32         'midgard_topic', 
    33         'midgard_article', 
    34     ); 
     29    /** 
     30     * array of classes for which to check the approval for 
     31     * 
     32     * @see configuration key exporter_staging2live_check_approvals_for 
     33     * @todo configurable on per subscription basis ? 
     34     */ 
     35    var $check_approvals_for = array(); 
    3536 
    3637    function midcom_helper_replicator_exporter_staging2live($subscription) 
    3738    { 
    3839        parent::midcom_helper_replicator_exporter_mirror($subscription); 
     40        $this->check_approvals_for = $this->_config->get('exporter_staging2live_check_approvals_for'); 
     41        if (!is_array($this->check_approvals_for)) 
     42        { 
     43            // Safety 
     44            $this->check_approvals_for = array(); 
     45        } 
    3946    } 
    4047 
     
    219226 
    220227        if (   is_a($object, 'midgard_article') 
    221             && $object->up
     228            && !empty($object->up)
    222229        { 
    223230            // Child articles don't currently have any approval UI, skip approval 
     
    311318            $serializations = array_merge($serializations, $dependency_serializations); 
    312319            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             */ 
    338320        } 
    339321 
  • trunk/midcom/midcom.helper.replicator/exporter/staging2live_typefilter.php

    r14133 r15916  
    2626     * array of $object->type values to allow replication for 
    2727     * 
    28      * @todo make configurable 
     28     * @see configuration key exporter_staging2live_typefilter_pass_types 
     29     * @todo configurable on per subscription basis ? 
    2930     */ 
    30     var $pass_types = array 
    31     ( 
    32         0, 
    33     ); 
     31    var $pass_types = array(); 
    3432 
    3533    /** 
    3634     * array of classes for which to check the type for 
    3735     * 
    38      * @todo make configurable 
     36     * @see configuration key exporter_staging2live_typefilter_check_types_for 
     37     * @todo configurable on per subscription basis ? 
    3938     */ 
    40     var $check_types_for = array 
    41     ( 
    42         'midgard_article', 
    43     ); 
     39    var $check_types_for = array(); 
    4440 
    4541    function midcom_helper_replicator_exporter_staging2live_typefilter($subscription) 
    4642    { 
    4743        parent::midcom_helper_replicator_exporter_staging2live($subscription); 
     44        $this->pass_types = $this->_config->get('exporter_staging2live_typefilter_pass_types'); 
     45        if (!is_array($this->pass_types)) 
     46        { 
     47            // Safety 
     48            $this->pass_types = array(); 
     49        } 
     50        $this->check_types_for = $this->_config->get('exporter_staging2live_typefilter_check_types_for'); 
     51        if (!is_array($this->check_types_for)) 
     52        { 
     53            // Safety 
     54            $this->check_types_for = array(); 
     55        } 
    4856    } 
    4957 
  • trunk/midcom/midgard.admin.asgard/plugin.php

    r15675 r15916  
    669669                ) 
    670670            ); 
     671            /** COPIED from midcom_services_toolbars */ 
     672            if ($GLOBALS['midcom_config']['metadata_approval']) 
     673            { 
     674                $metadata =& midcom_helper_metadata::retrieve($object); 
     675                if (   $metadata 
     676                    && $metadata->is_approved()) 
     677                { 
     678                    $toolbar->add_item(Array( 
     679                        MIDCOM_TOOLBAR_URL => "__ais/folder/unapprove.html", 
     680                        MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('unapprove', 'midcom'), 
     681                        MIDCOM_TOOLBAR_HELPTEXT => $_MIDCOM->i18n->get_string('approved', 'midcom'), 
     682                        MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/approved.png', 
     683                        MIDCOM_TOOLBAR_POST => true, 
     684                        MIDCOM_TOOLBAR_POST_HIDDENARGS => Array 
     685                        ( 
     686                            'guid' => $object->guid, 
     687                            'return_to' => $_SERVER['REQUEST_URI'], 
     688                        ), 
     689                        MIDCOM_TOOLBAR_ACCESSKEY => 'u', 
     690                        MIDCOM_TOOLBAR_ENABLED => $object->can_do('midcom:approve'), 
     691                    )); 
     692                } 
     693                else 
     694                { 
     695                    $toolbar->add_item(Array( 
     696                        MIDCOM_TOOLBAR_URL => "__ais/folder/approve.html", 
     697                        MIDCOM_TOOLBAR_LABEL => $_MIDCOM->i18n->get_string('approve', 'midcom'), 
     698                        MIDCOM_TOOLBAR_HELPTEXT => $_MIDCOM->i18n->get_string('unapproved', 'midcom'), 
     699                        MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/not_approved.png', 
     700                        MIDCOM_TOOLBAR_POST => true, 
     701                        MIDCOM_TOOLBAR_POST_HIDDENARGS => Array 
     702                        ( 
     703                            'guid' => $object->guid, 
     704                            'return_to' => $_SERVER['REQUEST_URI'], 
     705                        ), 
     706                        MIDCOM_TOOLBAR_ACCESSKEY => 'a', 
     707                        MIDCOM_TOOLBAR_ENABLED => $object->can_do('midcom:approve'), 
     708                    )); 
     709                } 
     710            } 
     711            /** /COPIED from midcom_services_toolbars */ 
     712 
    671713 
    672714            $toolbar->add_item 
  • trunk/midcom/midgard.admin.asgard/static/screen.css

    r15909 r15916  
    465465} 
    466466 
    467 #container #toolbar ul li 
     467#container #toolbar ul li, 
     468#container #toolbar ul li form 
    468469{ 
    469470  display: inline;