[Openfirst-cvscommit] base/config/functions browserid.php,1.2,1.3 forms.php,1.1.1.1,1.2 wysiwyg.php,
Brought to you by:
xtimg
From: <xt...@us...> - 2003-11-23 23:39:10
|
Update of /cvsroot/openfirst/base/config/functions In directory sc8-pr-cvs1:/tmp/cvs-serv22139/functions Modified Files: browserid.php forms.php wysiwyg.php Log Message: Fix style issues and improper commenting where applicable. Some files were misidentified in their heading information, which may have lead to unnecessary confusion. Index: browserid.php =================================================================== RCS file: /cvsroot/openfirst/base/config/functions/browserid.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** browserid.php 3 Oct 2003 23:40:49 -0000 1.2 --- browserid.php 23 Nov 2003 23:39:07 -0000 1.3 *************** *** 1,4 **** --- 1,6 ---- <?php /* + * openFIRST.base - config/functions/browserid.php + * * Copyright (C) 2003, * openFIRST Project Index: forms.php =================================================================== RCS file: /cvsroot/openfirst/base/config/functions/forms.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** forms.php 7 Jun 2003 16:11:32 -0000 1.1.1.1 --- forms.php 23 Nov 2003 23:39:07 -0000 1.2 *************** *** 1,7 **** <?php /* ! * openFIRST globals.php ! * Last Modified: ! * David Di Biase, April 13, 2003 * * Copyright (C) 2003, --- 1,5 ---- <?php /* ! * openFIRST.base - config/functions/forms.php * * Copyright (C) 2003, *************** *** 32,75 **** function checkform($field){ ! $error = array(); ! // Loop through every single array in the function ! foreach($field as $fields=>$checkwith){ ! // While looping use one of these cases to perform the proper checking ! switch($checkwith){ ! // If field is a password then check as password and respond ! case "password": ! if(strlen($_POST[$fields]) < 5){ ! $error[] = "Password is too short, must be 5-6 characters in length. You entered: ".$_POST[$fields]; ! } break; ! // If field is an email address then check as email and respond ! case "email": ! if( ! eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*"."@([a-z0-9]+([\.-][a-z0-9]+))*$",$_POST[$fields])){ ! $error[] = "E-mail field contains illegal characters. You entered: ".$_POST[$fields]; ! } else { ! $item = explode("@", $_POST[$fields]); ! if( gethostbyname($item["1"]) == $item["1"]) { ! $error[] = "Domain in e-mail address is illegal. You entered: ".$_POST[$fields]; ! } ! } ! break; ! // If field is set as ifempty then check if its empty and respond ! case "ifempty": ! if(empty($_POST[$fields])){ ! $error[] = "Empty field on form. You entered: ".$_POST[$fields]; ! } } } ! return $error; } --- 30,73 ---- function checkform($field){ ! $error = array(); ! // Loop through every single array in the function ! foreach($field as $fields=>$checkwith){ ! // While looping use one of these cases to perform the proper checking ! switch($checkwith){ ! // If field is a password then check as password and respond ! case "password": ! if(strlen($_POST[$fields]) < 5){ ! $error[] = "Password is too short, must be 5-6 characters in length. You entered: ".$_POST[$fields]; ! } break; ! // If field is an email address then check as email and respond ! case "email": ! if( ! eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*"."@([a-z0-9]+([\.-][a-z0-9]+))*$",$_POST[$fields])) { ! $error[] = "E-mail field contains illegal characters. You entered: ".$_POST[$fields]; ! } else { ! $item = explode("@", $_POST[$fields]); ! if( gethostbyname($item["1"]) == $item["1"]) { ! $error[] = "Domain in e-mail address is illegal. You entered: ".$_POST[$fields]; ! } ! } ! break; ! // If field is set as ifempty then check if its empty and respond ! case "ifempty": ! if(empty($_POST[$fields])){ ! $error[] = "Empty field on form. You entered: ".$_POST[$fields]; ! } } } ! return $error; } *************** *** 78,90 **** // Check if requires error response if (! empty($error)){ ! // Create errors table ! echo "<table width=400 border=1 align=center cellpadding=1 cellspacing=0 bordercolor=#333333 bgcolor=#CCCCCC><tr><td><b>You have errors within your form:</b><br>"; // Display errors in form foreach($error as $value){ echo "- ".$value."<br>"; } ! // Close errors table ! echo "</td></tr></table>"; } } ! ?> \ No newline at end of file --- 76,88 ---- // Check if requires error response if (! empty($error)){ ! // Create errors table ! echo "<table width=400 border=1 align=center cellpadding=1 cellspacing=0 bordercolor=#333333 bgcolor=#CCCCCC><tr><td><b>You have errors within your form:</b><br>"; // Display errors in form foreach($error as $value){ echo "- ".$value."<br>"; } ! // Close errors table ! echo "</td></tr></table>"; } } ! ?> Index: wysiwyg.php =================================================================== RCS file: /cvsroot/openfirst/base/config/functions/wysiwyg.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wysiwyg.php 23 Oct 2003 14:14:39 -0000 1.2 --- wysiwyg.php 23 Nov 2003 23:39:07 -0000 1.3 *************** *** 29,39 **** // A complete function to create the Javascript command for loading of the WYSIWYG function make_wysiwyg($fieldname,$height,$width,$init){ ! global $basepath; ?> <SCRIPT TYPE="text/javascript" language="JavaScript1.3"> <!-- !!!! important comment this !!!! ! document.dhtmlEditors_home='<?php echo $basepath; ?>/config/functions/wysiwyg/'; ! document.writeln('<'+'SCRIPT LANGUAGE="JavaScript" src="'+document.dhtmlEditors_home+'js/lib.js">'+'<'+'/SCRIPT'+'>'); ! document.writeln('<SCRIPT LANGUAGE="JavaScript" src="'+document.dhtmlEditors_home+'modules/button_html.js"></SCRIPT>'); // --> --- 29,39 ---- // A complete function to create the Javascript command for loading of the WYSIWYG function make_wysiwyg($fieldname,$height,$width,$init){ ! global $basepath; ?> <SCRIPT TYPE="text/javascript" language="JavaScript1.3"> <!-- !!!! important comment this !!!! ! document.dhtmlEditors_home='<?php echo $basepath; ?>/config/functions/wysiwyg/'; ! document.writeln('<'+'SCRIPT LANGUAGE="JavaScript" src="'+document.dhtmlEditors_home+'js/lib.js">'+'<'+'/SCRIPT'+'>'); ! document.writeln('<SCRIPT LANGUAGE="JavaScript" src="'+document.dhtmlEditors_home+'modules/button_html.js"></SCRIPT>'); // --> *************** *** 42,48 **** <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- ! var myEditor = new dhtmlEditor; ! myEditor.registerApiModul(MODUL__toggleEditModeGetApiInfoArray('<?php echo $basepath; ?>/config/functions/wysiwyg/images/newdoc.gif')); ! myEditor.make_andReplaceTextarea('<?php echo $fieldname; ?>'); //--> </SCRIPT> --- 42,48 ---- <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- ! var myEditor = new dhtmlEditor; ! myEditor.registerApiModul(MODUL__toggleEditModeGetApiInfoArray('<?php echo $basepath; ?>/config/functions/wysiwyg/images/newdoc.gif')); ! myEditor.make_andReplaceTextarea('<?php echo $fieldname; ?>'); //--> </SCRIPT> |