replace most of the html

This commit is contained in:
Uwe Steinmann 2021-05-04 17:29:30 +02:00
parent 9990fdb57d
commit 7da093ff4e
3 changed files with 40 additions and 33 deletions

View File

@ -322,8 +322,6 @@ $(document).ready( function() {
$attrdefs = $this->params['attrdefs'];
$selattrdef = $this->params['selattrdef'];
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/bootbox/bootbox.min.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
@ -333,7 +331,7 @@ $(document).ready( function() {
$this->columnStart(6);
?>
<form class="form-horizontal">
<select class="chzn-select" id="selector" class="input-xlarge">
<select class="form-control chzn-select" id="selector" class="input-xlarge">
<option value="-1"><?php echo getMLText("choose_attrdef")?></option>
<option value="0"><?php echo getMLText("new_attrdef")?></option>
<?php

View File

@ -64,7 +64,7 @@ $(document).ready( function() {
if($selcat) {
$this->contentHeading(getMLText("category_info"));
$c = $selcat->countDocumentsByCategory();
echo "<table class=\"table table-condensed\">\n";
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<tr><td>".getMLText('document_count')."</td><td>".($c)."</td></tr>\n";
echo "</table>";
@ -145,8 +145,6 @@ $(document).ready( function() {
$categories = $this->params['categories'];
$selcat = $this->params['selcategory'];
$this->htmlAddHeader('<script type="text/javascript" src="../styles/'.$this->theme.'/bootbox/bootbox.min.js"></script>'."\n", 'js');
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
$this->contentStart();
@ -157,15 +155,24 @@ $(document).ready( function() {
$this->columnStart(6);
?>
<form class="form-horizontal">
<select class="chzn-select" id="selector" class="input-xlarge">
<option value="-1"><?php echo getMLText("choose_category")?>
<option value="0"><?php echo getMLText("new_document_category")?>
<?php
foreach ($categories as $category) {
print "<option value=\"".$category->getID()."\" ".($selcat && $category->getID()==$selcat->getID() ? 'selected' : '').">" . htmlspecialchars($category->getName());
}
$options = array();
$options[] = array("-1", getMLText("choose_category"));
$options[] = array("0", getMLText("new_document_category"));
foreach ($categories as $category) {
$options[] = array($category->getID(), htmlspecialchars($category->getName()), $selcat && $category->getID()==$selcat->getID());
}
$this->formField(
null, //getMLText("selection"),
array(
'element'=>'select',
'id'=>'selector',
'class'=>'chzn-select',
'options'=>$options,
'placeholder'=>getMLText('choose_category'),
)
);
?>
</select>
</form>
<div class="ajax" style="margin-bottom: 15px;" data-view="Categories" data-action="actionmenu" <?php echo ($selcat ? "data-query=\"categoryid=".$selcat->getID()."\"" : "") ?>></div>
<div class="ajax" data-view="Categories" data-action="info" <?php echo ($selcat ? "data-query=\"categoryid=".$selcat->getID()."\"" : "") ?>></div>

View File

@ -120,13 +120,13 @@ $(document).ready( function() {
function actionmenu() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$selcategoryid = $this->params['selcategoryid'];
$selcategory = $this->params['selcategory'];
if($selcategoryid && $selcategoryid > 0) {
if($selcategory && $selcategory->getId() > 0) {
?>
<form style="display: inline-block;" method="post" action="../op/op.DefaultKeywords.php" >
<?php echo createHiddenFieldWithKey('removecategory'); ?>
<input type="hidden" name="categoryid" value="<?php echo $selcategoryid?>">
<input type="hidden" name="categoryid" value="<?php echo $selcategory->getId(); ?>">
<input type="hidden" name="action" value="removecategory">
<button class="btn btn-danger" type="submit"><i class="fa fa-remove"></i> <?php echo getMLText("rm_default_keyword_category")?></button>
</form>
@ -137,7 +137,7 @@ $(document).ready( function() {
function form() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$category = $dms->getKeywordCategory($this->params['selcategoryid']);
$category = $this->params['selcategory'];
$this->showKeywordForm($category, $user);
} /* }}} */
@ -240,7 +240,7 @@ $(document).ready( function() {
$dms = $this->params['dms'];
$user = $this->params['user'];
$categories = $this->params['categories'];
$selcategoryid = $this->params['selcategoryid'];
$selcategory = $this->params['selcategory'];
$this->htmlStartPage(getMLText("admin_tools"));
$this->globalNavigation();
@ -252,31 +252,33 @@ $(document).ready( function() {
$this->columnStart(4);
?>
<form class="form-horizontal">
<select class="chzn-select" id="selector" class="input-xlarge">
<option value="-1"><?php echo getMLText("choose_category")?>
<option value="0"><?php echo getMLText("new_default_keyword_category")?>
<?php
$selected=0;
$count=2;
$options = array();
$options[] = array("-1", getMLText("choose_category"));
$options[] = array("0", getMLText("new_default_keyword_category"));
foreach ($categories as $category) {
$owner = $category->getOwner();
if ((!$user->isAdmin()) && ($owner->getID() != $user->getID())) continue;
if ($selcategoryid && $category->getID()==$selcategoryid) $selected=$count;
print "<option value=\"".$category->getID()."\">" . htmlspecialchars($category->getName());
$count++;
if ($user->isAdmin() || ($owner->getID() == $user->getID()))
$options[] = array($category->getID(), htmlspecialchars($category->getName()), $selcategory && $category->getID()==$selcategory->getID());
}
$this->formField(
null, //getMLText("selection"),
array(
'element'=>'select',
'id'=>'selector',
'class'=>'chzn-select',
'options'=>$options,
'placeholder'=>getMLText('choose_category'),
)
);
?>
</select>
</form>
<div class="ajax" style="margin-bottom: 15px;" data-view="DefaultKeywords" data-action="actionmenu" <?php echo ($selcategoryid ? "data-query=\"categoryid=".$selcategoryid."\"" : "") ?>></div>
<div class="ajax" style="margin-bottom: 15px;" data-view="DefaultKeywords" data-action="actionmenu" <?php echo ($selcategory ? "data-query=\"categoryid=".$selcategory->getId()."\"" : "") ?>></div>
<?php
$this->columnEnd();
$this->columnStart(8);
?>
<div class="ajax" data-view="DefaultKeywords" data-action="form" <?php echo ($selcategoryid ? "data-query=\"categoryid=".$selcategoryid."\"" : "") ?>></div>
<div class="ajax" data-view="DefaultKeywords" data-action="form" <?php echo ($selcategory ? "data-query=\"categoryid=".$selcategory->getId()."\"" : "") ?>></div>
</div>
<?php
$this->columnEnd();