function default_pages_settings()
{
    foreach ($_REQUEST as $keys => $values) {
        ${$keys} = trim($values);
    }
    $return_data = array('success' => '-1', 'alert' => 'Save option failed, please try contacting your host provider to increase the post_max_size and suhosin.post.max_vars varialble on the server.');
    ?>
	

	<div class="cp-wrapper bootstrap_admin cp-margin-left"> 

    <!--content area start -->	  
	<div class="hbg top_navigation row-fluid">
		<div class="cp-logo span2">
			<img src="<?php 
    echo CP_PATH_URL;
    ?>
/framework/images/logo.png" class="logo" />
		</div>
		<div class="sidebar span10">
			<?php 
    echo top_navigation_html_tooltip();
    ?>
		</div>
	 <?php 
    //echo top_navigation_html();
    ?>
	</div>
	<div class="content-area-main row-fluid"> 
	
      <!--sidebar start -->
      <div class="sidebar-wraper span2">
        <div class="sidebar-sublinks">
  <ul id="wp_t_o_right_menu">
				<li id="active_tab" class="default_pages"><?php 
    _e('Default Pages Settings', 'crunchpress');
    ?>
</li>
			</ul>
        </div>
      </div>
      <!--sidebar end --> 
      <!--content start -->
      <div class="content-area span10 default_cate_sec">
	  <?php 
    //echo top_navigation_html();
    ?>
        <form id="options-panel-form" name="cp-panel-form">
          <div class="panel-elements" id="panel-elements">
            <div class="panel-element" id="panel-element-save-complete">
              <div class="panel-element-save-text"><?php 
    _e('Save Options Complete', 'crunchpress');
    ?>
.</div>
              <div class="panel-element-save-arrow"></div>
            </div>
            <div class="panel-element">
			<?php 
    if (isset($action) and $action == 'default_pages_settings') {
        $default_pages_xml = '<default_pages_settings>';
        $default_pages_xml = $default_pages_xml . create_xml_tag('sidebar_default', $sidebars);
        $default_pages_xml = $default_pages_xml . create_xml_tag('right_sidebar_default', $right_sidebar_default);
        $default_pages_xml = $default_pages_xml . create_xml_tag('left_sidebar_default', $left_sidebar_default);
        $default_pages_xml = $default_pages_xml . create_xml_tag('default_excerpt', $default_excerpt);
        $default_pages_xml = $default_pages_xml . '</default_pages_settings>';
        if (!save_option('default_pages_settings', get_option('default_pages_settings'), $default_pages_xml)) {
            die(json_encode($return_data));
        }
        die(json_encode(array('success' => '0')));
    }
    $sidebar_default = '';
    $right_sidebar_default = '';
    $left_sidebar_default = '';
    $default_excerpt = '';
    $cp_default_settings = get_option('default_pages_settings');
    if ($cp_default_settings != '') {
        $cp_default = new DOMDocument();
        $cp_default->loadXML($cp_default_settings);
        $sidebar_default = find_xml_value($cp_default->documentElement, 'sidebar_default');
        $right_sidebar_default = find_xml_value($cp_default->documentElement, 'right_sidebar_default');
        $left_sidebar_default = find_xml_value($cp_default->documentElement, 'left_sidebar_default');
        $default_excerpt = find_xml_value($cp_default->documentElement, 'default_excerpt');
    }
    ?>
	
			</div>
			<h3> <?php 
    _e('Category Pages, Search, Archives, Taxonomy, Tags.', 'crunchpress');
    ?>
 </h3>
			<div class="sidebar_default_sec">
				<?php 
    echo show_sidebar($sidebar_default, 'right_sidebar_default', 'left_sidebar_default', $right_sidebar_default, $left_sidebar_default);
    ?>
			</div>
			
			<ul class="default_excerpt recipe_class row-fluid">
				<li class="panel-input span8">
					<span class="panel-title">
						<h3 for="default_excerpt" > <?php 
    _e('Default Excerpt', 'crunchpress');
    ?>
 </h3>
					</span>	
					<input type="text" name="default_excerpt" id="default_excerpt" value="<?php 
    if ($default_excerpt != '') {
        echo $default_excerpt;
    }
    ?>
" />
				</li>
				<li class="description span4"><p><?php 
    _e('Please Paste Your Default Excerpt(Number of words).', 'crunchpress');
    ?>
</p></li>
			</ul>
  
            <div class="panel-element-tail">
              <div class="tail-save-changes">
                <div class="loading-save-changes"></div>
                <input type="submit" value="<?php 
    echo __('Save Changes', 'crunchpress');
    ?>
">
                <input type="hidden" name="action" value="default_pages_settings">
                <!--<input type="hidden" name="security" value="<?php 
    //echo wp_create_nonce(plugin_basename(__FILE__))
    ?>
">--> 
              </div>
            </div>
          </div>
        </form>
      </div>
      <!--content End --> 
    </div>
    <!--content area end --> 
  </div>
	<?php 
}
Esempio n. 2
0
  </div>

    <div id="topnav">
      <?php 
