/** * Deletes all tags for any given entry. * * @param mixed $tags * @param integer $entrycode * @return void */ function deleteTags($tags, $entrycode) { if (is_string($tags)) { $tags = explode(", ", $tags); } // Loop through tags, and delete them.. foreach ($tags as $tag) { deleteTag($tag, $entrycode); } }
/** * Processes loading of this sample code through a web browser. Uses AuthSub * authentication and outputs a list of a user's albums if succesfully * authenticated. * * @return void */ function processPageLoad() { global $_SESSION, $_GET; if (!isset($_SESSION['sessionToken']) && !isset($_GET['token'])) { requestUserLogin('Please login to your Google Account.'); } else { $client = getAuthSubHttpClient(); if (!empty($_REQUEST['command'])) { switch ($_REQUEST['command']) { case 'retrieveSelf': outputUserFeed($client, "default"); break; case 'retrieveUser': outputUserFeed($client, $_REQUEST['user']); break; case 'retrieveAlbumFeed': outputAlbumFeed($client, $_REQUEST['user'], $_REQUEST['album']); break; case 'retrievePhotoFeed': outputPhotoFeed($client, $_REQUEST['user'], $_REQUEST['album'], $_REQUEST['photo']); break; } } // Now we handle the potentially destructive commands, which have to // be submitted by POST only. if (!empty($_POST['command'])) { switch ($_POST['command']) { case 'addPhoto': addPhoto($client, $_POST['user'], $_POST['album'], $_FILES['photo']); break; case 'deletePhoto': deletePhoto($client, $_POST['user'], $_POST['album'], $_POST['photo']); break; case 'addAlbum': addAlbum($client, $_POST['user'], $_POST['name']); break; case 'deleteAlbum': deleteAlbum($client, $_POST['user'], $_POST['album']); break; case 'addComment': addComment($client, $_POST['user'], $_POST['album'], $_POST['photo'], $_POST['comment']); break; case 'addTag': addTag($client, $_POST['user'], $_POST['album'], $_POST['photo'], $_POST['tag']); break; case 'deleteComment': deleteComment($client, $_POST['user'], $_POST['album'], $_POST['photo'], $_POST['comment']); break; case 'deleteTag': deleteTag($client, $_POST['user'], $_POST['album'], $_POST['photo'], $_POST['tag']); break; default: break; } } // If a menu parameter is available, display a submenu. if (!empty($_REQUEST['menu'])) { switch ($_REQUEST['menu']) { case 'user': displayUserMenu(); break; case 'photo': displayPhotoMenu(); break; case 'album': displayAlbumMenu(); break; case 'logout': logout(); break; default: header('HTTP/1.1 400 Bad Request'); echo "<h2>Invalid menu selection.</h2>\n"; echo "<p>Please check your request and try again.</p>"; } } if (empty($_REQUEST['menu']) && empty($_REQUEST['command'])) { displayMenu(); } } }
break; case "getusertags": $response = getUserTags(); break; case "addtag": $tagname = required_param('tagname', PARAM_TEXT); $response = addTag($tagname); break; case "edittag": $tagid = required_param('tagid', PARAM_ALPHANUMEXT); $tagname = required_param('tagname', PARAM_TEXT); $response = editTag($tagid, $tagname); break; case "deletetag": $tagid = required_param('tagid', PARAM_ALPHANUMEXT); $response = deleteTag($tagid); break; case "gettagsbyfirstcharacters": $query = required_param('q', PARAM_TEXT); $scope = optional_param('scope', 'my', PARAM_ALPHANUMEXT); $response = getTagsByFirstCharacters($query, $scope); break; /** VOTING **/ /** VOTING **/ case "addlemon": $issueid = required_param('issueid', PARAM_ALPHANUMEXT); $nodeid = required_param('nodeid', PARAM_ALPHANUMEXT); $response = addLemon($issueid, $nodeid); break; case "deletelemon": $issueid = required_param('issueid', PARAM_ALPHANUMEXT);
login($link); break; case '1': register($link); break; case '2': logout(); break; case '3': addTag($link); break; case '4': modifyTag($link); break; case '5': deleteTag($link); break; case '6': updateData($link); break; case '7': listAllTags($link); break; case '8': // metaSearch(); // metaSearch(); default: break; } /*****************************************************
addCategorie(); break; case 'ModCategorie': modCategorie(); break; case 'deleteCategorie': deleteCategorie(); break; case 'addTag': addTag(); break; case 'ModTag': modTag(); break; case 'deleteTag': deleteTag(); break; case 'addTache': addTaches(); break; case 'modTache': modTaches(); break; case 'modTache2': modTaches2(); break; case 'deleteTache': deleteTaches(); break; case 'dec': deconnecter();
$response = getPageRatingBulk($_REQUEST['url_string'], $_REQUEST['params_string'], $_REQUEST['username']); break; case "add_tag": $response = addTag($_REQUEST['url'], $_REQUEST['url_parameter'], $_REQUEST['tag']); break; case "get_page_tags": $response = getPageTags($_REQUEST['url'], $_REQUEST['url_parameter']); break; case "get_recommended_page_tags": $response = getRecommendedPageTags($_POST['url'], $_POST['url_parameter']); break; case "rate_tag": $response = rateTag($_REQUEST['url'], $_REQUEST['url_parameter'], $_REQUEST['tag'], $_REQUEST['up']); break; case "delete_tag": $response = deleteTag($_REQUEST['url'], $_REQUEST['url_parameter'], $_REQUEST['tag']); break; case "get_pages_with_tag": $response = getPagesWithTag($_REQUEST['tag']); break; case "follow_contact": $response = followContact($_REQUEST['username']); break; case "unfollow_contact": $response = unfollowContact($_REQUEST['username']); break; case "get_contact_list": $response = getContactList(); break; case "add_link": $response = addLink($_REQUEST['from_url'], $_REQUEST['from_url_param'], $_REQUEST['to_url'], $_REQUEST['to_url_param'], $_REQUEST['note']);
function testDeleteTag() { $r = deleteTag(new folksoQuery(array(), array('folksotag' => 'tagone'), array()), $this->dbc, $this->fks); $this->assertIsA($r, folksoResponse, 'problem with object creation'); $this->assertEqual($r->status, 403, 'anonymous delete tag should return 403'); $this->fks->startSession('vicktr-2010-001', true); $r2 = deleteTag(new folksoQuery(array(), array('folksotag' => 'tagone'), array()), $this->dbc, $this->fks); $this->assertEqual(204, $r2->status, sprintf('deleteTag returning error %s %s %s', $r2->status, $r2->status_message, $r2->body())); $r2 = deleteTag(new folksoQuery(array(), array('folksotag' => 'bullshit'), array()), $this->dbc2, $this->fks); $this->assertIsA($r2, folksoResponse, 'problem with object creation on bad tag delete'); $this->assertEqual($r2->status, 404, 'Not getting correct status (404) on bad tag delete: ' . $r2->status); }
/** * Deletes all tags for any given entry. * * @param mixed $tags * @param integer $entrycode * @return void */ function deleteTags($tags, $entrycode) { // Tags are separated by space(s) if (is_string($tags)) { $tags = preg_split('/[ ]+/', $tags); } // Loop through tags, and delete them.. foreach ($tags as $tag) { deleteTag($tag, $entrycode); } }
<?php /****************************************************************** editannotations.php Called by deleteTag, deleteNote, editNote, deleteNote, and deleteAnnotation in annotate.js in service of view.js in service of view.php Contains utilities for deleting and editing annotations *******************************************************************/ include 'dbsetup.php'; include 'util.php'; if ($_GET['event'] == 'delete-tag') { deleteTag($_GET['tag'], $_GET['highlight']); } else { if ($_GET['event'] == 'delete-note') { deleteNote($_GET['note'], $_GET['highlight']); } else { if ($_GET['event'] == 'edit-note') { editNote($_GET['note'], mysql_real_escape_string($_GET['text'])); } else { if ($_GET['event'] == 'add-note') { addNote(mysql_real_escape_string($_GET['text']), $_GET['highlight'], $_GET['user']); } else { if ($_GET['event'] == 'add-tags') { addTags(mysql_real_escape_string($_GET['tags']), $_GET['highlight'], $_GET['user']); } else { if ($_GET['event'] == 'delete-annotation') { deleteAnnotation($_GET['highlight']); } } }