Beispiel #1
0
	function unset_hidden_sections($template_area_sections, $hook_id){
			
		global $post;

		//Global Section Control Option
		$section_control = epanel_option('section-control');
		
		
		if(is_array($template_area_sections)){
		
			foreach($template_area_sections as $key => $section){
				
				 
				if($hook_id == 'templates') {
					$template_slug = $hook_id.'-'.$this->template_type;
				} elseif ($hook_id == 'main'){
					$template_slug = $hook_id.'-'.$this->main_type;
				} else {
					$template_slug = $hook_id;
				}
				
				$sc = (isset($section_control[$template_slug][$section])) ? $section_control[$template_slug][$section] : null;

					if( isset($sc['hide']) && (!isset($post) || ( isset($post) && !m_epanel('_show_'.$section, $post->ID ))) && (!is_home() || ( is_home() && !isset($sc['posts-page']['show']))) ){
						unset($template_area_sections[$key]);
					} elseif ( (is_home() && isset($sc['posts-page']['hide'])) || (isset($post) && m_epanel('_hide_'.$section, $post->ID ))) {
						unset($template_area_sections[$key]);
					} 
				
				
			}
			
		}
		
		return $template_area_sections;
		
	}
	function _get_image_upload_option($oid, $o){ 
		
		global $post_ID;
		
		?>
		
			<p>
				<label class="context" for="<?php echo $oid;?>"><?php echo $o['label'];?></label>
				<input class="regular-text uploaded_url" type="text" name="<?php echo $oid;?>" value="<?php em_epanel($oid, $post_ID); ?>" /><br/><br/>


				<span id="<?php echo $oid;?>" class="image_upload_button button">Upload Image</span>
				<span title="<?php echo $oid;?>" id="<?php echo $oid;?>" class="image_reset_button button">Remove</span>
				<input type="hidden" class="ajax_action_url" name="wp_ajax_action_url" value="<?php echo admin_url("admin-ajax.php"); ?>" />
				<input type="hidden" class="image_preview_size" name="img_size_<?php echo $oid;?>" value="100"/>
			</p>
			<?php if(m_epanel($oid, $post_ID)):?>
				<img class="epanel_image_preview" id="image_<?php echo $oid;?>" src="<?php em_epanel($oid, $post_ID); ?>" style="max-width: 100px"/>
			<?php endif;?>

		
	<?php }
Beispiel #3
0
	function em_epanel($option, $post, $alt = ''){
		$post_meta = m_epanel($option, $post);
	
		if(isset($post_meta)){
			echo $post_meta;
		}else{
			echo $alt;
		}
	}