public function load($row, $postData = array())
 {
     if ($this->_latitudeFieldname && $this->_longitudeFieldname) {
         return array($this->getFieldName() => $row->{$this->_latitudeFieldname} . ';' . $row->{$this->_longitudeFieldname});
     } else {
         return parent::load($row, $postData);
     }
 }
Пример #2
0
 public function load($row, $postData = array())
 {
     $ret = parent::load($row, $postData);
     if (!empty($ret[$this->getFieldName()])) {
         $id = $ret[$this->getFieldName()];
         $ret[$this->getFieldName()] = array('id' => $id);
         $cmp = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($id, array('ignoreVisible' => true));
         if ($cmp) {
             $title = array();
             do {
                 if ($cmp->generator->getGeneratorFlag('showInPageTreeAdmin') && $cmp->name) {
                     $title[] = $cmp->name;
                 }
             } while (($cmp = $cmp->parent) && $cmp->componentId != 'root');
             $ret[$this->getFieldName()]['name'] = implode(' - ', $title);
         } else {
             $ret[$this->getFieldName()]['id'] = null;
             $ret[$this->getFieldName()]['name'] = '';
         }
     }
     return $ret;
 }
Пример #3
0
 public function load($row, $postData = array())
 {
     $ret = parent::load($row, $postData);
     $ref = $this->getReference();
     if ($ref && $row && !empty($ret[$this->getFieldName()])) {
         $id = $ret[$this->getFieldName()];
         $parentRow = $row->getParentRow($ref);
         if ($parentRow) {
             $displayField = $this->getDisplayField();
             if ($displayField) {
                 $ret[$this->getFieldName()] = array('id' => $id, 'name' => $parentRow->{$displayField});
             } else {
                 if ($parentRow instanceof Kwf_Model_Tree_Row_Interface) {
                     $ret[$this->getFieldName()] = array('id' => $id, 'name' => $parentRow->getTreePath());
                 } else {
                     $ret[$this->getFieldName()] = array('id' => $id, 'name' => $parentRow->__toString());
                 }
             }
         } else {
             $ret[$this->getFieldName()] = array('id' => $id, 'name' => '');
         }
     }
     return $ret;
 }