コード例 #1
0
 /**
  * @param bool|false|int $Id
  *
  * @return Stage
  */
 public function frontendSearch($Id = false)
 {
     $Stage = new Stage('Suche', 'nach Gruppe');
     $tblGroupAll = Group::useService()->getGroupAll();
     if (!empty($tblGroupAll)) {
         /** @noinspection PhpUnusedParameterInspection */
         array_walk($tblGroupAll, function (TblGroup &$tblGroup, $Index, Stage $Stage) {
             $Stage->addButton(new Standard($tblGroup->getName(), new Route(__NAMESPACE__), new PersonGroup(), array('Id' => $tblGroup->getId()), $tblGroup->getDescription()));
         }, $Stage);
     }
     $tblGroup = Group::useService()->getGroupById($Id);
     if ($tblGroup) {
         $tblCompanyAll = Group::useService()->getCompanyAllByGroup($tblGroup);
         if ($tblCompanyAll) {
             array_walk($tblCompanyAll, function (TblCompany &$tblCompany) {
                 $tblCompany->Option = new Standard('', '/Corporation/Company', new Pencil(), array('Id' => $tblCompany->getId()), 'Bearbeiten');
             });
         }
         $Stage->setContent(new Layout(new LayoutGroup(array(new LayoutRow(new LayoutColumn(new Panel(new PersonGroup() . ' Gruppe', array(new Bold($tblGroup->getName()), $tblGroup->getDescription() ? new Small($tblGroup->getDescription()) : '', $tblGroup->getRemark() ? new Danger(new Italic(nl2br($tblGroup->getRemark()))) : ''), Panel::PANEL_TYPE_SUCCESS))), new LayoutRow(new LayoutColumn(new TableData($tblCompanyAll, null, array('Name' => 'Name', 'Description' => 'Beschreibung', 'Option' => 'Optionen'))))))));
     } else {
         $Stage->setMessage('Bitte wählen Sie eine Gruppe');
     }
     return $Stage;
 }
コード例 #2
0
ファイル: Search.php プロジェクト: BozzaCoon/SPHERE-Framework
 public static function registerApplication()
 {
     Group\Group::registerModule();
 }