Plasma GitLab Archive
Projects Blog Knowledge

<?xml version="1.0" encoding="ISO8859-1"?>

<!-- $Id: index.ui,v 1.1 2003-03-09 17:37:29 stolpmann Exp $ -->

<!DOCTYPE ui:application
	  PUBLIC "-//NPC//DTD WDIALOG 2.1//EN" "application.dtd" [

<!-- Better we would have a complete definition of all HTML-related
     entities. For the moment, ad-hoc definitions do the job.
  -->

<!ENTITY nbsp "<ui:special>&amp;nbsp;</ui:special>">

]>

<ui:application start-dialog="directory">

  <!-- ******************** TEMPLATES *********************** -->

  <!-- The top-level layout of the pages.
       Params:
       page:   the page to display
    -->
  <ui:template name="page-layout" from-caller="body language-selector">
    <ui:default name="language-selector">yes</ui:default>
    <html>
      <head><title><q:msg-title/></title></head>
      <body bgcolor="white">

        <ui:form>

          <!-- We want the whole page to be indented by 20 pixels -->
          <table>
            <tr>
              <td width="20">&nbsp;</td>
              <td>$body</td>
            </tr>
            <ui:if value1="${language-selector}" value2="yes">
	      <tr>
		<td>&nbsp;</td>
		<td>
		  <ui:a name="set_language" index="en">English</ui:a>
		  <ui:a name="set_language" index="de">Deutsch</ui:a>
		</td>
	      </tr>
	    </ui:if>
          </table>

        </ui:form>

      </body>
    </html>
  </ui:template>



  <!-- One row of the directory listing
       Params:
       filename, fileperms, fileowner, filegroup, filesize,
       filemtime, filesymlink
    -->
  <ui:template name="directory-row" 
	       from-caller="filename fileperms fileowner filegroup filesize
	                    filemtime filesymlink">
    <tr>
      <td align="left"><tt>$fileperms</tt></td>
      <td>&nbsp;&nbsp;</td>
      <td align="left">$fileowner</td>
      <td>&nbsp;&nbsp;</td>
      <td align="left">$filegroup</td>
      <td>&nbsp;&nbsp;</td>
      <td align="right">$filesize</td>
      <td>&nbsp;&nbsp;</td>
      <td align="left"><tt>$filemtime</tt></td>
      <td>&nbsp;&nbsp;</td>
      <td align="left">$filename $filesymlink</td>
    </tr>
  </ui:template>



  <!-- The default layout of a filename.
       Params:
       value
    -->
  <ui:template name="filename" from-caller="value">
    $value
  </ui:template>



  <!-- The layout of filenames of directories.
       Params:
       value
    -->
  <ui:template name="filename_d" from-caller="value">
    <a href="javascript:void(open_confirmation_popup('width=400,height=200',
               '${value/js}'))"
       >$value</a>
  </ui:template>



  <!-- The layout of a symlink
       Params:
       value
    -->
  <ui:template name="symlink" from-caller="value">
    -&gt; $value
  </ui:template>


  <!-- Localized messages -->

  <ui:template name="msg-title" xml:lang="en">
    Directory listing application
  </ui:template>

  <ui:template name="msg-title" xml:lang="de">
    Verzeichnislisten-Anwendung
  </ui:template>



  <ui:template name="msg-enter-path" xml:lang="en" 
	        from-caller="path_widget ok_button">
     <h1>Directory Listings</h1>
     Please enter the path name of the directory you want to
     see.<br/>
     Path name: $path_widget $ok_button
  </ui:template>

  <ui:template name="msg-enter-path" xml:lang="de"
	        from-caller="path_widget ok_button">
     <h1>Verzeichnislisten</h1>
     Bitte gib den Pfadnamen des Verzeichnisses an, das du ansehen willst.
     <br/>
     Pfadname: $path_widget $ok_button
  </ui:template>



  <ui:template name="msg-the-directory" xml:lang="en" from-caller="dir">
    The directory $dir
  </ui:template>

  <ui:template name="msg-the-directory" xml:lang="de" from-caller="dir">
    Das Verzeichnis $dir
  </ui:template>


  <!-- ********************* OBJECTS *********************** -->

  <ui:dialog name="directory" start-page="enter-path" lang-variable="lang">


    <!-- *** Declaration of state variables *** -->

    <ui:variable name="path">
      <ui:string-value>/</ui:string-value>
    </ui:variable>
      <!-- The path to list -->

    <ui:variable name="next_path"/>
      <!-- The next path to list -->

    <ui:variable name="listing" temporary="yes"/>
      <!-- Contains the generated listing -->

    <ui:variable name="lang">
       <ui:string-value>en</ui:string-value>
    </ui:variable>


    <!-- *** The page enter-path *** -->

    <ui:page name="enter-path">
      <q:page-layout>
	<t:msg-enter-path>
	  <p:path_widget><ui:text variable="path" size="40"/></p:path_widget>
	  <p:ok_button>
            <ui:button name="path-ok" label="OK" goto="show-listing"/>
          </p:ok_button>
        </t:msg-enter-path>
      </q:page-layout>
    </ui:page>

    <!-- *** The page enter_popup *** -->

    <ui:page name="enter_popup" popup="yes">
      <q:page-layout language-selector="no">
	<t:msg-enter-path>
	  <p:path_widget><ui:text variable="path" size="40"/></p:path_widget>
	  <p:ok_button>
            <ui:button name="path-ok" label="OK" goto="show-listing"/>
	    <input type="button" value="Cancel" onclick="window.close()"/>
          </p:ok_button>
        </t:msg-enter-path>
      </q:page-layout>
    </ui:page>


    <!-- *** The page confirmation_popup *** -->

    <ui:page name="confirmation_popup" popup="yes">
      <q:page-layout language-selector="no">
	<l:de>
	  Wirklich in das Verzeichnis "$[next_path]" wechseln?
	  <ui:button name="confirm" label="Ja" goto="show-listing"/>
	  <input type="button" value="Nein" onclick="window.close()"/>
	</l:de>
	<l:en>
	  Do you really want to change into the directory "$[next_path]"?
	  <ui:button name="confirm" label="Yes" goto="show-listing"/>
	  <input type="button" value="No" onclick="window.close()"/>
	</l:en>
      </q:page-layout>
    </ui:page>


    <!-- *** The page show-listing *** -->

    <ui:page name="show-listing" from-caller="Change_path">
      <ui:default name="Change_path"><ui:cond>
	<ui:iflang xml:lang="en">Change path</ui:iflang>
	<ui:iflang xml:lang="de">Ändere Pfad</ui:iflang>
      </ui:cond></ui:default>

      <ui:use template="page-layout">
        <ui:param name="body">
	  <ui:popup page="enter_popup"/>
	  <ui:server-popup page="confirmation_popup"/>
          <h1>
	    <t:msg-the-directory>
	      <p:dir><ui:dynamic variable="path"/></p:dir>
	    </t:msg-the-directory>
          </h1>
          <table>
             <!-- Here multiple instances of the template
                  "directory-row" are inserted.
	       -->
             <ui:dynamic variable="listing" special="yes"/>
          </table>
	  <input type="button" value="$Change_path" 
	         onclick="open_enter_popup('width=400,height=200')"/>
        </ui:param>
      </ui:use>
    </ui:page>

  </ui:dialog>

</ui:application>




This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml