Merge pull request #55 from LDAPAccountManager/feature/responsiveList
Feature/responsive list
This commit is contained in:
commit
a97e489ba7
Binary file not shown.
After Width: | Height: | Size: 719 B |
Binary file not shown.
After Width: | Height: | Size: 801 B |
Binary file not shown.
After Width: | Height: | Size: 686 B |
Binary file not shown.
After Width: | Height: | Size: 764 B |
|
@ -2040,6 +2040,8 @@ class htmlInputCheckbox extends htmlElement {
|
||||||
protected $elementsToEnable = array();
|
protected $elementsToEnable = array();
|
||||||
/** list of input elements to disable when checked */
|
/** list of input elements to disable when checked */
|
||||||
protected $elementsToDisable = array();
|
protected $elementsToDisable = array();
|
||||||
|
/** onclick event code */
|
||||||
|
private $onClick;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2167,7 +2169,11 @@ class htmlInputCheckbox extends htmlElement {
|
||||||
if (!empty($onChange)) {
|
if (!empty($onChange)) {
|
||||||
$onChange = ' onChange="' . $onChange . '"';
|
$onChange = ' onChange="' . $onChange . '"';
|
||||||
}
|
}
|
||||||
echo '<input type="checkbox" id="' . $this->name . '" name="' . $this->name . '"' . $classes . $tabindexValue . $onChange . $checked . $disabled . '>';
|
$onClick = '';
|
||||||
|
if (!empty($this->onClick)) {
|
||||||
|
$onClick = ' onclick="' . $this->onClick . '"';
|
||||||
|
}
|
||||||
|
echo '<input type="checkbox" id="' . $this->name . '" name="' . $this->name . '"' . $classes . $tabindexValue . $onChange . $onClick . $checked . $disabled . '>';
|
||||||
echo $script;
|
echo $script;
|
||||||
if ($this->transient) {
|
if ($this->transient) {
|
||||||
return array();
|
return array();
|
||||||
|
@ -2250,6 +2256,15 @@ class htmlInputCheckbox extends htmlElement {
|
||||||
return 'tr';
|
return 'tr';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the onclick code.
|
||||||
|
*
|
||||||
|
* @param string $code JS code
|
||||||
|
*/
|
||||||
|
public function setOnClick($code) {
|
||||||
|
$this->onClick = $code;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4663,6 +4678,14 @@ class htmlResponsiveTable extends htmlElement {
|
||||||
|
|
||||||
/** highlighted rows */
|
/** highlighted rows */
|
||||||
private $highlighted = array();
|
private $highlighted = array();
|
||||||
|
/** CSS class for odd row numbers */
|
||||||
|
private $cssOddRow;
|
||||||
|
/** CSS class for even row numbers */
|
||||||
|
private $cssEvenRow;
|
||||||
|
/** onclick code (row number => code) */
|
||||||
|
private $onClick = array();
|
||||||
|
/** ondoubleclick code (row number => code) */
|
||||||
|
private $onDoubleClick = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the table.
|
* Creates the table.
|
||||||
|
@ -4689,7 +4712,8 @@ class htmlResponsiveTable extends htmlElement {
|
||||||
$classes[] = 'responsive-table';
|
$classes[] = 'responsive-table';
|
||||||
echo '<table class="' . implode(' ', $classes) . '">';
|
echo '<table class="' . implode(' ', $classes) . '">';
|
||||||
echo '<thead>';
|
echo '<thead>';
|
||||||
echo '<tr>';
|
$headClass = empty($this->cssOddRow) ? '' : ' class="' . $this->cssOddRow . '"';
|
||||||
|
echo '<tr ' . $headClass . '>';
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
foreach ($this->titles as $title) {
|
foreach ($this->titles as $title) {
|
||||||
$width = '';
|
$width = '';
|
||||||
|
@ -4706,10 +4730,28 @@ class htmlResponsiveTable extends htmlElement {
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
foreach ($this->data as $row) {
|
foreach ($this->data as $row) {
|
||||||
$cssClass = '';
|
$cssClass = '';
|
||||||
|
$cssClasses = array();
|
||||||
if (in_array($counter, $this->highlighted)) {
|
if (in_array($counter, $this->highlighted)) {
|
||||||
$cssClass = ' class="bold"';
|
$cssClasses[] = 'bold';
|
||||||
}
|
}
|
||||||
echo '<tr ' . $cssClass . '>';
|
if (!empty($this->cssEvenRow) && ($counter % 2 === 0)) {
|
||||||
|
$cssClasses[] = $this->cssEvenRow;
|
||||||
|
}
|
||||||
|
if (!empty($this->cssOddRow) && ($counter % 2 === 1)) {
|
||||||
|
$cssClasses[] = $this->cssOddRow;
|
||||||
|
}
|
||||||
|
if (!empty($cssClasses)) {
|
||||||
|
$cssClass = ' class="' . implode(' ', $cssClasses) . '"';
|
||||||
|
}
|
||||||
|
$onClick = '';
|
||||||
|
if (!empty($this->onClick[$counter])) {
|
||||||
|
$onClick = ' onclick="' . $this->onClick[$counter] . '"';
|
||||||
|
}
|
||||||
|
$onDoubleClick = '';
|
||||||
|
if (!empty($this->onDoubleClick[$counter])) {
|
||||||
|
$onDoubleClick = ' ondblclick="' . $this->onDoubleClick[$counter] . '"';
|
||||||
|
}
|
||||||
|
echo '<tr ' . $cssClass . $onClick . $onDoubleClick . '>';
|
||||||
for ($i = 0; $i < $titleCount; $i++) {
|
for ($i = 0; $i < $titleCount; $i++) {
|
||||||
echo '<td data-label="' . $this->titles[$i] . '">';
|
echo '<td data-label="' . $this->titles[$i] . '">';
|
||||||
$ids = parseHtml($module, $row[$i], $values, $restricted, $tabindex, $scope);
|
$ids = parseHtml($module, $row[$i], $values, $restricted, $tabindex, $scope);
|
||||||
|
@ -4728,6 +4770,36 @@ class htmlResponsiveTable extends htmlElement {
|
||||||
$this->widths = $widths;
|
$this->widths = $widths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the CSS classes for odd and even rows.
|
||||||
|
* The title row counts as row number -1.
|
||||||
|
*
|
||||||
|
* @param string $oddClass class for odd rows
|
||||||
|
* @param string $evenClass class for even rows
|
||||||
|
*/
|
||||||
|
public function setRowClasses($oddClass, $evenClass) {
|
||||||
|
$this->cssOddRow = $oddClass;
|
||||||
|
$this->cssEvenRow = $evenClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the onclick code for the rows.
|
||||||
|
*
|
||||||
|
* @param array $calls row number => code
|
||||||
|
*/
|
||||||
|
public function setOnClickEvents($calls) {
|
||||||
|
$this->onClick = $calls;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the ondoubleclick code for the rows.
|
||||||
|
*
|
||||||
|
* @param array $calls row number => code
|
||||||
|
*/
|
||||||
|
public function setOnDoubleClickEvents($calls) {
|
||||||
|
$this->onDoubleClick = $calls;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
use LAM\TYPES\ConfiguredType;
|
use LAM\TYPES\ConfiguredType;
|
||||||
use phpseclib\Net\SFTP\Stream;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
@ -173,7 +172,7 @@ class lamList {
|
||||||
// get some parameters
|
// get some parameters
|
||||||
$this->listGetParams();
|
$this->listGetParams();
|
||||||
// print HTML head
|
// print HTML head
|
||||||
$this->listPrintHeader();
|
$this->printHeader();
|
||||||
// print messages when redirected from other pages
|
// print messages when redirected from other pages
|
||||||
$this->listPrintRedirectMessages();
|
$this->listPrintRedirectMessages();
|
||||||
// refresh data if needed
|
// refresh data if needed
|
||||||
|
@ -202,12 +201,7 @@ class lamList {
|
||||||
// navigation bar
|
// navigation bar
|
||||||
$this->listDrawNavigationBar(sizeof($this->entries));
|
$this->listDrawNavigationBar(sizeof($this->entries));
|
||||||
echo ("<br>\n");
|
echo ("<br>\n");
|
||||||
echo "<div id=\"listScrollArea\" style=\"overflow: auto; padding: 1px;\">";
|
$this->printAccountTable($this->entries);
|
||||||
// account table head
|
|
||||||
$this->listPrintTableHeader();
|
|
||||||
// account table body
|
|
||||||
$this->listPrintTableBody($this->entries);
|
|
||||||
echo "</div>";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// buttons
|
// buttons
|
||||||
|
@ -216,11 +210,11 @@ class lamList {
|
||||||
// navigation bar
|
// navigation bar
|
||||||
$this->listDrawNavigationBar(sizeof($this->entries));
|
$this->listDrawNavigationBar(sizeof($this->entries));
|
||||||
echo ("<br>\n");
|
echo ("<br>\n");
|
||||||
// account table head
|
$accounts = array();
|
||||||
$this->listPrintTableHeader();
|
$this->printAccountTable($accounts);
|
||||||
echo "</table><br>\n";
|
echo "</table><br>\n";
|
||||||
}
|
}
|
||||||
$this->listPrintFooter();
|
$this->printFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -313,23 +307,27 @@ class lamList {
|
||||||
*/
|
*/
|
||||||
protected function listDrawNavigationBar($count) {
|
protected function listDrawNavigationBar($count) {
|
||||||
$filter = $this->getFilterAsTextForURL();
|
$filter = $this->getFilterAsTextForURL();
|
||||||
echo("<table width=\"100%\" border=\"0\">\n");
|
$row = new htmlResponsiveRow();
|
||||||
echo("<tr>\n");
|
$row->setCSSClasses(array('maxrow'));
|
||||||
echo("<td align=\"left\">");
|
$countLabel = new htmlOutputText(sprintf($this->labels['nav'], $count));
|
||||||
printf($this->labels['nav'], $count);
|
$row->add($countLabel, 12, 6, 6);
|
||||||
echo("</td>");
|
$navGroup = new htmlGroup();
|
||||||
|
|
||||||
if ($count > $this->maxPageEntries) {
|
if ($count > $this->maxPageEntries) {
|
||||||
echo("<td class=\"activepage\" align=\"right\">");
|
|
||||||
if ($this->page != 1) {
|
if ($this->page != 1) {
|
||||||
echo("<a title=\"" . _('Jump to first page') . "\" href=\"list.php?type=" . $this->type->getId() . "&norefresh=true&page=1" .
|
$linkHref = "list.php?type=" . $this->type->getId() . "&norefresh=true&page=1" .
|
||||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter;
|
||||||
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-first.png\"></a>\n");
|
$link = new htmlLink(null, $linkHref, '../../graphics/go-first.png');
|
||||||
|
$link->setTitle(_('Jump to first page'));
|
||||||
|
$link->setCSSClasses(array('margin5'));
|
||||||
|
$navGroup->addElement($link);
|
||||||
}
|
}
|
||||||
if ($this->page > 11) {
|
if ($this->page > 11) {
|
||||||
echo("<a title=\"" . _('Jump 10 pages backward') . "\" href=\"list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . ($this->page - 10) .
|
$linkHref = "list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . ($this->page - 10) .
|
||||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter;
|
||||||
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-previous.png\"></a>\n");
|
$link = new htmlLink(null, $linkHref, '../../graphics/go-previous.png');
|
||||||
|
$link->setTitle(_('Jump 10 pages backward'));
|
||||||
|
$link->setCSSClasses(array('margin5'));
|
||||||
|
$navGroup->addElement($link);
|
||||||
}
|
}
|
||||||
$pageCount = ceil($count / $this->maxPageEntries);
|
$pageCount = ceil($count / $this->maxPageEntries);
|
||||||
for ($i = $this->page - 6; $i < ($this->page + 5); $i++) {
|
for ($i = $this->page - 6; $i < ($this->page + 5); $i++) {
|
||||||
|
@ -340,30 +338,41 @@ class lamList {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($i == $this->page - 1) {
|
if ($i == $this->page - 1) {
|
||||||
$url = "list.php?type=" . $this->type->getId() . "&norefresh=true" .
|
$url = "list.php?type=" . $this->type->getId() . "&norefresh=true" .
|
||||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter;
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter;
|
||||||
echo '<input type="number" class="listPageInput" id="listNavPage" name="listNavPage"'
|
$navInput = new htmlInputField('listNavPage', ($i + 1));
|
||||||
. ' value="' . ($i + 1) . '" min="1" max="' . $pageCount . '"'
|
$navInput->setMinimumAndMaximumNumber(1, $pageCount);
|
||||||
. ' onkeypress="listPageNumberKeyPress(\'' . $url . '\', event);">';
|
$navInput->setCSSClasses(array('listPageInput'));
|
||||||
|
$navInput->setOnKeyPress('listPageNumberKeyPress(\'' . $url . '\', event);');
|
||||||
|
$navGroup->addElement($navInput);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo " <a href=\"list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . ($i + 1) .
|
$linkHref = "list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . ($i + 1) .
|
||||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" . ($i + 1) . "</a>\n";
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter;
|
||||||
|
$link = new htmlLink(($i + 1), $linkHref);
|
||||||
|
$link->setCSSClasses(array('margin5'));
|
||||||
|
$navGroup->addElement($link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->page < ($pageCount - 10)) {
|
if ($this->page < ($pageCount - 10)) {
|
||||||
echo("<a title=\"" . _('Jump 10 pages forward') . "\" href=\"list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . ($this->page + 10) .
|
$linkHref = "list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . ($this->page + 10) .
|
||||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter;
|
||||||
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-next.png\"></a>\n");
|
$link = new htmlLink(null, $linkHref, '../../graphics/go-next.png');
|
||||||
|
$link->setTitle(_('Jump 10 pages forward'));
|
||||||
|
$link->setCSSClasses(array('margin5'));
|
||||||
|
$navGroup->addElement($link);
|
||||||
}
|
}
|
||||||
if ($this->page < $pageCount) {
|
if ($this->page < $pageCount) {
|
||||||
echo("<a title=\"" . _('Jump to last page') . "\" href=\"list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . $pageCount .
|
$linkHref = "list.php?type=" . $this->type->getId() . "&norefresh=true&page=" . $pageCount .
|
||||||
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter . "\">" .
|
"&sort=" . $this->sortColumn . "&sortdirection=" . $this->sortDirection . $filter;
|
||||||
"<img height=16 width=16 class=\"align-middle\" alt=\"\" src=\"../../graphics/go-last.png\"></a>\n");
|
$link = new htmlLink(null, $linkHref, '../../graphics/go-last.png');
|
||||||
|
$link->setTitle(_('Jump to last page'));
|
||||||
|
$link->setCSSClasses(array('margin5'));
|
||||||
|
$navGroup->addElement($link);
|
||||||
}
|
}
|
||||||
echo "</td>";
|
|
||||||
}
|
}
|
||||||
echo "</tr></table>\n";
|
$row->add($navGroup, 12, 6, 6, 'responsiveLabel');
|
||||||
|
parseHtml(null, $row, array(), false, $this->tabindex, $this->type->getScope());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -374,106 +383,119 @@ class lamList {
|
||||||
protected function getFilterAsTextForURL() {
|
protected function getFilterAsTextForURL() {
|
||||||
$text = '';
|
$text = '';
|
||||||
foreach ($this->filters as $attr => $filter) {
|
foreach ($this->filters as $attr => $filter) {
|
||||||
$text .= "&filter" . strtolower($attr) . '=' . $filter;
|
$text .= "&filter" . strtolower($attr) . '=' . $filter;
|
||||||
}
|
}
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints the attribute and filter row at the account table head
|
|
||||||
*/
|
|
||||||
protected function listPrintTableHeader() {
|
|
||||||
$filter = $this->getFilterAsTextForURL();
|
|
||||||
// print table header
|
|
||||||
echo "<table id=\"accountTable\" frame=\"box\" rules=\"none\" class=\"" . $this->type->getScope() . "-border collapse accountlist ui-corner-all\" width=\"100%\"><thead>\n";
|
|
||||||
echo "<tr class=\"" . $this->type->getScope() . "-dark\">\n";
|
|
||||||
echo "<th width=22 height=34><a href=\"#\" onClick=\"list_switchAccountSelection();\"><img height=16 width=16 src=\"../../graphics/selectDown.png\" alt=\"select all\"></a></th>\n";
|
|
||||||
echo "<td> <a href=\"#\" onClick=\"list_switchAccountSelection();\">" .
|
|
||||||
"<font color=\"black\"><small>" . _("Select all") . "</small></font></a></td>\n";
|
|
||||||
// table header
|
|
||||||
for ($k = 0; $k < sizeof($this->descArray); $k++) {
|
|
||||||
if (strtolower($this->attrArray[$k]) == $this->sortColumn) {
|
|
||||||
$sortImage = "sort_asc.png";
|
|
||||||
if ($this->sortDirection < 0) {
|
|
||||||
$sortImage = "sort_desc.png";
|
|
||||||
}
|
|
||||||
echo "<th align=\"left\"><a href=\"list.php?type=" . $this->type->getId() . "&".
|
|
||||||
"sort=" . strtolower($this->attrArray[$k]) . $filter . "&norefresh=y" . "\">" . $this->descArray[$k] .
|
|
||||||
" <img height=16 width=16 style=\"vertical-align: middle;\" src=\"../../graphics/$sortImage\" alt=\"sort direction\"></a></th>\n";
|
|
||||||
}
|
|
||||||
else echo "<th align=\"left\"><a href=\"list.php?type=" . $this->type->getId() . "&".
|
|
||||||
"sort=" . strtolower($this->attrArray[$k]) . $filter . "&norefresh=y" . "\">" . $this->descArray[$k] . "</a></th>\n";
|
|
||||||
}
|
|
||||||
echo "</tr>\n";
|
|
||||||
|
|
||||||
// print filter row
|
|
||||||
echo "<tr align=\"center\" class=\"" . $this->type->getScope() . "-bright\">\n";
|
|
||||||
echo "<td width=22 height=34>";
|
|
||||||
printHelpLink(getHelp('', '250'), '250');
|
|
||||||
echo "</td>\n";
|
|
||||||
echo "<td>";
|
|
||||||
$filterGroup = new htmlGroup();
|
|
||||||
$filterButton = new htmlButton('apply_filter', 'filter.png', true);
|
|
||||||
$filterButton->setTitle(_("Filter"));
|
|
||||||
$filterGroup->addElement($filterButton);
|
|
||||||
if (sizeof($this->filters) > 0) {
|
|
||||||
$filterGroup->addElement(new htmlSpacer('1px', null));
|
|
||||||
$clearFilterButton = new htmlButton('clear_filter', 'clearFilter.png', true);
|
|
||||||
$clearFilterButton->setTitle(_('Clear filter'));
|
|
||||||
$filterGroup->addElement($clearFilterButton);
|
|
||||||
}
|
|
||||||
parseHtml(null, $filterGroup, array(), false, $this->tabindex, $this->type->getScope());
|
|
||||||
echo "</td>\n";
|
|
||||||
// print input boxes for filters
|
|
||||||
for ($k = 0; $k < sizeof($this->descArray); $k++) {
|
|
||||||
echo "<td align=\"left\">";
|
|
||||||
if ($this->canBeFiltered($this->attrArray[$k])) {
|
|
||||||
$this->printFilterArea($this->attrArray[$k], isset($_POST['clear_filter']));
|
|
||||||
}
|
|
||||||
echo "</td>\n";
|
|
||||||
}
|
|
||||||
echo "</tr></thead>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints the content of a single attribute filter area.
|
|
||||||
*
|
|
||||||
* @param String $attrName attribute name
|
|
||||||
* @param boolean $clearFilter true if filter value should be cleared
|
|
||||||
*/
|
|
||||||
protected function printFilterArea($attrName, $clearFilter) {
|
|
||||||
$value = "";
|
|
||||||
if (!$clearFilter) {
|
|
||||||
if (isset($this->filters[strtolower($attrName)])) {
|
|
||||||
$value = $this->filters[strtolower($attrName)];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$filterInput = new htmlInputField('filter' . strtolower($attrName), $value);
|
|
||||||
$filterInput->setCSSClasses(array($this->type->getScope() . '-dark'));
|
|
||||||
$filterInput->setFieldSize('15');
|
|
||||||
$filterInput->setOnKeyPress("SubmitForm('apply_filter', event);");
|
|
||||||
parseHtml(null, $filterInput, array(), false, $this->tabindex, $this->type->getScope());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns if the given attribute can be filtered.
|
|
||||||
* If filtering is not possible then no filter box will be displayed.
|
|
||||||
* By default all attributes can be filtered.
|
|
||||||
*
|
|
||||||
* @param String $attr attribute name
|
|
||||||
* @return boolean filtering possible
|
|
||||||
*/
|
|
||||||
protected function canBeFiltered($attr) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the entry list
|
* Prints the entry list
|
||||||
*
|
*
|
||||||
* @param array $info entries
|
* @param array $info entries
|
||||||
*/
|
*/
|
||||||
protected function listPrintTableBody(&$info) {
|
private function printAccountTable(&$info) {
|
||||||
echo "<tbody>\n";
|
$scope = $this->type->getScope();
|
||||||
|
$titles = $this->descArray;
|
||||||
|
array_unshift($titles, _('Actions'));
|
||||||
|
$data = array();
|
||||||
|
$data[] = $this->getSortingElements();
|
||||||
|
$data[] = $this->getFilterElements();
|
||||||
|
$onClickEvents = array();
|
||||||
|
$onDoubleClickEvents = array();
|
||||||
|
$this->addDataElements($data, $info, $onClickEvents, $onDoubleClickEvents);
|
||||||
|
|
||||||
|
$table = new htmlResponsiveTable($titles, $data);
|
||||||
|
$table->setRowClasses($scope . '-dark', $scope . '-bright');
|
||||||
|
$table->setCSSClasses(array($scope . '-border accountlist'));
|
||||||
|
$table->setOnClickEvents($onClickEvents);
|
||||||
|
$table->setOnDoubleClickEvents($onDoubleClickEvents);
|
||||||
|
|
||||||
|
parseHtml(null, $table, array(), false, $this->tabindex, $scope);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the elements to show in sorting row.
|
||||||
|
*
|
||||||
|
* @return htmlElement[] elements
|
||||||
|
*/
|
||||||
|
private function getSortingElements() {
|
||||||
|
$filter = $this->getFilterAsTextForURL();
|
||||||
|
$sortElements = array(new htmlOutputText(_('Sort sequence')));
|
||||||
|
foreach ($this->attrArray as $attributeName) {
|
||||||
|
$link = "list.php?type=" . $this->type->getId() . "&".
|
||||||
|
"sort=" . strtolower($attributeName) . $filter . "&norefresh=y";
|
||||||
|
$buttons = new htmlGroup();
|
||||||
|
if (strtolower($attributeName) == $this->sortColumn) {
|
||||||
|
if ($this->sortDirection < 0) {
|
||||||
|
$buttons->addElement(new htmlLink(null, $link . '&sortdirection=1', '../../graphics/downarrows.png'));
|
||||||
|
$buttons->addElement(new htmlLink(null, $link . '&sortdirection=-1', '../../graphics/uparrows-black.png'));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$buttons->addElement(new htmlLink(null, $link . '&sortdirection=1', '../../graphics/downarrows-black.png'));
|
||||||
|
$buttons->addElement(new htmlLink(null, $link . '&sortdirection=-1', '../../graphics/uparrows.png'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$buttons->addElement(new htmlLink(null, $link . '&sortdirection=1', '../../graphics/downarrows.png'));
|
||||||
|
$buttons->addElement(new htmlLink(null, $link . '&sortdirection=-1', '../../graphics/uparrows.png'));
|
||||||
|
}
|
||||||
|
$sortElements[] = $buttons;
|
||||||
|
}
|
||||||
|
return $sortElements;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the elements to show in filter row.
|
||||||
|
*
|
||||||
|
* @return htmlElement[] elements
|
||||||
|
*/
|
||||||
|
private function getFilterElements() {
|
||||||
|
$actionElement = new htmlGroup();
|
||||||
|
$selectAll = new htmlInputCheckbox('tableSelectAll', false);
|
||||||
|
$selectAll->setCSSClasses(array('align-middle'));
|
||||||
|
$selectAll->setOnClick('list_switchAccountSelection();');
|
||||||
|
$actionElement->addElement($selectAll);
|
||||||
|
$actionElement->addElement(new htmlSpacer('1rem', null));
|
||||||
|
$actionElement->addElement(new htmlOutputText(_('Filter')));
|
||||||
|
$filterButton = new htmlButton('apply_filter', 'filter.png', true);
|
||||||
|
$filterButton->setTitle(_("Here you can input simple filter expressions (e.g. 'value' or 'v*'). The filter is case-insensitive."));
|
||||||
|
$actionElement->addElement($filterButton);
|
||||||
|
if (sizeof($this->filters) > 0) {
|
||||||
|
$clearFilterButton = new htmlButton('clear_filter', 'clearFilter.png', true);
|
||||||
|
$clearFilterButton->setTitle(_('Clear filter'));
|
||||||
|
$actionElement->addElement($clearFilterButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
$filterElements = array(new htmlDiv(null, $actionElement, array('nowrap')));
|
||||||
|
$clearFilter = isset($_POST['clear_filter']);
|
||||||
|
foreach ($this->attrArray as $attributeName) {
|
||||||
|
$attributeName = strtolower($attributeName);
|
||||||
|
if ($this->canBeFiltered($attributeName)) {
|
||||||
|
$value = "";
|
||||||
|
if (!$clearFilter && isset($this->filters[$attributeName])) {
|
||||||
|
$value = $this->filters[$attributeName];
|
||||||
|
}
|
||||||
|
$filterInput = new htmlInputField('filter' . $attributeName, $value, null);
|
||||||
|
$filterInput->setCSSClasses(array($this->type->getScope() . '-bright'));
|
||||||
|
$filterInput->setOnKeyPress("SubmitForm('apply_filter', event);");
|
||||||
|
$filterElements[] = $filterInput;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$filterElements[] = new htmlOutputText('');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $filterElements;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the LDAP data elements to the given array.
|
||||||
|
*
|
||||||
|
* @param array $data data for responsible table
|
||||||
|
* @param array $info entries
|
||||||
|
* @param array $onClickEvents row number => code
|
||||||
|
* @param array $onDoubleClickEvents row number => code
|
||||||
|
*/
|
||||||
|
private function addDataElements(&$data, &$info, &$onClickEvents, &$onDoubleClickEvents) {
|
||||||
// calculate which rows to show
|
// calculate which rows to show
|
||||||
$table_begin = ($this->page - 1) * $this->maxPageEntries;
|
$table_begin = ($this->page - 1) * $this->maxPageEntries;
|
||||||
if (($this->page * $this->maxPageEntries) > sizeof($info)) $table_end = sizeof($info);
|
if (($this->page * $this->maxPageEntries) > sizeof($info)) $table_end = sizeof($info);
|
||||||
|
@ -489,100 +511,97 @@ class lamList {
|
||||||
}
|
}
|
||||||
// print account list
|
// print account list
|
||||||
for ($i = $table_begin; $i < $table_end; $i++) {
|
for ($i = $table_begin; $i < $table_end; $i++) {
|
||||||
|
$row = array();
|
||||||
$index = $sortMapping[$i];
|
$index = $sortMapping[$i];
|
||||||
$rowID = base64_encode($info[$index]['dn']);
|
$rowID = base64_encode($info[$index]['dn']);
|
||||||
if ((($i - $table_begin) % 2) == 1) {
|
$actionElement = new htmlGroup();
|
||||||
$classes = ' ' . $this->type->getScope() . '-bright';
|
$checkbox = new htmlInputCheckbox($rowID, false);
|
||||||
|
$checkbox->setOnClick("list_click('" . $rowID . "');");
|
||||||
|
$checkbox->setCSSClasses(array('accountBoxUnchecked align-middle'));
|
||||||
|
$actionElement->addElement($checkbox);
|
||||||
|
$actionElement->addElement(new htmlSpacer('0.5rem', null));
|
||||||
|
$onClickEvents[$i + 2] = "list_click('" . $rowID . "');";
|
||||||
|
$onDoubleClickEvents[$i + 2] = "top.location.href='../account/edit.php?type=" . $this->type->getId() . "&DN=" . rawurlencode($info[$index]['dn']) . "';";
|
||||||
|
$this->addToolLinks($info[$index], $rowID, $actionElement);
|
||||||
|
$row[] = new htmlDiv(null, $actionElement, array('nowrap'));
|
||||||
|
foreach ($this->attrArray as $attributeName) {
|
||||||
|
$attributeName = strtolower($attributeName);
|
||||||
|
$row[] = $this->getTableCellContent($info[$index], $attributeName);
|
||||||
}
|
}
|
||||||
else {
|
$data[] = $row;
|
||||||
$classes = ' ' . $this->type->getScope() . '-dark';
|
|
||||||
}
|
|
||||||
echo("<tr class=\"$classes\"" .
|
|
||||||
" onClick=\"list_click('" . $rowID . "')\"\n" .
|
|
||||||
" onDblClick=\"top.location.href='../account/edit.php?type=" . $this->type->getId() . "&DN=" . rawurlencode($info[$index]['dn']) . "'\">\n");
|
|
||||||
echo " <td align=\"center\"><input class=\"accountBoxUnchecked\" onClick=\"list_click('" . $rowID . "')\"" .
|
|
||||||
" type=\"checkbox\" name=\"" . $rowID . "\"></td>\n";
|
|
||||||
$this->listPrintToolLinks($info[$index], $rowID);
|
|
||||||
for ($k = 0; $k < sizeof($this->attrArray); $k++) {
|
|
||||||
echo ("<td>");
|
|
||||||
$attrName = strtolower($this->attrArray[$k]);
|
|
||||||
$this->listPrintTableCellContent($info[$index], $attrName);
|
|
||||||
echo ("</td>\n");
|
|
||||||
}
|
|
||||||
echo("</tr>\n");
|
|
||||||
}
|
}
|
||||||
// display select all link
|
|
||||||
$colspan = sizeof($this->attrArray) + 1;
|
|
||||||
echo "<tr class=\"" . $this->type->getScope() . "-bright\">\n";
|
|
||||||
echo "<td align=\"center\"><a href=\"#\" onClick=\"list_switchAccountSelection();\"><img height=16 width=16 src=\"../../graphics/select.png\" alt=\"select all\"></a></td>\n";
|
|
||||||
echo "<td colspan=$colspan> <a href=\"#\" onClick=\"list_switchAccountSelection();\">" .
|
|
||||||
"<font color=\"black\"><small>" . _("Select all") . "</small></font></a></td>\n";
|
|
||||||
echo "</tr>\n";
|
|
||||||
echo "</tbody>\n";
|
|
||||||
echo "</table>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the tool image links (e.g. edit and delete) for each account.
|
* Adds the tool image links (e.g. edit and delete) for each account.
|
||||||
*
|
*
|
||||||
* @param array $account LDAP attributes
|
* @param array $account LDAP attributes
|
||||||
* @param String $id account ID
|
* @param String $id account ID
|
||||||
|
* @param htmlGroup $element location where to add tools
|
||||||
*/
|
*/
|
||||||
private function listPrintToolLinks($account, $id) {
|
private function addToolLinks($account, $id, &$element) {
|
||||||
$toolCount = 0;
|
$toolCount = 0;
|
||||||
$group = new htmlGroup();
|
|
||||||
// edit link
|
// edit link
|
||||||
$editLink = new htmlLink('', "../account/edit.php?type=" . $this->type->getId() . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/edit.png');
|
$editLink = new htmlLink('', "../account/edit.php?type=" . $this->type->getId() . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/edit.png');
|
||||||
$editLink->setTitle(_("Edit"));
|
$editLink->setTitle(_("Edit"));
|
||||||
$group->addElement($editLink);
|
$element->addElement($editLink);
|
||||||
$toolCount++;
|
$toolCount++;
|
||||||
// delete link
|
// delete link
|
||||||
if (checkIfWriteAccessIsAllowed($this->type->getId()) && checkIfDeleteEntriesIsAllowed($this->type->getId())) {
|
if (checkIfWriteAccessIsAllowed($this->type->getId()) && checkIfDeleteEntriesIsAllowed($this->type->getId())) {
|
||||||
$deleteLink = new htmlLink('', "deletelink.php?type=" . $this->type->getId() . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/delete.png');
|
$deleteLink = new htmlLink('', "deletelink.php?type=" . $this->type->getId() . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/delete.png');
|
||||||
$deleteLink->setTitle(_("Delete"));
|
$deleteLink->setTitle(_("Delete"));
|
||||||
$group->addElement($deleteLink);
|
$element->addElement($deleteLink);
|
||||||
$toolCount++;
|
$toolCount++;
|
||||||
}
|
}
|
||||||
// PDF button
|
// PDF button
|
||||||
$pdfButton = new htmlButton("createPDF_" . $id, 'pdf.png', true);
|
$pdfButton = new htmlButton("createPDF_" . $id, 'pdf.png', true);
|
||||||
$pdfButton->setTitle(_('Create PDF file'));
|
$pdfButton->setTitle(_('Create PDF file'));
|
||||||
$group->addElement($pdfButton);
|
$element->addElement($pdfButton);
|
||||||
$toolCount++;
|
$toolCount++;
|
||||||
// additional tools
|
// additional tools
|
||||||
$tools = $this->getAdditionalTools();
|
$tools = $this->getAdditionalTools();
|
||||||
for ($i = 0; $i < sizeof($tools); $i++) {
|
for ($i = 0; $i < sizeof($tools); $i++) {
|
||||||
$toolLink = new htmlLink('', $tools[$i]->getLinkTarget() . "?type=" . $this->type->getId() . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/' . $tools[$i]->getImage());
|
$toolLink = new htmlLink('', $tools[$i]->getLinkTarget() . "?type=" . $this->type->getId() . "&DN='" . rawurlencode($account['dn']) . "'", '../../graphics/' . $tools[$i]->getImage());
|
||||||
$toolLink->setTitle($tools[$i]->getName());
|
$toolLink->setTitle($tools[$i]->getName());
|
||||||
$group->addElement($toolLink);
|
$element->addElement($toolLink);
|
||||||
$toolCount++;
|
$toolCount++;
|
||||||
}
|
}
|
||||||
$width = ($toolCount * 20) + 20;
|
|
||||||
echo "<td align='center' style=\"white-space: nowrap; width: ${width}px;\">";
|
|
||||||
parseHtml(null, $group, array(), false, $this->tabindex, $this->type->getScope());
|
|
||||||
echo "</td>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the content of a cell in the account list for a given LDAP entry and attribute.
|
* Returns if the given attribute can be filtered.
|
||||||
|
* If filtering is not possible then no filter box will be displayed.
|
||||||
|
* By default all attributes can be filtered.
|
||||||
|
*
|
||||||
|
* @param String $attr attribute name
|
||||||
|
* @return boolean filtering possible
|
||||||
|
*/
|
||||||
|
protected function canBeFiltered($attr) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the content of a cell in the account list for a given LDAP entry and attribute.
|
||||||
*
|
*
|
||||||
* @param array $entry LDAP attributes
|
* @param array $entry LDAP attributes
|
||||||
* @param string $attribute attribute name
|
* @param string $attribute attribute name
|
||||||
|
* @return htmlElement content
|
||||||
*/
|
*/
|
||||||
protected function listPrintTableCellContent(&$entry, &$attribute) {
|
protected function getTableCellContent(&$entry, &$attribute) {
|
||||||
// print all attribute entries seperated by "; "
|
// print all attribute entries seperated by "; "
|
||||||
if (isset($entry[$attribute]) && sizeof($entry[$attribute]) > 0) {
|
if (isset($entry[$attribute]) && sizeof($entry[$attribute]) > 0) {
|
||||||
if (is_array($entry[$attribute])) {
|
if (is_array($entry[$attribute])) {
|
||||||
if (($attribute == 'entryexpiretimestamp') && !empty($entry[$attribute][0])) {
|
if (($attribute == 'entryexpiretimestamp') && !empty($entry[$attribute][0])) {
|
||||||
echo formatLDAPTimestamp($entry[$attribute][0]);
|
return new htmlOutputText(formatLDAPTimestamp($entry[$attribute][0]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// sort array
|
// sort array
|
||||||
sort($entry[$attribute]);
|
sort($entry[$attribute]);
|
||||||
echo htmlspecialchars(implode("; ", $entry[$attribute]), ENT_QUOTES, "UTF-8");
|
return new htmlOutputText(implode("; ", $entry[$attribute]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo htmlspecialchars($entry[$attribute], ENT_QUOTES, "UTF-8");
|
return new htmlOutputText($entry[$attribute]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -816,51 +835,52 @@ class lamList {
|
||||||
* @param int $tabindex HTML tabindex counter
|
* @param int $tabindex HTML tabindex counter
|
||||||
*/
|
*/
|
||||||
protected function listPrintButtons($createOnly) {
|
protected function listPrintButtons($createOnly) {
|
||||||
$table = new htmlTable('100%');
|
$row = new htmlResponsiveRow();
|
||||||
|
$row->setCSSClasses(array('maxrow'));
|
||||||
$left = new htmlGroup();
|
$left = new htmlGroup();
|
||||||
// button part
|
// button part
|
||||||
$left->alignment = htmlElement::ALIGN_LEFT;
|
|
||||||
if (checkIfWriteAccessIsAllowed($this->type->getId())) {
|
if (checkIfWriteAccessIsAllowed($this->type->getId())) {
|
||||||
// add button
|
// add button
|
||||||
if (checkIfNewEntriesAreAllowed($this->type->getId())) {
|
if (checkIfNewEntriesAreAllowed($this->type->getId())) {
|
||||||
$newButton = new htmlButton('new', $this->labels['newEntry']);
|
$newButton = new htmlButton('new', $this->labels['newEntry']);
|
||||||
$newButton->setIconClass('createButton');
|
$newButton->setIconClass('createButton');
|
||||||
|
$newButton->setCSSClasses(array('fullwidth-mobile-only'));
|
||||||
$left->addElement($newButton);
|
$left->addElement($newButton);
|
||||||
}
|
}
|
||||||
// delete button
|
// delete button
|
||||||
if (!$createOnly && checkIfDeleteEntriesIsAllowed($this->type->getId())) {
|
if (!$createOnly && checkIfDeleteEntriesIsAllowed($this->type->getId())) {
|
||||||
$left->addElement(new htmlSpacer('1px', null));
|
|
||||||
$delButton = new htmlButton('del', $this->labels['deleteEntry']);
|
$delButton = new htmlButton('del', $this->labels['deleteEntry']);
|
||||||
$delButton->setIconClass('deleteButton');
|
$delButton->setIconClass('deleteButton');
|
||||||
|
$delButton->setCSSClasses(array('fullwidth-mobile-only'));
|
||||||
$left->addElement($delButton);
|
$left->addElement($delButton);
|
||||||
}
|
}
|
||||||
$toolSettings = $_SESSION['config']->getToolSettings();
|
$toolSettings = $_SESSION['config']->getToolSettings();
|
||||||
if ($this->type->getBaseType()->supportsFileUpload() && checkIfNewEntriesAreAllowed($this->type->getId())
|
if ($this->type->getBaseType()->supportsFileUpload() && checkIfNewEntriesAreAllowed($this->type->getId())
|
||||||
&& !(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) {
|
&& !(isset($toolSettings['tool_hide_toolFileUpload']) && ($toolSettings['tool_hide_toolFileUpload'] == 'true'))) {
|
||||||
$left->addElement(new htmlSpacer('20px', null));
|
|
||||||
$uploadButton = new htmlButton('fileUpload', _('File upload'));
|
$uploadButton = new htmlButton('fileUpload', _('File upload'));
|
||||||
$uploadButton->setIconClass('upButton');
|
$uploadButton->setIconClass('upButton');
|
||||||
|
$uploadButton->setCSSClasses(array('fullwidth-mobile-only'));
|
||||||
$left->addElement($uploadButton);
|
$left->addElement($uploadButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// OU selection and settings
|
// OU selection and settings
|
||||||
$right = new htmlGroup();
|
$right = new htmlResponsiveRow();
|
||||||
$right->alignment = htmlElement::ALIGN_RIGHT;
|
$right->add($this->listShowOUSelection(), 12, 12, 10);
|
||||||
$right->addElement($this->listShowOUSelection());
|
$rightButtonGroup = new htmlGroup();
|
||||||
$refreshButton = new htmlButton('refresh', 'refresh.png', true);
|
$refreshButton = new htmlButton('refresh', 'refresh.png', true);
|
||||||
$refreshButton->setTitle(_("Refresh"));
|
$refreshButton->setTitle(_("Refresh"));
|
||||||
$right->addElement($refreshButton);
|
$rightButtonGroup->addElement($refreshButton);
|
||||||
$right->addElement(new htmlSpacer('1px', null));
|
|
||||||
$settingsLink = new htmlLink('', '#', '../../graphics/tools.png');
|
$settingsLink = new htmlLink('', '#', '../../graphics/tools.png');
|
||||||
$settingsLink->setOnClick('listShowSettingsDialog(\'' . _('Change list settings') . '\', \'' . _('Ok') . '\', \'' . _('Cancel') . '\');');
|
$settingsLink->setOnClick('listShowSettingsDialog(\'' . _('Change list settings') . '\', \'' . _('Ok') . '\', \'' . _('Cancel') . '\');');
|
||||||
$settingsLink->setTitle(_('Change settings'));
|
$settingsLink->setTitle(_('Change settings'));
|
||||||
$right->addElement($settingsLink);
|
$rightButtonGroup->addElement($settingsLink);
|
||||||
|
$right->add($rightButtonGroup, 12, 12, 2);
|
||||||
|
|
||||||
$this->addExtraInputElementsToTopArea($left, $right);
|
$this->addExtraInputElementsToTopArea($left, $right);
|
||||||
$table->addElement($left);
|
$row->add($left, 12, 6, 6, 'text-left');
|
||||||
$table->addElement($right);
|
$row->add($right, 12, 6, 6, 'text-right');
|
||||||
parseHtml(null, $table, array(), false, $this->tabindex, $this->type->getScope());
|
parseHtml(null, $row, array(), false, $this->tabindex, $this->type->getScope());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -873,16 +893,6 @@ class lamList {
|
||||||
// only used by subclasses
|
// only used by subclasses
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints the HTML header.
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
protected function listPrintHeader() {
|
|
||||||
include '../main_header.php';
|
|
||||||
$this->printHeaderContent();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the header part of the page.
|
* Prints the header part of the page.
|
||||||
*/
|
*/
|
||||||
|
@ -898,16 +908,6 @@ class lamList {
|
||||||
// implemented by child classes if needed
|
// implemented by child classes if needed
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Prints the HTML footer.
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
protected function listPrintFooter() {
|
|
||||||
$this->printFooterContent();
|
|
||||||
include '../main_footer.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the footer area of the page.
|
* Prints the footer area of the page.
|
||||||
*/
|
*/
|
||||||
|
@ -927,9 +927,6 @@ class lamList {
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
jQuery('#tab_<?php echo $this->type->getId(); ?>').addClass('ui-tabs-active');
|
jQuery('#tab_<?php echo $this->type->getId(); ?>').addClass('ui-tabs-active');
|
||||||
jQuery('#tab_<?php echo $this->type->getId(); ?>').addClass('ui-state-active');
|
jQuery('#tab_<?php echo $this->type->getId(); ?>').addClass('ui-state-active');
|
||||||
window.onload = listResizeITabContentDiv;
|
|
||||||
window.onresize = listResizeITabContentDiv;
|
|
||||||
jQuery('#filterButton').button();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
@ -986,7 +983,7 @@ class lamList {
|
||||||
}
|
}
|
||||||
// get sort order
|
// get sort order
|
||||||
if (isset($_GET['sortdirection'])) {
|
if (isset($_GET['sortdirection'])) {
|
||||||
$this->sortDirection = $_GET['sortdirection'];
|
$this->sortDirection = htmlspecialchars($_GET['sortdirection']);
|
||||||
}
|
}
|
||||||
// check search suffix
|
// check search suffix
|
||||||
if (isset($_POST['suffix'])) {
|
if (isset($_POST['suffix'])) {
|
||||||
|
@ -1176,20 +1173,18 @@ class lamList {
|
||||||
* Prints the list configuration page.
|
* Prints the list configuration page.
|
||||||
*/
|
*/
|
||||||
protected function listPrintConfigurationPage() {
|
protected function listPrintConfigurationPage() {
|
||||||
echo "<div id=\"settingsDialog\" class=\"hidden\">\n";
|
echo "<div id=\"settingsDialog\" class=\"hidden dialog-content\">\n";
|
||||||
echo "<form id=\"settingsDialogForm\" action=\"list.php?type=" . $this->type->getId() . "&norefresh=true\" method=\"post\">\n";
|
echo "<form id=\"settingsDialogForm\" action=\"list.php?type=" . $this->type->getId() . "&norefresh=true\" method=\"post\">\n";
|
||||||
echo '<table width="100%"><tr><td>';
|
|
||||||
|
|
||||||
$configContainer = new htmlTable();
|
$configContainer = new htmlResponsiveRow();
|
||||||
for ($i = 0; $i < sizeof($this->configOptions); $i++) {
|
for ($i = 0; $i < sizeof($this->configOptions); $i++) {
|
||||||
$configContainer->mergeTableElements($this->configOptions[$i]->getMetaHTML());
|
$configContainer->add($this->configOptions[$i]->getMetaHTML(), 12);
|
||||||
}
|
}
|
||||||
$configContainer->addElement(new htmlHiddenInput('saveConfigOptions', 'ok'));
|
$configContainer->add(new htmlHiddenInput('saveConfigOptions', 'ok'), 12);
|
||||||
addSecurityTokenToMetaHTML($configContainer);
|
addSecurityTokenToMetaHTML($configContainer);
|
||||||
|
|
||||||
parseHtml('', $configContainer, array(), false, $this->tabindex, $this->type->getScope());
|
parseHtml('', $configContainer, array(), false, $this->tabindex, $this->type->getScope());
|
||||||
|
|
||||||
echo "</td></tr></table>\n";
|
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
}
|
}
|
||||||
|
@ -1369,7 +1364,7 @@ abstract class lamListOption {
|
||||||
/**
|
/**
|
||||||
* Returns the meta HTML data to display this option.
|
* Returns the meta HTML data to display this option.
|
||||||
*
|
*
|
||||||
* @return htmlTable meta HTML
|
* @return htmlResponsiveRow meta HTML
|
||||||
*/
|
*/
|
||||||
public abstract function getMetaHTML();
|
public abstract function getMetaHTML();
|
||||||
|
|
||||||
|
@ -1422,13 +1417,12 @@ class lamBooleanListOption extends lamListOption {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the meta HTML data to display this option.
|
* {@inheritDoc}
|
||||||
*
|
* @see lamListOption::getMetaHTML()
|
||||||
* @return htmlTable meta HTML
|
|
||||||
*/
|
*/
|
||||||
public function getMetaHTML() {
|
public function getMetaHTML() {
|
||||||
$return = new htmlTable();
|
$return = new htmlResponsiveRow();
|
||||||
$return->addElement(new htmlTableExtendedInputCheckbox($this->getID(), $this->isSelected(), $this->name));
|
$return->add(new htmlResponsiveInputCheckbox($this->getID(), $this->isSelected(), $this->name), 12);
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1487,13 +1481,12 @@ class lamSelectListOption extends lamListOption {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the meta HTML data to display this option.
|
* {@inheritDoc}
|
||||||
*
|
* @see lamListOption::getMetaHTML()
|
||||||
* @return htmlTable meta HTML
|
|
||||||
*/
|
*/
|
||||||
public function getMetaHTML() {
|
public function getMetaHTML() {
|
||||||
$return = new htmlTable();
|
$return = new htmlResponsiveRow();
|
||||||
$return->addElement(new htmlTableExtendedSelect($this->getID(), $this->options, array($this->getValue()), $this->name, $this->helpID));
|
$return->add(new htmlResponsiveSelect($this->getID(), $this->options, array($this->getValue()), $this->name, $this->helpID), 12);
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -178,12 +178,10 @@ class lamDHCPList extends lamList {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the content of a cell in the account list for a given LDAP entry and attribute.
|
* {@inheritDoc}
|
||||||
*
|
* @see lamList::getTableCellContent()
|
||||||
* @param array $entry LDAP attributes
|
|
||||||
* @param string $attribute attribute name
|
|
||||||
*/
|
*/
|
||||||
public function listPrintTableCellContent(&$entry, &$attribute) {
|
public function getTableCellContent(&$entry, &$attribute) {
|
||||||
// Fixed IPs
|
// Fixed IPs
|
||||||
if ($attribute=="fixed_ips") {
|
if ($attribute=="fixed_ips") {
|
||||||
// find all fixed addresses:
|
// find all fixed addresses:
|
||||||
|
@ -197,48 +195,59 @@ class lamDHCPList extends lamList {
|
||||||
$order[$i] = fixed_ip::extractIP($entries[$i]['dhcpstatements']);
|
$order[$i] = fixed_ip::extractIP($entries[$i]['dhcpstatements']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$group = new htmlGroup();
|
||||||
natcasesort($order);
|
natcasesort($order);
|
||||||
echo "<table border=\"0\" width=\"100%\">";
|
for ($i = 0; $i < sizeof($order); $i++) {
|
||||||
foreach ($order as $i => $sortval) {
|
|
||||||
$dhcpstatements = array();
|
$dhcpstatements = array();
|
||||||
if (isset($entries[$i]['dhcpstatements'][0])) {
|
if (isset($entries[$i]['dhcpstatements'][0])) {
|
||||||
$dhcpstatements = $entries[$i]['dhcpstatements'];
|
$dhcpstatements = $entries[$i]['dhcpstatements'];
|
||||||
}
|
}
|
||||||
$style = '';
|
$cssClasses = array('nowrap');
|
||||||
if (!fixed_ip::isActive($dhcpstatements)) {
|
if (!fixed_ip::isActive($dhcpstatements)) {
|
||||||
$style = 'style="text-decoration: line-through;"';
|
$cssClasses[] = 'strike-through';
|
||||||
}
|
}
|
||||||
echo "<tr " . $style . ">";
|
|
||||||
echo "<td width=\"25%\">" . fixed_ip::extractIP($dhcpstatements) . "</td>";
|
|
||||||
$dhcphwaddress = explode(" ",$entries[$i]['dhcphwaddress'][0]);
|
$dhcphwaddress = explode(" ",$entries[$i]['dhcphwaddress'][0]);
|
||||||
echo "<td width=\"35%\">".array_pop($dhcphwaddress)."</td>";
|
$ipAddress = fixed_ip::extractIP($dhcpstatements);
|
||||||
echo "<td width=\"40%\">".$entries[$i]['cn'][0]."</td>";
|
$ip = new htmlOutputText($ipAddress);
|
||||||
echo "</tr>";
|
$ip->setCSSClasses($cssClasses);
|
||||||
}
|
$group->addElement($ip);
|
||||||
echo "</table>";
|
if (!empty($ipAddress)) {
|
||||||
}
|
$group->addElement(new htmlOutputText('<br>', false));
|
||||||
}
|
}
|
||||||
// fixed ip address
|
$macAddress = array_pop($dhcphwaddress);
|
||||||
elseif ($attribute=="dhcpstatements") {
|
$mac = new htmlOutputText($macAddress);
|
||||||
// Search after the fixed ip entry
|
$mac->setCSSClasses($cssClasses);
|
||||||
if (is_array($entry['dhcpstatements'])) {
|
$group->addElement($mac);
|
||||||
foreach($entry['dhcpstatements'] AS $id => $value) {
|
if (!empty($macAddress)) {
|
||||||
|
$group->addElement(new htmlOutputText('<br>', false));
|
||||||
if (!is_array($value) && array_shift( explode(" ", $value) ) == "fixed-address") {
|
}
|
||||||
$ip = explode(" ", $value);
|
$name = new htmlOutputText($entries[$i]['cn'][0]);
|
||||||
echo $ip['1'];
|
$name->setCSSClasses($cssClasses);
|
||||||
|
$group->addElement($name);
|
||||||
|
$group->addElement(new htmlOutputText('<br>', false));
|
||||||
|
if ($i < (sizeof($order) - 1)) {
|
||||||
|
$group->addElement(new htmlOutputText('<br>', false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $group;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($attribute=="dhcprange") { // DHCP Range
|
elseif ($attribute=="dhcprange") { // DHCP Range
|
||||||
if (isset($entry['dhcprange'])) {
|
if (isset($entry['dhcprange'])) {
|
||||||
echo"<table cellspacing=\"0\">";
|
$table = new htmlTable();
|
||||||
|
$table->setCSSClasses(array('nowrap'));
|
||||||
$ranges = array();
|
$ranges = array();
|
||||||
foreach($entry['dhcprange'] AS $id => $value) {
|
foreach($entry['dhcprange'] AS $id => $value) {
|
||||||
if (!empty($value) && !is_numeric($value)) {
|
if (!empty($value) && !is_numeric($value)) {
|
||||||
$ex = explode(" ", $value);
|
$ex = explode(" ", $value);
|
||||||
$ranges[] = "<tr><td>".$ex[0]."</td><td width=\"20\"><center>-</center></td><td>".$ex[1]."</td></tr>";
|
$row = new htmlTableRow(
|
||||||
|
array(
|
||||||
|
new htmlOutputText($ex[0]),
|
||||||
|
new htmlOutputText(' - '),
|
||||||
|
new htmlOutputText($ex[1])
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$ranges[$ex[0] . ' - ' . $ex[1]] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$pooledRanges = searchLDAP($entry['dn'], '(objectclass=dhcpPool)', array('dhcprange'));
|
$pooledRanges = searchLDAP($entry['dn'], '(objectclass=dhcpPool)', array('dhcprange'));
|
||||||
|
@ -249,18 +258,26 @@ class lamDHCPList extends lamList {
|
||||||
foreach($pool['dhcprange'] AS $id => $value) {
|
foreach($pool['dhcprange'] AS $id => $value) {
|
||||||
if (!empty($value) && !is_numeric($value)) {
|
if (!empty($value) && !is_numeric($value)) {
|
||||||
$ex = explode(" ", $value);
|
$ex = explode(" ", $value);
|
||||||
$ranges[] = "<tr><td>".$ex[0]."</td><td width=\"20\"><center>-</center></td><td>".$ex[1]."</td></tr>";
|
$row = new htmlTableRow(
|
||||||
|
array(
|
||||||
|
new htmlOutputText($ex[0]),
|
||||||
|
new htmlOutputText(' - '),
|
||||||
|
new htmlOutputText($ex[1])
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$ranges[$ex[0] . ' - ' . $ex[1]] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
natcasesort($ranges);
|
uksort($ranges, 'strnatcasecmp');
|
||||||
echo implode('', $ranges);
|
foreach ($ranges as $text => $row) {
|
||||||
echo"</table>";
|
$table->addElement($row);
|
||||||
|
}
|
||||||
|
return $table;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
return parent::getTableCellContent($entry, $attribute);
|
||||||
parent::listPrintTableCellContent($entry, $attribute);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,9 +289,9 @@ class lamDHCPList extends lamList {
|
||||||
*/
|
*/
|
||||||
protected function addExtraInputElementsToTopArea(&$left, &$right) {
|
protected function addExtraInputElementsToTopArea(&$left, &$right) {
|
||||||
if (checkIfWriteAccessIsAllowed($this->type->getId())) {
|
if (checkIfWriteAccessIsAllowed($this->type->getId())) {
|
||||||
$left->addElement(new htmlSpacer('20px', null));
|
|
||||||
$dhcpButton = new htmlButton('dhcpDefaults', $this->labels['dhcpDefaults']);
|
$dhcpButton = new htmlButton('dhcpDefaults', $this->labels['dhcpDefaults']);
|
||||||
$dhcpButton->setIconClass('settingsButton');
|
$dhcpButton->setIconClass('settingsButton');
|
||||||
|
$dhcpButton->setCSSClasses(array('fullwidth-mobile-only'));
|
||||||
$left->addElement($dhcpButton);
|
$left->addElement($dhcpButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,12 +284,10 @@ class lamGroupList extends lamList {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the content of a cell in the account list for a given LDAP entry and attribute.
|
* {@inheritDoc}
|
||||||
*
|
* @see lamList::getTableCellContent()
|
||||||
* @param array $entry LDAP attributes
|
|
||||||
* @param string $attribute attribute name
|
|
||||||
*/
|
*/
|
||||||
function listPrintTableCellContent(&$entry, &$attribute) {
|
protected function getTableCellContent(&$entry, &$attribute) {
|
||||||
if ($attribute == "memberuid") {
|
if ($attribute == "memberuid") {
|
||||||
// $gid is used for linking primary group memebers
|
// $gid is used for linking primary group memebers
|
||||||
$gid = -1;
|
$gid = -1;
|
||||||
|
@ -350,11 +348,10 @@ class lamGroupList extends lamList {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo implode("; ", $linklist);
|
return new htmlOutputText(implode("; ", $linklist), false);
|
||||||
}
|
}
|
||||||
// pretty print member DNs
|
// pretty print member DNs
|
||||||
elseif (in_array_ignore_case($attribute, array('member', 'uniqueMember', 'owner', 'roleOccupant')) && !empty($entry[$attribute])) {
|
elseif (in_array_ignore_case($attribute, array('member', 'uniqueMember', 'owner', 'roleOccupant')) && !empty($entry[$attribute])) {
|
||||||
echo '<div class="rightToLeftText">';
|
|
||||||
$values = $entry[$attribute];
|
$values = $entry[$attribute];
|
||||||
if (!empty($values)) {
|
if (!empty($values)) {
|
||||||
usort($values, 'compareDN');
|
usort($values, 'compareDN');
|
||||||
|
@ -375,12 +372,11 @@ class lamGroupList extends lamList {
|
||||||
$values[$i] = getAbstractDN($values[$i]);
|
$values[$i] = getAbstractDN($values[$i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo implode('<br>', $values);
|
return new htmlDiv(null, new htmlOutputText(implode('<br>', $values), false), array('rightToLeftText'));
|
||||||
echo '</div>';
|
|
||||||
}
|
}
|
||||||
// print all other attributes
|
// print all other attributes
|
||||||
else {
|
else {
|
||||||
parent::listPrintTableCellContent($entry, $attribute);
|
return parent::getTableCellContent($entry, $attribute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -717,24 +717,21 @@ class lamUserList extends lamList {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the content of a cell in the account list for a given LDAP entry and attribute.
|
* {@inheritDoc}
|
||||||
*
|
* @see lamList::getTableCellContent()
|
||||||
* @param array $entry LDAP attributes
|
|
||||||
* @param string $attribute attribute name
|
|
||||||
*/
|
*/
|
||||||
protected function listPrintTableCellContent(&$entry, &$attribute) {
|
protected function getTableCellContent(&$entry, &$attribute) {
|
||||||
// check if there is something to display at all
|
// check if there is something to display at all
|
||||||
if (($attribute != self::ATTR_ACCOUNT_STATUS) && (!isset($entry[$attribute]) || !is_array($entry[$attribute]) || (sizeof($entry[$attribute]) < 1))) {
|
if (($attribute != self::ATTR_ACCOUNT_STATUS) && (!isset($entry[$attribute]) || !is_array($entry[$attribute]) || (sizeof($entry[$attribute]) < 1))) {
|
||||||
parent::listPrintTableCellContent($entry, $attribute);
|
return parent::getTableCellContent($entry, $attribute);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
// translate GID to group name
|
// translate GID to group name
|
||||||
if (($attribute == "gidnumber") && ($this->trans_primary == "on")) {
|
if (($attribute == "gidnumber") && ($this->trans_primary == "on")) {
|
||||||
if (isset($this->trans_primary_hash[$entry[$attribute][0]])) {
|
if (isset($this->trans_primary_hash[$entry[$attribute][0]])) {
|
||||||
echo $this->trans_primary_hash[$entry[$attribute][0]];
|
return new htmlOutputText($this->trans_primary_hash[$entry[$attribute][0]]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
parent::listPrintTableCellContent($entry, $attribute);
|
return parent::getTableCellContent($entry, $attribute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// show user photos
|
// show user photos
|
||||||
|
@ -764,47 +761,45 @@ class lamUserList extends lamList {
|
||||||
if ($imgHeight < 64) {
|
if ($imgHeight < 64) {
|
||||||
$minSize = $imgHeight;
|
$minSize = $imgHeight;
|
||||||
}
|
}
|
||||||
$imgTitle = _('Click to switch between thumbnail and original size.');
|
return new htmlImage($photoFile, null, $minSize, _('Photo'));
|
||||||
echo "<img id=\"img$imgNumber\" title=\"$imgTitle\" height=$minSize src=\"" . $photoFile . "\" alt=\"" . _('Photo') . "\">";
|
|
||||||
echo '<script type="text/javascript">';
|
|
||||||
echo "addResizeHandler(document.getElementById(\"img$imgNumber\"), $minSize, " . $imgHeight . ")";
|
|
||||||
echo '</script>';
|
|
||||||
}
|
}
|
||||||
elseif (($attribute == 'mail') || ($attribute == 'rfc822Mailbox')) {
|
elseif (($attribute == 'mail') || ($attribute == 'rfc822Mailbox')) {
|
||||||
|
$group = new htmlGroup();
|
||||||
if (isset($entry[$attribute][0]) && ($entry[$attribute][0] != '')) {
|
if (isset($entry[$attribute][0]) && ($entry[$attribute][0] != '')) {
|
||||||
for ($i = 0; $i < sizeof($entry[$attribute]); $i++) {
|
for ($i = 0; $i < sizeof($entry[$attribute]); $i++) {
|
||||||
if ($i > 0) {
|
if ($i > 0) {
|
||||||
echo ", ";
|
$group->addElement(new htmlOutputText(", "));
|
||||||
}
|
}
|
||||||
echo "<a href=\"mailto:" . $entry[$attribute][$i] . "\">" . $entry[$attribute][$i] . "</a>\n";
|
$group->addElement(new htmlLink($entry[$attribute][$i], "mailto:" . $entry[$attribute][$i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $group;
|
||||||
}
|
}
|
||||||
// expire dates
|
// expire dates
|
||||||
elseif ($attribute == 'shadowexpire') {
|
elseif ($attribute == 'shadowexpire') {
|
||||||
if (!empty($entry[$attribute][0])) {
|
if (!empty($entry[$attribute][0])) {
|
||||||
$time = new DateTime('@' . $entry[$attribute][0] * 24 * 3600, getTimeZone());
|
$time = new DateTime('@' . $entry[$attribute][0] * 24 * 3600, getTimeZone());
|
||||||
echo $time->format('d.m.Y');
|
return new htmlOutputText($time->format('d.m.Y'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($attribute == 'sambakickofftime') {
|
elseif ($attribute == 'sambakickofftime') {
|
||||||
if (!empty($entry[$attribute][0])) {
|
if (!empty($entry[$attribute][0])) {
|
||||||
if ($entry[$attribute][0] > 2147483648) {
|
if ($entry[$attribute][0] > 2147483648) {
|
||||||
echo "∞";
|
return new htmlOutputText("∞");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$date = new DateTime('@' . $entry[$attribute][0], new DateTimeZone('UTC'));
|
$date = new DateTime('@' . $entry[$attribute][0], new DateTimeZone('UTC'));
|
||||||
echo $date->format('d.m.Y');
|
return new htmlOutputText($date->format('d.m.Y'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// account status
|
// account status
|
||||||
elseif ($attribute == self::ATTR_ACCOUNT_STATUS) {
|
elseif ($attribute == self::ATTR_ACCOUNT_STATUS) {
|
||||||
$this->printAccountStatus($entry);
|
return $this->getAccountStatus($entry);
|
||||||
}
|
}
|
||||||
// print all other attributes
|
// print all other attributes
|
||||||
else {
|
else {
|
||||||
parent::listPrintTableCellContent($entry, $attribute);
|
return parent::getTableCellContent($entry, $attribute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1040,11 +1035,12 @@ class lamUserList extends lamList {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the account status.
|
* Returns the account status.
|
||||||
*
|
*
|
||||||
* @param array $attrs LDAP attributes
|
* @param array $attrs LDAP attributes
|
||||||
|
* @return htmlElement content
|
||||||
*/
|
*/
|
||||||
private function printAccountStatus(&$attrs) {
|
private function getAccountStatus(&$attrs) {
|
||||||
// check status
|
// check status
|
||||||
$unixAvailable = self::isUnixAvailable($attrs);
|
$unixAvailable = self::isUnixAvailable($attrs);
|
||||||
$sambaAvailable = self::isSambaAvailable($attrs);
|
$sambaAvailable = self::isSambaAvailable($attrs);
|
||||||
|
@ -1144,10 +1140,10 @@ class lamUserList extends lamList {
|
||||||
$tipContent .= '<tr><td>' . _('Password expired') . ' </td><td><img height=16 width=16 src="../../graphics/lock.png"></td></tr>';
|
$tipContent .= '<tr><td>' . _('Password expired') . ' </td><td><img height=16 width=16 src="../../graphics/lock.png"></td></tr>';
|
||||||
}
|
}
|
||||||
$tipContent .= '</table>';
|
$tipContent .= '</table>';
|
||||||
echo '<img helptitle="' . _('Account status') . '" helpdata="' . $tipContent . '" alt="status" height=16 width=16 src="../../graphics/' . $icon . '">';
|
return new htmlOutputText('<img helptitle="' . _('Account status') . '" helpdata="' . $tipContent . '" alt="status" height=16 width=16 src="../../graphics/' . $icon . '">', false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo '<img alt="status" height=16 width=16 src="../../graphics/' . $icon . '">';
|
return new htmlImage('../../graphics/' . $icon, 16, 16, 'status');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -507,6 +507,10 @@ input.markOk {
|
||||||
.sortableList li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; }
|
.sortableList li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; }
|
||||||
.sortableList li span { position: absolute; margin-left: -1.3em; }
|
.sortableList li span { position: absolute; margin-left: -1.3em; }
|
||||||
|
|
||||||
|
.strike-through {
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* table style for delete.php
|
* table style for delete.php
|
||||||
|
|
|
@ -61,6 +61,11 @@ div.lam-dialog-msg {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.dialog-content {
|
||||||
|
overflow: visible !important;
|
||||||
|
margin: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
table.padding5 td {
|
table.padding5 td {
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
}
|
}
|
||||||
|
@ -73,11 +78,15 @@ table.responsive-table {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.responsive-table th {
|
table.responsive-table th {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 0;
|
padding-bottom: 0.5rem;
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
padding-right: 0.3rem;
|
||||||
|
padding-left: 0.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.responsive-table td {
|
table.responsive-table td {
|
||||||
|
@ -85,8 +94,8 @@ table.responsive-table td {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
padding-bottom: 0.5rem;
|
padding-bottom: 0.5rem;
|
||||||
padding-top: 0.5rem;
|
padding-top: 0.5rem;
|
||||||
padding-right: 0.1rem;
|
padding-right: 0.3rem;
|
||||||
padding-left: 0.1rem;
|
padding-left: 0.3rem;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,6 +154,10 @@ table.responsive-table td {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fullwidth-mobile-only {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tablet */
|
/* tablet */
|
||||||
|
|
|
@ -62,23 +62,6 @@ function listPageNumberKeyPress(url, e) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Resizes the content area of the account lists to fit the window size.
|
|
||||||
* This prevents that the whole page is scrolled in the browser. Only the account table has scroll bars.
|
|
||||||
*/
|
|
||||||
function listResizeITabContentDiv() {
|
|
||||||
var myDiv = document.getElementById("listTabContentArea");
|
|
||||||
var height = document.documentElement.clientHeight;
|
|
||||||
height -= myDiv.offsetTop;
|
|
||||||
height -= 105;
|
|
||||||
myDiv.style.height = height +"px";
|
|
||||||
|
|
||||||
var myDivScroll = document.getElementById("listScrollArea");
|
|
||||||
var top = myDivScroll.offsetTop;
|
|
||||||
var scrollHeight = height - (top - myDiv.offsetTop);
|
|
||||||
myDivScroll.style.height = scrollHeight + "px";
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows the dialog to change the list settings.
|
* Shows the dialog to change the list settings.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue