コード例 #1
0
ファイル: UtilGUI.class.php プロジェクト: nemiah/poolPi
 public static function EMailPopupAttachmentsSP($dataClass, $dataClassID, $callbackParameter = null)
 {
     $c = new $dataClass($dataClassID);
     $data = $c->getEMailData($callbackParameter);
     $T = new HTMLTable(1, "Anhänge");
     foreach ($data["attachmentsAlways"] as $file) {
         $T->addRow("<small>{$file}</small>");
         $T->addCellStyle(1, "max-width: 100px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;");
     }
     echo $T;
     $T = new HTMLTable(2, "Mögliche Anhänge");
     $T->setColWidth(1, 20);
     foreach ($data["attachmentsOptional"] as $k => $file) {
         $I = new HTMLInput("addFile{$k}", "checkbox");
         $I->style("margin:0px;");
         $I->data("value", $file);
         $T->addRow(array($I, "<small>{$file}</small>"));
         $T->addCellStyle(2, "max-width: 100px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;cursor:pointer;");
         $T->addCellEvent(2, "click", "\$j('[name=addFile{$k}]').prop('checked', !\$j('[name=addFile{$k}]').prop('checked'));");
     }
     echo ((isset($data["attachmentsOptional"]) and count($data["attachmentsOptional"])) ? "<div style=\"height:30px;\"></div>" : "") . "<form id=\"UtilEmailFormAttachments\">" . $T . "</form>";
 }