本文整理汇总了PHP中ElggMenuItem::addLinkClass方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggMenuItem::addLinkClass方法的具体用法?PHP ElggMenuItem::addLinkClass怎么用?PHP ElggMenuItem::addLinkClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElggMenuItem
的用法示例。
在下文中一共展示了ElggMenuItem::addLinkClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reportedcontent_user_hover_menu
/**
* Add report user link to hover menu
*/
function reportedcontent_user_hover_menu($hook, $type, $return, $params)
{
$user = $params['entity'];
/* @var ElggUser $user */
$profile_url = urlencode($user->getURL());
$name = urlencode($user->name);
$url = "reportedcontent/add?address={$profile_url}&title={$name}";
if (elgg_is_logged_in() && elgg_get_logged_in_user_guid() != $user->guid) {
$item = new ElggMenuItem('reportuser', elgg_echo('reportedcontent:user'), $url);
$item->setSection('action');
$item->addLinkClass('elgg-lightbox');
$return[] = $item;
}
return $return;
}
示例2: evaluationcontent_user_hover_menu
/**
* entrada de menu para el usuario solo cuando esta en el viaje
*/
function evaluationcontent_user_hover_menu($hook, $type, $return, $params)
{
$user = $params['entity'];
$trip = elgg_get_page_owner_entity();
// Check for valid trip
if (!elgg_instanceof($trip, 'group')) {
return $return;
}
$tripinfo = urlencode($trip->getGUID());
//or give a valid one $tripinfo = urlencode(309);
$profile_url = urlencode($user->getURL());
$name = urlencode($user->name);
$uid = urlencode($user->guid);
//desconozco por qué motivo despues de este texto se añade ?url=<group_profile> que dificulta leer los valores
$url = "trip_companions/add?profile={$profile_url}&name={$name}&trip={$tripinfo}&uid={$uid}&null";
if (elgg_is_logged_in() && elgg_get_logged_in_user_guid() != $user->guid) {
elgg_load_library('elgg:trip_companions');
if (check_valid_asessment(elgg_get_logged_in_user_guid(), $user->guid, $tripinfo)) {
//all menu items have a class based on their name -- elgg-menu-item-$name
$item = new ElggMenuItem('evaluation-content', elgg_echo('evaluationcontent:user'), $url);
$item->setSection('action');
$item->addLinkClass('elgg-lightbox');
$return[] = $item;
}
}
return $return;
}
示例3: testAddLinkClassWithArray
public function testAddLinkClassWithArray()
{
$item = new \ElggMenuItem('name', 'text', 'url');
$item->setLinkClass('new-link');
$item->addLinkClass(array('2nd-link'));
$this->assertEquals('new-link 2nd-link', $item->getLinkClass());
}