Parcourir la source

[svn r9950] coding standards: replace <? with <?php
http://www.dokeos.com/forum/viewtopic.php?t=7570

Patrick Cool il y a 18 ans
Parent
commit
2cac1c2624

+ 16 - 16
main/inc/lib/fckeditor/editor/plugins/ImageManager/editor.php

@@ -219,32 +219,32 @@ $editor = new ImageEditor($manager, $IMConfig);
 	</div>
 	<div id="tools_save" style="display:none;">
 
-<? if($IMConfig['demo'] != true) { ?>
+<?php if($IMConfig['demo'] != true) { ?>
 
 		<div id="tool_inputs">
 
-	<? if($IMConfig['allow_newFileName'] == true) { ?>
-			<label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<? if($IMConfig['allow_overwrite'] == false){ echo $editor->getDefaultSaveFile(); }else{ echo basename($_GET['img']); } ?>" />
-	<? }else{ ?>
-			<input type="hidden" id="save_filename" value="<? echo basename($_GET['img']); ?>" />
-	<? } ?>
+	<?php if($IMConfig['allow_newFileName'] == true) { ?>
+			<label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<?php if($IMConfig['allow_overwrite'] == false){ echo $editor->getDefaultSaveFile(); }else{ echo basename($_GET['img']); } ?>" />
+	<?php }else{ ?>
+			<input type="hidden" id="save_filename" value="<?php echo basename($_GET['img']); ?>" />
+	<?php } ?>
 
 	<?
 	$pos = strrpos($_GET['img'], ".");
 	$ext = substr($_GET['img'], $pos + 1);
 	?>
-			<select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle; <? if($IMConfig['allow_newFileName'] != true && $ext != "jpg" && $ext != "jpeg") {echo "display: none;";} ?>" onchange="updateFormat(this)">
+			<select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle; <?php if($IMConfig['allow_newFileName'] != true && $ext != "jpg" && $ext != "jpeg") {echo "display: none;";} ?>" onchange="updateFormat(this)">
             <option value="" selected>Image Format</option>
             <option value="">---------------------</option>
             <option value="jpeg,85">JPEG High</option>
             <option value="jpeg,60">JPEG Medium</option>
             <option value="jpeg,35">JPEG Low</option>
-			<? if($IMConfig['allow_newFileName'] == true){ ?>
+			<?php if($IMConfig['allow_newFileName'] == true){ ?>
             <option value="png">PNG</option>
-			<?    if($editor->isGDGIFAble() != -1) { ?>
+			<?php    if($editor->isGDGIFAble() != -1) { ?>
             <option value="gif">GIF</option>
-			<?    } ?>
-			<? } ?>
+			<?php    } ?>
+			<?php } ?>
 			</select>
 
 			<label>Quality:</label>
@@ -263,21 +263,21 @@ $editor = new ImageEditor($manager, $IMConfig);
 		</div>	
 		<a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
 
-	<? }else{ ?>
+	<?php }else{ ?>
 
 		<div id="tool_inputs" style="text-align: center; width: 90%; font-size: 150%; font-weight: bold; letter-spacing: 3px; color: #474767;">
 			<label>Demo</label>
 		</div>	
 
-	<? } ?>
+	<?php } ?>
 
 	</div>	
 </div>
 <div id="toolbar">
 	<div id="buttons">
 
-		<a href="javascript:toggle('replace')" id="icon_replace" title="Replace" <? if($IMConfig['allow_replace'] == false) { echo "style=\"display: none;\""; } ?> ><img src="img/replace.gif" height="20" width="20" alt="Replace" /><span>Replace</span></a>
-		<a href="javascript:toggle('watermark')" id="icon_watermark" title="Watermark" <? if(empty($IMConfig['watermarks'])) { echo "style=\"display: none;\""; } ?> ><img src="img/watermark.gif" height="20" width="20" alt="Watermark" /><span>Watermark</span></a>
+		<a href="javascript:toggle('replace')" id="icon_replace" title="Replace" <?php if($IMConfig['allow_replace'] == false) { echo "style=\"display: none;\""; } ?> ><img src="img/replace.gif" height="20" width="20" alt="Replace" /><span>Replace</span></a>
+		<a href="javascript:toggle('watermark')" id="icon_watermark" title="Watermark" <?php if(empty($IMConfig['watermarks'])) { echo "style=\"display: none;\""; } ?> ><img src="img/watermark.gif" height="20" width="20" alt="Watermark" /><span>Watermark</span></a>
 		<a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a>
 		<a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a>
 		<a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a>
@@ -288,7 +288,7 @@ $editor = new ImageEditor($manager, $IMConfig);
 </div>
 <div id="contents">
 <div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
-<iframe src="editorFrame.php?img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe>
+<iframe src="editorFrame.php?img=<?php if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor" scrolling="auto" title="Image Editor" frameborder="0"></iframe>
 </div>
 <div id="bottom"></div>
 </body>

