Author: jfthomps
Date: Tue May 8 18:25:10 2012
New Revision: 1335678
URL: http://svn.apache.org/viewvc?rev=1335678&view=rev
Log:
VCL-576
Finalizing for 2.3 release
serverprofiles.php:
-modified manageGroupingHTML - added code to keep from showing content for
managing server profile group memberships if user does not have access to any
server profile groups
-modified jsonProfileGroupingProfiles - if user does not have access to
$groupid, still populate the 'all' part of the array, but send empty array for
inprofiles and outprofiles
serverprofiles.js:
-modified getProfiles - only work with groupname if profileGroups widget has
options
-modified getProfilesCB - only hide deployprofileslist if it is empty; only
unhide manage grouping if there are profile groups available
-modified addRemGroupCB - added code to call getGroups if one of the
added/removed groups is the selected group on the By Group tab
-modified addRemProfileCB - added code to call getProfiles if one of the
added/removed profiles is the selected profile on the By Server Profile tab
themes/default/page.php: modified getHeader - fixed code to show placeholder
for menu area on selectauth and login pages
themes/default/css/vcl.css: added .themelayouttable td.thememenunoauth
Modified:
incubator/vcl/trunk/web/.ht-inc/serverprofiles.php
incubator/vcl/trunk/web/js/serverprofiles.js
incubator/vcl/trunk/web/themes/default/css/vcl.css
incubator/vcl/trunk/web/themes/default/page.php
Modified: incubator/vcl/trunk/web/.ht-inc/serverprofiles.php
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/serverprofiles.php?rev=1335678&r1=1335677&r2=1335678&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/serverprofiles.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/serverprofiles.php Tue May 8 18:25:10 2012
@@ -456,6 +456,8 @@ function manageGroupingHTML() {
global $mode;
$resources = getUserResources(array("serverProfileAdmin"),
array("manageGroup"));
+ $resourcegroups = getUserResources(array("serverProfileAdmin"),
+ array("manageGroup"), 1);
$h = '';
if($mode == 'submitServerProfileGroups')
$gridSelected = "selected=\"true\"";
@@ -464,13 +466,13 @@ function manageGroupingHTML() {
$h .= "<H2>Server Profile Grouping</H2>\n";
$h .= "<span id=\"noprofilegroupsspan\"";
- if(count($resources["serverprofile"]))
+ if(count($resources["serverprofile"]) &&
count($resourcegroups['serverprofile']))
$h .= " class=\"hidden\"";
$h .= ">\n";
$h .= "You don't have access to modify any server profile
groups.<br>\n";
$h .= "</span>\n";
$h .= "<span id=\"groupprofilesspan\"";
- if(! count($resources["serverprofile"]))
+ if(! count($resources["serverprofile"]) || !
count($resourcegroups['serverprofile']))
$h .= " class=\"hidden\"";
$h .= ">\n";
$h .= "<div id=\"groupTabContainer\"
dojoType=\"dijit.layout.TabContainer\"\n";
@@ -1410,11 +1412,9 @@ function jsonProfileGroupingGroups() {
function jsonProfileGroupingProfiles() {
$groupid = processInputVar('groupid', ARG_NUMERIC);
$groups = getUserResources(array("serverProfileAdmin"),
array("manageGroup"), 1);
- if(! array_key_exists($groupid, $groups['serverprofile'])) {
- $arr = array('inprofiles' => array(), 'outprofiles' => array(),
'all' => array());
- sendJSON($arr);
- return;
- }
+ $emptyinout = 0;
+ if(! array_key_exists($groupid, $groups['serverprofile']))
+ $emptyinout = 1;
$resources = getUserResources(array('serverProfileAdmin'),
array('manageGroup'));
uasort($resources['serverprofile'], 'sortKeepIndex');
@@ -1423,7 +1423,9 @@ function jsonProfileGroupingProfiles() {
$in = array();
$out = array();
foreach($resources['serverprofile'] as $id => $profile) {
- if(array_key_exists($id, $memberships['serverprofile']) &&
+ if($emptyinout)
+ $all[] = array('inout' => 0, 'id' => $id, 'name' =>
$profile);
+ elseif(array_key_exists($id, $memberships['serverprofile']) &&
in_array($groupid, $memberships['serverprofile'][$id]))
{
$all[] = array('inout' => 1, 'id' => $id, 'name' =>
$profile);
$in[] = array('name' => $profile, 'id' => $id);
Modified: incubator/vcl/trunk/web/js/serverprofiles.js
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/js/serverprofiles.js?rev=1335678&r1=1335677&r2=1335678&view=diff
==============================================================================
--- incubator/vcl/trunk/web/js/serverprofiles.js (original)
+++ incubator/vcl/trunk/web/js/serverprofiles.js Tue May 8 18:25:10 2012
@@ -353,10 +353,11 @@ function getProfiles() {
var obj = dijit.byId('profileGroups');
if(! obj)
return;
- var groupname =
obj.getOptions(dijit.byId('profileGroups').get('value')).label;
-
- dojo.byId('ingroupname').innerHTML = groupname;
- dojo.byId('outgroupname').innerHTML = groupname;
+ if(obj.options.length) {
+ var groupname =
obj.getOptions(dijit.byId('profileGroups').get('value')).label;
+ dojo.byId('ingroupname').innerHTML = groupname;
+ dojo.byId('outgroupname').innerHTML = groupname;
+ }
var data = {continuation: dojo.byId('profilecont').value,
groupid: dijit.byId('profileGroups').get('value')};
@@ -376,15 +377,18 @@ function getProfilesCB(data, ioArgs) {
allprofiles = data.items.all;
if(allprofiles.length == 0) {
dojo.addClass('profileslist', 'hidden');
- dojo.addClass('deployprofileslist', 'hidden');
+ if(! dijit.byId('deployprofileid').options.length)
+ dojo.addClass('deployprofileslist', 'hidden');
dojo.addClass('groupprofilesspan', 'hidden');
dojo.removeClass('noprofilegroupsspan', 'hidden');
}
else {
dojo.removeClass('profileslist', 'hidden');
dojo.removeClass('deployprofileslist', 'hidden');
- dojo.removeClass('groupprofilesspan', 'hidden');
- dojo.addClass('noprofilegroupsspan', 'hidden');
+ if(dijit.byId('profileGroups').options.length) {
+ dojo.removeClass('groupprofilesspan', 'hidden');
+ dojo.addClass('noprofilegroupsspan', 'hidden');
+ }
}
dojo.removeClass('profilesdiv', 'hidden');
document.body.style.cursor = 'default';
@@ -418,6 +422,8 @@ function addRemGroupCB(data, ioArgs) {
we find the previous item in the select.options array
we insert a new option right after that one
*/
+ var byprofileselid = dijit.byId('profiles').get('value');
+ var reloadbyprofile = 0;
var profiles = data.items.profiles;
var addrem = data.items.addrem; // 1 for add, 0 for rem
if(addrem == 0 && data.items.removedaccess == 1) {
@@ -442,6 +448,8 @@ function addRemGroupCB(data, ioArgs) {
else
var obj = document.getElementById('outprofiles');
for(var i = 0; i < profiles.length; i++) {
+ if(profiles[i] == byprofileselid )
+ reloadbyprofile = 1;
var lastid = -1;
for(var j = 0; j < allprofiles.length; j++) {
if(allprofiles[j].id == profiles[i]) {
@@ -485,9 +493,13 @@ function addRemGroupCB(data, ioArgs) {
}
}
document.body.style.cursor = 'default';
+ if(reloadbyprofile)
+ getGroups();
}
function addRemProfileCB(data, ioArgs) {
+ var bygroupselid = dijit.byId('profileGroups').get('value');
+ var reloadbygroup = 0;
var groups = data.items.groups;
var addrem = data.items.addrem; // 1 for add, 0 for rem
if(addrem)
@@ -495,6 +507,8 @@ function addRemProfileCB(data, ioArgs) {
else
var obj = dojo.byId('outgroups');
for(var i = 0; i < groups.length; i++) {
+ if(groups[i] == bygroupselid )
+ reloadbygroup = 1;
var lastid = -1;
for(var j = 0; j < allgroups.length; j++) {
if(allgroups[j].id == groups[i]) {
@@ -551,6 +565,8 @@ function addRemProfileCB(data, ioArgs) {
});
}
document.body.style.cursor = 'default';
+ if(reloadbygroup)
+ getProfiles();
}
function setStartNow() {
Modified: incubator/vcl/trunk/web/themes/default/css/vcl.css
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/themes/default/css/vcl.css?rev=1335678&r1=1335677&r2=1335678&view=diff
==============================================================================
--- incubator/vcl/trunk/web/themes/default/css/vcl.css (original)
+++ incubator/vcl/trunk/web/themes/default/css/vcl.css Tue May 8 18:25:10 2012
@@ -141,6 +141,12 @@ form {
padding: 0 1px 0 0;
}
+.themelayouttable td.thememenunoauth {
+ background: url(../images/menu_bg.jpg) repeat-y;
+ border-spacing: 0;
+ padding: 0 0 0 160px;
+}
+
.themelayouttable td.themecontent {
width: 100%;
text-align: left;
Modified: incubator/vcl/trunk/web/themes/default/page.php
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/web/themes/default/page.php?rev=1335678&r1=1335677&r2=1335678&view=diff
==============================================================================
--- incubator/vcl/trunk/web/themes/default/page.php (original)
+++ incubator/vcl/trunk/web/themes/default/page.php Tue May 8 18:25:10 2012
@@ -85,17 +85,18 @@ function getHeader($refresh) {
$rt .= " <table class=\"themelayouttable\" summary=\"\">\n";
$rt .= " <TR valign=top>\n";
- $rt .= " <TD class=\"thememenu\">\n";
+ if($authed)
+ $rt .= " <TD class=\"thememenu\">\n";
+ else
+ $rt .= " <TD class=\"thememenunoauth\">\n";
$rt .= "<div id=menulist>\n";
$rt .= "<h3 class=hidden>Resources</h3>\n";
- $rt .= "<ul>\n";
- if($authed)
+ if($authed) {
+ $rt .= "<ul>\n";
$rt .= getNavMenu(1, 1);
- /*else
- $rt .= "<img src=\"themes/default/images/belltower.jpg\"
height=200 width=160 alt=\"\">\n";*/
- $rt .= "</ul>\n";
- if($authed)
- $rt .= "<img
src=\"themes/default/images/menu_dividerblock.jpg\" border=0 width=158
height=83 alt=\"\"><br/>\n";
+ $rt .= "</ul>\n";
+ $rt .= "<img
src=\"themes/default/images/menu_dividerblock.jpg\" border=0 width=\"158px\"
height=\"83px\" alt=\"\"><br/>\n";
+ }
$rt .= "</div>\n";
$rt .= " </TD>\n";
$rt .= " <TD class=\"themecontent\">\n";