[Pieforms-commit] SF.net SVN: pieforms: [167] pieforms-php5/branches/0.2.0/src
Status: Alpha
Brought to you by:
oracleshinoda
|
From: <ora...@us...> - 2007-01-11 09:48:45
|
Revision: 167
http://svn.sourceforge.net/pieforms/?rev=167&view=rev
Author: oracleshinoda
Date: 2007-01-11 01:48:45 -0800 (Thu, 11 Jan 2007)
Log Message:
-----------
Merged changes from trunk
Modified Paths:
--------------
pieforms-php5/branches/0.2.0/src/pieform.php
pieforms-php5/branches/0.2.0/src/static/core/pieforms.js
Modified: pieforms-php5/branches/0.2.0/src/pieform.php
===================================================================
--- pieforms-php5/branches/0.2.0/src/pieform.php 2007-01-11 09:42:55 UTC (rev 166)
+++ pieforms-php5/branches/0.2.0/src/pieform.php 2007-01-11 09:48:45 UTC (rev 167)
@@ -285,7 +285,10 @@
'rulei18n' => array(),
// The tabindex for the form (managed automatically by Pieforms)
- 'tabindex' => false
+ 'tabindex' => false,
+
+ // Whether to add a class of the type of the element to each element
+ 'elementclasses' => false
);
$data = array_merge($formdefaults, $formconfig, $data);
$this->data = $data;
@@ -1049,7 +1052,7 @@
* @param array $element The element to make an ID for
* @return string The ID for the element
*/
- public static function make_id($element) {
+ public function make_id($element) {
if (isset($element['id'])) {
return self::hsc($element['id']);
}
@@ -1071,7 +1074,7 @@
* @param array $element The element to make a class for
* @return string The class for an element
*/
- public static function make_class($element) {
+ public function make_class($element) {
$classes = array();
if (isset($element['class'])) {
$classes[] = $element['class'];
@@ -1082,6 +1085,9 @@
if (!empty($element['error'])) {
$classes[] = 'error';
}
+ if ($this->data['elementclasses']) {
+ $classes[] = $element['type'];
+ }
// Please make sure that 'autofocus' is the last class added in this
// method. Otherwise, improve the logic for removing 'autofocus' from
// the elemnt class string in pieform_render_element
@@ -1336,8 +1342,8 @@
throw new PieformException('No such form renderer function: "' . $rendererfunction . '"');
}
- $element['id'] = Pieform::make_id($element);
- $element['class'] = Pieform::make_class($element);
+ $element['id'] = $form->make_id($element);
+ $element['class'] = $form->make_class($element);
$builtelement = $function($form, $element);
// Remove the 'autofocus' class, because we only want it on the form input
Modified: pieforms-php5/branches/0.2.0/src/static/core/pieforms.js
===================================================================
--- pieforms-php5/branches/0.2.0/src/static/core/pieforms.js 2007-01-11 09:42:55 UTC (rev 166)
+++ pieforms-php5/branches/0.2.0/src/static/core/pieforms.js 2007-01-11 09:48:45 UTC (rev 167)
@@ -60,7 +60,7 @@
this.grippie.dimensions = getElementDimensions(this.grippie);
// Set wrapper and textarea dimensions
- setElementDimensions(this.wrapper, {'h': this.dimensions.h + this.grippie.dimensions.h + 1});
+ setElementDimensions(this.wrapper, {'h': this.dimensions.h + this.grippie.dimensions.h + 1, 'w': this.dimensions.w});
setStyle(this.element, {
'margin-bottom': '0',
'width': '100%',
@@ -82,7 +82,6 @@
this.grippie.style.width = '100%';
this.grippie.style.paddingLeft = '2px';
setStyle(this.grippie, {
- 'width': '100%',
'padding-left': '2px'
});
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|