本文整理汇总了PHP中OOMedia::_getFormattedSize方法的典型用法代码示例。如果您正苦于以下问题:PHP OOMedia::_getFormattedSize方法的具体用法?PHP OOMedia::_getFormattedSize怎么用?PHP OOMedia::_getFormattedSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OOMedia
的用法示例。
在下文中一共展示了OOMedia::_getFormattedSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rex_image
function rex_image($filepath)
{
global $REX;
// ----- check params
if (!file_exists($filepath)) {
$this->sendError('Imagefile does not exist - ' . $filepath);
exit;
}
// ----- check filesize
$max_file_size = $REX['ADDON']['image_manager']['max_resizekb'] * 1024;
$filesize = filesize($filepath);
if ($filesize > $max_file_size) {
$error = 'Imagefile is to big.';
$error .= ' Only files < ' . $REX['ADDON']['image_manager']['max_resizekb'] . 'kb are allowed';
$error .= '- ' . $filepath . ', ' . OOMedia::_getFormattedSize($filesize);
$this->sendError($error);
exit;
}
// ----- imagepfad speichern
$this->img = array();
$this->img['file'] = basename($filepath);
$this->img['filepath'] = $filepath;
$this->img['quality'] = $REX['ADDON']['image_manager']['jpg_quality'];
$this->img['format'] = strtoupper(OOMedia::_getExtension($this->img['filepath']));
}
示例2: elseif
}
$thumbnail = '<img src="' . $icon_src . '" width="44" height="38" alt="' . $alt . '" title="' . $alt . '" />';
if (OOMedia::_isImage($file_name) && $thumbs) {
$thumbnail = '<img src="' . $REX['HTDOCS_PATH'] . 'files/' . $file_name . '" width="80" alt="' . $alt . '" title="' . $alt . '" />';
if ($image_manager) {
$thumbnail = '<img src="' . $REX['HTDOCS_PATH'] . $REX['FRONTEND_FILE'] . '?rex_img_type=rex_mediapool_preview&rex_img_file=' . $encoded_file_name . '" alt="' . $alt . '" title="' . $alt . '" />';
} else {
if ($image_resize) {
$thumbnail = '<img src="' . $REX['HTDOCS_PATH'] . $REX['FRONTEND_FILE'] . '?rex_resize=80a__' . $encoded_file_name . '" alt="' . $alt . '" title="' . $alt . '" />';
}
}
}
}
// ----- get file size
$size = $file_size;
$file_size = OOMedia::_getFormattedSize($size);
if ($file_title == '') {
$file_title = '[' . $I18N->msg('pool_file_notitle') . ']';
}
if ($REX['USER']->hasPerm('advancedMode[]')) {
$file_title .= ' [' . $file_id . ']';
}
// ----- opener
$opener_link = '';
if ($opener_input_field == 'TINYIMG') {
if (OOMedia::_isImage($file_name)) {
$opener_link .= "<a href=\"javascript:insertImage('{$file_name}','" . $files->getValue("title") . "')\">" . $I18N->msg('pool_image_get') . "</a><br>";
}
} elseif ($opener_input_field == 'TINY') {
$opener_link .= "<a href=\"javascript:insertLink('" . $file_name . "');\">" . $I18N->msg('pool_link_get') . "</a>";
} elseif ($opener_input_field != '') {
示例3: rex_medienpool_Mediaform
function rex_medienpool_Mediaform($form_title, $button_title, $rex_file_category, $file_chooser, $close_form)
{
global $I18N, $REX, $REX_USER, $subpage, $ftitle;
$s = '';
$cats_sel = new rex_select();
$cats_sel->setStyle('class="inp100"');
$cats_sel->setSize(1);
$cats_sel->setName('rex_file_category');
$cats_sel->setId('rex_file_category');
$cats_sel->addOption($I18N->msg('pool_kats_no'), "0");
$mediacat_ids = array();
$rootCat = 0;
if ($rootCats = OOMediaCategory::getRootCategories()) {
foreach ($rootCats as $rootCat) {
rex_medienpool_addMediacatOptionsWPerm($cats_sel, $rootCat, $mediacat_ids);
}
}
$cats_sel->setSelected($rex_file_category);
if (isset($msg) and $msg != "") {
$s .= rex_warning($msg);
$msg = "";
}
if (!isset($ftitle)) {
$ftitle = '';
}
$add_file = '';
if ($file_chooser) {
$devInfos = '';
if ($REX_USER->hasPerm('advancedMode[]')) {
$devInfos = '<span class="rex-notice">
<span>' . $I18N->msg('pool_max_uploadsize') . ':</span> ' . OOMedia::_getFormattedSize(rex_ini_get('upload_max_filesize')) . '
<!-- Upload-Temp-Dir: ' . rex_ini_get('upload_tmp_dir') . '
Uploads: ' . (rex_ini_get('file_uploads') == 1 ? 'On' : 'Off') . '<br />
Max-Upload-Time: ' . rex_ini_get('max_input_time') . 's -->
</span>';
}
$add_file = '<p>
<label for="file_new">' . $I18N->msg('pool_file_file') . '</label>
<input type="file" id="file_new" name="file_new" size="30" />
' . $devInfos . '
</p>';
}
$add_submit = '';
if (rex_session('media[opener_input_field]') != '') {
$add_submit = '<input type="submit" class="rex-sbmt" name="saveandexit" value="' . $I18N->msg('pool_file_upload_get') . '"' . rex_accesskey($I18N->msg('pool_file_upload_get'), $REX['ACKEY']['SAVE']) . ' />';
}
$s .= '
<div class="rex-mpl-oth">
<form action="index.php" method="post" enctype="multipart/form-data">
<fieldset>
<legend class="rex-lgnd"><span >' . $form_title . '</span></legend>
<input type="hidden" name="page" value="medienpool" />
<input type="hidden" name="media_method" value="add_file" />
<input type="hidden" name="subpage" value="' . $subpage . '" />
<p>
<label for="ftitle">' . $I18N->msg('pool_file_title') . '</label>
<input type="text" size="20" id="ftitle" name="ftitle" value="' . htmlspecialchars(stripslashes($ftitle)) . '" />
</p>
<p>
<label for="rex_file_category">' . $I18N->msg('pool_file_category') . '</label>
' . $cats_sel->get() . '
</p>
' . $add_file . '
<p class="rex-sbmt">
<input type="submit" name="save" value="' . $button_title . '"' . rex_accesskey($button_title, $REX['ACKEY']['SAVE']) . ' />
' . $add_submit . '
</p>
</fieldset>
';
if ($close_form) {
$s .= '</form></div>' . "\n";
}
return $s;
}
示例4: rex_mediapool_Mediaform
/**
* Ausgabe des Medienpool Formulars
*/
function rex_mediapool_Mediaform($form_title, $button_title, $rex_file_category, $file_chooser, $close_form)
{
global $I18N, $REX, $subpage, $ftitle, $warning, $info;
$s = '';
$cats_sel = new rex_mediacategory_select();
$cats_sel->setStyle('class="rex-form-select"');
$cats_sel->setSize(1);
$cats_sel->setName('rex_file_category');
$cats_sel->setId('rex_file_category');
$cats_sel->addOption($I18N->msg('pool_kats_no'), "0");
$cats_sel->setAttribute('onchange', 'this.form.submit()');
$cats_sel->setSelected($rex_file_category);
if (isset($warning) and $warning != "") {
$s .= rex_warning($warning);
$warning = "";
}
if (isset($info) and $info != "") {
$s .= rex_info($info);
$info = "";
}
if (!isset($ftitle)) {
$ftitle = '';
}
$add_file = '';
if ($file_chooser) {
$devInfos = '';
if ($REX['USER']->hasPerm('advancedMode[]')) {
$devInfos = '<span class="rex-form-notice">
' . $I18N->msg('phpini_settings') . ':<br />
' . (rex_ini_get('file_uploads') == 0 ? '<span>' . $I18N->msg('pool_upload') . ':</span> <em>' . $I18N->msg('pool_upload_disabled') . '</em><br />' : '') . '
<span>' . $I18N->msg('pool_max_uploadsize') . ':</span> ' . OOMedia::_getFormattedSize(rex_ini_get('upload_max_filesize')) . '<br />
<span>' . $I18N->msg('pool_max_uploadtime') . ':</span> ' . rex_ini_get('max_input_time') . 's
</span>';
}
$add_file = '
<div class="rex-form-row">
<p class="rex-form-file">
<label for="file_new">' . $I18N->msg('pool_file_file') . '</label>
<input class="rex-form-file" type="file" id="file_new" name="file_new" size="30" />
' . $devInfos . '
</p>
</div>';
}
$arg_fields = '';
foreach (rex_request('args', 'array') as $arg_name => $arg_value) {
$arg_fields .= '<input type="hidden" name="args[' . $arg_name . ']" value="' . $arg_value . '" />' . "\n";
}
$arg_fields = '';
$opener_input_field = rex_request('opener_input_field', 'string');
if ($opener_input_field != '') {
$arg_fields .= '<input type="hidden" name="opener_input_field" value="' . htmlspecialchars($opener_input_field) . '" />' . "\n";
}
$add_submit = '';
if ($close_form) {
$add_submit = '<input type="submit" class="rex-form-submit" name="saveandexit" value="' . $I18N->msg('pool_file_upload_get') . '"' . rex_accesskey($I18N->msg('pool_file_upload_get'), $REX['ACKEY']['SAVE']) . ' />';
}
$s .= '
<div class="rex-form" id="rex-form-mediapool-other">
<form action="index.php" method="post" enctype="multipart/form-data">
<fieldset class="rex-form-col-1">
<legend>' . $form_title . '</legend>
<div class="rex-form-wrapper">
<input type="hidden" name="page" value="mediapool" />
<input type="hidden" name="media_method" value="add_file" />
<input type="hidden" name="subpage" value="' . $subpage . '" />
' . $arg_fields . '
<div class="rex-form-row">
<p class="rex-form-text">
<label for="ftitle">' . $I18N->msg('pool_file_title') . '</label>
<input class="rex-form-text" type="text" size="20" id="ftitle" name="ftitle" value="' . htmlspecialchars(stripslashes($ftitle)) . '" />
</p>
</div>
<div class="rex-form-row">
<p class="rex-form-select">
<label for="rex_file_category">' . $I18N->msg('pool_file_category') . '</label>
' . $cats_sel->get() . '
</p>
</div>
<div class="rex-clearer"></div>';
// ----- EXTENSION POINT
$s .= rex_register_extension_point('MEDIA_FORM_ADD', '');
$s .= $add_file . '
<div class="rex-form-row">
<p class="rex-form-submit">
<input class="rex-form-submit" type="submit" name="save" value="' . $button_title . '"' . rex_accesskey($button_title, $REX['ACKEY']['SAVE']) . ' />
' . $add_submit . '
</p>
</div>
<div class="rex-clearer"></div>
</div>
</fieldset>
';
if ($close_form) {
//.........这里部分代码省略.........
示例5: getImportDir
</th>
<th colspan="3"><?php
echo $I18N->msg('im_export_function');
?>
</th>
</tr>
</thead>
<tbody>
<?php
$dir = getImportDir();
$files = readImportFolder('.tar.gz');
sort($files);
foreach ($files as $file) {
$filepath = $dir . '/' . $file;
$filec = date('d.m.Y H:i', filemtime($filepath));
$filesize = OOMedia::_getFormattedSize(filesize($filepath));
echo '<tr>
<td>' . $file . '</td>
<td>' . $filesize . '</td>
<td>' . $filec . '</td>
<td><a href="index.php?page=import_export&subpage=import&function=fileimport&impname=' . $file . '" title="' . $I18N->msg('im_export_import_file') . '" onclick="return confirm(\'' . $I18N->msg('im_export_proceed_file_import') . '\')">' . $I18N->msg('im_export_to_import') . '</a></td>
<td><a href="index.php?page=import_export&subpage=import&function=download&impname=' . $file . '" title="' . $I18N->msg('im_export_download_file') . '">' . $I18N->msg('im_export_download') . '</a></td>
<td><a href="index.php?page=import_export&subpage=import&function=delete&impname=' . $file . '" title="' . $I18N->msg('im_export_delete_file') . '" onclick="return confirm(\'' . $I18N->msg('im_export_delete') . ' ?\')">' . $I18N->msg('im_export_delete') . '</a></td>
</tr>';
}
?>
</tbody>
</table>
<div class="rex-clearer"></div>
</div><!-- END rex-area -->