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


PHP PublicFileManager::uploadConferenceFile方法代码示例

本文整理汇总了PHP中PublicFileManager::uploadConferenceFile方法的典型用法代码示例。如果您正苦于以下问题:PHP PublicFileManager::uploadConferenceFile方法的具体用法?PHP PublicFileManager::uploadConferenceFile怎么用?PHP PublicFileManager::uploadConferenceFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PublicFileManager的用法示例。


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

示例1: uploadStyleSheet

 /**
  * Uploads conference custom stylesheet.
  * @param $settingName string setting key associated with the file
  */
 function uploadStyleSheet($settingName)
 {
     $conference =& Request::getConference();
     $settingsDao =& DAORegistry::getDAO('ConferenceSettingsDAO');
     import('file.PublicFileManager');
     $fileManager = new PublicFileManager();
     if ($fileManager->uploadError($settingName)) {
         return false;
     }
     if ($fileManager->uploadedFileExists($settingName)) {
         $type = $fileManager->getUploadedFileType($settingName);
         if ($type != 'text/plain' && $type != 'text/css') {
             return false;
         }
         $uploadName = $settingName . '.css';
         if ($fileManager->uploadConferenceFile($conference->getId(), $settingName, $uploadName)) {
             $value = array('name' => $fileManager->getUploadedFileName($settingName), 'uploadName' => $uploadName, 'dateUploaded' => date("Y-m-d g:i:s"));
             $settingsDao->updateSetting($conference->getId(), $settingName, $value, 'object');
             return true;
         }
     }
     return false;
 }
开发者ID:sedici,项目名称:ocs,代码行数:27,代码来源:ConferenceSetupStep4Form.inc.php

示例2: uploadImage

 /**
  * Uploads a conference image.
  * @param $settingName string setting key associated with the file
  * @param $locale string
  */
 function uploadImage($settingName, $locale)
 {
     $conference =& Request::getConference();
     $settingsDao = DAORegistry::getDAO('ConferenceSettingsDAO');
     $faviconTypes = array('.ico', '.png', '.gif');
     import('classes.file.PublicFileManager');
     $fileManager = new PublicFileManager();
     if ($fileManager->uploadError($settingName)) {
         return false;
     }
     if ($fileManager->uploadedFileExists($settingName)) {
         $type = $fileManager->getUploadedFileType($settingName);
         $extension = $fileManager->getImageExtension($type);
         if (!$extension) {
             return false;
         }
         if ($settingName == 'conferenceFavicon' && !in_array($extension, $faviconTypes)) {
             return false;
         }
         $uploadName = $settingName . '_' . $locale . $extension;
         if ($fileManager->uploadConferenceFile($conference->getId(), $settingName, $uploadName)) {
             // Get image dimensions
             $filePath = $fileManager->getConferenceFilesPath($conference->getId());
             list($width, $height) = getimagesize($filePath . '/' . $uploadName);
             $value = $conference->getSetting($settingName);
             $value[$locale] = array('name' => $fileManager->getUploadedFileName($settingName), 'uploadName' => $uploadName, 'width' => $width, 'height' => $height, 'mimeType' => $fileManager->getUploadedFileType($settingName), 'dateUploaded' => Core::getCurrentDate());
             $settingsDao->updateSetting($conference->getId(), $settingName, $value, 'object', true);
             return true;
         }
     }
     return false;
 }
开发者ID:artkuo,项目名称:ocs,代码行数:37,代码来源:ConferenceSetupForm.inc.php


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