$insMsk->setAttribute(1, new Hiddenfield($regelItemsDbTable->getNewEntryButtonName(), "-"));
            }
            $rNew = $itemsTable->createRow();
            $rNew->setSpawnAll(true);
            $rNew->setAttribute(0, $insMsk);
            $itemsTable->addRow($rNew);
            $itemsTable->addSpacer(0, 10);
        }
    }
    if (isset($_REQUEST["DbTableUpdate" . $regelItemsDbTable->TABLENAME])) {
        $regelItemsDbTable->doUpdate();
    }
    $itemsTable->addSpacer(0, 15);
    $rZuordnung = $itemsTable->createRow();
    $rZuordnung->setSpawnAll(true);
    $rZuordnung->setAttribute(0, $regelItemsDbTable->getUpdateAllMask());
    $itemsTable->addRow($rZuordnung);
    $itemsTable->addSpacer(0, 10);
    $newItemBtn = $regelItemsDbTable->getNewEntryButton("Schaltung anlegen");
    $rZuordnung = $itemsTable->createRow();
    $rZuordnung->setSpawnAll(true);
    $rZuordnung->setAttribute(0, $newItemBtn);
    $itemsTable->addRow($rZuordnung);
    $form = new Form();
    $form->add($spc);
    $form->add($itemsTable);
    $form->add($spc);
    $form->show();
} else {
    // Regel-Auswahl Combobox anzeigen,
    // wenn noch keine Regel ausgewählt wurde
    $alarmgeberDBTbl = new DbTable($_SESSION['config']->DBCONNECT, "homecontrol_alarm_geber", array("name", "ip"), "", "", "name", "");
    $alarmgeberDBTbl->setDeleteInUpdate(true);
    $alarmgeberDBTbl->setHeaderEnabled(true);
    $alarmgeberDBTbl->setToCheck("name", "ip");
    $alarmgeberDBTbl->setWidth("100%");
    // --------------------------------------------------
    //  Neuer Eintrag
    // --------------------------------------------------
    if (isset($_REQUEST['dbTableNew' . $alarmgeberDBTbl->TABLENAME])) {
        $alarmgeberDBTbl->showInsertMask();
    }
    if (isset($_REQUEST['InsertIntoDB' . $alarmgeberDBTbl->TABLENAME]) && $_REQUEST['InsertIntoDB' . $alarmgeberDBTbl->TABLENAME] == "Speichern") {
        $alarmgeberDBTbl->doInsert();
    }
    // --------------------------------------------------
    //  Bearbeiten-Maske
    // --------------------------------------------------
    if (isset($_REQUEST["DbTableUpdate" . $alarmgeberDBTbl->TABLENAME])) {
        $alarmgeberDBTbl->doUpdate();
    }
    $mskUpdate = $alarmgeberDBTbl->getUpdateAllMask();
    $mskUpdate->show();
    $spc = new Spacer();
    $spc->setHeight(10);
    $spc->show();
    if (!isset($_REQUEST['dbTableNew' . $alarmgeberDBTbl->TABLENAME])) {
        $newBtn = $alarmgeberDBTbl->getNewEntryButton("Neuen Alarmgeber anlegen");
        $newBtn->show();
    }
    $spc->show();
}
Ejemplo n.º 3
0
 /**
  * Zeigt das gesamte DIV an
  */
 function show()
 {
     echo "<div ";
     if ($this->XPOS > 0 || $this->YPOS > 0) {
         $tmp = ":absolute; ";
         if ($this->YPOS > 0) {
             $tmp .= " top:" . $this->YPOS . "px; ";
         }
         if ($this->XPOS > 0) {
             $tmp .= " left:" . $this->XPOS . "px; ";
         }
         $this->setStyle("position", $tmp);
     }
     $this->getToolTipTag();
     $this->showStyles();
     echo " > ";
     if ($this->KOPFTEXT_NEED) {
         /*
          * Bei berechtigung, Kopftext bearbeiten.
          */
         if ($_SESSION['config']->CURRENTUSER->STATUS == "admin" || $_SESSION['config']->CURRENTUSER->STATUS == "user") {
             if (isset($_REQUEST['changeHeadInfo']) && strlen($_REQUEST['changeHeadInfo']) > 5) {
                 $ktRl = substr($_REQUEST['changeHeadInfo'], 5);
                 $dbtbl = new DbTable($_SESSION['config']->DBCONNECT, "kopftexte", array("text"), "", "", "", "runlink = '" . $ktRl . "' ");
                 if ($dbtbl->getRowCount() == 0) {
                     $dbtblInsert = new DbTable($_SESSION['config']->DBCONNECT, "kopftexte", array("runlink", "parent", "text"), "", "", "", "runlink = '" . $ktRl . "' ");
                     $dbtblInsert->insertRowByArray(array($ktRl, null, ""));
                     $dbtbl->refresh();
                 }
                 if (isset($_REQUEST['DbTableUpdate' . $dbtbl->TABLENAME]) && $_REQUEST['DbTableUpdate' . $dbtbl->TABLENAME] == "Speichern") {
                     $dbtbl->doUpdate();
                 }
                 $frm = $dbtbl->getUpdateAllMask();
                 $frm->add(new Hiddenfield("changeHeadInfo", $_REQUEST['changeHeadInfo']));
                 $frm->show();
             } else {
                 $sp = new Spacer(5);
                 $sp->show();
                 $txKtb = new Text("Kopftext bearbeiten<br>");
                 $txKtb->setFilter(false);
                 $lnk = new Link("?changeHeadInfo=Cnge-" . $_SESSION['runLink'], $txKtb);
                 $lnk->show();
             }
         }
         $tx = new Text(getKopfText());
         $tx->setFilter(false);
         $tx->show();
     }
     if ($this->getObjectCount() > 0) {
         foreach ($this->OBJECTS as $obj) {
             $obj->show();
         }
     }
     //--------------
     include $this->FILE;
     //--------------
     echo "</div>";
 }