<?php /** * @version $Header$ * @package tags * @subpackage functions * * @copyright Copyright (c) 2004-2006, bitweaver.org * All Rights Reserved. See below for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details. */ /** * required setup */ require_once "../kernel/setup_inc.php"; require_once TAGS_PKG_PATH . "LibertyTag.php"; $gBitSystem->verifyPackage('tags'); if (!$gBitUser->hasPermission('p_tags_admin')) { $gBitSystem->fatalError('You do not have permission to edit Tags'); } $tag = new LibertyTag(); if ($tag->loadTag($_REQUEST)) { $gBitSmarty->assign('tagData', $tag->mInfo); } if (!empty($_REQUEST["save"])) { if ($tag->storeOneTag($_REQUEST)) { header("location: " . TAGS_PKG_URL . "index.php?tags=" . $tag->mInfo['tag']); } } $gBitSystem->display('bitpackage:tags/edit_tag.tpl', tra("Edit Tag"), array('display_mode' => 'edit'));
* All Rights Reserved. See below for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details. */ /** * required setup */ require_once "../kernel/setup_inc.php"; require_once TAGS_PKG_PATH . "LibertyTag.php"; $gBitSystem->verifyPackage('tags'); if (!empty($_REQUEST['action'])) { if ($_REQUEST['action'] == 'remove' && !empty($_REQUEST['tag_id'])) { if (!$gBitUser->hasPermission('p_tags_moderate')) { $gBitSystem->fatalError(tra('You do not have permission to remove tags.')); } $tmpTag = new LibertyTag(); $tmpTag->loadTag($_REQUEST); if (isset($_REQUEST["confirm"])) { if ($tmpTag->expunge($tmpTag->mInfo['tag_id'])) { bit_redirect(TAGS_PKG_URL . 'list.php?status_id=' . (!empty($_REQUEST['status_id']) ? $_REQUEST['status_id'] : '')); } else { $feedback['error'] = $tmpTag->mErrors; } } $gBitSystem->setBrowserTitle('Confirm removal of ' . $tmpTag->mInfo['tag']); $formHash['remove'] = TRUE; $formHash['action'] = 'remove'; $formHash['status_id'] = !empty($_REQUEST['status_id']) ? $_REQUEST['status_id'] : ''; $formHash['tag_id'] = $_REQUEST['tag_id']; $msgHash = array('label' => tra('Remove Tag'), 'confirm_item' => $tmpTag->mInfo['tag'], 'warning' => 'This will remove the above tag.', 'error' => tra('This cannot be undone!')); $gBitSystem->confirmDialog($formHash, $msgHash); }