本文整理汇总了PHP中Action::getScoped方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::getScoped方法的具体用法?PHP Action::getScoped怎么用?PHP Action::getScoped使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Action
的用法示例。
在下文中一共展示了Action::getScoped方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onStartShowStylesheets
function onStartShowStylesheets(Action $action)
{
//get the theme and set the current config for site and theme.
if ($action->getScoped() instanceof Profile) {
$site_theme = common_config('site', 'theme');
$user_theme = $action->getScoped()->getPref('chosen_theme', 'theme', $site_theme);
common_config_set('site', 'theme', $user_theme);
}
return true;
}
示例2: onEndShowSections
public function onEndShowSections(Action $action)
{
if (!$action->isAction(array('all', 'public'))) {
return true;
}
if (!common_config('performance', 'high')) {
$section = new PopularNoticeSection($action, $action->getScoped());
$section->show();
}
}
示例3: onStartShowConversation
public function onStartShowConversation(Action $action, Conversation $conv, Profile $scoped = null)
{
$nl = new ConversationTree($conv->getNotices($action->getScoped()), $action);
$cnt = $nl->show();
return false;
}
示例4: onEndShowSections
function onEndShowSections(Action $action)
{
if (!$action instanceof ShowstreamAction) {
// early return for actions we're not interested in
return true;
}
$scoped = $action->getScoped();
if (!$scoped instanceof Profile || !$scoped->hasRight(self::VIEWMODLOG)) {
// only continue if we are allowed to VIEWMODLOG
return true;
}
$profile = $action->getTarget();
$ml = new ModLog();
$ml->profile_id = $profile->getID();
$ml->orderBy("created");
$cnt = $ml->find();
if ($cnt > 0) {
$action->elementStart('div', array('id' => 'entity_mod_log', 'class' => 'section'));
$action->element('h2', null, _('Moderation'));
$action->elementStart('table');
while ($ml->fetch()) {
$action->elementStart('tr');
$action->element('td', null, strftime('%y-%m-%d', strtotime($ml->created)));
$action->element('td', null, sprintf($ml->is_grant ? _('+%s') : _('-%s'), $ml->role));
$action->elementStart('td');
if ($ml->moderator_id) {
$mod = Profile::getByID($ml->moderator_id);
if (empty($mod)) {
$action->text(_('[unknown]'));
} else {
$action->element('a', array('href' => $mod->getUrl(), 'title' => $mod->getFullname()), $mod->getNickname());
}
} else {
$action->text(_('[unknown]'));
}
$action->elementEnd('td');
$action->elementEnd('tr');
}
$action->elementEnd('table');
$action->elementEnd('div');
}
}