[11117] | 1 | # this file must be UTF-8 encoded
|
---|
| 2 |
|
---|
| 3 | # This macro file contains the definitions required for making the
|
---|
| 4 | # navigation bar presentation controlled by the CSS file.
|
---|
| 5 |
|
---|
| 6 | #######################################################################
|
---|
| 7 | # GLOBAL MACROS
|
---|
| 8 | #######################################################################
|
---|
| 9 |
|
---|
| 10 | package Global
|
---|
| 11 |
|
---|
| 12 | #######################################################################
|
---|
| 13 | # global navigation links
|
---|
| 14 | #######################################################################
|
---|
| 15 |
|
---|
[27150] | 16 | _globallinks_ {_If_("_cgiargu_" ne "1",_homelink_) _helplink_ _preflink__optloginlink_ _optrsslink_}
|
---|
[23519] | 17 | _homelink_ {_navtaborig_(_httppagehome_,_linktextHOME_,_textdescrhome_)}
|
---|
| 18 | _helplink_ {_navtaborig_(_httppagehelp_,_linktextHELP_,_textdescrhelp_)}
|
---|
| 19 | _preflink_ {_navtaborig_(_httppagepref_,_linktextPREFERENCES_,_textdescrpref_)}
|
---|
[11117] | 20 |
|
---|
[23519] | 21 | _optloginlink_ {
|
---|
| 22 | _If_("_activateweb20_" >= "1",_If_("x_cgiargun__cgiarguan_" ne "x1",_loginlink_))
|
---|
| 23 | }
|
---|
[20316] | 24 |
|
---|
[23519] | 25 | _loginlink_ {
|
---|
| 26 |
|
---|
| 27 | _If_(_cgiargun_,
|
---|
| 28 | _navtablogoutorig_(_linktextLOGOUT_,_textdescrlogout_) _linktextLOGGEDIN_
|
---|
| 29 | <script type="text/javascript">
|
---|
| 30 | appendUsernameArgs("logout","uan=&un=")
|
---|
| 31 | </script>
|
---|
| 32 | ,
|
---|
| 33 | _navtabloginorig_(_linktextLOGIN_,_textdescrlogin_)
|
---|
| 34 | <script type="text/javascript">
|
---|
| 35 | appendUsernameArgs("login","uan=1")
|
---|
| 36 | </script>
|
---|
| 37 | )
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 |
|
---|
[27150] | 41 | # if a collection should have an rss link,
|
---|
| 42 | # set _optrsslink_ for that collection's global package to contain _rsslink_
|
---|
| 43 | _optrsslink_ {}
|
---|
| 44 |
|
---|
| 45 | # RSS link and default RSS icon for embedding in the link
|
---|
| 46 | # RSS icon from http://webneel.com/post/freedownload/web-design/icon-design/25-web-rss-icons
|
---|
| 47 | # e.g. rss link: http://localhost:8283/greenstone/cgi-bin/library.cgi?site=localhost&a=rss&c=demo&l=en&w=utf-8&hostname=localhost:8283
|
---|
| 48 | # And the javascript that's used for appending "&hostname=host:port" to the link to the RSS feed
|
---|
| 49 | # The script is activated on loading the rss icon <img>, since onLoad doesn't work on <a>
|
---|
| 50 | # The rsslink that embeds rssicon are two macros defined in base.dm
|
---|
| 51 | # To use this script, define pagescriptextra macro to contain the domainscript macro
|
---|
| 52 | # Can do so at collectionlevel in a collection's extra.dm (try to add it to package about)
|
---|
| 53 |
|
---|
| 54 | _rssicon_ {<img class="icon" src="_httpimages_/rssicon.png" alt="_collectionname_ RSS feed" title="_collectionname_ RSS feed" onLoad="addDomainToRSSAnchor(this)">}
|
---|
| 55 |
|
---|
| 56 | _rsslink_ {<a id="rss" href="_gwcgi_?site=localhost&a=rss&c=_cgiargc_&l=_cgiargl_&w=_cgiargw_">_rssicon_</a>
|
---|
| 57 | <script type="text/javascript">
|
---|
| 58 | function addDomainToRSSAnchor (imgtag)
|
---|
| 59 | \{
|
---|
| 60 | parent = imgtag.parentNode;
|
---|
| 61 | if (parent && parent.href)
|
---|
| 62 | \{
|
---|
| 63 | parent.href += "&hostname="+location.hostname;
|
---|
| 64 | if(location.port) \{
|
---|
| 65 | parent.href += ":"+location.port;
|
---|
| 66 | \}
|
---|
| 67 | \}
|
---|
| 68 | \}
|
---|
| 69 | </script>
|
---|
| 70 | }
|
---|
| 71 |
|
---|
| 72 |
|
---|
[11117] | 73 | # The following is useful if collection specific macro. Override
|
---|
| 74 | # _optnavigationbar_ to be empty if you don't want the navigation bar to
|
---|
| 75 | # appear in the standard place, and then specify _navigationbar_ elsewhere
|
---|
| 76 | # in a collection specific macro file(s) to be where you do want it.
|
---|
| 77 | _optnavigationbar_{
|
---|
| 78 | <div class="navbar">
|
---|
| 79 | <p class="navbar">
|
---|
| 80 | _navigationbar_
|
---|
| 81 | </p>
|
---|
| 82 | </div>
|
---|
| 83 | }
|
---|
| 84 |
|
---|
| 85 | _starthighlight_ {<span class="highlight">}
|
---|
| 86 | _endhighlight_ {</span>}
|
---|
| 87 |
|
---|
| 88 | # parameters are:
|
---|
| 89 | # 1. the url to go to when clicked
|
---|
| 90 | # 2. the name of the tab
|
---|
| 91 | # 3. alt/title explanatory text
|
---|
| 92 | # 4. optional "selected" or not if it is the current tab
|
---|
[12178] | 93 | _navtaborig_ {<a _If_("_4_" eq "selected",class="navlink_sel">_2_,class="navlink" href="_1_" title="_3_">_2_)</a>}
|
---|
[11117] | 94 |
|
---|
[23519] | 95 | # same sa above, but without _1_ as there is no hyperlink to go to (want to say on the same page)
|
---|
| 96 | _navtabloginorig_ {<a _If_("_3_" eq "selected",class="navlink_sel postit">_1_,class="navlink postit" id="login" href="" title="_2_">_1_)</a>}
|
---|
| 97 |
|
---|
| 98 | # same sa above, but without _1_ as there is no hyperlink to go to (want to say on the same page)
|
---|
| 99 | _navtablogoutorig_ {<a _If_("_3_" eq "selected",class="navlink_sel postit">_1_,class="navlink postit" id="logout" href="" title="_2_">_1_)</a>}
|
---|
| 100 |
|
---|
[12178] | 101 | # parameters are
|
---|
| 102 | # 1. The url to go to when clicked
|
---|
| 103 | # 2. The metadata name - this gets used to determine the title and alt text
|
---|
| 104 | # 3. optional "selected" if it is the current tab
|
---|
| 105 | _navtab_ {<a _If_("_3_" eq "selected",class="navlink_sel">_navlinktitle_(_2_),class="navlink" href="_1_" title="_navlinkalt_(_2_)">_navlinktitle_(_2_))</a>}
|
---|
[11117] | 106 |
|
---|
| 107 |
|
---|
| 108 | #######################################################################
|
---|
| 109 | # navigation bar images
|
---|
| 110 | #
|
---|
| 111 | #######################################################################
|
---|
| 112 |
|
---|
[16302] | 113 | # the spacer image - the width of this is calculated and set from server.
|
---|
| 114 | #
|
---|
| 115 | # Its height is now explicity set to 1 to avoid width x height "scaling
|
---|
| 116 | # problem". Given that spacer.gif's natural dimensions are 40x4 pixels,
|
---|
| 117 | # left uncontrolled, when the image is stretched through _widthtspace_ to
|
---|
| 118 | # a width of say 400 (as happens when there are only two items in the
|
---|
| 119 | # navigation bar) then its height becomes 40 pixels, making the navbar
|
---|
| 120 | # twice as high as the text in it, and quite ugly looking
|
---|
[11117] | 121 |
|
---|
[27785] | 122 | _navbarspacer_ {<img src="_httpimg_/spacer.gif" alt="" height="1" width="_widthtspace_" />}
|
---|
[16302] | 123 |
|
---|
[11117] | 124 | _navbarspacer_[v=1] {<br>
|
---|
| 125 | }
|
---|
| 126 |
|
---|
| 127 | # cgiargu means "static page", so no search link should be shown
|
---|
[12178] | 128 | _navtabsearch_ {_If_("_cgiargu_" ne "1",_navtab_(_httpquery_,Search,_1_))}
|
---|
[11117] | 129 |
|
---|
[12178] | 130 | package about
|
---|
[11156] | 131 |
|
---|
| 132 | _imagethispage_ {_titleabout_}
|
---|
| 133 |
|
---|
| 134 | package query
|
---|
[12178] | 135 |
|
---|
[11159] | 136 | _imagethispage_ {_labelSearch_}
|
---|
[11156] | 137 |
|
---|
| 138 |
|
---|
[11117] | 139 | package Style
|
---|
| 140 |
|
---|
| 141 | _imagescript_ {}
|
---|
| 142 |
|
---|
[11822] | 143 | #_bannertitle_ {_If_(_imagethispage_,<p class="bannertitle"><span class="bannertitle">_imagethispage_</span></p>)}
|
---|
[11156] | 144 |
|
---|
[11822] | 145 | _bannertitle_ {_If_(_imagethispage_,<p class="bannertitle">_imagethispage_</p>)}
|
---|
[11799] | 146 |
|
---|
[11822] | 147 | #<span class="bannertitlebackground">i</span>
|
---|
| 148 |
|
---|
[11117] | 149 | package home
|
---|
| 150 |
|
---|
[20611] | 151 | _preflink_ {_navtaborig_(_home:httppagehomepref_,_linktextPREFERENCES_,_textdescrpref_)}
|
---|
[11117] | 152 |
|
---|