Beispiel #1
0
 protected function _itemFromRow(Syj_Model_Path $item, Zend_Db_Table_Row $row)
 {
     $decoder = new gisconverter\WKT();
     $geom = $decoder->geomFromText($row->wkt);
     $item->setId($row->id)->setGeom($geom)->setTitle($row->title)->setUrlComp($row->urlcomp)->setCreatorIp($row->creator_ip);
     if (!$item->getCreator()) {
         $user = new Syj_Model_User();
         $userMapper = new Syj_Model_UserMapper();
         if ($userMapper->find($row->creator, $user)) {
             $item->setCreator($user);
         }
     }
     return $item;
 }
Beispiel #2
0
 protected function _jsLoggedInfo(Syj_Model_Path $path = null)
 {
     $loggedinfo = new phptojs\JsObject('gLoggedInfo', array('connections' => 0));
     $user = $this->_helper->SyjUserManager->current();
     if ($user) {
         $loggedinfo->logged = true;
     } else {
         $loggedinfo->logged = false;
     }
     if (isset($path)) {
         $loggedinfo->iscreator = $path->isCreator($user);
         $loggedinfo->pathid = (string) $path->id;
     } else {
         $loggedinfo->iscreator = true;
     }
     $this->view->headScript()->prependScript((string) $loggedinfo);
 }