示例#1
0
 * @since 1.17
 */
/**
 * @action `gravityview/field/notes/scripts` Print scripts and styles required for the Notes field
 * @see GravityView_Field_Notes::enqueue_scripts
 * @since 1.17
 */
do_action('gravityview/field/notes/scripts');
?>
<form method="post" class="gv-note-add">
	<div>
		<input type="hidden" name="action" value="gv_note_add" />
		<input type="hidden" name="entry-slug" value="{entry_slug}" />
		<input type="hidden" name="show-delete" value="{show_delete}" />
		{nonce_field}
		{email_fields}

		<div class="gv-note-content-container">
			<label for="gv-note-content-{entry_slug}" class="screen-reader-text"><?php 
echo GravityView_Field_Notes::strings('content-label');
?>
</label>
			<textarea name="gv-note-content" id="gv-note-content-{entry_slug}"></textarea>
		</div>

		<button type="submit" class="button gv-add-note-submit"><?php 
echo GravityView_Field_Notes::strings('add-note');
?>
</button>
	</div>
</form>
示例#2
0
$gravityview_view = GravityView_View::getInstance();
$visibility_settings = $gravityview_view->getCurrentFieldSetting('notes');
$show_notes_logged_out = !empty($visibility_settings['view']) && !empty($visibility_settings['view_loggedout']);
if (!GVCommon::has_cap(array('gravityview_view_entry_notes', 'gravityview_add_entry_notes', 'gravityview_delete_entry_notes')) && !$show_notes_logged_out) {
    return;
}
require_once GFCommon::get_base_path() . '/entry_detail.php';
/**
 * @action `gravityview/field/notes/scripts` Print scripts and styles required for the Notes field
 * @see GravityView_Field_Notes::enqueue_scripts
 * @since 1.17
 */
do_action('gravityview/field/notes/scripts');
$entry = $gravityview_view->getCurrentEntry();
$notes = GravityView_Entry_Notes::get_notes($entry['id']);
$strings = GravityView_Field_Notes::strings();
$entry_slug = GravityView_API::get_entry_slug($entry['id'], $entry);
$show_add = !empty($visibility_settings['add']);
$show_delete = !empty($visibility_settings['delete']) && GVCommon::has_cap('gravityview_delete_entry_notes');
$show_notes = $show_notes_logged_out || !empty($visibility_settings['view']) && GVCommon::has_cap('gravityview_view_entry_notes');
$container_class = sizeof($notes) > 0 ? 'gv-has-notes' : 'gv-no-notes';
$container_class .= $show_notes ? ' gv-show-notes' : ' gv-hide-notes';
?>
<div class="gv-notes <?php 
echo $container_class;
?>
">
<?php 
if ($show_notes) {
    ?>
	<form method="post" class="gv-notes-list">