本文整理汇总了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;
}