예제 #1
0
    if ($db->queryF($sql)) {
        redirectMsg('bookmarks.php', __('Database updated successfully!', 'mywords'), 0);
    } else {
        redirectMsg('bookmarks.php', __('Errors ocurred while trying to update database!', 'mywords') . '<br />' . $db->error(), 0);
    }
}
$action = rmc_server_var($_REQUEST, 'action', '');
switch ($action) {
    case 'new':
        save_bookmark();
        break;
    case 'edit':
        edit_bookmark();
        break;
    case 'save':
        saveBookmark();
        break;
    case 'saveedit':
        save_bookmark(true);
        break;
    case 'activate':
        activate_bookmark(1);
        break;
    case 'deactivate':
        activate_bookmark(0);
        break;
    case 'delete':
        delete_bookmark();
        break;
    default:
        show_bookmarks();
예제 #2
0
파일: index.php 프로젝트: jreinert/RuneUI
             sendMpdCommand($mpd, "update \"" . html_entity_decode($_POST['path']) . "\"");
             // send MPD response to UI
             ui_mpd_response($mpd, array('title' => 'MPD update DB path:', 'text' => $_POST['path']));
         }
     }
     break;
 case 'search':
     if ($activePlayer === 'MPD') {
         if (isset($_POST['query']) && isset($_GET['querytype'])) {
             echo json_encode(searchDB($mpd, $_GET['querytype'], $_POST['query']));
         }
     }
     break;
 case 'bookmark':
     if (isset($_POST['path'])) {
         if (saveBookmark($redis, $_POST['path'])) {
             ui_notify('Bookmark saved', $_POST['path'] . ' added to bookmarks');
             ui_libraryHome($redis);
         } else {
             ui_notify('Error saving bookmark', 'please try again later');
         }
     }
     if (isset($_POST['id'])) {
         if (deleteBookmark($redis, $_POST['id'])) {
             ui_notify('Bookmark deleted', '"' . $_POST['name'] . '" successfully removed');
             ui_libraryHome($redis);
         } else {
             ui_notify('Error deleting bookmark', 'Please try again later');
         }
     }
     break;