本文整理匯總了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;
}