<!-- $Id: d_read.tt2 6099 2009-08-13 08:31:02Z olivier.salaun $ -->

[% IF file %]
  [% INSERT $file IF file %]
[% ELSE %]

[% IF path %]  <span class="search_form"> <a class="actionMenuLinks" href="[% path_cgi %]/d_read/[% list %]/[% escaped_father %]">[%|loc%]Up to higher level directory[%END%]</a></span>
[% END %]

[% IF expert_page %]
    <a class="actionMenuLinks" href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]?type=directory&previous_action=d_read&show_user_page=1">[%|loc%]User mode[%END%]</a>
    <a class="actionMenuLinksCurrentPage" href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]?type=directory&previous_action=d_read&show_expert_page=1">[%|loc%]Expert mode[%END%]</a>
[% ELSE %] 
    [% IF has_dir_rights %]
    <a class="actionMenuLinksCurrentPage" href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]?type=directory&previous_action=d_read&show_user_page=1">[%|loc%]User mode[%END%]</a>
    <a class="actionMenuLinks" href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]?type=directory&previous_action=d_read&show_expert_page=1">[%|loc%]Expert mode[%END%]</a>
    [% END %]
[% END %]  

[% IF path %]  

<h1>[%|loc%]Listing of folder[%END%] [% visible_path %] <a class="input" href="[% path_cgi %]/nomenu/help/shared" title="[%|loc%]Open in a new window[%END%]" onclick="window.open('','wws_help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=200')" target="wws_help">[%|loc%]Help[%END%]</a></h1>

    [% IF expert_page %]
    <span class="search_form">
      [% IF may_edit %]
    <a class="actionMenuLinks" href="[% path_cgi %]/d_delete/[% list %]/[% escaped_path %]" onclick="request_confirm_link('[% path_cgi %]/d_delete/[% list %]/[% escaped_path %]', '[% FILTER escape_quote %][%|loc(visible_path)%]Do you really want to delete %1?[%END%][%END%]'); return false;">[%|loc%]delete[%END%]</a> 
	 <a class="actionMenuLinks"  href="[% path_cgi %]/d_properties/[% list %]/[% escaped_path %]">[%|loc%]properties[%END%]</a>
      [% END %]
      [% IF may_control %]      
        <a  class="actionMenuLinks" href="[% path_cgi %]/d_control/[% list %]/[% escaped_path %]">[%|loc%]access[%END%]</a>
      [% END %]      
	</span>
    [% END %]

      <br />

    [%|loc(doc_owner)%]Owner: %1[%END%] <br />
    [%|loc(doc_date)%]Last update: %1[%END%] <br />
    [% IF doc_title %]
    [%|loc(doc_title)%]Description: %1[%END%] <br /><br />
    [% END %]
    
    <br />  
  [% ELSE %]
     
  <h1>[%|loc%]Listing of root folder[%END%]  <a class="input" href="[% path_cgi %]/nomenu/help/shared" title="[%|loc%]Open in a new window[%END%]" onclick="window.open('','wws_help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=200')" target="wws_help">[%|loc%]Help[%END%]</a></h1>
  [% END %]   

  <table summary="[%|loc%]Listing of folder[%END%] [% visible_path %]" class="listOfItems">
  <tr>
  
  [% IF order_by != 'order_by_doc' %]  
	<th><a href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]?order=order_by_doc">[%|loc%]Document[%END%]</a> </th>
  [% ELSE %]  
        <th class="sortby">[%|loc%]Document[%END%]</th>
  [% END %]
  [% IF order_by != 'order_by_author' %]  
	<th><a href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]?order=order_by_author">[%|loc%]Author[%END%]</a> </th>
  [% ELSE %]  	
        <th class="sortby">[%|loc%]Author[%END%]</span></td>
  [% END %]
  [% IF order_by != 'order_by_size' %] 
	<th><a href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]?order=order_by_size">[%|loc%]Size (Kb)[%END%]</a> </th>
  [% ELSE %]  
        <th class="sortby">[%|loc%]Size (Kb)[%END%]</th> 
  [% END %]
  [% IF order_by != 'order_by_date' %]
	<th><a href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]?order=order_by_date">[%|loc%]Last update[%END%]</a> </th>
  [% ELSE %]  
        <th class="sortby">[%|loc%]Last update[%END%]</span></td>
  [% END %]

  [% IF expert_page %]
   <th>[%|loc%]Edit[%END%]</th> 
   <th>[%|loc%]Delete[%END%]</th>
   <th>[%|loc%]Access[%END%]</th>
   <th>[%|loc%]Properties[%END%]</th>
   [% IF is_editor %]
     <th>[%|loc%]Moderation[%END%]</th>
   [% END %]
  [% END %]
  </tr>
      
  [% IF empty %]
    <tr class="color0">
    <td class="text_center" colspan="9"> [%|loc%]Empty folder[%END%] </td>
    </tr>
  [% ELSE %]   
    [% IF sort_subdirs %]
      [% FOREACH s = sort_subdirs %]
        <tr class="color0">
	[% IF escaped_path %]
	  <td class="review_cels_mail"> <a href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]/[% s.escaped_doc %]/"> 
	[% ELSE %]
	  <td class="review_cels_mail"> <a href="[% path_cgi %]/d_read/[% list %]/[% s.escaped_doc %]/"> 
	[% END %]
	<img src="[% s.icon %]" alt="[% s.escaped_title %]" /> [% s.doc %]</a></td>
	<td class="review_cels">
	[% IF s.author_known %] 
	  [% s.author_mailto %]  
        [% ELSE %]
	   [%|loc%]Unknown[%END%] 
	[% END %]
	</td>	    
	<td>&nbsp;</td>
	<td class="review_cels"> [% s.date %] </td>
		

	[% IF expert_page %]

	  [% IF s.edit %]
            <td>&nbsp; </td>
	  <td class="review_cels">
	    [% IF escaped_path %]
	      <a href="[% path_cgi %]/d_delete/[% list %]/[% escaped_path %]/[% s.escaped_doc %]" onclick="request_confirm_link('[% path_cgi %]/d_delete/[% list %]/[% escaped_path %]/[% s.escaped_doc %]', '[% FILTER escape_quote %][%|loc(visible_path,s.doc)%]Do you really want to delete %1%2?[%END%][%END%]'); return false;">[%|loc%]delete[%END%]</a>
            [% ELSE %]
	      <a href="[% path_cgi %]/d_delete/[% list %]/[% s.escaped_doc %]" onclick="request_confirm_link('[% path_cgi %]/d_delete/[% list %]/[% s.escaped_doc %]', '[% FILTER escape_quote %][%|loc(visible_path,s.doc)%]Do you really want to delete %1%2?[%END%][%END%]'); return false;">[%|loc%]delete[%END%]</a>
	    [% END %]
	  </td>
	[% ELSE %]
	  <td>&nbsp; </td>
	  <td>&nbsp; </td>
	[% END %]
	
	[% IF s.control %]
	  <td class="review_cels">
	    [% IF escaped_path %]
	        <a href="[% path_cgi %]/d_control/[% list %]/[% escaped_path %]/[% s.escaped_doc %]">[%|loc%]access[%END%]</a>
	    [% ELSE %]
	     <a href="[% path_cgi %]/d_control/[% list %]/[% s.escaped_doc %]">[%|loc%]access[%END%]</a>
            [% END %]
	    </td>	 
	  [% ELSE %]
	    <td>&nbsp; </td>
	  [% END %]
      
          [% IF s.edit %]
	    <td class="review_cels">
	    [% IF escaped_path %]
	      <a href="[% path_cgi %]/d_properties/[% list %]/[% escaped_path %]/[% s.escaped_doc %]">[%|loc%]properties[%END%]</a>
	    [% ELSE %] 
	      <a href="[% path_cgi %]/d_properties/[% list %]/[% s.escaped_doc %]">[%|loc%]properties[%END%]</a>
	    [% END %]
	  </td>	 
	[% ELSE %]
	  <td>&nbsp; </td>
	[% END %]

      [% IF is_editor %]
       <td>&nbsp; </td>
          [% END %]
	[% END %]
      </tr>
      [% END %] 
    [% END %]

    [% IF sort_files %]
      [% FOREACH f = sort_files %]
	[% IF f.moderate %]
	  [% IF expert_page %]
         <tr class="bg_color_bg">
	  [% END %]
	[% ELSE %]
         <tr class="color0">
        [% END %]
        
        [% IF f.html %]
	  <td class="review_cels_mail">
	  [% IF escaped_path %]
            <a href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]/[% f.escaped_doc %]" title="[%|loc%]Open in a new window[%END%]" target="html_window">
	  [% ELSE %]
            <a href="[% path_cgi %]/d_read/[% list %]/[% f.escaped_doc %]" title="[%|loc%]Open in a new window[%END%]" target="html_window">
	  [% END %]	  
	  <img src="[% f.icon %]" alt="[% f.escaped_title %]" /> [% f.doc %] </a>
	  </td>
	[% ELSIF f.url %]
	  <td class="review_cels_mail">
	  <a href="[% f.url %]" title="[%|loc%]Open in a new window[%END%]" target="html_window">
	  <img src="[% f.icon %]" alt="[% f.escaped_title %]" /> [% f.anchor %] </a>
	  </td>
	[% ELSE %]
	  [% IF f.moderate %]
	    [% IF expert_page %]
	      <td class="review_cels_mail">
	      [% IF escaped_path %]
	        <a href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]/[% f.escaped_doc %]">
	      [% ELSE %]
                <a href="[% path_cgi %]/d_read/[% list %]/[% f.escaped_doc %]">
	      [% END %]
	  <img src="[% f.icon %]" alt="[% f.escaped_title %]" /> [% f.doc %] </a>
	      </td>
        [% END %] 
	  [% ELSE %]
	    <td class="review_cels_mail">
	    [% IF escaped_path %]
	      <a href="[% path_cgi %]/d_read/[% list %]/[% escaped_path %]/[% f.escaped_doc %]">
	    [% ELSE %]
              <a href="[% path_cgi %]/d_read/[% list %]/[% f.escaped_doc %]">
	    [% END %]
	    <img src="[% f.icon %]" alt="[% f.escaped_title %]" /> [% f.doc %] </a>
	</td>  
	  [% END %]
     
        [% END %] 
	  
	 
	 
	[% IF f.moderate %]
	  [% IF expert_page %]
	    <td class="review_cels">[%|loc%]to moderate[%END%]</td>
          [% END %]
	[% ELSE %]
         <td class="review_cels">
	 [% IF f.author_known %]
	   [% f.author_mailto %]
 	 [% ELSE %]
           [%|loc%]Unknown[%END%]  
         [%END%]
	</td>
        [% END %]
	 
	[% IF f.moderate %]
	  [% IF expert_page %]
   	     <td class="review_cels">&nbsp;
	     [% IF !f.url %]
	       [% f.size %] 
	     [% END %]
	     </td>
	     <td class="review_cels"> [% f.date %] </td>
	  [% END %]
	[% ELSE %]
	  <td class="review_cels">&nbsp;
	  [% IF !f.url %]
	    [% f.size %] 
	  [% END %]
	  </td>
	  <td class="review_cels"> [% f.date %] </td>
	[% END %]

	 
	[% IF expert_page %] 
	[% IF f.edit %]
	<td class="review_cels">
	    [% IF escaped_path %]
	      <a href="[% path_cgi %]/d_editfile/[% list %]/[% escaped_path %]/[% f.escaped_doc %]">[%|loc%]edit[%END%]</a>
	    [% ELSE %]
  	      <a href="[% path_cgi %]/d_editfile/[% list %]/[% f.escaped_doc %]">[%|loc%]edit[%END%]</a>
	    [% END %]	  
	</td>
	<td class="review_cels">
	    [% IF escaped_path %]
              <a href="[% path_cgi %]/d_delete/[% list %]/[% escaped_path %]/[% f.escaped_doc %]" onclick="request_confirm_link('[% path_cgi %]/d_delete/[% list %]/[% escaped_path %]/[% f.escaped_doc %]', '[% FILTER escape_quote %][%|loc(visible_path,f.doc,f.size)%]Do you really want to delete %1%2 (%3 Kb)?[%END%][%END%]'); return false;">[%|loc%]delete[%END%]</a>
	    [% ELSE %]
              <a href="[% path_cgi %]/d_delete/[% list %]/[% f.escaped_doc %]" onclick="request_confirm_link('[% path_cgi %]/d_delete/[% list %]/[% f.escaped_doc %]', '[% FILTER escape_quote %][%|loc(visible_path,f.doc,f.size)%]Do you really want to delete %1%2 (%3 Kb)?[%END%][%END%]'); return false;">[%|loc%]delete[%END%]</a>
	    [% END %]
	</td>
	[% ELSE %]
	  <td>&nbsp; </td> <td>&nbsp; </td>
	[% END %]
		 
	[% IF f.control %]
	  <td class="review_cels">
	    [% IF escaped_path %]
	      <a href="[% path_cgi %]/d_control/[% list %]/[% escaped_path %]/[% f.escaped_doc %]">[%|loc%]access[%END%]</a>
	    [% ELSE %]
	      <a href="[% path_cgi %]/d_control/[% list %]/[% f.escaped_doc %]">[%|loc%]access[%END%]</a>
	    [% END %]
	    </td>
	  [% ELSE %]
	  <td>&nbsp; </td>
	  [% END %]
        
	  [% IF f.edit %]
	    <td class="review_cels">
	    [% IF escaped_path %]
	      <a href="[% path_cgi %]/d_properties/[% list %]/[% escaped_path %]/[% f.escaped_doc %]">[%|loc%]properties[%END%]</a>
	    [% ELSE %]	    
	      <a href="[% path_cgi %]/d_properties/[% list %]/[% f.escaped_doc %]">[%|loc%]properties[%END%]</a>
	    [% END %]
	  </td>
	[% ELSE %]
	<td>&nbsp; </td>
	[% END %]

        [% IF is_editor %]
          [% IF f.moderate %]
	  [% IF expert_page %]
          <td class="review_cels">
          <a href="[% path_cgi %]/modindex/[% list %]"> [%|loc%]moderate[%END%]</a>
          </td>
	  [% END %]
          [% ELSE %]
          <td>&nbsp; </td>
          [%END%]
        [%END%]

        [% END %]
	</tr>
      [% END %] 
    [% END %]
  [% END %]
  </table>	        
 
  <br />
  [% IF expert_page %] 
  [% IF may_edit %]
   [% IF total_edit %]    
    <div class="block">
    <form method="post" action="[% path_cgi %]">
    <fieldset>
    <strong>
    [% IF path %]
      [%|loc(visible_path)%]Create a new folder inside folder %1[%END%]
    [% ELSE %]
      [%|loc%]Create a new folder inside root folder[%END%]
    [% END %]
    </strong> <br />
    <label for="name_doc">[%|loc%]Folder name[%END%]</label> <input id="name_doc" maxlength="30" type="text" name="name_doc" />
    <input class="MainMenuLinks" type="submit" value="[%|loc%]Create[%END%]" name="action_d_create_dir" />
    <input type="hidden" name="previous_action" value="d_read" />
    <input type="hidden" name="list" value="[% list %]" />
    <input type="hidden" name="path" value="[% path %]" />
    <input type="hidden" name="type" value="directory" />
    <input type="hidden" name="action" value="d_create_dir" />
    </fieldset>
    </form>
    </div><br/>
    [% END %]

    <div class="block">
    <form method="post" action="[% path_cgi %]">
    <fieldset>
    <strong> [%|loc%]Create a new file[%END%]</strong> <br />
    <label for="name_doc">[%|loc%]File name[%END%]</label> <input id="name_doc" maxlength="30" type="text" name="name_doc" />
    <input class="MainMenuLinks" type="submit" value="[%|loc%]Create[%END%]" name="action_d_create_dir" />
    <input type="hidden" name="previous_action" value="d_read" />
    <input type="hidden" name="list" value="[% list %]" />
    <input type="hidden" name="path" value="[% path %]" />
    <input type="hidden" name="type" value="file" />
    <input type="hidden" name="action" value="d_create_dir" />
    </fieldset>
    </form>
    </div>

    <br /><div class="block">
    <form method="post" action="[% path_cgi %]">
    <fieldset>
    <strong>[%|loc%]Add a bookmark[%END%]</strong><br />
    <label for="name_doc">[%|loc%]title[%END%]</label> <input id="name_doc" maxlength="100" size="25" type="text" name="name_doc" /><br />
    <label for="url">[%|loc%]URL[%END%]</label> <input id="url" size="35" type="text" name="url" />
    <input class="MainMenuLinks" type="submit" value="[%|loc%]Add[%END%]" name="action_d_savefile" />
    <input type="hidden" name="previous_action" value="d_read" />
    <input type="hidden" name="list" value="[% list %]" />
    <input type="hidden" name="path" value="[% path %]" />
    <input type="hidden" name="action" value="d_savefile" />
    </fieldset>
    </form>
    </div><br/>
   <div class="block">
   <form method="post" action="[% path_cgi %]" enctype="multipart/form-data" >
   <fieldset>
   <label for="uploaded_file">
   <strong>
   [% IF path %]
     [%|loc(visible_path)%]Upload a file inside folder %1[%END%]
   [% ELSE %]
     <strong> [%|loc%]Upload a file inside folder SHARED[%END%]
   [% END %]
   </strong></label><br />
   <input id="uploaded_file" type="file" name="uploaded_file"/>
   <input class="MainMenuLinks" type="submit" value="[%|loc%]Publish[%END%]" name="action_d_upload" />
   <input type="hidden" name="list" value="[% list %]" />
   <input type="hidden" name="path" value="[% path %]" />
   </form> 
   </div><br />

      [% IF total_edit %]
        <div class="block">
        <form method="post" action="[% path_cgi %]" enctype="multipart/form-data" >
	<fieldset>
	<label for="unzipped_file">
        <strong>
 	[% IF path %]
           [%|loc(visible_path)%]Unzip a file inside the folder %1[%END%]
         [% ELSE %]
           [%|loc%]Unzip a file inside the folder SHARED[%END%]
         [% END %]
        </strong></label><br />
        <input id="unzipped_file" type="file" name="unzipped_file"/>

        <input class="MainMenuLinks" type="submit" value="[%|loc%]Publish[%END%]" name="action_d_unzip" />
        <input type="hidden" name="list" value="[% list %]" />
        <input type="hidden" name="path" value="[% path %]" />
	</fieldset>
        </form> 
        </div><br />
       
       [% END %]
     [% END %]
   [% END %]

[% END %]
   
<!-- end d_read.tt2 -->
