ImageManager
[ class tree: ImageManager ] [ index: ImageManager ] [ all elements ]

Source for file manager.php

Documentation is available at manager.php

  1. <?php
  2. /**
  3.  * The main GUI for the ImageManager.
  4.  * @author $Author: Wei Zhuo $
  5.  * @version $Id: manager.php 26 2004-03-31 02:35:21Z Wei Zhuo $
  6.  * @package ImageManager
  7.  */
  8.  
  9. require_once('config.inc.php');
  10. require_once('Classes/ImageManager.php');
  11.  
  12. $manager new ImageManager($IMConfig);
  13. $dirs $manager->getDirs();
  14.  
  15. ?>
  16. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  17.  
  18. <html>
  19. <head>
  20. <title><?php echo get_lang('InsertImage')?></title>
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  22. <link href="assets/manager.css" rel="stylesheet" type="text/css" />    
  23.  
  24. <script type="text/javascript">
  25.  
  26.     var thumbdir = "<?php echo $IMConfig['thumbnail_dir']?>";
  27.     var base_url = "<?php echo $manager->getBaseURL()?>";
  28.     var server_name = "<?php echo $IMConfig['server_name']?>";
  29.     
  30.     <?php
  31.     //It's a teacher
  32.         if(api_is_allowed_to_edit())
  33.         {
  34.             echo "window.resizeTo(600, 500);";
  35.         }
  36.         else{
  37.             echo "window.resizeTo(600, 125);";
  38.         }
  39.     ?>
  40.  
  41.     if(window.opener.ImageManager && window.opener.ImageManager.I18N)
  42.     {
  43.         I18N = window.opener.ImageManager.I18N;
  44.     }
  45.  
  46.     // language object not found?
  47.     if (!this.I18N)
  48.     {
  49.         // Read it now - copy in next script block
  50.         document.write('<script type="text/javascript" src="lang/' + window.opener._editor_lang + '.js"><\/script>');
  51.     }
  52.     
  53.     function showAdvancedSettings(){
  54.         if(document.getElementById("advanced_settings").style.display=="none"){
  55.             document.getElementById("advanced_settings").style.display="block";
  56.         }
  57.         else{
  58.             document.getElementById("advanced_settings").style.display="none";
  59.         }
  60.     }
  61.     
  62. </script>
  63.  
  64. <script type="text/javascript">
  65.  
  66.     // now copy the language object of the included script - needed a seperate new script block to be able to do so
  67.     if (!this.I18N)
  68.     {
  69.         I18N = this.ImageManager.I18N;
  70.     }
  71.  
  72. </script>
  73.  
  74. <script type="text/javascript" src="assets/popup.js"></script>
  75. <script type="text/javascript" src="assets/dialog.js"></script>
  76. <script type="text/javascript" src="assets/manager.js"></script>
  77.  
  78. </head>
  79.  
  80. <body>
  81. <div class="title"><?php echo get_lang('InsertImage')?></div>
  82. <form action="images.php<?php if(isset($_GET['uploadPath']&& $_GET['uploadPath']!=""echo "?uploadPath=".$_GET['uploadPath']?>" id="uploadForm" method="post" enctype="multipart/form-data">
  83.  
  84. <fieldset <?php if(!api_is_allowed_to_edit()) echo "style='display: none;'"?>>
  85. <legend><?php echo get_lang('ImageManager')?></legend>
  86. <div class="dirs">
  87.     <label for="dirPath"><?php echo ucwords(get_lang('directory'))?></label>
  88.     <select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)">
  89.     <option value="/">/</option>
  90.         <?php foreach($dirs as $relative=>$fullpath?>
  91.                 <option value="<?php echo rawurlencode($relative)?>"><?php echo $relative?></option>
  92.         <?php ?>
  93.             </select>
  94.             <a href="#" onclick="javascript: goUpDir();" title="<?php echo get_lang('Up')?>">
  95.             <img src="img/btnFolderUp.gif" height="15" width="15" alt="<?php echo get_lang('Up')?>" /></a>
  96.         <?php if($IMConfig['safe_mode'== false && $IMConfig['allow_new_dir']?>
  97.             <a href="#" onclick="newFolder();" title="New Folder">
  98.                 <img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" />
  99.             </a>
  100.         <?php ?>
  101.     <div id="messages" style="display: none;">
  102.     <span id="message"></span>
  103.     <img src="img/dots.gif" width="22" height="12" alt="..." /></div>
  104.     <iframe src="images.php<?php if(isset($_GET['uploadPath']&& $_GET['uploadPath']!=""echo "?uploadPath=".$_GET['uploadPath']?>" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
  105. </div>
  106. </fieldset>
  107.  
  108.  
  109. <!-- image properties -->
  110. <input type="file" name="upload" id="upload"/>&nbsp;<button type="submit" name="submit" onclick="doUpload();"/><?php echo get_lang('Send')?></button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  111.           <button type="button" class="buttons" onclick="return refresh();" style="display: none"><?php echo get_lang('Regresh')?></button>
  112.           <button type="button" class="buttons" onclick="return onOK();"><?php echo get_lang('Ok')?></button>
  113.           <button type="button" class="buttons" onclick="return onCancel();"><?php echo get_lang('Cancel')?></button>
  114.           <?php
  115.           
  116.           if(api_is_allowed_to_edit()){
  117.           ?>
  118.               <span style="cursor: pointer" onclick="showAdvancedSettings();"><?php echo utf8_encode(get_lang('AdvancedSettings'));?></span>
  119.               
  120.           <?php
  121.           }
  122.           ?>
  123.           
  124.     <table class="inputTable" style="display: none" id="advanced_settings">
  125.         <tr>
  126.             <td align="right">            
  127.                 <label for="f_url"><?php echo get_lang('ImageFile')?></label></td>                
  128.             <td>
  129.                 <input type="text" id="f_url" class="largelWidth" value="" /></td>
  130.             <td rowspan="3" align="right">&nbsp;</td>
  131.             <td align="right">
  132.             
  133.             <label for="f_width"><?php echo get_lang('Width')?></label></td>
  134.             
  135.             <td><input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/></td>
  136.             <td rowspan="2" align="right"><img src="img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" /></td>
  137.             <td rowspan="3" align="right">&nbsp;</td>            
  138.             <td align="right">
  139.             
  140.             <label for="f_vert"><?php echo get_lang('VSpace')?></label></td>
  141.             
  142.             <td><input type="text" id="f_vert" class="smallWidth" value="" /></td>
  143.         </tr>
  144.         <tr>
  145.             <td align="right">
  146.             <label for="f_alt"><?php echo get_lang('Alt')?></label></td>
  147.             
  148.             <td><input type="text" id="f_alt" class="largelWidth" value="" /></td>
  149.             <td align="right">
  150.             <label for="f_height"><?php echo get_lang('Height')?></label></td>
  151.             
  152.             <td><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/></td>
  153.             <td align="right">
  154.             <label for="f_horiz"><?php echo get_lang('HSpace')?></label></td>
  155.             
  156.             <td><input type="text" id="f_horiz" class="smallWidth" value="" /></td>
  157.         </tr>
  158.         <tr>
  159. <?php if($IMConfig['allow_upload'== true?>
  160.             
  161. <?php else ?>
  162.             <td colspan="2"></td>
  163. <?php ?>
  164.             <td align="right"><label for="f_align"><?php echo get_lang('Align')?></label></td>
  165.             <td colspan="2">
  166.                 <select size="1" id="f_align"  title="Positioning of this image">
  167.                   <option value=""                             >Not Set</option>
  168.                   <option value="left"                         >Left</option>
  169.                   <option value="right"                        >Right</option>
  170.                   <option value="texttop"                      >Texttop</option>
  171.                   <option value="absmiddle"                    >Absmiddle</option>
  172.                   <option value="baseline" selected="selected" >Baseline</option>
  173.                   <option value="absbottom"                    >Absbottom</option>
  174.                   <option value="bottom"                       >Bottom</option>
  175.                   <option value="middle"                       >Middle</option>
  176.                   <option value="top"                          >Top</option>
  177.                 </select>
  178.             </td>
  179.             <td align="right"><label for="f_border"><?php echo get_lang('Border')?></label></td>
  180.             <td><input type="text" id="f_border" class="smallWidth" value="" /></td>
  181.         </tr>
  182.         <tr>
  183.          <td colspan="4" align="right">
  184.                 <input type="hidden" id="orginal_width" />
  185.                 <input type="hidden" id="orginal_height" />
  186.             <input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" />
  187.           </td>
  188.           <td colspan="5"><label for="constrain_prop"><?php echo get_lang('ConstrainProportions')?></label></td>
  189.       </tr>
  190.     </table>
  191.  
  192.     <input type="hidden" id="f_file" name="f_file" />
  193. </form>
  194. </body>
  195. </html>

Documentation generated on Thu, 12 Jun 2008 14:04:47 -0500 by phpDocumentor 1.4.1