public function executeAddregion() { $c = new Criteria(); $c->add(RegionPeer::NAME, $this->getRequestParameter('region')); $exregion = RegionPeer::doSelectOne($c); if ($exregion) { $this->setFlash('notice', 'Region could not be added. A Region with this name already exists.'); } else { $region = new Region(); $region->setName($this->getRequestParameter('region')); $region->save(); $this->setFlash('notice', 'Region <b>' . $region->getName() . '</b> added successfully'); } $this->redirect('admin/regions'); }
$typeURL = false; $ctrTypeID = $contracttarget->getID(); switch ($type) { case "corp": $corp = new Corporation($ctrTypeID); $name = $corp->getName(); $typeURL = edkURI::page('corp_detail', $ctrTypeID, 'crp_id'); break; case "alliance": $alliance = new Alliance($ctrTypeID); $name = $alliance->getName(); $typeURL = edkURI::page('alliance_detail', $ctrTypeID, 'all_id'); break; case "region": $region = new Region($ctrTypeID); $name = $region->getName(); $typeURL = edkURI::page('detail_view', $ctrTypeID, 'region_id'); break; case "system": $system = new SolarSystem($ctrTypeID); $name = $system->getName(); $typeURL = edkURI::page('system_detail', $ctrTypeID, 'sys_id'); break; } if ($typeURL) { $html .= '<tr class=kb-table-row-odd><td class=kb-table-cell><b><a href="' . $typeURL . '">' . $name . '</b></td><td class=kb-table-cell align=center>'; } else { $html .= "<tr class=kb-table-row-odd><td class=kb-table-cell><b>" . $name . "</b></td><td class=kb-table-cell align=center>"; } if ($type == "corp") { $html .= "x";
/** * @param Region $region The region */ private function loadWidgets($region) { $pagePartAdminConfiguration = null; foreach ($this->pagePartAdminConfigurations as $ppac) { if ($ppac->getContext() == $region->getName()) { $pagePartAdminConfiguration = $ppac; } } if ($pagePartAdminConfiguration !== null) { $pagePartWidget = new PagePartWidget($this->page, $this->request, $this->em, $pagePartAdminConfiguration, $this->formFactory, $this->pagePartAdminFactory); $this->widgets[$region->getName()] = $pagePartWidget; } }