From 4cedcbab58678085c5272631f7e3fc3e9e6cdde3 Mon Sep 17 00:00:00 2001 From: Banana Date: Wed, 15 Jun 2011 14:29:33 +0200 Subject: [PATCH] whoops --- lib/Insipid/Main.pm | 2 +- lib/Insipid/Tags.pm | 32 +++++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/lib/Insipid/Main.pm b/lib/Insipid/Main.pm index 49f8538..f9902e1 100755 --- a/lib/Insipid/Main.pm +++ b/lib/Insipid/Main.pm @@ -290,7 +290,7 @@ IFORM param('description'), param('tags') ); - if($url == '' || $title == '') { + if(!$url || !$title) { print "URL or Title can not be empty"; exit; } diff --git a/lib/Insipid/Tags.pm b/lib/Insipid/Tags.pm index e15cdc1..96e837b 100755 --- a/lib/Insipid/Tags.pm +++ b/lib/Insipid/Tags.pm @@ -29,6 +29,7 @@ use CGI::Carp qw(fatalsToBrowser); use Insipid::Config; use Insipid::Database; use Insipid::Sessions; +use Insipid::Util; require Exporter; use Data::Dumper; @@ -47,18 +48,20 @@ sub tag_operations { check_access(); + print Dumper param("doDelete"); + print Dumper param("deleteTag"); + print Dumper param("moveTo"); + if(param('save') && param('newName')) { print '

Reanming...

'; my $newTag = param('newName'); my $oldTagName = param('rename'); my $oldTagId = get_tag_id_by_name($oldTagName); - print Dumper "oldtagid: ".$oldTagId; # is the new name already a tag ? # if check then check is the new tagId my $check = get_tag_id_by_name($newTag); - print Dumper "newtagid: ".$check; if($check && ($check != $oldTagId)) { my $sql = "SELECT bookmark_id, tag_id FROM `$tbl_bookmark_tags` @@ -83,7 +86,6 @@ sub tag_operations { my $sql = "DELETE FROM `$tbl_tags` WHERE id = ?"; my $sth = $dbh->prepare($sql); $sth->execute($oldTagId); - } else { # just rename the tag @@ -93,7 +95,17 @@ sub tag_operations { } print 'Done !'; + } + elsif(param("doDelete") && param("deleteTag") && param("moveTo")) { + print '

Delete...

'; + + my($delTagName,$moveToTagName) = (param('deleteTag'), param('moveTo')); + + if($delTagName && $moveToTagName && ($delTagName != $moveToTagName)) { + + } + print 'Done !'; } print '

Rename Tag

'; @@ -101,16 +113,26 @@ sub tag_operations { print ''; - print '
'; + print ''; print ''; print ''; print ''; print ''; print '

Delete Tag

'; - print ''; + show_tags(1); + print '
'; + print "and move to:"; + print ''; + print ''; + print ''; + print ''; + print ''; } # Display the tag list. Takes one parameter for the mode - 0 is for the -- 2.39.5