Dotclear

Changeset 1048


Ignore:
Timestamp:
04/20/09 23:24:15 (14 years ago)
Author:
Oaz
Message:

added <FieldMatches? name="" pattern=""> tag
added "checkboxes" example

Location:
plugins/myForms/trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/myForms/trunk/TplFields.php

    r962 r1048  
    2222$core->tpl->addValue('myformsFileFieldValue',array('MyFormsTplFields','FileFieldValue')); 
    2323$core->tpl->addBlock('myformsFieldWarning',array('MyFormsTplFields','FieldWarning')); 
     24$core->tpl->addBlock('myformsFieldMatches',array('MyFormsTplFields','FieldMatches')); 
    2425$core->tpl->addBlock('myformsTextField',array('MyFormsTplFields','TextField')); 
    2526$core->tpl->addBlock('myformsTextArea',array('MyFormsTplFields','TextArea')); 
     
    7374  { 
    7475    return '<?php if( !MyForms::validateField("'.$attr['name'].'","'.$attr['validate'].'") ) { ?>'.$content.'<?php } ?>'; 
     76  } 
     77   
     78  // Field Matching 
     79  public static function FieldMatches($attr,$content) 
     80  { 
     81    return '<?php if( MyForms::matchField("'.$attr['name'].'","'.$attr['pattern'].'") ) { ?>'.$content.'<?php } ?>'; 
    7582  } 
    7683   
  • plugins/myForms/trunk/_define.php

    r962 r1048  
    2323     /* Description*/         "Create a custom form page with custom action (save in db, send email, ...)", 
    2424     /* Author */             "Olivier Azeau", 
    25      /* Version */            '0.3', 
     25     /* Version */            '0.3a', 
    2626     /* Permissions */        null 
    2727); 
  • plugins/myForms/trunk/_public.php

    r798 r1048  
    122122  } 
    123123   
     124  public static function matchField($fieldName,$pattern) { 
     125    global $_REQUEST; 
     126    return preg_match('#'.$pattern.'#', @$_REQUEST["myforms"][$fieldName]); 
     127  } 
     128   
    124129  public static function checkQueryMatches($queryFilter) 
    125130  { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map