add showConfigGroup()

This commit is contained in:
Uwe Steinmann 2024-02-12 14:10:12 +01:00
parent 4eba2e3283
commit 0224793366

View File

@ -225,6 +225,37 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style {
<?php
} /* }}} */
protected function showConfigGroup($title, $name, $allowempty=false, $multiple=false, $size=0) { /* {{{ */
$settings = $this->params['settings'];
$dms = $this->params['dms'];
?>
<tr title="<?= getMLText($title."_desc") ?>">
<td><?= getMLText($title) ?></td>
<td>
<?php
$groups = $dms->getAllGroups();
if($groups) {
if(is_array($settings->{"_".$name}))
$selections = $settings->{"_".$name};
else
$selections = explode(',', $settings->{"_".$name});
echo "<select class=\"chzn-select\"".($allowempty ? " data-allow-clear=\"true\"" : "")."\" name=\"".$name.($multiple ? "[]" : "")."\"".($multiple ? " multiple" : "").($size ? " size=\"".$size."\"" : "")." data-placeholder=\"".getMLText("select_group")."\" style=\"width: 100%;\">";
if($allowempty)
echo "<option value=\"\"></option>";
foreach($groups as $curgroup) {
echo "<option value=\"".$curgroup->getID()."\"";
if(in_array($curgroup->getID(), $selections))
echo " selected";
echo ">".htmlspecialchars($curgroup->getName())."</option>";
}
echo "</select>";
}
?>
</td>
</tr>
<?php
} /* }}} */
protected function showConfigFolder($title, $name, $allowempty=false, $multiple=false, $size=0) { /* {{{ */
$settings = $this->params['settings'];
$dms = $this->params['dms'];