Project

General

Profile

« Previous | Next » 

Revision 3596

Added by walbridge about 17 years ago

Updated the NCEAS skin for various fixes: Rewrote the login XSLT to work correctly. Added a login status button to the page headers. Modified the header image to disable the global site search used on the NCEAS homepage. Removed former IFRAME cruft.

View differences:

lib/style/skins/nceas/header.html
1
  <!--
2
    '$RCSfile$'
3
    Copyright: 2003 Regents of the University of California and the
4
               National Center for Ecological Analysis and Synthesis
5
     '$Author$'
6
       '$Date$'
7
   '$Revision$'
8

  
9
   This program is free software; you can redistribute it and/or modify
10
   it under the terms of the GNU General Public License as published by
11
   the Free Software Foundation; either version 2 of the License, or
12
   (at your option) any later version.
13

  
14
   This program is distributed in the hope that it will be useful,
15
   but WITHOUT ANY WARRANTY; without even the implied warranty of
16
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
   GNU General Public License for more details.
18
     
19
   You should have received a copy of the GNU General Public License
20
   along with this program; if not, write to the Free Software
21
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22
  -->
23
<!--____________________________max_width____________________________________-->
24

  
25
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
26
<html>
27
<head>
28
  <title>NCEAS Data Repository</title>
29
  <link rel="stylesheet" type="text/css" 
30
        href="@systemidserver@@style-skins-path@/nceas/nceas.css"></link>
31
  <script type="text/javascript"
32
          href="@systemidserver@@style-skins-path@/nceas/search.js"></script>
33
</head>
34

  
35
<body>
36
<table width="760" border="0" cellspacing="0" cellpadding="0">
37
  <tr> 
38
    <td rowspan="3" width="20%" valign="top">
39
      <div align="left"><img src="@systemidserver@@style-skins-path@/nceas/nceas-logo.png"></div>
40
    </td>
41
    <td valign="middle" colspan="4" class="title">NCEAS Data Repository</td>
42
  </tr>
43
  <tr> 
44
    <td class="spacerrow" valign="top" colspan="4">&nbsp;</td>
45
  </tr>
46
  <tr> 
47
    <td valign="top" width="20%"> 
48
      <p><a href="http://www.nceas.ucsb.edu" target=_top"> NCEAS Home</a></p>
49
    </td>
50
    <td valign="top" width="20%"> 
51
      <p><a href="http://data.nceas.ucsb.edu" target="_top">Repository Home</a></p>
52
    </td>
53
    <td valign="top" width="20%"> 
54
      <p><a href="@cgi-prefix@/register-dataset.cgi?cfg=nceas" target="_top">Register a <br>New Data Set</a></p>
55
    </td>
56
    <td valign="top" width="20%"> 
57
      <!--
58
      <p>
59
        <a href="@servlet-path@?action=query&operator=INTERSECT&anyfield=%25&organizationName=National%20Center%20for%20Ecological%20Analysis%20and%20Synthesis&qformat=nceas&returndoctype=eml://ecoinformatics.org/eml-2.0.0&returndoctype=eml://ecoinformatics.org/eml-2.0.1&returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN&returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN&returnfield=dataset/title&returnfield=keyword&returnfield=originator/individualName/surName&returnfield=creator/individualName/surName&returnfield=originator/organizationName&returnfield=creator/organizationName" target="_top">Search for Data</a></p>
60
      -->
61
<p class="searchbox">
62
Search for Data<br />
63
<form method="POST" action="@servlet-path@" target="_top" onSubmit="return checkSearch(this)">
64
  <input value="INTERSECT" name="operator" type="hidden">
65
  <input size="14" name="searchstring" type="text" value="">
66
  <input name="query" type="hidden"/>
67
  <input name="qformat" value="nceas" type="hidden">
68
  <input name="enableediting" value="true" type="hidden">
69
  <input type="hidden" name="action" value="squery">
70
  <!-- <input value="Start Search" type="submit"> -->
71
</form>
72
</p>
73
    </td>
74
  </tr>
75
</table>
76
</body>
77
</html>
78 0

  
lib/style/skins/nceas/nceas-login.xsl
42 42
                src="@style-skins-path@/nceas/nceas.js" />
43 43
        <script language="Javascript" type="text/JavaScript"
44 44
                src="@style-common-path@/branding.js" />
45
         <script language="JavaScript">
46
         <![CDATA[
47
            function search(){
48
                location.href = "@cgi-prefix@/register-dataset.cgi?cfg=nceas";
49
            }]]>
50
         </script>
45 51
      </head>
52
      <body onload="timerId=setTimeout('search()',2000)">
53
      <div id="main_wrapper">
46 54

  
47
      <script language="JavaScript">
48
          insertTemplateOpening();
49
          insertSearchBox();
50
      </script>
