$VideoInDb = Video::Filter($VideosInDb, $Model2Process->getID(), $Set2Process->getID(), (string) $Video->attributes()->name); if ($VideoInDb) { $VideoInDb = $VideoInDb[0]; } /* @var $Video2Process Video */ $Video2Process = $VideoInDb ? $VideoInDb : new Video(); $Video2Process->setSet($Set2Process); $Video2Process->setFileName((string) $Video->attributes()->name); $Video2Process->setFileExtension((string) $Video->attributes()->extension); $Video2Process->setFileSize((int) $Video->attributes()->filesize); $Video2Process->setFileCheckSum((string) $Video->attributes()->checksum); $Video2Process->setFileCRC32((string) $Video->attributes()->crc32); if ($Video2Process->getID()) { Video::Update($Video2Process, $CurrentUser); } else { Video::Insert($Video2Process, $CurrentUser); } $videotags = Tag::GetTagArray((string) $Video->attributes()->tags); $Tag2AllThisVideo = Tag2All::Filter($Tag2AllThisSet, NULL, $Model2Process->getID(), $Set2Process->getID(), NULL, $Video2Process->getID()); Tag2All::HandleTags($videotags, $Tag2AllThisVideo, $TagsInDB, $CurrentUser, $Model2Process->getID(), $Set2Process->getID(), NULL, $Video2Process->getID(), FALSE); } } } } if ($fileToProcess != 'setup_data.xml') { unlink(realpath($fileToProcess)); } $infoSuccess = new Info($lang->g('MessageXMLImported')); Info::AddInfo($infoSuccess); if (isset($argv) && $argc > 0) { $bi->Finish();
$VideosInDB = Video::Filter($Videos, $ModelID, $Set->getID(), $matches['Name'] . $matches['Number'] . $matches['Suffix']); if ($VideosInDB) { $VideoInDB = $VideosInDB[0]; $cis = CacheImage::Filter($CacheImages, NULL, NULL, NULL, NULL, NULL, $VideoInDB->getID()); CacheImage::DeleteMulti($cis, $CurrentUser); } else { $VideoInDB = new Video(); $VideoInDB->setSet($Set); } $VideoInDB->setFileName($matches['Prefix'] . $matches['Name'] . $matches['Number'] . $matches['Suffix']); $VideoInDB->setFileExtension($matches['Extension']); $VideoInDB->setFileSize($FileInfo->getSize()); $VideoInDB->setFileCheckSum(Utils::CalculateMD5($FileInfo->getRealPath())); $VideoInDB->setFileCRC32(Utils::CalculateCRC32($FileInfo->getRealPath())); if (!$VideoInDB->getID() && $CurrentUser->hasPermission(RIGHT_VIDEO_ADD)) { Video::Insert($VideoInDB, $CurrentUser); } else { if ($CurrentUser->hasPermission(RIGHT_VIDEO_EDIT)) { Video::Update($VideoInDB, $CurrentUser); } } } } } $infoSuccess = new Info($lang->g('MessageVideosImported')); Info::AddInfo($infoSuccess); if (isset($argv) && $argc > 0) { $bi->Finish(); } } HTMLstuff::RefererRedirect();
$tags = Tag::GetTagArray($_POST['txtTags']); if ($Video->getID()) { if ($DeleteVideo) { if (Video::Delete($Video, $CurrentUser)) { header('location:' . $ReturnURL); exit; } } else { if (Video::Update($Video, $CurrentUser)) { Tag2All::HandleTags($tags, $TagsThisVideo, $TagsInDB, $CurrentUser, $ModelID, $SetID, NULL, $Video->getID(), NULL); header('location:' . $ReturnURL); exit; } } } else { if (Video::Insert($Video, $CurrentUser)) { Tag2All::HandleTags($tags, $TagsThisVideo, $TagsInDB, $CurrentUser, $ModelID, $SetID, NULL, $Video->getID()); header('location:' . $ReturnURL); exit; } } } echo HTMLstuff::HtmlHeader(sprintf('%1$s - %2$s %3$s - %4$s', $Model->GetShortName(TRUE), $lang->g('NavigationSet'), $Set->getName(), $lang->g('NavigationVideos')), $CurrentUser); ?> <h2><?php echo sprintf('<a href="index.php">%7$s</a> - <a href="model_view.php?model_id=%1$d">%4$s</a> - <a href="set.php?model_id=%1$d">%8$s</a> - <a href="set_view.php?model_id=%1$d&set_id=%2$d">%9$s %5$s</a> - <a href="video.php?model_id=%1$d&set_id=%2$d">%10$s</a> - %6$s', $ModelID, $SetID, $VideoID, htmlentities($Model->GetShortName(TRUE)), htmlentities($Set->getName()), htmlentities($Video->getFileName()), $lang->g('NavigationHome'), $lang->g('NavigationSets'), $lang->g('NavigationSet'), $lang->g('NavigationVideos')); ?> </h2> <form action="<?php