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


PHP PublicFileManager::removeSchedConfFile方法代码示例

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


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

示例1: saveLocationSettings

 /**
  * Save changes to location settings.
  */
 function saveLocationSettings()
 {
     $this->validate();
     $this->setupTemplate(true);
     $schedConf =& Request::getSchedConf();
     if (!$schedConf) {
         Request::redirect(null, null, 'index');
     }
     import('manager.form.LocationSettingsForm');
     $settingsForm = new LocationSettingsForm();
     $settingsForm->readInputData();
     $editData = false;
     $locationFiles =& $schedConf->getSetting('locationFiles');
     if (Request::getUserVar('uploadLocationFile')) {
         // Get a numeric key for this file.
         $thisFileKey = 0;
         if (isset($locationFiles[$settingsForm->getFormLocale()])) {
             foreach ($locationFiles[$settingsForm->getFormLocale()] as $key => $junk) {
                 $thisFileKey = $key + 1;
             }
         }
         import('file.PublicFileManager');
         $fileManager = new PublicFileManager();
         $success = !$fileManager->uploadError('locationFile');
         if ($success && ($success = $fileManager->uploadedFileExists('locationFile'))) {
             $oldName = $fileManager->getUploadedFileName('locationFile');
             $extension = $fileManager->getExtension($oldName);
             if (!$extension) {
                 break;
             }
             $uploadName = 'location-' . $thisFileKey . '.' . $extension;
             if ($success && ($success = $fileManager->uploadSchedConfFile($schedConf->getId(), 'locationFile', $uploadName))) {
                 $value = array('name' => $oldName, 'uploadName' => $uploadName, 'dateUploaded' => Core::getCurrentDate(), 'title' => Request::getUserVar('locationFileTitle'));
                 $locationFiles[$settingsForm->getFormLocale()][$thisFileKey] =& $value;
                 $settingsForm->setData('locationFiles', $locationFiles);
                 $settingsForm->setData('locationFileTitle', '');
                 $schedConf->updateSetting('locationFiles', $locationFiles, 'object', true);
             }
         }
         if (!$success) {
             $settingsForm->addError('locationFiles', __('common.uploadFailed'));
         }
         $editData = true;
     } else {
         $formLocale = $settingsForm->getFormLocale();
         $deleteKey = null;
         if (isset($locationFiles[$formLocale])) {
             foreach ($locationFiles[$formLocale] as $key => $junk) {
                 if (Request::getUserVar("deleteLocationFile-{$formLocale}-{$key}")) {
                     $deleteKey = $key;
                 }
             }
         }
         if ($deleteKey !== null) {
             import('file.PublicFileManager');
             $fileManager = new PublicFileManager();
             if ($fileManager->removeSchedConfFile($schedConf->getId(), $locationFiles[$formLocale][$deleteKey]['uploadName'])) {
                 unset($locationFiles[$formLocale][$deleteKey]);
                 $schedConf->updateSetting('locationFiles', $locationFiles, 'object', true);
             }
             $editData = true;
         }
     }
     if (!$editData && $settingsForm->validate()) {
         $settingsForm->execute();
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign(array('currentUrl' => Request::url(null, null, null, 'location'), 'pageTitle' => 'schedConf.location', 'message' => 'common.changesSaved', 'backLink' => Request::url(null, null, Request::getRequestedPage()), 'backLinkLabel' => 'manager.conferenceSiteManagement'));
         $templateMgr->display('common/message.tpl');
     } else {
         $settingsForm->display();
     }
 }
开发者ID:pulipulichen,项目名称:ocs,代码行数:75,代码来源:ManagerLocationHandler.inc.php

示例2: deleteProgram

 /**
  * Deletes a program file.
  * @param $settingName string setting key associated with the file
  * @param $locale string
  */
 function deleteProgram($settingName, $locale = null)
 {
     $schedConf =& Request::getSchedConf();
     $settingsDao =& DAORegistry::getDAO('SchedConfSettingsDAO');
     $setting = $schedConf->getSetting($settingName);
     import('file.PublicFileManager');
     $fileManager = new PublicFileManager();
     if ($fileManager->removeSchedConfFile($schedConf->getId(), $locale !== null ? $setting[$locale]['uploadName'] : $setting['uploadName'])) {
         return $settingsDao->deleteSetting($schedConf->getId(), $settingName, $locale);
     } else {
         return false;
     }
 }
开发者ID:jalperin,项目名称:ocs,代码行数:18,代码来源:ProgramSettingsForm.inc.php


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