aboutsummaryrefslogtreecommitdiffstats
path: root/admin/themes
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-05-03 21:24:34 +0000
committerplegall <plg@piwigo.org>2010-05-03 21:24:34 +0000
commit1f01b7f91200350c3ca2ecd05f8511f1ef943e03 (patch)
tree1f847a006896a72cfffde92bccbe1dd71a90e942 /admin/themes
parent322d34507796654caf9e691f5a972b63be5434f2 (diff)
bug 1642 fixed: if no category exists, prevent from selecting an existing
category (before form submission). git-svn-id: http://piwigo.org/svn/trunk@6057 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/themes')
-rw-r--r--admin/themes/default/template/photos_add_direct.tpl6
1 files changed, 6 insertions, 0 deletions
diff --git a/admin/themes/default/template/photos_add_direct.tpl b/admin/themes/default/template/photos_add_direct.tpl
index f5a8c7f53..ffa5e2415 100644
--- a/admin/themes/default/template/photos_add_direct.tpl
+++ b/admin/themes/default/template/photos_add_direct.tpl
@@ -49,6 +49,12 @@ jQuery(document).ready(function(){
}
+ if ($("select[name=category] option").length == 0) {
+ $('input[name=category_type][value=existing]').attr('disabled', true);
+ $('input[name=category_type]').attr('checked', false);
+ $('input[name=category_type][value=new]').attr('checked', true);
+ }
+
$("input[name=category_type]").click(function () {
$("[id^=category_type_]").hide();
$("#category_type_"+$(this).attr("value")).show();