本文整理汇总了PHP中ProductDownload::checkFile方法的典型用法代码示例。如果您正苦于以下问题:PHP ProductDownload::checkFile方法的具体用法?PHP ProductDownload::checkFile怎么用?PHP ProductDownload::checkFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProductDownload
的用法示例。
在下文中一共展示了ProductDownload::checkFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayFormInformations
//.........这里部分代码省略.........
/>
<label for="is_virtual_good" class="t bold"><?php
echo $this->l('Is this a downloadable product?');
?>
</label>
<div id="virtual_good" <?php
if (!$productDownload->id or !$productDownload->active) {
echo 'style="display:none;"';
}
?>
>
<?php
if (!ProductDownload::checkWritableDir()) {
?>
<p class="alert">
<?php
echo $this->l('Your download repository is not writable.');
?>
<br/>
<?php
echo realpath(_PS_DOWNLOAD_DIR_);
?>
</p>
<?php
} else {
?>
<?php
if ($productDownload->id) {
echo '<input type="hidden" id="virtual_product_id" name="virtual_product_id" value="' . $productDownload->id . '" />';
}
?>
<p class="block">
<?php
if (!$productDownload->checkFile()) {
?>
<?php
if ($productDownload->id) {
?>
<p class="alert">
<?php
echo $this->l('This product is missing');
?>
:<br/>
<?php
echo realpath(_PS_DOWNLOAD_DIR_) . '/' . $productDownload->physically_filename;
?>
</p>
<?php
}
?>
<p><?php
echo $this->l('Your server\'s maximum upload file size is') . ': ' . ini_get('upload_max_filesize');
?>
</p>
<?php
if (!strval(Tools::getValue('virtual_product_filename'))) {
?>
<label id="virtual_product_file_label" for="virtual_product_file" class="t"><?php
echo $this->l('Upload a file');
?>
</label>
<input type="file" id="virtual_product_file" name="virtual_product_file" value="" class="" onchange="uploadFile()" maxlength="<?php
echo $this->maxFileSize;
?>
" />
<?php
示例2: displayFormInformations
//.........这里部分代码省略.........
/>
<label for="is_virtual_good" class="t bold" style="color: black;"><?php
echo $this->l('Is this a downloadable product?');
?>
</label></p>
<div id="virtual_good" <?php
if (!$productDownload->id or !$productDownload->active) {
echo 'style="display:none;"';
}
?>
>
<?php
if (!ProductDownload::checkWritableDir()) {
?>
<p class="alert">
<?php
echo $this->l('Your download repository is not writable.');
?>
<br/>
<?php
echo realpath(_PS_DOWNLOAD_DIR_);
?>
</p>
<?php
} else {
?>
<?php
if ($productDownload->id) {
echo '<input type="hidden" id="virtual_product_id" name="virtual_product_id" value="' . $productDownload->id . '" />';
}
?>
<p class="block">
<?php
if (!$productDownload->checkFile()) {
?>
<div style="padding:5px;width:50%;float:left;margin-right:20px;border-right:1px solid #E0D0B1">
<?php
if ($productDownload->id) {
?>
<p class="alert" id="file_missing">
<?php
echo $this->l('This product is missing');
?>
:<br/>
<?php
echo realpath(_PS_DOWNLOAD_DIR_) . '/' . $productDownload->physically_filename;
?>
</p>
<?php
}
?>
<p><?php
$max_upload = (int) ini_get('upload_max_filesize');
$max_post = (int) ini_get('post_max_size');
$upload_mb = min($max_upload, $max_post);
echo $this->l('Your server\'s maximum upload file size is') . ': ' . $upload_mb . $this->l('Mb');
?>
</p>
<?php
if (!strval(Tools::getValue('virtual_product_filename'))) {
?>
<label id="virtual_product_file_label" for="virtual_product_file" class="t"><?php
echo $this->l('Upload a file');
?>
</label>