Changeset 1328

Show
Ignore:
Timestamp:
03/18/11 21:54:35 (2 years ago)
Author:
Torben Brodt
Message:

fixes for custom gmap input

Location:
g-map
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • g-map/files/lib/data/gmap/GmapApi.class.php

    r1326 r1328  
    4444         */ 
    4545        public function getFields() { 
    46                 if(defined('GMAP_CUSTOMINPUT') && $const = GMAP_CUSTOMINPUT && !empty($const)) { 
     46                if(defined('GMAP_CUSTOMINPUT') && ($const = GMAP_CUSTOMINPUT) && !empty($const)) { 
    4747                        $tmp = explode(",", GMAP_CUSTOMINPUT); 
    4848                        $cols = array(); 
     
    8484         */ 
    8585        public function search($location) { 
    86  
    8786                if(!$this->isActive()) { 
    8887                        return; 
  • g-map/optionals/de.easy-coding.wcf.map.custominput/files/lib/system/event/listener/MapCustomInputListener.class.php

    r1327 r1328  
    1818                foreach($tmp as $field) { 
    1919                        $col = User::getUserOptionID($field); 
    20                         if($col) { 
    21                                 $cols[] = $col; 
     20                        if($col && in_array($col, explode(",", $this->optionIDs))) { 
     21                                $cols[] = $field; 
    2222                        } 
    2323                } 
     
    3636                switch($eventName) { 
    3737                        case 'readData': 
    38                                  
     38                                $this->getOptionIDs(); 
    3939                                $this->current = explode(",", $eventObj->activeOptions['gmap_custominput']['optionValue']); 
    4040                                $this->current = $this->validate($this->current); 
    4141                                $eventObj->activeOptions['gmap_custominput']['optionValue'] = implode(",", $this->current); 
    42                                 $this->getOptionIDs(); 
    4342                                $this->readOptions(); 
    4443                        break; 
     
    9796                                        AND option_table.editable < 4 
    9897                                        AND option_table.visible < 4 
     98                                        AND option_table.optionType IN ('text', 'select') 
    9999                        ORDER BY        package_dependency.priority"; 
    100100                $result = WCF::getDB()->sendQuery($sql); 
    101                 $options = array(); 
     101                $options = array(0); 
    102102                while ($row = WCF::getDB()->fetchArray($result)) { 
    103103                        $options[$row['optionName']] = $row['optionID'];