55
      <div id="header">
56
          <p>Skip to <a href="#navigation">navigation</a>, <a href="#main_content">main
57
          content</a>, <a href="#secondary_content">secondary content</a> or to <a
58
          href="#search">search</a>.</p> <h1><span></span><a href="/">NCEAS</a></h1>
59
      </div>
60
      <div id="navigation">
61
          <p></p>
62
          <ul id="main_nav">
63
              <ul class="menu">
64
                  <li class="collapsed"><a href="http://www.nceas.ucsb.edu">Home</a></li>
65
                  <li class="collapsed"><a href="http://data.nceas.ucsb.edu">Repository</a></li>
66
                  <li class="collapsed"><a href="@cgi-prefix@/register-dataset.cgi?cfg=nceas">Register</a></li>
67
            </ul>
68
        </ul>
69
    </div> <!-- navigation -->
70

  
71
    <div id="content_wrapper">
72
        <h1>NCEAS Data Repository</h1>
73

  
51 74
      <xsl:if test="count(login) &gt; 0">
52
      <xsl:choose>
53
      <xsl:when test="count(login/isModerator) &gt; 0">
54
           <script language="JavaScript">
55
	   <![CDATA[function search(){
56
		var searchForm = document.getElementById("search-form");
57
		var queryInput = document.createElement("input");
58
        	queryInput.setAttribute("type", "hidden");
59
        	queryInput.setAttribute("name", "query");
60
        	queryInput.setAttribute("value", "<pathquery version=\"1.2\"><querytitle>Moderator-Search</querytitle><returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype><returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype><returndoctype>-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN</returndoctype><returndoctype>-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN</returndoctype><returndoctype>-//NCEAS//resource//EN</returndoctype><returndoctype>-//NCEAS//eml-dataset//EN</returndoctype><returnfield>originator/individualName/surName</returnfield><returnfield>originator/individualName/givenName</returnfield><returnfield>creator/individualName/surName</returnfield><returnfield>creator/individualName/givenName</returnfield><returnfield>originator/organizationName</returnfield><returnfield>creator/organizationName</returnfield><returnfield>dataset/title</returnfield><returnfield>keyword</returnfield><querygroup operator=\"INTERSECT\"><queryterm searchmode=\"not-contains\" casesensitive=\"false\"><value>public</value><pathexpr>dataset/access/allow/principal</pathexpr></queryterm><queryterm searchmode=\"not-contains\" casesensitive=\"false\"><value>Revision Requested</value><pathexpr>additionalMetadata/moderatorComment</pathexpr></queryterm></querygroup></pathquery>");
61
		searchForm.appendChild(queryInput);	
62
		searchForm.submit();
63
	}]]>
64
        </script>
65
      	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="timerID=setTimeout('search()',20)">
66
          <p class="text_plain">Welcome <xsl:value-of select="login/name"/>. You are now logged in as moderator.</p>
67
	  <form id="search-form" action="@servlet-path@" method="post">
68
		<input type="hidden" name="action" value="squery"/>
69
		<input type="hidden" name="qformat" value="nceas"/>
70
		<input type="hidden" name="enableediting" value="true"/>
71
		<input type="hidden" name="message" value="You are now logged in as moderator."/>
72
	</form>
73
    	</body>
74
      </xsl:when>
75
      <xsl:otherwise>
76
 <script language="JavaScript">
77
           <![CDATA[
78
		function search(){
79
		location.href = "@cgi-prefix@/register-dataset.cgi?cfg=nceas";
80
        }]]>
81
        </script>
82
        <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="timerID=setTimeout('search()',2000)">
83
          <p class="text_plain">Welcome <xsl:value-of select="login/name"/>. You will be automatically redirected to the data repoistory form.</p>
84
        </body>
85

  
86
      </xsl:otherwise>
87
      </xsl:choose>
75
          <p class="text_plain">
76
            Welcome <xsl:value-of select="login/name"/>. You will be automatically redirected to the data repoistory form.
77
          </p>
88 78
      </xsl:if>
89 79
      <xsl:if test="count(unauth_login) &gt; 0">
90
      	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
91
          <p class="text_plain"><xsl:value-of select="unauth_login/message" /></p>
92
    	</body>
80
          <p class="text_plain">
81
            <xsl:value-of select="unauth_login/message" />
82
          </p>
93 83
      </xsl:if>
94
      <p class="text_plain">Return to the <a href="@systemidserver@@style-skins-path@/nceas/" target="_top">Registry home</a>.
95
      </p>
96
      <script language="JavaScript">
97
          insertTemplateClosing();
98
      </script>
84
          <p class="text_plain">
85
            Return to the <a href="@systemidserver@@style-skins-path@/nceas/">Registry home</a>.
86
          </p>
87
        </div>
88
        </div>
89
      </body>
