本文整理汇总了PHP中GFForms::get_toolbar_menu_items方法的典型用法代码示例。如果您正苦于以下问题:PHP GFForms::get_toolbar_menu_items方法的具体用法?PHP GFForms::get_toolbar_menu_items怎么用?PHP GFForms::get_toolbar_menu_items使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFForms
的用法示例。
在下文中一共展示了GFForms::get_toolbar_menu_items方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form_list_page
//.........这里部分代码省略.........
</td>
<td class="column-title">
<?php
if ($trash) {
echo esc_html($form->title);
} else {
?>
<strong><a class="row-title" disabled="<?php
disabled(true, $trash);
?>
"
href="admin.php?page=gf_edit_forms&id=<?php
echo absint($form->id);
?>
"
title="<?php
esc_attr_e('Edit', 'gravityforms');
?>
"><?php
echo esc_html($form->title);
?>
</a></strong>
<?php
$gf_form_locking->lock_info($form->id);
}
?>
<div class="row-actions">
<?php
if ($trash) {
$form_actions['restore'] = array('label' => __('Restore', 'gravityforms'), 'title' => __('Restore', 'gravityforms'), 'url' => '#', 'onclick' => 'RestoreForm(' . absint($form->id) . ');', 'capabilities' => 'gravityforms_delete_forms', 'priority' => 600);
$form_actions['delete'] = array('label' => __('Delete permanently', 'gravityforms'), 'title' => __('Delete permanently', 'gravityforms'), 'menu_class' => 'delete', 'url' => '#', 'onclick' => 'ConfirmDeleteForm(' . absint($form->id) . ');', 'capabilities' => 'gravityforms_delete_forms', 'priority' => 500);
} else {
require_once GFCommon::get_base_path() . '/form_settings.php';
$form_actions = GFForms::get_toolbar_menu_items($form->id, true);
$form_actions['duplicate'] = array('label' => __('Duplicate', 'gravityforms'), 'title' => __('Duplicate this form', 'gravityforms'), 'url' => '#', 'onclick' => 'DuplicateForm(' . absint($form->id) . ');return false;', 'capabilities' => 'gravityforms_create_form', 'priority' => 600);
$form_actions['trash'] = array('label' => __('Trash', 'gravityforms'), 'title' => __('Move this form to the trash', 'gravityforms'), 'url' => '#', 'onclick' => 'TrashForm(' . absint($form->id) . ');return false;', 'capabilities' => 'gravityforms_delete_forms', 'menu_class' => 'trash', 'priority' => 500);
}
$form_actions = apply_filters('gform_form_actions', $form_actions, $form->id);
echo GFForms::format_toolbar_menu_items($form_actions, true);
?>
</div>
</td>
<td class="column-date"><strong><?php
echo absint($form->view_count);
?>
</strong></td>
<td class="column-date">
<strong>
<?php
if ($form->lead_count > 0 && !$trash) {
?>
<a href="<?php
echo esc_url(admin_url('admin.php?page=gf_entries&view=entries&id=' . absint($form->id)));
?>
"><?php
echo absint($form->lead_count);
?>
</a>
<?php
} else {
echo absint($form->lead_count);
}
?>
</strong>
</td>
示例2: form_list_page
//.........这里部分代码省略.........
<td class="column-title">
<?php
if ($trash) {
echo $form->title;
} else {
?>
<strong><a class="row-title" disabled="<?php
disabled(true, $trash);
?>
"
href="admin.php?page=gf_edit_forms&id=<?php
echo $form->id;
?>
"
title="<?php
_e("Edit", "gravityforms");
?>
"><?php
echo $form->title;
?>
</a></strong>
<?php
$gf_form_locking->lock_info($form->id);
}
?>
<div class="row-actions">
<?php
if ($trash) {
$form_actions['restore'] = array('label' => __("Restore", "gravityforms"), 'title' => __("Restore", "gravityforms"), 'url' => 'javascript:RestoreForm(' . $form->id . ');', 'capabilities' => "gravityforms_delete_forms", 'priority' => 600);
$form_actions['delete'] = array('label' => __("Delete permanently", "gravityforms"), 'title' => __("Delete permanently", "gravityforms"), 'menu_class' => 'delete', 'url' => 'javascript: if(confirm("' . __("WARNING: You are about to delete this form and ALL entries associated with it. ", "gravityforms") . __('\\"Cancel\\" to stop, \\"OK\\" to delete.', "gravityforms") . '")){ DeleteForm(' . $form->id . ');}', 'capabilities' => "gravityforms_delete_forms", 'priority' => 500);
} else {
require_once GFCommon::get_base_path() . '/form_settings.php';
$form_actions = GFForms::get_toolbar_menu_items($form->id, true);
$form_actions['duplicate'] = array('label' => __("Duplicate", "gravityforms"), 'title' => __("Duplicate this form", "gravityforms"), 'url' => 'javascript:DuplicateForm(' . $form->id . ');', 'capabilities' => "gravityforms_create_form", 'priority' => 600);
$form_actions['trash'] = array('label' => __("Trash", "gravityforms"), 'title' => __("Move this form to the trash", "gravityforms"), 'url' => 'javascript:TrashForm(' . $form->id . ');', 'capabilities' => "gravityforms_delete_forms", 'menu_class' => 'trash', 'priority' => 500);
}
$form_actions = apply_filters("gform_form_actions", $form_actions, $form->id);
echo GFForms::format_toolbar_menu_items($form_actions, true);
?>
</div>
</td>
<td class="column-date"><strong><?php
echo $form->view_count;
?>
</strong></td>
<td class="column-date">
<strong>
<?php
if ($form->lead_count > 0 && !$trash) {
?>
<a href="<?php
echo admin_url("admin.php?page=gf_entries&view=entries&id={$form->id}");
?>
"><?php
echo $form->lead_count;
?>
</a>
<?php
} else {
echo $form->lead_count;
}
?>
</strong>
</td>
示例3: handle_row_actions
protected function handle_row_actions($form, $column_name, $primary)
{
if ($primary !== $column_name) {
return '';
}
?>
<div class="row-actions">
<?php
if ($this->filter == 'trash') {
$form_actions['restore'] = array('label' => __('Restore', 'gravityforms'), 'title' => __('Restore', 'gravityforms'), 'url' => '#', 'onclick' => 'RestoreForm(' . absint($form->id) . ');', 'onkeypress' => 'RestoreForm(' . absint($form->id) . ');', 'capabilities' => 'gravityforms_delete_forms', 'priority' => 600);
$form_actions['delete'] = array('label' => __('Delete permanently', 'gravityforms'), 'title' => __('Delete permanently', 'gravityforms'), 'menu_class' => 'delete', 'url' => '#', 'onclick' => 'ConfirmDeleteForm(' . absint($form->id) . ');', 'onkeypress' => 'ConfirmDeleteForm(' . absint($form->id) . ');', 'capabilities' => 'gravityforms_delete_forms', 'priority' => 500);
} else {
$this->locking_info->lock_info($form->id);
require_once GFCommon::get_base_path() . '/form_settings.php';
$form_actions = GFForms::get_toolbar_menu_items($form->id, true);
$form_actions['duplicate'] = array('label' => __('Duplicate', 'gravityforms'), 'title' => __('Duplicate this form', 'gravityforms'), 'url' => '#', 'onclick' => 'DuplicateForm(' . absint($form->id) . ');return false;', 'onkeypress' => 'DuplicateForm(' . absint($form->id) . ');return false;', 'capabilities' => 'gravityforms_create_form', 'priority' => 600);
$form_actions['trash'] = array('label' => __('Trash', 'gravityforms'), 'title' => __('Move this form to the trash', 'gravityforms'), 'url' => '#', 'onclick' => 'TrashForm(' . absint($form->id) . ');return false;', 'onkeypress' => 'TrashForm(' . absint($form->id) . ');return false;', 'capabilities' => 'gravityforms_delete_forms', 'menu_class' => 'trash', 'priority' => 500);
}
$form_actions = apply_filters('gform_form_actions', $form_actions, $form->id);
echo GFForms::format_toolbar_menu_items($form_actions, true);
?>
</div>
<?php
return $column_name === $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __('Show more details') . '</span></button>' : '';
}