Exemple #1
0
    function fave_post_settings_metabox($object, $box)
    {
        $fave_meta = fave_get_post_meta($object->ID);
        $sidebars_lay = fave_get_sidebar_layouts();
        $post_layouts = fave_get_post_layouts(true);
        $sidebars = fave_get_sidebars_list();
        ?>
	  	
	  	
	   <div class="favethemes_meta_control">
	   		<p class="fave-inline-title-wrap"><span class="fave_meta_title"><?php 
        _e('Post Template:', 'magzilla');
        ?>
</span></p>
	   		<div class="fave-inline-block-wrap">
			  	<ul class="fave-img-select-wrap">
			  	<?php 
        foreach ($post_layouts as $id => $layout) {
            ?>
			  		<li>
			  			<?php 
            $selected_class = $id == $fave_meta['post_layout'] ? ' selected' : '';
            ?>
			  			<img src="<?php 
            echo $layout['img'];
            ?>
" title="<?php 
            echo $layout['title'];
            ?>
" class="fave-img-select<?php 
            echo $selected_class;
            ?>
">
			  			<span><?php 
            //echo $layout['title'];
            ?>
</span>
			  			<input type="radio" class="fave-hidden" name="fave[post_layout]" value="<?php 
            echo $id;
            ?>
" <?php 
            checked($id, $fave_meta['post_layout']);
            ?>
/> </label>
			  		</li>
			  	<?php 
        }
        ?>
			   </ul>
		   </div>
	   </div>

	   <div class="favethemes_meta_control">
	   		<p class="fave-inline-title-wrap"><span class="fave_meta_title"><?php 
        _e('Sidebar Position:', 'magzilla');
        ?>
</span></p>
	   		<div class="fave-inline-block-wrap">
			  	<ul class="fave-img-select-wrap">
			  	<?php 
        foreach ($sidebars_lay as $id => $layout) {
            ?>
			  		<li>
			  			<?php 
            $selected_class = $id == $fave_meta['fave_post_sidebar'] ? ' selected' : '';
            ?>
			  			<img src="<?php 
            echo $layout['img'];
            ?>
" title="<?php 
            echo $layout['title'];
            ?>
" class="fave-img-select<?php 
            echo $selected_class;
            ?>
">
			  			<span><?php 
            //echo $layout['title'];
            ?>
</span>
			  			<input type="radio" class="fave-hidden" name="fave[fave_post_sidebar]" value="<?php 
            echo $id;
            ?>
" <?php 
            checked($id, $fave_meta['fave_post_sidebar']);
            ?>
/> </label>
			  		</li>
			  	<?php 
        }
        ?>
			   </ul>
		   </div>
	   </div>

	  <?php 
        if (!empty($sidebars)) {
            ?>

	  <div class="favethemes_meta_control custom_sidebar_js">  
	  	<p class="fave-inline-block-wrap"><span class="fave_meta_title"><?php 
            _e('Custom Sidebar:', 'magzilla');
            ?>
</span></p>
		<div class="fave-inline-block-wrap">
			<ul class="next-hide">
			  	<p><select name="fave[fave_sidebar]" class="fave-dropdown widefat">
			  	<?php 
            foreach ($sidebars as $id => $name) {
                ?>
			  		<option value="<?php 
                echo $id;
                ?>
" <?php 
                selected($id, $fave_meta['fave_sidebar']);
                ?>
><?php 
                echo $name;
                ?>
</option>
			  	<?php 
            }
            ?>
			  </select></p>
			</ul>
		</div>

	</div>
	<?php 
        }
        ?>

	<div class="favethemes_meta_control">  
	  	<p class="fave-inline-block-wrap"><span class="fave_meta_title"><?php 
        _e('Source Name:', 'magzilla');
        ?>
</span></p>
		<div class="fave-inline-block-wrap">
			<input class="fave-input-text-backend-small" type="text" name="fave[source_name]" value="<?php 
        echo $fave_meta['source_name'];
        ?>
" />
		</div>
		<p class="fave-inline-block-wrap fave-meta-des"><?php 
        _e('- Name of the source', 'magzilla');
        ?>
</p>
	</div>

	<div class="favethemes_meta_control">  
	  	<p class="fave-inline-block-wrap"><span class="fave_meta_title"><?php 
        _e('Source URL:', 'magzilla');
        ?>
</span></p>
		<div class="fave-inline-block-wrap">
			<input class="fave-input-text-backend-small" type="text" name="fave[source_url]" value="<?php 
        echo $fave_meta['source_url'];
        ?>
" />
		</div>
		<p class="fave-inline-block-wrap fave-meta-des"><?php 
        _e('- URL of the source', 'magzilla');
        ?>
</p>
	</div>


<?php 
    }
    function fave_category_edit_meta_fields($term)
    {
        $fave_meta = fave_get_category_meta($term->term_id);
        $sidebars_lay = fave_get_sidebar_layouts();
        $post_layouts = fave_get_main_layouts(true);
        $sidebars = fave_get_sidebars_list();
        $cat_excerpt = fave_get_cat_excerpt();
        $show_child_cat = fave_show_child_cat();
        $pagination = fave_get_pagination(true);
        ?>
	  

	  <tr class="form-field">
		<th scope="row" valign="top">
	  		<label><?php 
        _e('Posts main layout', 'magzilla');
        ?>
</label>
	  	</th>
	  	<td>
		  	<ul class="fave-img-select-wrap next-hide">
	  		<?php 
        foreach ($post_layouts as $id => $layout) {
            ?>
	  		<li>
	  			<?php 
            $selected_class = fave_compare($fave_meta['layout'], $id) ? ' selected' : '';
            ?>
	  			<img src="<?php 
            echo $layout['img'];
            ?>
" title="<?php 
            echo $layout['title'];
            ?>
" class="fave-img-select<?php 
            echo $selected_class;
            ?>
">
	  			<input type="radio" class="fave-hidden" name="fave[layout]" value="<?php 
            echo $id;
            ?>
" <?php 
            checked($id, $fave_meta['layout']);
            ?>
/> </label>
	  		</li>
	  		<?php 
        }
        ?>
	   		</ul>
		   	<p class="description"><?php 
        _e('Choose posts layout for this category', 'magzilla');
        ?>
</p>
	 	</td>
	  </tr>

	  <tr class="form-field">
		<th scope="row" valign="top">
	  		<label><?php 
        _e('Sidebar layout', 'magzilla');
        ?>
</label>
	  	</th>
	  	<td>
		  	<ul class="fave-img-select-wrap">
	  		<?php 
        foreach ($sidebars_lay as $id => $layout) {
            ?>
	  		<li>
	  			<?php 
            $selected_class = fave_compare($fave_meta['use_sidebar'], $id) ? ' selected' : '';
            ?>
	  			<img src="<?php 
            echo $layout['img'];
            ?>
" title="<?php 
            echo $layout['title'];
            ?>
" class="fave-img-select<?php 
            echo $selected_class;
            ?>
">
	  			<input type="radio" class="fave-hidden" name="fave[use_sidebar]" value="<?php 
            echo $id;
            ?>
" <?php 
            checked($id, $fave_meta['use_sidebar']);
            ?>
/> </label>
	  		</li>
	  		<?php 
        }
        ?>
	   </ul>
		   	<p class="description"><?php 
        _e('Choose sidebar layout', 'magzilla');
        ?>
</p>
	 	</td>
	  </tr>

	  <tr class="form-field">
	  	 <th scope="row" valign="top"><label><?php 
        _e('Posts Excerpt', 'magzilla');
        ?>
</label></th>
	  	 <td>
	  	 <select name="fave[p_excerpt]" class="widefat">
		  	 <?php 
        foreach ($cat_excerpt as $val => $title) {
            ?>
		  		 <option value="<?php 
            echo $val;
            ?>
" <?php 
            selected($val, $fave_meta['p_excerpt']);
            ?>
><?php 
            echo $title['title'];
            ?>
</option>
		  	 <?php 
        }
        ?>
		 </select>
	    <p class="description"><?php 
        _e('Enable/Disable posts excerpt', 'magzilla');
        ?>
</p>
		</td>
	 </tr>

	 <tr class="form-field">
	  	<th scope="row" valign="top"><label><?php 
        _e('Show child categories menu:', 'magzilla');
        ?>
</label></td>
	  	<td>
	  	<select name="fave[show_child_cat]" class="widefat">
		  	<?php 
        foreach ($show_child_cat as $val => $title) {
            ?>
		  		<option value="<?php 
            echo $val;
            ?>
" <?php 
            selected($val, $fave_meta['show_child_cat']);
            ?>
><?php 
            echo $title['title'];
            ?>
</option>
		  	<?php 
        }
        ?>
		</select>
	   <p class="description"><?php 
        _e('This will show a menu at the top of the block that contains the child categories of the selected category.', 'magzilla');
        ?>
</p>
	  </td>
	</tr>

	  <tr class="form-field">
		<th scope="row" valign="top">
	  		<label><?php 
        _e('Standard sidebar', 'magzilla');
        ?>
</label>
	  	</th>
	  	<td>
			<select name="fave[sidebar]" class="widefat">
			<?php 
        foreach ($sidebars as $id => $name) {
            ?>
				<option value="<?php 
            echo $id;
            ?>
" <?php 
            selected($id, $fave_meta['sidebar']);
            ?>
><?php 
            echo $name;
            ?>
</option>
			<?php 
        }
        ?>
			</select>
			<p class="description"><?php 
        _e('Choose standard sidebar to display', 'magzilla');
        ?>
</p>
	  	</td>
	  </tr>

	  <tr class="form-field">
	  	<th scope="row" valign="top">
	  		<label><?php 
        _e('Pagination Style', 'magzilla');
        ?>
</label>
	  	</th>
	  	
	  	<td>
	  	<ul class="fave-img-select-wrap">
	  	<?php 
        foreach ($pagination as $id => $layout) {
            ?>
	  		<li>
	  			<?php 
            $selected_class = fave_compare($fave_meta['pagination'], $id) ? ' selected' : '';
            ?>
	  			<img src="<?php 
            echo $layout['img'];
            ?>
" title="<?php 
            echo $layout['title'];
            ?>
" class="fave-img-select<?php 
            echo $selected_class;
            ?>
">
	  			<input type="radio" class="fave-hidden" name="fave[pagination]" value="<?php 
            echo $id;
            ?>
" <?php 
            checked($id, $fave_meta['pagination']);
            ?>
/> </label>
	  		</li>
	  	<?php 
        }
        ?>
	   </ul>
	   <p class="description"><?php 
        _e('Choose pagination style', 'magzilla');
        ?>
</p>
		</td>
	</tr>

	  <?php 
        $most_used = get_option('fave_recent_cat_colors');
        $colors = '';
        if (!empty($most_used)) {
            $colors .= '<p>' . __('Recently used', 'magzilla') . ': <br/>';
            foreach ($most_used as $color) {
                $colors .= '<a href="#" style="width: 20px; height: 20px; background: ' . $color . '; float: left; margin-right:3px; border: 1px solid #aaa;" class="fave_colorpick" data-color="' . $color . '"></a>';
            }
            $colors .= '</p>';
        }
        ?>

	 <tr class="form-field">
		<th scope="row" valign="top"><label><?php 
        _e('Color', 'magzilla');
        ?>
</label></th>
			<td>
				<label><input type="radio" name="fave[color_type]" value="inherit" class="fave-radio color-type" <?php 
        checked($fave_meta['color_type'], 'inherit');
        ?>
> <?php 
        _e('Inherit from default accent color', 'magzilla');
        ?>
</label> <br/>
				<label><input type="radio" name="fave[color_type]" value="custom" class="fave-radio color-type" <?php 
        checked($fave_meta['color_type'], 'custom');
        ?>
> <?php 
        _e('Custom', 'magzilla');
        ?>
</label>
			  <div id="fave_color_wrap">
			  <p>
			    	<input name="fave[color]" type="text" class="fave_colorpicker" value="<?php 
        echo $fave_meta['color'];
        ?>
" data-default-color="<?php 
        echo $fave_meta['color'];
        ?>
"/>
			  </p>
			  <?php 
        if (!empty($colors)) {
            echo $colors;
        }
        ?>
				</div>
				<div class="clear"></div>
				<p class="howto"><?php 
        _e('Choose color', 'magzilla');
        ?>
</p>
			</td>
		</tr>

	<?php 
    }