Commit 8b859764c3fc634c78b5c970950c660267309ef6

Authored by totoro
1 parent 1a15cad4

fix some function definition do be compatible with old action name (String) and …

…let old project to compiles
Showing 2 changed files with 84 additions and 10 deletions   Show diff stats
web/CXM_form.anubis
@@ -317,6 +317,11 @@ public define CXM_Form_Field @@ -317,6 +317,11 @@ public define CXM_Form_Field
317 submit(WEB_Action_Name action_name, Maybe(String) label, String button_text, List((String,String)) extra_operands) 317 submit(WEB_Action_Name action_name, Maybe(String) label, String button_text, List((String,String)) extra_operands)
318 = submit([], htmlClass(""), action_name, label, button_text, extra_operands). 318 = submit([], htmlClass(""), action_name, label, button_text, extra_operands).
319 319
  320 +public define CXM_Form_Field //Helper for older project wich use only String as Action name
  321 + submit(String _action_name, Maybe(String) label, String button_text, List((String,String)) extra_operands)
  322 + = submit([], htmlClass(""), action_name(_action_name), label, button_text, extra_operands).
  323 +
  324 +
320 public define CXM_Form_Field 325 public define CXM_Form_Field
321 upload(HTML_Label label, HTML_Id id, WebArgName name, Width width) 326 upload(HTML_Label label, HTML_Id id, WebArgName name, Width width)
322 = upload([], label, id, name, width, non_mandatory). 327 = upload([], label, id, name, width, non_mandatory).
@@ -634,6 +639,29 @@ public define HTML_Off_Form @@ -634,6 +639,29 @@ public define HTML_Off_Form
634 extra_ops, 639 extra_ops,
635 format_CXM_Form_Field(fields, lwa) 640 format_CXM_Form_Field(fields, lwa)
636 ). 641 ).
  642 +
  643 +public define HTML_Off_Form
  644 +/* older manner to call CXM_form with action as String.
  645 + * this function only exists for compatibility with older projects. Please consider
  646 + * to use the above function with WEB_Action_Name instead of String
  647 +*/
  648 + cxm_form
  649 + (
  650 + HTML_Id form_Id,
  651 + List(CoreAttrs) options,
  652 + String action, //older manner to call action with String
  653 + List((String,String)) extra_ops,
  654 + List(Web_arg) lwa,
  655 + List(CXM_Form_Field) fields
  656 + ) =
  657 +
  658 + form(
  659 + form_Id,
  660 + [class("cxm_form") . options],
  661 + action_name(action),
  662 + extra_ops,
  663 + format_CXM_Form_Field(fields, lwa)
  664 + ).
637 665
638 public define HTML_Off_Form 666 public define HTML_Off_Form
639 cxm_form 667 cxm_form
@@ -646,17 +674,19 @@ public define HTML_Off_Form @@ -646,17 +674,19 @@ public define HTML_Off_Form
646 List(CXM_Form_Field) form_fields 674 List(CXM_Form_Field) form_fields
647 )= 675 )=
648 cxm_form(html_Id(form_name), options, action, extra_ops, lwa, form_fields). 676 cxm_form(html_Id(form_name), options, action, extra_ops, lwa, form_fields).
649 -  
650 - public define HTML_In_Form  
651 - cxm_fieldset 677 +
  678 +public define HTML_Off_Form
  679 + cxm_form
652 ( 680 (
653 - HTML_Id fieldSetId, 681 + String form_name,
  682 + List(CoreAttrs) options,
  683 + String action,
  684 + List((String,String)) extra_ops,
654 List(Web_arg) lwa, 685 List(Web_arg) lwa,
655 - List(CXM_Form_Field) fields  
656 - ) =  
657 - cxm_fieldset([id(fieldSetId.id), class("aligned")], "", lwa, fields).  
658 -  
659 - 686 + List(CXM_Form_Field) form_fields
  687 + )=
  688 + cxm_form(html_Id(form_name), options, action_name(action), extra_ops, lwa, form_fields).
  689 +
660 690
661 public define HTML_Off_Form 691 public define HTML_Off_Form
662 cxm_form 692 cxm_form
web/CXM_making_a_web_site.anubis
@@ -1416,6 +1416,22 @@ public define HTML_In_Form @@ -1416,6 +1416,22 @@ public define HTML_In_Form
1416 )= 1416 )=
1417 actioner(conn,targ,asp,action,extra_ops,[]) 1417 actioner(conn,targ,asp,action,extra_ops,[])
1418 . 1418 .
  1419 +
  1420 +public define HTML_In_Form
  1421 +/* Older call with String as action instead of WEB_Action_Name.
  1422 + * This function exists only for compatibility with older project.
  1423 + * Please condiser to use above function instead
  1424 + */
  1425 + actioner
  1426 + (
  1427 + Actioner_Connection conn,
  1428 + Actioner_Target targ,
  1429 + Actioner_Aspect asp,
  1430 + String action,
  1431 + List((String,String)) extra_ops
  1432 + )=
  1433 + actioner(conn,targ,asp,action_name(action),extra_ops,[])
  1434 +.
1419 1435
1420 public define HTML_In_Form 1436 public define HTML_In_Form
1421 actioner 1437 actioner
@@ -1653,6 +1669,22 @@ public define HTML_Off_Form @@ -1653,6 +1669,22 @@ public define HTML_Off_Form
1653 List((String,String)) extra_ops 1669 List((String,String)) extra_ops
1654 ) = 1670 ) =
1655 actioner(conn,targ,asp,action,extra_ops,[]). 1671 actioner(conn,targ,asp,action,extra_ops,[]).
  1672 +
  1673 +public define HTML_Off_Form
  1674 +/* Older call with String as action instead of WEB_Action_Name.
  1675 + * This function exists only for compatibility with older project.
  1676 + * Please condiser to use above function instead
  1677 + */
  1678 + actioner
  1679 + (
  1680 + Actioner_Connection conn,
  1681 + Actioner_Target targ,
  1682 + Actioner_Aspect asp,
  1683 + String action,
  1684 + List((String,String)) extra_ops
  1685 + )=
  1686 + actioner(conn,targ,asp,action_name(action),extra_ops,[])
  1687 +.
1656 1688
1657 public define HTML_Off_Form 1689 public define HTML_Off_Form
1658 table 1690 table
@@ -1896,7 +1928,19 @@ public type HTML_Meta: @@ -1896,7 +1928,19 @@ public type HTML_Meta:
1896 literal (String). 1928 literal (String).
1897 1929
1898 Meta tags are put in the 'head' of the HTML page. 1930 Meta tags are put in the 'head' of the HTML page.
1899 - 1931 +
  1932 +public define HTML_Meta
  1933 + refresh
  1934 + (
  1935 + Actioner_Connection connection,
  1936 + Actioner_Target target,
  1937 + String action,
  1938 + Int delay
  1939 + )=
  1940 + refresh(connection, target, action_name(action), delay)
  1941 +.
  1942 +
  1943 +
1900 1944
1901 public type Body_Option: 1945 public type Body_Option:
1902 core_attrs(List(CoreAttrs)), 1946 core_attrs(List(CoreAttrs)),