/** * Output for Appendix edit input. */ function anno_appendix_box_content($index = null, $content = null) { $html = ''; if (empty($index) && $index !== 0) { $index = '###INDEX###'; } if (empty($content)) { $content = '<sec> <title></title> <p> </p> </sec>'; } ob_start(); anno_load_editor(anno_process_editor_content($content), esc_attr('appendix-' . $index), array('textarea_name' => esc_attr('anno_appendix[' . $index . ']'))); $editor_markup = ob_get_contents(); ob_end_clean(); $html .= ' <fieldset id="' . esc_attr('anno_appendix_' . $index) . '" class="appendix-wrapper" data-editor="' . esc_attr('appendix-' . $index) . '"> <h4> ' . _x('appendix', 'meta box title', 'anno') . ' ' . esc_html($index) . ' - <a href="#" onclick="deleteannoappendix(jquery(this).parent()); return false;" class="delete">' . _x('delete', 'meta box delete repeater link', 'anno') . '</a> </h4> ' . $editor_markup . ' </fieldset>'; return $html; }
/** * Output for Appendix edit input. */ function anno_appendix_box_content($index = null, $content = null) { $html = ''; if (empty($index) && $index !== 0) { $index = '###INDEX###'; $index_alpha = '###INDEX_ALPHA###'; } else { $index_alpha = anno_index_alpha($index); } if (empty($content)) { $content = '<sec> <heading></heading> <para> </para> </sec>'; } ob_start(); anno_load_editor(anno_process_editor_content($content), esc_attr('appendix-') . $index, array('textarea_name' => esc_attr('anno_appendix[' . $index . ']'))); $editor_markup = ob_get_contents(); ob_end_clean(); $html .= ' <fieldset id="' . esc_attr('anno_appendix_' . $index) . '" class="appendix-wrapper"> <h4> ' . _x('Appendix', 'meta box title', 'anno') . ' ' . esc_html($index_alpha) . ' - <a href="#" onclick="deleteAnnoAppendix(jQuery(this).parent()); return false;" class="delete">' . _x('delete', 'Meta box delete repeater link', 'anno') . '</a> </h4> ' . $editor_markup . ' </fieldset>'; return $html; }
/** * Abstract meta box markup (stored in excerpt) */ function anno_abstract_meta_box($post) { // FIXME: hack because excerpt comes out encoded if (empty($post->post_excerpt)) { $post->post_excerpt = '<p>&#xA0;</p>'; } else { if (html_entity_decode($post->post_excerpt) == $post->post_excerpt) { $post->post_excerpt = '<p>' . $post->post_excerpt . '</p>'; } } anno_load_editor(anno_process_editor_content(html_entity_decode($post->post_excerpt)), "excerpt", array('editor_class' => esc_attr('anno-meta anno-meta-abstract'), 'textarea_name' => esc_attr('excerpt'), 'textarea_rows' => esc_attr('8'))); }
/** * Body meta box markup (stored in content) */ function anno_body_meta_box($post) { global $hook_suffix; if (empty($post->post_content) || $hook_suffix == 'post-new.php') { $content = '<sec> <heading></heading> <para> </para> </sec>'; } else { // Note this is actually post_content_filtered in the db, see 'edit_post_content' filter $content = anno_process_editor_content($post->post_content); } if (function_exists('wp_editor')) { anno_load_editor($content, 'anno-body', array('textarea_name' => 'content')); } else { echo '<p style="padding:0 10px;">' . sprintf(_x('The Annotum editor requires at least WordPress 3.3. It appears you are using WordPress %s. ', 'WordPress version error message', 'anno'), get_bloginfo('version')) . '</p>'; } ?> <?php }