<div class="js-code-editor code-editor layout-css-editor"> <div class="code-editor-toolbar js-code-editor-toolbar"> <ul> <li></li> </ul> </div> <!-- THERE SHOULDN'T BE ANY NEW LINE IN TEXT AREA TAG OTHERWISE CREATES A VISUAL BUG --> <ul class="codemirror-bookmarks js-codemirror-bookmarks"></ul> <textarea name="ddl-<?php echo $dialog_type; ?> -css-editor" id="ddl-<?php echo $dialog_type; ?> -css-editor" class="js-ddl-css-editor-area"><?php WPDD_GUI_EDITOR::print_layouts_css(); ?> </textarea> </div> <p class="js-need-css-help"> <?php _e('Need help with CSS styling?', 'ddl-layouts'); ?> <a href="<?php echo WPDDL_CSS_STYLING_LINK; ?> " target="_blank"><?php _e('Using HTML and CSS to style layout cells', 'ddl-layouts'); ?> »</a>
function ddl_render_editor($inline) { global $wpddlayout; // Get layout if ($inline) { $post = get_post($_GET['post']); $layout_json = WPDD_Layouts::get_layout_json_settings_encoded_64($post->ID); if (!$layout_json) { // This post doesn't have a layout so create an empty one $preset_dir = WPDDL_RES_ABSPATH . '/preset-layouts/'; $layout = $wpddlayout->load_layout($preset_dir . '4-evenly-spaced-columns.ddl'); // Force fluid when using in post editor. $layout['type'] = 'fluid'; for ($i = 0; $i < sizeof($layout['Rows']); $i++) { $layout['Rows'][$i]['layout_type'] = 'fluid'; } $layout_json = wp_json_encode($layout); } } else { $post = get_post($_GET['layout_id']); // $layout_json_not_decoded = WPDD_Layouts::get_layout_settings($post->ID); $layout_json = WPDD_Layouts::get_layout_json_settings_encoded_64($post->ID); } ob_start(); WPDD_GUI_EDITOR::load_js_templates('/js/templates'); include_once 'templates/editor_box.tpl.php'; echo ob_get_clean(); }