?? image.php
字號:
var CURRENT_HIGHLIGHT
function highlight(srcElement) {
if (CURRENT_HIGHLIGHT) {
CURRENT_HIGHLIGHT.style.backgroundColor='';
CURRENT_HIGHLIGHT.style.color='#003399';
}
srcElement.style.backgroundColor = 'highlight';
srcElement.style.color = 'highlighttext';
CURRENT_HIGHLIGHT = srcElement;
}
function insert_image() {
parentWindow.<?php
if (!empty($return_function)) {
echo $return_function.'(';
} else {
echo 'wp_create_image_html(obj,';
} ?>document.image_form.imagename.value, document.image_form.iwidth.value, document.image_form.iheight.value, '', '', '');
top.window.close();
return false;
}
function moreoptions() {
if (document.getElementById('options').disabled == true) {
return;
}
if (document.image_form.imagename.value == '') {
alert('<?php echo $lang['select_image_first']; ?>');
document.getElementById('options').disabled = true;
return;
} else {
document.location.replace('<?php echo WP_WEB_DIRECTORY; ?>imageoptions.php?lang=<?php echo $lang_include; ?>&image=' + document.image_form.imagename.value + '&width=' + document.image_form.iwidth.value +'&height=' + document.image_form.iheight.value + '&alt=&align=&mtop=&mbottom=&mleft=&mright=&border=')
}
}
function preview(url) {
if (url!='') {
url = make_url_with_base (url);
if (wp_is_ie) {
document.frames('preview').location.replace(url);
} else {
document.getElementById('preview').contentWindow.location.replace(url);
}
} else {
if (wp_is_ie) {
document.frames('preview').location.replace('<?php echo WP_WEB_DIRECTORY; ?>no_preview.php?lang=<?php echo $lang_include; ?>');
} else {
document.getElementById('preview').contentWindow.location.replace('<?php echo WP_WEB_DIRECTORY; ?>no_preview.php?lang=<?php echo $lang_include; ?>');
}
}
}
function localImage(image,do_preview,iwidth,iheight,isize) {
document.image_form.imagename.value=image;
document.image_form.imagename.value = image
document.image_form.iwidth.value=iwidth;
document.getElementById('width').innerHTML = '<?php echo $lang['width']; ?> ' + iwidth + 'px';
document.image_form.iheight.value=iheight;
document.getElementById('height').innerHTML = '<?php echo $lang['height']; ?> ' + iheight + 'px';
document.getElementById('size').innerHTML = '<?php echo $lang['size']; ?> ' + isize;
if (do_preview == 0) {
if (wp_is_ie) {
document.frames('preview').location.replace('<?php echo WP_WEB_DIRECTORY; ?>no_preview.php?lang=<?php echo $lang_include; ?>');
} else {
document.getElementById('preview').contentWindow.location.replace('<?php echo WP_WEB_DIRECTORY; ?>no_preview.php?lang=<?php echo $lang_include; ?>');
}
} else {
preview(image);
}
if (document.getElementById('options')) {
document.getElementById('options').disabled = false;
}
if (document.getElementById('ok')) {
document.getElementById('ok').focus()
}
}
function doConfirm(url,msg) {
if (confirm(msg)){
document.location.assign(url)
}
}
function upload_check() {
if (document.getElementById('image_field').value == '') {
alert("<?php echo $lang['click_browse']; ?>")
document.getElementById('image_field').focus();
return false;
} else {
return true;
}
}
function showUploadMessage() {
document.getElementById('uploadMessage').style.display = 'block'
}
function hideUploadMessage() {
document.getElementById('uploadMessage').style.display = 'none'
}
function cancelUpload() {
if (wp_is_ie) {
try {
document.execCommand('stop');
} catch (e) {
document.location.reload();
}
} else {
window.stop();
}
hideUploadMessage()
}
//-->
</script>
<?php
// script to make any uploaded images currently selected
if (!empty($name2)) {
echo '<script type="text/javascript">
<!--// Begin
function uploadedimage() {
localImage("'.$web_directory.$name2.'", 1, "'.$width.'", "'.$height.'", "'.$fsize.'");
highlight(document.getElementById("'.$web_directory.$name2.'"));
document.getElementById("'.$web_directory.$name2.'").focus();
}
// End -->
</script>
';
} else {
echo '<script type="text/javascript">
<!--// Begin
function uploadedimage() {
return true;
}
// End -->
</script>
';
}
?>
</head>
<body scroll="no" onLoad="uploadedimage(); hideLoadMessage();">
<?php include('./includes/load_message.php'); ?>
<div align="center" id="uploadMessage">
<table width="100%" height="90%">
<tr>
<td align="center" valign="middle"><div id="uploadMessageText"><?php echo $lang['upload_in_progress']; ?> <?php echo $lang['please_wait']; ?><br><br>
<img src="images/load_bar.gif" height="12" width="251" alt="" class="inset"><br><br>
<input class="button" type="button" value="<?php echo $lang['cancel']; ?>" onClick="cancelUpload()"></div></td>
</tr>
</table>
</div>
<div class="dialog_content">
<div style="height:22px">
<?php
if ($message) {echo $message;} else {echo ' ';}
?>
</div>
<table border="0" cellpadding="1" cellspacing="3">
<tr>
<td rowspan="10" valign="top"> <fieldset>
<legend><?php echo $lang['select_image']; ?></legend>
<div align="left"> <?php echo $lang['looking_in'] ; ?> <input class="disabledtextbox" type="text" name="imagename" value="<?php echo $web_directory.$folderpath; ?>" style="width:292px" readonly="readonly">
</div>
<table width="360" border="0" cellpadding="0" cellspacing="0" style="background-color:threedshadow;">
<tr>
<td> <p>
<?php
if ($folderpath != '') {
$array = explode ('/',$folderpath);
$array[sizeof($array)-1] = NULL;
$array[sizeof($array)-2] = NULL;
$foo = implode ('/', $array);
while (substr ($foo, strlen ($foo) - 1) == '/') {
$foo = substr ($foo, 0, strlen ($foo) - 1);
}
?>
<a style="color:highlighttext" href="<?php echo WP_WEB_DIRECTORY; ?>image.php<?php echo str_replace('folder='.$folderpath, 'folder='.$foo, $query_string) ?>">
<img src="<?php echo WP_WEB_DIRECTORY; ?>images/up.gif" width="23" height="22" alt="<?php echo $lang['up_one_level']; ?>" title="<?php echo $lang['up_one_level']; ?>" border="0" align="absmiddle"><?php echo $lang['parent_directory']; ?></a>
<?php
} else {
?>
<img src="<?php echo WP_WEB_DIRECTORY; ?>images/spacer.gif" width="23" height="22" alt="" border="0" align="absmiddle">
<?php
}
if ($create_directories) { ?>
</p></td>
<td align="right"> <p> <a style="color:highlighttext" href="<?php echo WP_WEB_DIRECTORY; ?>image.php<?php echo $query_string ?>&action=create_dir"><img src="<?php echo WP_WEB_DIRECTORY; ?>images/newfolder.gif" width="23" height="22" alt="<?php echo $lang['new_folder']; ?>" title="<?php echo $lang['new_folder']; ?>" border="0" align="absmiddle"><?php echo $lang['new_folder']; ?></a>
<?php } ?>
</p></td>
</tr>
</table>
<table width="360px" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fileBar" width="190"><p><a href="<?php echo WP_WEB_DIRECTORY; ?>image.php<?php echo str_replace(array('sort_by='.$sort_by,'sort_dir='.$sort_dir), array('sort_by=name','sort_dir='.$name_sort_dir), $query_string) ?>"><?php echo $lang['name']; ?> <?php echo $name_arrow ?></a></p></td>
<td class="fileBar" width="100"><p><a href="<?php echo WP_WEB_DIRECTORY; ?>image.php<?php echo str_replace(array('sort_by='.$sort_by,'sort_dir='.$sort_dir), array('sort_by=type','sort_dir='.$type_sort_dir), $query_string) ?>"><?php echo $lang['type']; ?> <?php echo $type_arrow ?></a></p></td>
<td class="fileBar" width="70" style="border-right: 1px solid threedshadow"><p><?php echo $lang['action']; ?></p>
<p></p></td>
</tr>
</table>
<div class="inset" style="height:315; width:100%; overflow:auto; background-color:#FFFFFF">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<?php
display_folders();
display_files();
?>
</table>
</div>
</fieldset></td>
<td rowspan="3"> </td>
<td colspan="3" valign="top">
<?php if ($upload_files) {?>
<fieldset>
<legend><?php echo $lang['upload_an_image']; ?></legend>
<form style="display:inline" enctype="multipart/form-data" action="<?php echo WP_WEB_DIRECTORY; ?>image.php" method="post" onsubmit="showUploadMessage()">
<input name="image_field" id="image_field" type="file" size="30" title="<?php echo $lang['click_browse']; ?>">
<input type="submit" class="button" value="<?php echo $lang['upload_file']; ?>" onClick="return upload_check()">
<?php echo $query_inputs; ?>
</form>
<p><?php echo wp_var_replace($lang['images_must_be'],array('max_size'=>$max_file_size/1000,'max_width'=>$max_image_width,'max_height'=>$max_image_height)) ?></p>
</fieldset>
<?php } else { echo ' '; }?>
</td>
</tr>
<tr>
<td colspan="3" align="right" valign="top"> <div align="center">
<iframe id="preview" width="99%" height="170" frameborder="0" marginheight="0" marginwidth="0" class="previewWindow" src="<?php echo WP_WEB_DIRECTORY; ?>blank.php?lang=<?php echo $lang_include; ?>"></iframe>
</div></td>
</tr>
<tr>
<td colspan="3" valign="top"> <form name="image_form" id="image_form" style="display:inline" onsubmit="return insert_image()">
<fieldset>
<legend><?php echo $lang['image_information']; ?></legend>
<table height="60" border="0" cellspacing="3" cellpadding="1">
<tr>
<td><?php echo $lang['source']; ?></td>
<td width="100%"><input type="text" name="imagename" id="imagename" value="" style="width:220px" title="<?php echo $lang['type_image_address']; ?>">
</td>
</tr>
<tr>
<td colspan="2"><span id="width"> </span> <input type="hidden" name="iwidth" size="4">
<span id="height"> </span> <input type="hidden" name="iheight" id="iheight" size="4">
<span id="size"> </span></td>
</tr>
</table>
</fieldset>
<div align="center">
<?php
if ($in_wp) {
?>
<p> </p>
<button id="ok" type="submit"><?php echo $lang['ok']; ?></button>
<button type="button" onClick="parent.window.close();"><?php echo $lang['cancel']; ?></button>
<script type="text/javascript">
<!--//
if (!parentWindow.image_action) {
document.write('<button disabled type="button" id="options" onClick="moreoptions()"><?php echo $lang['next']; ?></button>')
}
//-->
</script>
<?php } ?>
</div>
</form></td>
</tr>
</table>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -