diff --git a/src/admin/views.php b/src/admin/views.php
index 738ac95..231c17f 100644
--- a/src/admin/views.php
+++ b/src/admin/views.php
@@ -201,14 +201,17 @@ if ( isset($content['ISEDITORNEWVIEW']) && $content['ISEDITORNEWVIEW'] )
// --- Read Columns from Formdata
if ( is_array($_POST['Columns']) )
{
+ // Copy columns ID's
+ foreach ($_POST['Columns'] as $myColKey)
+ $content['SUBCOLUMNS'][$myColKey]['ColFieldID'] = $myColKey;
}
else // One element only
- $content['COLUMNS'][$_POST['Columns']]['ColFieldID'] = $_POST['Columns'];
+ $content['SUBCOLUMNS'][$_POST['Columns']]['ColFieldID'] = $_POST['Columns'];
// ---
// --- Process Columns for display
$i = 0; // Help counter!
- foreach ($content['COLUMNS'] as $key => &$myColumn )
+ foreach ($content['SUBCOLUMNS'] as $key => &$myColumn )
{
// Set Fieldcaption
if ( isset($content[ $fields[$key]['FieldCaptionID'] ]) )
@@ -225,12 +228,21 @@ if ( isset($content['ISEDITORNEWVIEW']) && $content['ISEDITORNEWVIEW'] )
// ---
}
// ---
+
+// print_r ( $content['COLUMNS'] );
}
// --- Copy fields data array
$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 )
{
// Set Fieldcaption
@@ -273,6 +285,7 @@ if ( isset($_POST['op']) )
$content['ERROR_MSG'] = $content['LN_VIEWS_ERROR_DISPLAYNAMEEMPTY'];
}
// ---
+print_r ( $_POST );
if ( !isset($content['ISERROR']) )
{
@@ -280,25 +293,62 @@ if ( isset($_POST['op']) )
if ( isset($_POST['subop']) )
{
// Get NewColID
- $szNewColID = DB_RemoveBadChars($_POST['newcolumn']);
+ $szColId = DB_RemoveBadChars($_POST['newcolumn']);
// Add a new Column into our list!
if ( $_POST['subop'] == $content['LN_VIEWS_ADDCOLUMN'] && isset($_POST['newcolumn']) )
{
// Add New entry into columnlist
- $content['COLUMNS'][$szNewColID]['ColFieldID'] = $szNewColID;
+ $content['SUBCOLUMNS'][$szColId]['ColFieldID'] = $szColId;
+
// Set Fieldcaption
- if ( isset($content[ $fields[$szNewColID]['FieldCaptionID'] ]) )
- $content['COLUMNS'][$szNewColID]['ColCaption'] = $content[ $fields[$szNewColID]['FieldCaptionID'] ];
+ if ( isset($content[ $fields[$szColId]['FieldCaptionID'] ]) )
+ $content['SUBCOLUMNS'][$szColId]['ColCaption'] = $content[ $fields[$szColId]['FieldCaptionID'] ];
else
- $content['COLUMNS'][$szNewColID]['ColCaption'] = $szNewColID;
+ $content['SUBCOLUMNS'][$szColId]['ColCaption'] = $szColId;
// 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!
{
diff --git a/src/css/defaults.css b/src/css/defaults.css
index ebddd41..9f49765 100644
--- a/src/css/defaults.css
+++ b/src/css/defaults.css
@@ -75,3 +75,11 @@
border:0px solid;
background-color: transparent;
}
+
+.borderlessbuttons
+{
+ border:0px solid;
+ background-color: transparent;
+ width:20px;
+ padding: 0px;
+}
diff --git a/src/images/icons/nav_down_blue.png b/src/images/icons/nav_down_blue.png
new file mode 100644
index 0000000..17eef44
Binary files /dev/null and b/src/images/icons/nav_down_blue.png differ
diff --git a/src/images/icons/nav_up_blue.png b/src/images/icons/nav_up_blue.png
new file mode 100644
index 0000000..c5eaf43
Binary files /dev/null and b/src/images/icons/nav_up_blue.png differ
diff --git a/src/include/functions_common.php b/src/include/functions_common.php
index 39b136c..808f457 100644
--- a/src/include/functions_common.php
+++ b/src/include/functions_common.php
@@ -435,6 +435,8 @@ function InitFrontEndVariables()
$content['MENU_INTERNAL'] = $content['BASEPATH'] . "images/icons/gear.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_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_PREVIOUS'] = $content['BASEPATH'] . "images/icons/media_rewind.png";
diff --git a/src/lang/en/admin.php b/src/lang/en/admin.php
index 939464e..f3195da 100644
--- a/src/lang/en/admin.php
+++ b/src/lang/en/admin.php
@@ -170,8 +170,8 @@ $content['LN_VIEWS_ADDEDIT'] = "Add / Edit a View";
$content['LN_VIEWS_COLUMNLIST'] = "Configured Columns";
$content['LN_VIEWS_ADDCOLUMN'] = "Add Column into list";
$content['LN_VIEWS_ERROR_DISPLAYNAMEEMPTY'] = "The DisplayName cannot be empty.";
-$content['LN_VIEWS_'] = "";
-$content['LN_VIEWS_'] = "";
+$content['LN_VIEWS_COLUMN'] = "Column";
+$content['LN_VIEWS_COLUMN_REMOVE'] = "Remove Column";
$content['LN_VIEWS_'] = "";
$content['LN_VIEWS_'] = "";
$content['LN_VIEWS_'] = "";
diff --git a/src/templates/admin/admin_views.html b/src/templates/admin/admin_views.html
index 7d60431..ca8f781 100644
--- a/src/templates/admin/admin_views.html
+++ b/src/templates/admin/admin_views.html
@@ -79,21 +79,29 @@
{LN_VIEWS_COLUMNLIST} | +{LN_VIEWS_COLUMNLIST} | |||
- - {ColFieldID} {ColCaption} + | {LN_VIEWS_COLUMN} {ZAEHLER}: | + ++ + {ColCaption} | -
- | + + + + + |
+ |