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


PHP Foundry::access方法代碼示例

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


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

示例1: onPrepareStoryPanel

 public function onPrepareStoryPanel($story)
 {
     $config = Foundry::config();
     if (!$config->get('photos.enabled')) {
         return;
     }
     // Get current logged in user.
     $my = Foundry::user();
     // Get user access
     $access = Foundry::access($my->id, SOCIAL_TYPE_USER);
     $plugin = $story->createPlugin("photos", "panel");
     $theme = Foundry::get('Themes');
     // check max photos upload here.
     if ($access->exceeded('photos.uploader.max', $my->getTotalPhotos())) {
         $theme->set('exceeded', JText::sprintf('COM_EASYSOCIAL_PHOTOS_EXCEEDED_MAX_UPLOAD', $access->get('photos.uploader.max')));
     }
     // check max photos upload daily here.
     if ($access->exceeded('photos.uploader.maxdaily', $my->getTotalPhotos(true))) {
         $theme->set('exceeded', JText::sprintf('COM_EASYSOCIAL_PHOTOS_EXCEEDED_DAILY_MAX_UPLOAD', $access->get('photos.uploader.maxdaily')));
     }
     $plugin->button->html = $theme->output('themes:/apps/user/photos/story/panel.button');
     $plugin->content->html = $theme->output('themes:/apps/user/photos/story/panel.content');
     $script = Foundry::get('Script');
     $script->set('maxFileSize', $access->get('photos.uploader.maxsize') . 'M');
     $plugin->script = $script->output('apps:/user/photos/story');
     return $plugin;
 }
開發者ID:knigherrant,項目名稱:decopatio,代碼行數:27,代碼來源:photos.php


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