+ 9 - 9
main/inc/lib/fckeditor/editor/plugins/ImageManager/editorFrame.php

@@ -101,8 +101,8 @@
 
 <script type="text/javascript">
 
-	var mode = "<? echo $editor->getAction(); ?>" //crop, scale, measure
-	var currentImageFile = "<? if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
+	var mode = "<?php echo $editor->getAction(); ?>" //crop, scale, measure
+	var currentImageFile = "<?php if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
 
 	if(window.top)
 	{
@@ -243,23 +243,23 @@
 <body>
 <div id="status"></div>
 <div id="ant" class="selection" style="visibility:hidden"><img src="img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div>
-<? if ($editor->isGDEditable() == -1) { ?>
+<?php if ($editor->isGDEditable() == -1) { ?>
 	<div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div>
-<? } ?>
+<?php } ?>
 <table height="100%" width="100%">
 	<tr>
 		<td>
-<? if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?>
+<?php if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?>
 
-		<div id="background" name="background" style="margin: auto; width: <? echo $imageInfo['width']; ?>px; height: <? echo $imageInfo['height']; ?>px; background-image: url(<? echo $imageInfo['src']; ?>);">
+		<div id="background" name="background" style="margin: auto; width: <?php echo $imageInfo['width']; ?>px; height: <?php echo $imageInfo['height']; ?>px; background-image: url(<?php echo $imageInfo['src']; ?>);">
 			<img name="floater" id="floater" style="width: 150px; height: 150px; behavior: url('assets/pngbehavior.htc'); position: absolute" src="<?= $IMConfig['base_url'] . $IMConfig['watermarks'][0] ?>" />
 		</div>
 
-		<span id="imgCanvas" name="imgCanvas" class="crop" style="display: none;"><img src="<? echo $imageInfo['src']; ?>" <? echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage" /></span>
+		<span id="imgCanvas" name="imgCanvas" class="crop" style="display: none;"><img src="<?php echo $imageInfo['src']; ?>" <?php echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage" /></span>
 
-<? } else { ?>
+<?php } else { ?>
 				<span class="error">No Image Available</span>
-<? } ?>
+<?php } ?>
 		</td>
 	</tr>
 </table>

+ 22 - 22
main/inc/lib/fckeditor/editor/plugins/ImageManager/images.php

@@ -54,15 +54,15 @@ function drawFiles($list, &$manager)
 	foreach($list as $entry => $file) 
 	{ ?>
 		<td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
-		<a href="javascript:;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);"title="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"><img src="<? echo $manager->getThumbnail($file['relative']); ?>" alt="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"/></a>
+		<a href="javascript:;" onclick="selectImage('<?php echo $file['relative'];?>', '<?php echo $entry; ?>', <?php echo $file['image'][0];?>, <?php echo $file['image'][1]; ?>);"title="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"><img src="<?php echo $manager->getThumbnail($file['relative']); ?>" alt="<?php echo $entry; ?> - <?php echo Files::formatSize($file['stat']['size']); ?>"/></a>
 		</td></tr><tr><td class="edit">
-		<? if($IMConfig['allow_delete'] == true) { ?>
-			<a href="images.php?dir=<? echo $relative; ?>&amp;delf=<? echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<? echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
-		<? } ?>
-			<a href="javascript:;" title="Edit" onclick="editImage('<? echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>
-		<? if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?>
+		<?php if($IMConfig['allow_delete'] == true) { ?>
+			<a href="images.php?dir=<?php echo $relative; ?>&amp;delf=<?php echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<?php echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
+		<?php } ?>
+			<a href="javascript:;" title="Edit" onclick="editImage('<?php echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>
+		<?php if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?>
 		</td></tr></table></td> 
-	  <? 
+	  <?php 
 	}//foreach
 }//function drawFiles
 
@@ -77,14 +77,14 @@ function drawDirs($list, &$manager)
 	foreach($list as $path => $dir) 
 	{ ?>
 		<td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
-		<a href="images.php?dir=<? echo rawurlencode($path); ?>" onclick="updateDir('<? echo $path; ?>')" title="<? echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<? echo $dir['entry']; ?>" /></a>
+		<a href="images.php?dir=<?php echo rawurlencode($path); ?>" onclick="updateDir('<?php echo $path; ?>')" title="<?php echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<?php echo $dir['entry']; ?>" /></a>
 		</td></tr><tr>
 		<td class="edit">
-			<a href="images.php?dir=<? echo $relative; ?>&amp;deld=<? echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<? echo $dir['entry']; ?>', <? echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
-			<? echo $dir['entry']; ?>
+			<a href="images.php?dir=<?php echo $relative; ?>&amp;deld=<?php echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<?php echo $dir['entry']; ?>', <?php echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
+			<?php echo $dir['entry']; ?>
 		</td>
 		</tr></table></td>
-	  <? 
+	  <?php 
 	} //foreach
 }//function drawDirs
 
