Index: trunk/extensions/EducationProgram/includes/EPOrg.php |
— | — | @@ -70,9 +70,9 @@ |
71 | 71 | |
72 | 72 | /** |
73 | 73 | * (non-PHPdoc) |
74 | | - * @see EPDBObject::createLogEntry() |
| 74 | + * @see EPDBObject::getLogInfo() |
75 | 75 | */ |
76 | | - protected function createLogEntry( $subType ) { |
| 76 | + protected function getLogInfo( $subType ) { |
77 | 77 | return array( |
78 | 78 | 'type' => 'institution', |
79 | 79 | 'title' => $this->getTitle(), |
Index: trunk/extensions/EducationProgram/includes/EPDBObject.php |
— | — | @@ -458,22 +458,35 @@ |
459 | 459 | */ |
460 | 460 | protected function log( $subType ) { |
461 | 461 | if ( $this->log ) { |
462 | | - if ( class_exists( 'ManualLogEntry' ) ) { |
463 | | - $info = $this->getLogInfo( $subType ); |
464 | | - |
465 | | - if ( $info !== false ) { |
| 462 | + $info = $this->getLogInfo( $subType ); |
| 463 | + $user = array_key_exists( 'user', $info ) ? $info['user'] : $GLOBALS['wgUser']; |
| 464 | + |
| 465 | + if ( $info !== false ) { |
| 466 | + if ( false && class_exists( 'ManualLogEntry' ) ) { |
466 | 467 | $logEntry = new ManualLogEntry( $info['type'], $subType ); |
467 | | - |
468 | | - $logEntry->setPerformer( array_key_exists( 'user', $info ) ? $info['user'] : $GLOBALS['wgUser'] ); |
| 468 | + |
| 469 | + $logEntry->setPerformer( $user ); |
469 | 470 | $logEntry->setTarget( $info['title'] ); |
470 | | - |
| 471 | + |
| 472 | + if ( array_key_exists( 'comment', $info ) ) { |
| 473 | + $logEntry->setComment( $info['comment'] ); |
| 474 | + } |
| 475 | + |
471 | 476 | $logid = $logEntry->insert(); |
472 | 477 | $logEntry->publish( $logid ); |
473 | 478 | } |
| 479 | + else { |
| 480 | + $log = new LogPage( $info['type'] ); |
| 481 | + |
| 482 | + $log->addEntry( |
| 483 | + $subType, |
| 484 | + $info['title'], |
| 485 | + array_key_exists( 'comment', $info ) ? $info['comment'] : '', |
| 486 | + array(), |
| 487 | + $user |
| 488 | + ); |
| 489 | + } |
474 | 490 | } |
475 | | - else { |
476 | | - // TODO |
477 | | - } |
478 | 491 | } |
479 | 492 | } |
480 | 493 | |