当前位置: 首页>>代码示例>>PHP>>正文


PHP _t_format_size函数代码示例

本文整理汇总了PHP中_t_format_size函数的典型用法代码示例。如果您正苦于以下问题:PHP _t_format_size函数的具体用法?PHP _t_format_size怎么用?PHP _t_format_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_t_format_size函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PageCodeClear

function PageCodeClear()
{
    global $oAdmTemplate, $oCacheUtilities, $aCacheTypes;
    $sChartData = '';
    foreach ($aCacheTypes as $r) {
        if ('all' == $r['action']) {
            continue;
        }
        $iSize = $oCacheUtilities->size($r['action']);
        $sChartData .= ",\n['" . bx_js_string($r['title'], BX_ESCAPE_STR_APOS) . "', {v:" . $iSize . ", f:'" . bx_js_string(_t_format_size($iSize)) . "'}]";
    }
    $s = $oAdmTemplate->parseHtmlByName('cache.html', array('bx_repeat:clear_action' => $aCacheTypes, 'chart_data' => trim($sChartData, ',')));
    return DesignBoxAdmin(_t('_adm_txt_cache'), $s, $GLOBALS['aTopItems'], '', 11);
}
开发者ID:noormcs,项目名称:studoro,代码行数:14,代码来源:cache.php

示例2: serviceAcceptFile

 function serviceAcceptFile()
 {
     $sResult = '';
     if ($_FILES) {
         for ($i = 0; $i < count($_FILES['file']['tmp_name']); $i++) {
             if ($_FILES['file']['error'][$i]) {
                 if ($_FILES['file']['error'][$i] == UPLOAD_ERR_INI_SIZE) {
                     $sResult .= $this->getFileAddError(_t('_sys_txt_upload_size_error', _t_format_size($this->iMaxFilesize)));
                 }
                 continue;
             }
             $sResult .= $this->_shareFile($_FILES['file']['tmp_name'][$i], true, $_FILES['file']['name'][$i], array('file_type' => $_FILES['file']['type'][$i]));
         }
     } else {
         $sResult = $this->getFileAddError(_t('_sys_txt_upload_size_error', _t_format_size($this->iMaxFilesize)));
     }
     return $sResult != '' ? $this->GenJquieryInjection() . $sResult : '';
 }
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:18,代码来源:BxDolFilesUploader.php

