<?php #---------------------------------------------------------------------- # Initialization and page contents. #---------------------------------------------------------------------- $currentSection = 'admin'; require '../includes/_header.php'; analyzeChoices(); adminHeadline('Validate media'); showDescription(); offerChoices(); showMedia(); require '../includes/_footer.php'; #---------------------------------------------------------------------- function analyzeChoices() { #---------------------------------------------------------------------- global $chosenType, $chosenStatus, $chosenRegionId, $chosenOrder; $chosenType = getNormalParam('type'); $chosenStatus = getNormalParam('status'); $chosenRegionId = getNormalParam('regionId'); $chosenOrder = getNormalParam('order'); if (!preg_match('/^(article|report|multimedia)$/', $chosenType)) { $chosenType = ''; } if (!preg_match('/^(date|submission)$/', $chosenOrder)) { $chosenOrder = 'submission'; } if (!preg_match('/^(pending|accepted)$/', $chosenStatus)) { // Do we need a "refused" status ? $chosenStatus = 'pending';
} showMedia($dirPath); break; case "delete": delete_file($delFile, $listdir); showMedia($listdir); break; case "deletefolder": delete_folder($delFolder, $listdir); showMedia($listdir); break; case "list": listImages($listdir); break; default: showMedia($listdir); break; } function delete_file($delfile, $listdir) { global $mosConfig_absolute_path; $del_image = $mosConfig_absolute_path . "/images/stories" . $listdir . "/" . $delfile; unlink($del_image); } function create_folder($folder_name, $dirPath) { global $mosConfig_absolute_path; if (strlen($folder_name) > 0) { if (eregi("[^0-9a-zA-Z_]", $folder_name)) { mosRedirect("index2.php?option=com_media&listdir=" . $_POST['dirPath'], T_("Directory name must only contain alphanumeric characters and no spaces please.")); }