| 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=' . $this->plugin['slug']; |
| 24 |
|
| 25 |
?> |
| 26 |
<form action="<?php echo $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 here</label> |
| 37 |
<input type="text" name="title" size="30" value="<?php echo $title; ?>" id="title" |
| 38 |
placeholder="<?php esc_attr_e( 'Register an item name', $this->plugin['text'] ); ?>"> |
| 39 |
</div> |
| 40 |
|
| 41 |
</div> |
| 42 |
</div> |
| 43 |
|
| 44 |
<!-- Sidebar with the setting--> |
| 45 |
<div id="postbox-container-1" class="postbox-container"> |
| 46 |
|
| 47 |
<?php include_once( 'add-new/targeting.php' ); // Include the targets ?> |
| 48 |
|
| 49 |
<div id="submitdiv" class="postbox "> |
| 50 |
<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e( 'Publish', $this->plugin['text'] ); ?></span> |
| 51 |
<?php echo self::pro(); ?> |
| 52 |
</h2> |
| 53 |
|
| 54 |
<div class="inside"> |
| 55 |
|
| 56 |
|
| 57 |
<div class="container"> |
| 58 |
<div class="element"> |
| 59 |
<?php echo self::option( $show ); ?> |
| 60 |
|
| 61 |
<span id="shortcode"> |
| 62 |
<code>[<?php echo $this->plugin['shortcode']; ?> id="<?php echo $tool_id; ?>"]</code> |
| 63 |
</span> |
| 64 |
</div> |
| 65 |
</div> |
| 66 |
|
| 67 |
<div class="submitbox" id="submitpost"> |
| 68 |
|
| 69 |
<div id="major-publishing-actions"> |
| 70 |
|
| 71 |
<div id="delete-action"> |
| 72 |
<?php if ( ! empty( $id ) ) { |
| 73 |
echo '<a class="submitdelete deletion" href="admin.php?page=' . $this->plugin['slug'] . |
| 74 |
'&info=delete&did=' . $id . '">' . esc_attr__( 'Delete', $this->plugin['text'] ) . '</a>'; |
| 75 |
}; ?> |
| 76 |
</div> |
| 77 |
|
| 78 |
<div id="publishing-action"> |
| 79 |
<span class="saving"><?php esc_html_e( 'Saving', $this->plugin['text'] ); ?></span> <input |
| 80 |
name="submit" id="submit" |
| 81 |
class="button button-primary button-large" |
| 82 |
value="<?php echo $btn; ?>" type="submit"> |
| 83 |
</div> |
| 84 |
|
| 85 |
<div class="clear"></div> |
| 86 |
|
| 87 |
</div> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
</div> |
| 91 |
</div> |
| 92 |
|
| 93 |
<!-- Block for main settings pages--> |
| 94 |
<div id="postbox-container-2" class="postbox-container"> |
| 95 |
<div id="postoptions" class="postbox "> |
| 96 |
<div class="inside"> |
| 97 |
|
| 98 |
<div class="tab-box"> |
| 99 |
<ul class="tab-nav"> |
| 100 |
<?php |
| 101 |
$tab_menu = array( |
| 102 |
'main' => __( 'Settings', $this->plugin['text'] ), |
| 103 |
'menu' => __( 'Menu', $this->plugin['text'] ), |
| 104 |
|
| 105 |
); |
| 106 |
$i = 1; |
| 107 |
foreach ( $tab_menu as $menu => $val ) { |
| 108 |
echo '<li><a href="#t' . $i . '">' . $val . '</a></li>'; |
| 109 |
$i ++; |
| 110 |
} |
| 111 |
?> |
| 112 |
</ul> |
| 113 |
<div class="tab-panels"> |
| 114 |
<?php |
| 115 |
$t = 1; |
| 116 |
foreach ( $tab_menu as $menu => $val ) { |
| 117 |
echo '<div id="t' . $t . '">'; |
| 118 |
// includes the settings pages |
| 119 |
include_once( 'add-new/' . $menu . '.php' ); |
| 120 |
echo '</div>'; |
| 121 |
$t ++; |
| 122 |
} |
| 123 |
?> |
| 124 |
</div> |
| 125 |
</div> |
| 126 |
|
| 127 |
</div> |
| 128 |
</div> |
| 129 |
</div> |
| 130 |
|
| 131 |
</div> |
| 132 |
</div> |
| 133 |
|
| 134 |
<!-- main param for adding in database--> |
| 135 |
<input type="hidden" name="tool_id" value="<?php echo $tool_id; ?>" id="tool_id"/> |
| 136 |
<input type="hidden" name="param[time]" value="<?php echo time(); ?>"/> |
| 137 |
<input type="hidden" name="add" id="add_action" value="<?php echo $add_action; ?>"/> |
| 138 |
<input type="hidden" name="id" value="<?php echo $id; ?>"/> |
| 139 |
<input type="hidden" name="data" value="<?php echo $data; ?>"/> |
| 140 |
<input type="hidden" name="page" value="<?php echo $this->plugin['slug']; ?>"/> |
| 141 |
<input type="hidden" name="prefix" value="<?php echo $this->plugin['prefix']; ?>" id="prefix"/> |
| 142 |
<?php wp_nonce_field( $this->plugin['slug'] . '_action', $this->plugin['slug'] . '_nonce' ); ?> |
| 143 |
|
| 144 |
</form> |
| 145 |
|
| 146 |
<div id="clone" style="display: none;"> |
| 147 |
<?php include_once('add-new/clone.php'); ?> |
| 148 |
</div> |
| 149 |
|
| 150 |
<?php |
| 151 |
|