Index: trunk/extensions/Wikidata/OmegaWiki/Controller.php |
— | — | @@ -584,6 +584,13 @@ |
585 | 585 | } |
586 | 586 | } |
587 | 587 | |
| 588 | +class IncomingRelationsController extends DefaultUpdateController { |
| 589 | + public function remove( $keyPath ) { |
| 590 | + $valueId = $keyPath->peek( 0 )->relationId; |
| 591 | + removeRelationWithId( $valueId ); |
| 592 | + } |
| 593 | +} |
| 594 | + |
588 | 595 | class AlternativeDefinitionsPermissionController implements PermissionController { |
589 | 596 | public function allowUpdateOfAttribute( $attribute ) { |
590 | 597 | return true; |
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiEditors.php |
— | — | @@ -582,12 +582,19 @@ |
583 | 583 | } |
584 | 584 | |
585 | 585 | function getDefinedMeaningReciprocalRelationsEditor( ViewInformation $viewInformation ) { |
586 | | - global |
587 | | - $relationsObjectAttributesEditor, $relationMeaningName; |
| 586 | + global $relationsObjectAttributesEditor, $relationMeaningName; |
588 | 587 | |
589 | 588 | $o = OmegaWikiAttributes::getInstance(); |
590 | 589 | |
591 | | - $editor = new RecordSetTableEditor( $o->reciprocalRelations, new SimplePermissionController( false ), new ShowEditFieldChecker( true ), new AllowAddController( false ), false, false, null ); |
| 590 | + $permissionController = new SimplePermissionController( true ); |
| 591 | + $showEditFieldChecker = new ShowEditFieldChecker( true ); |
| 592 | + $allowAddController = new AllowAddController( false ); |
| 593 | + $allowRemove = true; |
| 594 | + $isAddField = false; |
| 595 | + $updateController = new IncomingRelationsController() ; |
| 596 | + |
| 597 | + $editor = new RecordSetTableEditor( $o->reciprocalRelations, $permissionController, $showEditFieldChecker, $allowAddController, $allowRemove, $isAddField, $updateController ); |
| 598 | + |
592 | 599 | $editor->addEditor( new DefinedMeaningReferenceEditor( $o->otherDefinedMeaning, new SimplePermissionController( false ), true ) ); |
593 | 600 | $editor->addEditor( new RelationTypeReferenceEditor( $o->relationType, new SimplePermissionController( false ), true ) ); |
594 | 601 | |
— | — | @@ -606,7 +613,8 @@ |
607 | 614 | function getDefinedMeaningClassMembershipEditor( ViewInformation $viewInformation ) { |
608 | 615 | $o = OmegaWikiAttributes::getInstance(); |
609 | 616 | |
610 | | - $editor = new RecordSetTableEditor( $o->classMembership, new SimplePermissionController( true ), new ShowEditFieldChecker( true ), new AllowAddController( true ), true, false, new DefinedMeaningClassMembershipController() ); |
| 617 | + $allowRemove = true; |
| 618 | + $editor = new RecordSetTableEditor( $o->classMembership, new SimplePermissionController( true ), new ShowEditFieldChecker( true ), new AllowAddController( true ), $allowRemove, false, new DefinedMeaningClassMembershipController() ); |
611 | 619 | $editor->addEditor( new ClassReferenceEditor( $o->class, new SimplePermissionController( false ), true ) ); |
612 | 620 | |
613 | 621 | addTableMetadataEditors( $editor, $viewInformation ); |