phpwebapp-commits Mailing List for phpWebApp (Page 15)
Brought to you by:
dashohoxha
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(2) |
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2003 |
Jan
|
Feb
(43) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(194) |
Sep
(60) |
Oct
(6) |
Nov
|
Dec
(16) |
2004 |
Jan
(73) |
Feb
(13) |
Mar
(5) |
Apr
|
May
(5) |
Jun
|
Jul
(183) |
Aug
|
Sep
(5) |
Oct
(30) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
(1) |
Jun
(35) |
Jul
(17) |
Aug
(2) |
Sep
(6) |
Oct
(19) |
Nov
(108) |
Dec
|
2006 |
Jan
(10) |
Feb
(1) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dashamir H. <das...@us...> - 2004-07-21 17:04:58
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2634 Modified Files: styles.css Log Message: Index: styles.css =================================================================== RCS file: /cvsroot/phpwebapp/web_app/styles.css,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** styles.css 13 Jul 2004 13:18:08 -0000 1.5 --- styles.css 21 Jul 2004 17:04:32 -0000 1.6 *************** *** 27,31 **** ! .webapp_error { color: #ff0000; --- 27,31 ---- ! .webapp_error, .webapp_error strong { color: #ff0000; *************** *** 34,38 **** background-color: #ffffff; } ! .webapp_warning { color: #bb0000; --- 34,38 ---- background-color: #ffffff; } ! .webapp_warning, .webapp_warning strong { color: #bb0000; *************** *** 41,45 **** background-color: #ffffff; } ! .xml_error { color: #ff0088; --- 41,45 ---- background-color: #ffffff; } ! .xml_error, .xml_error strong { color: #ff0088; *************** *** 48,52 **** background-color: #ffffff; } ! .xml_err_str { color: #dd0066; --- 48,52 ---- background-color: #ffffff; } ! .xml_err_str, .xml_err_str strong { color: #dd0066; |
From: Dashamir H. <das...@us...> - 2004-07-21 17:04:58
|
Update of /cvsroot/phpwebapp/web_app/boxes/codeViewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2634/boxes/codeViewer Modified Files: codeViewer.html codeViewer.css Log Message: Index: codeViewer.html =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/codeViewer/codeViewer.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** codeViewer.html 20 Aug 2003 07:00:50 -0000 1.3 --- codeViewer.html 21 Jul 2004 17:04:32 -0000 1.4 *************** *** 1,12 **** ! <WebBox ID="codeViewer"> <table class="codeViewer-table" cellspacing="0" cellpadding="0"> ! <Repeat rs="lines"> <tr> ! <If condition="{{show_nr}}"> <td class="{{class-nr}}">{{nr}} </td> ! </If> <td class="{{class-line}}"><pre class="{{class-line}}">{{line}}</pre></td> </tr> ! </Repeat> </table> ! </WebBox> --- 1,12 ---- ! <webbox id="codeViewer"> <table class="codeViewer-table" cellspacing="0" cellpadding="0"> ! <repeat rs="lines"> <tr> ! <if condition="{{show_nr}}"> <td class="{{class-nr}}">{{nr}} </td> ! </if> <td class="{{class-line}}"><pre class="{{class-line}}">{{line}}</pre></td> </tr> ! </repeat> </table> ! </webbox> Index: codeViewer.css =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/codeViewer/codeViewer.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** codeViewer.css 20 Aug 2003 07:00:51 -0000 1.2 --- codeViewer.css 21 Jul 2004 17:04:32 -0000 1.3 *************** *** 44,47 **** --- 44,49 ---- pre.codeViewer-line { + margin: 0; + padding: 0; background-color: #ffffff; color: #000099; *************** *** 51,54 **** --- 53,58 ---- pre.codeViewer-line-highlighted { + margin: 0; + padding: 0; background-color: #5555ff; color: #ffff00; |
From: Dashamir H. <das...@us...> - 2004-07-21 17:04:57
|
Update of /cvsroot/phpwebapp/web_app/append In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2634/append Modified Files: wbDebug.html append.html Log Message: Index: wbDebug.html =================================================================== RCS file: /cvsroot/phpwebapp/web_app/append/wbDebug.html,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wbDebug.html 15 Jul 2004 14:46:04 -0000 1.6 --- wbDebug.html 21 Jul 2004 17:04:32 -0000 1.7 *************** *** 1,5 **** <!--# external link #--> ! <If condition="SHOW_EXTERNAL_LINK"> ! <Var name="extern_link">WebApp::get_external_link()</Var> <br/> <table bgcolor="#aaaaaa" border="0" cellspacing="1" cellpadding="2"> --- 1,5 ---- <!--# external link #--> ! <if condition="SHOW_EXTERNAL_LINK"> ! <var name="extern_link">WebApp::get_external_link()</var> <br/> <table bgcolor="#aaaaaa" border="0" cellspacing="1" cellpadding="2"> *************** *** 14,41 **** </table> <br/> ! </If> ! <WebBox ID="wbDbgStatevars"> <!--# debug state vars #--> ! </WebBox> ! <WebBox ID="wbDbgTemplates"> <!--# debug template structure #--> ! </WebBox> ! <WebBox ID="wbDebug"> <!--# debug GoTo() transitions #--> ! <If condition="'{{DEBUG_GOTO}}'!=''"> {{debug_goto}} ! </If> <!--# debug recordsets #--> ! <If condition="'{{DEBUG_RECORDSETS}}'!=''"> {{debug_recordsets}} ! </If> <!--# show timer results #--> ! <If condition="'{{EXECUTION_TIME_INFO}}'!=''"> {{timer_results}} ! </If> ! </WebBox> --- 14,41 ---- </table> <br/> ! </if> ! <webbox id="wbDbgStatevars"> <!--# debug state vars #--> ! </webbox> ! <webbox id="wbDbgTemplates"> <!--# debug template structure #--> ! </webbox> ! <webbox id="wbDebug"> <!--# debug GoTo() transitions #--> ! <if condition="'{{DEBUG_GOTO}}'!=''"> {{debug_goto}} ! </if> <!--# debug recordsets #--> ! <if condition="'{{DEBUG_RECORDSETS}}'!=''"> {{debug_recordsets}} ! </if> <!--# show timer results #--> ! <if condition="'{{EXECUTION_TIME_INFO}}'!=''"> {{timer_results}} ! </if> ! </webbox> Index: append.html =================================================================== RCS file: /cvsroot/phpwebapp/web_app/append/append.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** append.html 14 Jul 2004 14:45:41 -0000 1.4 --- append.html 21 Jul 2004 17:04:32 -0000 1.5 *************** *** 13,23 **** <!--# include session variables #--> ! <Include SRC="{{SESSION_PATH}}wbSession.html" /> <!--# display any messages from server-side code #--> ! <WebBox ID="wbMessages"> {{MESSAGES}} ! </WebBox> <!--# include debug info #--> ! <Include SRC="{{./}}wbDebug.html" /> --- 13,23 ---- <!--# include session variables #--> ! <include src="{{SESSION_PATH}}wbSession.html" /> <!--# display any messages from server-side code #--> ! <webbox id="wbMessages"> {{MESSAGES}} ! </webbox> <!--# include debug info #--> ! <include src="{{./}}wbDebug.html" /> |
From: Dashamir H. <das...@us...> - 2004-07-21 17:04:44
|
Update of /cvsroot/phpwebapp/web_app/boxes/menu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2634/boxes/menu Modified Files: menu.html Log Message: Index: menu.html =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/menu/menu.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** menu.html 16 Jul 2004 07:41:39 -0000 1.1 --- menu.html 21 Jul 2004 17:04:31 -0000 1.2 *************** *** 1,3 **** ! <WebBox ID="menu"> <script language="JavaScript" src="{{./}}menu_items.js"></script> <script language="JavaScript" src="{{./}}menu_tpl.js"></script> --- 1,3 ---- ! <webbox id="menu"> <script language="JavaScript" src="{{./}}menu_items.js"></script> <script language="JavaScript" src="{{./}}menu_tpl.js"></script> *************** *** 6,10 **** </script> ! <If condition="'{{edit_menu_visible}}'=='true'"> <script language="JavaScript" src="{{./}}edit/menu_items.php"></script> <script language="JavaScript" src="{{./}}edit/menu_tpl.js"></script> --- 6,10 ---- </script> ! <if condition="'{{edit_menu_visible}}'=='true'"> <script language="JavaScript" src="{{./}}edit/menu_items.php"></script> <script language="JavaScript" src="{{./}}edit/menu_tpl.js"></script> *************** *** 12,15 **** new menu (EDIT_MENU_ITEMS, EDIT_MENU_POS); </script> ! </If> ! </WebBox> --- 12,15 ---- new menu (EDIT_MENU_ITEMS, EDIT_MENU_POS); </script> ! </if> ! </webbox> |
From: Dashamir H. <das...@us...> - 2004-07-21 17:04:44
|
Update of /cvsroot/phpwebapp/web_app/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2634/parser Modified Files: class.Parser.php Log Message: Index: class.Parser.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.Parser.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** class.Parser.php 20 Jul 2004 17:26:09 -0000 1.13 --- class.Parser.php 21 Jul 2004 17:04:31 -0000 1.14 *************** *** 131,135 **** if ($tpl===UNDEFINED) $tpl = new Template; ! if (!$well_formed) { //The contents of the string usually is not well-formed xml --- 131,136 ---- if ($tpl===UNDEFINED) $tpl = new Template; ! //if (!$well_formed) ! if (substr($xml_string, 0, 5) != '<?xml') { //The contents of the string usually is not well-formed xml *************** *** 234,238 **** } ! //reset parsing options to default and safe values $this->copy_mode = false; } --- 235,239 ---- } ! //reset parsing modes to default and safe values $this->copy_mode = false; } *************** *** 396,400 **** $name = strtolower($name); $attr_list = $this->get_attr_list($attribs); ! $this->append("<$name $attr_list>"); break; --- 397,401 ---- $name = strtolower($name); $attr_list = $this->get_attr_list($attribs); ! $this->append("<$name$attr_list>"); break; *************** *** 408,412 **** $name = strtolower($name); $attr_list = $this->get_attr_list($attribs); ! $this->append("<$name $attr_list>"); break; } --- 409,413 ---- $name = strtolower($name); $attr_list = $this->get_attr_list($attribs); ! $this->append("<$name$attr_list>"); break; } *************** *** 673,721 **** function start_HEAD($attribs) { ! if ($this->current_tpl->type<>"MainTpl") { ! //give a warning message ! $msg = "Parser: <head> element cannot be used " ! ."in this place"; ! $err_msg = WebApp::warning_msg($msg); ! $this->append($err_msg); } - - $tpl = new Template("HeadTpl", "HeadTpl"); - $this->push_current_tpl($tpl); - $attr_list = $this->get_attr_list($attribs); - $this->append('<head'.$attr_list.'>'); } function end_HEAD() { ! $this->append('</head>'); ! $tpl = $this->pop_current_tpl(); ! //link it to the MainTpl ! $this->link_template($tpl); ! if ($this->current_tpl->type=="MainTpl") { ! global $webPage; $this->current_tpl->head = &$webPage->tpl_collection[$tpl->id]; } } function start_BODY($attribs) { ! if ($this->current_tpl->type<>"MainTpl") { ! //give a warning message ! $msg = "Parser: <body> element cannot be used " ! ."in this place"; ! $err_msg = WebApp::warning_msg($msg); ! $this->append($err_msg); } - - //create a body template - $tpl = new Template("BodyTpl", "BodyTpl"); - - $this->push_current_tpl($tpl); - - $this->append('<body'.$this->get_attr_list($attribs).'>'); } function end_BODY() --- 674,721 ---- function start_HEAD($attribs) { ! if ($this->current_tpl->type=="MainTpl") { ! $tpl = new Template("HeadTpl", "HeadTpl"); ! $this->push_current_tpl($tpl); ! $this->append('<head>'); ! } ! else ! { ! $tpl = new Template; ! $this->push_current_tpl($tpl); } } function end_HEAD() { ! global $webPage; ! if ($this->current_tpl->type=="HeadTpl") { ! $this->append('</head>'); ! $tpl = $this->pop_current_tpl(); ! $this->link_template($tpl); $this->current_tpl->head = &$webPage->tpl_collection[$tpl->id]; } + else + { + $tpl = $this->pop_current_tpl(); + $tpl->parent = &$webPage->tpl_collection['HeadTpl']; + $webPage->append_to_head('&&'.$tpl->id.';;'); + } } function start_BODY($attribs) { ! if ($this->current_tpl->type=="MainTpl") { ! $tpl = new Template("BodyTpl", "BodyTpl"); ! $this->push_current_tpl($tpl); ! $this->append('<body'.$this->get_attr_list($attribs).'>'); ! } ! else ! { ! $tpl = new Template; ! $this->push_current_tpl($tpl); } } function end_BODY() *************** *** 815,819 **** if ($this->current_tpl->type=="WebClassTpl") { ! $name = strtoupper($name); $this->current_tpl->params[$name] = $default; } --- 815,819 ---- if ($this->current_tpl->type=="WebClassTpl") { ! $name = strtolower($name); $this->current_tpl->params[$name] = $default; } *************** *** 830,833 **** --- 830,835 ---- function start_WEBOBJECT($attribs) { + global $webPage; + //get the attributes of the webobject $class_name = $attribs['CLASS']; *************** *** 860,866 **** while (list($p_name,$p_default) = each($tpl->params)) { ! if (isset($attribs[$p_name])) { ! $tpl->params[$p_name] = $attribs[$p_name]; } } --- 862,868 ---- while (list($p_name,$p_default) = each($tpl->params)) { ! if (isset($attribs[strtoupper($p_name)])) { ! $tpl->params[$p_name] = $attribs[strtoupper($p_name)]; } } |
From: Dashamir H. <das...@us...> - 2004-07-21 17:04:44
|
Update of /cvsroot/phpwebapp/web_app/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2634/doc Modified Files: to_do.txt Log Message: Index: to_do.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/to_do.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** to_do.txt 16 Jul 2004 14:45:14 -0000 1.7 --- to_do.txt 21 Jul 2004 17:04:31 -0000 1.8 *************** *** 1,8 **** ! - Use the new framework with the other web applications (app1, ! app2, app3, documentation, top10, smewapp, ilar, kushtetuta, ! doc-book, etc.) in order to test the new parser (and the XHTML conversion tool(s)). - Reformat all the files (automatically with emacs). --- 1,11 ---- ! - Use the new framework with the other web applications ! (top10, smewapp, ilar, kushtetuta, doc-book, etc.) ! in order to test the new parser (and the XHTML conversion tool(s)). + - Fix some bugs in the documentation application and improve its + contents a little bit. + - Reformat all the files (automatically with emacs). *************** *** 27,31 **** 2 - Replace 'not-equal operator' <> by !=, in the condition of <If> elements: <If condition="'{{CurrPage}}'<>'{{PrevPage}}'"> - This can be done automatically by a script. 3 - Replace the old usage of 'checked' in checkboxes with the new --- 30,33 ---- *************** *** 34,47 **** replace {{selected_var}} with selected="{{selected_var}}" ! 4 - Use 'tidy' (with some appropriate options) to convert all the ! templates to clean XHTML code (convert all tags and attributes ! to lowercase, replace <img...> by <img ... />, etc.). ! A script would be usefull for this. ! ! 5 - In case that some formating of tidy is not satisfactory, then ! use an XSLT transformer(stylesheet) and xsltproc to convert ! the templates to a better formating. ! 6 - Add these lines at the beginning of the root templates: <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" --- 36,46 ---- replace {{selected_var}} with selected="{{selected_var}}" ! 4 - Convert all the templates to clean XHTML code (convert all tags ! and attributes to lowercase, replace <img...> by <img ... />, ! etc.). Maybe 'tidy' can be used for this, however sometimes ! it does not produce the desired results (because of the framework ! tags). ! 5 - Add these lines at the beginning of the root templates: <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" *************** *** 49,50 **** --- 48,59 ---- <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> + 6 - Each xml parser is required to process the entities: & < + > " and ' and to return the corresponding character + instead of the entity itself. So, it is neccessary to replace + in the templates all the xml builtin entities, like this: + & --> &amp; + < --> &lt; + > --> &gt; + " --> &quot; + ' --> &apos; + |
From: Dashamir H. <das...@us...> - 2004-07-21 17:04:44
|
Update of /cvsroot/phpwebapp/web_app/convert In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2634/convert Modified Files: convert.php class.Render.php README Log Message: Index: convert.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/convert/convert.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** convert.php 20 Jul 2004 16:51:14 -0000 1.1 --- convert.php 21 Jul 2004 17:04:31 -0000 1.2 *************** *** 37,41 **** //handle empty tags $empty_tag = '(br|hr|img|input|meta|link|include|parameter)'; ! $pattern = '#(<'.$empty_tag.'([^>]*[^/])?)>#'; $str = preg_replace($pattern, '$1 />', $str); --- 37,41 ---- //handle empty tags $empty_tag = '(br|hr|img|input|meta|link|include|parameter)'; ! $pattern = '#(<'.$empty_tag.'([^>]*[^/-])?)>#'; $str = preg_replace($pattern, '$1 />', $str); *************** *** 45,50 **** //replace {{checked}} by checked="{{checked}}" ! $pattern = '#(<input[^<>]+type=.checkbox[^<>]+\s)(\{\{[^\}]+\}\})#'; ! $str = preg_replace($pattern, '${1}checked="$2"', $str); //replace {{selected}} by selected="{{selected}}" --- 45,50 ---- //replace {{checked}} by checked="{{checked}}" ! $pattern = '#(<input[^<>]+type=.(checkbox|radio)[^<>]+\s)(\{\{[^\}]+\}\})#'; ! $str = preg_replace($pattern, '${1}checked="$3"', $str); //replace {{selected}} by selected="{{selected}}" *************** *** 52,55 **** --- 52,66 ---- $str = preg_replace($pattern, '${1}selected="$2"', $str); + //replace compact attributes by their xhtml equivalent + $compact = '(nowrap|checked|disabled|readonly|selected|noresize)'; + $pattern = '#(<\w+[^<>]+\s+)'.$compact.'(?!\s*=)#'; + $str = preg_replace($pattern, '${1}$2="$2"', $str); + + //replace the xml builtin entities + $str = preg_replace('#&(lt|gt|quot|apos);#', '&$1;', $str); + //convert also & but not those that are + //the result of a previous conversion + $str = preg_replace('#&(?!(amp|lt|gt|apos);)#', '&amp;', $str); + return $str; } Index: class.Render.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/convert/class.Render.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** class.Render.php 20 Jul 2004 16:51:14 -0000 1.1 --- class.Render.php 21 Jul 2004 17:04:31 -0000 1.2 *************** *** 47,73 **** function render_RepeatTpl($tpl) { - //decrease the indentation of header $header = $tpl->header; - for ($i=0; $i < sizeof($header->content); $i++) - { - $line = $header->content[$i]; - $line = ereg_replace('^ ', '', $line); - $header->content[$i] = $line; - } - //decrease the indentation of footer $footer = $tpl->footer; ! for ($i=0; $i < sizeof($footer->content); $i++) ! { ! $line = $footer->content[$i]; ! $line = ereg_replace('^ ', '', $line); ! $footer->content[$i] = $line; ! } ! //increase the indentation of <Repeat> and <RepeatBody> ! for ($i=0; $i < sizeof($tpl->content); $i++) { ! $line = $tpl->content[$i]; ! if (ereg('^ *</?Repeat', $line)) { ! $tpl->content[$i] = ' '.$line; } } --- 47,76 ---- function render_RepeatTpl($tpl) { $header = $tpl->header; $footer = $tpl->footer; ! if (sizeof($header->content) > 0 or sizeof($footer->content) > 0) { ! //decrease the indentation of header ! for ($i=0; $i < sizeof($header->content); $i++) { ! $line = $header->content[$i]; ! $line = ereg_replace('^ ', '', $line); ! $header->content[$i] = $line; ! } ! //decrease the indentation of footer ! for ($i=0; $i < sizeof($footer->content); $i++) ! { ! $line = $footer->content[$i]; ! $line = ereg_replace('^ ', '', $line); ! $footer->content[$i] = $line; ! } ! //increase the indentation of <Repeat> and <RepeatBody> ! for ($i=0; $i < sizeof($tpl->content); $i++) ! { ! $line = $tpl->content[$i]; ! if (ereg('^ *</?Repeat', $line)) ! { ! $tpl->content[$i] = ' '.$line; ! } } } Index: README =================================================================== RCS file: /cvsroot/phpwebapp/web_app/convert/README,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README 20 Jul 2004 16:51:14 -0000 1.1 --- README 21 Jul 2004 17:04:31 -0000 1.2 *************** *** 5,9 **** version of the framework. ! What is does is this: - Removes the elements <Header> and <Footer> from the <Repeat> element and puts their contents respectivly before and after --- 5,9 ---- version of the framework. ! What it does is this: - Removes the elements <Header> and <Footer> from the <Repeat> element and puts their contents respectivly before and after *************** *** 17,22 **** It can be used like this: ! $ ./convert.sh ../templates/*.html ! $ find ../templates/ -name '*.html' | xargs ./convert.sh After a template is converted, it is saved with the same name, --- 17,22 ---- It can be used like this: ! $ ./convert.sh ../templates/*.html ! $ find ../templates/ -name '*.html' | xargs ./convert.sh After a template is converted, it is saved with the same name, *************** *** 26,31 **** After making sure that all the templates are converted successfully, the backup files can be deleted with the command: ! $ find ../templates/ -name '*.html.orig' -exec rm {} \; All the backup files can be restored like this: ! $ find ../templates/ -name '*.html' -exec cp {}.orig {} \; --- 26,31 ---- After making sure that all the templates are converted successfully, the backup files can be deleted with the command: ! $ find ../templates/ -name '*.html.orig' -exec rm {} \; All the backup files can be restored like this: ! $ find ../templates/ -name '*.html' -exec cp {}.orig {} \; |
From: Dashamir H. <das...@us...> - 2004-07-21 17:04:42
|
Update of /cvsroot/phpwebapp/web_app/session In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2634/session Modified Files: wbSession.html Log Message: Index: wbSession.html =================================================================== RCS file: /cvsroot/phpwebapp/web_app/session/wbSession.html,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wbSession.html 15 Jul 2004 14:46:04 -0000 1.6 --- wbSession.html 21 Jul 2004 17:04:31 -0000 1.7 *************** *** 1,8 **** ! <WebBox ID="wbSession"> <!--# the form that transmits to the server the session vars, the event (and event args), the php vars etc. #--> ! <form name="WebAppForm" id="WebAppForm" method="{{method}}" onSubmit="return false;"> <input type="hidden" name="sourcePage" id="sourcePage" value="{{sourcePage}}"/> <input type="hidden" name="targetPage" id="targetPage" value=""/> --- 1,8 ---- ! <webbox id="wbSession"> <!--# the form that transmits to the server the session vars, the event (and event args), the php vars etc. #--> ! <form name="WebAppForm" id="WebAppForm" method="{{method}}" onsubmit="return false;"> <input type="hidden" name="sourcePage" id="sourcePage" value="{{sourcePage}}"/> <input type="hidden" name="targetPage" id="targetPage" value=""/> *************** *** 15,17 **** <script type="text/javascript" language="javascript" src="{{./}}class.Session.js"></script> {{SESSION_VARS}} ! </WebBox> --- 15,17 ---- <script type="text/javascript" language="javascript" src="{{./}}class.Session.js"></script> {{SESSION_VARS}} ! </webbox> |
From: Dashamir H. <das...@us...> - 2004-07-21 17:04:42
|
Update of /cvsroot/phpwebapp/web_app/boxes/menu/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2634/boxes/menu/edit Modified Files: edit_menu.html Log Message: Index: edit_menu.html =================================================================== RCS file: /cvsroot/phpwebapp/web_app/boxes/menu/edit/edit_menu.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** edit_menu.html 16 Jul 2004 07:41:39 -0000 1.1 --- edit_menu.html 21 Jul 2004 17:04:31 -0000 1.2 *************** *** 1,3 **** ! <WebBox ID="edit_menu"> <div id="menu_place"></div> --- 1,3 ---- ! <webbox id="edit_menu"> <div id="menu_place"></div> *************** *** 7,12 **** <tr> <td class="item"> ! ID:<input type="text" name="item_id" value="{{item_id}}"> ! Caption:<input type="text" name="item_caption" value="{{item_caption}}"> </td> <td> --- 7,12 ---- <tr> <td class="item"> ! ID:<input type="text" name="item_id" value="{{item_id}}" /> ! Caption:<input type="text" name="item_caption" value="{{item_caption}}" /> </td> <td> *************** *** 15,19 **** </td> </tr> ! <Repeat rs="subitems"> <tr> <td class="subitem"> --- 15,19 ---- </td> </tr> ! <repeat rs="subitems"> <tr> <td class="subitem"> *************** *** 26,34 **** </td> </tr> ! </Repeat> <tr> <td class="subitem"> ! id:<input type="text" name="new_id" value=""> ! caption:<input type="text" name="new_caption" value=""> </td> <td> --- 26,34 ---- </td> </tr> ! </repeat> <tr> <td class="subitem"> ! id:<input type="text" name="new_id" value="" /> ! caption:<input type="text" name="new_caption" value="" /> </td> <td> *************** *** 44,46 **** <a class="button" href="javascript:close()">Close</a> </div> ! </WebBox> --- 44,46 ---- <a class="button" href="javascript:close()">Close</a> </div> ! </webbox> |
From: Dashamir H. <das...@us...> - 2004-07-20 17:28:58
|
Update of /cvsroot/phpwebapp/app2/templates/page3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14532/templates/page3 Modified Files: tpl_2_2.html tpl_2_1.html tpl_2.html tpl_1.html tmpl.html page3.html Log Message: converted to xhtml Index: tpl_2_2.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_2_2.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tpl_2_2.html 15 Aug 2003 09:09:26 -0000 1.2 --- tpl_2_2.html 20 Jul 2004 17:28:48 -0000 1.3 *************** *** 3,7 **** <tr><td class="box_title_2_2">tpl_2_2.html</td></tr> <tr><td class="box_content_2_2"> ! tpl_2_2 <br> content </td></tr> --- 3,7 ---- <tr><td class="box_title_2_2">tpl_2_2.html</td></tr> <tr><td class="box_content_2_2"> ! tpl_2_2 <br /> content </td></tr> Index: tpl_2_1.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_2_1.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tpl_2_1.html 15 Aug 2003 09:09:26 -0000 1.2 --- tpl_2_1.html 20 Jul 2004 17:28:48 -0000 1.3 *************** *** 3,7 **** <tr><td class="box_title_2_1">tpl_2_1.html</td></tr> <tr><td class="box_content_2_1"> ! tpl_2_1 <br> content </td></tr> --- 3,7 ---- <tr><td class="box_title_2_1">tpl_2_1.html</td></tr> <tr><td class="box_content_2_1"> ! tpl_2_1 <br /> content </td></tr> Index: tpl_2.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_2.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tpl_2.html 15 Aug 2003 09:09:26 -0000 1.2 --- tpl_2.html 20 Jul 2004 17:28:48 -0000 1.3 *************** *** 5,12 **** <table width="100%" border="0" cellspacing="10" cellpadding="0"> <tr><td> ! <Include SRC="{{./}}tpl_2_1.html"/> </td></tr> <tr><td> ! <Include SRC="{{./}}tpl_2_2.html"/> </td></tr> </table> --- 5,12 ---- <table width="100%" border="0" cellspacing="10" cellpadding="0"> <tr><td> ! <include src="{{./}}tpl_2_1.html"/> </td></tr> <tr><td> ! <include src="{{./}}tpl_2_2.html"/> </td></tr> </table> Index: tpl_1.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tpl_1.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tpl_1.html 20 Aug 2003 07:36:38 -0000 1.3 --- tpl_1.html 20 Jul 2004 17:28:48 -0000 1.4 *************** *** 12,18 **** <ul> <li> <strong>Modularity</strong> -- the graphical ! designer can work with smaller pieces of code. <li> <strong>Reusability</strong> -- templates are ! easier to be reused in other pages or other applications. </ul> --- 12,18 ---- <ul> <li> <strong>Modularity</strong> -- the graphical ! designer can work with smaller pieces of code.</li> <li> <strong>Reusability</strong> -- templates are ! easier to be reused in other pages or other</li> applications. </ul> Index: tmpl.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/tmpl.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tmpl.html 15 Aug 2003 09:09:26 -0000 1.2 --- tmpl.html 20 Jul 2004 17:28:48 -0000 1.3 *************** *** 6,13 **** <tr> <td width="60%" valign="top"> ! <Include SRC="{{./}}tpl_1.html"/> </td> <td valign="top"> ! <Include SRC="{{./}}tpl_2.html"/> </td> </tr> --- 6,13 ---- <tr> <td width="60%" valign="top"> ! <include src="{{./}}tpl_1.html"/> </td> <td valign="top"> ! <include src="{{./}}tpl_2.html"/> </td> </tr> Index: page3.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page3/page3.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** page3.html 25 Aug 2003 14:28:29 -0000 1.3 --- page3.html 20 Jul 2004 17:28:48 -0000 1.4 *************** *** 1,13 **** ! <html> <head> <title>Page 3</title> ! <link rel="stylesheet" type="text/css" href="{{TPL_URL}}styles.css"> </head> <body> ! <Include SRC="{{TPL_PATH}}header.html"/> <h3>A Page Constructed by Subtemplates</h3> ! <Include SRC="{{./}}tmpl.html"/> ! <br><br> ! <Include SRC="{{TPL_PATH}}footer.html"/> </body> </html> --- 1,17 ---- ! <?xml version="1.0" encoding="iso-8859-1"?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ! "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ! ! <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> <head> <title>Page 3</title> ! <link rel="stylesheet" type="text/css" href="{{TPL_URL}}styles.css" /> </head> <body> ! <include src="{{TPL_PATH}}header.html"/> <h3>A Page Constructed by Subtemplates</h3> ! <include src="{{./}}tmpl.html"/> ! <br /><br /> ! <include src="{{TPL_PATH}}footer.html"/> </body> </html> |
From: Dashamir H. <das...@us...> - 2004-07-20 17:28:58
|
Update of /cvsroot/phpwebapp/app2/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14532/templates Modified Files: page2.html page1_content.html page1.html footer.html Log Message: converted to xhtml Index: page2.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page2.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** page2.html 25 Aug 2003 14:28:29 -0000 1.3 --- page2.html 20 Jul 2004 17:28:48 -0000 1.4 *************** *** 1,11 **** ! <html> <head> <title>Page 2</title> ! <link rel="stylesheet" type="text/css" href="{{./}}styles.css"> ! <link rel="stylesheet" type="text/css" href="{{./}}page2.css"> </head> <body> ! <Include SRC="{{./}}header.html" /> <h3>A Page Constructed without Subtemplates</h3> --- 1,15 ---- ! <?xml version="1.0" encoding="iso-8859-1"?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ! "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ! ! <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> <head> <title>Page 2</title> ! <link rel="stylesheet" type="text/css" href="{{./}}styles.css" /> ! <link rel="stylesheet" type="text/css" href="{{./}}page2.css" /> </head> <body> ! <include src="{{./}}header.html" /> <h3>A Page Constructed without Subtemplates</h3> *************** *** 58,62 **** <tr> <td class="box_content_2_1"> ! tpl_2_1 <br> content </td> </tr> --- 62,66 ---- <tr> <td class="box_content_2_1"> ! tpl_2_1 <br /> content </td> </tr> *************** *** 74,78 **** <tr> <td class="box_content_2_2"> ! tpl_2_2 <br> content </td> </tr> --- 78,82 ---- <tr> <td class="box_content_2_2"> ! tpl_2_2 <br /> content </td> </tr> *************** *** 91,95 **** </table> ! <Include SRC="{{./}}footer.html" /> </body> </html> --- 95,99 ---- </table> ! <include src="{{./}}footer.html" /> </body> </html> Index: page1_content.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page1_content.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** page1_content.html 25 Aug 2003 14:28:29 -0000 1.4 --- page1_content.html 20 Jul 2004 17:28:48 -0000 1.5 *************** *** 21,25 **** which is used to include another template inside the current template:</p> <pre> ! <Include SRC="file_to_be_included" /> </pre> --- 21,25 ---- which is used to include another template inside the current template:</p> <pre> ! <Include src="file_to_be_included" /> </pre> Index: page1.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/page1.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** page1.html 25 Aug 2003 14:28:29 -0000 1.3 --- page1.html 20 Jul 2004 17:28:48 -0000 1.4 *************** *** 1,12 **** ! <html> <head> <title>Page 1</title> ! <link rel="stylesheet" type="text/css" href="{{./}}styles.css"> </head> <body> ! <Include SRC="{{./}}header.html"/> ! <Include SRC="{{./}}page1_content.html"/> ! <Include SRC="{{./}}footer.html"/> ! <br> </body> </html> --- 1,17 ---- ! <?xml version="1.0" encoding="iso-8859-1"?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ! "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ! ! <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> <head> <title>Page 1</title> ! <link rel="stylesheet" type="text/css" href="{{./}}styles.css" /> </head> + <body> ! <include src="{{./}}header.html"/> ! <include src="{{./}}page1_content.html"/> ! <include src="{{./}}footer.html"/> ! <br /> </body> </html> Index: footer.html =================================================================== RCS file: /cvsroot/phpwebapp/app2/templates/footer.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** footer.html 25 Aug 2003 14:28:29 -0000 1.5 --- footer.html 20 Jul 2004 17:28:48 -0000 1.6 *************** *** 1,10 **** <script language="JavaScript" src="{{./}}footer.js"></script> ! <hr> ! <br> Go To [ <a href="javascript: goto_page1()"> Page 1 </a> | <a href="javascript: goto_page2()"> Page 2 </a> | <a href="javascript: goto_page3()"> Page 3 </a> ] ! <br><br> ! <a href="javascript:go_back()"><img src="{{IMG_URL}}back.png" alt="Back" border="0"></a> ! <a href="{{APP_URL}}"><img src="{{IMG_URL}}home.png" alt="Home" border="0"></a> --- 1,10 ---- <script language="JavaScript" src="{{./}}footer.js"></script> ! <hr /> ! <br /> Go To [ <a href="javascript: goto_page1()"> Page 1 </a> | <a href="javascript: goto_page2()"> Page 2 </a> | <a href="javascript: goto_page3()"> Page 3 </a> ] ! <br /><br /> ! <a href="javascript:go_back()"><img src="{{IMG_URL}}back.png" alt="Back" border="0" /></a> ! <a href="{{APP_URL}}"><img src="{{IMG_URL}}home.png" alt="Home" border="0" /></a> |
From: Dashamir H. <das...@us...> - 2004-07-20 17:27:43
|
Update of /cvsroot/phpwebapp/app1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14292 Modified Files: page3.html page2.html page1.html external_page.html Log Message: converted to xhtml Index: page3.html =================================================================== RCS file: /cvsroot/phpwebapp/app1/page3.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** page3.html 25 Aug 2003 14:07:01 -0000 1.4 --- page3.html 20 Jul 2004 17:27:34 -0000 1.5 *************** *** 1,6 **** ! <html> <head> <title>Page 3</title> ! <link rel="stylesheet" type="text/css" href="styles.css"> </head> --- 1,10 ---- ! <?xml version="1.0" encoding="iso-8859-1"?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ! "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ! ! <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> <head> <title>Page 3</title> ! <link rel="stylesheet" type="text/css" href="styles.css" /> </head> *************** *** 22,27 **** ]</p> ! <a href="javascript:history.back()"><img src="img/back.png" alt="Back" border="0"></a> ! <a href="{{APP_URL}}"><img src="img/home.png" alt="Home" border="0"></a> </body> </html> --- 26,31 ---- ]</p> ! <a href="javascript:history.back()"><img src="img/back.png" alt="Back" border="0" /></a> ! <a href="{{APP_URL}}"><img src="img/home.png" alt="Home" border="0" /></a> </body> </html> Index: page2.html =================================================================== RCS file: /cvsroot/phpwebapp/app1/page2.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** page2.html 25 Aug 2003 14:07:01 -0000 1.4 --- page2.html 20 Jul 2004 17:27:34 -0000 1.5 *************** *** 1,6 **** ! <html> <head> <title>Page 2</title> ! <link rel="stylesheet" type="text/css" href="styles.css"> </head> --- 1,10 ---- ! <?xml version="1.0" encoding="iso-8859-1"?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ! "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ! ! <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> <head> <title>Page 2</title> ! <link rel="stylesheet" type="text/css" href="styles.css" /> </head> *************** *** 27,32 **** ]</p> ! <a href="javascript:history.back()"><img src="img/back.png" alt="Back" border="0"></a> ! <a href="{{APP_URL}}"><img src="img/home.png" alt="Home" border="0"></a> </body> </html> --- 31,36 ---- ]</p> ! <a href="javascript:history.back()"><img src="img/back.png" alt="Back" border="0" /></a> ! <a href="{{APP_URL}}"><img src="img/home.png" alt="Home" border="0" /></a> </body> </html> Index: page1.html =================================================================== RCS file: /cvsroot/phpwebapp/app1/page1.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** page1.html 25 Aug 2003 14:07:01 -0000 1.4 --- page1.html 20 Jul 2004 17:27:34 -0000 1.5 *************** *** 1,6 **** ! <html> <head> <title>Page 1</title> ! <link rel="stylesheet" type="text/css" href="styles.css"> <script language="javascript" type="text/javascript"> function on_test() --- 1,10 ---- ! <?xml version="1.0" encoding="iso-8859-1"?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ! "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ! ! <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> <head> <title>Page 1</title> ! <link rel="stylesheet" type="text/css" href="styles.css" /> <script language="javascript" type="text/javascript"> function on_test() *************** *** 30,34 **** <div align="center"> <img src="img/state_diagram.png" ! alt="A state diagram that represents three pages of the application as three states"> </div> --- 34,38 ---- <div align="center"> <img src="img/state_diagram.png" ! alt="A state diagram that represents three pages of the application as three states" /> </div> *************** *** 55,60 **** ]</p> ! <a href="javascript:history.back()"><img src="img/back.png" alt="Back" border="0"></a> ! <a href="{{APP_URL}}"><img src="img/home.png" alt="Home" border="0"></a> </body> </html> --- 59,64 ---- ]</p> ! <a href="javascript:history.back()"><img src="img/back.png" alt="Back" border="0" /></a> ! <a href="{{APP_URL}}"><img src="img/home.png" alt="Home" border="0" /></a> </body> </html> Index: external_page.html =================================================================== RCS file: /cvsroot/phpwebapp/app1/external_page.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** external_page.html 25 Aug 2003 14:07:01 -0000 1.4 --- external_page.html 20 Jul 2004 17:27:34 -0000 1.5 *************** *** 1,3 **** ! <html> <head> <title>External Page</title> --- 1,7 ---- ! <?xml version="1.0" encoding="iso-8859-1"?> ! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ! "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ! ! <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> <head> <title>External Page</title> *************** *** 28,32 **** <a href="javascript:history.back()"> ! <img src="img/back.png" alt="Back" border="0"> </a> </body> --- 32,36 ---- <a href="javascript:history.back()"> ! <img src="img/back.png" alt="Back" border="0" /> </a> </body> |
From: Dashamir H. <das...@us...> - 2004-07-20 17:26:18
|
Update of /cvsroot/phpwebapp/web_app/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14005/parser Modified Files: class.Parser.php Log Message: Index: class.Parser.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.Parser.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** class.Parser.php 15 Jul 2004 13:36:13 -0000 1.12 --- class.Parser.php 20 Jul 2004 17:26:09 -0000 1.13 *************** *** 227,231 **** $type = $this->current_tpl->type; ! while ($type!='FileTpl' and $type!='WebObjectTpl') { $tpl = $this->pop_current_tpl(); --- 227,231 ---- $type = $this->current_tpl->type; ! while ($type!='MainTpl' and $type!='FileTpl' and $type!='WebObjectTpl') { $tpl = $this->pop_current_tpl(); |
From: Dashamir H. <das...@us...> - 2004-07-20 16:51:23
|
Update of /cvsroot/phpwebapp/web_app/convert In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6986/convert Added Files: convert.php class.Template.php class.Render.php class.Parser.php README Log Message: converting old templates for the new version of the framework (which requires XML templates) --- NEW FILE: convert.php --- #!/usr/bin/php -q <?php include 'class.Template.php'; include 'class.Parser.php'; include 'class.Render.php'; $tpl_collection = array(); $parser = new Parser; $render = new Render; for ($i=1; $i < $argc; $i++) { $fname = $argv[$i]; print "$fname\n"; $tpl = $parser->parse_file($fname); $render->render_tpl($tpl); $tpl_str = $render->get_result(); $tpl_str = reformat($tpl_str); //backup and write the file print shell_exec("cp $fname $fname.orig"); $fp = fopen($fname, 'w'); fputs($fp, $tpl_str); fclose($fp); //print $tpl_str; } function reformat($str) { $str = str_replace('<>', '!=', $str); //match any starting or ending tag and make it lowercase $pattern = '#</?(\w+)[^<>]*>#'; $str = preg_replace_callback($pattern, 'lowercase', $str); //handle empty tags $empty_tag = '(br|hr|img|input|meta|link|include|parameter)'; $pattern = '#(<'.$empty_tag.'([^>]*[^/])?)>#'; $str = preg_replace($pattern, '$1 />', $str); //match any attribute name and make it lowercase $pattern = '#\s+(\w+)\s*=\s*(["\'])[^"\']*["\']#'; $str = preg_replace_callback($pattern, 'lowercase', $str); //replace {{checked}} by checked="{{checked}}" $pattern = '#(<input[^<>]+type=.checkbox[^<>]+\s)(\{\{[^\}]+\}\})#'; $str = preg_replace($pattern, '${1}checked="$2"', $str); //replace {{selected}} by selected="{{selected}}" $pattern = '#(<option[^<>]+)(\{\{[^\}]+\}\})#'; $str = preg_replace($pattern, '${1}selected="$2"', $str); return $str; } function lowercase($matches) { $str = str_replace($matches[1], strtolower($matches[1]), $matches[0]); return $str; } ?> --- NEW FILE: class.Template.php --- <?php class Template { var $id; var $type; var $contents; /** Constructor */ function Template($type ="Template") { static $default_id = "Template_001"; $this->id = $default_id++; $this->type = $type; $this->contents = array(); } } ?> --- NEW FILE: class.Render.php --- <?php class Render { var $result; function Render() { $this->result = ''; } function get_result() { $result = $this->result; $this->result = ''; return $result; } /** Renders the given template including all subtemplates. */ function render_tpl($tpl) { global $tpl_collection;; $i = 0; while ($i < sizeof($tpl->content)) { $line = $tpl->content[$i++]; if (chop($line)<>"##") { $this->result .= $line; } else //subtemplate indicator found { //get the subtemplate $line = $tpl->content[$i++]; $subtpl_id = trim($line); $subtpl = $tpl_collection[$subtpl_id]; //render the subtemplate if ($subtpl->type=='RepeatTpl') $this->render_RepeatTpl($subtpl); else $this->render_tpl($subtpl); } } } function render_RepeatTpl($tpl) { //decrease the indentation of header $header = $tpl->header; for ($i=0; $i < sizeof($header->content); $i++) { $line = $header->content[$i]; $line = ereg_replace('^ ', '', $line); $header->content[$i] = $line; } //decrease the indentation of footer $footer = $tpl->footer; for ($i=0; $i < sizeof($footer->content); $i++) { $line = $footer->content[$i]; $line = ereg_replace('^ ', '', $line); $footer->content[$i] = $line; } //increase the indentation of <Repeat> and <RepeatBody> for ($i=0; $i < sizeof($tpl->content); $i++) { $line = $tpl->content[$i]; if (ereg('^ *</?Repeat', $line)) { $tpl->content[$i] = ' '.$line; } } $this->render_tpl($header); $this->render_tpl($tpl); $this->render_tpl($footer); } } ?> --- NEW FILE: class.Parser.php --- <?php class Parser { /** A stack of templates that are being parsed. */ var $tpl_stack; /** The template that is being parsed currently. */ var $current_tpl; /** file pointer */ var $fp; function Parser() { $this->tpl_stack = array(); $this->current_tpl = UNDEFINED; } function parse_file($filename) { if ( !file_exists($filename) ) { print "'$filename' not found\n"; return UNDEFINED; } $tpl = new Template; $this->fp = fopen($filename, "r"); //open file //parse the file into $tpl $this->push($tpl); $this->parse(); $tpl = $this->pop(); //close the file fclose($this->fp); return $tpl; } /** * Loads the current template from * the file that is being parsed currently. */ function parse() { $closing_tag = false; while (!$closing_tag and !feof($this->fp)) { $line = $this->get_line(); if ($line=='') continue; $closing_tag = $this->parse_line($line); } } /** * Return true when the line is the closing tag of a template; * if the line contains the opening tag of another template, call * a function to parse this template, else add the line to the * current template. */ function parse_line($line) { $tag = Parser::get_tag_name($line); switch ($tag) { default: $this->add_line($line); break; case "<Repeat": $this->parse_Repeat($line); break; case "</Repeat": $this->add_line($line); return true; break; case "<Header": case "<Footer": $this->parse_Repeat_subtpl($line); break; case "</Header": case "</Footer": return true; break; } return false; } /** * Make the given $tpl current, what will be * parsed from now on goes to this template. */ function push(&$tpl) { //push the current_tpl on tpl_stack array_push($this->tpl_stack, $this->current_tpl); //make current the new template $this->current_tpl = &$tpl; } /** * The parsing of the current template has finished; * make current the top of the stack. */ function pop() { //pop the last template from tpl_stack into current_tpl $tpl = $this->current_tpl; $last = count($this->tpl_stack) - 1; $this->current_tpl = &$this->tpl_stack[$last]; array_pop($this->tpl_stack); //add the template in the template collection global $tpl_collection; $tpl_collection[$tpl->id] = $tpl; return $tpl; } function parse_Repeat($line) { $tpl = new Template('RepeatTpl'); $tpl->header = new Template; $tpl->footer = new Template; //set a pointer from this template to the new template $this->add_line("##\n"); $this->add_line($tpl->id."\n"); //parse the new template into $tpl $this->push($tpl); $this->add_line($line); $this->parse(); $this->pop(); } /** Parse <Header> and <Footer> */ function parse_Repeat_subtpl($line) { $tag = Parser::get_tag_name($line); $tag = substr($tag, 1); $tpl = new Template; $this->push($tpl); $this->parse(); $tpl = $this->pop(); switch ($tag) { case "Header": $this->current_tpl->header = $tpl; break; case "Footer": $this->current_tpl->footer = $tpl; break; } } /** returns a line from the file that is being parsed */ function get_line() { $line = fgets($this->fp,896); return $line; } /** add a line to the current template */ function add_line($line) { $this->current_tpl->content[] = $line; } /** * If the $line starts with an opening or closing tag * ('<tag_name' or '</tag_name') then it returns it, * otherwise returns UNDEFINED. */ function get_tag_name($line) { $line = trim($line); if ( ereg("^(</?[^[:space:] >]*)", $line, $regs) ) { return $regs[1]; } else { return UNDEFINED; } } /** * Returns the value of the given attribute from the given * line (assuming that the line is a start element), or * UNDEFINED if not found. */ function get_attr_value($line, $attrib) { $line = trim($line); $pattern = '[[:space:]]+'.$attrib.'[[:space:]]*=[[:space:]]*"([^"]*)"'; if ( ereg($pattern, $line, $regs) ) { $attr = $regs[1]; return $attr; } else { return UNDEFINED; } } } ?> --- NEW FILE: README --- The PHP script 'convert.php' (which includes also 'class.Template.php', 'class.Parser.php' and 'class.Render.php') is used to convert the templates of an existing web_app application for use with the new version of the framework. What is does is this: - Removes the elements <Header> and <Footer> from the <Repeat> element and puts their contents respectivly before and after the <Repeat> element. - Replaces 'not-equal operator' '<>' by '!='. - Makes all the tags lowercase. - Makes all the names of the attributes lowercase. - Replaces: <input type="checkbox" {{checked}}> by <input type="checkbox" checked="{{checked}}"> and <option {{selected}}> by <option selected="{{selected}}"> It can be used like this: $ ./convert.sh ../templates/*.html $ find ../templates/ -name '*.html' | xargs ./convert.sh After a template is converted, it is saved with the same name, however it is copied first to the backup file filename.orig (e.g. page.html.orig). After making sure that all the templates are converted successfully, the backup files can be deleted with the command: $ find ../templates/ -name '*.html.orig' -exec rm {} \; All the backup files can be restored like this: $ find ../templates/ -name '*.html' -exec cp {}.orig {} \; |
From: Dashamir H. <das...@us...> - 2004-07-20 16:49:42
|
Update of /cvsroot/phpwebapp/web_app/convert In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6524/convert Log Message: Directory /cvsroot/phpwebapp/web_app/convert added to the repository |
From: Dashamir H. <das...@us...> - 2004-07-16 14:45:23
|
Update of /cvsroot/phpwebapp/web_app/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27618/doc Modified Files: to_do.txt changes.txt Log Message: Index: to_do.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/to_do.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** to_do.txt 16 Jul 2004 07:37:05 -0000 1.6 --- to_do.txt 16 Jul 2004 14:45:14 -0000 1.7 *************** *** 1,11 **** - * Parse the templates using an XML parser. - - - Use 'tidy' or any shell scripts for converting from HTML to XHTML. - After this, use an XSLT transformer to reformat the templates - properly. - This script should convert tags like <br>, <hr>, <input> etc. - to <br/>, <hr/>, <input/> etc. Some other things that may need - to be converted are: <li>, <option>, checked, nowrap, , - <img>, etc. - Use the new framework with the other web applications (app1, --- 1,2 ---- *************** *** 20,21 **** --- 11,50 ---- - Make a new release of phpwebapp that includes the latest changes in the parser any improvments in the docs, etc. + + ---------------------------------------------------------------------- + + * When switching an existing web application to the new version + of the framework (with the xml parser), these modifications + need to be done to the templates: + + 1 - Find and remove all <Header> and <Footer> tags and place their + contents outside the <Repeat> element. In case that the + recordset of the <Repeat> is a paged recordset and page variables + ({{PrevPage}}, {{NextPage}} etc.) are used for navigation, + then put the navigation part of the template inside the element + <RSNavig>. + + 2 - Replace 'not-equal operator' <> by !=, in the condition of <If> + elements: <If condition="'{{CurrPage}}'<>'{{PrevPage}}'"> + This can be done automatically by a script. + + 3 - Replace the old usage of 'checked' in checkboxes with the new + usage; replace {{checked_var}} with checked="{{checked_var}}". + Do the same for the 'selected' attribute of the listboxes: + replace {{selected_var}} with selected="{{selected_var}}" + + 4 - Use 'tidy' (with some appropriate options) to convert all the + templates to clean XHTML code (convert all tags and attributes + to lowercase, replace <img...> by <img ... />, etc.). + A script would be usefull for this. + + 5 - In case that some formating of tidy is not satisfactory, then + use an XSLT transformer(stylesheet) and xsltproc to convert + the templates to a better formating. + + 6 - Add these lines at the beginning of the root templates: + <?xml version="1.0" encoding="iso-8859-1"?> + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> + Index: changes.txt =================================================================== RCS file: /cvsroot/phpwebapp/web_app/doc/changes.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** changes.txt 16 Jul 2004 07:37:06 -0000 1.6 --- changes.txt 16 Jul 2004 14:45:14 -0000 1.7 *************** *** 31,42 **** ------------------------------------------------------------------- * <Repeat> syntax changed. There was a problem with the <Header>/<Footer> tags, because the contents of the <Header> usually is not well-formed xml and ! it breaks the xml parsing. E.g. it may be something like this: <repeat rs="rs_id"> <header> ! <table> </header> <tr><td>{{xyz}}</td></tr> --- 31,61 ---- ------------------------------------------------------------------- + * The main (root) template should start like this: + + <?xml version="1.0" encoding="iso-8859-1"?> + <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" lang="EN"> + + because if no DOCTYPE is defined, the parser will have problems + with reckognizing entities ( & etc.), and there may + be any other problems as well. + + For the other templates, however, these headers shoud not be + added, because the parser will add them automatically to them, + so that they become well-formed xml and are parsed successfully. + The headers that will be added to the other templates will be + a copy of the headers of the main template. + + ------------------------------------------------------------------- + * <Repeat> syntax changed. There was a problem with the <Header>/<Footer> tags, because the contents of the <Header> usually is not well-formed xml and ! it breaks the parser. E.g. it may be something like this: <repeat rs="rs_id"> <header> ! <table> <---- not well-formed XML </header> <tr><td>{{xyz}}</td></tr> *************** *** 63,66 **** --- 82,123 ---- ------------------------------------------------------------------- + * This is wrong: <If condition="'{{CurrPage}}'<>'{{PrevPage}}'"> + This is right: <If condition="'{{CurrPage}}'!='{{PrevPage}}'"> + because the xml parser complains about the characters < and > + inside the value of an attribute. + + ------------------------------------------------------------------- + + * In order to put a check in a checkbox according to the value of + some state variable, framework used something like this: + <input type="checkbox" name="all_books" {{all_books}} + onclick="set_chkbox(this)> + where the variable {{all_books}} has a value of 'checked' or ''. + + This is not well-formed XHTML and it breaks the xml parser, + because, instead of {{all_books}} the parser expects an attribute + name and value. + + In XHTML this attribute should be used like this: checked="checked". + However, doing it like this: + <input type="checkbox" name="all_books" checked="{{all_books}}" + onclick="set_chkbox(this)> + would not solve the problem, because the browser will check the + checkbox no matter what is the value of the checked attribute; + the presense of the 'checked' attribute is enough for the browser + to check the checkbox. + + In order to solve this problem, the framework, when it renders the + HTML page, replaces 'checked=""' with empty (removes it). + It also removes: checked="no" and checked="false". On the other hand, + it replaces checked="yes" and checked="true" by checked="checked", + so that the output complies with XHTML. + + The same thing is done for: selected="selected", selected="", + selected="yes", selected="no", selected="true" and selected="false". + + ------------------------------------------------------------------- + ------------------------------------------------------------------- + * Added the tag <example>. It can be used like this: *************** *** 90,102 **** ------------------------------------------------------------------- - * - This is wrong: <If condition="'{{CurrPage}}'<>'{{PrevPage}}'"> - This is right: <If condition="'{{CurrPage}}'!='{{PrevPage}}'"> - because the xml parser complains about the characters < and > - inside the value of an attribute. - - ------------------------------------------------------------------- - - ------------------------------------------------------------------- - ------------------------------------------------------------------- - ------------------------------------------------------------------- ------------------------------------------------------------------- --- 147,149 ---- |
Update of /cvsroot/phpwebapp/web_app/boxes/menu/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20494/boxes/menu/edit Added Files: edit_menu.css edit_menu.html edit_menu.js edit_menu.php menu.xml menu_items.js menu_items.php menu_tpl.js Log Message: --- NEW FILE: edit_menu.css --- #menu_place { height: 30px; } .item { margin: 1px; margin-bottom: 3px; padding: 2px 5px; background-color: #dddddd; } .subitem { margin: 1px; padding: 2px 5px; padding-left: 20px; background-color: #eeeeee; } --- NEW FILE: edit_menu.html --- <WebBox ID="edit_menu"> <div id="menu_place"></div> <form name="edit_menu" onsubmit="return false;"> <table> <tr> <td class="item"> ID:<input type="text" name="item_id" value="{{item_id}}"> Caption:<input type="text" name="item_caption" value="{{item_caption}}"> </td> <td> <a class="button" href="javascript:update()">Update</a> <a class="button" href="javascript:del()">Delete</a> </td> </tr> <Repeat rs="subitems"> <tr> <td class="subitem"> <li/> <a href="javascript:edit('{{id}}')">{{caption}}</a> </td> <td> <a class="button" href="javascript:move_up('{{id}}')">Move Up</a> <a class="button" href="javascript:move_down('{{id}}')">Move Down</a> </td> </tr> </Repeat> <tr> <td class="subitem"> id:<input type="text" name="new_id" value=""> caption:<input type="text" name="new_caption" value=""> </td> <td> <a class="button" href="javascript:add_subitem()">Add Subitem</a> </td> </tr> </table> </form> <div> <a class="button" href="javascript:apply()">Apply Changes</a> <a class="button" href="javascript:cancel()">Cancel Changes</a> <a class="button" href="javascript:close()">Close</a> </div> </WebBox> --- NEW FILE: edit_menu.js --- // -*-C-*- /* This file is part of SMEWebApp. SMEWebApp is a web application that helps the informatization of small and medium enterprises. Copyright 2003, 2004 Dashamir Hoxha, dh...@in... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ function edit(menu_item) { SendEvent('edit_menu', 'select', 'item_id='+menu_item); } function update() { var form = document.edit_menu; var new_id = form.item_id.value; var new_caption = form.item_caption.value; if (new_id=='') { alert('ID cannot be empty.'); form.item_id.focus(); return false; } if (new_caption=='') { alert('Caption cannot be empty.'); form.item_caption.focus(); return false; } var event_args = 'new_id='+new_id+';new_caption='+new_caption; SendEvent('edit_menu', 'update', event_args); } function del() { var msg = 'You are deleting this item and all its subitems.'; if (confirm(msg)) { SendEvent('edit_menu', 'delete'); } } function move_up(item_id) { SendEvent('edit_menu', 'move_up', 'item_id='+item_id); } function move_down(item_id) { SendEvent('edit_menu', 'move_down', 'item_id='+item_id); } function add_subitem() { var form = document.edit_menu; var new_id = form.new_id.value; var new_caption = form.new_caption.value; if (new_id=='') { alert('Please fill the ID field.'); form.new_id.focus(); return false; } if (new_caption=='') { alert('Please fill the Caption field.'); form.new_caption.focus(); return false; } var event_args = 'new_id='+new_id+';new_caption='+new_caption; SendEvent('edit_menu', 'add_subitem', event_args); } function apply() { var msg = 'This will copy the modified menu to the main menu.'; if (confirm(msg)) { SendEvent('edit_menu', 'apply'); } } function cancel() { var msg = 'This will get a fresh copy of the main menu,' +' discarding any modifications'; if (confirm(msg)) { SendEvent('edit_menu', 'cancel'); } } function close() { //display the docbook webbox SendEvent('main', 'docbook'); } --- NEW FILE: edit_menu.php --- <?php class edit_menu extends WebObject { function init() { //the menu item that is being edited, initially the root $this->addSVar('item_id', 'menu'); } /** select an item for editing */ function on_select($event_args) { $item_id = $event_args['item_id']; $this->setSVar('item_id', $item_id); } function transform_menu($transformer, $arr_params =array()) { //apply the transformer and get the new menu $new_menu = $this->transform($transformer, $arr_params); //save the transformed menu to a tmp file $tmpfname = tempnam("/tmp", "menu"); $fp = fopen($tmpfname, 'w'); fputs($fp, $new_menu); fclose($fp); //move to menu.xml and set permissions $menu_xml = MENU.'edit/menu.xml'; shell_exec("./wrapper mv $tmpfname $menu_xml"); shell_exec("./wrapper chown dasho.dasho $menu_xml"); shell_exec("./wrapper chmod 664 $menu_xml"); } /** * Applies the given xsl transformer to menu.xml and returns * the result. $arr_params is an associative array of parameters. */ function transform($transformer, $arr_params =array()) { //construct the string $params $params = ''; while (list($p_name, $p_value) = each($arr_params)) { $params .= "--stringparam $p_name \"$p_value\" "; } //apply the $transformer with $params to menu.xml $menu_xml = MENU.'edit/menu.xml'; $xsl_file = MENU."edit/xsl/$transformer"; $result = shell_exec("xsltproc $params $xsl_file $menu_xml 2>&1"); //print "<xmp>$result</xmp>\n"; return $result; } /** save modifications in id and caption of the current item */ function on_update($event_args) { //if the id has changed, check that the new id does not exist $item_id = $this->getSVar('item_id'); $new_id = $event_args['new_id']; $output = $this->transform('get_id.xsl', array('id'=>$new_id)); if ($new_id <> $item_id and $output==$new_id) { WebApp::message("Another menu item with id '$new_id' already exists."); return; } $params = $event_args; $params['id'] = $item_id; $this->transform_menu('update.xsl', $params); $this->setSVar('item_id', $new_id); } /** delete the current item and set the parent item as the current one */ function on_delete($event_args) { $params['id'] = $this->getSVar('item_id'); $parent_id = $this->transform('get_parent_id.xsl', $params); $this->transform_menu('delete.xsl', $params); $this->setSVar('item_id', $parent_id); } /** move the current item up */ function on_move_up($event_args) { $params['id'] = $event_args['item_id']; $this->transform_menu('move_up.xsl', $params); } /** move the current item down */ function on_move_down($event_args) { $params['id'] = $event_args['item_id']; $this->transform_menu('move_down.xsl', $params); } /** add a new subitem to the current item */ function on_add_subitem($event_args) { //check that the new id does not exist $new_id = $event_args['new_id']; $output = $this->transform('get_id.xsl', array('id'=>$new_id)); if ($output==$new_id) { WebApp::message("Another menu item with id '$new_id' already exists."); return; } $params = $event_args; $params['id'] = $this->getSVar('item_id'); $this->transform_menu('add_subitem.xsl', $params); } /** apply the modifications to the main menu */ function on_apply($event_args) { $menu_xml = MENU.'menu.xml'; $edit_menu_xml = MENU.'edit/menu.xml'; shell_exec("./wrapper cp $edit_menu_xml $menu_xml"); //get menu_items.js $menu_items = $this->transform('menu_items.xsl'); //save it to a tmp file $tmpfname = tempnam("/tmp", "menu"); $fp = fopen($tmpfname, 'w'); fputs($fp, $menu_items); fclose($fp); //move to menu_items.js and set permissions $menu_items_js = MENU.'menu_items.js'; shell_exec("./wrapper mv $tmpfname $menu_items_js"); shell_exec("./wrapper chown dasho.dasho $menu_items_js"); shell_exec("./wrapper chmod 664 $menu_items_js"); //get book_list.php $book_list = $this->transform('book_list.xsl'); //save it to a tmp file $tmpfname = tempnam("/tmp", "menu"); $fp = fopen($tmpfname, 'w'); fputs($fp, $book_list); fclose($fp); //move to book_list_php and set permissions $book_list_php = MENU.'book_list.php'; shell_exec("./wrapper mv $tmpfname $book_list_php"); shell_exec("./wrapper chown dasho.dasho $book_list_php"); shell_exec("./wrapper chmod 664 $book_list_php"); } /** discard any modifications and get a copy of the main menu */ function on_cancel($event_args) { $menu_xml = MENU.'menu.xml'; $edit_menu_xml = MENU.'edit/menu.xml'; shell_exec("./wrapper cp $menu_xml $edit_menu_xml"); } function onRender() { //this variable makes visible the edit menu in menu.html WebApp::addGlobalVar('edit_menu_visible', 'true'); $item_id = $this->getSVar('item_id'); //get the selected item and subitems $items = $this->transform('subitems.xsl', array('id'=>$item_id)); $arr_lines = explode("\n", $items); //get the caption of the selected item (from the first line) list($id, $item_caption) = split(' ', $arr_lines[0], 2); WebApp::addVar('item_caption', $item_caption); //create a recordset with id-s and captions of the subitems $rs = new EditableRS('subitems'); for ($i=1; $i < sizeof($arr_lines); $i++) { list($id, $caption) = split(' ', $arr_lines[$i], 2); if ($id=='') continue; $rs->addRec(compact('id','caption')); } global $webPage; $webPage->addRecordset($rs); } } ?> --- NEW FILE: menu.xml --- <?xml version="1.0" encoding="iso-latin-1" standalone="no"?> <menu id="menu"> <item id="technical" caption="Technical Books" link="null"> <item id="docbookwiki_guide" caption="DocBookWiki Guide"/> <item id="linux_server_admin" caption="Becoming a Linux Server Admin"/> <item id="book3" caption="Book 3"/> <item id="book4" caption="Book 4"/> </item> <item id="nontechnical" caption="Non-technical Books" link="null"> <item id="legislation" caption="Legislation and Law" link="null"> <item id="kushtetuta" caption="Kushtetuta e Shqiperise"/> <item id="kushtetuta_it" caption="La Costituzione Albanese"/> </item> <item id="cat2_sub2" caption="Subcategory 2" link="null"> <item id="cat2_sub2_book1" caption="Book 1"/> <item id="cat2_sub2_book2" caption="Book 2"/> <item id="test1" caption="test1"/> <item id="test2" caption="test 3"/> </item> <item id="cat2_sub3" caption="Subcategory 3" link="null"> <item id="cat2_sub3_book1" caption="Book 1"/> <item id="cat2_sub3_book2" caption="Book 2"/> </item> </item> <item id="category_3" caption="Book Category 3" link="null"> <item id="cat3_sub1" caption="Subcategory 1" link="null"> <item id="cat3_sub1_book1" caption="Book 1"/> <item id="cat3_sub1_book2" caption="Book 2"/> </item> <item id="cat3_sub2" caption="Subcategory 2" link="null"> <item id="cat3_sub2_book1" caption="Book 1"/> <item id="cat3_sub2_book2" caption="Book 2"/> </item> </item> <item id="category_4" caption="Book Category 4" link="null"> <item id="cat4_sub1" caption="Subcategory 1" link="null"> <item id="cat4_sub1_book1" caption="Book 1"/> <item id="cat4_sub1_book2" caption="Book 2"/> </item> <item id="cat4_sub2" caption="Subcategory 2" link="null"> <item id="cat4_sub2_book1" caption="Book 1"/> <item id="cat4_sub2_book2" caption="Book 2"/> </item> </item> <item id="category_5" caption="Book Category 5" link="null"> <item id="cat5_sub1" caption="Subcategory 1" link="null"> <item id="cat5_sub1_book1" caption="Book 1"/> <item id="cat5_sub1_book2" caption="Book 2"/> </item> <item id="cat5_sub2" caption="Subcategory 2" link="null"> <item id="cat5_sub2_book1" caption="Book 1"/> <item id="cat5_sub2_book2" caption="Book 2"/> </item> </item> </menu> --- NEW FILE: menu_items.js --- // -*-C-*- //tell emacs to use the C mode var EDIT_MENU_ITEMS = [ ['Botimet', 'javascript:edit(\'botimet\')', null, ['Listo Kartat', 'javascript:edit(\'botimet/kartat/listo\')', null], ['Krijo Karte', 'javascript:edit(\'botimet/kartat/krijo\')', null], ['Listo Kontratat', 'javascript:edit(\'botimet/kontratat/listo\')', null], ['Krijo Kontrate', 'javascript:edit(\'botimet/kontratat/krijo\')', null], ], ['Buletinet', 'javascript:edit(\'buletinet\')', null, ['Ofseti', 'javascript:edit(\'ofseti\')', null, ['Listo', 'javascript:edit(\'buletinet/offseti/listo\')', null], ['Krijo', 'javascript:edit(\'buletinet/offseti/krijo\')', null], ], ['Parapregatitja', 'javascript:edit(\'parapregatitja\')', null, ['Listo', 'javascript:edit(\'buletinet/parapreg/listo\')', null], ['Krijo', 'javascript:edit(\'buletinet/parapreg/krijo\')', null], ], ['Liberlidhja', 'javascript:edit(\'liberlidhja\')', null, ['Listo', 'javascript:edit(\'buletinet/lidhja/listo\')', null], ['Krijo', 'javascript:edit(\'buletinet/lidhja/krijo\')', null], ], ], ['Magazina', 'javascript:edit(\'magazina\')', null, ['Leter', 'javascript:edit(\'leter\')', null, ['Listo Faturat', 'javascript:edit(\'magazina/leter/faturat\')', null], ['Bej Hyrje', 'javascript:edit(\'magazina/leter/hyrje\')', null], ['Bej Dalje', 'javascript:edit(\'magazina/leter/dalje\')', null], ['Gjendja', 'javascript:edit(\'magazina/leter/gjendja\')', null], ], ['Boje', 'javascript:edit(\'boje\')', null, ['Listo Faturat', 'javascript:edit(\'magazina/tjeter/faturat\')', null], ['Bej Hyrje', 'javascript:edit(\'magazina/tjeter/hyrje\')', null], ['Bej Dalje', 'javascript:edit(\'magazina/tjeter/dalje\')', null], ['Gjendja', 'javascript:edit(\'magazina/tjeter/gjendja\')', null], ], ], ['Raportet', 'javascript:edit(\'raportet\')', null, ['Shpenzimet', 'javascript:edit(\'shpenzimet\')', null, ['Permbledhese', 'javascript:edit(\'rpt_shpenzimet\')', null], ['Sasi', 'javascript:edit(\'sasi\')', null, ['Parapregatitja', 'javascript:edit(\'rpt_shpenzimet/sasi/parapreg\')', null], ['Offseti', 'javascript:edit(\'rpt_shpenzimet/sasi/offseti\')', null], ['Liberlidhja', 'javascript:edit(\'rpt_shpenzimet/sasi/lidhja\')', null], ['Te Gjitha', 'javascript:edit(\'rpt_shpenzimet/sasi\')', null], ], ['Vlere', 'javascript:edit(\'vlere\')', null, ['Parapregatitja', 'javascript:edit(\'rpt_shpenzimet/vlere/parapreg\')', null], ['Offseti', 'javascript:edit(\'rpt_shpenzimet/vlere/offseti\')', null], ['Liberlidhja', 'javascript:edit(\'rpt_shpenzimet/vlere/lidhja\')', null], ['Te Gjitha', 'javascript:edit(\'rpt_shpenzimet/vlere\')', null], ], ['Sasi-Vlere', 'javascript:edit(\'sasi-vlere\')', null, ['Parapregatitja', 'javascript:edit(\'rpt_shpenzimet/sasi_vlere/parapreg\')', null], ['Offseti', 'javascript:edit(\'rpt_shpenzimet/sasi_vlere/offseti\')', null], ['Liberlidhja', 'javascript:edit(\'rpt_shpenzimet/sasi_vlere/lidhja\')', null], ['Te Gjitha', 'javascript:edit(\'rpt_shpenzimet/sasi_vlere\')', null], ], ], ['Puna e Kryer', 'javascript:edit(\'rpt_punet\')', null, ['Parapregatitja', 'javascript:edit(\'rpt_punet/parapreg\')', null], ['Offseti', 'javascript:edit(\'rpt_punet/offseti\')', null], ['Liberlidhja', 'javascript:edit(\'rpt_punet/lidhja\')', null], ['Permbledhese', 'javascript:edit(\'rpt_punet/permbledhese\')', null], ], ], ['Koeficientet', 'javascript:edit(\'koeficientet\')', null, ['Teknologjike', 'javascript:edit(\'teknologjike\')', null, ['Parapregatitja', 'javascript:edit(\'koeficientet/parapreg\')', null], ['Offseti', 'javascript:edit(\'koeficientet/offseti\')', null], ['Liberlidhja', 'javascript:edit(\'koeficientet/lidhja\')', null], ], ['Financiare', 'javascript:edit(\'koeficientet/financiare\')', null], ], ['Administrim', 'javascript:edit(\'administrim\')', null, ['Perdoruesit', 'javascript:edit(\'perdoruesit\')', null], ['Punetoret', 'javascript:edit(\'punetoret\')', null], ['Punetor Paraperg.', 'javascript:edit(\'punetoret/parapreg\')', null], ['Punetor Offseti', 'javascript:edit(\'punetoret/offseti\')', null], ['Punetor Liberlidhje', 'javascript:edit(\'punetoret/lidhja\')', null], ['Backup/Restore', 'javascript:edit(\'backup_restore\')', null], ['Tabelat', 'javascript:edit(\'tabelat\')', null], ], ]; --- NEW FILE: menu_items.php --- <?php passthru("xsltproc xsl/edit_menu_items.xsl menu.xml"); ?> --- NEW FILE: menu_tpl.js --- // -*-C-*- //tell emacs to use the C mode var EDIT_MENU_POS = [ { // item sizes 'width': 120, 'height': 18, // menu block offset from the origin: // for root level origin is upper left corner of the page // for other levels origin is upper left corner of parent item 'block_top': 70, 'block_left': 140, // offsets between items of the same level 'top': 0, 'left': 82, // time in milliseconds before menu is hidden after cursor has gone out // of any items 'hide_delay': 200, 'css' : { 'inner' : 'minner', 'outer' : ['moout', 'moover', 'modown'] } }, { 'width': 128, 'height': 18, 'block_top': 20, 'block_left': 50, 'top': 20, 'left': 0, }, { 'width': 188, 'block_top': 3, 'block_left': 120 }, { 'block_left': 180 } ]; |
From: Dashamir H. <das...@us...> - 2004-07-16 07:41:48
|
Update of /cvsroot/phpwebapp/web_app/boxes/menu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20494/boxes/menu Added Files: book_list.php menu.css menu.html menu.js menu.xml menu_items.js menu_tpl.js Log Message: --- NEW FILE: book_list.php --- <?php /** * This file contains an array with the list of books and their titles. */ $arr_books = array( "docbookwiki_guide" => "DocBookWiki Guide", "linux_server_admin" => "Becoming a Linux Server Admin", "book3" => "Book 3", "book4" => "Book 4", "kushtetuta" => "Kushtetuta e Shqiperise", "kushtetuta_it" => "La Costituzione Albanese", "cat2_sub2_book1" => "Book 1", "cat2_sub2_book2" => "Book 2", "test1" => "test1", "test2" => "test 3", "cat2_sub3_book1" => "Book 1", "cat2_sub3_book2" => "Book 2", "cat3_sub1_book1" => "Book 1", "cat3_sub1_book2" => "Book 2", "cat3_sub2_book1" => "Book 1", "cat3_sub2_book2" => "Book 2", "cat4_sub1_book1" => "Book 1", "cat4_sub1_book2" => "Book 2", "cat4_sub2_book1" => "Book 1", "cat4_sub2_book2" => "Book 2", "cat5_sub1_book1" => "Book 1", "cat5_sub1_book2" => "Book 2", "cat5_sub2_book1" => "Book 1", "cat5_sub2_book2" => "Book 2", ); ?> --- NEW FILE: menu.css --- /* all levels inner */ .minner { font-family: Tahoma, Verdana, sans-serif; font-size: 12px; text-decoration : none; white-space: nowrap; padding: 2px 4px; } /* all levels, all states, outer */ .moout { text-decoration : none; border : 1px outset #ffffff; color: #000066; background: #dddddd; border: 1px outset #ffffff; } .moover { text-decoration : none; border : 1px outset #ffffff; color: #000088; background: #eeeeee; } .modown { background: #eef9f9; border: 1px inset #ffffff; } --- NEW FILE: menu.html --- <WebBox ID="menu"> <script language="JavaScript" src="{{./}}menu_items.js"></script> <script language="JavaScript" src="{{./}}menu_tpl.js"></script> <script language="JavaScript"> new menu (MENU_ITEMS, MENU_POS); </script> <If condition="'{{edit_menu_visible}}'=='true'"> <script language="JavaScript" src="{{./}}edit/menu_items.php"></script> <script language="JavaScript" src="{{./}}edit/menu_tpl.js"></script> <script language="JavaScript"> new menu (EDIT_MENU_ITEMS, EDIT_MENU_POS); </script> </If> </WebBox> --- NEW FILE: menu.js --- // -*-C-*- //tell emacs to use the C mode // Title: tigra menu // Description: See the demo at url // URL: http://www.softcomplex.com/products/tigra_menu/ // Version: 2.0 (commented source) // Date: 04-05-2003 (mm-dd-yyyy) // Contact: fee...@so... (specify product title in the subject) // Tech. Support: http://www.softcomplex.com/forum/forumdisplay.php?fid=40 // Notes: This script is free. Visit official site for further details. // -------------------------------------------------------------------------------- // global collection containing all menus on current page var A_MENUS = []; // -------------------------------------------------------------------------------- // menu class function menu (a_items, a_tpl) { // browser check if (!document.body || !document.body.style) return; // store items structure this.a_config = a_items; // store template structure this.a_tpl = a_tpl; // get menu id this.n_id = A_MENUS.length; // declare collections this.a_index = []; this.a_children = []; // assigh methods and event handlers this.expand = menu_expand; this.collapse = menu_collapse; this.onclick = menu_onclick; this.onmouseout = menu_onmouseout; this.onmouseover = menu_onmouseover; this.onmousedown = menu_onmousedown; // default level scope description structure this.a_tpl_def = { 'block_top' : 16, 'block_left' : 16, 'top' : 20, 'left' : 4, 'width' : 120, 'height' : 22, 'hide_delay' : 0, 'expd_delay' : 0, 'css' : { 'inner' : '', 'outer' : '' } }; // assign methods and properties required to imulate parent item this.getprop = function (s_key) { return this.a_tpl_def[s_key]; }; this.o_root = this; this.n_depth = -1; this.n_x = 0; this.n_y = 0; // init items recursively for (n_order = 0; n_order < a_items.length; n_order++) new menu_item(this, n_order); // register self in global collection A_MENUS[this.n_id] = this; // make root level visible for (var n_order = 0; n_order < this.a_children.length; n_order++) this.a_children[n_order].e_oelement.style.visibility = 'visible'; } // -------------------------------------------------------------------------------- function menu_collapse (n_id) { // cancel item open delay clearTimeout(this.o_showtimer); // by default collapse to root level var n_tolevel = (n_id ? this.a_index[n_id].n_depth : 0); // hide all items over the level specified for (n_id = 0; n_id < this.a_index.length; n_id++) { var o_curritem = this.a_index[n_id]; if (o_curritem.n_depth > n_tolevel && o_curritem.b_visible) { o_curritem.e_oelement.style.visibility = 'hidden'; o_curritem.b_visible = false; } } // reset current item if mouse has gone out of items if (!n_id) this.o_current = null; } // -------------------------------------------------------------------------------- function menu_expand (n_id) { // expand only when mouse is over some menu item if (this.o_hidetimer) return; // lookup current item var o_item = this.a_index[n_id]; // close previously opened items if (this.o_current && this.o_current.n_depth >= o_item.n_depth) this.collapse(o_item.n_id); this.o_current = o_item; // exit if there are no children to open if (!o_item.a_children) return; // show direct child items for (var n_order = 0; n_order < o_item.a_children.length; n_order++) { var o_curritem = o_item.a_children[n_order]; o_curritem.e_oelement.style.visibility = 'visible'; o_curritem.b_visible = true; } } // -------------------------------------------------------------------------------- // // -------------------------------------------------------------------------------- function menu_onclick (n_id) { // don't go anywhere if item has no link defined return Boolean(this.a_index[n_id].a_config[1]); } // -------------------------------------------------------------------------------- function menu_onmouseout (n_id) { // lookup new item's object var o_item = this.a_index[n_id]; // apply rollout o_item.e_oelement.className = o_item.getstyle(0, 0); o_item.e_ielement.className = o_item.getstyle(1, 0); // update status line o_item.upstatus(7); // run mouseover timer this.o_hidetimer = setTimeout('A_MENUS['+ this.n_id +'].collapse();', o_item.getprop('hide_delay')); } // -------------------------------------------------------------------------------- function menu_onmouseover (n_id) { // cancel mouseoute menu close and item open delay clearTimeout(this.o_hidetimer); this.o_hidetimer = null; clearTimeout(this.o_showtimer); // lookup new item's object var o_item = this.a_index[n_id]; // update status line o_item.upstatus(); // apply rollover o_item.e_oelement.className = o_item.getstyle(0, 1); o_item.e_ielement.className = o_item.getstyle(1, 1); // if onclick open is set then no more actions required if (o_item.getprop('expd_delay') < 0) return; // run expand timer this.o_showtimer = setTimeout('A_MENUS['+ this.n_id +'].expand(' + n_id + ');', o_item.getprop('expd_delay')); } // -------------------------------------------------------------------------------- // called when mouse button is pressed on menu item // -------------------------------------------------------------------------------- function menu_onmousedown (n_id) { // lookup new item's object var o_item = this.a_index[n_id]; // apply mouse down style o_item.e_oelement.className = o_item.getstyle(0, 2); o_item.e_ielement.className = o_item.getstyle(1, 2); this.expand(n_id); // this.items[id].switch_style('onmousedown'); } // -------------------------------------------------------------------------------- // menu item Class function menu_item (o_parent, n_order) { // store parameters passed to the constructor this.n_depth = o_parent.n_depth + 1; this.a_config = o_parent.a_config[n_order + (this.n_depth ? 3 : 0)]; // return if required parameters are missing if (!this.a_config) return; // store info from parent item this.o_root = o_parent.o_root; this.o_parent = o_parent; this.n_order = n_order; // register in global and parent's collections this.n_id = this.o_root.a_index.length; this.o_root.a_index[this.n_id] = this; o_parent.a_children[n_order] = this; // calculate item's coordinates var o_root = this.o_root, a_tpl = this.o_root.a_tpl; // assign methods this.getprop = mitem_getprop; this.getstyle = mitem_getstyle; this.upstatus = mitem_upstatus; this.n_x = n_order ? o_parent.a_children[n_order - 1].n_x + this.getprop('left') : o_parent.n_x + this.getprop('block_left'); this.n_y = n_order ? o_parent.a_children[n_order - 1].n_y + this.getprop('top') : o_parent.n_y + this.getprop('block_top'); // generate item's HMTL document.write ( '<a id="e' + o_root.n_id + '_' + this.n_id +'o" class="' + this.getstyle(0, 0) + '" href="' + this.a_config[1] + '"' + (this.a_config[2] && this.a_config[2]['tw'] ? ' target="' + this.a_config[2]['tw'] + '"' : '') + ' style="position: absolute; top: ' + this.n_y + 'px; left: ' + this.n_x + 'px; width: ' + this.getprop('width') + 'px; height: ' + this.getprop('height') + 'px; visibility: hidden;' +' z-index: ' + this.n_depth + ';" ' + 'onclick="return A_MENUS[' + o_root.n_id + '].onclick(' + this.n_id + ');" onmouseout="A_MENUS[' + o_root.n_id + '].onmouseout(' + this.n_id + ');" onmouseover="A_MENUS[' + o_root.n_id + '].onmouseover(' + this.n_id + ');" onmousedown="A_MENUS[' + o_root.n_id + '].onmousedown(' + this.n_id + ');"><div id="e' + o_root.n_id + '_' + this.n_id +'i" class="' + this.getstyle(1, 0) + '">' + this.a_config[0] + "</div></a>\n" ); this.e_ielement = document.getElementById('e' + o_root.n_id + '_' + this.n_id + 'i'); this.e_oelement = document.getElementById('e' + o_root.n_id + '_' + this.n_id + 'o'); this.b_visible = !this.n_depth; // no more initialization if leaf if (this.a_config.length < 4) return; // node specific methods and properties this.a_children = []; // init downline recursively for (var n_order = 0; n_order < this.a_config.length - 3; n_order++) new menu_item(this, n_order); } // -------------------------------------------------------------------------------- // reads property from template file, inherits from parent level if not found // ------------------------------------------------------------------------------------------ function mitem_getprop (s_key) { // check if value is defined for current level var s_value = null, a_level = this.o_root.a_tpl[this.n_depth]; // return value if explicitly defined if (a_level) s_value = a_level[s_key]; // request recursively from parent levels if not defined return (s_value == null ? this.o_parent.getprop(s_key) : s_value); } // -------------------------------------------------------------------------------- // reads property from template file, inherits from parent level if not found // ------------------------------------------------------------------------------------------ function mitem_getstyle (n_pos, n_state) { var a_css = this.getprop('css'); var a_oclass = a_css[n_pos ? 'inner' : 'outer']; // same class for all states if (typeof(a_oclass) == 'string') return a_oclass; // inherit class from previous state if not explicitly defined for (var n_currst = n_state; n_currst >= 0; n_currst--) if (a_oclass[n_currst]) return a_oclass[n_currst]; } // ------------------------------------------------------------------------------------------ // updates status bar message of the browser // ------------------------------------------------------------------------------------------ function mitem_upstatus (b_clear) { window.setTimeout("window.status=unescape('" + (b_clear ? '' : (this.a_config[2] && this.a_config[2]['sb'] ? escape(this.a_config[2]['sb']) : escape(this.a_config[0]) + (this.a_config[1] ? ' ('+ escape(this.a_config[1]) + ')' : ''))) + "')", 10); } // -------------------------------------------------------------------------------- // that's all folks --- NEW FILE: menu.xml --- <?xml version="1.0" encoding="iso-latin-1" standalone="no"?> <menu id="menu"> <item id="technical" caption="Technical Books" link="null"> <item id="docbookwiki_guide" caption="DocBookWiki Guide"/> <item id="linux_server_admin" caption="Becoming a Linux Server Admin"/> <item id="book3" caption="Book 3"/> <item id="book4" caption="Book 4"/> </item> <item id="nontechnical" caption="Non-technical Books" link="null"> <item id="legislation" caption="Legislation and Law" link="null"> <item id="kushtetuta" caption="Kushtetuta e Shqiperise"/> <item id="kushtetuta_it" caption="La Costituzione Albanese"/> </item> <item id="cat2_sub2" caption="Subcategory 2" link="null"> <item id="cat2_sub2_book1" caption="Book 1"/> <item id="cat2_sub2_book2" caption="Book 2"/> <item id="test1" caption="test1"/> <item id="test2" caption="test 3"/> </item> <item id="cat2_sub3" caption="Subcategory 3" link="null"> <item id="cat2_sub3_book1" caption="Book 1"/> <item id="cat2_sub3_book2" caption="Book 2"/> </item> </item> <item id="category_3" caption="Book Category 3" link="null"> <item id="cat3_sub1" caption="Subcategory 1" link="null"> <item id="cat3_sub1_book1" caption="Book 1"/> <item id="cat3_sub1_book2" caption="Book 2"/> </item> <item id="cat3_sub2" caption="Subcategory 2" link="null"> <item id="cat3_sub2_book1" caption="Book 1"/> <item id="cat3_sub2_book2" caption="Book 2"/> </item> </item> <item id="category_4" caption="Book Category 4" link="null"> <item id="cat4_sub1" caption="Subcategory 1" link="null"> <item id="cat4_sub1_book1" caption="Book 1"/> <item id="cat4_sub1_book2" caption="Book 2"/> </item> <item id="cat4_sub2" caption="Subcategory 2" link="null"> <item id="cat4_sub2_book1" caption="Book 1"/> <item id="cat4_sub2_book2" caption="Book 2"/> </item> </item> <item id="category_5" caption="Book Category 5" link="null"> <item id="cat5_sub1" caption="Subcategory 1" link="null"> <item id="cat5_sub1_book1" caption="Book 1"/> <item id="cat5_sub1_book2" caption="Book 2"/> </item> <item id="cat5_sub2" caption="Subcategory 2" link="null"> <item id="cat5_sub2_book1" caption="Book 1"/> <item id="cat5_sub2_book2" caption="Book 2"/> </item> </item> </menu> --- NEW FILE: menu_items.js --- // -*-C-*- //tell emacs to use the C mode var MENU_ITEMS = [ ['Technical Books', null, null, ['DocBookWiki Guide', 'javascript:book(\'docbookwiki_guide\')', null], ['Becoming a Linux Server Admin', 'javascript:book(\'linux_server_admin\')', null], ['Book 3', 'javascript:book(\'book3\')', null], ['Book 4', 'javascript:book(\'book4\')', null], ], ['Non-technical Books', null, null, ['Legislation and Law', null, null, ['Kushtetuta e Shqiperise', 'javascript:book(\'kushtetuta\')', null], ['La Costituzione Albanese', 'javascript:book(\'kushtetuta_it\')', null], ], ['Subcategory 2', null, null, ['Book 1', 'javascript:book(\'cat2_sub2_book1\')', null], ['Book 2', 'javascript:book(\'cat2_sub2_book2\')', null], ['test1', 'javascript:book(\'test1\')', null], ['test 3', 'javascript:book(\'test2\')', null], ], ['Subcategory 3', null, null, ['Book 1', 'javascript:book(\'cat2_sub3_book1\')', null], ['Book 2', 'javascript:book(\'cat2_sub3_book2\')', null], ], ], ['Book Category 3', null, null, ['Subcategory 1', null, null, ['Book 1', 'javascript:book(\'cat3_sub1_book1\')', null], ['Book 2', 'javascript:book(\'cat3_sub1_book2\')', null], ], ['Subcategory 2', null, null, ['Book 1', 'javascript:book(\'cat3_sub2_book1\')', null], ['Book 2', 'javascript:book(\'cat3_sub2_book2\')', null], ], ], ['Book Category 4', null, null, ['Subcategory 1', null, null, ['Book 1', 'javascript:book(\'cat4_sub1_book1\')', null], ['Book 2', 'javascript:book(\'cat4_sub1_book2\')', null], ], ['Subcategory 2', null, null, ['Book 1', 'javascript:book(\'cat4_sub2_book1\')', null], ['Book 2', 'javascript:book(\'cat4_sub2_book2\')', null], ], ], ['Book Category 5', null, null, ['Subcategory 1', null, null, ['Book 1', 'javascript:book(\'cat5_sub1_book1\')', null], ['Book 2', 'javascript:book(\'cat5_sub1_book2\')', null], ], ['Subcategory 2', null, null, ['Book 1', 'javascript:book(\'cat5_sub2_book1\')', null], ['Book 2', 'javascript:book(\'cat5_sub2_book2\')', null], ], ], ]; --- NEW FILE: menu_tpl.js --- // -*-C-*- //tell emacs to use the C mode var MENU_POS = [ { // item sizes 'width': 128, 'height': 18, // menu block offset from the origin: // for root level origin is upper left corner of the page // for other levels origin is upper left corner of parent item 'block_top': 85, 'block_left': 0, // offsets between items of the same level 'top': 20, 'left': 0, // time in milliseconds before menu is hidden after cursor has gone out // of any items 'hide_delay': 200, 'css' : { 'inner' : 'minner', 'outer' : ['moout', 'moover', 'modown'] } }, { 'width': 188, 'block_top': 3, 'block_left': 120 }, { 'block_left': 180 } ]; |
From: Dashamir H. <das...@us...> - 2004-07-16 07:41:48
|
Update of /cvsroot/phpwebapp/web_app/boxes/menu/edit/xsl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20494/boxes/menu/edit/xsl/test Added Files: add_subitem.sh book_list.sh delete.sh edit_menu_items.sh get_parent_id.sh menu_items.sh move_down.sh move_up.sh subitems.sh update.sh Log Message: --- NEW FILE: add_subitem.sh --- #!/bin/bash id=ofseti new_id=new_offseti new_caption='New Offseti' xsl_file=../add_subitem.xsl xml_file=../../menu.xml xsltproc --stringparam id "$id" \ --stringparam new_id "$new_id" \ --stringparam new_caption "$new_caption" \ $xsl_file $xml_file --- NEW FILE: book_list.sh --- #!/bin/bash xsl_file=../book_list.xsl xml_file=../../menu.xml xsltproc $xsl_file $xml_file --- NEW FILE: delete.sh --- #!/bin/bash id=ofseti xsl_file=../delete.xsl xml_file=../../menu.xml xsltproc --stringparam id "$id" $xsl_file $xml_file --- NEW FILE: edit_menu_items.sh --- #!/bin/bash xsl_file=../edit_menu_items.xsl xml_file=../../menu.xml xsltproc $xsl_file $xml_file --- NEW FILE: get_parent_id.sh --- #!/bin/bash id=ofseti xsl_file=../get_parent_id.xsl xml_file=../../menu.xml xsltproc --stringparam id "$id" $xsl_file $xml_file --- NEW FILE: menu_items.sh --- #!/bin/bash xsl_file=../menu_items.xsl xml_file=../../menu.xml xsltproc $xsl_file $xml_file --- NEW FILE: move_down.sh --- #!/bin/bash id=parapregatitja xsl_file=../move_down.xsl xml_file=../../menu.xml xsltproc --stringparam id "$id" $xsl_file $xml_file --- NEW FILE: move_up.sh --- #!/bin/bash id=parapregatitja xsl_file=../move_up.xsl xml_file=../../menu.xml xsltproc --stringparam id "$id" $xsl_file $xml_file --- NEW FILE: subitems.sh --- #!/bin/bash item_id=leter xsl_file=../subitems.xsl xml_file=../../menu.xml xsltproc --stringparam id $item_id $xsl_file $xml_file --- NEW FILE: update.sh --- #!/bin/bash id=ofseti new_id=new_offseti new_caption='New Offseti' xsl_file=../update.xsl xml_file=../../menu.xml xsltproc --stringparam id "$id" \ --stringparam new_id "$new_id" \ --stringparam new_caption "$new_caption" \ $xsl_file $xml_file |
From: Dashamir H. <das...@us...> - 2004-07-16 07:41:48
|
Update of /cvsroot/phpwebapp/web_app/boxes/menu/edit/xsl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20494/boxes/menu/edit/xsl Added Files: add_subitem.xsl book_list.xsl delete.xsl edit_menu_items.xsl get_id.xsl get_parent_id.xsl menu_items.xsl move_down.xsl move_up.xsl subitems.xsl update.xsl Log Message: --- NEW FILE: add_subitem.xsl --- <?xml version='1.0'?><!-- -*-SGML-*- --> <!-- This file is part of SMEWebApp. SMEWebApp is a web application that displays and edits DocBook documents. Copyright (c) 2004 Dashamir Hoxha, das...@us... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <!-- This transformation appends a new child item to the selected item. It is called with parameters 'id', 'new_id', 'new_caption', like this: xsltproc -stringparam id $id \ -stringparam new_id $new_id \ -stringparam new_caption $new_caption \ add_subitem.xsl menu.xml --> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" version="1.0" encoding="iso-latin-1" omit-xml-declaration="no" standalone="no" indent="yes" /> <xsl:template match="menu[@id=$id]"> <menu id="{@id}"> <xsl:apply-templates /> <item id="{$new_id}" caption="{$new_caption}" /> </menu> </xsl:template> <xsl:template match="item[@id=$id]"> <item id="{@id}" caption="{@caption}" link="null"> <xsl:apply-templates /> <item id="{$new_id}" caption="{$new_caption}" /> </item> </xsl:template> <!-- copy everything else --> <xsl:template match="*|@*"> <xsl:copy> <xsl:apply-templates select="@*" /> <xsl:apply-templates select="node()" /> </xsl:copy> </xsl:template> <!-- ignore text nodes --> <xsl:template match="text()" /> </xsl:transform> --- NEW FILE: book_list.xsl --- <?xml version='1.0'?><!-- -*-SGML-*- --> <!-- This file is part of SMEWebApp. SMEWebApp is a web application that displays and edits DocBook documents. Copyright (c) 2004 Dashamir Hoxha, das...@us... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" indent="no" /> <xsl:template match="menu"> <xsl:text><?php /** * This file contains an array with the list of books and their titles. */ $arr_books = array( </xsl:text> <xsl:apply-templates select="./item" /> <xsl:text>); ?></xsl:text> </xsl:template> <xsl:template match="item"> <xsl:text> "</xsl:text> <xsl:value-of select="@id" /> <xsl:text>" => "</xsl:text> <xsl:value-of select="@caption" /> <xsl:text>", </xsl:text> <xsl:apply-templates /> </xsl:template> <!-- ignore items that have a 'null' link --> <xsl:template match="item[@link='null']"> <xsl:apply-templates /> </xsl:template> <!-- ignore text nodes --> <xsl:template match="text()" /> </xsl:transform> --- NEW FILE: delete.xsl --- <?xml version='1.0'?><!-- -*-SGML-*- --> <!-- This file is part of SMEWebApp. SMEWebApp is a web application that displays and edits DocBook documents. Copyright (c) 2004 Dashamir Hoxha, das...@us... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <!-- This transformation deletes the item with the id given as parameter. It is called with a parameter 'id', like this: xsltproc -stringparam id $id delete.xsl menu.xml --> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" version="1.0" encoding="iso-latin-1" omit-xml-declaration="no" standalone="no" indent="yes" /> <!-- ignore the item with the given id --> <xsl:template match="item[@id=$id]" /> <!-- copy everything else --> <xsl:template match="*|@*"> <xsl:copy> <xsl:apply-templates select="@*" /> <xsl:apply-templates select="node()" /> </xsl:copy> </xsl:template> <!-- ignore text nodes --> <xsl:template match="text()" /> </xsl:transform> --- NEW FILE: edit_menu_items.xsl --- <?xml version='1.0'?><!-- -*-SGML-*- --> <!-- This file is part of SMEWebApp. SMEWebApp is a web application that displays and edits DocBook documents. Copyright (c) 2004 Dashamir Hoxha, das...@us... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" indent="no" /> <xsl:template match="menu"> <xsl:text>// -*-C-*- //tell emacs to use the C mode var EDIT_MENU_ITEMS = [['Select Menu Item', 'javascript:edit(\'</xsl:text><xsl:value-of select="@id"/> <xsl:text>\')', null, </xsl:text> <xsl:apply-templates select="./item"> <xsl:with-param name="indent" select="' '" /> </xsl:apply-templates> <xsl:text>]];</xsl:text> </xsl:template> <xsl:template match="item"> <xsl:param name="indent" select="''" /> <xsl:variable name="link"> <xsl:text>'javascript:edit(\'</xsl:text> <xsl:value-of select="@id" /> <xsl:text>\')'</xsl:text> </xsl:variable> <xsl:value-of select="$indent" /> <xsl:text>['</xsl:text> <xsl:value-of select="@caption"/> <xsl:text>', </xsl:text> <xsl:value-of select="$link"/> <xsl:text>, null</xsl:text> <xsl:choose> <xsl:when test="./item"> <xsl:text>, </xsl:text> <xsl:apply-templates select="./item"> <xsl:with-param name="indent" select="concat(' ', $indent)" /> </xsl:apply-templates> <xsl:value-of select="$indent" /><xsl:text> ], </xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>], </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:transform> --- NEW FILE: get_id.xsl --- <?xml version='1.0'?><!-- -*-SGML-*- --> <!-- This file is part of SMEWebApp. SMEWebApp is a web application that displays and edits DocBook documents. Copyright (c) 2004 Dashamir Hoxha, das...@us... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <!-- This transformation is used to check whether the given id exists and outputs the id itself if it exists. It is called with a parameter 'id', like this: xsltproc -stringparam id $id get_id.xsl menu.xml --> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" /> <xsl:template match="*[@id=$id]"> <xsl:value-of select="@id" /> </xsl:template> <!-- ignore text nodes --> <xsl:template match="text()" /> </xsl:transform> --- NEW FILE: get_parent_id.xsl --- <?xml version='1.0'?><!-- -*-SGML-*- --> <!-- This file is part of SMEWebApp. SMEWebApp is a web application that displays and edits DocBook documents. Copyright (c) 2004 Dashamir Hoxha, das...@us... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <!-- This transformation returns the id of the parent item. It is called with a parameter 'id', like this: xsltproc -stringparam id $id get_parent_id.xsl menu.xml --> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" /> <xsl:template match="item[@id=$id]"> <xsl:value-of select="../@id" /> </xsl:template> <!-- ignore text nodes --> <xsl:template match="text()" /> </xsl:transform> --- NEW FILE: menu_items.xsl --- <?xml version='1.0'?><!-- -*-SGML-*- --> <!-- This file is part of SMEWebApp. SMEWebApp is a web application that displays and edits DocBook documents. Copyright (c) 2004 Dashamir Hoxha, das...@us... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" indent="no" /> <xsl:template match="menu"> <xsl:text>// -*-C-*- //tell emacs to use the C mode var MENU_ITEMS = [ </xsl:text> <xsl:apply-templates select="./item"> <xsl:with-param name="indent" select="' '" /> </xsl:apply-templates> <xsl:text>];</xsl:text> </xsl:template> <xsl:template match="item"> <xsl:param name="indent" select="''" /> <xsl:variable name="link"> <xsl:apply-templates select="." mode="get-link" /> </xsl:variable> <xsl:value-of select="$indent" /> <xsl:text>['</xsl:text> <xsl:value-of select="@caption"/> <xsl:text>', </xsl:text> <xsl:value-of select="$link"/> <xsl:text>, null</xsl:text> <xsl:choose> <xsl:when test="./item"> <xsl:text>, </xsl:text> <xsl:apply-templates select="./item"> <xsl:with-param name="indent" select="concat(' ', $indent)" /> </xsl:apply-templates> <xsl:value-of select="$indent" /><xsl:text> ], </xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>], </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="item[@link='null']" mode="get-link"> <xsl:value-of select="'null'" /> </xsl:template> <xsl:template match="item[not(@link='null')]" mode="get-link"> <xsl:value-of select="'not-null'" /> <xsl:text>'</xsl:text> <xsl:value-of select="@link" /> <xsl:text>'</xsl:text> </xsl:template> <xsl:template match="item[not(@link)]" mode="get-link"> <xsl:text>'javascript:book(\'</xsl:text> <xsl:value-of select="@id" /> <xsl:text>\')'</xsl:text> </xsl:template> </xsl:transform> --- NEW FILE: move_down.xsl --- <?xml version='1.0'?><!-- -*-SGML-*- --> <!-- This file is part of SMEWebApp. SMEWebApp is a web application that displays and edits DocBook documents. Copyright (c) 2004 Dashamir Hoxha, das...@us... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <!-- This transformation moves down the item with the given id. It is called with a parameter 'id', like this: xsltproc -stringparam id $id move_down.xsl menu.xml --> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" version="1.0" encoding="iso-latin-1" omit-xml-declaration="no" standalone="no" indent="yes" /> <xsl:template match="item"> <xsl:choose> <xsl:when test="@id=$id and following-sibling::item"> <xsl:copy-of select="following-sibling::item[1]" /> </xsl:when> <xsl:when test="preceding-sibling::item[1]/@id=$id"> <xsl:copy-of select="preceding-sibling::item[1]" /> </xsl:when> <xsl:otherwise> <xsl:copy> <xsl:copy-of select="@*" /> <xsl:apply-templates /> </xsl:copy> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- copy everything else --> <xsl:template match="*|@*"> <xsl:copy> <xsl:apply-templates select="@*" /> <xsl:apply-templates select="node()" /> </xsl:copy> </xsl:template> </xsl:transform> --- NEW FILE: move_up.xsl --- <?xml version='1.0'?><!-- -*-SGML-*- --> <!-- This file is part of SMEWebApp. SMEWebApp is a web application that displays and edits DocBook documents. Copyright (c) 2004 Dashamir Hoxha, das...@us... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <!-- This transformation moves up the item with the given id. It is called with a parameter 'id', like this: xsltproc -stringparam id $id move_up.xsl menu.xml --> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" version="1.0" encoding="iso-latin-1" omit-xml-declaration="no" standalone="no" indent="yes" /> <xsl:template match="item"> <xsl:choose> <!-- if the item next to this one is the selected one, --> <!-- then copy the next item instead of this one --> <xsl:when test="following-sibling::item[1]/@id=$id"> <xsl:copy-of select="following-sibling::item[1]" /> </xsl:when> <!-- if this item is the selected one and there exists a previous --> <!-- item, then copy the previous item instead of this one --> <xsl:when test="@id=$id and preceding-sibling::item"> <xsl:copy-of select="preceding-sibling::*[1]" /> </xsl:when> <!-- otherwise copy this item and apply templates --> <xsl:otherwise> <xsl:copy> <xsl:copy-of select="@*" /> <xsl:apply-templates /> </xsl:copy> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- copy everything else --> <xsl:template match="*|@*"> <xsl:copy> <xsl:apply-templates select="@*" /> <xsl:apply-templates select="node()" /> </xsl:copy> </xsl:template> </xsl:transform> --- NEW FILE: subitems.xsl --- <?xml version='1.0'?><!-- -*-SGML-*- --> <!-- This file is part of SMEWebApp. SMEWebApp is a web application that displays and edits DocBook documents. Copyright (c) 2004 Dashamir Hoxha, das...@us... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <!-- Outputs subitems of the selected item --> <!-- Is called with a parameter 'id', like this: --> <!-- xsltproc -stringparam id $item_id subitems.xsl menu.xml --> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" indent="no" /> <!-- Find the item with the given id and then output the id and caption for this item and for its subitems. --> <xsl:template match="*[@id=$id]"> <xsl:value-of select="concat(@id, ' ', @caption)" /> <xsl:text> </xsl:text> <xsl:for-each select="./item"> <xsl:value-of select="concat(@id, ' ', @caption)" /> <xsl:text> </xsl:text> </xsl:for-each> </xsl:template> <!-- ignore text nodes --> <xsl:template match="text()" /> </xsl:transform> --- NEW FILE: update.xsl --- <?xml version='1.0'?><!-- -*-SGML-*- --> <!-- This file is part of SMEWebApp. SMEWebApp is a web application that displays and edits DocBook documents. Copyright (c) 2004 Dashamir Hoxha, das...@us... SMEWebApp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SMEWebApp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SMEWebApp; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> <!-- This transformation updates the id and caption of the selected item. It is called with parameters 'id', 'new_id', 'new_caption', like this: xsltproc -stringparam id $id \ -stringparam new_id $new_id \ -stringparam new_caption $new_caption \ update.xsl menu.xml --> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" version="1.0" encoding="iso-latin-1" omit-xml-declaration="no" standalone="no" indent="yes" /> <xsl:template match="item[@id=$id]"> <xsl:choose> <xsl:when test="./item"> <item id="{$new_id}" caption="{$new_caption}" link="null"> <xsl:apply-templates /> </item> </xsl:when> <xsl:otherwise> <item id="{$new_id}" caption="{$new_caption}"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- copy everything else --> <xsl:template match="*|@*"> <xsl:copy> <xsl:apply-templates select="@*" /> <xsl:apply-templates select="node()" /> </xsl:copy> </xsl:template> <!-- ignore text nodes --> <xsl:template match="text()" /> </xsl:transform> |
From: Dashamir H. <das...@us...> - 2004-07-16 07:40:32
|
Update of /cvsroot/phpwebapp/web_app/boxes/menu/edit/xsl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20346/boxes/menu/edit/xsl/test Log Message: Directory /cvsroot/phpwebapp/web_app/boxes/menu/edit/xsl/test added to the repository |
From: Dashamir H. <das...@us...> - 2004-07-16 07:39:55
|
Update of /cvsroot/phpwebapp/web_app/boxes/menu/edit/xsl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20206/boxes/menu/edit/xsl Log Message: Directory /cvsroot/phpwebapp/web_app/boxes/menu/edit/xsl added to the repository |
From: Dashamir H. <das...@us...> - 2004-07-16 07:39:20
|
Update of /cvsroot/phpwebapp/web_app/boxes/menu/edit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20152/boxes/menu/edit Log Message: Directory /cvsroot/phpwebapp/web_app/boxes/menu/edit added to the repository |
From: Dashamir H. <das...@us...> - 2004-07-16 07:38:45
|
Update of /cvsroot/phpwebapp/web_app/boxes/menu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20072/boxes/menu Log Message: Directory /cvsroot/phpwebapp/web_app/boxes/menu added to the repository |
From: Dashamir H. <das...@us...> - 2004-07-16 07:38:26
|
Update of /cvsroot/phpwebapp/web_app/boxes/editMenus In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20029/boxes/editMenus Removed Files: tri.png test_1.php test.php menubar.css include_menus.js hierMenus.js fun.editMenus.php editMenus.php editMenus.js editMenus.html class.XMLMenus.php class.Menus.php class.MenuTopElem.php class.MenuElem.php Log Message: replaced by a new menu --- tri.png DELETED --- --- test_1.php DELETED --- --- test.php DELETED --- --- menubar.css DELETED --- --- include_menus.js DELETED --- --- hierMenus.js DELETED --- --- fun.editMenus.php DELETED --- --- editMenus.php DELETED --- --- editMenus.js DELETED --- --- editMenus.html DELETED --- --- class.XMLMenus.php DELETED --- --- class.Menus.php DELETED --- --- class.MenuTopElem.php DELETED --- --- class.MenuElem.php DELETED --- |