/** * 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; }
private function xml_appendices($article) { $appendices = get_post_meta($article->ID, '_anno_appendices', true); $xml = ''; if (!empty($appendices) && is_array($appendices)) { $xml = ' <app-group>'; foreach ($appendices as $appendix_key => $appendix) { if (!empty($appendix)) { $xml .= ' <app id="app' . ($appendix_key + 1) . '"> <title>' . sprintf(_x('Appendix %s', 'xml appendix title', 'anno'), anno_index_alpha($appendix_key)) . '</title>' . $appendix . ' </app>'; } } $xml .= ' </app-group>'; } return $xml; }