Changeset 16821

Show
Ignore:
Timestamp:
07/08/08 16:57:26 (5 months ago)
Author:
adrenalin
Message:

Forward-porting a bunch of changes: r16626, r16699, r16700, r16771 and
r16772

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midgard.admin.asgard/config/config.inc

    r16301 r16821  
    9494'midgard_types' => '',              // List of types, imploded and wrapped (e.g. |midgard_article|,|midgard_topic|) 
    9595'midgard_types_regexp' => '',       // Perl-styled regular expression 
    96 'edit_mode' => false,               // Enable to enter straight to the edit mode and to skip viewing mode 
    9796 
    9897// Welcome page 
  • trunk/midcom/midgard.admin.asgard/handler/type.php

    r16336 r16821  
    1616{ 
    1717    var $type = ''; 
     18    var $_show_type_children_headers = true; 
    1819 
    1920    /** 
     
    298299        midcom_show_style('midgard_admin_asgard_middle'); 
    299300 
     301        // Show the garbage bins of child types 
    300302        $data['type'] = $this->type; 
     303        $data['reflector'] = new midcom_helper_reflector_tree($this->type); 
     304        $data['type_name'] = $this->type; 
     305        $data['type_translated'] = $data['reflector']->get_class_label(); 
     306         
    301307        midcom_show_style('midgard_admin_asgard_type'); 
     308         
     309        $class = $this->type; 
     310         
     311        $data['used_types'][] = $data['type']; 
     312        $data['used_types'][] = $_MIDCOM->dbclassloader->get_midcom_class_name_for_legacy_midgard_class($this->type); 
     313         
     314        $data['prefix'] = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX); 
     315         
     316        $this->_show_headers = false; 
     317         
     318        $types = $data['reflector']->get_child_classes(); 
     319         
     320        if (count($types) > 0) 
     321        { 
     322            midcom_show_style('midgard_admin_asgard_type_children_start'); 
     323            $this->show_child_types($this->type, &$data); 
     324            midcom_show_style('midgard_admin_asgard_type_children_end'); 
     325        } 
     326         
    302327        midcom_show_style('midgard_admin_asgard_footer'); 
     328    } 
     329     
     330    function show_child_types($type, &$data) 
     331    { 
     332        $types = $data['reflector']->get_child_classes(); 
     333        $first = true; 
     334         
     335        foreach ($types as $child_type) 
     336        { 
     337            if (in_array($child_type, $data['used_types'])) 
     338            { 
     339                continue; 
     340            } 
     341             
     342            // Show the header on first item. Has to be inside foreach loop, since we are 
     343            //  
     344            if ($first) 
     345            { 
     346                $first = false; 
     347                midcom_show_style('midgard_admin_asgard_type_children_header'); 
     348            } 
     349             
     350            $data['reflector'] = new midcom_helper_reflector_tree($child_type); 
     351             
     352            $data['type_name'] = $child_type; 
     353            $data['type_translated'] = $data['reflector']->get_class_label(); 
     354             
     355            $data['used_types'][] = $child_type; 
     356             
     357            midcom_show_style('midgard_admin_asgard_type_children_item'); 
     358        } 
     359         
     360        // Not a single type was shown, skip the footer item 
     361        if ($first) 
     362        { 
     363            return; 
     364        } 
     365         
     366        midcom_show_style('midgard_admin_asgard_type_children_footer'); 
    303367    } 
    304368} 
  • trunk/midcom/midgard.admin.asgard/navigation.php

    r16815 r16821  
    247247            echo "<a href=\"{$_MIDGARD['self']}__mfa/asgard/object/{$this->_request_data['default_mode']}/{$object->guid}/\" title=\"GUID: {$object->guid}, ID: {$object->id}\">{$icon}{$label}</a>\n"; 
    248248 
    249         /* If there is exactly one root object, show its children, since  
    250          * this is what the user most likely wants to reach 
    251          */ 
     249            // If there is exactly one root object, show its children, since this is what the user most likely wants to reach 
    252250            if ($selected || sizeof($root_objects) == 1) 
    253251            { 
     
    445443                    $this->_list_root_elements($root_objects, &$ref); 
    446444                } 
    447  
    448445            } 
    449446            midcom_show_style('midgard_admin_asgard_navigation_section_footer'); 
  • trunk/midcom/midgard.admin.asgard/style/midgard_admin_asgard_type.php

    r15733 r16821  
    9494            echo "        <tr>\n"; 
    9595            echo "            <td><a href=\"{$prefix}__mfa/asgard/object/{$data['default_mode']}/{$result->guid}/\">{$icon} {$label}</a></td>\n"; 
    96             echo "            <td class=\"nowrap\">" . strftime('%x %X', $result->metadata->created) . "</td>\n"; 
     96            echo "            <td>" . strftime('%x %X', $result->metadata->created) . "</td>\n"; 
    9797 
    9898            if ($persons[$result->metadata->creator]->guid) 
     
    113113        echo "            \$j('#search_results').tablesorter(\n"; 
    114114        echo "            {\n "; 
    115         echo "                widgets: ['zebra'],\n"; 
     115        echo "                widgets: ['zebra'],"; 
    116116        echo "                sortList: [[0,0]]\n"; 
    117117        echo "            });\n"; 
  • trunk/midcom/midgard.admin.asgard/tree.php

    r16621 r16821  
    1212 * @package midgard.admin.asgard 
    1313 */ 
    14  class midgard_admin_asgard_copytree extends midgard_admin_asgard_navigation 
     14class midgard_admin_asgard_copytree extends midgard_admin_asgard_navigation 
    1515{ 
    1616    /**