function camp_is_image_file($p_fileName) { $extension = strtolower(pathinfo($p_fileName, PATHINFO_EXTENSION)); return in_array($extension, camp_get_image_extensions()); } // fn camp_is_image_file
<?php if ($g_user->hasPermission("DeleteTempl") && is_writable($Campsite['TEMPLATE_DIRECTORY'].$f_path)) { ?> <table class="box_table"> <tr> <td align="left" colspan="2"> <form method="POST" action="do_replace.php" onsubmit="return <?php camp_html_fvalidate(); ?>;" ENCTYPE="multipart/form-data" > <?php echo SecurityToken::FormParameter(); ?> <input type="hidden" name="f_path" value="<?php p(htmlspecialchars($f_path)); ?>"> <input type="hidden" name="f_old_name" value="<?php p(htmlspecialchars($f_name)); ?>"> <table > <tr> <td> <b><?php putGS("Replace current with:"); ?></b> <input type="FILE" name="f_file" class="input_file" alt="file|<?php echo implode(",",camp_get_text_extensions()).",".implode(",", camp_get_image_extensions()); ?>" emsg="<?php putGS("You must select a file to upload."); ?>"> </td> <td> <input type="submit" name="replace" value="<?php putGS("Replace"); ?>" class="button"> </td> </tr> </table> </form> </td> </tr> </table> <?php } ?> </td> </tr> </table>