function tab($tab = array(), $count = 0, $ajax = false)
        {
            ?>
			<li id="<?php 
            echo esc_attr($this->get_field_id('tabs'));
            ?>
-sortable-item-<?php 
            echo esc_attr($count);
            ?>
" class="sortable-item" rel="<?php 
            echo esc_attr($count);
            ?>
">

				<div class="sortable-head cf">
					<div class="sortable-title">
						<strong><?php 
            echo esc_html($tab['title']);
            ?>
</strong>
					</div>
					<div class="sortable-out-delete">
						<span></span>
					</div>
					<div class="sortable-handle">
						<a href="#">Open / Close</a>
					</div>
				</div>

				<div class="sortable-body">
					<p class="tab-desc description">
						<span class="leftHalf">
							<label for="<?php 
            echo esc_attr($this->get_field_id('tabs'));
            ?>
-<?php 
            echo esc_attr($count);
            ?>
-link">
								Feature Link
							</label>
						</span>
						<span class="rightHalf">
							<input type="text" id="<?php 
            echo esc_attr($this->get_field_id('tabs'));
            ?>
-<?php 
            echo esc_attr($count);
            ?>
-link" class="input-full" name="<?php 
            echo esc_attr($this->get_field_name('tabs'));
            ?>
[<?php 
            echo esc_attr($count);
            ?>
][link]" value="<?php 
            echo esc_attr($tab['link']);
            ?>
" />
						</span>
					</p>
					<p class="tab-desc description">
						<span class="leftHalf">
							<label for="<?php 
            echo esc_attr($this->get_field_id('choose_type'));
            ?>
">
								Choose Image Or Icon
							</label>
						</span>
						<span class="rightHalf">
							<span class="rightHalf select">
								<?php 
            $choose_type = array('Icon', 'Image');
            ?>
								<?php 
            /*foreach( $choose_type as $key=>$value) {
            			echo $value .'<br/>';
            		} */
            ?>
							<select id="<?php 
            echo esc_attr($this->get_field_id('tabs'));
            ?>
-<?php 
            echo esc_attr($count);
            ?>
-choose_type"
									name="<?php 
            echo esc_attr($this->get_field_name('tabs'));
            ?>
[<?php 
            echo esc_attr($count);
            ?>
][choose_type]"
									data-fd-handle="feature_icon_image">
								<?php 
            foreach ($choose_type as $key => $value) {
                ?>
									<option value="<?php 
                echo esc_attr($key);
                ?>
" '<?php 
                echo selected(isset($tab['choose_type']) ? $tab['choose_type'] : '', $key, false);
                ?>
'><?php 
                echo esc_url($value);
                ?>
</option>
								<?php 
            }
            ?>
							</select>
							</span>
						</span>
					</p>
					<div class="tab-desc description iconselector" data-fd-rules='["feature_icon_image:equal:0"]'>
						<span class="leftHalf">
							<label for="cc">
								Select Icon
							</label>
						</span>
						<span class="rightHalf icons ">
							<?php 
            echo circleflip_builder_icon_selector(esc_attr($this->get_field_name('tabs')) . "[{$count}][icon]", isset($tab['icon']) ? $tab['icon'] : 'icon-spin3');
            ?>
						</span>
					</div>
					<p class="description" data-fd-rules='["feature_icon_image:equal:1"]'>
						<span class="leftHalf">
							<label for="<?php 
            echo esc_attr($this->get_field_id('image_upload'));
            ?>
-<?php 
            echo esc_attr($count);
            ?>
-image">
								Choose Image
								<?php 
            if (isset($tab['image']) && !empty($tab['image'])) {
                $tab_image = $tab['image'];
                $slider_img_id = isset($tab['imagesrc']) ? $tab['imagesrc'] : '';
            } else {
                $tab_image = '';
                $slider_img_id = '';
            }
            ?>
							</label>
							<span class="description_text">
								Upload your image.
							</span>
						</span>
						<span class="rightHalf">
							<img class="screenshot" src="<?php 
            echo esc_url($tab_image);
            ?>
" alt=""/>
							<input type="hidden" id="<?php 
            echo esc_attr($this->get_field_id('image_upload'));
            ?>
-<?php 
            echo esc_attr($count);
            ?>
-imagesrc"
								   name="<?php 
            echo esc_attr($this->get_field_name('tabs'));
            ?>
[<?php 
            echo esc_attr($count);
            ?>
][imagesrc]"
								   value=<?php 
            echo esc_attr($slider_img_id);
            ?>
 />
							<input type="text" id="<?php 
            echo esc_attr($this->get_field_id('image_upload'));
            ?>
-<?php 
            echo esc_attr($count);
            ?>
-image"
								   class="input-full input-upload" value="<?php 
            echo esc_attr($tab_image);
            ?>
"
								   name="<?php 
            echo esc_attr($this->get_field_name('tabs'));
            ?>
[<?php 
            echo esc_attr($count);
            ?>
][image]">
							<a href="#" class="aq_upload_button button" rel="image">Upload</a>
							<a href="#" class="remove_image button" rel="image">Remove</a>
						</span>
					</p>
					<p class="tab-desc description">
						<span class="leftHalf">
							<label for="<?php 
            echo esc_attr($this->get_field_id('tabs'));
            ?>
-<?php 
            echo esc_attr($count);
            ?>
-title">
								Feature Title
							</label>
						</span>
						<span class="rightHalf">
							<input type="text" id="<?php 
            echo esc_attr($this->get_field_id('tabs'));
            ?>
-<?php 
            echo esc_attr($count);
            ?>
-title" class="input-full" name="<?php 
            echo esc_attr($this->get_field_name('tabs'));
            ?>
[<?php 
            echo esc_attr($count);
            ?>
][title]" value="<?php 
            echo esc_attr($tab['title']);
            ?>
" />
						</span>
					</p>
					<div class="tab-desc description">
						<div class="leftHalf">
							<label for="<?php 
            echo esc_attr($this->get_field_id('tabs'));
            ?>
-<?php 
            echo esc_attr($count);
            ?>
-content">
								Feature Content
							</label>
						</div>
						<div class="rightHalf">
							<?php 
            echo wp_editor($tab['content'], esc_attr($this->get_field_id('tabs')) . '-' . esc_attr($count) . '-' . 'content', array('textarea_name' => esc_attr($this->get_field_name('tabs')) . '[' . $count . '][content]', 'editor_class' => esc_attr($this->get_field_id('tabs')) . '_editor_tabbed', 'quicktags' => false));
            ?>
						</div>
					</div>
					<div class="description half last">
						<span class="leftHalf">
							<label for="<?php 
            echo esc_attr($this->get_field_id('tabs'));
            ?>
-<?php 
            echo esc_attr($count);
            ?>
-color">
								Pick the Icon color
							</label>
							<span class="description_text">
								Choose Icon Color, This Will Apply only for layout 1
							</span>
						</span>
						<span class="rightHalf">
							<div class="aqpb-color-picker">
								<input type="text" id="<?php 
            echo esc_attr($this->get_field_id('tabs'));
            ?>
-<?php 
            echo esc_attr($count);
            ?>
-color" class="input-color-picker" value="<?php 
            if (isset($tab['color']) && !empty($tab['color'])) {
                echo esc_attr($tab['color']);
            }
            ?>
" name="<?php 
            echo esc_attr($this->get_field_name('tabs'));
            ?>
[<?php 
            echo esc_attr($count);
            ?>
][color]" data-default-color="<?php 
            echo esc_attr($tab['color']);
            ?>
"/>
							</div>
						</span>
					</div>
				</div>
			</li>
			<?php 
            $wordpress_version = get_bloginfo('version');
            if ($ajax) {
                ?>
			<script type="text/javascript">
				jQuery(document).ready(function($) {
					jQuery('.wp-editor-area').each(function(index,element) {
						<?php 
                if (version_compare($wordpress_version, '3.9', '>=')) {
                    ?>
						tinymce.PluginManager.load('colorpicker_cf', '<?php 
                    echo get_template_directory_uri();
                    ?>
/creiden-framework/content-builder/assets/js/colorpicker/colorpicker.js');
								tinyMCE.init( {selector: $(element).attr('id'),
								content_css : '<?php 
                    echo get_template_directory_uri() . "/css/fonts/fonts-admin.css";
                    ?>
',
								plugins: [
							        "wordpress textcolor colorpicker_cf directionality wplink"
								],
								menubar: false,
                                                                relative_urls: false,
								font_formats : 	"Andale Mono=andale mono,times;"+
												"Droid Kufi Regular=DroidArabicKufi,arial;"+"Droid Kufi Bold=DroidArabicKufiBold,arial;"+
												"Inika =inikaNormal,arial;"+
												"Arial=arial,helvetica,sans-serif;"+
												"Arial Black=arial black,avant garde;"+
												"Source Sans=sourceSans,arial;"+
												"Source Sans Semibold=sourceSansBold,arial;"+
												"Source Sans Light=sourceSansLight,arial;"+
												"Raleway regular=Raleway,arial;"+
												"Raleway Light=Raleway-light,arial;"+
												"Book Antiqua=book antiqua,palatino;"+
												"Comic Sans MS=comic sans ms,sans-serif;"+
												"Courier New=courier new,courier;"+
												"Georgia=georgia,palatino;"+
												"Helvetica=helvetica;"+
												"Impact=impact,chicago;"+
												"Symbol=symbol;"+
												"Tahoma=tahoma,arial,helvetica,sans-serif;"+
												"Terminal=terminal,monaco;"+
												"Times New Roman=times new roman,times;"+
												"Trebuchet MS=trebuchet ms,geneva;"+
												"Verdana=verdana,geneva;"+
												"Webdings=webdings;"+
												"Wingdings=wingdings,zapf dingbats",
									fontsize_formats : "9px 10px 11px 12px 13px 14px 16px 18px 20px 22px 24px 26px 28px 30px 32px 34px 36px 38px 40px 44px 48px 50px 54px",
									toolbar1 : "save newdocument | bold italic underline strikethrough | justifyleft justifycenter justifyright justifyfull | styleselect formatselect fontselect fontsizeselect",
									toolbar2 : "cut copy paste pastetext pasteword | search replace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image cleanup help code | insertdate inserttime preview | colorpicker_cf  forecolor backcolor alignleft aligncenter alignright alignjustify",
									toolbar3 : "tablecontrols | hr removeformat visualaid | sub sup | charmap emotions iespell media advhr | print | ltr rtl | fullscreen",
									style_formats: [
								        {title: 'Line height 10px', inline: 'span', styles: {'line-height': '10px'}},
								        {title: 'Line height 11px', inline: 'span', styles: {'line-height': '11px'}},
								        {title: 'Line height 12px', inline: 'span', styles: {'line-height': '12px'}},
								        {title: 'Line height 13px', inline: 'span', styles: {'line-height': '13px'}},
								        {title: 'Line height 14px', inline: 'span', styles: {'line-height': '14px'}},
								        {title: 'Line height 15px', inline: 'span', styles: {'line-height': '15px'}},
								        {title: 'Line height 16px', inline: 'span', styles: {'line-height': '16px'}},
								        {title: 'Line height 17px', inline: 'span', styles: {'line-height': '17px'}},
								        {title: 'Line height 18px', inline: 'span', styles: {'line-height': '18px'}},
								        {title: 'Line height 19px', inline: 'span', styles: {'line-height': '19px'}},
								        {title: 'Line height 20px', inline: 'span', styles: {'line-height': '20px'}},
								        {title: 'Line height 21px', inline: 'span', styles: {'line-height': '21px'}},
								        {title: 'Line height 22px', inline: 'span', styles: {'line-height': '22px'}},
								        {title: 'Line height 23px', inline: 'span', styles: {'line-height': '23px'}},
								        {title: 'Line height 24px', inline: 'span', styles: {'line-height': '24px'}},
								        {title: 'Line height 25px', inline: 'span', styles: {'line-height': '25px'}},
								        {title: 'Line height 26px', inline: 'span', styles: {'line-height': '26px'}},
								        {title: 'Line height 27px', inline: 'span', styles: {'line-height': '27px'}},
								        {title: 'Line height 28px', inline: 'span', styles: {'line-height': '28px'}},
								        {title: 'Line height 29px', inline: 'span', styles: {'line-height': '29px'}},
								        {title: 'Line height 30px', inline: 'span', styles: {'line-height': '30px'}},
								        {title: 'Line height 31px', inline: 'span', styles: {'line-height': '31px'}},
								        {title: 'Line height 32px', inline: 'span', styles: {'line-height': '32px'}},
								        {title: 'Line height 33px', inline: 'span', styles: {'line-height': '33px'}},
								        {title: 'Line height 34px', inline: 'span', styles: {'line-height': '34px'}},
								        {title: 'Line height 35px', inline: 'span', styles: {'line-height': '35px'}},
								        {title: 'Line height 36px', inline: 'span', styles: {'line-height': '36px'}},
								        {title: 'Line height 37px', inline: 'span', styles: {'line-height': '37px'}},
								        {title: 'Line height 38px', inline: 'span', styles: {'line-height': '38px'}},
								        {title: 'Line height 39px', inline: 'span', styles: {'line-height': '39px'}},
								        {title: 'Line height 40px', inline: 'span', styles: {'line-height': '40px'}},
								    ]
									} );
								_.delay(function(){
								tinyMCE.execCommand( 'mceAddEditor', true, $(element).attr('id') );
								setTimeout(function() {
									$( 'table.mceLayout' ).css( {
										width: '100%',
										'visibility': 'visible'
									} );
									$( '.wp-editor-container iframe' ).css('height','170px');
									$('.mceToolbar').show();
								},1000)
							}, 500);
						<?php 
                } else {
                    ?>
							tinyMCE.init( {selector: $(element).attr('id'),
							skin: "wp_theme",
							content_css : '<?php 
                    echo get_template_directory_uri() . "/css/fonts/fonts-admin.css";
                    ?>
',
							theme_advanced_fonts : 	"Andale Mono=andale mono,times;"+
													"Droid Kufi Regular=DroidArabicKufi,arial;"+"Droid Kufi Bold=DroidArabicKufiBold,arial;"+
													"Inika =inikaNormal,arial;"+
													"Arial=arial,helvetica,sans-serif;"+
													"Arial Black=arial black,avant garde;"+
													"Source Sans=sourceSans,arial;"+
													"Source Sans Semibold=sourceSansBold,arial;"+
													"Source Sans Light=sourceSansLight,arial;"+
													"Raleway regular=Raleway,arial;"+
													"Raleway Light=Raleway-light,arial;"+
													"Book Antiqua=book antiqua,palatino;"+
													"Comic Sans MS=comic sans ms,sans-serif;"+
													"Courier New=courier new,courier;"+
													"Georgia=georgia,palatino;"+
													"Helvetica=helvetica;"+
													"Impact=impact,chicago;"+
													"Symbol=symbol;"+
													"Tahoma=tahoma,arial,helvetica,sans-serif;"+
													"Terminal=terminal,monaco;"+
													"Times New Roman=times new roman,times;"+
													"Trebuchet MS=trebuchet ms,geneva;"+
													"Verdana=verdana,geneva;"+
													"Webdings=webdings;"+
													"Wingdings=wingdings,zapf dingbats",
							theme_advanced_font_sizes : "9px,10px,11px,12px,13px,14px,16px,18px,20px,22px,24px,26px,28px,30px,32px,34px,36px,38px,40px,44px,48px,50px,54px",
							theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
							theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
							theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",} );
							_.delay(function(){
								tinyMCE.execCommand( 'mceAddControl', true, $(element).attr('id') );
								setTimeout(function() {
									$( 'table.mceLayout' ).css( {
										width: '100%',
										'visibility': 'visible'
									} );
									$( '.wp-editor-container iframe' ).css('height','170px');
									$('.mceToolbar').show();
								},1000)
							}, 500);
						});
						<?php 
                }
                ?>
					});
					});
				</script>
				<?php 
            } else {
                ?>
				<script type="text/javascript">
					function decodeEntities(s){
					    var str, temp= document.createElement('p');
					    temp.innerHTML= s;
					    str= temp.textContent || temp.innerText;
					    temp=null;
					    return str;
					}


					jQuery(document).ready(function($) {
						jQuery('#aqpb-body #<?php 
                echo esc_attr($this->get_field_id('tabs')) . '-' . $count . '-' . 'content';
                ?>
').each(function(index,element) {
						    $(element).html(decodeEntities($(element).text()));
						})
					});
				</script>
				<?php 
            }
        }
Example #2
0
 function circleflip_field_radioButtonIcon($field_id, $block_id, $fields = array(), $selected)
 {
     return circleflip_builder_icon_selector("aq_blocks[{$block_id}][{$field_id}]", $selected);
 }