[chg] change rename/delete tag form

This commit is contained in:
Knah Tsaeb 2015-05-20 10:40:51 +02:00
parent 2e05b32a32
commit 3737a64ff3
5 changed files with 124 additions and 53 deletions

View File

@ -212,13 +212,13 @@ pre code {
align-items: flex-start;
}
.searchform input:nth-child(1), .tagfilter input:nth-child(1), .addform input:nth-child(1) {
.searchform input:nth-child(1), .tagfilter input:nth-child(1), .addform input:nth-child(1){
order: 1;
flex: 1 0 auto;
align-self: stretch;
}
.searchform input:nth-child(2), .tagfilter input:nth-child(2), .addform input:nth-child(2) {
.searchform input:nth-child(2), .tagfilter input:nth-child(2), .addform input:nth-child(2){
order: 2;
flex: 0 0 20%;
align-self: stretch;
@ -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;
}

View File

@ -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)
{

View File

@ -1,16 +1,18 @@
<!DOCTYPE html>
<html>
<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="submit" value="Add link" class="bigbutton">
</form>
</div>
</div>
{include="page.footer"}
</body>
<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">
<input type="submit" value="Add link" class="bigbutton">
</form>
</div>
</div>
{include="page.footer"}
</body>
</html>

View File

@ -1,15 +1,26 @@
<!DOCTYPE html>
<html>
<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">&nbsp; &nbsp;
New password: <input type="password" name="setpassword">
<input type="hidden" name="token" value="{$token}">
<input type="submit" name="Save" value="Save password" class="bigbutton"></form>
</div>
{include="page.footer"}
</body>
<head>
{include="includes"}
</head>
<body onload="document.changepasswordform.oldpassword.focus();">
<div id="pageheader">
{include="page.header"}
<form method="POST" action="" name="changepasswordform" id="changepasswordform">
<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">
</p>
</form>
</div>
{include="page.footer"}
</body>
</html>

View File

@ -1,26 +1,69 @@
<!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>
<body onload="document.changetag.fromtag.focus();">
<div id="pageheader">
{include="page.header"}
<form method="POST" action="" name="changetag" id="changetag">
<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">
&nbsp;&nbsp;or&nbsp; <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>
</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});
});
</script>
{/if}
</body>
<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>
<div id="pageheader">
{include="page.header"}
<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}">
<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
});
});
</script>
{/if}
</body>
</html>