99 90
    </html>
100 91
    </xsl:template>
101 92

  
lib/style/skins/nceas/nceas.js
32 32
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
33 33

  
34 34
 
35
//  These settings allow you to include and display common content (eg a common 
36
//  header) on all your pages, in much the same way as a frameset allows you to 
37
//  do, but through the use of iframes and a table instead. You can include up 
38
//  to 4 external pages, each one within the header, footer, left or right areas
39
//
40
//  looks like this (if you're using a fixed width font to display these notes):
41
//    ___________________
42
//    |     header      |
43
//    |-----------------|
44
//    | |             | |
45
//    | |             | |
46
//    |L|   content   |R|
47
//    | |             | |
48
//    | |             | |
49
//    |-----------------|
50
//    |     footer      | 
51
//    -------------------
52
//
53
//  Each area may display another page on the local site, or a page on a 
54
//  different server, or may be set to display nothing (in which case an iframe 
55
//  will not be drawn, although the containing table cell will still need to be 
56
//  resized using the css style - see below) 
57
//
58
//  NOTES:
59
//
60
//  1) if you have any links in the included documents, the target attribute for 
61
//     these *MUST* be set to _top, otherwise the new document will be displayed 
62
//     inside the small iframe areas, instead of replacing the entire page!
63
//     - example: <a href="index.html" target="_top">HOME</a>
64
//   
65
//  2) you will need to set the correct iframe size, in order to accomodate 
66
//     each of these areas on the page. The default location for these size 
67
//     settings is in the default.css file - see the "IFRAME_XXXXXX_CLASS" 
68
//     variables (below) for the name of the style to edit
69
//
70
//  3) you will also need to set the correct table cell sizes and/or overall 
71
//     table size for similar reasons. The default location for these size 
72
//     settings is in the default.css file - see the "TEMPLATE_XXXXXX_CLASS" 
73
//     variables (below) for the name of the style to edit
35
/* loginStatus: Uses XHR request to check for current session login status */
36
function loginStatus(){
37
    var httpRequest = false;
38
    try {
39
          httpRequest = new XMLHttpRequest();
40
    } catch (trymicrosoft) {
41
        try {
42
            httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
43
        } catch (othermicrosoft) {
44
            try {
45
                httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
46
            } catch (failed) {
47
                request = null;
48
            }
49
        }
50
    }
74 51

  
52
    if (!httpRequest){
53
        alert("no httpRequest object");
54
        return false;
55
    }
75 56

  
57
    httpRequest.onreadystatechange = function() {
58
        if(httpRequest.readyState == 4) {
59
            if (httpRequest.status == 200) {
60
                var response = httpRequest.responseText;
61
                var login_block = document.getElementById('login_block');
76 62

  
77
////////////////////////////////////////////////////////////////////////////////
78
//  Edit these variables to define the content that will be loaded into the 
79
//  various iframes. Each may be a relative path to another page on the local 
80
//  site, or a full URL to a page on a remote server, or may be set to the empty 
81
//  string if no content is required at that position on the page (and in which  
82
//  case an iframe will not be drawn, although an empty table cell will still  
83
//  exist unless it is resized smaller) . 
84
//  ( e.g. if you do not want a header to be included, set: HEADER_URL="";)
85
////////////////////////////////////////////////////////////////////////////////
63
                if (response.indexOf("public") > 0) {
64
                    login_block.innerHTML = '<a href="@cgi-prefix@/register-dataset.cgi?cfg=nceas&' +
65
                                            'stage=loginform">Login</a>';
66
                }
67
                else
68
                {
69
                    login_block.innerHTML = '<a href="@cgi-prefix@/register-dataset.cgi?cfg=nceas&' +
70
                                            'stage=logout">Logout</a>';
71
                }
72
            }
73
        }
74
    }
86 75

  
87

  
88
//  Location of the header that will be displayed at the top of the page
89
var HEADER_URL 
90
  = "@systemidserver@/@context@@style-skins-relpath@/nceas/header.html";
91

  
92
// Location of the search box that will be displayed above the  
93
//  results on the results page (optional)
94
var SEARCHBOX_URL 
95
  = "";
96
  //= "@systemidserver@/@context@@style-skins-relpath@/obfs/searchform.html";
97

  
98
//  Location of the header that will be displayed at the top of the page
99
var LEFTCOL_URL 
100
  = "";
101
  
102
//  Location of the header that will be displayed at the top of the page
103
var RIGHTCOL_URL 
104
  = "";
105
  
106
//  Location of the header that will be displayed at the top of the page
107
var FOOTER_URL 
108
  = "";
109
  
110

  
111

  
112

  
113
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
114
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
115
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
116
/* * * * * * * * *  MAY CHANGE THE FOLLOWING, BUT SHOULDN'T NEED TO* * * * * */ 
117
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
118
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
119
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
120

  
121
  
122
////////////////////////////////////////////////////////////////////////////////
123
//  Edit the default.css file to set the correct iframe sizes to accomodate the 
124
//  header, footer, left and right areas.
125
//  The following variables set the names of the styles that will be applied to 
126
//  each of the iframes - they can be anythign you wish, provided you use the 
127
//  same names for your classes in the css file
128
//  NOTE: these styles apply only to each container frame, *NOT* to the document 
129
//  within it!
130
////////////////////////////////////////////////////////////////////////////////
131

  
132
//header iframe class
133
var IFRAME_HEADER_CLASS         = "iframeheaderclass";
134

  
135
//(metacat only) search box iframe class
136
var IFRAME_SEARCHBOX_CLASS      = "iframesearchboxclass";
137

  
138
//left column iframe class
139
var IFRAME_LEFTCOL_CLASS        = "iframeleftcolclass";
140

  
141
//right column iframe class
142
var IFRAME_RIGHTCOL_CLASS       = "iframerightcolclass";
143

  
144
//footer iframe class
145
var IFRAME_FOOTER_CLASS         = "iframefooterclass";
146

  
147

  
148
////////////////////////////////////////////////////////////////////////////////
149
//  Edit the default.css file to set the correct table sizes to accomodate the 
150
//  header, footer, left and right iframes.
151
//  The following variables set the names of the styles that will be applied to 
152
//  each of the table cells (or the table itself - see below) - they can be 
153
//  anything you wish, provided you use the same names for your classes in the 
154
//  css file
155
//  NOTE: these styles apply only to each table cell, *NOT* to the document 
156
//  inside the iframe that is nested within it! (the exception is 
157
//  TEMPLATE_CONTENTAREA_CLASS, since the content probably isn't within an 
158
//  iframe - so style elements in this class will apply to the content istelf)
159
////////////////////////////////////////////////////////////////////////////////
160

  
161
//entire table class
162
var TEMPLATE_TABLE_CLASS        = "templatetableclass";
163

  
164
//header table-cell class. Note you should not set css "width" on this, since it 
165
//includes a colspan
166
var TEMPLATE_HEADERROW_CLASS    = "templateheaderrowclass";
167

  
168
//left column table-cell class. Note that restricting css "height" on this may 
169
//affect visibility of the main content, since it's in the same table row 
170
var TEMPLATE_LEFTCOL_CLASS      = "templateleftcolclass";
171

  
172
//main central content table-cell class. Note that css attributes set here may 
173
//apply to the content nested inside this cell
174
var TEMPLATE_CONTENTAREA_CLASS  = "templatecontentareaclass";
175

  
176
//rigth column table-cell class. Note that restricting css "height" on this may 
177
//affect visibility of the main content, since it's in the same table row 
178
var TEMPLATE_RIGHTCOL_CLASS     = "templaterightcolclass";
179

  
180
//footer table-cell class. Note you should not set "width" on this, since it 
181
//includes a colspan
182
var TEMPLATE_FOOTERROW_CLASS    = "templatefooterrowclass";
183

  
184

  
76
    httpRequest.open("GET", "@servlet-path@?action=getloggedinuserinfo", true);
77
    httpRequest.send(null);
78
}
lib/style/skins/nceas/index.html
41 41
          src="@systemidserver@@style-skins-path@/nceas/search.js"></script>
