/** * Send js to client for managing content sections * */ function ManageSections() { global $langmessage, $page; includeFile('tool/ajax.php'); //output links ob_start(); echo '<div id="new_section_links" style="display:none" class="inline_edit_area" title="Add">'; self::NewSections(); echo '</div>'; echo 'var section_types = ' . json_encode(ob_get_clean()) . ';'; $scripts = array(); $scripts[] = '/include/thirdparty/js/nestedSortable.js'; $scripts[] = '/include/js/inline_edit/inline_editing.js'; $scripts[] = '/include/js/inline_edit/manage_sections.js'; gpAjax::SendScripts($scripts); die; }
/** * Send js to client for managing content sections * */ function ManageSections() { global $langmessage; includeFile('tool/ajax.php'); //section types $section_types = section_content::GetTypes(); ob_start(); echo '<form action="?">'; echo '<table id="new_section_table"><tr><td>'; echo '<select name="content_type" class="ckeditor_control">'; foreach ($section_types as $type => $type_info) { echo '<option value="' . htmlspecialchars($type) . '">'; echo htmlspecialchars($type_info['label']); echo '</option>'; } echo '</select>'; echo '</td><td>'; echo '<button name="cmd" value="NewSectionContent" class="ckeditor_control" id="add_section" data-cmd="gppost">' . $langmessage['New Section'] . '</button>'; echo '</table>'; echo '</form>'; echo 'var section_types = ' . json_encode(ob_get_clean()) . ';'; $scripts = array(); $scripts[] = '/include/thirdparty/js/nestedSortable.js'; $scripts[] = '/include/js/inline_edit/inline_editing.js'; $scripts[] = '/include/js/inline_edit/manage_sections.js'; gpAjax::SendScripts($scripts); die; }