: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) exit;
$moduleTemplate = array();
$layoutTemplate = array();
add_action("plugins_loaded", "ampforwp_module_templates");
if(!function_exists("ampforwp_module_templates")){
function ampforwp_module_templates(){
global $moduleTemplate, $layoutTemplate;
$dir = AMP_PAGE_BUILDER.'/modules/';
if('post-new.php' == $pagenow || 'post.php' == $pagenow || 'index.php' == $pagenow){
if (is_dir($dir) && $checkpb) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if(is_file($dir.$file) && strpos($file, '-module.php') == true){
$moduleTemplate[str_replace("-module.php", "", $file)] = include $dir.$file;
$moduleTemplate = apply_filters("ampforwp_pagebuilder_modules_filter", $moduleTemplate);
$dir = AMP_PAGE_BUILDER.'/layouts/';
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if(is_dir($dir.$file) && strpos($file, '-layouts') == true){
$layoutTemplate[str_replace('-layouts', "", $file)] = array();
$layoutdir = $dir.$file."/";
if ($dhInside = opendir($layoutdir)) {
while (($layoutfile = readdir($dhInside)) !== false) {
if(is_file($layoutdir.$layoutfile) && strpos($layoutfile, '-layout.php') == true){
$layoutTemplate[str_replace('-layouts', "", $file)][str_replace(".php", "", $layoutfile)] = include $layoutdir.$layoutfile;
/*if(is_file($dir.$file) && strpos($file, '-layout.php') == true){
$layoutTemplate[str_replace(".php", "", $file)] = include $dir.$file;
$layoutTemplate = apply_filters("ampforwp_pagebuilder_layout_filter", $layoutTemplate);
}//If Fucntion check closed
$ampforwp_module_output = '<section {{if_row_id}}id={{row_id}}{{ifend_row_id}} class="ap_m {{row_class}} {{grid_type}} {{mobile_display}} {{if_condition_check_for_slant==1}}slant_clr{{ifend_condition_check_for_slant_1}}">
{{if_condition_background_type==video}}
<amp-iframe class="vdo" width="854" height="480"
sandbox="allow-scripts allow-same-origin"
src="{{row_background_video}}">
{{if_condition_check_for_overlay==1}}
<div class="overlay"></div>
{{ifend_condition_check_for_overlay_1}}
{{ifend_condition_background_type_video}}
{{if_condition_background_type==mp4video}}
<amp-video class="vdo" width="720" height="405"
{{if_condition_enable_mp4video_autoplay==1}}autoplay{{ifend_condition_enable_mp4video_autoplay_1}}
src="{{row_background_mp4video}}"
{{if_condition_enable_youtube_loop==1}}loop{{ifend_condition_enable_youtube_loop_1}}
{{if_condition_enable_mp4video_controls==1}}controls{{ifend_condition_enable_mp4video_controls_1}}>
{{if_condition_check_for_overlay==1}}
<div class="overlay"></div>
{{ifend_condition_check_for_overlay_1}}
{{ifend_condition_background_type_mp4video}}
{{if_condition_background_type==youtubevideo}}
<amp-youtube class="vdo" width="480" height="270"
{{if_condition_enable_youtube_controls==1}}data-param-controls=1{{ifend_condition_enable_youtube_controls_1}}
{{if_condition_enable_youtube_controls==0}}data-param-controls=0{{ifend_condition_enable_youtube_controls_0}}
{{if_condition_enable_modestbranding==1}}data-param-modestbranding="1"{{ifend_condition_enable_modestbranding_1}}
{{if_condition_enable_youtube_rel==1}}data-param-rel="1"{{ifend_condition_enable_youtube_rel_1}}
{{if_condition_enable_youtube_rel==0}}data-param-rel="0"{{ifend_condition_enable_youtube_rel_0}}
{{if_condition_enable_youtube_loop==1}}loop{{ifend_condition_enable_youtube_loop_1}}
data-videoid="{{row_background_youtubevideo}}"
{{if_condition_enable_youtube_autoplay==1}}autoplay{{ifend_condition_enable_youtube_autoplay_1}}>
{{if_condition_check_for_overlay==1}}
<div class="overlay"></div>
{{ifend_condition_check_for_overlay_1}}
{{ifend_condition_background_type_youtubevideo}}
$outputEnd = '<div class="cb"></div> </section>';
{{if_condition_background_type==image}}
background-image: url({{row_background_image}});
background-repeat: no-repeat;
background-position:{{align_type}};
{{if_condition_check_for_parallax==1}}
background-attachment: initial;
{{ifend_condition_check_for_parallax_1}}
{{ifend_condition_background_type_image}}
{{row-class}}.amppb-fluid{width:{{fluid-width}};}
{{row-class}}.amppb-fluid .col, {{row-class}}.amppb-fluid .col-2-wrap{margin:0 auto;max-width:{{fluid-wrapper}}; }
{{row-class}}.amppb-fixed .col {max-width:{{content-width}};width:{{fixed-width}};margin: 0 auto;}
{{if_condition_check_for_brdr==1}}
border-width:{{border_sz}};
border-color: {{border_clr_pkr}};
{{ifend_condition_check_for_brdr_1}}
color: {{font_color_picker}};
background-color: {{color_picker}};
{{if_selected_gradient}}{{selected_gradient}};{{ifend_selected_gradient}}
{{if_condition_check_for_slant==1}}
{{row-class}}.st{position:relative;}
{{ifend_condition_check_for_slant_1}}
{{if_condition_check_for_enbtp==1}}
background-image:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' preserveAspectRatio=\'none\' viewBox=\'0 0 100 100\'><polygon fill=\'{{color_picker}}\' points=\'0,0 100,0 100,44 0,0\' /></svg>");
background-repeat:no-repeat;
{{if_condition_align_type_slant==left}}
transform: rotate(-180deg);
{{ifend_condition_align_type_slant_left}}
{{if_condition_align_type_slant==right}}
transform: rotate(-180deg) scaleX(-1);
{{ifend_condition_align_type_slant_right}}
{{ifend_condition_check_for_enbtp_1}}
{{if_condition_check_for_enbbt==1}}
background-image:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' preserveAspectRatio=\'none\' viewBox=\'0 0 100 100\'><polygon fill=\'{{color_picker}}\' points=\'0,0 100,0 100,44 0,0\' /></svg>");
background-repeat:no-repeat;
{{if_condition_align_type_slate_btn==lft}}
transform: rotate(-0deg) scaleX(-1);
{{ifend_condition_align_type_slate_btn_lft}}
{{if_condition_align_type_slate_btn==rht}}
{{ifend_condition_align_type_slate_btn_rht}}
{{ifend_condition_check_for_enbbt_1}}
{{if_condition_background_type==video}}
{{row-class}} .amp_video{
{{row-class}} .amp_video .amp-txt{
line-height: {{cnt_ln_hgt}};
font-weight: {{cnt_font_type}};
{{if_condition_check_for_overlay==0}}
{{ifend_condition_check_for_overlay_0}}
{{row-class}} .amp-txt h1{
font-weight: {{tlt_wgt}};
letter-spacing: {{letter_spacing}};
line-height: {{tlt_ln_hgt}};
{{if_condition_check_for_overlay==0}}
{{ifend_condition_check_for_overlay_0}}
{{if_condition_check_for_overlay==1}}
color:{{overlay_cnt_color}};
{{ifend_condition_check_for_overlay_1}}
{{ifend_condition_background_type_video}}
{{if_condition_background_type==mp4video}}
{{row-class}} .amp_video{
{{row-class}} .amp_video .amp-txt{
line-height: {{cnt_ln_hgt}};
font-weight: {{cnt_font_type}};
{{if_condition_check_for_overlay==0}}
{{ifend_condition_check_for_overlay_0}}
{{row-class}} .amp-txt h1{
font-weight: {{tlt_wgt}};
letter-spacing: {{letter_spacing}};
line-height: {{tlt_ln_hgt}};
{{if_condition_check_for_overlay==0}}
{{ifend_condition_check_for_overlay_0}}
{{if_condition_check_for_overlay==1}}
color:{{overlay_cnt_color}};
{{ifend_condition_check_for_overlay_1}}
{{ifend_condition_background_type_mp4video}}
{{if_condition_background_type==youtubevideo}}
{{row-class}} .amp_video{
{{row-class}} .amp_video .amp-txt{
line-height: {{cnt_ln_hgt}};
font-weight: {{cnt_font_type}};
{{if_condition_check_for_overlay==0}}
{{ifend_condition_check_for_overlay_0}}
{{row-class}} .amp-txt h1{
font-weight: {{tlt_wgt}};
letter-spacing: {{letter_spacing}};
line-height: {{tlt_ln_hgt}};
{{if_condition_check_for_overlay==0}}
{{ifend_condition_check_for_overlay_0}}
{{if_condition_check_for_overlay==1}}
color:{{overlay_cnt_color}};
{{ifend_condition_check_for_overlay_1}}
{{ifend_condition_background_type_youtubevideo}}
{{row-class}}.amppb-fluid{width:100%;}
{{row-class}}.amppb-fluid .col, {{row-class}}.amppb-fluid .col-2-wrap{max-width:{{fluid-wrapper}};}
{{if_condition_check_for_pdng==1}}
{{ifend_condition_check_for_pdng_1}}
{{if_condition_check_for_mrgn==1}}
{{ifend_condition_check_for_mrgn_1}}
$front_common_css = '.amppb-fluid .col{margin:0 auto;max-width:{{fluid-width}}; }
.amppb-fixed .col {max-width: {{fixed-width}};width:1125px;margin: 0 auto;}';
/*border-size: {{border_css}};
border-style:{{border_type}};*/
$containerCommonSettings = array(
'label' => 'Row Settings',
'default_tab'=> 'customizer',
'container_css'=>'Advance',
'label' =>esc_html__('Row ID', 'accelerated-mobile-pages'),
'default' =>'amppb-fluid',
'required' => array('grid_type'=>'amppb-fixed')
'name' =>"content-width",
'label' =>'Content Width',
'required' => array('grid_type'=>'amppb-fixed')
'required' => array('grid_type'=>'amppb-fluid')
'name' =>"fluid-wrapper",
'required' => array('grid_type'=>'amppb-fluid')
'name' =>"font_color_picker",
'label' => esc_html__( 'Overlay Text Color', 'accelerated-mobile-pages' ),
'output_format'=>"color: %default%"
'name' => "mobile_display",
'label' => esc_html__('Mobile Display'),
'label'=> 'Side By Side',
'content_type' => 'html',
'name' =>"background_type",
'label' => esc_html__("Background Type", 'accelerated-mobile-pages' ),
'options_details'=>array(
'image'=>'Background Image',
'video'=>'Background Video (Third Party Embed)',
'mp4video'=>'Background Video (MP4)',
'youtubevideo'=>'Background Video (Youtube)',
'type' =>'require_script',
'name' =>"embeded_script",
'default' =>'https://cdn.ampproject.org/v0/amp-iframe-0.1.js',
'required' => array('background_type'=>'video'),
'type' =>'require_script',
'name' =>"embeded_script",
'default' =>'https://cdn.ampproject.org/v0/amp-video-0.1.js',