$editArea = 'Comment filter'; $areaId = 'cofilter'; $model = new ae_CommentfilterModel(); $model->load($_GET['cofilter']); } else { if (isset($_GET['comment']) && ae_Validate::id($_GET['comment'])) { $editArea = 'Comment'; $areaId = 'comment'; $model = new ae_CommentModel(); $model->load($_GET['comment']); } else { if (isset($_GET['media']) && ae_Validate::id($_GET['media'])) { $editArea = 'Media'; $areaId = 'media'; $model = new ae_MediaModel(); $model->load($_GET['media']); } else { if (isset($_GET['page']) && ae_Validate::id($_GET['page'])) { $editArea = 'Page'; $areaId = 'page'; $model = new ae_PageModel(); $model->load($_GET['page']); } else { if (isset($_GET['post']) && ae_Validate::id($_GET['post'])) { $editArea = 'Post'; $areaId = 'post'; $model = new ae_PostModel(); $model->load($_GET['post']); $model->loadCategoryIds(); } else { if (isset($_GET['user']) && ae_Validate::id($_GET['user'])) {
/** * Update media. * @return {int} ID of the media object. */ function updateMedia() { if (!isset($_POST['media-name']) || $_POST['media-name'] == '') { header('Location: ../admin.php?error=missing_data_for_media'); exit; } $media = new ae_MediaModel(); $media->load($_POST['edit-id']); $media->setMediaPath('../../media/'); $media->setName($_POST['media-name']); if (!$media->save()) { return FALSE; } return $media->getId(); }