26 include_once self::$metaboxes_dir .
'class-gravityview-metabox-tab.php';
28 include_once self::$metaboxes_dir .
'class-gravityview-metabox-tabs.php';
40 add_action(
'add_meta_boxes', array( $this,
'register_metaboxes' ) );
42 add_action(
'add_meta_boxes_gravityview', array( $this,
'update_priority' ) );
45 add_action(
'post_submitbox_misc_actions', array( $this,
'render_shortcode_hint' ) );
53 global $wp_meta_boxes;
55 if ( ! empty( $wp_meta_boxes[
'gravityview'] ) ) {
56 foreach ( array(
'high',
'core',
'low' ) as $position ) {
57 if ( isset( $wp_meta_boxes[
'gravityview'][
'normal'][ $position ] ) ) {
58 foreach ( $wp_meta_boxes[
'gravityview'][
'normal'][ $position ] as $key => $meta_box ) {
59 if ( ! preg_match(
'/^gravityview_/ism', $key ) ) {
60 $wp_meta_boxes[
'gravityview'][
'advanced'][ $position ][ $key ] = $meta_box;
61 unset( $wp_meta_boxes[
'gravityview'][
'normal'][ $position ][ $key ] );
73 if ( empty( $post ) || ! is_object( $post ) || ! isset( $post->ID ) ) {
78 add_meta_box(
'gravityview_select_form', $this->
get_data_source_header( $post->ID ), array( $this,
'render_data_source_metabox' ),
'gravityview',
'normal',
'high' );
81 add_meta_box(
'gravityview_select_template', __(
'Choose a View Type',
'gk-gravityview' ), array( $this,
'render_select_template_metabox' ),
'gravityview',
'normal',
'high' );
84 add_meta_box(
'gravityview_view_config', __(
'Layout',
'gk-gravityview' ), array( $this,
'render_view_configuration_metabox' ),
'gravityview',
'normal',
'high' );
89 add_meta_box(
'gravityview_settings', __(
'Settings',
'gk-gravityview' ), array( $this,
'settings_metabox_render' ),
'gravityview',
'normal',
'core' );
105 do_action(
'gravityview/metaboxes/before_render',
$post );
109 include self::$metaboxes_dir .
'views/gravityview-navigation.php';
110 include self::$metaboxes_dir .
'views/gravityview-content.php';
117 do_action(
'gravityview/metaboxes/after_render',
$post );
128 'id' =>
'template_settings',
129 'title' => __(
'View Settings',
'gk-gravityview' ),
130 'file' =>
'view-settings.php',
131 'icon-class' =>
'dashicons-admin-generic',
133 'callback_args' =>
'',
136 'id' =>
'multiple_entries',
137 'title' => __(
'Multiple Entries',
'gk-gravityview' ),
138 'file' =>
'multiple-entries.php',
139 'icon-class' =>
'dashicons-admin-page',
141 'callback_args' =>
'',
144 'id' =>
'single_entry',
145 'title' => __(
'Single Entry',
'gk-gravityview' ),
146 'file' =>
'single-entry.php',
147 'icon-class' =>
'dashicons-media-default',
149 'callback_args' =>
'',
152 'id' =>
'edit_entry',
153 'title' => __(
'Edit Entry',
'gk-gravityview' ),
154 'file' =>
'edit-entry.php',
155 'icon-class' =>
'dashicons-welcome-write-blog',
157 'callback_args' =>
'',
160 'id' =>
'delete_entry',
161 'title' => __(
'Delete Entry',
'gk-gravityview' ),
162 'file' =>
'delete-entry.php',
163 'icon-class' =>
'dashicons-trash',
165 'callback_args' =>
'',
168 'id' =>
'sort_filter',
169 'title' => __(
'Filter & Sort',
'gk-gravityview' ),
170 'file' =>
'sort-filter.php',
171 'icon-class' =>
'dashicons-sort',
173 'callback_args' =>
'',
176 'id' =>
'permissions',
177 'title' => __(
'Permissions',
'gk-gravityview' ),
178 'file' =>
'permissions.php',
179 'icon-class' =>
'dashicons-lock',
181 'callback_args' =>
'',
190 $metaboxes = apply_filters(
'gravityview/metaboxes/default', $metaboxes );
192 foreach ( $metaboxes as $m ) {
194 $tab =
new GravityView_Metabox_Tab( $m[
'id'], $m[
'title'], $m[
'file'], $m[
'icon-class'], $m[
'callback'], $m[
'callback_args'] );
218 if ( ! class_exists(
'GravityView_Admin_Views' ) ) {
219 return __(
'Data Source',
'gk-gravityview' );
226 if ( ! empty( $links ) ) {
227 $links =
'<span class="alignright gv-form-links">' . $links .
'</span>';
235 $_id = isset( $_GET[
'id'] ) ? $_GET[
'id'] : null;
239 '<script type="text/javascript">var form = %s; %s</script>',
241 GFCommon::gf_vars(
false )
247 return __(
'Data Source',
'gk-gravityview' ) .
$output;
258 include self::$metaboxes_dir .
'views/data-source.php';
270 include self::$metaboxes_dir .
'views/select-template.php';
287 $get_id_backup = isset( $_GET[
'id'] ) ? $_GET[
'id'] : null;
289 if ( isset(
$form[
'id'] ) ) {
290 $form_script =
'var form = ' . GFCommon::json_encode(
$form ) .
';';
293 $_GET[
'id'] =
$form[
'id'];
296 $form_script =
'var form = new Form();';
299 $output =
'<script type="text/javascript" data-gv-merge-tags="1">' . $form_script .
"\n" . GFCommon::gf_vars(
false ) .
'</script>';
302 $_GET[
'id'] = $get_id_backup;
316 wp_nonce_field(
'gravityview_view_configuration',
'gravityview_view_configuration_nonce' );
326 echo self::render_merge_tags_scripts(
$curr_form );
328 include self::$metaboxes_dir .
'views/view-configuration.php';
342 include self::$metaboxes_dir .
'views/view-settings.php';
357 if (
false ===
gravityview()->request->is_admin(
'', null ) ) {
366 include self::$metaboxes_dir .
'views/shortcode-hint.php';
const GRAVITYVIEW_DIR
"GRAVITYVIEW_DIR" "./" The absolute path to the plugin directory, with trailing slash ...
static get_connected_form_links( $form, $include_form_link=true)
Get HTML links relating to a connected form, like Edit, Entries, Settings, Preview.
gravityview_get_form( $form_id)
Returns the form object for a given Form ID.
gravityview_get_directory_widgets( $post_id)
Get the widgets, as configured for a View.
gravityview_get_template_settings( $post_id)
Get all the settings for a View.
gravityview_get_directory_fields( $post_id, $apply_filter=true, $form_id=0)
Get the field configuration for the View.
static is_valid()
Is everything compatible with this version of GravityView?
if(gravityview() ->plugin->is_GF_25()) $form
gravityview_get_form_id( $view_id)
Get the connected form ID from a View ID.
gravityview()
The main GravityView wrapper function.
gravityview_get_template_id( $post_id)
Get the template ID (list, table, datatables, map) for a View.
static from_post( $post)
Construct a instance from a .