function testRenameTag() { $r = renameTag(new folksoQuery(array(), array('folksonewname' => 'emacs', 'folksotag' => 'tagone'), array()), $this->dbc, $this->fks); $this->assertIsA($r, folksoResponse, 'Problem with object creation'); $this->assertEqual($r->status, 403, 'Anonymous user should fail with 403: ' . $r->status); $this->fks2->startSession('vicktr-2010-001', true); $r2 = renameTag(new folksoQuery(array(), array('folksonewname' => 'emacs', 'folksotag' => 'tagone'), array()), $this->dbc, $this->fks2); $this->assertEqual(204, $r2->status, 'tag rename should return 204'); $h = headCheckTag(new folksoQuery(array(), array('folksotag' => 'emacs'), array()), $this->dbc2, $this->fks2); $this->assertEqual($h->status, 200, 'No tag with new tag name'); $h2 = headCheckTag(new folksoQuery(array(), array('folksotag' => 'tagone'), array()), $this->dbc3, $this->fks3); $this->assertEqual($h2->status, 404, 'Old tag name is still present'); }
/// All rights reserved. Licensed under the GPL. /// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) if (count($_POST) > 0) { $IV = array('POST' => array('deleteTag' => array('id', 'mandatory' => false), 'modifyTag' => array('id', 'mandatory' => false), 'newName' => array('string', 'mandatory' => false))); } require ROOT . '/library/preprocessor.php'; importlib('model.blog.tag'); importlib('model.blog.entry'); $blogid = getBlogId(); if (!empty($_POST['deleteTag'])) { deleteTagById($blogid, $_POST['deleteTag']); Respond::ResultPage(0); exit; } if (!empty($_POST['modifyTag']) && !empty($_POST['newName'])) { $newTagId = renameTag($blogid, $_POST['modifyTag'], $_POST['newName']); $newTagList = getTagListTemplate(getSiteTags($blogid)); $newEntryList = '<a href="' . $context->getProperty('uri.blog') . '/owner/entry/?tagId=' . $newTagId . '">' . _f('"%1" 태그를 갖는 모든 글의 목록을 봅니다', $_POST['newName']) . '</a>'; $result = array('error' => 0, 'tagId' => $newTagId, 'entryList' => $newEntryList, 'tagList' => $newTagList); Respond::PrintResult($result); exit; } if (!empty($_POST['id']) && !empty($_POST['category'])) { $entries = array(); foreach (getEntriesByTagId($blogid, $_POST['id']) as $entry) { $entries[] = $entry['id']; } changeCategoryOfEntries($blogid, implode(',', $entries), $_POST['category']); } $tags = getSiteTags($blogid); if (isset($suri['value']) && !empty($suri['value'])) {
function bbcodeTableRowHeader($dom, $nodes) { $tr = $dom->createElement('tr'); $tr->setAttribute('class', 'header0'); bbcodeAppend($tr, $nodes); foreach (iterator_to_array($tr->childNodes) as $node) { if ($node->tagName === 'td') { renameTag($node, 'th'); } } return $tr; }