| 1 |
<?php |
| 2 |
/** |
| 3 |
* Add new Element |
| 4 |
* |
| 5 |
* @package Wow_Plugin |
| 6 |
* @subpackage Admin/Add_Item |
| 7 |
* @author Dmytro Lobov <d@dayes.dev> |
| 8 |
* @copyright 2019 Wow-Company |
| 9 |
* @license GNU Public License |
| 10 |
* @version 1.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
// include the database params for item |
| 18 |
include_once( 'include-data.php' ); |
| 19 |
|
| 20 |
// include the settings param |
| 21 |
include_once( 'add-new/settings/add-new.php' ); |
| 22 |
|
| 23 |
$url_form = admin_url() . 'admin.php?page=' . esc_attr( $this->plugin['slug'] ); |
| 24 |
|
| 25 |
?> |
| 26 |
<form action="<?php echo esc_url( $url_form ); ?>" method="post" name="post" class="wow-plugin" id="wow-plugin"> |
| 27 |
<div id="poststuff"> |
| 28 |
<div id="post-body" class="metabox-holder columns-2"> |
| 29 |
|
| 30 |
<!-- Block with the Title and content--> |
| 31 |
<div id="post-body-content" style="position: relative;"> |
| 32 |
|
| 33 |
<div id="titlediv"> |
| 34 |
|
| 35 |
<div id="titlewrap"> |
| 36 |
<label class="screen-reader-text" id="title-prompt-text" for="title">Enter title |
| 37 |
here</label> |
| 38 |
<input type="text" name="title" size="30" value="<?php echo esc_attr( $title ); ?>" |
| 39 |
id="title" |
| 40 |
placeholder="<?php esc_attr_e( 'Register an item name', $this->plugin['text'] ); ?>"> |
| 41 |
</div> |
| 42 |
|
| 43 |
</div> |
| 44 |
</div> |
| 45 |
|
| 46 |
<!-- Sidebar with the setting--> |
| 47 |
<div id="postbox-container-1" class="postbox-container"> |
| 48 |
|
| 49 |
<?php include_once( 'add-new/targeting.php' ); // Include the targets ?> |
| 50 |
|
| 51 |
<div id="submitdiv" class="postbox "> |
| 52 |
<h2 class="hndle ui-sortable-handle"> |
| 53 |
<span><?php esc_html_e( 'Publish', $this->plugin['text'] ); ?></span> |
| 54 |
<?php self::pro(); ?> |
| 55 |
</h2> |
| 56 |
|
| 57 |
<div class="inside"> |
| 58 |
|
| 59 |
|
| 60 |
<div class="container"> |
| 61 |
<div class="element"> |
| 62 |
<?php self::option( $show ); ?> |
| 63 |
|
| 64 |
<span id="shortcode"> |
| 65 |
<code>[<?php echo esc_attr( $this->plugin['shortcode'] ); ?> id="<?php echo absint( $tool_id ); ?>"]</code> |
| 66 |
</span> |
| 67 |
</div> |
| 68 |
</div> |
| 69 |
|
| 70 |
<div class="submitbox" id="submitpost"> |
| 71 |
|
| 72 |
<div id="major-publishing-actions"> |
| 73 |
|
| 74 |
<div id="delete-action"> |
| 75 |
<?php if ( ! empty( $id ) ) { |
| 76 |
echo '<a class="submitdelete deletion" href="admin.php?page=' . esc_attr( $this->plugin['slug'] ) . |
| 77 |
'&info=delete&did=' . absint( $id ) . '">' . esc_attr__( 'Delete', $this->plugin['text'] ) . '</a>'; |
| 78 |
}; ?> |
| 79 |
</div> |
| 80 |
|
| 81 |
<div id="publishing-action"> |
| 82 |
<span class="saving"><?php esc_html_e( 'Saving', $this->plugin['text'] ); ?></span> |
| 83 |
<input name="submit" id="submit" class="button button-primary button-large" |
| 84 |
value="<?php echo esc_attr( $btn ); ?>" type="submit"> |
| 85 |
</div> |
| 86 |
|
| 87 |
<div class="clear"></div> |
| 88 |
|
| 89 |
</div> |
| 90 |
</div> |
| 91 |
</div> |
| 92 |
</div> |
| 93 |
</div> |
| 94 |
|
| 95 |
<!-- Block for main settings pages--> |
| 96 |
<div id="postbox-container-2" class="postbox-container"> |
| 97 |
<div id="postoptions" class="postbox "> |
| 98 |
<div class="inside"> |
| 99 |
|
| 100 |
<div class="tab-box"> |
| 101 |
<ul class="tab-nav"> |
| 102 |
<?php |
| 103 |
$tab_menu = array( |
| 104 |
'main' => __( 'Settings', $this->plugin['text'] ), |
| 105 |
'menu' => __( 'Menu', $this->plugin['text'] ), |
| 106 |
|
| 107 |
); |
| 108 |
$i = 1; |
| 109 |
foreach ( $tab_menu as $menu => $val ) { |
| 110 |
echo '<li><a href="#t' . absint( $i ) . '">' . esc_html( $val ) . '</a></li>'; |
| 111 |
$i ++; |
| 112 |
} |
| 113 |
?> |
| 114 |
</ul> |
| 115 |
<div class="tab-panels"> |
| 116 |
<?php |
| 117 |
$t = 1; |
| 118 |
foreach ( $tab_menu as $menu => $val ) { |
| 119 |
echo '<div id="t' . absint( $t ) . '">'; |
| 120 |
include_once( 'add-new/' . esc_attr( $menu ) . '.php' ); |
| 121 |
echo '</div>'; |
| 122 |
$t ++; |
| 123 |
} |
| 124 |
?> |
| 125 |
</div> |
| 126 |
</div> |
| 127 |
|
| 128 |
</div> |
| 129 |
</div> |
| 130 |
</div> |
| 131 |
|
| 132 |
</div> |
| 133 |
</div> |
| 134 |
|
| 135 |
<!-- main param for adding in database--> |
| 136 |
<input type="hidden" name="tool_id" value="<?php echo absint( $tool_id ); ?>" id="tool_id"/> |
| 137 |
<input type="hidden" name="add" id="add_action" value="<?php echo absint( $add_action ); ?>"/> |
| 138 |
<input type="hidden" name="prefix" value="<?php echo esc_attr( $this->plugin['prefix'] ); ?>" id="prefix"/> |
| 139 |
<?php wp_nonce_field( $this->plugin['slug'] . '_action', $this->plugin['slug'] . '_nonce' ); ?> |
| 140 |
|
| 141 |
</form> |
| 142 |
|
| 143 |
<div id="clone" style="display: none;"> |
| 144 |
<?php include_once( 'add-new/clone.php' ); ?> |
| 145 |
</div> |
| 146 |
|
| 147 |
<?php |
| 148 |
|