Index: trunk/extensions/EducationProgram/includes/EPOrg.php |
— | — | @@ -75,12 +75,10 @@ |
76 | 76 | * @see EPDBObject::createLogEntry() |
77 | 77 | */ |
78 | 78 | protected function createLogEntry( $subType ) { |
79 | | - $logEntry = new ManualLogEntry( 'institution', $subType ); |
80 | | - |
81 | | - $logEntry->setPerformer( $GLOBALS['wgUser'] ); |
82 | | - $logEntry->setTarget( $this->getTitle() ); |
83 | | - |
84 | | - return $logEntry; |
| 79 | + return array( |
| 80 | + 'type' => 'institution', |
| 81 | + 'title' => $this->getTitle(), |
| 82 | + ); |
85 | 83 | } |
86 | 84 | |
87 | 85 | /** |
Index: trunk/extensions/EducationProgram/includes/EPDBObject.php |
— | — | @@ -459,26 +459,35 @@ |
460 | 460 | */ |
461 | 461 | protected function log( $subType ) { |
462 | 462 | if ( $this->log ) { |
463 | | - $logEntry = $this->createLogEntry( $subType ); |
| 463 | + if ( class_exists( 'ManualLogEntry' ) ) { |
| 464 | + $info = $this->getLogInfo( $subType ); |
464 | 465 | |
465 | | - if ( createLogEntry !== false ) { |
466 | | - $logid = $logEntry->insert(); |
467 | | - $logEntry->publish( $logid ); |
| 466 | + if ( $info !== false ) { |
| 467 | + $logEntry = new ManualLogEntry( $info['type'], $subType ); |
| 468 | + |
| 469 | + $logEntry->setPerformer( array_key_exists( 'user', $info ) ? $info['user'] : $GLOBALS['wgUser'] ); |
| 470 | + $logEntry->setTarget( $info['title'] ); |
| 471 | + |
| 472 | + $logid = $logEntry->insert(); |
| 473 | + $logEntry->publish( $logid ); |
| 474 | + } |
468 | 475 | } |
| 476 | + else { |
| 477 | + // TODO |
| 478 | + } |
469 | 479 | } |
470 | 480 | } |
471 | 481 | |
472 | 482 | /** |
473 | | - * Override and create and return a log entry to |
474 | | - * make the log method have an actual effect. |
| 483 | + * Returns the info for the log entry or false if no entry should be created. |
475 | 484 | * |
476 | 485 | * @since 0.1 |
477 | 486 | * |
478 | 487 | * @param string $subType |
479 | 488 | * |
480 | | - * @return false|ManualLogEntry |
| 489 | + * @return array|false |
481 | 490 | */ |
482 | | - protected function createLogEntry( $subType ) { |
| 491 | + protected function getLogInfo( $subType ) { |
483 | 492 | return false; |
484 | 493 | } |
485 | 494 | |