Changeset 1853

Show
Ignore:
Timestamp:
01/28/08 17:15:30 (6 months ago)
Author:
Shadowhand
Message:

Fix for #333, thanks sbeattie.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/modules/forge/libraries/Forge.php

    r1594 r1853  
    1919        public $hidden = array(); 
    2020 
    21         public function __construct($action = '', $title = '', $method = NULL, $class = 'form'
     21        public function __construct($action = '', $title = '', $method = NULL, $attr = array()
    2222        { 
    2323                // Set form attributes 
     
    2727                // Set template variables 
    2828                $this->template['title'] = $title; 
    29                 $this->template['class'] = $class; 
     29 
     30                // Empty attributes sets the class to "form" 
     31                empty($attr) and $attr = array('class' => 'form'); 
     32 
     33                // String attributes is the class name 
     34                is_string($attr) and $attr = array('class' => $attr); 
     35 
     36                // Extend the template with the attributes 
     37                $this->template += $attr; 
    3038        } 
    3139