replace table with form controll

This commit is contained in:
Uwe Steinmann 2021-05-04 17:29:07 +02:00
parent 62d8197751
commit 9990fdb57d

View File

@ -115,99 +115,90 @@ myTA.focus();
<div>
<?php
$this->contentContainerStart();
?>
<table>
<tr>
<td valign="top" class="inputDescription"><?php echo getMLText("keywords")?>:</td>
<td><textarea id="keywordta" rows="5" cols="30"></textarea></td>
</tr>
<tr>
<td class="inputDescription"><?php echo getMLText("global_default_keywords")?>:</td>
<td>
<select _onchange="showKeywords(0)" id="categories0">
<option value="-1"><?php echo getMLText("choose_category")?>
<?php
foreach ($categories as $category) {
$owner = $category->getOwner();
if (!$owner->isAdmin())
continue;
print "<option value=\"".$category->getID()."\">" . htmlspecialchars($category->getName());
}
?>
</select>
</td>
</tr>
<?php
foreach ($categories as $category) {
$owner = $category->getOwner();
if (!$owner->isAdmin())
continue;
?>
<tr id="keywords<?php echo $category->getID()?>" style="display : none;">
<td valign="top" class="inputDescription"><?php echo getMLText("default_keywords")?>:</td>
<td>
<?php
$lists = $category->getKeywordLists();
if (count($lists) == 0) print getMLText("no_default_keywords");
else {
print "<ul>";
foreach ($lists as $list) {
print "<li><a class=\"insertkeyword\" keyword=\"".htmlspecialchars($list["keywords"])."\">".htmlspecialchars($list["keywords"])."</a></li>";
}
print "</ul>";
}
?>
</td>
</tr>
<?php } ?>
<tr>
<td class="inputDescription"><?php echo getMLText("personal_default_keywords")?>:</td>
<td>
<select _onchange="showKeywords(1)" id="categories1">
<option value="-1"><?php echo getMLText("choose_category")?>
<?php
foreach ($categories as $category) {
$owner = $category->getOwner();
if ($owner->isAdmin())
continue;
print "<option value=\"".$category->getID()."\">" . htmlspecialchars($category->getName());
}
?>
</select>
</td>
</tr>
<?php
$this->formField(
getMLText("keywords"),
array(
'element'=>'textarea',
'id'=>'keywordta',
'rows'=>4,
)
);
$options = array();
$options[] = array('-1', getMLText('choose_category'));
foreach ($categories as $category) {
$owner = $category->getOwner();
if ($owner->isAdmin())
continue;
?>
<tr id="keywords<?php echo $category->getID()?>" style="display : none;">
<td valign="top" class="inputDescription"><?php echo getMLText("default_keywords")?>:</td>
<td class="standardText">
<?php
$lists = $category->getKeywordLists();
if (count($lists) == 0) print getMLText("no_default_keywords");
else {
print "<ul>";
foreach ($lists as $list) {
print "<li><a class=\"insertkeyword\" keyword=\"".htmlspecialchars($list["keywords"])."\">".htmlspecialchars($list["keywords"])."</a></li>";
}
print "</ul>";
if($owner->isAdmin())
$options[] = array(''.$category->getID(), htmlspecialchars($category->getName()));
}
$this->formField(
getMLText("global_default_keywords"),
array(
'element'=>'select',
'id'=>'categories0',
'options'=>$options,
)
);
foreach ($categories as $category) {
$owner = $category->getOwner();
if($owner->isAdmin()) {
$lists = $category->getKeywordLists();
if(count($lists) == 0) print getMLText("no_default_keywords");
else {
$kw = array();
foreach ($lists as $list) {
$kw[] = "<a class=\"insertkeyword\" keyword=\"".htmlspecialchars($list["keywords"])."\"><span class=\"badge badge-secondary\">".htmlspecialchars($list["keywords"])."</span></a>";
}
?>
</td>
</tr>
<?php } ?>
</table>
<?php
echo '<div id="keywords'.$category->getId().'" style="display: none;">';
$this->formField(
getMLText("default_keywords"),
array(
'element'=>'plain',
'name'=>'categories0',
'value'=>implode(' ', $kw),
)
);
echo '</div>';
}
}
}
$options = array();
$options[] = array('-1', getMLText('choose_category'));
foreach ($categories as $category) {
$owner = $category->getOwner();
if(!$owner->isAdmin())
$options[] = array(''.$category->getID(), htmlspecialchars($category->getName()));
}
$this->formField(
getMLText("personal_default_keywords"),
array(
'element'=>'select',
'id'=>'categories1',
'options'=>$options,
)
);
foreach ($categories as $category) {
$owner = $category->getOwner();
if(!$owner->isAdmin()) {
$lists = $category->getKeywordLists();
if(count($lists) == 0) print getMLText("no_default_keywords");
else {
$kw = array();
foreach ($lists as $list) {
$kw[] = "<a class=\"insertkeyword\" keyword=\"".htmlspecialchars($list["keywords"])."\"><span class=\"badge badge-secondary\">".htmlspecialchars($list["keywords"])."</span></a>";
}
echo '<div id="keywords'.$category->getId().'" style="display: none;">';
$this->formField(
getMLText("default_keywords"),
array(
'element'=>'plain',
'name'=>'categories0',
'value'=>implode(', ', $kw),
)
);
echo '</div>';
}
}
}
$this->contentContainerEnd();
echo '<script src="../out/out.KeywordChooser.php?action=js&'.$_SERVER['QUERY_STRING'].'"></script>'."\n";
// $this->htmlEndPage();