/**
  * Renders the layout data for a new column group.
  *
  * @since 1.7
  * @param string $node_id The node ID of a row to add the new group to.
  * @param string $cols The type of column layout to use.
  * @param int $position The position of the new column group in the row.
  * @return array
  */
 public static function render_new_column_group($node_id, $cols = '1-col', $position = false)
 {
     // Add the group.
     $group = FLBuilderModel::add_col_group($node_id, $cols, $position);
     // Render the group.
     ob_start();
     FLBuilder::render_column_group($group);
     $html = ob_get_clean();
     // Return the response.
     return array('partial' => true, 'nodeType' => $group->type, 'html' => $html, 'js' => 'FLBuilder._renderLayoutComplete();');
 }
Пример #2
0
 /**
  * Adds a new column group and renders it.
  *
  * @since 1.0
  * @param string $node_id The node ID of a row to add the new group to.
  * @param string $cols The type of column layout to use.
  * @param int $position The position of the new column group in the row.
  * @return void
  */
 public static function render_new_column_group($node_id = null, $cols = '1-col', $position = false)
 {
     $post_data = FLBuilderModel::get_post_data();
     $node_id = isset($post_data['node_id']) ? $post_data['node_id'] : $node_id;
     $cols = isset($post_data['cols']) ? $post_data['cols'] : $cols;
     $position = isset($post_data['position']) ? (int) $post_data['position'] : $position;
     $group = FLBuilderModel::add_col_group($node_id, $cols, $position);
     self::render_column_group($group);
     if (defined('DOING_AJAX')) {
         die;
     }
 }