+
+
+
+
+
+
+
';
+ $content .= ''.$short_descr.'
+diff -r 000000000000 -r d970ebf37754 wp/wp-content/plugins/portfolio/portfolio.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wp/wp-content/plugins/portfolio/portfolio.php Wed Nov 06 03:21:17 2013 +0000 @@ -0,0 +1,1346 @@ +
'.__( 'The files "portfolio.php" and "portfolio-post.php" are not found in your theme directory. Please copy them from the directory `wp-content/plugins/portfolio/template/` to your theme directory for correct work of the Portfolio plugin', 'portfolio' ).'
'; + } + } +} + +if ( ! function_exists( 'prtfl_plugin_uninstall' ) ) { + function prtfl_plugin_uninstall() { + if ( file_exists( get_stylesheet_directory() .'/portfolio.php' ) && ! unlink(get_stylesheet_directory() .'/portfolio.php') ) { + add_action( 'admin_notices', create_function( '', ' return "Error delete template file";' ) ); + } + if ( file_exists( get_stylesheet_directory() .'/portfolio-post.php' ) && ! unlink(get_stylesheet_directory() .'/portfolio-post.php') ) { + add_action( 'admin_notices', create_function( '', ' return "Error delete template file";' ) ); + } + if( get_option( 'prtfl_postmeta_update' ) ) { + delete_option( 'prtfl_postmeta_update' ); + } + if( get_option( 'prtfl_tag_update' ) ) { + delete_option( 'prtfl_tag_update' ); + } + if( get_option( 'prtfl_options' ) ) { + delete_option( 'prtfl_options' ); + } + } +} + +if ( ! function_exists ( 'prtfl_plugin_init' ) ) { + function prtfl_plugin_init() { + // Internationalization, first(!) + load_plugin_textdomain( 'portfolio', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); + load_plugin_textdomain( 'bestwebsoft', false, dirname( plugin_basename( __FILE__ ) ) . '/bws_menu/languages/' ); + global $prtfl_boxes; + $prtfl_boxes['Portfolio-Info'] = array( + array( '_prtfl_short_descr', __( 'Short description', 'portfolio' ), __( 'A short description which you\'d like to be displayed on your portfolio page', 'portfolio' ), '', '' ), + array( '_prtfl_date_compl', __( 'Date of completion', 'portfolio' ), __( 'The date when the task was completed', 'portfolio' ), '', '' ), + array( '_prtfl_link', __( 'Link', 'portfolio' ), __( 'A link to the site', 'portfolio' ), '', '' ), + array( '_prtfl_svn', __( 'SVN', 'portfolio' ), __( 'SVN URL', 'portfolio' ), '', '' ), + ); + + } +} + +// Create post type for portfolio +if ( ! function_exists( 'prtfl_post_type_portfolio' ) ) { + function prtfl_post_type_portfolio() { + global $wpdb; + prtfl_replace_old_post_tag(); + $options = get_site_option( 'prtfl_options' ); + $slug = isset( $options['prtfl_slug'] ) && ! empty( $options['prtfl_slug'] ) ? $options['prtfl_slug'] : 'portfolio'; + register_post_type( + 'portfolio', + array( + 'labels' => array( + 'name' => __( 'Portfolio', 'portfolio' ), + 'singular_name' => __( 'Portfolio', 'portfolio' ), + 'add_new' => __( 'Add New', 'portfolio' ), + 'add_new_item' => __( 'Add New Portfolio', 'portfolio' ), + 'edit' => __( 'Edit', 'portfolio' ), + 'edit_item' => __( 'Edit Portfolio', 'portfolio' ), + 'new_item' => __( 'New Portfolio', 'portfolio' ), + 'view' => __( 'View Portfolio', 'portfolio' ), + 'view_item' => __( 'View Portfolio', 'portfolio' ), + 'search_items' => __( 'Search Portfolio', 'portfolio' ), + 'not_found' => __( 'No portfolio found', 'portfolio' ), + 'not_found_in_trash' => __( 'No portfolio found in Trash', 'portfolio' ), + 'parent' => __( 'Parent Portfolio', 'portfolio' ), + ), + 'description' => __( 'Create a portfolio item', 'portfolio' ), + 'public' => true, + 'show_ui' => true, + 'publicly_queryable' => true, + 'exclude_from_search' => true, + 'menu_position' => 6, + 'hierarchical' => true, + 'query_var' => true, + 'register_meta_box_cb' => 'prtfl_init_metaboxes', + 'rewrite' => array( 'slug' => $slug ), + 'supports' => array ( + 'title', //Text input field to create a post title. + 'editor', + 'custom-fields', + 'comments', //Ability to turn on/off comments. + 'thumbnail', //Displays a box for featured image. + 'author' + ) + ) + ); + } +} + +// Create taxonomy for portfolio - Technologies and Executors Profile +if ( ! function_exists( 'prtfl_taxonomy_portfolio' ) ) { + function prtfl_taxonomy_portfolio() { + register_taxonomy( + 'portfolio_executor_profile', + 'portfolio', + array( + 'hierarchical' => false, + 'update_count_callback' => '_update_post_term_count', + 'labels' => array( + 'name' => __( 'Executor Profiles', 'portfolio' ), + 'singular_name' => __( 'Executor Profile', 'portfolio' ), + 'search_items' => __( 'Search Executor Profiles', 'portfolio' ), + 'popular_items' => __( 'Popular Executor Profiles', 'portfolio' ), + 'all_items' => __( 'All Executor Profiles', 'portfolio' ), + 'parent_item' => __( 'Parent Executor Profile', 'portfolio' ), + 'parent_item_colon' => __( 'Parent Executor Profile:', 'portfolio' ), + 'edit_item' => __( 'Edit Executor Profile', 'portfolio' ), + 'update_item' => __( 'Update Executor Profile', 'portfolio' ), + 'add_new_item' => __( 'Add New Executor Profile', 'portfolio' ), + 'new_item_name' => __( 'New Executor Name', 'portfolio' ), + 'separate_items_with_commas' => __( 'Separate Executor Profiles with commas', 'portfolio' ), + 'add_or_remove_items' => __( 'Add or remove Executor Profile', 'portfolio' ), + 'choose_from_most_used' => __( 'Choose from the most used Executor Profiles', 'portfolio' ), + 'menu_name' => __( 'Executors', 'portfolio' ) + ), + 'sort' => true, + 'args' => array( 'orderby' => 'term_order' ), + 'rewrite' => array( 'slug' => 'executor_profile' ), + 'show_tagcloud' => false + ) + ); + + register_taxonomy( + 'portfolio_technologies', + 'portfolio', + array( + 'hierarchical' => false, + 'update_count_callback' => '_update_post_term_count', + 'labels' => array( + 'name' => __( 'Technologies', 'portfolio' ), + 'singular_name' => __( 'Technology', 'portfolio'), + 'search_items' => __( 'Search Technologies', 'portfolio' ), + 'popular_items' => __( 'Popular Technologies', 'portfolio' ), + 'all_items' => __( 'All Technologies', 'portfolio' ), + 'parent_item' => __( 'Parent Technology', 'portfolio' ), + 'parent_item_colon' => __( 'Parent Technology:', 'portfolio' ), + 'edit_item' => __( 'Edit Technology', 'portfolio' ), + 'update_item' => __( 'Update Technology', 'portfolio' ), + 'add_new_item' => __( 'Add New Technology', 'portfolio' ), + 'new_item_name' => __( 'New Technology Name', 'portfolio' ), + 'separate_items_with_commas' => __( 'Separate Technologies with commas', 'portfolio' ), + 'add_or_remove_items' => __( 'Add or remove Technology', 'portfolio' ), + 'choose_from_most_used' => __( 'Choose from the most used technologies', 'portfolio' ), + 'menu_name' => __( 'Technologies', 'portfolio' ) + ), + 'query_var' => 'technologies', + 'rewrite' => array( 'slug' => 'technologies' ), + 'public' => true, + 'show_ui' => true, + '_builtin' => true, + 'show_tagcloud' => false + ) + ); + } +} + +if ( ! function_exists( 'prtfl_technologies_get_posts' ) ) { + function prtfl_technologies_get_posts( $query ) { + if ( isset( $query->query_vars["technologies"] ) ) + $query->set( 'post_type', array( 'portfolio' ) ); + return $query; + } +} + +if ( ! function_exists( 'prtfl_register_widget' ) ) { + function prtfl_register_widget() { + $control_ops = array('width' => 200, 'height' => 200, 'id_base' => 'portfolio_technologies_widget'); + + wp_register_sidebar_widget( + 'portfolio_technologies_widget', + __( 'Technologies', 'portfolio' ), + 'prtfl_widget_display', + array( + 'description' => __( 'Your most used portfolio technologies as a tag cloud', 'portfolio' ) + ) + ); + wp_register_widget_control( + 'portfolio_technologies_widget', // your unique widget id + __( 'Technologies', 'portfolio' ), // widget name + 'prtfl_widget_display_control', // Callback function + $control_ops, + array( 'number' => 1 ) + ); + } +} + +if ( ! function_exists( 'prtfl_widget_display' ) ) { + function prtfl_widget_display( $args, $vars = array() ) { + // print some HTML for the widget to display here + extract( $args); + $options = get_option( 'widget-portfolio_technologies_widget' ); + if ( !empty( $options[1]['title'] ) ) { + $title = $options[1]['title']; + } else { + $title = $widget_name; + } + $title = apply_filters( 'widget_title', $title, '', 'portfolio_technologies_widget' ); + + echo $before_widget; + if ( $title ) + echo $before_title . $title . $after_title; + echo '+
+ flush_rules(); + } + } +} + +// Initialization of all metaboxes on the 'Add Portfolio' and Edit Portfolio pages +if ( ! function_exists( 'prtfl_init_metaboxes' ) ) { + function prtfl_init_metaboxes() { + add_meta_box( 'Portfolio-Info', __( 'Portfolio Info', 'portfolio' ), 'prtfl_post_custom_box', 'portfolio', 'normal', 'high' ); // Description metaboxe + } +} + +// Create custom meta box for portfolio post type +if ( ! function_exists( 'prtfl_post_custom_box' ) ) { + function prtfl_post_custom_box( $obj = '', $box = '' ) { + global $prtfl_boxes; + // Generate box contents + foreach( $prtfl_boxes[ $box[ 'id' ] ] as $prtfl_box ) { + echo prtfl_text_field( $prtfl_box ); + } + } +} + +// This is the default text field meta box +if ( ! function_exists( 'prtfl_text_field' ) ) { + function prtfl_text_field( $args ) { + global $post; + + $description = $args[2]; + if ( get_option( 'prtfl_postmeta_update' ) == '1' ) { + $post_meta = get_post_meta( $post->ID, 'prtfl_information', true); + $args[ 2 ] = is_array( $post_meta ) ? esc_html ( $post_meta[ $args[0] ] ) : "" ; + } else { + $args[ 2 ] = esc_html ( get_post_meta( $post->ID, $args[0], true ) ); + } + $label_format = + ''. $description .'
'. + ''. $description .'
'. + '[latest_portfolio_items count=3],
+ + get_var( "SELECT meta_id FROM ".$wpdb->postmeta." WHERE meta_key = '".$prefix."_short_descr' LIMIT 1" ) != NULL ) { ?> ++ |
+ ![]() |
+
---|
+ |
+ ![]() |
+
---|
'.$short_descr.'
+