[chg] change rename/delete tag form
This commit is contained in:
parent
2e05b32a32
commit
3737a64ff3
5 changed files with 124 additions and 53 deletions
15
inc/user.css
15
inc/user.css
|
@ -310,6 +310,21 @@ pre code {
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #CDCDCD;
|
||||
border-radius: 0.3em;
|
||||
padding: 0.3em;
|
||||
margin: 0.3em 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
padding : 0 0.3em;
|
||||
margin: 0 0 0 0.6em;
|
||||
color : #FFFFFF;
|
||||
font-weight: bolder;
|
||||
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
|
|
@ -1473,7 +1473,7 @@ function renderPage()
|
|||
// -------- User wants to rename a tag or delete it
|
||||
if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=changetag'))
|
||||
{
|
||||
if (empty($_POST['fromtag']))
|
||||
if (empty($_POST['fromtag']) && empty($_POST['tagToDelete']))
|
||||
{
|
||||
$PAGE = new pageBuilder;
|
||||
$PAGE->assign('linkcount',count($LINKSDB));
|
||||
|
@ -1484,9 +1484,9 @@ function renderPage()
|
|||
if (!tokenOk($_POST['token'])) die('Wrong token.');
|
||||
|
||||
// Delete a tag:
|
||||
if (!empty($_POST['deletetag']) && !empty($_POST['fromtag']))
|
||||
if (!empty($_POST['deletetag']) && !empty($_POST['tagToDelete']))
|
||||
{
|
||||
$needle=trim($_POST['fromtag']);
|
||||
$needle=trim($_POST['tagToDelete']);
|
||||
$linksToAlter = $LINKSDB->filterTags($needle,true); // true for case-sensitive tag search.
|
||||
foreach($linksToAlter as $key=>$value)
|
||||
{
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>{include="includes"}</head>
|
||||
<head>
|
||||
{include="includes"}
|
||||
</head>
|
||||
<body onload="document.addform.post.focus();">
|
||||
<div id="pageheader">
|
||||
{include="page.header"}
|
||||
<div id="headerform">
|
||||
<form method="GET" action="" name="addform" class="addform">
|
||||
<input type="text" name="post" style="width:50%;">
|
||||
<input type="text" name="post">
|
||||
<input type="submit" value="Add link" class="bigbutton">
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -1,14 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>{include="includes"}</head>
|
||||
<head>
|
||||
{include="includes"}
|
||||
</head>
|
||||
<body onload="document.changepasswordform.oldpassword.focus();">
|
||||
<div id="pageheader">
|
||||
{include="page.header"}
|
||||
<form method="POST" action="" name="changepasswordform" id="changepasswordform">
|
||||
Old password: <input type="password" name="oldpassword">
|
||||
New password: <input type="password" name="setpassword">
|
||||
<p>
|
||||
<label for="oldpassword">Old password:</label>
|
||||
<input type="password" name="oldpassword" id="oldpassword" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="setpassword">New password:</label>
|
||||
<input type="password" name="setpassword" id="setpassword">
|
||||
</p>
|
||||
<p>
|
||||
<input type="hidden" name="token" value="{$token}">
|
||||
<input type="submit" name="Save" value="Save password" class="bigbutton"></form>
|
||||
<input type="submit" name="Save" value="Save password" class="bigbutton">
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
{include="page.footer"}
|
||||
</body>
|
||||
|
|
|
@ -1,24 +1,67 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>{include="includes"}
|
||||
{if="empty($GLOBALS['disablejquery'])"}<script src="inc/jquery.min.js#"></script><script src="inc/jquery-ui.min.js#"></script>{/if}
|
||||
<head>
|
||||
{include="includes"}
|
||||
{if="empty($GLOBALS['disablejquery'])"}
|
||||
<script src="inc/jquery.min.js#"></script>
|
||||
<script src="inc/jquery-ui.min.js#"></script>
|
||||
{/if}
|
||||
</head>
|
||||
<body onload="document.changetag.fromtag.focus();">
|
||||
<body>
|
||||
<div id="pageheader">
|
||||
{include="page.header"}
|
||||
<form method="POST" action="" name="changetag" id="changetag">
|
||||
<form method="POST" action="" name="changetag" id="editlinkform">
|
||||
<fieldset>
|
||||
<legend>
|
||||
Rename tag
|
||||
</legend>
|
||||
<p>
|
||||
<label for="">Old tag :</label>
|
||||
<input type="text" name="fromtag" class="fromtag" autofocus>
|
||||
(Case sensitive)
|
||||
</p>
|
||||
<p>
|
||||
<label>New tag :</label>
|
||||
<input type="text" name="totag" class="fromtag">
|
||||
</p>
|
||||
<p class="submitButton">
|
||||
<input type="submit" name="renametag" value="Rename tag" class="bigbutton">
|
||||
</p>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>
|
||||
Delete tag
|
||||
</legend>
|
||||
<p>
|
||||
<label for="">Tag :</label>
|
||||
<input type="text" name="tagToDelete" class="fromtag">
|
||||
(Case sensitive)
|
||||
</p>
|
||||
<p class="submitButton">
|
||||
<input type="hidden" name="token" value="{$token}">
|
||||
Tag: <input type="text" name="fromtag" id="fromtag">
|
||||
<input type="text" name="totag" style="margin-left:40px;"><input type="submit" name="renametag" value="Rename tag" class="bigbutton">
|
||||
or <input type="submit" name="deletetag" value="Delete tag" class="bigbutton" onClick="return confirmDeleteTag();"><br>(Case sensitive)</form>
|
||||
<script language="JavaScript">function confirmDeleteTag() { var agree=confirm("Are you sure you want to delete this tag from all links ?"); if (agree) return true ; else return false ; }</script>
|
||||
<input type="submit" name="deletetag" value="Delete tag" class="bigbutton" onClick="return confirmDeleteTag();">
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
<script language="JavaScript">
|
||||
function confirmDeleteTag() {
|
||||
var agree = confirm("Are you sure you want to delete this tag from all links ?");
|
||||
if (agree) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
{include="page.footer"}
|
||||
{if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"}
|
||||
<script language="JavaScript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#fromtag').autocomplete({source:'{$source}?ws=singletag',minLength:1});
|
||||
$(document).ready(function() {
|
||||
$('.fromtag').autocomplete({
|
||||
source : '{$source}?ws=singletag',
|
||||
minLength : 1
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
|
|
Loading…
Reference in a new issue