} /* @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(); } } HTMLstuff::RefererRedirect();
if ($Image->getID()) { if ($DeleteImage) { if (Image::Delete($Image, $CurrentUser)) { header('location:' . $ReturnURL); exit; } } else { if (Image::Update($Image, $CurrentUser)) { Tag2All::HandleTags($tags, $TagsThisImage, $TagsInDB, $CurrentUser, $ModelID, $SetID, $Image->getID(), NULL, TRUE); header('location:' . $ReturnURL); exit; } } } else { if (Image::Insert($Image, $CurrentUser)) { Tag2All::HandleTags($tags, $TagsThisImage, $TagsInDB, $CurrentUser, $ModelID, $SetID, $Image->getID(), NULL, TRUE); header('location:' . $ReturnURL); exit; } } } echo HTMLstuff::HtmlHeader(sprintf('%1$s - %2$s - %3$s', $Model->GetShortName(TRUE), $lang->g('NavigationImages'), $Image->getFileName()), $CurrentUser); if ($ImageID) { $width = $Image->getImageWidthToppedOff(400, 600); $height = $Image->getImageHeightToppedOff(400, 600); echo HTMLstuff::ImageLoading(sprintf('download_image.php?image_id=%1$d&width=%2$d&height=%3$d&portrait_only=true', $ImageID, $width, $height), $width, $height, htmlentities($Model->GetFullName()), htmlentities($Model->GetFullName())); echo '<div class="PhotoContainer Loading"></div>'; } ?> <h2><?php
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 echo htmlentities($_SERVER['REQUEST_URI']);
exit; } } else { if ($CurrentUser->hasPermission(RIGHT_SET_EDIT)) { $NoErrorDuringPostback = Set::Update($Set, $CurrentUser); if ($NoErrorDuringPostback) { Tag2All::HandleTags($tags, $TagsThisSet, $TagsInDB, $CurrentUser, $ModelID, $Set->getID(), NULL, NULL); } } } } else { if ($CurrentUser->hasPermission(RIGHT_SET_ADD)) { if ($NoErrorDuringPostback = Set::Insert($Set, $CurrentUser)) { $CacheImages = CacheImage::GetCacheImages(new CacheImageSearchParameters(FALSE, FALSE, $Model->getID())); CacheImage::DeleteMulti($CacheImages, $CurrentUser); Tag2All::HandleTags($tags, $TagsThisSet, $TagsInDB, $CurrentUser, $ModelID, $Set->getID(), NULL, NULL); } } } $Set->setDatesPic(HTMLstuff::DatesFromPOST($_POST, $Set, DATE_KIND_IMAGE)); $Set->setDatesVid(HTMLstuff::DatesFromPOST($_POST, $Set, DATE_KIND_VIDEO)); /* @var $Date Date */ /* @var $dateInDb Date */ foreach ($Set->getDatesPic() as $Date) { if ($Date->getID()) { if ($Date->getTimeStamp() == -1) { Date::Delete($Date, $CurrentUser); } else { Date::Update($Date, $CurrentUser); } } else {
<?php /* This file needs to be put in the application's root directory */ include 'cd.php'; ini_set('max_execution_time', '3600'); $CurrentUser = Authentication::Authenticate(); $TagsInDb = Tag::GetTags(); function NotComment($line) { return !preg_match('/^\\s*;/i', $line); } if (isset($argv) && $argc > 0) { $f = sprintf('%1$s/misc/tag_list.txt', dirname($_SERVER['PHP_SELF'])); } else { $f = 'misc/tag_list.txt'; } $fc = file_get_contents($f); $lines = preg_split('/\\n/i', $fc, NULL, PREG_SPLIT_NO_EMPTY); $lines = array_filter($lines, 'NotComment'); Tag2All::HandleTags($lines, array(), $TagsInDb, $CurrentUser);
if ($Model->getID()) { if ($DeleteModel) { if ($CurrentUser->hasPermission(RIGHT_MODEL_DELETE) && Model::Delete($Model, $CurrentUser)) { header('location:index.php'); exit; } } else { if ($CurrentUser->hasPermission(RIGHT_MODEL_EDIT) && Model::Update($Model, $CurrentUser)) { Tag2All::HandleTags($tags, $TagsThisModel, $TagsInDB, $CurrentUser, $Model->getID(), NULL, NULL, NULL); header('location:index.php'); exit; } } } else { if ($CurrentUser->hasPermission(RIGHT_MODEL_ADD) && Model::Insert($Model, $CurrentUser)) { Tag2All::HandleTags($tags, $TagsThisModel, $TagsInDB, $CurrentUser, $Model->getID(), NULL, NULL, NULL); header('location:index.php'); exit; } } } echo HTMLstuff::HtmlHeader($Model->GetFullName(), $CurrentUser); if ($ModelID) { echo HTMLstuff::ImageLoading(sprintf('download_image.php?model_id=%1$d&width=400&height=600&portrait_only=true', $ModelID), 400, 600, htmlentities($Model->GetFullName()), htmlentities($Model->GetFullName())); echo '<div class="PhotoContainer Loading"></div>'; } ?> <h2><?php echo sprintf('<a href="index.php">%2$s</a> - %1$s', htmlentities($Model->GetFullName()), $lang->g('NavigationHome')); ?>