當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ArtefactTypeFileBase::get方法代碼示例

本文整理匯總了PHP中ArtefactTypeFileBase::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArtefactTypeFileBase::get方法的具體用法?PHP ArtefactTypeFileBase::get怎麽用?PHP ArtefactTypeFileBase::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ArtefactTypeFileBase的用法示例。


在下文中一共展示了ArtefactTypeFileBase::get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_export_path_for_file

 /**
  * Generates a path, relative to the root of the export, that the given
  * file will appear in the export.
  *
  * If the file is a thumbnail, the copy proxy is informed about it so that
  * the image can later be copied in to place.
  *
  * @param ArtefactTypeFileBase $file The file to get the exported path for
  * @param array $options             Options from the URL that was linking
  *                                   to the image - most importantly, size
  *                                   related options about how the image
  *                                   was thumbnailed, if it was.
  * @param string $basefolder         What folder in the export to dump the
  *                                   file in
  * @return string                    The relative path to where the file
  *                                   will be placed
  */
 private function get_export_path_for_file(ArtefactTypeFileBase $file, array $options, $basefolder = null)
 {
     if (is_null($basefolder)) {
         if ($file->get('owner') == $this->owner) {
             $basefolder = '/files/file/' . $this->get_folder_path_for_file($file);
         } else {
             $basefolder = '/files/extra/';
         }
     }
     unset($options['view']);
     $prefix = '';
     $title = PluginExportHtml::sanitise_path($file->get('title'));
     if ($options) {
         list($size, $prefix) = $this->get_size_from_options($options);
         $from = $file->get_path($size);
         $to = $basefolder . $file->get('id') . '-' . $prefix . $title;
         $this->htmlexportcopyproxy->add($from, $to);
     } else {
         if ($basefolder == '/files/extra/') {
             $title = $file->get('id') . '-' . $title;
         }
         $to = $basefolder . $title;
     }
     return $this->basepath . $to;
 }
開發者ID:rboyatt,項目名稱:mahara,代碼行數:42,代碼來源:lib.php

示例2: get_export_path_for_file

 /**
  * Generates a path, relative to the root of the export, that the given 
  * file will appear in the export.
  *
  * If the file is a thumbnail, the copy proxy is informed about it so that 
  * the image can later be copied in to place.
  *
  * @param ArtefactTypeFileBase $file The file to get the exported path for
  * @param array $options             Options from the URL that was linking 
  *                                   to the image - most importantly, size 
  *                                   related options about how the image 
  *                                   was thumbnailed, if it was.
  * @param string $basefolder         What folder in the export to dump the 
  *                                   file in
  * @return string                    The relative path to where the file 
  *                                   will be placed
  */
 private function get_export_path_for_file(ArtefactTypeFileBase $file, array $options, $basefolder)
 {
     unset($options['view']);
     $prefix = '';
     if ($options) {
         list($size, $prefix) = $this->get_size_from_options($options);
         $from = $file->get_path($size);
         $to = $basefolder . $file->get('id') . '-' . $prefix . PluginExportHtml::sanitise_path($file->get('title'));
         $this->htmlexportcopyproxy->add($from, $to);
     } else {
         $to = $basefolder . PluginExportHtml::sanitise_path($file->get('title'));
     }
     return $this->basepath . $to;
 }
開發者ID:richardmansfield,項目名稱:richardms-mahara,代碼行數:31,代碼來源:lib.php


注:本文中的ArtefactTypeFileBase::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。