<?xml version="1.0"?>
<!--
 -
 -  $Id$
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -
 -  Copyright (C) 1998-2018 OpenLink Software
 -
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -
-->
  <v:form name="toolbar" action="" type="simple" method="POST"
	  xmlns:v="http://www.openlinksw.com/vspx/" 
	  enabled="--case when (  get_keyword ('logout_button', control.vc_page.vc_event.ve_params) is
	  null and  self.vc_authenticated ) then 1 else 0 end">
    <div class="wiki_menu">
      <div class="wiki_menu_row">
	<span> 
	  <v:button xhtml_class="button" action="simple" style="url"
		    name="wabutton" value="WAPage">
	    <v:on-post>
	      <![CDATA[
	        self.vc_redirect('/wa/settings.vspx');
	      ]]>
	    </v:on-post>
	  </v:button>
	</span>
	<span> 
	  <v:button xhtml_class="button" action="simple" style="url"
		name="dav_browser" value="DAVSecurity">
	    <v:on-post>
	      <![CDATA[
	        declare _page, _cluster, _local_name, _attach, _base_adjust varchar;
	        WV.WIKI.VSPDECODEWIKIPATH (path, _page, _cluster, _local_name, _attach, _base_adjust);

	        declare sid varchar;
	        sid := md5 (concat (datestring (now ()), http_client_ip (), http_path ()));
	        insert into VSPX_SESSION (VS_REALM, VS_SID, VS_UID, VS_STATE, VS_EXPIRY)
			values ('virtuoso_admin', sid, connection_get ('vspx_user'), serialize (vector ('vspx_user', connection_get ('vspx_user'))), now());
		commit work;
	        http_request_status ('HTTP/1.1 302 Found');
	        http_header (sprintf('Location: /conductor/popup_browser.vspx?sid=%s&realm=virtuoso_admin&path=%s\r\n', 
			sid,
			'DAV/VAD/wiki/' || _cluster ));
	      ]]>
	    </v:on-post>
	  </v:button>
	</span>
	<?vsp
	  if (connection_get ('vspx_user') = 'dav') {
	?>
	<span> 
	  <v:button xhtml_class="button" action="simple" style="url"
		    name="settbutton" value="ClusterSettings">
	    <v:on-post>
	      <![CDATA[
	        self.vc_redirect('/wikix/settings.vspx?cluster=Main');
	      ]]>
	    </v:on-post>
	  </v:button>
	</span>
	<?vsp
	  }
	?>
	<span width="100%">&nbsp;</span>
        <span>
	  <v:button xhtml_class="button" action="submit" style="button"
		    name="searchbutton" value="Search">
	    <v:on-post>
	      <![CDATA[
	      self.vc_redirect('/wikix/search.vspx?searchtext_t=' || self.searchtext_t.ufl_value);
	      ]]>
	    </v:on-post>
	  </v:button>
	</span>
	<span align="right">
          <v:text name="searchtext_t" xhtml_size="20" format="%s"/>
        </span>
      </div>
    </div>
  </v:form>
