コード例 #1
0
ファイル: backend.php プロジェクト: ratmir-by/icms-calendar
    echo '</div>';
}
//=================================================================================================//
//=================================================================================================//
if ($opt == 'update_photo') {
    if ($inCore->inRequest('item_id')) {
        $id = $inCore->request('item_id', 'int');
        $photo['album_id'] = $inCore->request('album_id', 'int');
        $photo['title'] = $inCore->request('title', 'str');
        $photo['description'] = $inCore->request('description', 'html');
        $photo['description'] = $inDB->escape_string($photo['description']);
        $photo['published'] = $inCore->request('published', 'int');
        $photo['showdate'] = $inCore->request('showdate', 'int');
        $photo['tags'] = $inCore->request('tags', 'str');
        $photo['filename'] = $inDB->get_field('cms_photo_files', "id={$id}", 'file');
        $model->updatePhoto($id, $photo);
    }
    if (!isset($_SESSION['editlist']) || @sizeof($_SESSION['editlist']) == 0) {
        $inCore->redirect('?view=components&do=config&id=' . $_REQUEST['id'] . '&opt=list_photos');
    } else {
        $inCore->redirect('?view=components&do=config&id=' . $_REQUEST['id'] . '&opt=edit_photo');
    }
}
//=================================================================================================//
//=================================================================================================//
if ($opt == 'delete_photo') {
    if (!isset($_REQUEST['item'])) {
        $id = (int) $_REQUEST['item_id'];
        if ($id >= 0) {
            $model->deletePhoto($id);
        }