示例3: serviceGetBlockSpace

 public function serviceGetBlockSpace($bDynamic = false)
 {
     $bInclideScriptSpace = false;
     //Use dynamic loading by default if this setting is enabled.
     $sJsObject = $this->getPageJsObject();
     $aChartData = array();
     if (!$bDynamic) {
         $aItems = array(array('label' => '_adm_dbd_txt_su_database', 'value' => $this->getDbSize()));
         if ($bInclideScriptSpace) {
             $iSizeDiskTotal = $this->getFolderSize(BX_DIRECTORY_PATH_ROOT);
             $iSizeDiskMedia = $this->getFolderSize(BX_DIRECTORY_STORAGE);
             $aItems[] = array('label' => '_adm_dbd_txt_su_system', 'value' => $iSizeDiskTotal - $iSizeDiskMedia);
         }
         bx_import('BxDolModuleQuery');
         $aModules = BxDolModuleQuery::getInstance()->getModulesBy(array('type' => 'all'));
         foreach ($aModules as $aModule) {
             $sName = $aModule['name'];
             $sTitle = $aModule['title'];
             if ($aModule['name'] == 'system') {
                 $sName = 'sys';
                 $sTitle = _t('_adm_dbd_txt_su_system_media');
             }
             $aItems[] = array('label' => $sTitle, 'value' => (int) $this->oDb->getModuleStorageSize($sName));
         }
         $iSizeTotal = 0;
         $aChartData = array();
         foreach ($aItems as $sColor => $aItem) {
             $iSizeTotal += $aItem['value'];
             $aChartData[] = array(bx_js_string(strip_tags(_t($aItem['label'])), BX_ESCAPE_STR_APOS), array('v' => $aItem['value'], 'f' => bx_js_string(_t_format_size($aItem['value']))));
         }
     }
     $sContent = BxDolStudioTemplate::getInstance()->parseHtmlByName('dbd_space.html', array('bx_if:show_content' => array('condition' => !$bDynamic, 'content' => array('js_object' => $sJsObject, 'chart_data' => json_encode($aChartData))), 'bx_if:show_loader' => array('condition' => $bDynamic, 'content' => array('js_object' => $sJsObject))));
     return array('content' => $sContent);
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:34,代码来源:BxBaseStudioDashboard.php

示例4: getRestrictionsTextFileSize

 /**
  * Get readable representation of restrictions by file size.
  * @param $iProfileId profile id
  * @return string
  */
 public function getRestrictionsTextFileSize($iProfileId)
 {
     return _t('_sys_storage_restriction_size', _t_format_size($this->getMaxUploadFileSize($iProfileId)));
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:9,代码来源:BxDolStorage.php

示例5: _shareMusic

 function _shareMusic($sFilePath, $isMoveUploadedFile = true, $sRealFilename = '')
 {
     global $sModule;
     $sAuthorCheck = $this->checkAuthorBeforeAdd();
     if (!$this->oModule->_iProfileId) {
         $this->oModule->_iProfileId = $this->_iOwnerId;
     }
     if (empty($sAuthorCheck) && $this->oModule->isAllowedAdd()) {
         $bAutoActive = false;
         $sFilePath = process_db_input($sFilePath, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION);
         if (!empty($sRealFilename)) {
             $iPointPos = strrpos($sRealFilename, '.');
             $sExt = substr($sRealFilename, $iPointPos + 1);
             if (!$this->oModule->_oConfig->checkAllowedExts(strtolower($sExt))) {
                 return $this->getMusicAddError();
             }
             $this->sTempFilename = substr($sRealFilename, 0, $iPointPos);
             /*
                             if (strtolower($sExt) == 'mp3' && getSettingValue($sModule, "autoApprove") == true)
                                 $bAutoActive = true;*/
         }
         $iFileSize = filesize($sFilePath);
         if (!$iFileSize || $iFileSize > $this->iMaxFilesize) {
             return $this->getMusicAddError(_t('_' . $this->oModule->_oConfig->getMainPrefix() . '_size_error', _t_format_size($this->iMaxFilesize)));
         }
         $sROwnerID = $this->_iOwnerId ? $this->_iOwnerId : $this->_getAuthorId();
         $iMID = uploadMusic($sFilePath, $sROwnerID, process_db_input($sRealFilename, BX_TAGS_STRIP), $isMoveUploadedFile);
         if ($iMID > 0) {
             $sAlbum = $_POST['extra_param_album'];
             $aAlbumParams = isset($_POST['extra_param_albumPrivacy']) ? array('privacy' => (int) $_POST['extra_param_albumPrivacy']) : array();
             $this->addObjectToAlbum($this->oModule->oAlbums, $sAlbum, $iMID, $bAutoActive, $sROwnerID, $aAlbumParams);
             $this->oModule->isAllowedAdd(true, true);
             $aDefault = array('title' => $this->sTempFilename);
             return $this->GenSendFileInfoForm($iMID, $aDefault);
         } else {
             return $this->getMusicAddError();
         }
     } else {
         return $sAuthorCheck;
     }
 }
开发者ID:noormcs,项目名称:studoro,代码行数:41,代码来源:BxSoundsUploader.php

示例6: getBlockCode_ViewFile

 function getBlockCode_ViewFile()
 {
     $oVotingView = new BxTemplVotingView('bx_files', $this->aFileInfo['medID']);
     if ($this->aFileInfo['prevItem'] > 0) {
         $aPrev = $this->oDb->getFileInfo(array('fileId' => $this->aFileInfo['prevItem']), true, array('medUri', 'medTitle'));
     }
     if ($this->aFileInfo['nextItem'] > 0) {
         $aNext = $this->oDb->getFileInfo(array('fileId' => $this->aFileInfo['nextItem']), true, array('medUri', 'medTitle'));
     }
     //icon
     $sIcon = $this->oDb->getTypeIcon($this->aFileInfo['Type']);
     if (!$sIcon) {
         $sIcon = 'default.png';
     }
     $aUnit = array('pic' => $this->oTemplate->getIconUrl($sIcon), 'fileTitle' => $this->aFileInfo['medTitle'], 'fileSize' => (int) $this->aFileInfo['medSize'] > 0 ? _t_format_size((int) $this->aFileInfo['medSize']) : 0, 'fileExt' => $this->aFileInfo['medExt'], 'fileDescription' => $this->aFileInfo['medDesc'], 'rate' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting(1, $this->aFileInfo['Rate']) : '', 'favInfo' => $this->oDb->getFavoritesCount($this->aFileInfo['medID']), 'viewInfo' => $this->aFileInfo['medViews'], 'albumUri' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'browse/album/' . $this->aFileInfo['albumUri'] . '/owner/' . $this->aFileInfo['NickName'], 'albumCaption' => $this->aFileInfo['albumCaption'], 'bx_if:prev' => array('condition' => $this->aFileInfo['prevItem'] > 0, 'content' => array('linkPrev' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aPrev['medUri'], 'titlePrev' => $aPrev['medTitle'], 'percent' => $this->aFileInfo['nextItem'] > 0 ? 50 : 100)), 'bx_if:next' => array('condition' => $this->aFileInfo['nextItem'] > 0, 'content' => array('linkNext' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aNext['medUri'], 'titleNext' => $aNext['medTitle'], 'percent' => $this->aFileInfo['prevItem'] > 0 ? 50 : 100)));
     $sCode = $this->oTemplate->parseHtmlByName('view_unit.html', $aUnit);
     return array($sCode, array(), array(), false);
 }
开发者ID:noormcs,项目名称:studoro,代码行数:18,代码来源:BxFilesPageView.php

示例7: getSearchUnitShort

 function getSearchUnitShort($aData)
 {
     //var_dump($aData); exit;
     $aUnit = array();
     $aUnit['unitClass'] = $this->aCurrent['name'];
     // title
     $aUnit['titleLink'] = $this->getCurrentUrl('file', $aData['id'], $aData['uri']);
     $aUnit['title'] = $aData['title'];
     // from
     $aUnit['fromLink'] = getProfileLink($aData['ownerId']);
     $aUnit['from'] = getNickName($aData['ownerId']);
     //extension
     $aUnit['ext'] = $aData['Ext'];
     //size
     $aUnit['size'] = _t_format_size($aData['size']);
     // when
     $aUnit['when'] = defineTimeInterval($aData['date']);
     // pic
     $sPicName = is_null($aData['Icon']) ? 'default.png' : $aData['Icon'];
     $aUnit['pic'] = $this->oModule->_oTemplate->getIconUrl($sPicName);
     $aUnit['id'] = $aData['id'];
     return $this->oModule->_oTemplate->parseHtmlByName('browse_unit_short.html', $aUnit, array('{', '}'));
 }
开发者ID:blas-dmx,项目名称:dolphin.pro,代码行数:23,代码来源:BxFilesSearch.php

示例8: _getCellQuotaMaxFileSize

 protected function _getCellQuotaMaxFileSize($mixedValue, $sKey, $aField, $aRow)
 {
     return parent::_getCellDefault($mixedValue > 0 ? _t_format_size($mixedValue) : '&infin;', $sKey, $aField, $aRow);
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:4,代码来源:BxBaseStudioPermissionsLevels.php

示例9: performUpload

 /**
  * @return array with the following keys:
  *         - id: uploaded file ID if file was successfully uploaded
  *         - error: error message if file wasn't successfully uploaded
  */
 function performUpload($sFilePath, $sRealFilename = '', $aInfo = array(), $isMoveUploadedFile = true, $aExtraParams = array())
 {
     $iOwner = $this->_getAuthorId();
     if ($this->_iOwnerId) {
         $iOwner = $this->oModule->_iProfileId = $this->_iOwnerId;
     }
     if (!$sRealFilename) {
         $sRealFilename = pathinfo($sFilePath, PATHINFO_BASENAME);
     }
     // basic checking before upload
     if ($this->checkAuthorBeforeAdd()) {
         return array('error' => _t('_LOGIN_REQUIRED_AE1'));
     }
     if (!$this->oModule->_oConfig->checkAllowedExtsByFilename($sRealFilename)) {
         return array('error' => _t('_sys_txt_wrong_file_extension'));
     }
     if (!$this->oModule->isAllowedAdd()) {
         return array('error' => _t('_Access denied'));
     }
     $iFileSize = filesize($sFilePath);
     if (!$iFileSize || $iFileSize > $this->iMaxFilesize) {
         return array('error' => _t('_' . $this->oModule->_oConfig->getMainPrefix() . '_size_error', _t_format_size($this->iMaxFilesize)));
     }
     $this->sTempFilename = pathinfo($sRealFilename, PATHINFO_FILENAME);
     if (!($iMID = $this->performFileUpload($sFilePath, array(), $isMoveUploadedFile, $sRealFilename, isset($aExtraParams['file_type']) ? $aExtraParams['file_type'] : ''))) {
         return array('error' => _t('_sys_txt_upload_failed'));
     }
     return array('id' => $iMID);
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:34,代码来源:BxFilesUploader.php

示例10: getCacheChartData

 protected function getCacheChartData($bAsString = true)
 {
     $oCacheUtilities = BxDolCacheUtilities::getInstance();
     $aChartData = array();
     foreach ($this->aItemsCache as $aItem) {
         if ($aItem['name'] == 'all') {
             continue;
         }
         $iSize = $oCacheUtilities->size($aItem['name']);
         if ($iSize === false) {
             continue;
         }
         $aChartData[] = array(bx_js_string(_t('_adm_dbd_txt_c_' . $aItem['name']), BX_ESCAPE_STR_APOS), array('v' => $iSize, 'f' => bx_js_string(_t_format_size($iSize))));
     }
     if (empty($aChartData)) {
         return false;
     }
     return $bAsString ? json_encode($aChartData) : $aChartData;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:19,代码来源:BxDolStudioDashboard.php

示例11: _shareVideo

 function _shareVideo($sFilePath, $isMoveUploadedFile = true, $sImageFilePath = '', $sRealFilename = '')
 {
     $sAuthorCheck = $this->checkAuthorBeforeAdd();
     if (!$this->_iOwnerId) {
         return false;
     }
     if (!$this->oModule->_iProfileId) {
         $this->oModule->_iProfileId = $this->_iOwnerId;
     }
     if (empty($sAuthorCheck) && $this->oModule->isAllowedAdd()) {
         $sFilePath = process_db_input($sFilePath, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION);
         $sImageFilePath = mb_strlen($sImageFilePath) > 0 ? process_db_input($sImageFilePath, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION) : '';
         if (!empty($sRealFilename)) {
             $iPointPos = strrpos($sRealFilename, '.');
             $sExt = substr($sRealFilename, $iPointPos + 1);
             if (!$this->oModule->_oConfig->checkAllowedExts(strtolower($sExt))) {
                 return $this->getVideoAddError();
             }
             $this->sTempFilename = substr($sRealFilename, 0, $iPointPos);
         }
         $iFileSize = filesize($sFilePath);
         if (!$iFileSize || $iFileSize > $this->iMaxFilesize) {
             return $this->getVideoAddError(_t('_' . $this->oModule->_oConfig->getMainPrefix() . '_size_error', _t_format_size($this->iMaxFilesize)));
         }
         $sROwnerID = $this->_iOwnerId ? $this->_iOwnerId : $this->_getAuthorId();
         $iMID = uploadVideo($sFilePath, $sROwnerID, $isMoveUploadedFile, $sImageFilePath, process_db_input($sRealFilename, BX_TAGS_STRIP));
         if ($iMID > 0) {
             $this->addObjectToAlbum($this->oModule->oAlbums, $_POST['extra_param_album'], $iMID, false);
             $this->oModule->isAllowedAdd(true, true);
             $aDefault = array('title' => $this->sTempFilename, 'description' => $this->sTempFilename);
             return $this->GenSendFileInfoForm($iMID, $aDefault);
         } else {
             return $this->getVideoAddError();
         }
     } else {
         return $sAuthorCheck;
     }
 }
开发者ID:Arvindvi,项目名称:dolphin,代码行数:38,代码来源:BxVideosUploader.php

示例12: _shareFile

 function _shareFile($sFilePath, $isMoveUploadedFile = true, $sRealFilename = '', $sFileType = '')
 {
     $sAuthorCheck = $this->checkAuthorBeforeAdd();
     if (empty($sAuthorCheck)) {
         //$this->sTempFilename = substr($sRealFilename, 0, strrpos($sRealFilename, '.'));
         $iFileSize = filesize($sFilePath);
         if (!$iFileSize || $iFileSize > $this->iMaxFilesize) {
             return $this->getFileAddError(_t('_' . $this->oModule->_oConfig->getMainPrefix() . '_size_error', _t_format_size($this->iMaxFilesize)));
         }
         $iPointPos = strrpos($sRealFilename, '.');
         $sExt = substr($sRealFilename, $iPointPos + 1);
         if (!$this->oModule->_oConfig->checkAllowedExts($sExt)) {
             return $this->getFileAddError();
         }
         $this->sTempFilename = substr($sRealFilename, 0, $iPointPos);
         $iMID = $this->performFileUpload($sFilePath, array(), $isMoveUploadedFile, $sRealFilename, $sFileType);
         if ($iMID > 0) {
             //upload success
             $aDefault = array('title' => $this->sTempFilename, 'description' => $this->sTempFilename);
             return $this->GenSendFileInfoForm($iMID, $aDefault);
         } else {
             return $this->getFileAddError();
         }
     } else {
         return $sAuthorCheck;
     }
 }
开发者ID:Arvindvi,项目名称:dolphin,代码行数:27,代码来源:BxFilesUploader.php


注:本文中的_t_format_size函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。