本文整理汇总了PHP中Wizard::canEdit方法的典型用法代码示例。如果您正苦于以下问题:PHP Wizard::canEdit方法的具体用法?PHP Wizard::canEdit怎么用?PHP Wizard::canEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wizard
的用法示例。
在下文中一共展示了Wizard::canEdit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wizardEntityMenu
/**
* change menu items for Wizard entities
*
* @param \ElggMenuItem[] $returnvalue current menu items
* @param \Wizard $entity wizard entity
*
* @return \ElggMenuItem[]
*/
protected static function wizardEntityMenu($returnvalue, \Wizard $entity)
{
$allowed_menu_items = ['access', 'edit', 'delete'];
foreach ($returnvalue as $index => $menu_item) {
$menu_name = $menu_item->getName();
if (!in_array($menu_name, $allowed_menu_items)) {
unset($returnvalue[$index]);
continue;
}
if ($menu_name === 'edit') {
$menu_item->setHref('admin/administer_utilities/wizard/manage?guid=' . $entity->guid);
}
}
if (!$entity->canEdit()) {
return $returnvalue;
}
$returnvalue[] = \ElggMenuItem::factory(['name' => 'copy', 'text' => elgg_echo('wizard:copy'), 'href' => "action/wizard/copy?guid={$entity->getGUID()}", 'is_action' => true, 'priority' => 100]);
$returnvalue[] = \ElggMenuItem::factory(['name' => 'reset', 'text' => elgg_echo('reset'), 'href' => "action/wizard/reset?guid={$entity->getGUID()}", 'confirm' => elgg_echo('wizard:reset:confirm'), 'priority' => 100]);
$returnvalue[] = \ElggMenuItem::factory(['name' => 'manage_steps', 'text' => elgg_echo('admin:administer_utilities:wizard:manage_steps'), 'href' => "admin/administer_utilities/wizard/manage_steps?guid={$entity->getGUID()}", 'priority' => 150]);
return $returnvalue;
}