@@ -111,7 +111,7 @@ function drawErrorBase(&$manager)
 ?>
 <table width="100%">
   <tr>
-    <td class="error">Invalid base directory: <? echo $manager->config['base_dir']; ?></td>
+    <td class="error">Invalid base directory: <?php echo $manager->config['base_dir']; ?></td>
   </tr>
 </table>
 <?	
@@ -145,7 +145,7 @@ function drawErrorBase(&$manager)
 		hideMessage();
 		var topDoc = window.top.document;
 
-<? 
+<?php 
 	//we need to refesh the drop directory list
 	//save the current dir, delete all select options
 	//add the new list, re-select the saved dir.
@@ -159,10 +159,10 @@ function drawErrorBase(&$manager)
 		while(selection.length > 0)
 		{	selection.remove(0); }
 		
-		selection.options[selection.length] = new Option("/","<? echo rawurlencode('/'); ?>");	
-		<? foreach($dirs as $relative=>$fullpath) { ?>
-		selection.options[selection.length] = new Option("<? echo $relative; ?>","<? echo rawurlencode($relative); ?>");		
-		<? } ?>
+		selection.options[selection.length] = new Option("/","<?php echo rawurlencode('/'); ?>");	
+		<?php foreach($dirs as $relative=>$fullpath) { ?>
+		selection.options[selection.length] = new Option("<?php echo $relative; ?>","<?php echo rawurlencode($relative); ?>");		
+		<?php } ?>
 		
 		for(var i = 0; i < selection.length; i++)
 		{
@@ -173,7 +173,7 @@ function drawErrorBase(&$manager)
 				break;
 			}
 		}		
-<? } ?>
+<?php } ?>
 	}	
 
 	function editImage(image) 
@@ -196,14 +196,14 @@ function drawErrorBase(&$manager)
 </head>
 
 <body>
-<? if ($manager->isValidBase() == false) { drawErrorBase($manager); } 
+<?php if ($manager->isValidBase() == false) { drawErrorBase($manager); } 
 	elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?>
 <table>
 	<tr>
-	<? drawDirs($list[0], $manager); ?>
-	<? drawFiles($list[1], $manager); ?>
+	<?php drawDirs($list[0], $manager); ?>
+	<?php drawFiles($list[1], $manager); ?>
 	</tr>
 </table>
-<? } else { drawNoResults(); } ?>
+<?php } else { drawNoResults(); } ?>
 </body>
 </html>

+ 11 - 11
main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php

@@ -24,9 +24,9 @@
 <script type="text/javascript">
 /*<![CDATA[*/
 
-	var thumbdir = "<? echo $IMConfig['thumbnail_dir']; ?>";
-	var base_url = "<? echo $manager->getBaseURL(); ?>";
-	var server_name = "<? echo $IMConfig['server_name']; ?>";
+	var thumbdir = "<?php echo $IMConfig['thumbnail_dir']; ?>";
+	var base_url = "<?php echo $manager->getBaseURL(); ?>";
+	var server_name = "<?php echo $IMConfig['server_name']; ?>";
 
 	window.resizeTo(600, 460);
 
@@ -71,14 +71,14 @@
 	<label for="dirPath">Directory</label>
 	<select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)">
 	<option value="/">/</option>
-<? foreach($dirs as $relative=>$fullpath) { ?>
-		<option value="<? echo rawurlencode($relative); ?>"><? echo $relative; ?></option>
-<? } ?>
+<?php foreach($dirs as $relative=>$fullpath) { ?>
+		<option value="<?php echo rawurlencode($relative); ?>"><?php echo $relative; ?></option>
+<?php } ?>
 	</select>
 	<a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a>
-<? if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
+<?php if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
 	<a href="#" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a>
-<? } ?>
+<?php } ?>
 	<div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
 	<iframe src="images.php" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
 </div>
@@ -105,7 +105,7 @@
 			<td><input type="text" id="f_horiz" class="smallWidth" value="" /></td>
 		</tr>
 		<tr>
-<? if($IMConfig['allow_upload'] == true) { ?>
+<?php if($IMConfig['allow_upload'] == true) { ?>
 			<td align="right"><label for="upload">Upload</label></td>
 			<td>
 				<table cellpadding="0" cellspacing="0" border="0">
@@ -115,9 +115,9 @@
                   </tr>
                 </table>
 			</td>
-<? } else { ?>
+<?php } else { ?>
 			<td colspan="2"></td>
-<? } ?>
+<?php } ?>
 			<td align="right"><label for="f_align">Align</label></td>
 			<td colspan="2">
 				<select size="1" id="f_align"  title="Positioning of this image">