|
From: creedon <icr...@us...> - 2005-09-08 06:00:53
|
Update of /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/macros In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26129 Modified Files: diskInfo listSites Log Message: changed userlandIcons to frontierIcons changed /mainResponderResources/ to /resources/ Index: listSites =================================================================== RCS file: /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/macros/listSites,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** listSites 26 Mar 2005 21:45:11 -0000 1.1.1.1 --- listSites 8 Sep 2005 06:00:45 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:mainResponder.adminSite.macros.listSites ! on listSites () { ÇChanges Ç3/29/04; 5:57:32 PM by JES ÇAdd a new icon to indicate whether hosting is enabled for a given site. Ç12/12/03; 11:50:10 PM by JES ÇIf the last-modified time can't be converted to a date type, just return it as a string. Ç9/8/02; 4:55:26 PM by JES ÇUse the local globe icon instead of the one hosted at UserLand. Ç9/3/02; 4:33:36 AM by JES ÇAdded a small padlock icon next to the name of editors only sites. Ç8/20/02; 4:16:45 PM by JES ÇAdded links to multiple pages for servers that have more than 25 sites. local (pta); try {pta = html.getPageTableAddress ()}; local (bgcolor1, bgcolor2, ctitems=0, thisPageUrl=""); try {bgcolor1 = pta^.trbg1; bgcolor2 = pta^.trbg2; tisPageUrl = pta^.uri}; local (start = 1, count = 25); bundle { //get start and count from pta^.searchArgTable, if present if defined (pta^.searchArgTable.s) { try {start = number (pta^.searchArgTable.s)}}; if defined (pta^.searchArgTable.m) { try {count = number (pta^.searchArgTable.m)}}}; local (globeicon, lockicon, hostingicon); bundle { //set globeicon, lockicon and hostingicon globeicon = "<img src=\"mainResponderResources/userlandIcons/remote\" width=\"11\" height=\"11\" border=\"0\" style=\"position:relative; top:1\">"; lockicon = "<img src=\"/mainResponderResources/icons/lock\" width=\"9\" height=\"12\" border=\"0\" style=\"position:relative; top:1\">"; hostingicon = "<img src=\"/mainResponderResources/icons/folderGlobe\" width=\"18\" height=\"16\" border=\"0\" style=\"position:relative; top:4\">"}; local (htmlText = "", indentlevel = 0); on add (s) { htmlText = htmlText + (string.filledString ("\t", indentlevel) + s + "\r");}; local (flFoundSites = false); local (adrcache = mainResponder.adminSite.macros.initSiteListCache ()); local (adrincache = @adrcache^.sites); if sizeOf (adrincache) > 0 { flFoundSites = true}; bundle { //description add ("<p>Below is a list of Manila sites on this server. For more detailed information and managerial functions, click a site's name. To view a site, click the globe icon. You can also <a href=\"" + mainResponder.adminSite.urls.newSite + "\">create a new site</a>.</p>")}; bundle { //build the table that gets rendered as HTML if flFoundSites { local (yesterday = date.yesterday (clock.now ())); on shortDateTime (d) { try { if d < yesterday { return (date.shortString (d))} else { return (string.timeString (d))}} else { return (d)}}; bundle { //start the table add ("<table cellpadding=\"10\" cellspacing=\"0\" boreder=\"0\" width=\"99%\">"); indentlevel++}; ÇLoop through the table of info about the sites on this server. local (numSites = sizeOf (adrincache^)); for i = start to (start + count - 1) { if i > numSites { break}; local (bgcolor); if i % 2 == 1 { bgcolor = bgcolor1} else { bgcolor = bgcolor2}; local (adrItem = @adrincache^[i]); local (editor = adrItem^.managingEditor); local (tagline = string.replaceAll (adrItem^.tagline, "\"", """)); local (editUrl = thisPageUrl + "?site=" + string.urlEncode (adrItem^.site)); local (editLink = "<a href=\"" + editUrl + "\" title=\"" + tagline + "\">" + adrItem^.displaySiteName + "</a>"); bundle { //add lock icon for editors only sites if defined (adrItem^.adrSite^.["#newsSite"].flEditorsOnlyAccessToSite) { if adrItem^.adrSite^.["#newsSite"].flEditorsOnlyAccessToSite { editLink = editLink + " " + lockicon}}}; try { //hosting icon for hosting-enabled sites if defined (pta^.canonicalSiteName) { delete (@pta^.canonicalSiteName)}; if manilaSuite.hosting.isHostingSite (adrItem^.adrSite) { editLink = editLink + " " + hostingicon}}; local (siteLink, editorLink); bundle { //set siteLink, editorLink, tagline if adrItem^.flInstalled { siteLink = "<a href=\"" + adrItem^.siteUrl + "\" title=\"" + tagline + "\">" + globeIcon + "</a>"; editorLink = html.getLink (editor, adrItem^.profilesUrl + editor); try { //get the real name of the editor, if possible //PBS06/05/01: was a bundle, now a try, so errors aren't fatal local (groupName = adrItem^.membershipGroupName); local (adrInfo = mainResponder.members.getMemberTable (groupName, editor)); if (defined (adrInfo^.personalInfo.name)) and (adrInfo^.personalInfo.name != "") { editorLink = html.getLink (adrInfo^.personalInfo.name, adrItem^.profilesUrl + editor)}}} else { siteLink = ""; editorLink = string.replace (editor, "@", "\\@")}}; bundle { //add the info for this site add ("<tr bgcolor=\"" + bgcolor + "\">"); indentlevel++; add ("<td valign=\"bottom\" style=\"padding-bottom: 0px;\"><span style=\"width:11;\">" + siteLink + "</span> <b>" + editLink + "</b></td>"); add ("<td valign=\"bottom\" style=\"padding-bottom: 0px;\" class=\"small\" valign=\"bottom\"><nobr><b>" + shortDateTime (adrItem^.modified) + "</b></nobr></td>"); add ("<td valign=\"bottom\" style=\"padding-bottom: 0px;\" class=\"small\" style=\"padding-top: 0px;\" align=\"right\"><nobr><b>" + string.addCommas (adrItem^.totalHits) + "</b> hits; <b>" + adrItem^.hitsToday + "</b> today</nobr>" + "</td>"); add ("</tr>"); indentlevel--; add ("<tr bgcolor=\"" + bgcolor + "\">"); indentlevel++; add ("<td valign=\"bottom\" style=\"padding-top: 0px;\" class=\"small\">Owner: <b>" + editorLink + "</b></td>"); local (memberstring = "members"); if adrItem^.ctMembers == 1 { memberstring = "member"}; add ("<td class=\"small\" style=\"padding-top: 0px;\"><b>" + string.addCommas (adrItem^.ctMembers) + "</b> " + memberstring + "</td>"); add ("<td class=\"small\" style=\"padding-top: 0px;\" align=\"right\"><b>" + string.addCommas (adrItem^.ctMessages) + "</b> messages</td>"); add ("</tr>"); indentlevel--}}; add ("</table>"); indentlevel--}}; if not flFoundSites { add ("<hr size=\"0\" /><p>There are no sites to list at this time.</p>")}; if flFoundSites { //possibly add links to more pages local (ctsites = sizeOf (adrincache^)); if ctsites > count { add ("<b> More sites:</b>"); local (ctpages = 0); local (n = 1); while n <= ctsites { ctpages++; if n < start or n >= (start + count) { //link add ("<a href=\"" + pta^.uri + "?s=" + n + "&m=" + count + "\">" + ctpages + "</a>")} else { add ("<b>" + ctpages + "</b>")}; n = n + count}}}; return (htmlText)}; Çbundle //test code ÇlistSites () \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:mainResponder.adminSite.macros.listSites ! on listSites () { ÇChanges Ç9/7/05; 10:53:18 PM by TAC Çchanged userlandIcons to frontierIcons Çchanged /mainResponderResources/ to /resources/ Ç3/29/04; 5:57:32 PM by JES ÇAdd a new icon to indicate whether hosting is enabled for a given site. Ç12/12/03; 11:50:10 PM by JES ÇIf the last-modified time can't be converted to a date type, just return it as a string. Ç9/8/02; 4:55:26 PM by JES ÇUse the local globe icon instead of the one hosted at UserLand. Ç9/3/02; 4:33:36 AM by JES ÇAdded a small padlock icon next to the name of editors only sites. Ç8/20/02; 4:16:45 PM by JES ÇAdded links to multiple pages for servers that have more than 25 sites. local (pta); try {pta = html.getPageTableAddress ()}; local (bgcolor1, bgcolor2, ctitems=0, thisPageUrl=""); try {bgcolor1 = pta^.trbg1; bgcolor2 = pta^.trbg2; tisPageUrl = pta^.uri}; local (start = 1, count = 25); bundle { //get start and count from pta^.searchArgTable, if present if defined (pta^.searchArgTable.s) { try {start = number (pta^.searchArgTable.s)}}; if defined (pta^.searchArgTable.m) { try {count = number (pta^.searchArgTable.m)}}}; local (globeicon, lockicon, hostingicon); bundle { //set globeicon, lockicon and hostingicon globeicon = "<img src=\"mainResponderResources/frontierIcons/remote\" width=\"11\" height=\"11\" border=\"0\" style=\"position:relative; top:1\">"; lockicon = "<img src=\"/resources/icons/lock\" width=\"9\" height=\"12\" border=\"0\" style=\"position:relative; top:1\">"; hostingicon = "<img src=\"/resources/icons/folderGlobe\" width=\"18\" height=\"16\" border=\"0\" style=\"position:relative; top:4\">"}; local (htmlText = "", indentlevel = 0); on add (s) { htmlText = htmlText + (string.filledString ("\t", indentlevel) + s + "\r");}; local (flFoundSites = false); local (adrcache = mainResponder.adminSite.macros.initSiteListCache ()); local (adrincache = @adrcache^.sites); if sizeOf (adrincache) > 0 { flFoundSites = true}; bundle { //description add ("<p>Below is a list of Manila sites on this server. For more detailed information and managerial functions, click a site's name. To view a site, click the globe icon. You can also <a href=\"" + mainResponder.adminSite.urls.newSite + "\">create a new site</a>.</p>")}; bundle { //build the table that gets rendered as HTML if flFoundSites { local (yesterday = date.yesterday (clock.now ())); on shortDateTime (d) { try { if d < yesterday { return (date.shortString (d))} else { return (string.timeString (d))}} else { return (d)}}; bundle { //start the table add ("<table cellpadding=\"10\" cellspacing=\"0\" boreder=\"0\" width=\"99%\">"); indentlevel++}; ÇLoop through the table of info about the sites on this server. local (numSites = sizeOf (adrincache^)); for i = start to (start + count - 1) { if i > numSites { break}; local (bgcolor); if i % 2 == 1 { bgcolor = bgcolor1} else { bgcolor = bgcolor2}; local (adrItem = @adrincache^[i]); local (editor = adrItem^.managingEditor); local (tagline = string.replaceAll (adrItem^.tagline, "\"", """)); local (editUrl = thisPageUrl + "?site=" + string.urlEncode (adrItem^.site)); local (editLink = "<a href=\"" + editUrl + "\" title=\"" + tagline + "\">" + adrItem^.displaySiteName + "</a>"); bundle { //add lock icon for editors only sites if defined (adrItem^.adrSite^.["#newsSite"].flEditorsOnlyAccessToSite) { if adrItem^.adrSite^.["#newsSite"].flEditorsOnlyAccessToSite { editLink = editLink + " " + lockicon}}}; try { //hosting icon for hosting-enabled sites if defined (pta^.canonicalSiteName) { delete (@pta^.canonicalSiteName)}; if manilaSuite.hosting.isHostingSite (adrItem^.adrSite) { editLink = editLink + " " + hostingicon}}; local (siteLink, editorLink); bundle { //set siteLink, editorLink, tagline if adrItem^.flInstalled { siteLink = "<a href=\"" + adrItem^.siteUrl + "\" title=\"" + tagline + "\">" + globeIcon + "</a>"; editorLink = html.getLink (editor, adrItem^.profilesUrl + editor); try { //get the real name of the editor, if possible //PBS06/05/01: was a bundle, now a try, so errors aren't fatal local (groupName = adrItem^.membershipGroupName); local (adrInfo = mainResponder.members.getMemberTable (groupName, editor)); if (defined (adrInfo^.personalInfo.name)) and (adrInfo^.personalInfo.name != "") { editorLink = html.getLink (adrInfo^.personalInfo.name, adrItem^.profilesUrl + editor)}}} else { siteLink = ""; editorLink = string.replace (editor, "@", "\\@")}}; bundle { //add the info for this site add ("<tr bgcolor=\"" + bgcolor + "\">"); indentlevel++; add ("<td valign=\"bottom\" style=\"padding-bottom: 0px;\"><span style=\"width:11;\">" + siteLink + "</span> <b>" + editLink + "</b></td>"); add ("<td valign=\"bottom\" style=\"padding-bottom: 0px;\" class=\"small\" valign=\"bottom\"><nobr><b>" + shortDateTime (adrItem^.modified) + "</b></nobr></td>"); add ("<td valign=\"bottom\" style=\"padding-bottom: 0px;\" class=\"small\" style=\"padding-top: 0px;\" align=\"right\"><nobr><b>" + string.addCommas (adrItem^.totalHits) + "</b> hits; <b>" + adrItem^.hitsToday + "</b> today</nobr>" + "</td>"); add ("</tr>"); indentlevel--; add ("<tr bgcolor=\"" + bgcolor + "\">"); indentlevel++; add ("<td valign=\"bottom\" style=\"padding-top: 0px;\" class=\"small\">Owner: <b>" + editorLink + "</b></td>"); local (memberstring = "members"); if adrItem^.ctMembers == 1 { memberstring = "member"}; add ("<td class=\"small\" style=\"padding-top: 0px;\"><b>" + string.addCommas (adrItem^.ctMembers) + "</b> " + memberstring + "</td>"); add ("<td class=\"small\" style=\"padding-top: 0px;\" align=\"right\"><b>" + string.addCommas (adrItem^.ctMessages) + "</b> messages</td>"); add ("</tr>"); indentlevel--}}; add ("</table>"); indentlevel--}}; if not flFoundSites { add ("<hr size=\"0\" /><p>There are no sites to list at this time.</p>")}; if flFoundSites { //possibly add links to more pages local (ctsites = sizeOf (adrincache^)); if ctsites > count { add ("<b> More sites:</b>"); local (ctpages = 0); local (n = 1); while n <= ctsites { ctpages++; if n < start or n >= (start + count) { //link add ("<a href=\"" + pta^.uri + "?s=" + n + "&m=" + count + "\">" + ctpages + "</a>")} else { add ("<b>" + ctpages + "</b>")}; n = n + count}}}; return (htmlText)}; Çbundle //test code ÇlistSites () \ No newline at end of file Index: diskInfo =================================================================== RCS file: /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/adminSite/macros/diskInfo,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** diskInfo 26 Mar 2005 21:45:11 -0000 1.1.1.1 --- diskInfo 8 Sep 2005 06:00:45 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:mainResponder.adminSite.macros.diskInfo ! on diskInfo () { ÇChanges Ç8/14/02; 3:34:39 PM by JES ÇCreated. local (htmltext); on add (s) { htmltext = htmltext + (s + "\r");}; local (pta = html.getPageTableAddress ()); local (bgcolors = {pta^.trbg2, pta^.trbg1}); local (frontiericon, systemicon); bundle { //get icons if system.environment.isMac { systemicon = "<img src=\"/mainResponderResources/logos/macosIconSmall\" height=\"16\" width=\"16\" border=\"0\">"} else { systemicon = "<img src=\"/mainResponderResources/logos/windowsIconSmall\" height=\"16\" width=\"16\" border=\"0\">"}; frontiericon = "<img src=\"/mainResponderResources/userlandIcons/cactusIconSmall\" height=\"16\" width=\"16\" border=\"0\">"}; local (systemdisk, frontierdisk); bundle { //get system and frontier disks systemdisk = file.getSystemDisk (); frontierdisk = frontier.pathstring; local (pc = file.getPathChar ()); while string.popTrailing (frontierdisk, pc) contains pc { frontierdisk = file.folderFromPath (frontierdisk)}}; add ("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"70%\">"); bundle { //headers if system.environment.isMac { add ("<tr><td style=\"padding-left:5px;\"><b>Disk</b></td><td> </td><td align=\"right\"><b>Size</b></td><td align=\"right\" style=\"padding-right:10px;\"><b>Free</b></td><td align=\"right\" style=\"padding-right:10px;\"><b>Files</b></td></tr>")} else { add ("<tr><td style=\"padding-left:5px;\"><b>Disk</b></td><td> </td><td align=\"right\"><b>Size</b></td><td align=\"right\" style=\"padding-right:10px;\"><b>Free</b></td></tr>")}}; local (ct = 0); fileloop (f in "") { if not system.environment.isMac { //skip the A & B drives on Windows if string.lower (f) beginsWith "a:" { continue}; if string.lower (f) beginsWith "b:" { continue}}; try { local (sizedouble = file.volumeSizeDouble (f)); local (freedouble = file.freeSpaceOnVolumeDouble (f)); local (files); if system.environment.isMac { files = file.filesOnVolume (f)}; local (icon = ""); if f == systemdisk { icon = icon + " " + systemicon + " "}; if f == frontierdisk { icon = icon + " " + frontiericon + " "}; ct++; add ("<tr bgcolor=\"" + bgcolors[(ct%2) + 1] + "\">"); add ("<td class=\"small\" style=\"padding-left:5px;\">" + f + "</td>"); add ("<td class=\"small\" style=\"padding-top:5px;\"><nobr>" + icon + "</nobr></td>"); add ("<td class=\"small\" align=\"right\">" + string.gigabyteString (sizedouble) + "</td>"); add ("<td class=\"small\" align=\"right\" style=\"padding-right:10px;\">" + string.gigabyteString (freedouble) + "</td>"); if system.environment.isMac { //file.filesOnVolume only works on MacOS add ("<td class=\"small\" align=\"right\" style=\"padding-right:10px;\">" + string.addCommas (files) + "</td>")}; add ("</tr>")}}; add ("</table>"); return (htmltext)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:mainResponder.adminSite.macros.diskInfo ! on diskInfo () { ÇChanges Ç9/7/05; 10:53:18 PM by TAC Çchanged userlandIcons to frontierIcons Çchanged /mainResponderResources/ to /resources/ Ç8/14/02; 3:34:39 PM by JES ÇCreated. local (htmltext); on add (s) { htmltext = htmltext + (s + "\r");}; local (pta = html.getPageTableAddress ()); local (bgcolors = {pta^.trbg2, pta^.trbg1}); local (frontiericon, systemicon); bundle { //get icons if system.environment.isMac { systemicon = "<img src=\"/resources/logos/macosIconSmall\" height=\"16\" width=\"16\" border=\"0\">"} else { systemicon = "<img src=\"/resources/logos/windowsIconSmall\" height=\"16\" width=\"16\" border=\"0\">"}; frontiericon = "<img src=\"/resources/frontierIcons/cactusIconSmall\" height=\"16\" width=\"16\" border=\"0\">"}; local (systemdisk, frontierdisk); bundle { //get system and frontier disks systemdisk = file.getSystemDisk (); frontierdisk = frontier.pathstring; local (pc = file.getPathChar ()); while string.popTrailing (frontierdisk, pc) contains pc { frontierdisk = file.folderFromPath (frontierdisk)}}; add ("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"70%\">"); bundle { //headers if system.environment.isMac { add ("<tr><td style=\"padding-left:5px;\"><b>Disk</b></td><td> </td><td align=\"right\"><b>Size</b></td><td align=\"right\" style=\"padding-right:10px;\"><b>Free</b></td><td align=\"right\" style=\"padding-right:10px;\"><b>Files</b></td></tr>")} else { add ("<tr><td style=\"padding-left:5px;\"><b>Disk</b></td><td> </td><td align=\"right\"><b>Size</b></td><td align=\"right\" style=\"padding-right:10px;\"><b>Free</b></td></tr>")}}; local (ct = 0); fileloop (f in "") { if not system.environment.isMac { //skip the A & B drives on Windows if string.lower (f) beginsWith "a:" { continue}; if string.lower (f) beginsWith "b:" { continue}}; try { local (sizedouble = file.volumeSizeDouble (f)); local (freedouble = file.freeSpaceOnVolumeDouble (f)); local (files); if system.environment.isMac { files = file.filesOnVolume (f)}; local (icon = ""); if f == systemdisk { icon = icon + " " + systemicon + " "}; if f == frontierdisk { icon = icon + " " + frontiericon + " "}; ct++; add ("<tr bgcolor=\"" + bgcolors[(ct%2) + 1] + "\">"); add ("<td class=\"small\" style=\"padding-left:5px;\">" + f + "</td>"); add ("<td class=\"small\" style=\"padding-top:5px;\"><nobr>" + icon + "</nobr></td>"); add ("<td class=\"small\" align=\"right\">" + string.gigabyteString (sizedouble) + "</td>"); add ("<td class=\"small\" align=\"right\" style=\"padding-right:10px;\">" + string.gigabyteString (freedouble) + "</td>"); if system.environment.isMac { //file.filesOnVolume only works on MacOS add ("<td class=\"small\" align=\"right\" style=\"padding-right:10px;\">" + string.addCommas (files) + "</td>")}; add ("</tr>")}}; add ("</table>"); return (htmltext)} \ No newline at end of file |