21,35c21,22
<       foreach ((array)$values as $name => $val) {
<         if ($name == 'settings' && !empty($val) && is_scalar($val)) {
<           $this->__construct(unserialize($val));
<         }
<         elseif (array_key_exists($name, $current) && !is_null($val)) {
<           $func = 'set_'. $name;
<           if (method_exists($this, $func)) {
<             $this->$func($val);
<           }
<           else {
<             $this->$name = $val;
<           }
<           unset($current[$name]);
<         }
<       }
---
>       $this->set_values((array($values)));
>       return;
37c24
<     // Set defaults if possible.
---
>     // otherwise set defaults if possible.
45a33,52
>   function set_values($values){
>     if (!is_array($values)){return;}
>     $current = (array) $this;
>     foreach ((array)$values as $name => $val) {
>           if ($name == 'settings' && !empty($val) && is_scalar($val)) {
>             $this->set_values(unserialize($val));
>           }
>           elseif (array_key_exists($name, $current) && !is_null($val)) {
>             $func = 'set_'. $name;
>             if (method_exists($this, $func)) {
>               $this->$func($val);
>             }
>             else {
>               $this->$name = $val;
>             }
>             unset($current[$name]);
>           }
>         }
>   }
>   
59a67,84
>   /*
>    * Only set the title value once
>    */
>   function set_title($val){
>     if(isset($this->title)){dpm(isset($this->title),'is title set');return;}
>     dpm($val,'passed in title');
>     dpm(filter_xss($val),'filtered value');
>     $this->title = filter_xss($val);
>   }
>   
> /*
>    * Only set the description value once
>    */
>   function set_description($val){
>     if(isset($this->description)){dpm(isset($this->description),'is description set');return;}
>     $this->description = filter_xss($val);
>   }
>   
266c291
< 
---
>   
268c293
<     $this->__construct($values);
---
>     $this->set_values($values);
