From: Dobrica Pavlinusic Date: Sun, 20 Nov 2005 21:45:09 +0000 (+0000) Subject: r8999@llin: dpavlin | 2005-11-20 22:46:22 +0100 X-Git-Url: http://git.rot13.org/?p=webpac2;a=commitdiff_plain;h=118ee5e3baceecea12902cd801999559edc50c7e;hp=7a90434422239603e90db854430b0507957a7520 r8999@llin: dpavlin | 2005-11-20 22:46:22 +0100 select template by clicking on list git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@79 07558da8-63fa-0310-ba24-9fe276d99e06 --- diff --git a/web/browse.cgi b/web/browse.cgi index a10d175..bc9340f 100755 --- a/web/browse.cgi +++ b/web/browse.cgi @@ -75,6 +75,23 @@ sub get_file_in_html($) { return $content; } +sub template_list_html($) { + my $current = shift || die; + + my $html = qq{ Template\n }; + return $html; +} + ##---- if ($q->path_info =~ m#xml#) { @@ -118,6 +135,17 @@ if ($q->path_info =~ m#xml#) { exit; } +} elsif ($q->path_info =~ m#template_list#) { + + print qq{ + +
} . template_list_html($template_filename) . qq{
+
+
+ }; + + exit; + } elsif ($q->path_info =~ m#template#) { my $template_path = $out->{'include_path'} . '/' . $template_filename; @@ -167,6 +195,7 @@ $tmpl @@ -231,20 +260,7 @@ iwfLog('loaded CSS template'); } else { - my $template_form = qq{ -
- - -
- }; + my $template_list_html = template_list_html($template_filename); print <<"_END_OF_HEAD_"; @@ -313,6 +329,18 @@ function edit_css() { return false; } +function load_template(name) { + iwfLog('changing template to '+name); + iwfOpacity('div_template', 30); + template_filename = name; + // load template editor + iwfRequest( url+'/template/?template='+template_filename, 'div_template' ); + load_rec(rec); + + // refresh template list + iwfRequest( url+'/template_list/?template='+template_filename, 'div_template_list' ); +} + function init_page() { iwfLog('div_css = ' + iwfX('div_css') + ':' + iwfY('div_css')); iwfLog('div_template = ' + iwfX('div_template') + ':' + iwfY('div_template')); @@ -322,10 +350,9 @@ function init_page() { iwfLog('div_css = ' + iwfX('div_css') + ':' + iwfY('div_css')); - load_rec(rec); + // load template editor and record + load_template(template_filename); - // load template editor - iwfRequest( url+'/template/?template='+template_filename, 'div_template' ); // load css editor iwfRequest( url+'/css/', 'div_css' ); } @@ -339,7 +366,6 @@ function init_page() { db_path = $db_path
-template = $template_form
css = $css_file
@@ -352,13 +378,20 @@ css = $css_file
+ +
+$template_list_html +
+
-
+
+ Editor template css +
no template loaded yet.