Beispiel #1
0
function printEntryFileUploadButton($entryId)
{
    $context = Model_Context::getInstance();
    $blogid = getBlogId();
    ?>
											<script type="text/javascript">
												//<![CDATA[

													var fileUploadNestOriginal = false;

													function makeCrossDamainSubmit(uri,userAgent) {
														var property =new Array();
														property['ie'] = new Array();
														property['ie']['width'] = '225px';
														property['ie']['height'] = '25px';

														property['moz'] = new Array();
														property['moz']['width'] = '215px';
														property['moz']['height'] = '22px';

														property['etc'] = new Array();
														property['etc']['width'] = '240px';
														property['etc']['height'] = '22px';

														if(fileUploadNestOriginal == false) {
															fileUploadNestOriginal = document.getElementById('fileUploadNest').innerHTML;
														}
														var str = '<iframe id="attachHiddenNest" src="' + uri + '" style="display: block; height: ' + property[userAgent]['height']+'; width: ' + property[userAgent]['width'] + ';" frameborder="no" scrolling="no"><\/iframe>';
														document.getElementById('fileUploadNest').innerHTML = str + fileUploadNestOriginal;
														/*if (document.getElementById('attachHiddenNest_' + (attachId - 1))) {
															document.getElementById('attachHiddenNest_' + (attachId - 1)).style.display = "none";
															document.getElementById('attachHiddenNest_' + (attachId - 1)).style.width = 0;
															document.getElementById('attachHiddenNest_' + (attachId - 1)).style.height = 0;
														}
														attachId++;*/
													}

													function refreshUploadButton() {
														if (getUploadObj()) {

														} else {
															if(isIE) {
																makeCrossDamainSubmit(blogURL + "/owner/entry/attach/" + entryManager.entryId,"ie");
															} else if(isMoz) {
																makeCrossDamainSubmit(blogURL + "/owner/entry/attach/" + entryManager.entryId,"moz");
															} else {
																makeCrossDamainSubmit(blogURL + "/owner/entry/attach/" + entryManager.entryId,"etc");
															}
														}
													}
												//]]>
											</script>
										<div id="fileUploadNest" class="container">
											<div id="fileSize">
<?php 
    echo getAttachmentSizeLabel($blogid, $entryId);
    ?>
											</div>
											<div id="fileDownload" class="system-message" style="display: none;"></div>
										</div>
										<script type="text/javascript">
										//<![CDATA[
										if (!DetectFlashVer(8, 0, 0) || !(isIE || isMoz || isMinSafari3) || <?php 
    echo $context->getProperty('service.flashuploader', true) ? 'false' : 'true';
    ?>
) {
											var deleteButtonContainer = document.getElementById('fileUploadNest');
											deleteButtonContainer.innerHTML = '<input type="button" id="deleteBtn" class="input-button" value="<?php 
    echo _t('삭제하기');
    ?>
" onclick="deleteAttachment();return false" />' + deleteButtonContainer.innerHTML;
											deleteButtonContainer.style.marginTop = '5px';
										}
										//]]>
										</script>
<?php 
}
Beispiel #2
0
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('parent' => array('int')));
require ROOT . '/library/preprocessor.php';
requireModel('blog.attachment');
$result = getAttachmentSizeLabel($blogid, $_GET['parent']);
Respond::PrintResult(array('error' => empty($result) ? 1 : 0, 'result' => $result));
?>