本文整理汇总了PHP中Action::elementEnd方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::elementEnd方法的具体用法?PHP Action::elementEnd怎么用?PHP Action::elementEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Action
的用法示例。
在下文中一共展示了Action::elementEnd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onStartShowSections
function onStartShowSections(Action $action)
{
$name = $action->trimmed('action');
if ($name == 'tag') {
$taginput = $action->trimmed('tag');
$tag = common_canonical_tag($taginput);
if (!empty($tag)) {
$url = sprintf('http://hashtags.wikia.com/index.php?title=%s&action=render', urlencode($tag));
$editurl = sprintf('http://hashtags.wikia.com/index.php?title=%s&action=edit', urlencode($tag));
$request = HTTPClient::start();
$response = $request->get($url);
$html = $response->getBody();
$action->elementStart('div', array('id' => 'wikihashtags', 'class' => 'section'));
if ($response->isOk() && !empty($html)) {
$action->element('style', null, "span.editsection { display: none }\n" . "table.toc { display: none }");
$action->raw($html);
$action->elementStart('p');
$action->element('a', array('href' => $editurl, 'title' => sprintf(_m('Edit the article for #%s on WikiHashtags'), $tag)), _m('Edit'));
$action->element('a', array('href' => 'http://www.gnu.org/copyleft/fdl.html', 'title' => _m('Shared under the terms of the GNU Free Documentation License'), 'rel' => 'license'), _m('GNU FDL'));
$action->elementEnd('p');
} else {
$action->element('a', array('href' => $editurl), sprintf(_m('Start the article for #%s on WikiHashtags'), $tag));
}
$action->elementEnd('div');
}
}
return true;
}
示例2: onEndShowSections
/**
* Add the conrnify button
*
* @param Action $action the current action
*
* @return void
*/
function onEndShowSections(Action $action)
{
$action->elementStart('div', array('id' => 'cornify_section', 'class' => 'section'));
$action->raw(<<<EOT
<a href="http://www.cornify.com" onclick="cornify_add();return false;">
<img src="http://www.cornify.com/assets/cornify.gif" width="61" height="16" border="0" alt="Cornify" />
</a>
<script type="text/javascript">(function() {
var js = document.createElement('script');
js.type = 'text/javascript';
js.async = true;
js.src = 'http://www.cornify.com/js/cornify.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(js);
})();</script>
EOT
);
$action->elementEnd('div');
}
示例3: onEndEmailFormData
public function onEndEmailFormData(Action $action, Profile $scoped)
{
$emailfave = $scoped->getConfigPref('email', 'notify_fave') ? 1 : 0;
$action->elementStart('li');
$action->checkbox('email-notify_fave', _('Send me email when someone adds my notice as a favorite.'), $emailfave);
$action->elementEnd('li');
return true;
}
示例4: onEndShowSections
function onEndShowSections(Action $action)
{
$actionName = $action->trimmed('action');
// These are the ones that have maps on 'em
if (!in_array($actionName, array('showstream', 'all'))) {
return true;
}
$action->elementStart('div', array('id' => 'entity_map', 'class' => 'section'));
// TRANS: Header for Map widget that displays a map with geodata for notices.
$action->element('h2', null, _m('Map'));
$action->element('div', array('id' => 'map_canvas', 'class' => 'gray smallmap', 'style' => "width: 100%; height: 240px"));
$mapAct = $actionName == 'showstream' ? 'usermap' : 'allmap';
$mapUrl = common_local_url($mapAct, array('nickname' => $action->trimmed('nickname')));
$action->element('a', array('href' => $mapUrl), _m('Full size'));
$action->elementEnd('div');
}
示例5: onEndProfileFormData
/**
* Show a checkbox on the profile form to ask whether to follow everyone
*
* @param Action $action The action being executed
*
* @return boolean hook value
*/
function onEndProfileFormData($action)
{
$user = common_current_user();
$action->elementStart('li');
// TRANS: Checkbox label in form for profile settings.
$action->checkbox('followeveryone', _('Follow everyone'), $action->arg('followeveryone') ? $action->arg('followeveryone') : User_followeveryone_prefs::followEveryone($user->id));
$action->elementEnd('li');
return true;
}
示例6: showFlagButton
/**
* Actually output a flag button. If the target profile has already been
* flagged by the current user, a null-action faux button is shown.
*
* @param Action $action
* @param Profile $profile
* @param array $returnToArgs
*/
protected function showFlagButton($action, $profile, $returnToArgs)
{
$user = common_current_user();
if (!empty($user) && $user->id != $profile->id) {
$action->elementStart('li', 'entity_flag');
if (User_flag_profile::exists($profile->id, $user->id)) {
// @todo FIXME: Add a title explaining what 'flagged' means?
// TRANS: Message added to a profile if it has been flagged for review.
$action->element('p', 'flagged', _m('Flagged'));
} else {
$form = new FlagProfileForm($action, $profile, $returnToArgs);
$form->show();
}
$action->elementEnd('li');
}
}
示例7: onEndLoginFormData
/**
* Show some extra instructions for using Yubikey
*
* @param Action $action Action being executed
*
* @return boolean hook value
*/
function onEndLoginFormData($action)
{
$action->elementStart('li');
$action->password('otp', _('Yubikey OTP'));
$action->elementEnd('li');
}
示例8: onEndShowSections
function onEndShowSections(Action $action)
{
if ($action->arg('action') != 'showstream') {
return true;
}
$cur = common_current_user();
if (empty($cur) || !$cur->hasRight(self::VIEWMODLOG)) {
return true;
}
$profile = $action->profile;
$ml = new ModLog();
$ml->profile_id = $profile->id;
$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::getKV('id', $ml->moderator_id);
if (empty($mod)) {
$action->text(_('[unknown]'));
} else {
$action->element('a', array('href' => $mod->profileurl, 'title' => $mod->fullname), $mod->nickname);
}
} else {
$action->text(_('[unknown]'));
}
$action->elementEnd('td');
$action->elementEnd('tr');
}
$action->elementEnd('table');
$action->elementEnd('div');
}
}
示例9: onEndEmailFormData
/**
* Add a checkbox to turn off email summaries
*
* @param Action $action Action being executed (emailsettings)
*
* @return boolean hook value
*/
function onEndEmailFormData($action)
{
$user = common_current_user();
$action->elementStart('li');
$action->checkbox('emailsummary', _('Send me a periodic summary of updates from my network.'), Email_summary_status::getSendSummary($user->id));
$action->elementEnd('li');
return true;
}
示例10: onEndProfileSettingsActions
/**
* Show a link to our delicious import page on profile settings form
*
* @param Action $action Profile settings action being shown
*
* @return boolean hook value
*/
function onEndProfileSettingsActions($action)
{
$user = common_current_user();
if (!empty($user) && $user->hasRight(self::IMPORTDELICIOUS)) {
$action->elementStart('li');
$action->element('a', array('href' => common_local_url('importdelicious')), _m('Import del.icio.us bookmarks'));
$action->elementEnd('li');
}
return true;
}
示例11: onStartPrimaryNav
/**
* Add in a Facebook Connect avatar to the primary nav menu
*
* @param Action $action the current action
*
* @return void
*
*/
function onStartPrimaryNav($action)
{
if (self::hasKeys()) {
$user = common_current_user();
if (!empty($user)) {
$fbuid = $this->loggedIn();
if (!empty($fbuid)) {
/* Default FB silhouette pic for FB users who haven't
uploaded a profile pic yet. */
$silhouetteUrl = 'http://static.ak.fbcdn.net/pics/q_silhouette.gif';
$url = $this->getProfilePicURL($fbuid);
$action->elementStart('li', array('id' => 'nav_fb'));
$action->element('img', array('id' => 'fbc_profile-pic', 'src' => !empty($url) ? $url : $silhouetteUrl, 'alt' => 'Facebook Connect User', 'width' => '16'), '');
$iconurl = common_path('plugins/Facebook/fbfavicon.ico');
$action->element('img', array('id' => 'fb_favicon', 'src' => $iconurl));
$action->elementEnd('li');
}
}
}
return true;
}
示例12: onEndGroupActionsList
/**
* To add a "Message" button to the group profile page
*
* @param Action $action The showgroup action being shown
* @param User_group $group The current group
*
* @return boolean hook value
*/
function onEndGroupActionsList($action, $group)
{
$cur = common_current_user();
if (empty($cur)) {
return true;
}
try {
Group_privacy_settings::ensurePost($cur, $group);
} catch (Exception $e) {
return true;
}
$action->elementStart('li', 'entity_send-a-message');
$action->element('a', array('href' => common_local_url('newgroupmessage', array('nickname' => $group->nickname)), 'title' => _('Send a direct message to this group')), _('Message'));
// $form = new GroupMessageForm($action, $group);
// $form->hidden = true;
// $form->show();
$action->elementEnd('li');
return true;
}
示例13: 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');
}
}
示例14: onEndEmailFormData
/**
* Add a checkbox to turn off email summaries
*
* @param Action $action Action being executed (emailsettings)
* @param Profile $scoped Profile for whom settings are configured (current user)
*
* @return boolean hook value
*/
public function onEndEmailFormData(Action $action, Profile $scoped)
{
$action->elementStart('li');
$action->checkbox('emailsummary', _m('Send me a periodic summary of updates from my network'), Email_summary_status::getSendSummary($scoped->id));
$action->elementEnd('li');
return true;
}
示例15: onEndShowInsideFooter
public function onEndShowInsideFooter(Action $action)
{
if ($this->serveMobile) {
// TRANS: Link to switch site layout from mobile to desktop mode. Appears at very bottom of page.
$linkText = _m('Switch to desktop site layout.');
$key = 'mobile-toggle-disable';
} else {
// TRANS: Link to switch site layout from desktop to mobile mode. Appears at very bottom of page.
$linkText = _m('Switch to mobile site layout.');
$key = 'mobile-toggle-enable';
}
$action->elementStart('p');
$action->element('a', array('href' => '#', 'id' => $key), $linkText);
$action->elementEnd('p');
return true;
}