/** * @group IL_Init * @param * @return */ public function testCopyright() { include_once './Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php'; $cpr = new ilMDCopyrightSelectionEntry(0); $cpr->setTitle("1"); $cpr->setDescription("2"); $cpr->setLanguage('en'); $cpr->setCopyright("3"); $cpr->setCosts(true); $cpr->add(); $entry = $cpr->getEntryId(); $this->assertGreaterThan(0, $entry); $cpr = new ilMDCopyrightSelectionEntry($entry); $ret = $cpr->getTitle(); $this->assertEquals($ret, '1'); $ret = $cpr->getDescription(); $this->assertEquals($ret, '2'); $ret = $cpr->getCopyright(); $this->assertEquals($ret, '3'); $ret = $cpr->getLanguage(); $this->assertEquals($ret, 'en'); $cpr->setTitle('11'); $cpr->update(); $cpr->delete(); }
/** * delete entries * * @access public * */ public function deleteEntries() { if (!is_array($_POST['entry_id']) or !count($_POST['entry_id'])) { ilUtil::sendInfo($this->lng->txt('select_one')); $this->showCopyrightSettings(); return true; } include_once 'Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php'; foreach ($_POST["entry_id"] as $entry_id) { $entry = new ilMDCopyrightSelectionEntry($entry_id); $entry->delete(); } ilUtil::sendInfo($this->lng->txt('md_copyrights_deleted')); $this->showCopyrightSettings(); return true; }