//show_links( link_place, format[ nolist->with out <li> or default <li>%s</li>, before, after )
show_links('top-navigation', 'nolist');
?>
    </div>

  <div id="main">
    <div id="left">
      <h2>Navigation</h2>
	  <div id="leftnav">
      	<ul>
		  <?php 
show_sidebar();
?>
        </ul>
		  <?php 
show_content_area('Below Navigation');
?>
	  </div>
    </div>
    <div id="right">
	  <?php 
show_content_slug();
?>
    </div>
 </div>

<div class="break">&nbsp;</div>
Esempio n. 3
0
function add_post_option_element()
{
    // init array
    $post_social = '';
    $sidebars = '';
    $right_sidebar_post = '';
    $left_sidebar_post = '';
    $audio_url_type = '';
    $post_thumbnail = '';
    $video_url_type = '';
    $select_slider_type = '';
    foreach ($_REQUEST as $keys => $values) {
        ${$keys} = $values;
    }
    global $post, $post_id;
    $post_detail_xml = get_post_meta($post->ID, 'post_detail_xml', true);
    if ($post_detail_xml != '') {
        $cp_post_xml = new DOMDocument();
        $cp_post_xml->loadXML($post_detail_xml);
        $post_social = find_xml_value($cp_post_xml->documentElement, 'post_social');
        $sidebars = find_xml_value($cp_post_xml->documentElement, 'sidebar_post');
        $right_sidebar_post = find_xml_value($cp_post_xml->documentElement, 'right_sidebar_post');
        $left_sidebar_post = find_xml_value($cp_post_xml->documentElement, 'left_sidebar_post');
        $audio_url_type = find_xml_value($cp_post_xml->documentElement, 'audio_url_type');
        $post_thumbnail = find_xml_value($cp_post_xml->documentElement, 'post_thumbnail');
        $video_url_type = find_xml_value($cp_post_xml->documentElement, 'video_url_type');
        $select_slider_type = find_xml_value($cp_post_xml->documentElement, 'select_slider_type');
    }
    ?>
		<div class="event_options cp-wrapper">
			<div class="row-fluid">
				<ul class="event_social_class recipe_class span12">
					<li class="panel-input">
						<span class="panel-title">
							<h3 for="post_social" > <?php 
    _e('SOCIAL NETWORKING', 'crunchpress');
    ?>
 </h3>
						</span>	
						<label for="post_social"><div class="checkbox-switch <?php 
    echo $post_social == 'enable' || $post_social == '' && empty($default) ? 'checkbox-switch-on' : 'checkbox-switch-off';
    ?>
"></div></label>
					<input type="checkbox" name="post_social" class="checkbox-switch" value="disable" checked>
					<input type="checkbox" name="post_social" id="post_social" class="checkbox-switch" value="enable" <?php 
    echo $post_social == 'enable' || $post_social == '' && empty($default) ? 'checked' : '';
    ?>
>
					<p><?php 
    _e('You can turn On/Off social sharing from event detail.', 'crunchpress');
    ?>
</p>
					</li>
					
				</ul>
			</div>
			<div class="clear"></div>
			<?php 
    //Condition for Library
    echo show_sidebar($sidebars, 'right_sidebar_post', 'left_sidebar_post', $right_sidebar_post, $left_sidebar_post);
    ?>
			<div class="clear"></div>
			<div class="row-fluid">
				<ul class="recipe_class span3">
					<li class="panel-input">	
						<span class="panel-title">
							<h3 for="post_thumbnail"><?php 
    _e('Select Type', 'crunchpress');
    ?>
</h3>
						</span>
						<div class="combobox">
							<select name="post_thumbnail" id="event_thumbnail">
								<option class="Image" value="Image" <?php 
    if ($post_thumbnail == 'Image') {
        echo 'selected';
    }
    ?>
><?php 
    echo __('Feature Image', 'crunchpress');
    ?>
</option>
								<option class="Audio" value="Audio" <?php 
    if ($post_thumbnail == 'Audio') {
        echo 'selected';
    }
    ?>
><?php 
    echo __('Audio', 'crunchpress');
    ?>
</option>
								<option class="Video" value="Video" <?php 
    if ($post_thumbnail == 'Video') {
        echo 'selected';
    }
    ?>
><?php 
    echo __('Video', 'crunchpress');
    ?>
</option>
								<option class="Slider" value="Slider" <?php 
    if ($post_thumbnail == 'Slider') {
        echo 'selected';
    }
    ?>
><?php 
    echo __('Slider', 'crunchpress');
    ?>
</option>
							</select>
						</div>
						<p><?php 
    _e('Please select your post type of content.', 'crunchpress');
    ?>
</p></li>			
					</li>
					
				</ul>
				<ul class="video_class recipe_class span3">						
					<li class="panel-input">
						<span class="panel-title">
							<label for="video_url_type" > <?php 
    _e('Video URL', 'crunchpress');
    ?>
 </label>
						</span>		
						<input type="text" name="video_url_type" id="video_url_type" value="<?php 
    if ($video_url_type != '') {
        echo $video_url_type;
    }
    ?>
" />
						<p><?php 
    _e('Please paste Youtube or Vimeo url.', 'crunchpress');
    ?>
</p>
					</li>
				</ul>
				<ul class="audio_class recipe_class span3">
					<li class="panel-input">
						<span class="panel-title">
							<h3> <?php 
    _e('AUDIO MP3 URL', 'crunchpress');
    ?>
 </h3>
						</span>
						<input type="text" name="audio_url_type" id="audio_url_type" value="<?php 
    if ($audio_url_type != '') {
        echo $audio_url_type;
    }
    ?>
" />
						<p><?php 
    _e('Please paste mp3 audio url.', 'crunchpress');
    ?>
</p>
					</li>
				</ul>
				<ul class="select_slider_option recipe_class span3">				
					<li class="panel-input">	
						<span class="panel-title">
							<h3><?php 
    _e('Select Images Slide', 'crunchpress');
    ?>
</h3>
						</span>
						<div class="combobox">
							<select name="select_slider_type" id="select_slider_type">
								<?php 
    foreach (get_title_list_array('cp_slider') as $values) {
        ?>
									<option value="<?php 
        echo $values->ID;
        ?>
" <?php 
        if ($select_slider_type == $values->ID) {
            echo 'selected';
        }
        ?>
><?php 
        echo $values->post_title;
        ?>
</option>
								<?php 
    }
    ?>
							</select>
						</div>
						<p><?php 
    _e('Please select slide to show in post.', 'crunchpress');
    ?>
</p>
					</li>
				</ul>
			</div>
			<div class="clear"></div>
			<input type="hidden" name="default_post" value="post">			
			<div class="clear"></div>
		</div>	
		<div class="clear"></div> <?php 
}