Changeset 14655
- Timestamp:
- 01/27/08 18:29:11 (9 months ago)
- Files:
-
- trunk/midcom/midcom.helper.replicator/config/schemadb_default.inc (modified) (6 diffs)
- trunk/midcom/midcom.helper.replicator/locale/default.de.txt (added)
- trunk/midcom/midcom.helper.replicator/locale/default.en.txt (modified) (1 diff)
- trunk/midcom/midcom.helper.replicator/manager.php (modified) (28 diffs)
- trunk/midcom/midcom.helper.replicator/transporter.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.helper.replicator/config/schemadb_default.inc
r14322 r14655 40 40 'filters' => Array 41 41 ( 42 'title' => ' XML filters (for advanced users only)',42 'title' => 'xml filters', 43 43 'storage' => 'filtersSerialized', 44 44 'type' => 'text', … … 57 57 ), 58 58 'widget' => 'select', 59 ), 59 ), 60 60 ) 61 61 ), … … 102 102 'filters' => Array 103 103 ( 104 'title' => ' XML filters (for advanced users only)',104 'title' => 'xml filters', 105 105 'storage' => 'filtersSerialized', 106 106 'type' => 'text', … … 119 119 ), 120 120 'widget' => 'select', 121 ), 121 ), 122 122 ) 123 123 ), … … 164 164 'filters' => Array 165 165 ( 166 'title' => ' XML filters (for advanced users only)',166 'title' => 'xml filters', 167 167 'storage' => 'filtersSerialized', 168 168 'type' => 'text', … … 181 181 ), 182 182 'widget' => 'select', 183 ), 183 ), 184 184 ) 185 185 ), trunk/midcom/midcom.helper.replicator/locale/default.en.txt
r12743 r14655 120 120 ---STRINGEND 121 121 122 ---STRING xml filters 123 XML filters (for advanced users only) 124 ---STRINGEND 125 126 ---STRING http post transport 127 HTTP POST transport 128 ---STRINGEND 129 130 ---STRING mirroring subscription 131 Mirroring Subscription 132 ---STRINGEND 133 134 ---STRING staging2live subscription with type filter 135 Staging2live subscription with type filter 136 ---STRINGEND trunk/midcom/midcom.helper.replicator/manager.php
r14385 r14655 2 2 /** 3 3 * @package midcom.helper.replicator 4 * @author The Midgard Project, http://www.midgard-project.org 4 * @author The Midgard Project, http://www.midgard-project.org 5 5 * @version $Id: acl_editor.php 4207 2006-09-26 08:41:44Z bergie $ 6 6 * @copyright The Midgard Project, http://www.midgard-project.org … … 28 28 */ 29 29 var $_subscription = null; 30 30 31 31 /** 32 32 * The Datamanager of the member to display … … 52 52 */ 53 53 var $_schemadb = null; 54 54 55 55 /** 56 56 * The schema to use for the new subscription. … … 60 60 */ 61 61 var $_schema = 'default'; 62 62 63 63 /** 64 64 * The defaults to use for the new subscription. … … 73 73 parent::midcom_baseclasses_components_handler(); 74 74 } 75 75 76 76 function get_plugin_handlers() 77 77 { 78 $_MIDCOM->load_library('midgard.admin.asgard'); 78 $_MIDCOM->load_library('midgard.admin.asgard'); 79 79 return array 80 80 ( … … 103 103 ); 104 104 } 105 105 106 106 function _on_initialize() 107 107 { 108 108 $_MIDCOM->load_library('midcom.helper.replicator'); 109 109 $_MIDCOM->load_library('midcom.helper.datamanager2'); 110 110 111 111 // Ensure we get the correct styles 112 112 $_MIDCOM->style->prepend_component_styledir('midcom.helper.replicator'); … … 114 114 $component_data =& $GLOBALS['midcom_component_data']['midcom.helper.replicator']; 115 115 $this->_local_config = $component_data['config']; 116 116 117 117 $this->_load_schemadb(); 118 118 119 midgard_admin_asgard_plugin::prepare_plugin('', &$this->_request_data); 119 midgard_admin_asgard_plugin::prepare_plugin('', &$this->_request_data); 120 120 foreach (array_keys($this->_schemadb) as $name) 121 121 { … … 128 128 $prefix = 'create/'; 129 129 } 130 130 131 131 $this->_request_data['asgard_toolbar']->add_item 132 132 ( … … 144 144 } 145 145 } 146 146 147 147 function _update_breadcrumb($handler_id) 148 148 { … … 174 174 $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp); 175 175 } 176 176 177 177 /** 178 178 * Loads and prepares the schema database. … … 185 185 */ 186 186 function _load_schemadb() 187 { 187 { 188 188 $this->_schemadb = midcom_helper_datamanager2_schema::load_database('file:/midcom/helper/replicator/config/schemadb_default.inc'); 189 189 } 190 190 191 191 function _handler_list($handler_id, $args, &$data) 192 192 { … … 200 200 201 201 $data['view_title'] = $_MIDCOM->i18n->get_string('replication subscriptions', 'midcom.helper.replicator'); 202 $_MIDCOM->set_pagetitle($data['view_title']); 202 $_MIDCOM->set_pagetitle($data['view_title']); 203 203 204 204 return true; 205 205 } 206 206 207 207 /** 208 208 * … … 214 214 midcom_show_style('midgard_admin_asgard_header'); 215 215 midcom_show_style('midgard_admin_asgard_middle'); 216 216 217 217 $data['schemadb'] =& $this->_schemadb; 218 218 $data['local_config'] =& $this->_local_config; 219 219 midcom_show_style('midcom-helper-replicator-list'); 220 220 221 221 midcom_show_style('midgard_admin_asgard_footer'); 222 222 … … 239 239 } 240 240 } 241 241 242 242 /** 243 243 * Internal helper, fires up the creation mode controller. Any error triggers a 500. … … 258 258 } 259 259 } 260 260 261 261 function _modify_schema_for_object($subscription) 262 262 { … … 274 274 $this->_subscription->require_do('midgard:update'); 275 275 $this->subscription->autoserialize_filters = false; 276 276 277 277 $_MIDCOM->bind_view_to_object($this->_subscription, $this->_subscription->exporter); 278 278 279 279 $this->_modify_schema_for_object($this->_subscription); 280 280 281 281 // Load the datamanager controller 282 282 $this->_load_controller(); 283 283 284 284 switch ($this->_controller->process_form()) 285 285 { … … 291 291 $_MIDCOM->relocate('__mfa/asgard_midcom.helper.replicator/'); 292 292 // This will exit. 293 } 293 } 294 294 295 295 $data['view_type'] = $_MIDCOM->i18n->get_string($this->_schemadb[$this->_subscription->exporter]->description, 'midcom.helper.replicator'); … … 299 299 $data['view_title'] = $this->_subscription->title; 300 300 $_MIDCOM->set_pagetitle($data['view_title']); 301 301 302 302 return true; 303 303 } 304 304 305 305 /** 306 306 * … … 312 312 midcom_show_style('midgard_admin_asgard_header'); 313 313 midcom_show_style('midgard_admin_asgard_middle'); 314 314 315 315 $data['controller'] =& $this->_controller; 316 316 midcom_show_style('midcom-helper-replicator-edit'); 317 317 318 318 midcom_show_style('midgard_admin_asgard_footer'); 319 319 } 320 320 321 321 /** 322 322 * DM2 creation callback, binds to the current content topic. … … 373 373 } 374 374 375 $data['view_title'] = sprintf($this->_l10n_midcom->get('create %s'), $ this->_schemadb[$this->_schema]->description);375 $data['view_title'] = sprintf($this->_l10n_midcom->get('create %s'), $_MIDCOM->i18n->get_string($this->_schemadb[$this->_schema]->description, 'midcom.helper.replicator')); 376 376 $_MIDCOM->set_pagetitle("{$this->_topic->extra}: {$data['view_title']}"); 377 377 … … 380 380 return true; 381 381 } 382 382 383 383 /** 384 384 * … … 393 393 $data['controller'] =& $this->_controller; 394 394 midcom_show_style('midcom-helper-replicator-create'); 395 395 396 396 midcom_show_style('midgard_admin_asgard_footer'); 397 397 } … … 400 400 { 401 401 $vars = get_object_vars($object); 402 402 403 403 if ( array_key_exists('title', $vars) 404 && $object->title) 404 && $object->title) 405 405 { 406 406 return $object->title; 407 } 408 elseif (array_key_exists('name', $vars)) 407 } 408 elseif (array_key_exists('name', $vars)) 409 409 { 410 410 return $object->name; … … 415 415 } 416 416 } 417 417 418 418 /** 419 419 * Displays replication information for an object … … 451 451 return false; 452 452 } 453 453 454 454 455 455 if ($bind_toolbar) … … 462 462 $data['view_title'] = sprintf($_MIDCOM->i18n->get_string('replication information for %s', 'midcom.helper.replicator'), $this->_resolve_object_title($data['object'])); 463 463 $_MIDCOM->set_pagetitle($data['view_title']); 464 464 465 465 $_MIDCOM->add_link_head 466 466 ( … … 475 475 return true; 476 476 } 477 477 478 478 /** 479 479 * … … 487 487 488 488 midcom_show_style('midcom-helper-replicator-object'); 489 489 490 490 midcom_show_style('midgard_admin_asgard_footer'); 491 491 trunk/midcom/midcom.helper.replicator/transporter.php
r14390 r14655 20 20 */ 21 21 var $subscription; 22 22 23 23 /** 24 24 * Possible processing error. … … 37 37 { 38 38 $this->_component = 'midcom.helper.replicator'; 39 39 40 40 $this->subscription = $subscription; 41 41 42 42 parent::midcom_baseclasses_components_purecode(); 43 43 } 44 44 45 45 /** 46 46 * This is a static factory method which lets you dynamically create transporter instances. … … 60 60 $type = $subscription->transporter; 61 61 $filename = MIDCOM_ROOT . "/midcom/helper/replicator/transporter/{$type}.php"; 62 62 63 63 if (!file_exists($filename)) 64 64 { … … 68 68 require_once($filename); 69 69 70 $classname = "midcom_helper_replicator_transporter_{$type}"; 70 $classname = "midcom_helper_replicator_transporter_{$type}"; 71 71 if (!class_exists($classname)) 72 72 { … … 74 74 // This will exit. 75 75 } 76 76 77 77 /** 78 78 * Php 4.4.1 does not allow you to return a reference to an expression. … … 82 82 return $class; 83 83 } 84 84 85 85 function list_transports() 86 86 { … … 89 89 'email' => $_MIDCOM->i18n->get_string('email transport', 'midcom.helper.replicator'), 90 90 'archive' => $_MIDCOM->i18n->get_string('file archive transport', 'midcom.helper.replicator'), 91 'http' => $_MIDCOM->i18n->get_string(' HTTP POSTtransport', 'midcom.helper.replicator'),91 'http' => $_MIDCOM->i18n->get_string('http post transport', 'midcom.helper.replicator'), 92 92 ); 93 93 } … … 116 116 return false; 117 117 } 118 118 119 119 /** 120 120 * This method allows transporters to tell what they're doing in the subscription list.
