<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%Links::Config::load_vars%>
<html>

<head>
  <title>Gossamer Links Setup: Path and URL Settings</title>
  <%include include_style.html%>
  <script type="text/javascript">
    var shown = false;
    function showOthers (e) {
      if (shown) return cancelEvent(e);
      shown = true;

      var tbody = document.getElementById('settings');
      var tr = document.createElement('TR');
      var th = document.createElement('TH');
      th.appendChild(document.createTextNode('Other Paths and URLs'));
      th.className = 'heading';
      th.colSpan = 2;
      tr.appendChild(th);
      tbody.appendChild(tr);

      addDescription('The URL and path for the What\'s New page.');
      addTextSetting('build_new_url', '<%escape_js cfg_build_new_url%>');
      addTextSetting('build_new_path', '<%escape_js cfg_build_new_path%>');

      addDescription('The URL and path for the What\'s Cool page.');
      addTextSetting('build_cool_url', '<%escape_js cfg_build_cool_url%>');
      addTextSetting('build_cool_path', '<%escape_js cfg_build_cool_path%>');

      addDescription('The URL and path for the Top Rated page.');
      addTextSetting('build_ratings_url', '<%escape_js cfg_build_ratings_url%>');
      addTextSetting('build_ratings_path', '<%escape_js cfg_build_ratings_path%>');

      addDescription('The URL and path for the Detailed pages.');
      addTextSetting('build_detail_url', '<%escape_js cfg_build_detail_url%>');
      addTextSetting('build_detail_path', '<%escape_js cfg_build_detail_path%>');

      addDescription('This should be the URL where any image files used by Gossamer Links can be found.  No trailing slash.  Note that this option is deprecated - you should only need this if you are using version 2.x templates.  Use the build_static_url option instead.');
      addTextSetting('build_images_url', '<%escape_js cfg_build_images_url%>');

      addDescription('The URL to your CSS file.  Note that this option is deprecated - you should only need this if you are using version 2.x templates.');
      addTextSetting('build_css_url', '<%escape_js cfg_build_css_url%>');

      return cancelEvent(e);
    }

    function addDescription (desc) {
      var table = document.getElementById('settings');
      var tr = document.createElement('tr');
      var td = document.createElement('td');
      td.appendChild(document.createTextNode(desc));
      td.colSpan = 2;
      td.className = 'description';
      tr.appendChild(td);
      table.appendChild(tr);
    }

    function addTextSetting (option, value) {
      var table = document.getElementById('settings');
      var tr = document.createElement('tr');
      var td = document.createElement('td');
      td.className = 'option';
      td.appendChild(document.createTextNode(option));
      tr.appendChild(td);

      td = document.createElement('td');
      td.className = 'value';

      var input = document.createElement('input');
      input.type = 'text';
      input.name = option;
      input.value = value;
      input.size = 40;

      td.appendChild(input);
      tr.appendChild(td);
      table.appendChild(tr);
    }

    function cancelEvent (e) {
      if (!e && window.event)
        e = window.event;
      if (e) {
        e.returnValue = false;
        e.cancelBubble = true;
      }
      return false;
    }
  </script>

</head>

<body>

<form method="post" action="setup.cgi">
<input type="hidden" name="do" value="setup_path" />

<%set header_title = 'Path and <acronym>URL</acronym> Settings'%>
<%set header_details = 'These are the only paths you should need to set in the
program. Most should be set appropriately during installation and should not
require changes.%>

<%include include_header.html%>

