Changeset 242 for trunk


Ignore:
Timestamp:
Aug 2, 2009, 5:16:47 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Položky typu yes/no neobklopovat uvozovkami.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/system/routerboard.php

    r241 r242  
    151151  function ListUpdate($Path, $Properties, $Values, $Condition = array(), $UsePrint = false)
    152152  {
    153     if($UsePrint == 0) $List = $this->ListGet($Path, $Properties, $Condition);
    154       else $List = $this->ListGetPrint($Path, $Properties, $Condition);
     153    if($UsePrint == 0)
     154    {
     155      $List = $this->ListGet($Path, $Properties, $Condition);
     156      // Change boolean values yes/no to true/false
     157      foreach($List as $Index => $ListItem)
     158      {
     159        foreach($ListItem as $Index2 => $Item2)
     160        {
     161          if($Item2 == 'true') $List[$Index][$Index2] = 'yes';
     162          if($Item2 == 'false') $List[$Index][$Index2] = 'no';
     163        }
     164      }
     165    } else
     166    {
     167      $List = $this->ListGetPrint($Path, $Properties, $Condition);     
     168    }
    155169    $Commands = array();
    156170   
     
    184198      ksort($List[$Index]);
    185199    }
    186     print_r($List);
    187     print_r($Values);
    188    
     200    //print_r($List);
     201    //print_r($Values);
     202       
    189203    // Erase all items not existed in $Values
    190204    foreach($List as $Index => $ListItem)
     
    195209        foreach($ListItem as $Index => $Property)
    196210        {
    197           if($Property != '') $Prop .= $Index.'="'.$Property.'" ';
     211          if($Property != '')
     212          {
     213            if(($Property == 'yes') or ($Property == 'no')) $Prop .= $Index.'='.$Property.' ';
     214              else $Prop .= $Index.'="'.$Property.'" ';
     215          }
    198216        }
    199217        $Prop = substr($Prop, 0, -1);
Note: See TracChangeset for help on using the changeset viewer.