42 42

  
43 43
</head>
44
<body id="Overview">
44
<body id="Overview" onload="loginStatus();">
45 45
    <div id="main_wrapper">
46 46

  
47 47
    <div id="header">
......
56 56
                <li class="collapsed"><a href="http://www.nceas.ucsb.edu">Home</a></li>
57 57
                <li class="collapsed"><a href="http://data.nceas.ucsb.edu">Repository</a></li>
58 58
                <li class="collapsed"><a href="@cgi-prefix@/register-dataset.cgi?cfg=nceas">Register</a></li>
59
                <li class="collapsed"><span id="login_block"></span></li>
59 60
            </ul>
60 61
        </ul>
61 62
    </div> <!-- navigation --> 
lib/style/skins/nceas/nceas.xsl
44 44
		
45 45
			<xsl:call-template name="documenthead"/>
46 46
			
47
			<body id="Overview">
47
			<body id="Overview" onload="loginStatus();">
48 48
				<div id="main_wrapper">
49 49
					
50 50
				    <xsl:call-template name="bodyheader"/>
......
131 131
						<a href="@cgi-prefix@/register-dataset.cgi?cfg=nceas">
132 132
						   Register</a>
133 133
					</li>
134
          <li class="collapsed">
135
            <span id="login_block"></span>
136
          </li>
134 137
				</ul>
135 138
			</ul>
136 139
		</div><!-- navigation -->

Also available in: Unified diff