public static function add_action_link($actions) { global $post; if ($post->post_type == 'wpak_apps') { if (array_key_exists('trash', $actions)) { $trash_mem = $actions['trash']; unset($actions['trash']); $actions['wpak-view-app-in-browser'] = '<a href="' . WpakBuild::get_appli_index_url($post->ID) . '" target="_blank">' . __('View in browser', WpAppKit::i18n_domain) . '</a>'; $actions['trash'] = $trash_mem; } else { $actions['wpak-view-app-in-browser'] = '<a href="' . WpakBuild::get_appli_index_url($post->ID) . '" target="_blank">' . __('View in browser', WpAppKit::i18n_domain) . '</a>'; } } return $actions; }
public static function inner_publish_box($post, $current_box) { $first_save = !in_array($post->post_status, array('publish', 'future', 'private')) || 0 == $post->ID; ?> <div class="submitbox" id="submitpost"> <div style="display:none;"> <?php submit_button(__('Save'), 'button', 'save'); ?> </div> <div id="minor-publishing"> <div id="minor-publishing-actions"> <div id="preview-action"> <a href="<?php echo WpakBuild::get_appli_index_url($post->ID); ?> " class="preview button" target="_blank"><?php _e('Preview', WpAppKit::i18n_domain); ?> </a> </div> <div class="clear"></div> </div> </div> <div id="misc-publishing-actions"> <?php /* translators: Publish box date format, see http://php.net/date */ $datef = __('M j, Y @ H:i'); if (0 != $post->ID) { if ('publish' == $post->post_status || 'private' == $post->post_status) { // already published $stamp = __('Last saved on: <b>%1$s</b>', WpAppKit::i18n_domain); } else { if ('0000-00-00 00:00:00' == $post->post_date_gmt) { // draft, 1 or more saves, no date specified $stamp = __('Not saved yet', WpAppKit::i18n_domain); } } $date = date_i18n($datef, strtotime($post->post_date)); } else { // draft (no saves, and thus no date specified) $stamp = __('Not saved yet', WpAppKit::i18n_domain); $date = date_i18n($datef, strtotime(current_time('mysql'))); } ?> <div class="misc-pub-section curtime misc-pub-curtime"> <span id="timestamp"> <?php printf($stamp, $date); ?> </span> </div> </div> <div id="major-publishing-actions"> <div id="delete-action"> <?php if (current_user_can("delete_post", $post->ID)) { if (!EMPTY_TRASH_DAYS) { $delete_text = __('Delete Permanently'); } else { $delete_text = __('Move to Trash'); } ?> <a class="submitdelete deletion" href="<?php echo get_delete_post_link($post->ID); ?> "><?php echo $delete_text; ?> </a><?php } ?> </div> <div id="publishing-action"> <span class="spinner"></span> <?php if ($first_save) { ?> <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish'); ?> " /> <?php submit_button(__('Save'), 'primary button-large', 'publish', false, array('accesskey' => 'p')); } else { ?> <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Update'); ?> " /> <?php submit_button(__('Save'), 'primary button-large', 'save', false, array('accesskey' => 'p', 'id' => 'publish')); ?> <?php } ?> </div> <div class="clear"></div> </div> </div> <?php }