function mfn_builder_show()
{
    global $post;
    $mfn_std_items = array('accordion' => array('type' => 'accordion', 'title' => __('Accordion', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'tabs', 'type' => 'tabs', 'title' => __('Accordion', 'mfn-opts'), 'sub_desc' => __('Manage accordion tabs.', 'mfn-opts')))), 'article_box' => array('type' => 'article_box', 'title' => __('Article box', 'mfn-opts'), 'size' => '1/2', 'fields' => array(array('id' => 'image', 'type' => 'upload', 'title' => __('Image', 'mfn-opts'), 'sub_desc' => __('Featured Image.', 'mfn-opts'), 'desc' => __('Recommended size 380px x 320px.', 'mfn-opts')), array('id' => 'background', 'type' => 'select', 'title' => __('Background color', 'mfn-opts'), 'options' => mfn_get_boxes_backgrounds(), 'desc' => __('Please choose one of the available colors above. When you use one of our <b>Predefined Skins</b> the colors will be get from the skin`s css file, but if you use <b>Custom Skin</b> you are able to define your own colors in Theme Options > Colors > Boxes section.', 'mfn-opts')), array('id' => 'slogan', 'type' => 'text', 'title' => __('Slogan', 'mfn-opts'), 'sub_desc' => __('Call to action text above the title.', 'mfn-opts')), array('id' => 'title', 'type' => 'text', 'title' => __('Title', 'mfn-opts'), 'sub_desc' => __('Will also be used as the image alternative text.', 'mfn-opts')), array('id' => 'link_title', 'type' => 'text', 'title' => __('Button Text', 'mfn-opts'), 'desc' => __('Button will appear only if this field will be filled.', 'mfn-opts')), array('id' => 'link', 'type' => 'text', 'title' => __('Button Link', 'mfn-opts'), 'desc' => __('Button will appear only if this field will be filled.', 'mfn-opts')), array('id' => 'target', 'type' => 'select', 'title' => __('Open in new window', 'mfn-opts'), 'options' => array(0 => 'No', 1 => 'Yes'), 'sub_desc' => __('Open link in a new window.', 'mfn-opts'), 'sub' => __('Adds a target="_blank" attribute to the link.', 'mfn-opts')))), 'blockquote' => array('type' => 'blockquote', 'title' => __('Blockquote', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'content', 'type' => 'textarea', 'title' => __('Content', 'mfn-opts'), 'sub_desc' => __('Blockquote content.', 'mfn-opts'), 'desc' => __('HTML tags allowed.', 'mfn-opts')), array('id' => 'author', 'type' => 'text', 'title' => __('Author', 'mfn-opts')), array('id' => 'link_title', 'type' => 'text', 'title' => __('Link title', 'mfn-opts'), 'desc' => __('Link will appear only if this field will be filled.', 'mfn-opts')), array('id' => 'link', 'type' => 'text', 'title' => __('Link', 'mfn-opts'), 'desc' => __('Link will appear only if this field will be filled.', 'mfn-opts')))), 'call_to_action' => array('type' => 'call_to_action', 'title' => __('Call to action', 'mfn-opts'), 'size' => '1/1', 'fields' => array(array('id' => 'text', 'type' => 'text', 'title' => __('Text', 'mfn-opts'), 'desc' => __('Wrap text into "span" tag to highlight it.', 'mfn-opts')), array('id' => 'btn_title', 'type' => 'text', 'title' => __('Button title', 'mfn-opts'), 'std' => __('Get in touch with us', 'mfn-opts')), array('id' => 'btn_link', 'type' => 'text', 'title' => __('Button link', 'mfn-opts')), array('id' => 'class', 'type' => 'text', 'title' => __('Class', 'mfn-opts'), 'desc' => __('This option is useful when you want to use Fancybox (fancybox) or Video Iframe (iframe).', 'mfn-opts')))), 'clients' => array('type' => 'clients', 'title' => __('Clients', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'count', 'type' => 'text', 'title' => __('Number of items', 'mfn-opts'), 'class' => 'small-text', 'sub_desc' => __('Number of items to show', 'mfn-opts')))), 'code' => array('type' => 'code', 'title' => __('Code', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'content', 'type' => 'textarea', 'title' => __('Content', 'mfn-opts'), 'class' => 'full-width', 'validate' => 'html'))), 'column' => array('type' => 'column', 'title' => __('Column', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'title', 'type' => 'text', 'title' => __('Title', 'mfn-opts'), 'desc' => __('This field is used as an Item Label in admin panel only and shows after page update.', 'mfn-opts')), array('id' => 'content', 'type' => 'textarea', 'title' => __('Column content', 'mfn-opts'), 'desc' => __('Shortcodes and HTML tags allowed.', 'mfn-opts'), 'class' => 'full-width', 'validate' => 'html'))), 'contact_box' => array('type' => 'contact_box', 'title' => __('Contact box', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'title', 'type' => 'text', 'title' => __('Title', 'mfn-opts')), array('id' => 'telephone', 'type' => 'text', 'title' => __('Telephone', 'mfn-opts')), array('id' => 'address', 'type' => 'textarea', 'title' => __('Address', 'mfn-opts'), 'desc' => __('HTML tags allowed.', 'mfn-opts')), array('id' => 'email', 'type' => 'text', 'title' => __('Email', 'mfn-opts')), array('id' => 'twitter', 'type' => 'text', 'title' => __('Twitter', 'mfn-opts')))), 'contact_form' => array('type' => 'contact_form', 'title' => __('Contact form', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'info', 'type' => 'info', 'desc' => __('Please don\'t include multiple Contact Forms on one page.', 'nhp-opts')), array('id' => 'title', 'type' => 'text', 'title' => __('Title', 'mfn-opts')), array('id' => 'email', 'type' => 'text', 'title' => __('Email', 'mfn-opts')))), 'content' => array('type' => 'content', 'title' => __('Content', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'info', 'type' => 'info', 'desc' => __('Adding this Item will show Content from WordPress Editor above Page Options. You can use it only once time per page. Please also remember to turn off "Show The Content" option.', 'nhp-opts')), array('id' => 'inner_padding', 'type' => 'select', 'title' => __('Inner horizontal padding', 'mfn-opts'), 'options' => array(0 => 'No', 1 => 'Yes'), 'std' => 1), array('id' => 'margin', 'type' => 'text', 'title' => __('Margin bottom', 'mfn-opts'), 'desc' => __('px', 'mfn-opts'), 'class' => 'small-text', 'std' => '30'))), 'divider' => array('type' => 'divider', 'title' => __('Divider', 'mfn-opts'), 'size' => '1/1', 'fields' => array(array('id' => 'height', 'type' => 'text', 'title' => __('Divider height', 'mfn-opts'), 'desc' => __('px', 'mfn-opts'), 'class' => 'small-text'), array('id' => 'line', 'type' => 'select', 'title' => __('Show line', 'mfn-opts'), 'options' => array(0 => 'No', 1 => 'Yes'), 'sub_desc' => __('Display horizontal line as a divider.', 'mfn-opts')))), 'faq' => array('type' => 'faq', 'title' => __('FAQ', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'tabs', 'type' => 'tabs', 'title' => __('FAQ', 'mfn-opts'), 'sub_desc' => __('Manage FAQ tabs.', 'mfn-opts')))), 'image' => array('type' => 'image', 'title' => __('Image', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'src', 'type' => 'upload', 'title' => __('Image', 'mfn-opts')), array('id' => 'alt', 'type' => 'text', 'title' => __('Alternate Text', 'mfn-opts')), array('id' => 'caption', 'type' => 'text', 'title' => __('Caption', 'mfn-opts')), array('id' => 'link_image', 'type' => 'upload', 'title' => __('Zoomed image', 'mfn-opts'), 'desc' => __('This image will be opened in lightbox.', 'mfn-opts')), array('id' => 'link', 'type' => 'text', 'title' => __('Link', 'mfn-opts'), 'desc' => __('This link will work only if you leave the above "Zoomed image" field empty.', 'mfn-opts')), array('id' => 'border', 'type' => 'select', 'title' => __('Border', 'mfn-opts'), 'options' => array(0 => 'No', 1 => 'Yes'), 'std' => 1))), 'latest_posts' => array('type' => 'latest_posts', 'title' => __('Latest posts', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'title', 'type' => 'text', 'title' => __('Title', 'mfn-opts'), 'std' => 'Latest posts'), array('id' => 'category', 'type' => 'select', 'title' => __('Category', 'mfn-opts'), 'options' => mfn_get_categories('category'), 'sub_desc' => __('Select posts category.', 'mfn-opts')), array('id' => 'count', 'type' => 'text', 'title' => __('Count', 'mfn-opts'), 'std' => 3, 'class' => 'small-text'))), 'map' => array('type' => 'map', 'title' => __('Map', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'lat', 'type' => 'text', 'title' => __('Google Maps Lat', 'mfn-opts'), 'class' => 'small-text', 'desc' => __('The map will appear only if this field is filled correctly.', 'mfn-opts')), array('id' => 'lng', 'type' => 'text', 'title' => __('Google Maps Lng', 'mfn-opts'), 'class' => 'small-text', 'desc' => __('The map will appear only if this field is filled correctly.', 'mfn-opts')), array('id' => 'height', 'type' => 'text', 'title' => __('Height', 'mfn-opts'), 'desc' => 'px', 'class' => 'small-text', 'std' => 200), array('id' => 'zoom', 'type' => 'text', 'title' => __('Zoom', 'mfn-opts'), 'class' => 'small-text', 'std' => 13))), 'offer_page' => array('type' => 'offer_page', 'title' => __('Offer page', 'mfn-opts'), 'size' => '1/1', 'fields' => array(array('id' => 'orderby', 'type' => 'select', 'title' => __('Order by', 'mfn-opts'), 'sub_desc' => __('Offer items order by column.', 'mfn-opts'), 'options' => array('date' => 'Date', 'menu_order' => 'Menu order', 'title' => 'Title'), 'std' => 'menu_order'), array('id' => 'order', 'type' => 'select', 'title' => __('Order', 'mfn-opts'), 'sub_desc' => __('Offer items order.', 'mfn-opts'), 'options' => array('ASC' => 'Ascending', 'DESC' => 'Descending'), 'std' => 'ASC'))), 'offer' => array('type' => 'offer', 'title' => __('Offer slider', 'mfn-opts'), 'size' => '1/1', 'fields' => array(array('id' => 'title', 'type' => 'text', 'title' => __('Title', 'mfn-opts'), 'class' => 'small-text'), array('id' => 'subtitle', 'type' => 'text', 'title' => __('Subtitle', 'mfn-opts'), 'class' => 'small-text'), array('id' => 'page', 'type' => 'pages_select', 'title' => __('Offer page', 'mfn-opts')), array('id' => 'count', 'type' => 'text', 'title' => __('Count', 'mfn-opts'), 'class' => 'small-text'), array('id' => 'orderby', 'type' => 'select', 'title' => __('Order by', 'mfn-opts'), 'sub_desc' => __('Offer items order by column.', 'mfn-opts'), 'options' => array('date' => 'Date', 'menu_order' => 'Menu order', 'title' => 'Title'), 'std' => 'menu_order'), array('id' => 'order', 'type' => 'select', 'title' => __('Order', 'mfn-opts'), 'sub_desc' => __('Offer items order.', 'mfn-opts'), 'options' => array('ASC' => 'Ascending', 'DESC' => 'Descending'), 'std' => 'ASC'))), 'our_team' => array('type' => 'our_team', 'title' => __('Our team', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'image', 'type' => 'upload', 'title' => __('Photo', 'mfn-opts')), array('id' => 'title', 'type' => 'text', 'title' => __('Title', 'mfn-opts'), 'sub_desc' => __('Will also be used as the image alternative text.', 'mfn-opts')), array('id' => 'subtitle', 'type' => 'text', 'title' => __('Subtitle', 'mfn-opts')), array('id' => 'email', 'type' => 'text', 'title' => __('E-mail', 'mfn-opts')), array('id' => 'facebook', 'type' => 'text', 'title' => __('Facebook', 'mfn-opts')), array('id' => 'twitter', 'type' => 'text', 'title' => __('Twitter', 'mfn-opts')), array('id' => 'linkedin', 'type' => 'text', 'title' => __('LinkedIn', 'mfn-opts')))), 'portfolio' => array('type' => 'portfolio', 'title' => __('Portfolio', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'title', 'type' => 'text', 'title' => __('Title', 'mfn-opts'), 'std' => 'Our recent works'), array('id' => 'background', 'type' => 'select', 'title' => __('Background color', 'mfn-opts'), 'options' => mfn_get_boxes_backgrounds(), 'desc' => __('Please choose one of the available colors above. When you use one of our <b>Predefined Skins</b> the colors will be get from the skin`s css file, but if you use <b>Custom Skin</b> you are able to define your own colors in Theme Options > Colors > Boxes section.', 'mfn-opts')), array('id' => 'count', 'type' => 'text', 'title' => __('Count', 'mfn-opts'), 'std' => '3', 'class' => 'small-text'), array('id' => 'link_title', 'type' => 'text', 'title' => __('Link title', 'mfn-opts'), 'sub_desc' => __('Read more link title', 'mfn-opts'), 'desc' => __('Link will appear only if this field will be filled.', 'mfn-opts'), 'std' => __('Check all', 'mfn-opts')), array('id' => 'link', 'type' => 'text', 'title' => __('Link', 'mfn-opts'), 'sub_desc' => __('Read more link', 'mfn-opts'), 'desc' => __('Link will appear only if this field will be filled.', 'mfn-opts')), array('id' => 'category', 'type' => 'select', 'title' => __('Category', 'mfn-opts'), 'options' => mfn_get_categories('portfolio-types'), 'sub_desc' => __('Select the portfolio post category.', 'mfn-opts')), array('id' => 'orderby', 'type' => 'select', 'title' => __('Order by', 'mfn-opts'), 'sub_desc' => __('Portfolio items order by column.', 'mfn-opts'), 'options' => array('date' => 'Date', 'menu_order' => 'Menu order', 'title' => 'Title'), 'std' => 'menu_order'), array('id' => 'order', 'type' => 'select', 'title' => __('Order', 'mfn-opts'), 'sub_desc' => __('Portfolio items order.', 'mfn-opts'), 'options' => array('ASC' => 'Ascending', 'DESC' => 'Descending'), 'std' => 'ASC'))), 'pricing_item' => array('type' => 'pricing_item', 'title' => __('Pricing item', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'title', 'type' => 'text', 'title' => __('Title', 'mfn-opts'), 'sub_desc' => __('Pricing item title', 'mfn-opts')), array('id' => 'price', 'type' => 'text', 'title' => __('Price', 'mfn-opts'), 'class' => 'small-text'), array('id' => 'currency', 'type' => 'text', 'title' => __('Currency', 'mfn-opts'), 'class' => 'small-text'), array('id' => 'content', 'type' => 'textarea', 'title' => __('Content', 'mfn-opts'), 'desc' => __('HTML tags allowed.', 'mfn-opts'), 'std' => '<ul><li><strong>List</strong> item</li></ul>'), array('id' => 'link_title', 'type' => 'text', 'title' => __('Link title', 'mfn-opts'), 'desc' => __('Link will appear only if this field will be filled.', 'mfn-opts')), array('id' => 'link', 'type' => 'text', 'title' => __('Link', 'mfn-opts'), 'desc' => __('Link will appear only if this field will be filled.', 'mfn-opts')), array('id' => 'featured', 'type' => 'select', 'title' => __('Featured', 'mfn-opts'), 'options' => array(0 => 'No', 1 => 'Yes'), 'sub_desc' => __('This pricing item will be featured.', 'mfn-opts'), 'desc' => __('Featured item is bigger and has different color.', 'mfn-opts')))), 'tabs' => array('type' => 'tabs', 'title' => __('Tabs', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'tabs', 'type' => 'tabs', 'title' => __('Tabs', 'mfn-opts'), 'sub_desc' => __('Manage tabs.', 'mfn-opts')))), 'vimeo' => array('type' => 'vimeo', 'title' => __('Vimeo', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'video', 'type' => 'text', 'title' => __('Vimeo video ID', 'mfn-opts'), 'desc' => __('It`s placed in every Vimeo video link after the last /,for example: http://vimeo.com/<b>1084537</b>', 'mfn-opts')), array('id' => 'width', 'type' => 'text', 'title' => __('Width', 'mfn-opts'), 'desc' => __('px', 'mfn-opts'), 'class' => 'small-text', 'std' => 700), array('id' => 'height', 'type' => 'text', 'title' => __('Height', 'mfn-opts'), 'desc' => __('px', 'mfn-opts'), 'class' => 'small-text', 'std' => 400))), 'youtube' => array('type' => 'youtube', 'title' => __('YouTube', 'mfn-opts'), 'size' => '1/4', 'fields' => array(array('id' => 'video', 'type' => 'text', 'title' => __('YouTube video ID', 'mfn-opts'), 'desc' => __('It`s placed in every YouTube video link after <b>v=</b> parameter, for example: http://www.youtube.com/watch?v=<b>YE7VzlLtp-4</b>', 'mfn-opts')), array('id' => 'width', 'type' => 'text', 'title' => __('Width', 'mfn-opts'), 'desc' => __('px', 'mfn-opts'), 'class' => 'small-text', 'std' => 700), array('id' => 'height', 'type' => 'text', 'title' => __('Height', 'mfn-opts'), 'desc' => __('px', 'mfn-opts'), 'class' => 'small-text', 'std' => 420))));
    $mfn_items = get_post_meta($post->ID, 'mfn-page-items', true);
    $mfn_tmp_fn = 'base' . '64_decode';
    $mfn_items = unserialize(call_user_func($mfn_tmp_fn, $mfn_items));
    ?>
	<div id="mfn-builder">
	
		<div id="mfn-content">
		
			<!-- .mfn-add-item ------------------------------------------------------>
			<div class="mfn-add-item">
				<table class="form-table">
					<tbody>
						<tr valign="top">
							<th scope="row">
								Content builder
								<span class="description">Add new item to the content</span>
							</th>
							<td>
								<select id="mfn-add-select">
									<option value="">&mdash; Select &mdash;</option>		
									<?php 
    foreach ($mfn_std_items as $item) {
        echo '<option value="' . $item['type'] . '">' . $item['title'] . '</option>';
    }
    ?>
								</select>
								<a class="btn-blue mfn-add-btn" href="javascript:void(0);">Add item</a>
								<span class="description">Choose an element and click the Add Item button</span>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
				
			
			<!-- #mfn-items ----------------------------------------------------------->
			<div id="mfn-items" class="clearfix">
			
				<?php 
    foreach ($mfn_std_items as $item) {
        mfn_builder_item($item);
    }
    ?>
								
			</div><!-- #mfn-items ------------------------------------------------------->

			<!-- #mfn-desk -------------------------------------------------------------->
			<div id="mfn-desk" class="clearfix">
			
				<?php 
    if (is_array($mfn_items)) {
        foreach ($mfn_items as $item) {
            mfn_builder_item($mfn_std_items[$item['type']], $item);
        }
    }
    ?>
			
			</div>
	
		</div>
		
		<!-- #mfn-popup -->
		<div id="mfn-popup">
			<a href="javascript:void(0);" class="mfn-btn-close mfn-popup-close"><em>close</em></a>	
			<a href="javascript:void(0);" class="mfn-popup-save">Save changes</a>	
		</div>
		
	</div>
	<?php 
}
示例#2
0
        case "slider_thumbnail":
            if (has_post_thumbnail()) {
                the_post_thumbnail('50x50');
            }
            break;
        case "slider_order":
            echo $post->menu_order;
            break;
    }
}
add_action("manage_posts_custom_column", "mfn_slide_custom_columns");
/*-----------------------------------------------------------------------------------*/
/*	Define Metabox Fields
/*-----------------------------------------------------------------------------------*/
$mfn_slide_prefix = 'mfn-slide-';
$mfn_slide_meta_box = array('id' => 'mfn-meta-slide', 'title' => __('Slide Options', 'mfn-opts'), 'page' => 'slide', 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('id' => $mfn_slide_prefix . 'text', 'type' => 'textarea', 'title' => __('Text', 'mfn-opts'), 'sub_desc' => __('Slide content text.', 'mfn-opts')), array('id' => $mfn_slide_prefix . 'link_title', 'type' => 'text', 'title' => __('Button text', 'mfn-opts'), 'desc' => __('Button will appear only if this field will be filled.', 'mfn-opts')), array('id' => $mfn_slide_prefix . 'link', 'type' => 'text', 'title' => __('Button link', 'mfn-opts'), 'desc' => __('Button will appear only if this field will be filled.', 'mfn-opts')), array('id' => $mfn_slide_prefix . 'position', 'type' => 'select', 'title' => __('Image position', 'mfn-opts'), 'options' => array('slide-left-img' => 'Left', 'slide-right-img' => 'Right'), 'std' => 'slide-left-img'), array('id' => $mfn_slide_prefix . 'background', 'type' => 'select', 'title' => __('Background color', 'mfn-opts'), 'options' => mfn_get_boxes_backgrounds(), 'desc' => __('Please choose one of the available colors above. When you use one of our <b>Predefined Skins</b> the colors will be get from the skin`s css file, but if you use <b>Custom Skin</b> you are able to define your own colors in Theme Options > Colors > Boxes section.', 'mfn-opts')), array('id' => $mfn_slide_prefix . 'video_vimeo', 'type' => 'text', 'title' => __('Vimeo video ID', 'mfn-opts'), 'desc' => __('It’s placed in every Vimeo video link after the last /, for example: http://vimeo.com/<b>1084537</b>', 'mfn-opts'), 'class' => 'small-text'), array('id' => $mfn_slide_prefix . 'video_youtube', 'type' => 'text', 'title' => __('YouTube video ID', 'mfn-opts'), 'desc' => __('It’s placed in every YouTube video link after v= parameter.<br /><br />For example: http://www.youtube.com/watch?v=<b>YE7VzlLtp-4</b>', 'mfn-opts'), 'class' => 'small-text')));
/*-----------------------------------------------------------------------------------*/
/*	Add metabox to edit page
/*-----------------------------------------------------------------------------------*/
function mfn_slide_meta_add()
{
    global $mfn_slide_meta_box;
    add_meta_box($mfn_slide_meta_box['id'], $mfn_slide_meta_box['title'], 'mfn_slide_show_box', $mfn_slide_meta_box['page'], $mfn_slide_meta_box['context'], $mfn_slide_meta_box['priority']);
}
add_action('admin_menu', 'mfn_slide_meta_add');
/*-----------------------------------------------------------------------------------*/
/*	Callback function to show fields in meta box
/*-----------------------------------------------------------------------------------*/
function mfn_slide_show_box()
{
    global $MFN_Options, $mfn_slide_meta_box, $post;