<table>
  <tbody id="settings">
    <tr>
      <th class="heading" colspan="2">Path and URL Settings</th>
    </tr>
    <tr>
      <td class="description" colspan="2">
        This should be the URL (starting with http://) to the directory where
        your admin files are. No trailing slash please.
      </td>
    </tr>
    <tr>
      <td class="option">admin_root_url</td>
      <td class="value"><input type="text" name="admin_root_url" value="<%cfg_admin_root_url%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        This should be the PATH (starting with a / or a drive letter) to the
        directory where your admin files are. No trailing slash please.
      </td>
    </tr>
    <tr>
      <td class="option">admin_root_path</td>
      <td class="value"><input type="text" name="admin_root_path" value="<%cfg_admin_root_path%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        This should be the URL where your public cgi scripts (add.cgi,
        modify.cgi, search.cgi, etc.) are located.  No trailing slash.
      </td>
    </tr>
    <tr>
      <td class="option">db_cgi_url</td>
      <td class="value"><input type="text" name="db_cgi_url" value="<%cfg_db_cgi_url%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        This should be the URL via HTTPS where your public cgi scripts are
        (add.cgi, modify.cgi, search.cgi, etc.) are located.  If this option is
        left blank, the above <b>db_cgi_url</b> value will be used, with
        'http://' changed to 'https://'.  This option can be ignored if not using
        'Direct' payment methods.  No trailing slash.
      </td>
    </tr>
    <tr>
      <td class="option">db_cgi_url_https</td>
      <td class="value"><input type="text" name="db_cgi_url_https" value="<%cfg_db_cgi_url_https%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        This should be the URL where Gossamer Links will create its HTML pages. No
        trailing slash.
      </td>
    </tr>
    <tr>
      <td class="option">build_root_url</td>
      <td class="value"><input type="text" name="build_root_url" value="<%cfg_build_root_url%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        This should be the PATH where Gossamer Links should create it's HTML pages. No
        trailing slash.
      </td>
    </tr>
    <tr>
      <td class="option">build_root_path</td>
      <td class="value"><input type="text" name="build_root_path" value="<%cfg_build_root_path%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        This is the URL where static template files (images, javascript, css, etc.) reside.
        No trailing slash.  If you are running in dynamic mode, this should not be the same
        as your build_root_url.
      </td>
    </tr>
    <tr>
      <td class="option">build_static_url</td>
      <td class="value"><input type="text" name="build_static_url" value="<%cfg_build_static_url%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        This should be the PATH where the static template files are located. No trailing slash.
      </td>
    </tr>
    <tr>
      <td class="option">build_static_path</td>
      <td class="value"><input type="text" name="build_static_path" value="<%cfg_build_static_path%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        FileMan Root Directory.  Included in Gossamer Links is a copy of FileMan that
        you can use to manage files from the web. It defaults to your Gossamer Links
        admin directory, but you can change it here.
      </td>
    </tr>
    <tr>
      <td class="option">fileman_root_dir</td>
      <td class="value"><input type="text" name="fileman_root_dir" value="<%cfg_fileman_root_dir%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        This should be the path to perl.  Windows users should include a drive
        letter as well.
      </td>
    </tr>
    <tr>
      <td class="option">path_to_perl</td>
      <td class="value"><input type="text" name="path_to_perl" value="<%cfg_path_to_perl%>" size="40" /></td>
    </tr>
  <%if not advanced%>
    <tr id="advanced_desc">
      <td class="description" colspan="2">
        Update other paths and URL's to reflect base? If selected, paths like
        What's New, What's Cool, etc. will be automatically updated, otherwise
        <a id="aadvanced" href="admin.cgi?page=setup_path.html;advanced=1"><b>click here</b></a>
        to view them and set them manually.
        <script type="text/javascript">document.getElementById('aadvanced').onclick = showOthers;</script>
      </td>
    </tr>
    <tr id="advanced_value">
      <td class="option">update_others</td>
      <td class="value"><input type="checkbox" name="update_others" value="ON" /></td>
    </tr>
  <%else%>
    <tr>
      <th class="heading" colspan="2">Other Paths and URL's</th>
    </tr>
    <tr>
      <td class="description" colspan="2">
        The <acronym>URL</acronym> and path for the What's New page.
      </td>
    </tr>
    <tr>
      <td class="option">build_new_url</td>
      <td class="value"><input type="text" name="build_new_url" value="<%cfg_build_new_url%>" size="40" /></td>
    </tr>
    <tr>
      <td class="option">build_new_path</td>
      <td class="value"><input type="text" name="build_new_path" value="<%cfg_build_new_path%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        The <acronym>URL</acronym> and path for the What's Cool page.
      </td>
    </tr>
    <tr>
      <td class="option">build_cool_url</td>
      <td class="value"><input type="text" name="build_cool_url" value="<%cfg_build_cool_url%>" size="40" /></td>
    </tr>
    <tr>
      <td class="option">build_cool_path</td>
      <td class="value"><input type="text" name="build_cool_path" value="<%cfg_build_cool_path%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        The <acronym>URL</acronym> and path for the Top Rated page.
      </td>
    </tr>
    <tr>
      <td class="option">build_ratings_url</td>
      <td class="value"><input type="text" name="build_ratings_url" value="<%cfg_build_ratings_url%>" size="40" /></td>
    </tr>
    <tr>
      <td class="option">build_ratings_path</td>
      <td class="value"><input type="text" name="build_ratings_path" value="<%cfg_build_ratings_path%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        The <acronym>URL</acronym> and path for the Detailed pages.
      </td>
    </tr>
    <tr>
      <td class="option">build_detail_url</td>
      <td class="value"><input type="text" name="build_detail_url" value="<%cfg_build_detail_url%>" size="40" /></td>
    </tr>
    <tr>
      <td class="option">build_detail_path</td>
      <td class="value"><input type="text" name="build_detail_path" value="<%cfg_build_detail_path%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        This should be the URL where any image files used by Gossamer Links can be
        found. No trailing slash.  Note that this option is deprecated - you should
        only need this if you are using version 2.x templates.  Use the build_static_url option instead.
      </td>
    </tr>
    <tr>
      <td class="option">build_images_url</td>
      <td class="value"><input type="text" name="build_images_url" value="<%cfg_build_images_url%>" size="40" /></td>
    </tr>
    <tr>
      <td class="description" colspan="2">
        The URL to your <acronym title="Cascading Style Sheet">CSS</acronym> file.
        Note that this option is deprecated - you should only need this if you are using version 2.x templates.
      </td>
    </tr>
    <tr>
      <td class="option">build_css_url</td>
      <td class="value"><input type="text" name="build_css_url" value="<%cfg_build_css_url%>" size="40" /></td>
    </tr>
  <%endif%>
  </tbody>
</table>

<div class="submit">
  <input type="submit" value="Submit Changes" />
  <input type="submit" name="reset_defaults" value="Restore System Defaults" class="reset" />
</div>

</form>
</body>
</html>
