forked from ellatrix/wp-front-end-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeta-modal-template.php
146 lines (111 loc) · 4.32 KB
/
meta-modal-template.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<div id="wp-fee-notice-area" class="wp-core-ui">
<?php if ( $notice ) : ?>
<div id="notice" class="error"><p id="has-newer-autosave"><?php echo $notice ?></p></div>
<?php endif; ?>
<?php if ( $message ) : ?>
<div id="message" class="updated"><p><?php echo $message; ?></p></div>
<?php endif; ?>
<div id="lost-connection-notice" class="error hidden">
<p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you’re reconnected.' ); ?>
<span class="hide-if-no-sessionstorage"><?php _e( 'We’re backing up this post in your browser, just in case.' ); ?></span>
</p>
</div>
</div>
<div id="local-storage-notice" class="hidden">
<p class="local-restore">
The backup of this post in your browser is different from the version below. <a class="restore-backup" href="#">Restore the backup.</a>
</p>
<p class="undo-restore hidden">
Post restored successfully. <a class="undo-restore-backup" href="#">Undo.</a>
</p>
</div>
<form id="wp-fee-meta-modal" style="display: none;">
<input type="hidden" id="post_ID" name="post_ID" value="<?php echo $post->ID; ?>">
<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type; ?>">
<input type="hidden" id="post_author" name="post_author" value="<?php echo $post->post_author; ?>">
<?php wp_nonce_field( 'update-post_' . $post->ID ); ?>
<?php if ( ! empty( $active_post_lock ) ) { ?>
<input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>">
<?php } ?>
<div class="media-modal wp-core-ui">
<a class="media-modal-close" href="#" title="Close">
<span class="media-modal-icon"></span>
</a>
<div class="media-modal-content">
<div class="media-frame wp-core-ui hide-router">
<div class="media-frame-menu">
<div class="media-menu">
<?php
$i = 0;
ksort( $wp_meta_modal_sections );
$array_keys = array_keys( $wp_meta_modal_sections );
foreach ( $wp_meta_modal_sections as $context => $priorities ) {
if ( is_array( $priorities ) ) {
ksort( $priorities );
foreach ( $priorities as $priority => $sections ) {
if ( is_array( $sections ) ) {
foreach ( $sections as $section ) {
$i++;
?>
<a id="media-menu-<?php echo $section['id']; ?>" class="media-menu-item<?php echo $i === 1 ? ' active' : ''; ?>" href="#" data-box="<?php echo $section['id']; ?>"><?php echo $section['title']; ?></a>
<?php
}
}
}
if ( $context !== end( $array_keys ) ) {
?>
<div class="separator"></div>
<?php
}
}
}
?>
</div>
</div>
<div class="media-frame-title">
<h1>Publish</h1>
</div>
<div class="media-frame-content" style="top: 0;border-top: none;">
<div class="media-frame-content-inner" style="position: relative;">
<?php
$i = 0;
foreach ( $wp_meta_modal_sections as $context => $priorities ) {
if ( is_array( $priorities ) ) {
ksort( $priorities );
foreach ( $priorities as $priority => $sections ) {
if ( is_array( $sections ) ) {
foreach ( $sections as $section ) {
$i++;
?>
<div id="wp-fee-meta-modal-box-<?php echo $section['id']; ?>" class="wp-fee-meta-modal-box" data-box="<?php echo $section['id']; ?>">
<div class="media-frame-sub-title<?php echo $i === 1 ? ' media-frame-sub-title-first' : ''; ?>" data-box="<?php echo $section['id']; ?>">
<h1><?php echo $section['title']; ?></h1>
</div>
<div id="<?php echo $section['id']; ?>" style="padding: 16px;">
<div class="inside">
<?php call_user_func( $section['callback'], $post, $section ); ?>
</div>
</div>
</div>
<?php
}
}
}
}
}
?>
</div>
</div>
<div class="media-frame-toolbar">
<div class="media-toolbar">
<div class="media-toolbar-secondary"></div>
<div class="media-toolbar-primary">
<a id="wp-fee-met-continue" class="button button-primary media-button button-large" href="#">Continue editing</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="media-modal-backdrop"></div>
</form>