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


PHP MOXMAN::getUserStorage方法代码示例

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


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

示例1: onFileAction

 public function onFileAction(MOXMAN_Vfs_FileActionEventArgs $args)
 {
     switch ($args->getAction()) {
         case MOXMAN_Vfs_FileActionEventArgs::DELETE:
         case MOXMAN_Vfs_FileActionEventArgs::COPY:
         case MOXMAN_Vfs_FileActionEventArgs::ADD:
             MOXMAN::getUserStorage()->put("quota.size", max(0, $this->currentSize));
             break;
     }
 }
开发者ID:newton27,项目名称:dolphin.pro,代码行数:10,代码来源:Plugin.php

示例2: onFileAction

 public function onFileAction(MOXMAN_Core_FileActionEventArgs $args)
 {
     switch ($args->getAction()) {
         case MOXMAN_Core_FileActionEventArgs::LIST_FILES:
             // Recalculate quota size when listing files
             $dirs = MOXMAN::getUserStorage()->get("quota.dirs", new stdClass());
             $this->recalcQuota($args->getFile(), $dirs);
             MOXMAN::getUserStorage()->put("quota.dirs", $dirs);
             break;
     }
 }
开发者ID:GHarutyunyan,项目名称:cms,代码行数:11,代码来源:Plugin.php

示例3: listFilesFiltered

 public function listFilesFiltered(MOXMAN_Vfs_IFileFilter $filter)
 {
     $entries = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("uploaded.files", "[]"));
     $files = array();
     foreach ($entries as $entry) {
         $file = new MOXMAN_Uploaded_File($this->fileSystem, $entry->path, $entry);
         if ($filter->accept($file) == MOXMAN_Vfs_IFileFilter::ACCEPTED) {
             $files[] = $file;
         }
     }
     return $files;
 }
开发者ID:tremor-od,项目名称:pizza.loc,代码行数:12,代码来源:File.php

示例4: listFilesFiltered

 public function listFilesFiltered(MOXMAN_Vfs_IFileFilter $filter)
 {
     $files = array();
     if ($this->isDirectory()) {
         $fileSystem = $this->getFileSystem();
         $entries = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("uploaded.files", "[]"));
         foreach ($entries as $entry) {
             $file = new MOXMAN_Favorites_File($fileSystem, $entry->path, $entry);
             if ($filter->accept($file)) {
                 $files[] = $file;
             }
         }
     }
     return new MOXMAN_Vfs_FileList($files);
 }
开发者ID:shainmcalindon,项目名称:boothsgardenstudios,代码行数:15,代码来源:File.php

示例5: remove

 public function remove($params)
 {
     if (isset($params->paths) && is_array($params->paths)) {
         $paths = $params->paths;
         $files = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("uploaded.files", "[]"));
         // Remove existing paths
         for ($i = 0; $i < count($files); $i++) {
             foreach ($paths as $path) {
                 if ($files[$i]->path == $path) {
                     array_splice($files, $i, 1);
                 }
             }
         }
         MOXMAN::getUserStorage()->put("uploaded.files", MOXMAN_Util_Json::encode($files));
     }
     return true;
 }
开发者ID:GHarutyunyan,项目名称:cms,代码行数:17,代码来源:Plugin.php

示例6: listFilesFiltered

 public function listFilesFiltered(MOXMAN_Vfs_IFileFilter $filter)
 {
     $files = array();
     if ($this->isDirectory()) {
         $fileSystem = $this->getFileSystem();
         $entries = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("history.files", "[]"));
         $index = 0;
         foreach ($entries as $entry) {
             $file = new MOXMAN_History_File($fileSystem, $entry->path, $entry);
             if ($filter->accept($file)) {
                 $entry->name = basename($entry->path) . "_\$\$[" . $index++ . "]";
                 $files[] = $file;
             }
         }
     }
     return new MOXMAN_Vfs_FileList($files);
 }
开发者ID:codekanzlei,项目名称:cake-cktools,代码行数:17,代码来源:File.php

示例7: remove

 public function remove($params)
 {
     if (isset($params->paths) && is_array($params->paths)) {
         $paths = $params->paths;
         $files = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("favorites.files", "[]"));
         foreach ($paths as $path) {
             for ($i = count($files) - 1; $i >= 0; $i--) {
                 if ($files[$i]->path == $path) {
                     array_splice($files, $i, 1);
                     $i--;
                 }
             }
         }
         MOXMAN::getUserStorage()->put("favorites.files", MOXMAN_Util_Json::encode($files));
     }
     return true;
 }
开发者ID:codekanzlei,项目名称:cake-cktools,代码行数:17,代码来源:Plugin.php

示例8: remove

 public function remove($params)
 {
     if (MOXMAN::getConfig()->get('general.demo')) {
         throw new MOXMAN_Exception("This action is restricted in demo mode.", MOXMAN_Exception::DEMO_MODE);
     }
     if (isset($params->paths) && is_array($params->paths)) {
         $paths = $params->paths;
         $files = MOXMAN_Util_Json::decode(MOXMAN::getUserStorage()->get("history.files", "[]"));
         for ($i = count($files) - 1; $i >= 0; $i--) {
             foreach ($paths as $path) {
                 if ($files[$i]->path == $path) {
                     array_splice($files, $i, 1);
                     $i--;
                 }
             }
         }
         MOXMAN::getUserStorage()->put("history.files", MOXMAN_Util_Json::encode($files));
     }
     return true;
 }
开发者ID:shainmcalindon,项目名称:boothsgardenstudios,代码行数:20,代码来源:Plugin.php


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