Commit f78b3c30 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

feat(management) Move styling to CSS theme

Moved styling out of HTML code into the CSS theme files
parent 2516a462
......@@ -123,6 +123,9 @@ border-bottom: 1px solid silver;
padding: 3px;
width: auto;
}
div.nlistFooter img {
vertical-align:middle;
}
/* Tree List (used in baseSelector) */
ul.treeList,ul.treeList ul {
......@@ -223,6 +226,27 @@ table.listing-container > tbody > tr > td.filter .contentboxb {
min-width: 230px;
}
/* Management */
table.listingTable.management {
width:100%;
}
table.listingTable.management > thead > tr > th.checkbox {
text-align:center;
padding:0;
width:24px;
}
table.listingTable.management > tbody > tr > td.filler {
height:100%;
width:100%;
}
table.listingTable > thead > tr > th > img, table.listingTable > thead > tr > th > input[type=image],
table.listingTable > tbody > tr > td > img, table.listingTable > tbody > tr > td > input[type=image] {
vertical-align: middle;
}
/* On small screens */
@media (max-width: 640px) {
table.listingTable {
......
......@@ -57,6 +57,10 @@ html.rtl .plugbottom {
text-align: left;
}
.plugbottom input[type=submit], .plugbottom input[type=button] {
min-width: 80px;
}
/* Simple Plugin specific things */
.plugin-sections:after {
......
......@@ -449,6 +449,10 @@ html.rtl #pulldown ul li a {
float: right;
}
#pulldown ul li img {
vertical-align:middle;
}
#pulldown ul li a:hover {
text-decoration: none;
}
......
......@@ -114,6 +114,9 @@ border-bottom: 1px solid silver;
padding: 3px;
width: auto;
}
div.nlistFooter img {
vertical-align:middle;
}
/* Tree List (used in baseSelector) */
ul.treeList,ul.treeList ul {
......@@ -214,6 +217,27 @@ table.listing-container > tbody > tr > td.filter .contentboxb {
min-width: 230px;
}
/* Management */
table.listingTable.management {
width:100%;
}
table.listingTable.management > thead > tr > th.checkbox {
text-align:center;
padding:0;
width:24px;
}
table.listingTable.management > tbody > tr > td.filler {
height:100%;
width:100%;
}
table.listingTable > thead > tr > th > img, table.listingTable > thead > tr > th > input[type=image],
table.listingTable > tbody > tr > td > img, table.listingTable > tbody > tr > td > input[type=image] {
vertical-align: middle;
}
/* On small screens */
@media (max-width: 640px) {
table.listingTable {
......
......@@ -58,6 +58,10 @@ html.rtl .plugbottom {
text-align: left;
}
.plugbottom input[type=submit], .plugbottom input[type=button] {
min-width: 80px;
}
/* Simple Plugin specific things */
.plugin-sections:after {
......
......@@ -438,6 +438,10 @@ html.rtl #pulldown ul li a {
float: right;
}
#pulldown ul li img {
vertical-align:middle;
}
#pulldown ul li a:hover {
text-decoration: none;
}
......
......@@ -476,7 +476,7 @@ class management
} else {
// Display ok, (apply) and cancel buttons
$str .= '<p class="plugbottom">'."\n";
$str .= '<input type="submit" name="edit_finish" style="width:80px" value="'.msgPool::okButton().'"/>'."\n";
$str .= '<input type="submit" name="edit_finish" value="'.msgPool::okButton().'"/>'."\n";
$str .= "&nbsp;\n";
if ($this->dn != 'new') {
$str .= '<input type="submit" name="edit_apply" value="'.msgPool::applyButton().'"/>'."\n";
......
......@@ -124,7 +124,7 @@ class Action
.'<a href="#" onClick="'
."document.getElementById('actionmenu').value='".$this->name."';document.getElementById('exec_act').click();"
.'">'
.'<img src="'.htmlentities($this->icon, ENT_COMPAT, 'UTF-8').'" alt="'.$this->name.'" class="center">&nbsp;'.$this->label.'</a>'
.'<img src="'.htmlentities($this->icon, ENT_COMPAT, 'UTF-8').'" alt="'.$this->name.'">&nbsp;'.$this->label.'</a>'
.'</li>'."\n";
}
......@@ -141,14 +141,14 @@ class Action
// Skip the entry completely if there's no permission to execute it
if (!$this->hasPermission($entry->dn, $entry->getTemplatedType(), $entry->isTemplate())) {
return '<img src="images/empty.png" alt=" " class="center optional"/>';
return '<img src="images/empty.png" alt=" " class="optional"/>';
}
// TODO? Skip entry if the pseudo filter does not fit
// TODO? Skip depending on type
// Render
return '<input class="center" type="image" src="'.htmlentities($this->icon, ENT_COMPAT, 'UTF-8').'"'.
return '<input type="image" src="'.htmlentities($this->icon, ENT_COMPAT, 'UTF-8').'"'.
' title="'.$this->label.'" alt="'.$this->label.'" name="listing_'.$this->name.'_'.$entry->row.'"/>';
}
......@@ -228,7 +228,7 @@ class ActionSubMenu extends Action
if (!empty($this->label)) {
$img = '';
if (!empty($this->icon)) {
$img = '<img class="center" src="'.htmlentities($this->icon, ENT_COMPAT, 'UTF-8').'" alt="'.$this->label.'"/>&nbsp;';
$img = '<img src="'.htmlentities($this->icon, ENT_COMPAT, 'UTF-8').'" alt="'.$this->label.'"/>&nbsp;';
}
$result .= '<li id="actionmenu_'.$this->name.'"><a href="#">'.$img.'&nbsp;'.$this->label.'&nbsp;<img src="images/forward-arrow.png" alt="forward arrow"/></a>'."\n";
}
......
......@@ -189,10 +189,10 @@ class ObjectTypeColumn extends StringColumn
{
if ($entry->isTemplate()) {
$infos = objects::infos($entry->getTemplatedType());
return '<img class="center" title="'.$entry->dn.'" src="'.htmlentities('geticon.php?context=devices&icon=template&size=16', ENT_COMPAT, 'UTF-8').'" alt="'.sprintf(_('%s template'), $infos['name']).'"/>';
return '<img title="'.$entry->dn.'" src="'.htmlentities('geticon.php?context=devices&icon=template&size=16', ENT_COMPAT, 'UTF-8').'" alt="'.sprintf(_('%s template'), $infos['name']).'"/>';
} elseif ($entry->type) {
$infos = objects::infos($entry->type);
return '<img class="center" title="'.$entry->dn.'" src="'.htmlentities($infos['icon'], ENT_COMPAT, 'UTF-8').'" alt="'.$infos['name'].'"/>';
return '<img title="'.$entry->dn.'" src="'.htmlentities($infos['icon'], ENT_COMPAT, 'UTF-8').'" alt="'.$infos['name'].'"/>';
} else {
return '&nbsp;';
}
......@@ -253,7 +253,7 @@ class PropertiesColumn extends StringColumn
/* Main tab is always there */
$pInfos = pluglist::pluginInfos($infos['mainTab']);
$result = '<input class="center" type="image" src="'.htmlentities($pInfos['plSmallIcon'], ENT_COMPAT, 'UTF-8').'" '.
$result = '<input type="image" src="'.htmlentities($pInfos['plSmallIcon'], ENT_COMPAT, 'UTF-8').'" '.
'alt="'.$pInfos['plShortName'].'" title="'.$pInfos['plShortName'].'" '.
'name="listing_edit_tab_'.$infos['mainTab'].'_'.$entry->row.'"/>';
if (!empty($entry)) {
......@@ -266,14 +266,14 @@ class PropertiesColumn extends StringColumn
if ($tab->is_this_account($attrs)) {
$pInfos = pluglist::pluginInfos($class);
if (isset($pInfos['plSmallIcon'])) {
$result .= '<input class="center" type="image" src="'.htmlentities($pInfos['plSmallIcon'], ENT_COMPAT, 'UTF-8').'" '.
$result .= '<input type="image" src="'.htmlentities($pInfos['plSmallIcon'], ENT_COMPAT, 'UTF-8').'" '.
'alt="'.$pInfos['plShortName'].'" title="'.$pInfos['plShortName'].'" '.
'name="listing_edit_tab_'.$class.'_'.$entry->row.'"/>';
} else {
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $pInfos['plShortName']." ($class)", 'No icon for');
}
} else {
$result .= '<img src="images/empty.png" alt="" class="center optional '.$class.'"/>';
$result .= '<img src="images/empty.png" alt="" class="optional '.$class.'"/>';
}
}
}
......
......@@ -146,7 +146,6 @@ class managementListing
//~ var $exporter = array();
//~ var $exportColumns = array();
protected $height = 0;
protected $scrollPosition = 0;
protected $baseSelector;
//~ protected $filterCache = array();
......@@ -296,7 +295,7 @@ class managementListing
$sorter = '';
if (($index == $this->sortColumn) && $column->isSortable()) {
$sorter = '&nbsp;<img class="center" title="'.($this->sortDirection[$index] ? _('Up') : _('Down')).'" src="geticon.php?context=actions&amp;size=16&amp;icon=view-sort-'.($this->sortDirection[$index] ? 'descending' : 'ascending').'" alt="'.($this->sortDirection[$index] ? _('Sort up') : _('Sort down')).'"/>';
$sorter = '&nbsp;<img title="'.($this->sortDirection[$index] ? _('Up') : _('Down')).'" src="geticon.php?context=actions&amp;size=16&amp;icon=view-sort-'.($this->sortDirection[$index] ? 'descending' : 'ascending').'" alt="'.($this->sortDirection[$index] ? _('Sort up') : _('Sort down')).'"/>';
}
$link = 'href="?plug='.$_GET['plug'].'&amp;PID='.$this->pid.'&amp;act=SORT_'.$index.'"';
......@@ -323,21 +322,19 @@ class managementListing
// Initialize list
$result = '<input type="hidden" value="'.$this->pid.'" name="PID"/>'."\n";
$result .= '<input type="hidden" name="position_'.$this->pid.'" id="position_'.$this->pid.'"/>'."\n";
$height = 450;
if ($this->height != 0) {
$result .= '<input type="hidden" value="'.$this->height.'" id="d_height"/>'."\n";
$height = $this->height;
}
$result .= '<div id="d_scrollbody" style="width:100%;">'."\n";
$result .= '<table style="width:100%;" id="t_scrolltable" class="listingTable">'."\n";
$result .= '<div style="width:100%;">'."\n";
$result .= '<table class="listingTable management">'."\n";
// Build list header
$result .= '<thead><tr>'."\n";
if ($this->multiSelect) {
$width = '24px';
$result .= '<th style="text-align:center;padding:0;width:'.$width.';"><input type="checkbox" id="select_all" name="select_all" title="'._('Select all').'" onClick=\'toggle_all_("listing_selected_[0-9]*$","select_all");\' /></th>'."\n";
$result .= '<th class="checkbox"><input type="checkbox" id="select_all" name="select_all" title="'._('Select all').'" onClick=\'toggle_all_("listing_selected_[0-9]*$","select_all");\' /></th>'."\n";
}
foreach ($this->header as $header) {
$result .= $header;
......@@ -345,11 +342,11 @@ class managementListing
$result .= '</tr></thead>'."\n";
// Build list body
$result .= '<tbody id="t_nscrollbody">'."\n";
$result .= '<tbody>'."\n";
// No results? Just take an empty colspanned row
if (count($this->entries) == 0) {
$result .= '<tr><td colspan="'.(count($this->columns) + ($this->multiSelect ? 1 : 0)).'" style="height:100%;width:100%;">&nbsp;</td></tr>'."\n";
$result .= '<tr><td colspan="'.(count($this->columns) + ($this->multiSelect ? 1 : 0)).'" class="filler">&nbsp;</td></tr>'."\n";
}
// Fill with contents, sort as configured
......@@ -391,19 +388,13 @@ class managementListing
foreach ($this->parent->objectTypes as $type) {
if (isset($this->objectTypeCount[$type])) {
$infos = objects::infos($type);
$result .= '<img class="center" src="'.htmlentities($infos['icon'], ENT_COMPAT, 'UTF-8').'" title="'.$infos['name'].'" alt="'.$infos['name'].'"/>&nbsp;'.$this->objectTypeCount[$type]."&nbsp;&nbsp;&nbsp;&nbsp;";
$result .= '<img src="'.htmlentities($infos['icon'], ENT_COMPAT, 'UTF-8').'" title="'.$infos['name'].'" alt="'.$infos['name'].'"/>&nbsp;'.$this->objectTypeCount[$type]."&nbsp;&nbsp;&nbsp;&nbsp;";
}
}
$result .= '</div>';
}
// Add scroll positioner
$result .= '<script type="text/javascript">';
$result .= '$("t_nscrollbody").scrollTop= '.$this->scrollPosition.';';
$result .= 'var box = $("t_nscrollbody").onscroll= function() {$("position_'.$this->pid.'").value= this.scrollTop;}';
$result .= '</script>';
return $result;
}
......@@ -434,11 +425,6 @@ class managementListing
// Do not do anything if this is not our PID
if ($refresh || !(isset($_REQUEST['PID']) && $_REQUEST['PID'] != $this->pid)) {
// Save position if set
if (isset($_POST['position_'.$this->pid]) && is_numeric($_POST['position_'.$this->pid])) {
$this->scrollPosition = $_POST['position_'.$this->pid];
}
// Filter POST with "act" attributes -> posted from action menu
if (isset($_POST['exec_act']) && $_POST['act'] != '') {
if (preg_match('/^export.*$/', $_POST['act']) && isset($this->exporter[$_POST['act']])) {
......@@ -644,11 +630,6 @@ class managementListing
return;
}
// Save position if set
if (isset($_POST['position_'.$this->pid]) && is_numeric($_POST['position_'.$this->pid])) {
$this->scrollPosition = $_POST['position_'.$this->pid];
}
$result = array('targets' => array(), 'action' => '', 'subaction' => NULL);
// Filter GET with "act" attributes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment