function __construct()
 {
     $block_options = array('image' => 'ad.png', 'class' => 'hbSprite-ad icon-megaphone', 'name' => 'AD', 'imagedesc' => '', 'desc' => 'This is an alert Block to show any warning, alert or confirmation message to the user');
     //create the block
     parent::__construct('header_ad', $block_options);
 }
 function __construct()
 {
     $block_options = array('image' => 'spacer.png', 'class' => 'hbSprite-spacer icon-doc-landscape', 'name' => 'Spacer', 'imagedesc' => '', 'desc' => 'This is an alert Block to show any warning, alert or confirmation message to the user');
     //create the block
     parent::__construct('header_spacer', $block_options);
 }
 function __construct()
 {
     $block_options = array('image' => 'social.png', 'class' => 'hbSprite-socialIcons icon-facebook-circled', 'name' => 'Social icons', 'imagedesc' => '', 'desc' => 'This is an alert Block to show any warning, alert or confirmation message to the user');
     //create the block
     parent::__construct('header_social', $block_options);
 }
Example #4
0
function get_header_builder()
{
    global $post;
    $hb_names = get_option('hb_names');
    //$hb_names = array_values($hb_names);
    $postmeta = get_post_meta($post->ID, '_circleflip_headerBuilder');
    $postmeta_slider = get_post_meta($post->ID, '_circleflip_headerBuilder_slider');
    if (!isset($postmeta) || empty($postmeta)) {
        if (is_rtl('global_header_builder_rtl')) {
            $header_name = cr_get_option('global_header_builder_rtl', 0);
        } else {
            $header_name = cr_get_option('global_header_builder', 0);
        }
        $header_name = $hb_names[$header_name];
    } else {
        if ($postmeta[0] != 'global') {
            $header_name = $hb_names[$postmeta[0]];
        } else {
            if (is_rtl('global_header_builder_rtl')) {
                $header_name = cr_get_option('global_header_builder_rtl', 0);
            } else {
                $header_name = cr_get_option('global_header_builder', 0);
            }
            $header_name = $hb_names[$header_name];
        }
    }
    // Get the slider before rendering the header
    if (isset($postmeta_slider) && !empty($postmeta_slider)) {
        echo do_shortcode($postmeta_slider[0]);
    }
    $header_builder = new header_builder();
    $header_builder->render_blocks_view($header_name);
}
Example #5
0
    function circleflip_header_builder_page()
    {
        $hb_names = get_option('hb_names');
        ?>
		<div id="tabs">
			<div class="col-sm-12">
				<form action="options.php" id="hbNamesForm" class="<?php 
        echo isset($hb_names) && !empty($hb_names) ? '' : 'noHeaders';
        ?>
" method="post">
				  	<?php 
        settings_fields('header_builder_names');
        ?>
				  	<div class="headerGear" data-toggle="modal" data-target="#addHeaderModal">
						<span class="">+</span>
					</div>
					<?php 
        if (isset($hb_names) && empty($hb_names)) {
            echo "<p class='firstHeaderText'>Start building your first header</p>";
        }
        ?>
					
					<?php 
        ?>
				  	<div id="addHeaderModal" class="modal fade hbModal">
				  		<div class="modal-dialog">
							<div class="modal-content">
								<div class="modal-body">
								  	<?php 
        $counter = 0;
        if ($hb_names) {
            foreach ($hb_names as $key => $value) {
                ?>
							  				<div class="modalRow row clearfix" style="display: none">
												<div class="col-sm-7">
													<p class="settingName">
														Header name
													</p>
												</div>
												<div class="col-sm-5">
													<input type="hidden" data-originalValue="<?php 
                echo esc_attr($value);
                ?>
" readonly class="hb_names" id="hb_names_input_<?php 
                echo esc_attr($counter);
                ?>
" name="hb_names[<?php 
                echo esc_attr($counter);
                ?>
]" value="<?php 
                echo esc_attr($value);
                ?>
"/>
													<!-- <p><?php 
                echo $value;
                ?>
</p> -->
												</div>
											</div>
											<?php 
                $counter++;
            }
        }
        ?>
									<div class="modalRow row clearfix">
										<div class="col-sm-7">
											<p class="settingName">
												Header name
											</p>
										</div>
										<div class="col-sm-5">
											<input type="text" class="hb_names" name="hb_names[<?php 
        echo esc_attr($counter);
        ?>
]" value=""/>  
										</div>
									</div>
					  			</div>  
		  						<div class="modal-footer">
									<button class="btn btn-primary saveName" type="submit">
										Save Name
									</button>
									<button type="button" class="btn btn-default" data-dismiss="modal">
										Close
									</button>
								</div>
		  					</div>
		  				</div>
		  			</div>
				</form>
				<ul class="headerSelectors">
					<?php 
        if ($hb_names) {
            foreach ($hb_names as $key => $value) {
                ?>
							<li><a href="#tabs-<?php 
                echo esc_attr($key);
                ?>
"><?php 
                echo esc_html($value);
                ?>
</a></li>
						<?php 
            }
        }
        ?>
				</ul>
			</div> 
			<?php 
        if ($hb_names) {
            foreach ($hb_names as $key => $value) {
                $name = "{$value}";
                ?>
				<div id="tabs-<?php 
                echo esc_attr($key);
                ?>
">
					<div class="col-sm-3 grid3">
						<div class="hbItems">
							<ul>
								<?php 
                $header_builder = new header_builder();
                $header_builder->render_blocks($name);
                ?>
							</ul>
						</div>
					</div>
					<div class="col-sm-9 grid3">
						<form action="options.php" method="post" id="creiden-form">
							<?php 
                settings_fields("header_builder_{$key}");
                ?>
								<div class="hbDropArea">
									<?php 
                $hb_blocks = get_option($name, array());
                $temp_blocks['settings'] = array();
                $temp_blocks = $hb_blocks;
                $defaults = array('settings' => array('header_type' => 0, 'bgColor' => '', 'opacity' => '100', 'header_content_color' => 1));
                $temp_blocks = wp_parse_args($temp_blocks, $defaults);
                if (isset($hb_blocks) && !empty($hb_blocks)) {
                    $hb_blocks = $header_builder->prepare_blocks_array($hb_blocks, $name);
                    $header_builder->render_blocks_admin($hb_blocks, $name);
                }
                ?>
								</div>
							<div class="hbHeaderSettings clearfix">
								<div class="pull-left">
									<button type="button" data-toggle="modal" data-target="#<?php 
                echo "modal_{$value}";
                ?>
" class="btn btn-info" ><?php 
                echo "{$value} Settings";
                ?>
</button>
								</div>
								<div class="header_buttons_settings pull-left">
									<button class="btn btn-default clear_headers">Clear All</button>
								</div>
								<div id="optionsframework-submit" class="pull-right">
									<button type="submit" id="header_builder-save-theme-opts" class="btn btn-primary" ><?php 
                echo "Save {$value} Options";
                ?>
</button>
								</div>
								<div class="pull-right">
									<button type="submit" rel="<?php 
                echo esc_attr($value);
                ?>
" class="btn delete_header btn-danger" ><?php 
                echo "Delete {$value}";
                ?>
</button>
								</div>
							</div>
							
							
							
							<div class="modal fade hbModal" id="<?php 
                echo "modal_{$value}";
                ?>
">
								<div class="modal-dialog">
									<div class="modal-content">
										<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal">
												<span aria-hidden="true">×</span><span class="sr-only"></span>
											</button>
											<h4 class="modal-title" id="myModalLabel"><?php 
                echo "<span>{$value}</span> settings";
                ?>
</h4>
										</div>
										<div class="modal-body">
											<div class="modalRow row clearfix headerType selectSwitcherField">
												<div class="col-sm-7">
													<p class="settingName">
														Header type
													</p>
												</div>
												<div class="col-sm-5">
													<select name="<?php 
                echo esc_attr($name . '[settings][header_type]');
                ?>
">
														<option value="0" <?php 
                echo $temp_blocks['settings']['header_type'] == 0 ? "selected='selected'" : '';
                ?>
>Default Header</option>
														<!-- <option value="1" <?php 
                //echo ($temp_blocks['settings']['header_type'] == 1) ?  "selected='selected'" : ''
                ?>
>Side Header</option> -->
														<option value="2" <?php 
                echo $temp_blocks['settings']['header_type'] == 2 ? "selected='selected'" : '';
                ?>
>Overlayed Header</option>
													</select>
												</div>
											</div>
											<div class="selectSwitcher selectSwitcher_2 selectSwitcher_0 settingsColorPicker">
												<div class="modalRow row clearfix">
													<div class="col-sm-7">
														<p class="settingName">
															Backround color
														</p>
													</div>
													<div class="col-sm-5">
														<span class="aqpb-color-picker">
															<input type="text" class="input-color-picker" value="<?php 
                echo $temp_blocks['settings']['bgColor'] ? esc_attr($temp_blocks['settings']['bgColor']) : '#ffffff';
                ?>
" name="<?php 
                echo esc_attr($name . '[settings][bgColor]');
                ?>
" data-default-color="#e32831"/>
														</span>
												    </div>
												</div>
												<div class="modalRow row clearfix">
													<div class="col-sm-7">
														<p class="settingName">
															Opacity
														</p>
														<span class="settingNote">Type the background opacity between 0 to 100.</span>
													</div>
													<div class="col-sm-5">
														<span class="aqpb-color-picker">
															<input type="text" value="<?php 
                echo esc_attr($temp_blocks['settings']['opacity']);
                ?>
" name="<?php 
                echo esc_attr($name . '[settings][opacity]');
                ?>
"/>
														</span>
												    </div>
												</div>
											</div>
											<div class="modalRow row clearfix selectSwitcher selectSwitcher_2">
												<div class="col-sm-7">
													<p class="settingName">
														Content Color
													</p>
													<span class="settingNote">Note: This option only works to the 'Overlayed Header' and it will not apply to the content colors of the fixed rows.</span>
												</div>
												<div class="col-sm-5">
													<select name="<?php 
                echo esc_attr($name . '[settings][header_content_color]');
                ?>
">
														<option value="0" <?php 
                echo $temp_blocks['settings']['header_content_color'] == 0 ? "selected='selected'" : '';
                ?>
>Light Content</option>
														<option value="1" <?php 
                echo $temp_blocks['settings']['header_content_color'] == 1 ? "selected='selected'" : '';
                ?>
>Dark Content</option>
													</select>
												</div>
											</div>
										</div>
										<div class="modal-footer">
											<p>
												Add custom class
											</p>
											<input id="customClass" type="text">
											<button type="button" class="btn btn-primary" data-dismiss="modal">
												Done
											</button>
										</div>
									</div>
								</div>
							</div>
							
						</form>
					</div>
				</div>
			<?php 
            }
        }
        ?>
			<?php 
        if (isset($header_builder)) {
            $header_builder->icon_selector_modal();
        }
        ?>
		</div>
		<div class="hbPreview col-sm-12">
			<header id="branding" role="banner" class="defaultHeader">
			</header>
		</div>
<?php 
    }
 function __construct()
 {
     $block_options = array('image' => 'logo.png', 'class' => 'hbSprite-logo icon-leaf', 'name' => 'Logo', 'imagedesc' => '', 'desc' => 'This is an alert Block to show any warning, alert or confirmation message to the user');
     //create the block
     parent::__construct('header_logo', $block_options);
 }
 function __construct()
 {
     $block_options = array('image' => 'row.png', 'class' => 'hbSprite-headerRow icon-progress-0', 'name' => 'Header Row', 'imagedesc' => '', 'desc' => 'This is an alert Block to show any warning, alert or confirmation message to the user');
     //create the block
     parent::__construct('header_row', $block_options);
 }
 function __construct()
 {
     $block_options = array('image' => 'breaking.png', 'class' => 'hbSprite-breakingNews icon-newspaper', 'name' => 'Breaking News', 'imagedesc' => '', 'desc' => 'This is an alert Block to show any warning, alert or confirmation message to the user');
     //create the block
     parent::__construct('header_breaking', $block_options);
 }