[Pieforms-commit] SF.net SVN: pieforms: [281] pieforms-php5/trunk/src/pieform.php
Status: Alpha
Brought to you by:
oracleshinoda
|
From: <ora...@us...> - 2008-01-29 04:22:43
|
Revision: 281
http://pieforms.svn.sourceforge.net/pieforms/?rev=281&view=rev
Author: oracleshinoda
Date: 2008-01-28 20:22:47 -0800 (Mon, 28 Jan 2008)
Log Message:
-----------
Some whitespace/spelling fixes. Prevent the markup element causing fatal errors. Prevent calling pieform_get_headdata() with no forms causing a fatal error.
Modified Paths:
--------------
pieforms-php5/trunk/src/pieform.php
Modified: pieforms-php5/trunk/src/pieform.php
===================================================================
--- pieforms-php5/trunk/src/pieform.php 2008-01-03 10:59:30 UTC (rev 280)
+++ pieforms-php5/trunk/src/pieform.php 2008-01-29 04:22:47 UTC (rev 281)
@@ -155,7 +155,7 @@
* @var bool
*/
private $submitted_by_js = false;
-
+
/*}}}*/
/**
@@ -620,7 +620,7 @@
}
$this->include_plugin('renderer', $this->data['renderer']);
-
+
// Form header
$function = 'pieform_renderer_' . $this->data['renderer'] . '_header';
if (function_exists($function)) {
@@ -662,7 +662,7 @@
// The two cases where it is needed is when:
// 1) The form is a JS form that hasn't been submitted yet. When the
// form has been submitted the javascript from the first page load is
- // still active in the documente
+ // still active in the document
// 2) The form is NOT a JS form, but has a presubmitcallback
if (($this->data['jsform'] && !$this->submitted)
|| (!$this->data['jsform'] && $this->data['presubmitcallback'])) {
@@ -1226,6 +1226,11 @@
$element['id'] = $this->make_id($element);
$element['class'] = $this->make_class($element);
+ // If the element is pure markup, don't pass it to the renderer
+ if ($element['type'] == 'markup') {
+ return $element['value'] . "\n";
+ }
+
// Build the element html
$function = 'pieform_element_' . $element['type'];
$element['html'] = $function($this, $element);
@@ -1453,10 +1458,12 @@
}
// TODO: jsdirectory should be independent of ANY form
- array_unshift($htmlelements, '<script type="text/javascript" src="'
- . Pieform::hsc($form->get_property('jsdirectory')) . 'pieforms.js"></script>');
- array_unshift($htmlelements, '<script type="text/javascript">pieformPath = "'
- . Pieform::hsc($form->get_property('jsdirectory')) . '";</script>');
+ if ($GLOBALS['_PIEFORM_REGISTRY']) {
+ array_unshift($htmlelements, '<script type="text/javascript" src="'
+ . Pieform::hsc($form->get_property('jsdirectory')) . 'pieforms.js"></script>');
+ array_unshift($htmlelements, '<script type="text/javascript">pieformPath = "'
+ . Pieform::hsc($form->get_property('jsdirectory')) . '";</script>');
+ }
return array_unique($htmlelements);
}/*}}}*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|