mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 03:09:21 +02:00
Views Admin almost completely working.
Need to code moving up and down of columns when adding / editing a new View.
This commit is contained in:
parent
037356b554
commit
64a92aabf9
@ -201,14 +201,17 @@ if ( isset($content['ISEDITORNEWVIEW']) && $content['ISEDITORNEWVIEW'] )
|
|||||||
// --- Read Columns from Formdata
|
// --- Read Columns from Formdata
|
||||||
if ( is_array($_POST['Columns']) )
|
if ( is_array($_POST['Columns']) )
|
||||||
{
|
{
|
||||||
|
// Copy columns ID's
|
||||||
|
foreach ($_POST['Columns'] as $myColKey)
|
||||||
|
$content['SUBCOLUMNS'][$myColKey]['ColFieldID'] = $myColKey;
|
||||||
}
|
}
|
||||||
else // One element only
|
else // One element only
|
||||||
$content['COLUMNS'][$_POST['Columns']]['ColFieldID'] = $_POST['Columns'];
|
$content['SUBCOLUMNS'][$_POST['Columns']]['ColFieldID'] = $_POST['Columns'];
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// --- Process Columns for display
|
// --- Process Columns for display
|
||||||
$i = 0; // Help counter!
|
$i = 0; // Help counter!
|
||||||
foreach ($content['COLUMNS'] as $key => &$myColumn )
|
foreach ($content['SUBCOLUMNS'] as $key => &$myColumn )
|
||||||
{
|
{
|
||||||
// Set Fieldcaption
|
// Set Fieldcaption
|
||||||
if ( isset($content[ $fields[$key]['FieldCaptionID'] ]) )
|
if ( isset($content[ $fields[$key]['FieldCaptionID'] ]) )
|
||||||
@ -225,12 +228,21 @@ if ( isset($content['ISEDITORNEWVIEW']) && $content['ISEDITORNEWVIEW'] )
|
|||||||
// ---
|
// ---
|
||||||
}
|
}
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
|
// print_r ( $content['COLUMNS'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Copy fields data array
|
// --- Copy fields data array
|
||||||
$content['FIELDS'] = $fields;
|
$content['FIELDS'] = $fields;
|
||||||
|
|
||||||
|
// removed already added fields
|
||||||
|
foreach ($content['SUBCOLUMNS'] as $key => &$myColumn )
|
||||||
|
{
|
||||||
|
if ( isset($content['FIELDS'][$key]) )
|
||||||
|
unset($content['FIELDS'][$key]);
|
||||||
|
}
|
||||||
|
|
||||||
// removed already added fields and set fieldcaption
|
// set fieldcaption
|
||||||
foreach ($content['FIELDS'] as $key => &$myField )
|
foreach ($content['FIELDS'] as $key => &$myField )
|
||||||
{
|
{
|
||||||
// Set Fieldcaption
|
// Set Fieldcaption
|
||||||
@ -273,6 +285,7 @@ if ( isset($_POST['op']) )
|
|||||||
$content['ERROR_MSG'] = $content['LN_VIEWS_ERROR_DISPLAYNAMEEMPTY'];
|
$content['ERROR_MSG'] = $content['LN_VIEWS_ERROR_DISPLAYNAMEEMPTY'];
|
||||||
}
|
}
|
||||||
// ---
|
// ---
|
||||||
|
print_r ( $_POST );
|
||||||
|
|
||||||
if ( !isset($content['ISERROR']) )
|
if ( !isset($content['ISERROR']) )
|
||||||
{
|
{
|
||||||
@ -280,25 +293,62 @@ if ( isset($_POST['op']) )
|
|||||||
if ( isset($_POST['subop']) )
|
if ( isset($_POST['subop']) )
|
||||||
{
|
{
|
||||||
// Get NewColID
|
// Get NewColID
|
||||||
$szNewColID = DB_RemoveBadChars($_POST['newcolumn']);
|
$szColId = DB_RemoveBadChars($_POST['newcolumn']);
|
||||||
|
|
||||||
// Add a new Column into our list!
|
// Add a new Column into our list!
|
||||||
if ( $_POST['subop'] == $content['LN_VIEWS_ADDCOLUMN'] && isset($_POST['newcolumn']) )
|
if ( $_POST['subop'] == $content['LN_VIEWS_ADDCOLUMN'] && isset($_POST['newcolumn']) )
|
||||||
{
|
{
|
||||||
// Add New entry into columnlist
|
// Add New entry into columnlist
|
||||||
$content['COLUMNS'][$szNewColID]['ColFieldID'] = $szNewColID;
|
$content['SUBCOLUMNS'][$szColId]['ColFieldID'] = $szColId;
|
||||||
|
|
||||||
// Set Fieldcaption
|
// Set Fieldcaption
|
||||||
if ( isset($content[ $fields[$szNewColID]['FieldCaptionID'] ]) )
|
if ( isset($content[ $fields[$szColId]['FieldCaptionID'] ]) )
|
||||||
$content['COLUMNS'][$szNewColID]['ColCaption'] = $content[ $fields[$szNewColID]['FieldCaptionID'] ];
|
$content['SUBCOLUMNS'][$szColId]['ColCaption'] = $content[ $fields[$szColId]['FieldCaptionID'] ];
|
||||||
else
|
else
|
||||||
$content['COLUMNS'][$szNewColID]['ColCaption'] = $szNewColID;
|
$content['SUBCOLUMNS'][$szColId]['ColCaption'] = $szColId;
|
||||||
|
|
||||||
// Set CSSClass
|
// Set CSSClass
|
||||||
$content['COLUMNS'][$szNewColID]['colcssclass'] = count($content['COLUMNS']) % 2 == 0 ? "line1" : "line2";
|
$content['SUBCOLUMNS'][$szColId]['colcssclass'] = count($content['SUBCOLUMNS']) % 2 == 0 ? "line1" : "line2";
|
||||||
|
|
||||||
|
// Remove from fields list as well
|
||||||
|
if ( isset($content['FIELDS'][$szColId]) )
|
||||||
|
unset($content['FIELDS'][$szColId]);
|
||||||
|
|
||||||
}
|
}
|
||||||
// else if ()
|
}
|
||||||
// {
|
else if ( isset($_POST['subop_delete']) )
|
||||||
// }
|
{
|
||||||
|
// Get Column ID
|
||||||
|
$szColId = DB_RemoveBadChars($_POST['subop_delete']);
|
||||||
|
|
||||||
|
// Remove Entry from Columnslist
|
||||||
|
if ( isset($content['SUBCOLUMNS'][$szColId]) )
|
||||||
|
unset($content['SUBCOLUMNS'][$szColId]);
|
||||||
|
|
||||||
|
// Add removed entry to field list
|
||||||
|
$content['FIELDS'][$szColId] = $fields[$szColId];
|
||||||
|
|
||||||
|
// Set Fieldcaption
|
||||||
|
if ( isset($content[ $fields[$szColId]['FieldCaptionID'] ]) )
|
||||||
|
$content['FIELDS'][$szColId]['FieldCaption'] = $content[ $fields[$szColId]['FieldCaptionID'] ];
|
||||||
|
else
|
||||||
|
$content['FIELDS'][$szColId]['FieldCaption'] = $szColId;
|
||||||
|
}
|
||||||
|
else if ( isset($_POST['subop_moveup']) )
|
||||||
|
{
|
||||||
|
// Get Column ID
|
||||||
|
$szColId = DB_RemoveBadChars($_POST['subop_moveup']);
|
||||||
|
|
||||||
|
// Move Entry one UP in Columnslist
|
||||||
|
|
||||||
|
}
|
||||||
|
else if ( isset($_POST['subop_movedown']) )
|
||||||
|
{
|
||||||
|
// Get Column ID
|
||||||
|
$szColId = DB_RemoveBadChars($_POST['subop_movedown']);
|
||||||
|
|
||||||
|
// Move Entry one DOWN in Columnslist
|
||||||
|
|
||||||
}
|
}
|
||||||
else // Now SUBOP means normal processing!
|
else // Now SUBOP means normal processing!
|
||||||
{
|
{
|
||||||
|
@ -75,3 +75,11 @@
|
|||||||
border:0px solid;
|
border:0px solid;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.borderlessbuttons
|
||||||
|
{
|
||||||
|
border:0px solid;
|
||||||
|
background-color: transparent;
|
||||||
|
width:20px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
BIN
src/images/icons/nav_down_blue.png
Normal file
BIN
src/images/icons/nav_down_blue.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 904 B |
BIN
src/images/icons/nav_up_blue.png
Normal file
BIN
src/images/icons/nav_up_blue.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 913 B |
@ -435,6 +435,8 @@ function InitFrontEndVariables()
|
|||||||
$content['MENU_INTERNAL'] = $content['BASEPATH'] . "images/icons/gear.png";
|
$content['MENU_INTERNAL'] = $content['BASEPATH'] . "images/icons/gear.png";
|
||||||
$content['MENU_EDIT_DISABLED'] = $content['BASEPATH'] . "images/icons/edit_disabled.png";
|
$content['MENU_EDIT_DISABLED'] = $content['BASEPATH'] . "images/icons/edit_disabled.png";
|
||||||
$content['MENU_DELETE_DISABLED'] = $content['BASEPATH'] . "images/icons/delete_disabled.png";
|
$content['MENU_DELETE_DISABLED'] = $content['BASEPATH'] . "images/icons/delete_disabled.png";
|
||||||
|
$content['MENU_MOVE_UP'] = $content['BASEPATH'] . "images/icons/nav_up_blue.png";
|
||||||
|
$content['MENU_MOVE_DOWN'] = $content['BASEPATH'] . "images/icons/nav_down_blue.png";
|
||||||
|
|
||||||
$content['MENU_PAGER_BEGIN'] = $content['BASEPATH'] . "images/icons/media_beginning.png";
|
$content['MENU_PAGER_BEGIN'] = $content['BASEPATH'] . "images/icons/media_beginning.png";
|
||||||
$content['MENU_PAGER_PREVIOUS'] = $content['BASEPATH'] . "images/icons/media_rewind.png";
|
$content['MENU_PAGER_PREVIOUS'] = $content['BASEPATH'] . "images/icons/media_rewind.png";
|
||||||
|
@ -170,8 +170,8 @@ $content['LN_VIEWS_ADDEDIT'] = "Add / Edit a View";
|
|||||||
$content['LN_VIEWS_COLUMNLIST'] = "Configured Columns";
|
$content['LN_VIEWS_COLUMNLIST'] = "Configured Columns";
|
||||||
$content['LN_VIEWS_ADDCOLUMN'] = "Add Column into list";
|
$content['LN_VIEWS_ADDCOLUMN'] = "Add Column into list";
|
||||||
$content['LN_VIEWS_ERROR_DISPLAYNAMEEMPTY'] = "The DisplayName cannot be empty.";
|
$content['LN_VIEWS_ERROR_DISPLAYNAMEEMPTY'] = "The DisplayName cannot be empty.";
|
||||||
$content['LN_VIEWS_'] = "";
|
$content['LN_VIEWS_COLUMN'] = "Column";
|
||||||
$content['LN_VIEWS_'] = "";
|
$content['LN_VIEWS_COLUMN_REMOVE'] = "Remove Column";
|
||||||
$content['LN_VIEWS_'] = "";
|
$content['LN_VIEWS_'] = "";
|
||||||
$content['LN_VIEWS_'] = "";
|
$content['LN_VIEWS_'] = "";
|
||||||
$content['LN_VIEWS_'] = "";
|
$content['LN_VIEWS_'] = "";
|
||||||
|
@ -79,21 +79,29 @@
|
|||||||
<br>
|
<br>
|
||||||
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" class="with_border_alternate">
|
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" class="with_border_alternate">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="cellmenu1" colspan="2"><b>{LN_VIEWS_COLUMNLIST}</b></td>
|
<td align="center" class="cellmenu1" colspan="3"><b>{LN_VIEWS_COLUMNLIST}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- BEGIN COLUMNS -->
|
<!-- BEGIN SUBCOLUMNS -->
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" class="{colcssclass}">
|
<td align="left" class="cellmenu2" width="150"><b>{LN_VIEWS_COLUMN} {ZAEHLER}: </b></td>
|
||||||
<input type="hidden" name="Columns" value="{ColFieldID}">
|
|
||||||
<b>{ColFieldID} {ColCaption}</b>
|
<td align="left" class="{colcssclass}" width="300">
|
||||||
|
<input type="hidden" name="Columns[]" value="{ColFieldID}">
|
||||||
|
<b>{ColCaption}</b>
|
||||||
</td>
|
</td>
|
||||||
<td align="right" class="{cssclass}">
|
<td align="center" class="{colcssclass}" width="150">
|
||||||
<a href="{BASEPATH}admin/views.php?op=delete&id={ID}"><img src="{MENU_DELETE}" width="16" title="{LN_SEARCH_DELETE}"></a>
|
<button name="subop_moveup" type="submit" value="{ColFieldID}" class="borderlessbuttons" title="{LN_VIEWS_COLUMN_REMOVE}"><img src="{MENU_MOVE_UP}" width="16" alt="{LN_VIEWS_COLUMN_REMOVE}"></button>
|
||||||
|
<button name="subop_movedown" type="submit" value="{ColFieldID}" class="borderlessbuttons" title="{LN_VIEWS_COLUMN_REMOVE}"><img src="{MENU_MOVE_DOWN}" width="16" alt="{LN_VIEWS_COLUMN_REMOVE}"></button>
|
||||||
|
<button name="subop_delete" type="submit" value="{ColFieldID}" class="borderlessbuttons" title="{LN_VIEWS_COLUMN_REMOVE}"><img src="{MENU_DELETE}" width="16" alt="{LN_VIEWS_COLUMN_REMOVE}"></button>
|
||||||
|
|
||||||
|
<!-- <input type="submit" style="background-image:url({MENU_DELETE}); background-repeat:no-repeat; background-position:center;" class="borderless" name="subop_delete" value="{ColFieldID}">
|
||||||
|
<input type="image" src="{MENU_DELETE}" alt="{LN_VIEWS_COLUMN_REMOVE}" class="borderless" width="16" name="subop_delete_{ColFieldID}">
|
||||||
|
-->
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END COLUMNS -->
|
<!-- END SUBCOLUMNS -->
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="line2" colspan="2">
|
<td align="center" class="line2" colspan="3">
|
||||||
|
|
||||||
<select name="newcolumn" size="1" STYLE="width: 200px">
|
<select name="newcolumn" size="1" STYLE="width: 200px">
|
||||||
<!-- BEGIN FIELDS -->
|
<!-- BEGIN FIELDS -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user