true)); $portf_categories=array(array('id'=>'-1', 'name'=>'All Portfolio Categories')); foreach($portf_taxonomies as $taxonomy){ $portf_categories[]=array("name"=>$taxonomy->name, "id"=>$taxonomy->term_id); } $loader_portf_categories=array_merge(array(array('id'=>'hide','name'=>'Hide'), (array('id'=>'disabled','name'=>'Show:'))), $portf_categories); //load the post categeories $categories=get_categories('hide_empty=0'); $pexeto_categories=array(array('id'=>'-1', 'name'=>'All Categories')); for($i=0; $i$categories[$i]->cat_ID, 'name'=>$categories[$i]->cat_name); } global $pexeto_data, $new_meta_boxes, $new_meta_portfolio_boxes, $new_meta_post_boxes; $sliders=pexeto_get_created_sliders(); /* ------------------------------------------------------------------------* * META BOXES FOR THE PAGES * ------------------------------------------------------------------------*/ //the meta data for pages $new_meta_boxes = array( array( "title" => '
Main Page Settings - available for all page templates', "type" => "heading"), array( "title" => "Slider", "name" => "slider", "type" => "select", "options" => $sliders, "std" => 'none' ), array( "title" => "Page Layout", "name" => "layout", "type" => "imageradio", "options" => array(array("img"=>PEXETO_IMAGES_URL.'layout-right-sidebar.png', "id"=>"right", "title"=>"Right Sidebar Layout"), array("img"=>PEXETO_IMAGES_URL.'layout-left-sidebar.png', "id"=>"left", "title"=>"Left Sidebar Layout"), array("img"=>PEXETO_IMAGES_URL.'layout-full-width.png', "id"=>"full", "title"=>"Full Width Layout")), "std" => 'right', "description" => 'Available for Default, Featured Posts and Contact page templates' ), array( "name" => "sidebar", "title" => "Sidebar", "type" => "select", "options" => $pexeto_data->pexeto_sidebars, "description" => 'You can select a sidebar for this page between the default one and another one that you have created. If you would like to use another sidebar, rather than the default one, you can create a new sidebar in "'.PEXETO_THEMENAME.' Options->Sidebars" section and after that you will be able to select the sidebar here.'), array( "name" => "show_title", "title" => "Display Page Title", "type" => "select", "options" => array(array("name"=>"Use Global Settings", "id"=>"global"), array("name"=>"Display", "id"=>"on"), array("name"=>"Hide", "id"=>"off")), "std" => 'global', "description" => 'Whether to display the page title or not - if "Use Global Settings" selected, the global setting selected in the '.PEXETO_THEMENAME.' Options » General » "Display page title on pages" field will be used.'), array( "name" => "carousel", "title" => "Show portfolio projects in the bottom of the page", "type" => "select", "none" => true, "options" => $loader_portf_categories, "std" => 'hide', "description" => 'Displays a carousel(slider) containing the portfolio project images from the selected category.'), array( "name" => "carouselTitle", "std" => "", "type" => "text", "title" => "Portfolio projects title", "description" => 'The title of the portfolio projects carousel - available only when the "Show portfolio projects in the bottom of the page" field above is enabled.'), array( "title" => '
Featured Page Template Settings', "type" => "heading"), array( "name" => "featuredCategory", "title" => "Display blog posts from category", "type" => "select", "none" => true, "options" => $pexeto_categories, "std" => '-1' ), array( "title" => "Number of posts to display", "name" => "featuredPostNumber", "std" => "5", "type" => "text" ), array( "title" => '
Portfolio Settings - available only for Portfolio page templates', "type" => "heading"), array( "name" => "postCategory", "title" => "Display items from categories", "type" => "select", "none" => true, "options" => $portf_categories, "std" => '-1', "description" => 'If "All Categories" selected, all the Portfolio items will be displayed. If another category is selected, only the Portfolio items that belong to this category or this category\'s subcategories will be displayed.'), array( "name" => "column_number", "title" => "Number of columns", "type" => "select", "options" => array(array("name"=>"Two Columns", "id"=>"2"), array("name"=>"Three Columns", "id"=>"3"), array("name"=>"Four Columns", "id"=>"4")), "std" => '3', "description" => 'Available for the Gallery template'), array( "name" => "order", "title" => "Portfolio item order", "type" => "select", "options" => array(array("name"=>"By Date", "id"=>"date"), array("name"=>"By Custom Order", "id"=>"custom")), "std" => 'date', "description" => 'If you select "By Date" the last created item will be displayed first. If you select by "By Custom Order" you will have to set the order field of each of the items.'), array( "name" => "categories", "title" => "Show portfolio categories", "type" => "select", "options" => array(array("name"=>"Show", "id"=>"show"), array("name"=>"Hide", "id"=>"hide")), "std" => 'show', "description" => 'If "Show" selected, a category filter will be displayed above the portfolio items (only for the Gallery template)'), array( "name" => "showdesc", "title" => "Show item descriptions", "type" => "select", "options" => array( array("name"=>"Hide", "id"=>"false"), array("name"=>"Show", "id"=>"true")), "std" => 'false', "description" => 'If "Show" selected, the portfolio item description will be displayed below the image (only for the Gallery template)' ), array( "name" => "show_titles", "title" => "Show item titles", "type" => "select", "options" => array( array("name"=>"Hide", "id"=>"false"), array("name"=>"Show", "id"=>"true")), "std" => 'true', "description" => 'If "Show" selected, the portfolio item title will be displayed over the image (only for the Gallery template)' ), array( "title" => "Number of posts per page", "name" => "postNumber", "std" => "6", "type" => "text", "description" => "The number of smaller thumbnails to be displayed per page" ), array( "name" => "desaturate", "title" => "Black/white image effect", "type" => "select", "options" => array( array("name"=>"OFF", "id"=>"false"),array("name"=>"ON", "id"=>"true")), "std" => 'off', "description" => 'If this option is enabled, the images will be automatically converted to black/white (desaturated) and they will be colored on hover (only for the Gallery template).' ) ); /* ------------------------------------------------------------------------* * META BOXES FOR THE PORTFOLIO POSTS * ------------------------------------------------------------------------*/ $new_meta_portfolio_boxes = array( array( "title" => "When clicked on the image open:", "name" => "action", "type" => "select", "options" => array(array("name"=>"Preview image in lightbox", "id"=>"lightbox"), array("name"=>"The content of the item", "id"=>"permalink"), array("name"=>"Play Video", "id"=>"video"), array("name"=>"Custom link", "id"=>"custom"), array("name"=>"Do Nothing", "id"=>"nothing")), "std" => "lightbox", "description" => "Select the action to be performed after clicking on a portfolio item. (only for the Gallery template)" ), array( "title" => "Thumbnail URL", "name" => "thumbnail", "std" => "", "type" => "upload", "description" => 'By default the theme will generate automatically the thumbnail image for the item from the bigger perview image, set in the "Preview Image URL" field below. However, if you prefer to manually set this thumbnail image, you have to set its URL in this field.
Use the "Upload" button to upload a new image. If you would like to select an image from the Media Library, click on the "Use Media Library" button. Once you select the image, click on the "Insert into post" button.' ), array( "title" => "Preview Image URL", "name" => "preview", "std" => "", "type" => "upload", "description" => 'Main preview image. If the "Thumbnail URL" field above is empty, the thumbnail image will be automatically generated by the image set in this field.
Use the "Upload" button to upload a new image. If you would like to select an image from the Media Library, click on the "Use Media Library" button. Once you select the image, click on the "Insert into post" button.' ), array( "title" => "Custom Link/Video URL", "name" => "custom", "std" => "", "type" => "text", "description" => 'If "Play Video" selected above, you can insert a video URL here. If "Custom link" selected above, you can insert the custom URL (only for the Gallery template)' ), array( "title" => "Crop image from", "name" => "crop", "type" => "imageradio", "options" => array(array("img"=>PEXETO_IMAGES_URL.'crop-c.png', "id"=>"c", "title"=>"Center"), array("img"=>PEXETO_IMAGES_URL.'crop-t.png', "id"=>"t", "title"=>"Top"), array("img"=>PEXETO_IMAGES_URL.'crop-b.png', "id"=>"b", "title"=>"Bottom"), array("img"=>PEXETO_IMAGES_URL.'crop-l.png', "id"=>"l", "title"=>"Left"), array("img"=>PEXETO_IMAGES_URL.'crop-r.png', "id"=>"r", "title"=>"Right") ), "std" => "c", "description" => 'This option is available when the thumbnail will be automatically generated from the preview image (when the "Thumbnail URL" field above is empty)- you can see above how the cropping settings will affect both portrait and landscape oriented images.' ), array( "title" => "Item Description", "name" => "description", "std" => "", "type" => "textarea", "description" => 'If the "Show item descriptions" field in enabled in the portfolio page, the description text will be displayed below the item image. If it is disabled, the description will be displayed in the lightbox. (only for the Gallery template)' ), array( "name" => "show_title", "title" => "Show portfolio title on preview page", "type" => "select", "options" => array(array("name"=>"Show", "id"=>"show"), array("name"=>"Hide", "id"=>"hide")), "std" => 'show', "description" => 'If "Show" selected, the portfolio title will be displayed on the single portfolio page and on the Portfolio Showcase template.'), array( "name" => "show_preview", "title" => "Show preview image on preview page", "type" => "select", "options" => array(array("name"=>"Show", "id"=>"show"), array("name"=>"Hide", "id"=>"hide")), "std" => 'show', "description" => 'If "Show" selected, the preview image will be displayed on the single portfolio page and on the Portfolio Showcase template.') ); } /** * Creates a page meta box. */ function create_meta_box() { if ( function_exists('add_meta_box') ) { add_meta_box( 'new-meta-boxes', '
'.PEXETO_THEMENAME.' PAGE SETTINGS', 'new_meta_boxes', 'page', 'normal', 'high' ); } } /** * Creates a post meta box. */ function create_meta_post_box() { if ( function_exists('add_meta_box') ) { add_meta_box( 'new-meta-post-boxes', '
'.PEXETO_THEMENAME.' POST SETTINGS', 'new_meta_post_boxes', 'post', 'normal', 'high' ); } } /** * Creates a post meta box. */ function create_meta_portfolio_box() { if ( function_exists('add_meta_box') ) { add_meta_box( 'new-meta-portfolio-boxes', '
'.PEXETO_THEMENAME.' PORTFOLIO ITEM SETTINGS', 'new_meta_portfolio_boxes', PEXETO_PORTFOLIO_POST_TYPE, 'normal', 'high' ); } } /** * Calls the print method for page meta boxes. */ function new_meta_boxes() { global $post, $new_meta_boxes; foreach($new_meta_boxes as $meta_box) { print_meta_box($meta_box, $post); } } /** * Calls the print method for portfolio meta boxes. */ function new_meta_portfolio_boxes() { global $post, $new_meta_portfolio_boxes; foreach($new_meta_portfolio_boxes as $meta_box) { print_meta_box($meta_box, $post); } } /** * Prints the meta box * @param $meta_box the meta box to be printed * @param $post the post to contain the meta box */ function print_meta_box($meta_box, $post){ if(isset($meta_box['name'])){ $meta_box_value = get_post_meta($post->ID, $meta_box['name'].'_value', true); } if((!isset($meta_box_value) || $meta_box_value=="") && isset($meta_box['std'])){ $meta_box_value = $meta_box['std']; } switch($meta_box['type']){ case 'heading': echo'

'.$meta_box['title'].'

'; break; case 'text': echo '
'; echo''; echo'

'.$meta_box['title'].'

'; echo'
'; if(isset($meta_box['description'])){ echo''.$meta_box['description'].''; } echo '
'; break; case 'upload': echo '
'; echo''; echo'

'.$meta_box['title'].'

'; echo''; echo ''; echo ''; if(isset($meta_box['description'])){ echo''.$meta_box['description'].''; } echo '
'; break; case 'textarea': echo '
'; echo''; echo'

'.$meta_box['title'].'

'; echo'
'; if(isset($meta_box['description'])){ echo''.$meta_box['description'].''; } echo '
'; break; case 'imageradio': echo '
'; echo''; echo'

'.$meta_box['title'].'

'; if(sizeof($meta_box['options'])>0){ foreach ($meta_box['options'] as $option) { $checked= $meta_box_value == $option['id']?'checked="checked"':''; echo '
'; } } if(isset($meta_box['description'])){ echo''.$meta_box['description'].''; } echo '
'; break; case 'select': echo '
'; echo''; echo'

'.$meta_box['title'].'

'; echo '