Changeset 5676

Show
Ignore:
Timestamp:
04/10/07 11:59:25 (2 years ago)
Author:
bergie
Message:

Started working on a object replication status view

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/midcom.helper.replicator/documentation/CHANGES

    r5630 r5676  
    77  which might even break existing functionality. 
    88- All items marked with "+" represent completely new features. 
     9 
     102007-04-10 bergie 
     11  + Added "object replication status" view 
    912 
    10132007-03-30 rambo 
  • trunk/src/midcom.helper.replicator/manager.php

    r4989 r5676  
    9292                'handler' => array('midcom_helper_replicator_manager', 'edit'), 
    9393                'fixed_args' => 'edit', 
     94                'variable_args' => 1, 
     95            ), 
     96            'object' => array 
     97            ( 
     98                'handler' => array('midcom_helper_replicator_manager', 'object'), 
     99                'fixed_args' => 'object', 
    94100                'variable_args' => 1, 
    95101            ), 
     
    334340        } 
    335341 
    336         $this->_request_data['view_title'] = sprintf($this->_l10n_midcom->get('create %s'), $this->_schemadb[$this->_schema]->description); 
    337         $_MIDCOM->set_pagetitle("{$this->_topic->extra}: {$this->_request_data['view_title']}"); 
     342        $data['view_title'] = sprintf($this->_l10n_midcom->get('create %s'), $this->_schemadb[$this->_schema]->description); 
     343        $_MIDCOM->set_pagetitle("{$this->_topic->extra}: {$data['view_title']}"); 
    338344 
    339345        $this->_update_breadcrumb($handler_id); 
     
    347353        midcom_show_style('midcom-helper-replicator-create'); 
    348354    } 
     355 
     356    function _resolve_object_title($object) 
     357    { 
     358        $vars = get_object_vars($object); 
     359         
     360        if (array_key_exists('title', $vars))  
     361        { 
     362            return $object->title; 
     363        }  
     364        elseif (array_key_exists('name', $vars))  
     365        { 
     366            return $object->name; 
     367        } 
     368        else 
     369        { 
     370            return "#{$object->id}"; 
     371        } 
     372    } 
     373     
     374    /** 
     375     * Displays replication information for an object 
     376     */ 
     377    function _handler_object($handler_id, $args, &$data) 
     378    { 
     379        $_MIDCOM->auth->require_admin_user(); 
     380 
     381        $data['object'] = $_MIDCOM->dbfactory->get_object_by_guid($args[0]); 
     382        if (!$data['object']) 
     383        { 
     384            return false; 
     385        } 
     386         
     387        $data['view_title'] = sprintf($this->_l10n->get('replication information for %s'), $this->_resolve_object_title($data['object'])); 
     388        $_MIDCOM->set_pagetitle($data['view_title']);         
     389 
     390        return true; 
     391    } 
     392     
     393    function _show_object($handler_id, &$data) 
     394    { 
     395        midcom_show_style('midcom-helper-replicator-object'); 
     396    } 
    349397} 
    350398?>