示例#1
0
        /**
         *
         * @param type $content			 : inner shortcode elements of this column
         * @param string $shortcode_data
         * @return string
         */
        public function element_in_pgbldr($content = '', $shortcode_data = '')
        {
            $column_html = empty($content) ? '' : WR_Pb_Helper_Shortcode::do_shortcode_admin($content, true);
            $span = !empty($this->params['span']) ? $this->params['span'] : 'span12';
            if (empty($shortcode_data)) {
                $shortcode_data = $this->config['shortcode_structure'];
            }
            // remove [/wr_row][wr_column...] from $shortcode_data
            $shortcode_data = explode('][', $shortcode_data);
            $shortcode_data = $shortcode_data[0] . ']';
            // Remove empty value attributes of shortcode tag.
            $shortcode_data = preg_replace('/\\[*([a-z_]*[\\n\\s\\t]*=[\\n\\s\\t]*"")/', '', $shortcode_data);
            $rnd_id = WR_Pb_Utils_Common::random_string();
            $column[] = '<div class="jsn-column-container clearafter shortcode-container ">
							<div class="jsn-column ' . $span . '">
								<div class="thumbnail clearafter">
									<textarea class="hidden" data-sc-info="shortcode_content" name="shortcode_content[]" >' . $shortcode_data . '</textarea>
									<div class="jsn-column-content item-container" data-column-class="' . $span . '" >
										<div class="jsn-handle-drag jsn-horizontal jsn-iconbar-trigger">
											<div class="jsn-iconbar layout">
												<a href="javascript:void(0);" title="Edit Column" data-shortcode="' . $this->config['shortcode'] . '" class="element-edit column" data-use-ajax="' . ($this->config['edit_using_ajax'] ? 1 : 0) . '"><i class="icon-pencil"></i></a>
												<a class="item-delete column" onclick="return false;" title="' . __('Delete column', WR_PBL) . '" href="#"><i class="icon-trash"></i></a>
											</div>
										</div>
										<div class="jsn-element-container item-container-content">
											' . $column_html . '</div>
										<a class="jsn-add-more wr-more-element" href="javascript:void(0);"><i class="icon-plus"></i>' . __('Add Element', WR_PBL) . '</a>
									</div>
									<textarea class="hidden" name="shortcode_content[]" >[/' . $this->config['shortcode'] . ']</textarea>
								</div>
							</div>
						</div>';
            return $column;
        }
示例#2
0
        /**
         *
         * @param type $content		: inner shortcode elements of this row
         * @param type $shortcode_data : not used
         * @return string
         */
        public function element_in_pgbldr($content = '', $shortcode_data = '')
        {
            if (empty($content)) {
                $column = new WR_Column();
                $column_html = $column->element_in_pgbldr();
                $column_html = $column_html[0];
            } else {
                $column_html = WR_Pb_Helper_Shortcode::do_shortcode_admin($content);
            }
            if (empty($shortcode_data)) {
                $shortcode_data = $this->config['shortcode_structure'];
            }
            // remove [/wr_row][wr_column...] from $shortcode_data
            $shortcode_data = explode('][', $shortcode_data);
            $shortcode_data = $shortcode_data[0] . ']';
            // Remove empty value attributes of shortcode tag.
            $shortcode_data = preg_replace('/\\[*([a-z_]*[\\n\\s\\t]*=[\\n\\s\\t]*"")/', '', $shortcode_data);
            $custom_style = WR_Pb_Utils_Placeholder::get_placeholder('custom_style');
            $row[] = '<div class="jsn-row-container ui-sortable row-fluid shortcode-container" ' . $custom_style . '>
						<textarea class="hidden" data-sc-info="shortcode_content" name="shortcode_content[]" >' . $shortcode_data . '</textarea>
						<div class="jsn-iconbar left">
							<a href="javascript:void(0);" title="' . __('Move Up', WR_PBL) . '" class="jsn-move-up disabled"><i class="icon-chevron-up"></i></a>
							<a href="javascript:void(0);" title="' . __('Move Down', WR_PBL) . '" class="jsn-move-down disabled"><i class=" icon-chevron-down"></i></a>
						</div>
						<div class="wr-row-content">
						' . $column_html . '
						</div>
						<div class="jsn-iconbar jsn-vertical">
							<a href="javascript:void(0);" class="add-container" title="' . __('Add column', WR_PBL) . '"><i class="wr-icon-add-col"></i></a>
							<a href="javascript:void(0);" title="Edit row" data-shortcode="' . $this->config['shortcode'] . '" class="element-edit row" data-use-ajax="' . ($this->config['edit_using_ajax'] ? 1 : 0) . '"><i class="icon-pencil"></i></a>
							<a href="javascript:void(0);" class="item-delete row" title="' . __('Delete row', WR_PBL) . '"><i class="icon-trash"></i></a>
						</div>
						<textarea class="hidden" name="shortcode_content[]" >[/' . $this->config['shortcode'] . ']</textarea>
					</div>';
            return $row;
        }
示例#3
0
        _e('Convert and Publish');
        ?>
						</span>
					</button>
				</div>
			</div>
		</div>
		<?php 
    }
    ?>
	<?php 
} else {
    $pagebuilder_content = get_post_meta($post->ID, '_wr_page_builder_content', true);
    if (!empty($pagebuilder_content)) {
        $builder = new WR_Pb_Helper_Shortcode();
        echo balanceTags($builder->do_shortcode_admin($pagebuilder_content));
    }
    ?>
		<a href="javascript:void(0);" id="jsn-add-container"
			class="jsn-add-more"><i class="wr-icon-add-row"></i> <?php 
    _e('Add Row', WR_PBL);
    ?>
		</a>
		<?php 
    // Default layouts
    include WR_PB_TPL_PATH . '/default-layouts.php';
    ?>
		<input type="hidden" id="wr-select-media" value="" />
	<?php 
}
?>
示例#4
0
 /**
  * Update PageBuilder when switch Classic Editor to WR PageBuilder
  *
  * @return string
  */
 function text_to_pagebuilder()
 {
     if (!isset($_POST[WR_NONCE]) || !wp_verify_nonce($_POST[WR_NONCE], WR_NONCE)) {
         return;
     }
     if (!isset($_POST['content'])) {
         return;
     }
     // $content = urldecode( $_POST['content'] );
     $content = $_POST['content'];
     $content = stripslashes($content);
     $empty_str = WR_Pb_Helper_Shortcode::check_empty_($content);
     if (strlen(trim($content)) && strlen(trim($empty_str))) {
         $builder = new WR_Pb_Helper_Shortcode();
         // remove wrap p tag
         $content = preg_replace('/^<p>(.*)<\\/p>$/', '$1', $content);
         $content = balanceTags($content);
         echo balanceTags($builder->do_shortcode_admin($content, false, true));
     } else {
         echo '';
     }
     exit;
 }