You are here

function layouter_insert_content_into_textarea in Layouter - WYSIWYG layout templates 7

Inserts content, which was templated with Layouter, into textarea.

5 calls to layouter_insert_content_into_textarea()
layouter_extension_example_one_column_width_500_form_submit in modules/layouter_extension_example/layouter_extension_example.module
Submit handler for one_column_width_500 form.
layouter_img_caption_text_form_submit in includes/layouter.pages.inc
Proccess Layouter Form with two_columns_img_left_text_right.
layouter_img_only_form_submit in includes/layouter.pages.inc
Proccess Layouter Form with img_only.
layouter_text_img_form_submit in includes/layouter.pages.inc
Proccess Layouter Form with two_columns_text_img_left.
layouter_two_columns_form_submit in includes/layouter.pages.inc
Proccess Layouter Form with two_columns.

File

includes/layouter.inc, line 236
Functions for layout processing.

Code

function layouter_insert_content_into_textarea($textarea_id, $content) {

  // Extract the id.
  $id = str_replace('layouter-', '', $textarea_id);
  $commands = array();

  // Command to insert into textarea itself.
  $commands[] = ajax_command_invoke(NULL, 'addContent', array(
    $content,
    $id,
  ));

  // Command to insert into CKEditor.
  $commands[] = ajax_command_invoke(NULL, 'layouter', array(
    $textarea_id,
    $content,
  ));

  // Close the pop-up.
  $commands[] = ctools_modal_command_dismiss();
  print ajax_render($commands);
  exit;
}