From 07683cffb11837b7715996b83e9078fd609efb26 Mon Sep 17 00:00:00 2001 From: markAking Date: Mon, 13 Jun 2016 16:08:11 -0400 Subject: [PATCH 01/15] added new project status, this is just in admin now. Next commit will have it on the dashboard --- .../wp-content/themes/backer/functions.php | 254 ++++++++++-------- 1 file changed, 145 insertions(+), 109 deletions(-) diff --git a/wordpress/wp-content/themes/backer/functions.php b/wordpress/wp-content/themes/backer/functions.php index 8e2c2ad7..e724a9f4 100644 --- a/wordpress/wp-content/themes/backer/functions.php +++ b/wordpress/wp-content/themes/backer/functions.php @@ -1,4 +1,40 @@ _x( 'Needs Editing', 'post' ), + 'public' => true, + 'show_in_admin_all_list' => true, + 'show_in_admin_status_list' => true, + 'label_count' => _n_noop( 'Needs Editing (%s)', 'Needs Editing (%s)' ) + ) ); +} + +function append_project_status_list(){ + global $post; + $complete = ''; + $label = ''; + if($post->post_type == 'ignition_product'){ + if($post->post_status == 'needsediting'){ + $complete = ' selected=\'selected\''; + $label = ' Needs Editing'; + } + echo ' + + '; + } +} + /*--------------------------------- Setup OptionTree ------------------------------------*/ @@ -232,7 +268,7 @@ add_action( 'after_setup_theme', 'krown_setup' ); if ( ! function_exists( '_wp_render_title_tag' ) ) { function theme_slug_render_title() { - echo '' . wp_title( '|', false, 'right' ) . "\n"; + echo '' . wp_title( '|', false, 'right' ) . "\n"; } add_action( 'wp_head', 'theme_slug_render_title' ); @@ -432,7 +468,7 @@ if ( ! function_exists( 'krown_excerptlength_post' ) ) { // Length (words no) function krown_excerptlength_post() { - return 15; + return 15; } } @@ -442,7 +478,7 @@ if ( ! function_exists( 'krown_excerptlength_post_big' ) ) { // Length (words no) function krown_excerptlength_post_big() { - return 80; + return 80; } } @@ -452,7 +488,7 @@ if ( ! function_exists( 'krown_excerptmore' ) ) { // More text function krown_excerptmore() { - return ' ...'; + return ' ...'; } } @@ -467,37 +503,37 @@ if ( ! function_exists( 'krown_excerpt' ) ) { function krown_excerpt( $length_callback = '', $more_callback = 'krown_excerptmore' ) { - global $post; + global $post; - if ( function_exists( $length_callback ) ) { + if ( function_exists( $length_callback ) ) { add_filter( 'excerpt_length', $length_callback ); - } + } - if ( function_exists( $more_callback ) ){ + if ( function_exists( $more_callback ) ){ add_filter( 'excerpt_more', $more_callback ); - } + } - $output = get_the_excerpt(); + $output = get_the_excerpt(); - if ( empty( $output ) ) { + if ( empty( $output ) ) { - // If the excerpt is empty (on pages created 100% with shortcodes), we should take the content, strip shortcodes, remove all HTML tags, then return the correct number of words + // If the excerpt is empty (on pages created 100% with shortcodes), we should take the content, strip shortcodes, remove all HTML tags, then return the correct number of words - $output = strip_tags( preg_replace( "~(?:\[/?)[^\]]+/?\]~s", '', $post->post_content ) ); - $output = explode( ' ', $output, $length_callback() ); - array_pop( $output ); - $output = implode( ' ', $output ) . $more_callback(); + $output = strip_tags( preg_replace( "~(?:\[/?)[^\]]+/?\]~s", '', $post->post_content ) ); + $output = explode( ' ', $output, $length_callback() ); + array_pop( $output ); + $output = implode( ' ', $output ) . $more_callback(); - } else { + } else { - // Continue with the regular excerpt method + // Continue with the regular excerpt method - $output = apply_filters( 'wptexturize', $output ); - $output = apply_filters( 'convert_chars', $output ); + $output = apply_filters( 'wptexturize', $output ); + $output = apply_filters( 'convert_chars', $output ); - } + } - return $output; + return $output; } @@ -535,13 +571,13 @@ if ( ! function_exists( 'krown_search_form' ) ) { function krown_search_form( $form ) { - $form = ' + $form = ' '; - return $form; + '; + return $form; } @@ -772,9 +808,9 @@ if ( ! function_exists( 'krown_custom_header' ) ) { ------------------------------------*/ function krown_custom_login_logo() { - echo ''; + echo ''; } add_action( 'login_head', 'krown_custom_login_logo' ); @@ -863,11 +899,11 @@ function krown_sidebar_class() { function krown_request_filter( $query_vars ) { - if( isset( $_GET['s'] ) && empty( $_GET['s'] ) ) { - $query_vars['s'] = " "; - } + if( isset( $_GET['s'] ) && empty( $_GET['s'] ) ) { + $query_vars['s'] = " "; + } - return $query_vars; + return $query_vars; } add_filter('request', 'krown_request_filter'); @@ -1006,21 +1042,21 @@ if ( ! function_exists( 'krown_mce_custom_styles' ) ) { function krown_mce_custom_styles($settings) { - $settings['theme_advanced_blockformats'] = 'p,h1,h2,h3,h4'; + $settings['theme_advanced_blockformats'] = 'p,h1,h2,h3,h4'; - $style_formats = array( - array('title' => 'Extreme', 'inline' => 'span', 'classes' => 'extreme'), - array('title' => 'Large', 'inline' => 'span', 'classes' => 'large'), - array('title' => 'Medium', 'inline' => 'span', 'classes' => 'medium'), - array('title' => 'Regular', 'inline' => 'span', 'classes' => 'regular'), - array('title' => 'Small', 'inline' => 'span', 'classes' => 'small'), - array('title' => 'Cite', 'inline' => 'cite', 'classes' => '') - ); + $style_formats = array( + array('title' => 'Extreme', 'inline' => 'span', 'classes' => 'extreme'), + array('title' => 'Large', 'inline' => 'span', 'classes' => 'large'), + array('title' => 'Medium', 'inline' => 'span', 'classes' => 'medium'), + array('title' => 'Regular', 'inline' => 'span', 'classes' => 'regular'), + array('title' => 'Small', 'inline' => 'span', 'classes' => 'small'), + array('title' => 'Cite', 'inline' => 'cite', 'classes' => '') + ); - $settings['style_formats'] = json_encode( $style_formats ); + $settings['style_formats'] = json_encode( $style_formats ); - return $settings; - + return $settings; + } } @@ -1047,7 +1083,7 @@ if ( ! function_exists( 'krown_mce_buttons' ) ) { function krown_mce_buttons( $buttons ) { array_unshift( $buttons, 'fontsizeselect' ); - array_unshift( $buttons, 'styleselect'); + array_unshift( $buttons, 'styleselect'); return $buttons; } @@ -1056,7 +1092,7 @@ if ( ! function_exists( 'krown_mce_buttons' ) ) { add_filter( 'mce_buttons_2', 'krown_mce_buttons' ); /*--------------------------------- - Update Notice + Update Notice ------------------------------------*/ add_action( 'admin_notices', 'krown_update_notice' ); @@ -1065,12 +1101,12 @@ function krown_update_notice() { if ( get_option( 'krown_koncept_version' ) != '1.1' ) { - echo '
-

You have just updated to version 1.1 - Read the CHANGELOG

'; + echo '
+

You have just updated to version 1.1 - Read the CHANGELOG

'; - printf(__('Dismiss'), '?krown_update_done_do=1'); + printf(__('Dismiss'), '?krown_update_done_do=1'); - echo "

"; + echo "

"; } @@ -1079,99 +1115,99 @@ add_action( 'admin_init', 'krown_update_done_do' ); function krown_update_done_do() { global $current_user; - $user_id = $current_user->ID; - if ( isset( $_GET['krown_update_done_do'] ) && '1' == $_GET['krown_update_done_do'] ) { - update_option( 'krown_koncept_version', '1.1' ); + $user_id = $current_user->ID; + if ( isset( $_GET['krown_update_done_do'] ) && '1' == $_GET['krown_update_done_do'] ) { + update_option( 'krown_koncept_version', '1.1' ); } } /*--------------------------------- - Navigation Walker + Navigation Walker ------------------------------------*/ class Krown_Nav_Walker extends Walker_Nav_Menu { - function start_lvl( &$output, $depth=0, $args=array() ) { - if ( $depth == 0 ) { - $output .= ' + +
+
+
+
+

Why Invest?

+

+
+
+
+
+ + - + - - - - - - - -
-
-
- -
Social -

Social Impact

-

-
-
-
-
-
Health -

Health Impact

-

-
-
+ + + + + + + +
+
+
+ +
Social +

Social Impact

+

+
+
+
+
+
Health +

Health Impact

+

+
+
-
- -
+
+ +
-
-
-
Environmental -

Environmental Impact

-

-
-
-
-
-
Financial -

Financial Impact

-

-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
Environmental +

Environmental Impact

+

+
+
+
+
+
Financial +

Financial Impact

+

+
+
+
+
+
+ + +
+
+
+
+
-

Comments

- - +

Comments

+ + -
- -
+
+ +
- + - - + + -
-
- - - + +
+

How does this work?

+

Your contribution make this bulding energy efficient, saving money and providing a positive social impact to the community.

+
+ + + + + + + ID, 'ign_project_id', true ); - $deck = new Deck($project_id); - $the_deck = $deck->the_deck(); - echo do_action('id_widget_after', $project_id, $the_deck); + $project_id = get_post_meta( $post->ID, 'ign_project_id', true ); + $deck = new Deck($project_id); + $the_deck = $deck->the_deck(); + echo do_action('id_widget_after', $project_id, $the_deck); ?> - - + + diff --git a/wordpress/wp-content/themes/backer/style.css b/wordpress/wp-content/themes/backer/style.css index 6b862289..4f1a04f2 100644 --- a/wordpress/wp-content/themes/backer/style.css +++ b/wordpress/wp-content/themes/backer/style.css @@ -1961,6 +1961,8 @@ input.terms-checkbox-input { .memberdeck .project_sortby select{ width: auto; } + + /* Notices */ .memberdeck p.success, .memberdeck p.error, .memberdeck p.info, .memberdeck .md-profile h2 + p, .ignitiondeck .notification { -- GitLab From 013af6169e204eeacda876f7cfaeaabd8e1f1ee9 Mon Sep 17 00:00:00 2001 From: markAking Date: Wed, 15 Jun 2016 13:59:11 -0400 Subject: [PATCH 07/15] moving elements around on the admin page. --- .../ign_metabox/init.php | 51 +++++++++--------- .../themes/backer/css/admin-style.css | 29 +++++++++++ .../includes/ignitiondeck-functions.php | 52 +++++++++---------- 3 files changed, 78 insertions(+), 54 deletions(-) diff --git a/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ign_metabox/init.php b/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ign_metabox/init.php index d70fe5f7..4a29976f 100644 --- a/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ign_metabox/init.php +++ b/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ign_metabox/init.php @@ -129,6 +129,14 @@ class ign_cmb_Meta_Box { if ( !isset($field['show_help']) ) $field['show_help'] = false; $meta = get_post_meta( $post->ID, $field['id'], 'multicheck' != $field['type'] /* If multicheck this can be multiple values */ ); + if ( $field['type'] == "wrapper_start" ) { + echo '
'; + continue; + } + if ( $field['type'] == "wrapper_end" ) { + echo '
'; + continue; + } if ( $field['type'] == "level1wraptop" ) { echo '

'.$GLOBALS["tr_Level"].' 1

'; } @@ -150,7 +158,7 @@ class ign_cmb_Meta_Box { echo '
  • '; if ( $field['type'] == "title" ) { - echo '
    ', $field['desc'], ''; } else if ($field['type'] == 'checkbox') { echo '
    ', $field['desc'], '
    '; @@ -160,13 +168,13 @@ class ign_cmb_Meta_Box { } else { if( $field['show_help'] == true ) { - echo ' [?] -
    ', $field['desc'], '
    - '; + echo '[?] +
    ', $field['desc'], '
    '; } - else { - echo ''; + else if($field['name']){ + echo ''; } echo '
    '; } @@ -239,10 +247,6 @@ class ign_cmb_Meta_Box { echo ''; echo ' '; break; - case 'title': - echo '
    ', $field['name'], '
    '; - echo ' '; - break; case 'wysiwyg': echo '
    '; echo '
    '; @@ -345,7 +349,7 @@ class ign_cmb_Meta_Box { echo apply_filters('id_product_levels_html_admin', $levels_html, $meta_no_levels, $post->ID); break; case 'add_levels': - echo ' '; + echo ''; break; ////Project What we’re installing line html form start here case 'product_levels_2': @@ -363,8 +367,7 @@ class ign_cmb_Meta_Box { $meta_order = 0; } $levels_html_2 .= ''. - '

    '.__('What we’re installing ', 'ignitiondeck').' '.($i).'

    '. - '
    '. + '

    '.__('Item ', 'ignitiondeck').' '.($i).'

    '. '
    '. '
    '; $levels_html_2 .= '
    '; @@ -378,7 +381,7 @@ class ign_cmb_Meta_Box { echo apply_filters('id_product_levels_2_html_admin', $levels_html_2, $meta_no_levels_2, $post->ID); break; case 'add_levels_2': - echo ' '; + echo ''; break; ////Project What we’re installing line html form end here ////Project Timeline multiple line html form start here @@ -412,23 +415,20 @@ class ign_cmb_Meta_Box { echo apply_filters('id_product_levels_3_html_admin', $levels_html_3, $meta_no_levels_3, $post->ID); break; case 'add_levels_3': - echo ' '; + echo ''; break; ////Project Timeline multiple line html form End here case 'short_code': - echo '
    + echo '
    '; - break; + break; case 'headline1': echo '

    '.$GLOBALS["tr_Headline1"].'

    '; - break; - case 'headline2': - echo '

    '.$GLOBALS["tr_Headline2"].'

    '; - break; + break; case 'headline2': echo '

    '.$GLOBALS["tr_Headline2"].'

    '; - break; + break; } echo '','
  • '; } @@ -791,10 +791,9 @@ function ign_cmb_editor_footer_scripts() { var pre_element_number = element_number - 1; jQuery('div[levels_2]').attr('levels_2', element_number); jQuery('#levels_2').val(element_number); - jQuery('div[levels_2]').append('
    ' + - '

    '+(element_number)+'

    '+ - '
    ' + - '
    '); + jQuery('div[levels_2]').append('
    ' + + '' + + '
    '); }); // Add What we’re installing js code end here // Add Project Timeline js code start here diff --git a/wordpress/wp-content/themes/backer/css/admin-style.css b/wordpress/wp-content/themes/backer/css/admin-style.css index c80c83b8..6846b4e2 100644 --- a/wordpress/wp-content/themes/backer/css/admin-style.css +++ b/wordpress/wp-content/themes/backer/css/admin-style.css @@ -1,4 +1,33 @@ +#product_meta label { + font-weight: bold; +} +#product_meta label span{ + display: block; + font-weight: normal; +} +#product_meta h4{ + margin: 30px 0 1rem; + padding-top: 30px; + border-top: 1px solid #CCC; + font-size: 1.2rem; + line-height: 1.5rem; +} +#product_meta h4 span{ + display: block; + font-weight: normal; + font-size: .85rem; +} +#product_meta .new_levels_2{ + padding: 0; +} +#product_meta .new_item{ + padding: 10px 0; +} +#product_meta .meta_wrapper{ + margin: 10px 0; + border-top: 1px solid #ccc; +} #wp-admin-bar-vc-inline-admin-bar-link, td.column-title .edit_vc, .composer-switch .wpb_switch-to-front-composer, .composer-switch span.vc-spacer:nth-of-type(3), #wpb-edit-inline, #message.rs-update-notice-wrap, #wpb-custom-post-css, .vc_row_edit_clone_delete .vc_row_image, .vc_admin_label.admin_label_css_animation.hidden-label, .vc-license-activation-notice, #accordion-section-idc_menu_items { display: none !important; } diff --git a/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php b/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php index ef31f4cc..1d4e83ef 100644 --- a/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php +++ b/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php @@ -40,10 +40,6 @@ function override_ign_sortable_columns() { remove_filter('manage_edit-ignition_product_sortable_columns', 'ign_sortable_columns'); add_filter( "manage_edit-ignition_product_sortable_columns", "override_ign_sortable_columns" ); - -remove_action( 'manage_posts_custom_column', 'manage_ign_product_columns', 10); -add_action( 'manage_posts_custom_column', 'override_manage_ign_product_columns', 10, 2 ); - function override_manage_ign_product_columns($column_name, $id) { global $post; require ID_PATH.'languages/text_variables.php'; @@ -122,6 +118,8 @@ function override_manage_ign_product_columns($column_name, $id) { break; } // end switch } +remove_action( 'manage_posts_custom_column', 'manage_ign_product_columns', 10); +add_action( 'manage_posts_custom_column', 'override_manage_ign_product_columns', 10, 2 ); function filter_by_project_status(){ $type = 'post'; @@ -173,12 +171,8 @@ function status_project_filter( $query ){ } add_filter( 'parse_query', 'status_project_filter' ); -remove_action( 'init', 'ign_create_post_type' ); -add_action( 'init', 'override_ign_create_post_type' ); - function override_ign_create_post_type() { require ID_PATH.'languages/text_variables.php'; - print_r(ID_PATH); $slug = apply_filters('idcf_archive_slug', __('projects', 'ignitiondeck')); register_post_type( 'ignition_product', array( @@ -213,6 +207,8 @@ function override_ign_create_post_type() { ) ); } +remove_action( 'init', 'ign_create_post_type' ); +add_action( 'init', 'override_ign_create_post_type' ); function override_ign_meta_boxes(array $meta_boxes) { require ID_PATH.'languages/text_variables.php'; @@ -227,67 +223,66 @@ function override_ign_meta_boxes(array $meta_boxes) { 'fields' => array( array( 'name' => __('Project Location', 'ignitiondeck'), - 'desc' => __('Location of Project (Required)', 'ignitiondeck'), + 'desc' => __('This should be exact address of project', 'ignitiondeck'), 'id' => $prefix . 'product_location', 'class' => $prefix . 'projectmeta_full', - 'show_help' => true, + 'show_help' => false, 'type' => 'text' ), array( 'name' => __('Project Short Description', 'ignitiondeck'), - 'desc' => __('Used in the grid, widget areas, and on the purchase form', 'ignitiondeck'), + 'desc' => __('Max 140 chars', 'ignitiondeck'), 'id' => $prefix . 'project_description', 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => true, + 'show_help' => false, 'type' => 'textarea_medium' ), array( 'name' => __('Project Long Description', 'ignitiondeck'), - 'desc' => __('Supports HTML. Used on project pages', 'ignitiondeck'), + 'desc' => __('History and back story behind the building and the people. No character limit.', 'ignitiondeck'), 'id' => $prefix . 'project_long_description', 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => true, + 'show_help' => false, 'type' => 'textarea_medium' ), array( 'name' => __('About this Project', 'ignitiondeck'), - 'desc' => __('About this Project', 'ignitiondeck'), + 'desc' => __('Specifics about the retrofit itself. No character limit.', 'ignitiondeck'), 'id' => $prefix . 'about_project', 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => true, + 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'type' => 'level2wraptop', - 'class' => 'projectmeta_none_2' + 'name' => __('What we’re installing', 'ignitiondeck'), + 'desc' => __('The exact details of the retrofit. Ex. New XR5 Boiler', 'ignitiondeck'), + 'type' => 'title', ), array( - 'name' => __('Text Field', 'ignitiondeck'), + 'name' => __('Item 1', 'ignitiondeck'), 'id' => $prefix . 'product_title_2', - 'class' => $prefix . 'projectmeta_reward_price', + 'class' => $prefix . 'projectmeta_full', 'type' => 'text' ), array( - 'type' => 'level2wrapbottom', - 'class' => 'projectmeta_none_2' - ), - array( - 'name' => '

    '.__('Additional Levels', 'ignitiondeck').'

    ', - 'std' => '', 'id' => $prefix . 'level', 'class' => $prefix . 'projectmeta_full new_levels_2', 'show_help' => false, 'type' => 'product_levels_2' ), array( - 'name' => __('Add More', 'ignitiondeck'), + 'name' => __('Add Another', 'ignitiondeck'), 'id' => $prefix . 'addlevels', 'class' => $prefix . 'projectmeta_full new_level_2', 'type' => 'add_levels_2', ), array( 'name' => __('Who is installing?', 'ignitiondeck'), - 'desc' => __('Who is installing?', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => __('Contractor Information', 'ignitiondeck'), + 'desc' => __('This can be the name, address and website of the contractor', 'ignitiondeck'), 'id' => $prefix . 'who_is_installing', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => true, @@ -595,6 +590,7 @@ function override_ign_meta_boxes(array $meta_boxes) { ); return apply_filters('id_postmeta_boxes', $meta_boxes); } + function override_install_ign_metaboxes() { global $pagenow; if ($pagenow == 'post.php' || 'post-new.php') { -- GitLab From 8ad4a9f8883b4df2cf170f7d89269a271c97ea69 Mon Sep 17 00:00:00 2001 From: Steven Walker Date: Wed, 15 Jun 2016 14:45:03 -0400 Subject: [PATCH 08/15] hardcoding GA into footer instead of plugin --- wordpress/wp-content/themes/backer/footer.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wordpress/wp-content/themes/backer/footer.php b/wordpress/wp-content/themes/backer/footer.php index 91b2d5d7..6d174579 100644 --- a/wordpress/wp-content/themes/backer/footer.php +++ b/wordpress/wp-content/themes/backer/footer.php @@ -123,7 +123,16 @@ + -- GitLab From 2e32546e2e6343158fa8e811b2a9e31d3bfa4481 Mon Sep 17 00:00:00 2001 From: markAking Date: Wed, 15 Jun 2016 15:11:17 -0400 Subject: [PATCH 09/15] init.php fix --- .../plugins/ignitiondeck-crowdfunding/ign_metabox/init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ign_metabox/init.php b/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ign_metabox/init.php index f01fabdd..d70fe5f7 100644 --- a/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ign_metabox/init.php +++ b/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ign_metabox/init.php @@ -205,8 +205,8 @@ class ign_cmb_Meta_Box { break; case 'select': echo ''; echo ' '; -- GitLab From 3dbb7947a74769a71ce316d8fa0505fcb2e8c1dd Mon Sep 17 00:00:00 2001 From: markAking Date: Wed, 15 Jun 2016 17:14:30 -0400 Subject: [PATCH 10/15] all fields have been updated. need to work on css now --- wordpress/wp-config.default.php | 101 --------- .../ign_metabox/init.php | 49 ++--- .../ignitiondeck-admin.css | 27 +-- .../themes/backer/css/admin-style.css | 23 +- .../includes/ignitiondeck-functions.php | 197 +++++++++--------- 5 files changed, 157 insertions(+), 240 deletions(-) delete mode 100644 wordpress/wp-config.default.php diff --git a/wordpress/wp-config.default.php b/wordpress/wp-config.default.php deleted file mode 100644 index b827b155..00000000 --- a/wordpress/wp-config.default.php +++ /dev/null @@ -1,101 +0,0 @@ -

    '.$GLOBALS["tr_Level"].' 1

    '; + echo '
    '; } if ( $field['type'] == "level1wrapbottom" ) { echo '
    '; } if ( $field['type'] == "level2wraptop" ) { - echo '

    What we’re installing 1

    '; + echo '
    '; } if ( $field['type'] == "level2wrapbottom" ) { echo '
    '; } if ( $field['type'] == "level3wraptop" ) { - echo '

    Project Timeline 1

    '; + echo '
    '; } if ( $field['type'] == "level3wrapbottom" ) { echo '
    '; @@ -159,14 +159,14 @@ class ign_cmb_Meta_Box { if ( $field['type'] == "title" ) { echo '

    ', $field['name'], '', $field['desc'], '

    '; - } - else if ($field['type'] == 'checkbox') { + } else if ( $field['type'] == "subtitle" ) { + echo '
    ', $field['name'], '', $field['desc'], '
    '; + } else if ($field['type'] == 'checkbox') { echo '
    ', $field['desc'], '
    '; echo ''; echo ' '; echo ' [?]'; - } - else { + } else { if( $field['show_help'] == true ) { echo '[?]
    ', $field['desc'], '
    '; @@ -290,9 +290,8 @@ class ign_cmb_Meta_Box { $check_image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $meta ); if ( $check_image ) { echo '
    '; - echo '
    '; + echo ''; echo 'Remove Image
    '; - echo '
    '; } else { $parts = explode( "/", $meta ); for( $i = 0; $i < sizeof( $parts ); ++$i ) { @@ -322,13 +321,12 @@ class ign_cmb_Meta_Box { $meta_short_desc = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_".($i)."_short_desc", true )); $meta_desc = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_".($i)."_desc", true )); $levels_html .= ''. - '

    '.__('Level', 'ignitiondeck').' '.($i).'

    '. - '
    '. - '
    '. - '
    '. - '
    ' . - '
    '. - '
    '. + '
    '. + '
    '. + '
    '. + '
    ' . + '
    '. + '
    '. '
    '; $levels_html .= '
    '; } @@ -400,10 +398,11 @@ class ign_cmb_Meta_Box { $meta_order = 0; } $levels_html_3 .= ''. - '

    '.__('Project Timeline ', 'ignitiondeck').' '.($i).'

    '. - '
    '. - '
    '. - '
    '; + '
    '.__('Event ', 'ignitiondeck').' '.($i).'
    '. + '
    '. + ''. + ''. + '
    '; $levels_html_3 .= '
    '; } @@ -766,7 +765,7 @@ function ign_cmb_editor_footer_scripts() { jQuery('div[levels]').attr('levels', element_number); jQuery('#levels').val(element_number); jQuery('div[levels]').append('
    ' + - '

    '+(element_number)+'

    '+ + '
    '+ '
    ' + '
    ' + '
    ' + @@ -804,9 +803,11 @@ function ign_cmb_editor_footer_scripts() { jQuery('div[levels_3]').attr('levels_3', element_number); jQuery('#levels_3').val(element_number); jQuery('div[levels_3]').append('
    ' + - '

    '+(element_number)+'

    '+ - '
    ' + - '
    '); + '
    '+(element_number)+'
    ' + + '
    ' + + ''+ + '' + + '
    '); }); // Add Project Timeline js code end here }); diff --git a/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ignitiondeck-admin.css b/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ignitiondeck-admin.css index d24b6905..8337b1e5 100644 --- a/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ignitiondeck-admin.css +++ b/wordpress/wp-content/plugins/ignitiondeck-crowdfunding/ignitiondeck-admin.css @@ -48,6 +48,9 @@ width: 100%; clear: both; } +.wrap ul li.ign_projectmeta_full.new_levels{ + padding: 0 0 10px; +} .wrap ul li.ign_projectmeta_full input[type=text]{ width: 97%; } @@ -65,8 +68,8 @@ width: 450px; margin: 10px 0; } -.wrap .ign_file_upload .upload_button { - margin-top: 10px; +.wrap .img_status{ + margin: 10px; } .wrap .ign_file_upload_image { padding: 0; @@ -102,24 +105,19 @@ } .wrap .ign_projectmeta_reward_price { padding: 0; - margin: 0; + margin: 0 0 10px; float: left; width: 20%; clear: both; } .wrap .ign_projectmeta_reward_limit { padding: 0; - margin: 0; + margin: 0 0 10px; float: left; width: 20%; clear: left; } -.wrap .ign_projectmeta_reward_left .ign_projectmeta_reward_limit { - margin-top: 65px; -} -.wrap .ign_projectmeta_reward_left .ign_projectmeta_reward_limit:last-child { - margin-top: 0; -} + .wrap .ign_projectmeta_reward_desc { padding: 0; margin: 0 2% 0 0; @@ -141,9 +139,11 @@ display: block; } .wrap .projectmeta-levelbox { - background-color: #f2f3f5; - margin-bottom: 10px; - padding: 8px; + margin: 0 0 10px; + padding: 0 0 30px; +} +.wrap .projectmeta-levelbox .ign_projectmeta_full{ + padding: 0; } .wrap .projectmeta_none { display: none ; @@ -162,6 +162,7 @@ } .wrap .projectmeta-levelbox label { font-weight: bold; + margin: 10px 0; } .new_levels h4 { diff --git a/wordpress/wp-content/themes/backer/css/admin-style.css b/wordpress/wp-content/themes/backer/css/admin-style.css index 6846b4e2..c52f50ee 100644 --- a/wordpress/wp-content/themes/backer/css/admin-style.css +++ b/wordpress/wp-content/themes/backer/css/admin-style.css @@ -1,5 +1,7 @@ #product_meta label { - font-weight: bold; + font-weight: bold; + margin-bottom: 10px; + display: inline-block; } #product_meta label span{ display: block; @@ -17,17 +19,34 @@ font-weight: normal; font-size: .85rem; } +#product_meta h5{ + margin: 1rem 0 0; + font-size: 1rem; + line-height: 1rem; + font-weight: bold; +} +#product_meta h5 span{ + display: block; + font-weight: normal; + font-size: .85rem; +} #product_meta .new_levels_2{ padding: 0; } #product_meta .new_item{ padding: 10px 0; } - #product_meta .meta_wrapper{ margin: 10px 0; border-top: 1px solid #ccc; } +#product_meta .ign_projectmeta_left{ + float: none; +} +#product_meta .ign_projectmeta_left label{ + margin-bottom: 10px; + display: inline-block; +} #wp-admin-bar-vc-inline-admin-bar-link, td.column-title .edit_vc, .composer-switch .wpb_switch-to-front-composer, .composer-switch span.vc-spacer:nth-of-type(3), #wpb-edit-inline, #message.rs-update-notice-wrap, #wpb-custom-post-css, .vc_row_edit_clone_delete .vc_row_image, .vc_admin_label.admin_label_css_animation.hidden-label, .vc-license-activation-notice, #accordion-section-idc_menu_items { display: none !important; } diff --git a/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php b/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php index 1d4e83ef..3b69e844 100644 --- a/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php +++ b/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php @@ -271,7 +271,6 @@ function override_ign_meta_boxes(array $meta_boxes) { 'type' => 'product_levels_2' ), array( - 'name' => __('Add Another', 'ignitiondeck'), 'id' => $prefix . 'addlevels', 'class' => $prefix . 'projectmeta_full new_level_2', 'type' => 'add_levels_2', @@ -285,52 +284,19 @@ function override_ign_meta_boxes(array $meta_boxes) { 'desc' => __('This can be the name, address and website of the contractor', 'ignitiondeck'), 'id' => $prefix . 'who_is_installing', 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => true, + 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'type' => 'headline2', - 'class' => $prefix . 'projectmeta_headline2' - ), - array( - 'name' => __('Featured Image', 'ignitiondeck'), - 'desc' => __('Featured Image - Shortcode: [project_image product="{product_number}" image="1"]', 'ignitiondeck'), - 'id' => $prefix . 'product_image1', - 'class' => $prefix . 'projectmeta_left', - 'show_help' => true, - 'type' => 'file' - ), - array( - 'name' => __('Image 2', 'ignitiondeck'), - 'desc' => __('Image 2 - Shortcode: [project_image product="{product_number}" image="2"]', 'ignitiondeck'), - 'id' => $prefix . 'product_image2', - 'class' => $prefix . 'projectmeta_left', - 'show_help' => true, - 'type' => 'file' - ), - array( - 'name' => __('Image 3', 'ignition'), - 'desc' => __('Image 3 - Shortcode: [project_image product="{product_number}" image="3"]', 'ignitiondeck'), - 'id' => $prefix . 'product_image3', - 'class' => $prefix . 'projectmeta_left', - 'show_help' => true, - 'type' => 'file' - ), - array( - 'name' => __('Image 4', 'ignition'), - 'desc' => __('Image 4 - Shortcode: [project_image product="{product_number}" image="4"]', 'ignitiondeck'), - 'id' => $prefix . 'product_image4', - 'class' => $prefix . 'projectmeta_left', - 'show_help' => true, - 'type' => 'file' + 'name' => __('Funding Details', 'ignitiondeck'), + 'type' => 'title', ), - array( 'name' => __('Funding Goal', 'ignitiondeck'), 'desc' => __('Amount you are seeking to raise (required)', 'ignitiondeck'), 'id' => $prefix . 'fund_goal', - 'class' => $prefix . 'projectmeta_full', - 'show_help' => true, + 'class' => $prefix . 'projectmeta_left', + 'show_help' => false, 'type' => 'text_money' ), array( @@ -338,21 +304,22 @@ function override_ign_meta_boxes(array $meta_boxes) { 'desc' => __('Date funding will end (recommended)', 'ignitiondeck'), 'id' => $prefix . 'fund_end', 'class' => $prefix . 'projectmeta_left', - 'show_help' => true, + 'show_help' => false, 'type' => 'text_date' ), array( - 'type' => 'headline1', - 'class' => $prefix . 'projectmeta_headline1' + 'name' => __('Funding Levels', 'ignitiondeck'), + 'desc' => __('This part should be completed by an Admin that knows what they are doing. Otherwise leave blank.', 'ignitiondeck'), + 'type' => 'subtitle', ), array( 'type' => 'level1wraptop', 'class' => 'projectmeta_none' ), array( - 'name' => __('Level Title', 'ignitiondeck'), + 'name' => __('Funding Level 1', 'ignitiondeck'), 'id' => $prefix . 'product_title', - 'class' => $prefix . 'projectmeta_reward_title', + 'class' => $prefix . 'projectmeta_full', 'show_help' => false, 'type' => 'text' ), @@ -399,15 +366,12 @@ function override_ign_meta_boxes(array $meta_boxes) { 'class' => 'projectmeta_none' ), array( - 'name' => '

    '.__('Additional Levels', 'ignitiondeck').'

    ', - 'std' => '', 'id' => $prefix . 'level', 'class' => $prefix . 'projectmeta_full new_levels', 'show_help' => false, 'type' => 'product_levels' ), array( - 'name' => __('Add Level', 'ignitiondeck'), 'id' => $prefix . 'addlevels', 'class' => $prefix . 'projectmeta_full new_level', 'type' => 'add_levels', @@ -415,63 +379,59 @@ function override_ign_meta_boxes(array $meta_boxes) { // Start setup custom metabox and fields for Project Timeline array( - 'type' => 'level3wraptop', - 'class' => 'projectmeta_none_3' + 'name' => __('Project Timeline', 'ignitiondeck'), + 'desc' => __('A rough timeline of the overall project. Ex. March 2016 - Contractor chosen', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => __('Event 1', 'ignitiondeck'), + 'type' => 'subtitle', ), array( 'name' => __('What', 'ignitiondeck'), 'id' => $prefix . 'product_image_3', - 'class' => $prefix . 'projectmeta_reward_title', + 'class' => $prefix . 'projectmeta_full', 'show_help' => false, 'type' => 'text' ), array( 'name' => __('When', 'ignitiondeck'), 'id' => $prefix . 'product_title_3', - 'class' => $prefix . 'projectmeta_reward_title', + 'class' => $prefix . 'projectmeta_full', 'type' => 'text' ), - array( - 'type' => 'level3wrapbottom', - 'class' => 'projectmeta_none_3' - ), - array( - 'name' => '

    '.__('Additional Levels', 'ignitiondeck').'

    ', - 'std' => '', 'id' => $prefix . 'level', 'class' => $prefix . 'projectmeta_full new_levels_3', 'show_help' => false, 'type' => 'product_levels_3' ), array( - 'name' => __('Add More', 'ignitiondeck'), 'id' => $prefix . 'addlevels', 'class' => $prefix . 'projectmeta_full new_level_3', 'type' => 'add_levels_3', ), - // End setup custom metabox and fields for Project Timeline. // Start setup custom metabox and fields for why invest part array( 'name' => __('Why Invest', 'ignitiondeck'), - 'desc' => __('Why Invest here', 'ignitiondeck'), + 'desc' => __('A quantifiable reasoning behind investing in projects', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => __('Why Invest Description', 'ignitiondeck'), + 'desc' => __('General description about the pronmary reason for investing in this project 200-300 characters', 'ignitiondeck'), 'id' => $prefix . 'why_invest', 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => true, + 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'name' => __('Health', 'ignitiondeck'), - 'desc' => __('Health here', 'ignitiondeck'), - 'id' => $prefix . 'health', - 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => true, - 'type' => 'textarea_medium' + 'name' => __('Health Impact', 'ignitiondeck'), + 'type' => 'title', ), array( - 'name' => 'Health Select', - 'desc' => 'Select an option', + 'name' => 'Health Rating', 'id' => $prefix . 'test_select', 'show_option_none' => true, 'type' => 'select', @@ -489,17 +449,20 @@ function override_ign_meta_boxes(array $meta_boxes) { ), ), array( - 'name' => __('Environmental', 'ignitiondeck'), - 'desc' => __('Environmental here', 'ignitiondeck'), - 'id' => $prefix . 'Environmental', + 'name' => __('Health', 'ignitiondeck'), + 'desc' => __('Describe why this project gets the health rating it has been given. Max 140 characters', 'ignitiondeck'), + 'id' => $prefix . 'health', 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => true, + 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'name' => 'Environmental Select', - 'desc' => 'Select an option', - 'id' => $prefix . 'test_select1', + 'name' => __('Financial Impact', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => 'Financial Rating', + 'id' => $prefix . 'test_select2', 'show_option_none' => true, 'type' => 'select', 'options' => array( @@ -517,16 +480,19 @@ function override_ign_meta_boxes(array $meta_boxes) { ), array( 'name' => __('Financial', 'ignitiondeck'), - 'desc' => __('Financial here', 'ignitiondeck'), + 'desc' => __('Describe why this project gets the financial rating it has been given. Max 140 characters', 'ignitiondeck'), 'id' => $prefix . 'Financial', 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => true, + 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'name' => 'Financial Select', - 'desc' => 'Select an option', - 'id' => $prefix . 'test_select2', + 'name' => __('Environmental Impact', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => 'Environmental Rating', + 'id' => $prefix . 'test_select1', 'show_option_none' => true, 'type' => 'select', 'options' => array( @@ -543,16 +509,19 @@ function override_ign_meta_boxes(array $meta_boxes) { ), ), array( - 'name' => __('Social', 'ignitiondeck'), - 'desc' => __('Social here', 'ignitiondeck'), - 'id' => $prefix . 'Social', + 'name' => __('Environmental', 'ignitiondeck'), + 'desc' => __('Describe why this project gets the environmental rating it has been given. Max 140 characters', 'ignitiondeck'), + 'id' => $prefix . 'Environmental', 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => true, + 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'name' => 'Social Select', - 'desc' => 'Select an option', + 'name' => __('Social Impact', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => 'Social Rating', 'id' => $prefix . 'test_select3', 'show_option_none' => true, 'type' => 'select', @@ -569,23 +538,51 @@ function override_ign_meta_boxes(array $meta_boxes) { '10' => __( '10', 'cmb2' ), ), ), - // end setup custom metabox and fields for why invest part array( - 'name' => __('Project FAQs', 'ignitiondeck'), - 'desc' => __('List Project FAQs here', 'ignitiondeck'), - 'id' => $prefix . 'faqs', + 'name' => __('Social', 'ignitiondeck'), + 'desc' => __('Describe why this project gets the social rating it has been given. Max 140 characters', 'ignitiondeck'), + 'id' => $prefix . 'Social', 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => true, + 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'name' => __('Project Updates', 'ignitiondeck'), - 'desc' => __('List Project Updates here', 'ignitiondeck'), - 'id' => $prefix . 'updates', - 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => true, - 'type' => 'textarea_medium' - ) + 'name' => __('Media', 'ignitiondeck'), + 'desc' => __('Add photos and video', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => __('Featured Image 1024px x 340px', 'ignitiondeck'), + 'desc' => __('First photo and thumbnail seen all over the site and posted to socail media', 'ignitiondeck'), + 'id' => $prefix . 'product_image1', + 'class' => $prefix . 'projectmeta_left', + 'show_help' => false, + 'type' => 'file' + ), + array( + 'name' => __('Image 2 1024px x 340px', 'ignitiondeck'), + 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), + 'id' => $prefix . 'product_image2', + 'class' => $prefix . 'projectmeta_left', + 'show_help' => false, + 'type' => 'file' + ), + array( + 'name' => __('Image 3 1024px x 340px', 'ignition'), + 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), + 'id' => $prefix . 'product_image3', + 'class' => $prefix . 'projectmeta_left', + 'show_help' => false, + 'type' => 'file' + ), + array( + 'name' => __('Image 4 1024px x 340px', 'ignition'), + 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), + 'id' => $prefix . 'product_image4', + 'class' => $prefix . 'projectmeta_left', + 'show_help' => false, + 'type' => 'file' + ), ) ); return apply_filters('id_postmeta_boxes', $meta_boxes); -- GitLab From 8c6cbacf99c41dc62d0f0915a4786a1bb7d05da3 Mon Sep 17 00:00:00 2001 From: markAking Date: Wed, 15 Jun 2016 17:47:14 -0400 Subject: [PATCH 11/15] radar graph set to always go from 0 - 10 --- .../themes/backer/single-ignition_product.php | 666 +++++++++--------- 1 file changed, 331 insertions(+), 335 deletions(-) diff --git a/wordpress/wp-content/themes/backer/single-ignition_product.php b/wordpress/wp-content/themes/backer/single-ignition_product.php index a6f69a9c..8ad5518b 100644 --- a/wordpress/wp-content/themes/backer/single-ignition_product.php +++ b/wordpress/wp-content/themes/backer/single-ignition_product.php @@ -4,13 +4,13 @@ */ ?> ID, 'ign_project_id', true ); $project_name = get_post_meta( $post->ID, 'ign_product_name', true ); @@ -52,11 +52,11 @@ $retina = krown_retina(); ?> - -
    -
    -
    -
    -
    -
    -

    - - post_title; ?> - -

    - - -

    - - - -

    - - - -
    - -
    -
    + +
    + +
    +
    +
    +
    +
    +
    +
    +

    + + + +

    + + +

    + + + +

    + + + +
    + +
    +
    -

    About this project

    +

    About this project

    - -

    - + +

    + -
    - -
    -
    -
    -

    What we’re installing

    -
    -
    -
      - -
    • - ID, 'ign_product_title_2', true ); ?> -
    • - ID, $name="ign_product_level_count_2", true ); - - for ($i=2 ; $i <= $meta_no_levels_2 ; $i++) { +
    + +
    +
    +
    +

    What we’re installing

    +
    +
    +
    +
      + +
    • + ID, 'ign_product_title_2', true ); ?> +
    • + + ID, $name="ign_product_level_count_2", true ); + + for ($i=2 ; $i <= $meta_no_levels_2 ; $i++) { - $filename = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_2_".($i)."_filename", true )); - $meta_title = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_2_".($i)."_title", true )); - ?> -
    • - - + $filename = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_2_".($i)."_filename", true )); + $meta_title = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_2_".($i)."_title", true )); + ?> +
    • + + - -
    -
    -
    -
    -
    -
    -
    -

    Who is installing?

    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -

    Project timeline

    -
    -
    -
    -
      + +
    +
    +
    +
    +
    +
    +
    +
    +

    Who is installing?

    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +

    Project timeline

    +
    +
    +
    +
      - -
    • ID, 'ign_product_title_3', true ); ?>ID, 'ign_product_image_3', true ); ?> -
    • - - ID, $name="ign_product_level_count_3", true ); - - for ($i=2 ; $i <= $meta_no_levels_3 ; $i++) { + +
    • ID, 'ign_product_title_3', true ); ?>ID, 'ign_product_image_3', true ); ?> +
    • + + ID, $name="ign_product_level_count_3", true ); + + for ($i=2 ; $i <= $meta_no_levels_3 ; $i++) { - $what = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_3_".($i)."_what", true )); - $when = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_3_".($i)."_when", true )); - ?> + $what = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_3_".($i)."_what", true )); + $when = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_3_".($i)."_when", true )); + ?> -
    • - -
    • - - - - +
    • + +
    • + + + + -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Why Invest?

    -

    -
    -
    -
    -
    - - - - - - - - - - - - -
    -
    -
    - -
    Social -

    Social Impact

    -

    -
    -
    -
    -
    -
    Health -

    Health Impact

    -

    -
    -
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Why Invest?

    +

    +
    +
    +
    +
    + + + + + + + +
    +
    +
    + +
    Social +

    Social Impact

    +

    +
    +
    +
    +
    +
    Health +

    Health Impact

    +

    +
    +
    -
    - -
    +
    + +
    -
    -
    -
    Environmental -

    Environmental Impact

    -

    -
    -
    -
    -
    -
    Financial -

    Financial Impact

    -

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +
    +
    +
    Environmental +

    Environmental Impact

    +

    +
    +
    +
    +
    +
    Financial +

    Financial Impact

    +

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    -

    Comments

    - - +

    Comments

    + + -
    - -
    +
    + +
    - + - - + + -
    -
    -
    -
    -
    +
    +
    + +
    +

    How does this work?

    +

    Your contribution make this bulding energy efficient, saving money and providing a positive social impact to the community.

    +
    +
    + + + + + + ID, 'ign_project_id', true ); - $deck = new Deck($project_id); - $the_deck = $deck->the_deck(); - echo do_action('id_widget_after', $project_id, $the_deck); + $project_id = get_post_meta( $post->ID, 'ign_project_id', true ); + $deck = new Deck($project_id); + $the_deck = $deck->the_deck(); + echo do_action('id_widget_after', $project_id, $the_deck); ?> - - + + -- GitLab From 9a5654dbb407b20a009dd62f88283e97d1890912 Mon Sep 17 00:00:00 2001 From: markAking Date: Thu, 16 Jun 2016 11:54:11 -0400 Subject: [PATCH 12/15] File restructering and cleanup. This is for if there are any updates to plugins we will need to worry about our custom content. If feel this is much safer and really easier to find --- .../wp-content/themes/backer/functions.php | 62 +- .../includes/ignitiondeck-functions.php | 598 ----------------- .../includes/overrides/project-edit.php | 433 +++++++++++++ .../includes/overrides/project-meta-boxes.php | 608 ++++++++++++++++++ .../includes/overrides/project-status.php | 229 +++++++ 5 files changed, 1272 insertions(+), 658 deletions(-) create mode 100644 wordpress/wp-content/themes/backer/includes/overrides/project-edit.php create mode 100644 wordpress/wp-content/themes/backer/includes/overrides/project-meta-boxes.php create mode 100644 wordpress/wp-content/themes/backer/includes/overrides/project-status.php diff --git a/wordpress/wp-content/themes/backer/functions.php b/wordpress/wp-content/themes/backer/functions.php index f2584391..7baf8e2c 100644 --- a/wordpress/wp-content/themes/backer/functions.php +++ b/wordpress/wp-content/themes/backer/functions.php @@ -1,64 +1,4 @@ _x( 'Closed', 'post' ), - 'public' => true, - 'show_in_admin_all_list' => true, - 'show_in_admin_status_list' => true, - 'label_count' => _n_noop( 'Closed (%s)', 'Closed (%s)' ) - ) ); - register_post_status( 'completed', array( - 'label' => _x( 'Completed', 'post' ), - 'public' => true, - 'show_in_admin_all_list' => true, - 'show_in_admin_status_list' => true, - 'label_count' => _n_noop( 'Completed (%s)', 'Completed (%s)' ) - ) ); - register_post_status( 'needsediting', array( - 'label' => _x( 'Needs Editing', 'post' ), - 'public' => true, - 'show_in_admin_all_list' => true, - 'show_in_admin_status_list' => true, - 'label_count' => _n_noop( 'Needs Editing (%s)', 'Needs Editing (%s)' ) - ) ); -} - -function append_project_status_list(){ - global $post; - $label = ''; - if($post->post_type == 'ignition_product'){ - $post_value = ""; - $original_status = ""; - if($post->post_status == 'closed'){ - $label = ' Closed'; - $post_value = '$("#original_publish, #publish").val("Update");'; - } else if($post->post_status == 'completed'){ - $label = ' Completed'; - $post_value = '$("#original_publish, #publish").val("Update");'; - } else if($post->post_status == 'needsediting'){ - $label = ' Needs Editing'; - $post_value = '$("#original_publish, #publish").val("Update");'; - } - echo ' - - '; - } -} - /*--------------------------------- Setup OptionTree ------------------------------------*/ @@ -85,6 +25,8 @@ add_filter( 'ot_header_version_text', 'filter_ot_header_version_text'); Include other files ------------------------------------*/ +include( 'includes/overrides/project-status.php' ); +include( 'includes/overrides/project-edit.php' ); include( 'includes/theme-options.php' ); include( 'includes/customizer-options.php' ); include( 'includes/custom-styles.php' ); diff --git a/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php b/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php index 3b69e844..8d828bdc 100644 --- a/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php +++ b/wordpress/wp-content/themes/backer/includes/ignitiondeck-functions.php @@ -3,604 +3,6 @@ * This file contains some IgnitionDeck related functions */ -/*--------------------------------- - overrides for project admin ------------------------------------*/ -function override_ign_change_columns( $cols ) { - require ID_PATH.'languages/text_variables.php'; - $cols = array( - 'cb' => '', - 'title' => $tr_Product, - 'author' => __('Author', 'ignitiondeck'), - 'type' => __('Type', 'ignitiondeck'), - 'status' => $tr_Status, - 'goal' => $tr_Funding_Goal, - 'raised' => $tr_Pledged, - 'enddate' => $tr_End_Date, - 'daysleft' => $tr_Days_Remaining , - ); - return apply_filters('id_project_columns', $cols); -} -remove_filter('manage_ignition_product_posts_columns', 'ign_change_columns'); -add_filter( "manage_ignition_product_posts_columns", "override_ign_change_columns" ); - -function override_ign_sortable_columns() { - $sortable_columns = array( - 'title' => 'title', - 'author' => 'author', - 'type' => 'type', - 'status' => 'status', - 'goal' => 'goal', - 'raised' => 'raised', - 'enddate' => 'enddate', - 'daysleft' => 'daysleft', - ); - return apply_filters('id_sortable_project_columns', $sortable_columns); -} -remove_filter('manage_edit-ignition_product_sortable_columns', 'ign_sortable_columns'); -add_filter( "manage_edit-ignition_product_sortable_columns", "override_ign_sortable_columns" ); - -function override_manage_ign_product_columns($column_name, $id) { - global $post; - require ID_PATH.'languages/text_variables.php'; - $post_id = $post->ID; - $project_id = get_post_meta($id, 'ign_project_id', true); - $project = new ID_Project($project_id); - $cCode = $project->currency_code(); - switch ($column_name) { - // display goal amount with currency formatting - case 'author': - echo (!empty($post->post_author) ? $post->post_author : __('None', 'ignitiondeck')); - break; - - case 'type': - $type = get_post_meta($post_id, 'ign_project_type', true); - if (isset($type)) { - if ($type == 'pwyw') { - $type = __('Pledge What You Want', 'Ignitiondeck'); - } - else if ($type == 'level-based') { - $type = __('Level-Based', 'ignitiondeck'); - } - } - $type = apply_filters('id_project_type', $type); - echo (isset($type) ? $type : ''); - break; - - case 'status': - $status = get_post_status_object($post->post_status); - echo $status->label; - break; - - case 'goal': - if (get_post_meta( $post->ID, 'ign_fund_goal', true)) { - $goal_amt = number_format(get_post_meta( $post->ID, 'ign_fund_goal', true), 2, '.', ','); - - setlocale(LC_MONETARY, 'en_US'); - echo //money_format('%(#10n', $goal_amt); - $cCode.$goal_amt; - } else { - echo ''.$tr_No_Goal_set.''; - } - break; - - case 'raised': - if (isset($project_id)) { - $project = new ID_Project($project_id); - $post_id = $project->get_project_postid(); - $raised = apply_filters('id_funds_raised', $project->get_project_raised(), $post_id); - echo $raised; - } - break; - // display end date - case 'enddate': - if (get_post_meta( $post->ID, 'ign_fund_end', true)) { - echo get_post_meta( $post->ID, 'ign_fund_end', true); - } else { - echo ''.$tr_No_Date_set.''; - } - break; - - // calculate days remaining - case 'daysleft': - if (get_post_meta( $post->ID, 'ign_fund_end', true)) { - $days_left = $project->days_left(); - //$ending = get_post_meta( $post->ID, 'ign_fund_end', true); - //$daysleft = ID_Project::days_left($ending); - echo $days_left; - } else { - echo ''.$tr_No_Date_set.''; - } - break; - - // return standard post columns - default: - break; - } // end switch -} -remove_action( 'manage_posts_custom_column', 'manage_ign_product_columns', 10); -add_action( 'manage_posts_custom_column', 'override_manage_ign_product_columns', 10, 2 ); - -function filter_by_project_status(){ - $type = 'post'; - if (isset($_GET['post_type'])) { - $type = $_GET['post_type']; - } - //only add filter to post type you want - if ('ignition_product' == $type){ - //change this to the list of values you want to show - //in 'label' => 'value' format - $values = array( - 'All Status' => 'any', - 'Closed' => 'closed', - 'Completed' => 'completed', - 'Needs Editing' => 'needsediting', - 'Published' => 'publish', - 'Pending Review' => 'pending', - 'Draft ' => 'draft', - ); - ?> - - query_vars['post_status'] = $_GET['project_status']; - } -} -add_filter( 'parse_query', 'status_project_filter' ); - -function override_ign_create_post_type() { - require ID_PATH.'languages/text_variables.php'; - $slug = apply_filters('idcf_archive_slug', __('projects', 'ignitiondeck')); - register_post_type( 'ignition_product', - array( - 'labels' => array( - 'name' => $tr_Projects, - 'singular_name' => $tr_Project, - 'add_new' => $tr_Add_New_Project, - 'add_new_item' => $tr_Add_New_Project, - 'edit' => $tr_Edit, - 'edit_item' => $tr_Edit_Project, - 'new_item' => $tr_New_Project, - 'view' => $tr_View_Project, - 'view_item' => $tr_View_Project, - 'search_items' =>$tr_Search_Project, - 'not_found' => $tr_No_Products_found , - 'not_found_in_trash' => $tr_No_Product_in_Trash, - ), - 'public' => true, - 'show_in_nav_menus' => true, - 'show_ui' => true, - 'publicly_queryable' => true, - 'exclude_from_search' => false, - 'hierarchical' => apply_filters('idcf_hierarchical', false), - 'menu_position' => 5, - 'capability_type' => 'post', - 'menu_icon' => plugins_url('/ignitiondeck-crowdfunding/images/ignitiondeck-menu.png'), - 'query_var' => true, - 'rewrite' => array( 'slug' => $slug, 'with_front' => true ), - 'has_archive' => $slug, - 'supports' => array('title', 'author', 'thumbnail'), - 'taxonomies' => array('category', 'post_tag', 'project_category'), - ) - ); -} -remove_action( 'init', 'ign_create_post_type' ); -add_action( 'init', 'override_ign_create_post_type' ); - -function override_ign_meta_boxes(array $meta_boxes) { - require ID_PATH.'languages/text_variables.php'; - $prefix = 'ign_'; - $meta_boxes[] = array( - 'id' => 'product_meta', - 'title' => $tr_Project, - 'pages' => array('ignition_product'), // post type - 'context' => 'normal', - 'priority' => 'high', - 'class' => $prefix . 'projectmeta', - 'fields' => array( - array( - 'name' => __('Project Location', 'ignitiondeck'), - 'desc' => __('This should be exact address of project', 'ignitiondeck'), - 'id' => $prefix . 'product_location', - 'class' => $prefix . 'projectmeta_full', - 'show_help' => false, - 'type' => 'text' - ), - array( - 'name' => __('Project Short Description', 'ignitiondeck'), - 'desc' => __('Max 140 chars', 'ignitiondeck'), - 'id' => $prefix . 'project_description', - 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => false, - 'type' => 'textarea_medium' - ), - array( - 'name' => __('Project Long Description', 'ignitiondeck'), - 'desc' => __('History and back story behind the building and the people. No character limit.', 'ignitiondeck'), - 'id' => $prefix . 'project_long_description', - 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => false, - 'type' => 'textarea_medium' - ), - array( - 'name' => __('About this Project', 'ignitiondeck'), - 'desc' => __('Specifics about the retrofit itself. No character limit.', 'ignitiondeck'), - 'id' => $prefix . 'about_project', - 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => false, - 'type' => 'textarea_medium' - ), - array( - 'name' => __('What we’re installing', 'ignitiondeck'), - 'desc' => __('The exact details of the retrofit. Ex. New XR5 Boiler', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => __('Item 1', 'ignitiondeck'), - 'id' => $prefix . 'product_title_2', - 'class' => $prefix . 'projectmeta_full', - 'type' => 'text' - ), - array( - 'id' => $prefix . 'level', - 'class' => $prefix . 'projectmeta_full new_levels_2', - 'show_help' => false, - 'type' => 'product_levels_2' - ), - array( - 'id' => $prefix . 'addlevels', - 'class' => $prefix . 'projectmeta_full new_level_2', - 'type' => 'add_levels_2', - ), - array( - 'name' => __('Who is installing?', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => __('Contractor Information', 'ignitiondeck'), - 'desc' => __('This can be the name, address and website of the contractor', 'ignitiondeck'), - 'id' => $prefix . 'who_is_installing', - 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => false, - 'type' => 'textarea_medium' - ), - array( - 'name' => __('Funding Details', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => __('Funding Goal', 'ignitiondeck'), - 'desc' => __('Amount you are seeking to raise (required)', 'ignitiondeck'), - 'id' => $prefix . 'fund_goal', - 'class' => $prefix . 'projectmeta_left', - 'show_help' => false, - 'type' => 'text_money' - ), - array( - 'name' => __('Fundraising End Date', 'ignitiondeck'), - 'desc' => __('Date funding will end (recommended)', 'ignitiondeck'), - 'id' => $prefix . 'fund_end', - 'class' => $prefix . 'projectmeta_left', - 'show_help' => false, - 'type' => 'text_date' - ), - array( - 'name' => __('Funding Levels', 'ignitiondeck'), - 'desc' => __('This part should be completed by an Admin that knows what they are doing. Otherwise leave blank.', 'ignitiondeck'), - 'type' => 'subtitle', - ), - array( - 'type' => 'level1wraptop', - 'class' => 'projectmeta_none' - ), - array( - 'name' => __('Funding Level 1', 'ignitiondeck'), - 'id' => $prefix . 'product_title', - 'class' => $prefix . 'projectmeta_full', - 'show_help' => false, - 'type' => 'text' - ), - array( - 'name' => __('Level Price', 'ignitiondeck'), - 'id' => $prefix . 'product_price', - 'class' => $prefix . 'projectmeta_reward_price', - 'type' => 'text_money' - ), - array( - 'name' => __('Level Short Description', 'ignitiondeck'), - 'desc' => __('Used in widgets sidebars, and in some cases, on the purchase form', 'ignitiondeck'), - 'id' => $prefix . 'product_short_description', - 'class' => $prefix . 'projectmeta_reward_desc', - 'show_help' => true, - 'type' => 'textarea_small' - ), - array( - 'name' => __('Level Long Description', 'ignitiondeck'), - 'desc' => __('For use on the project page and in level shortcodes/widgets', 'ignitiondeck'), - 'id' => $prefix . 'product_details', - 'class' => $prefix . 'projectmeta_reward_desc tinymce', - 'show_help' => true, - 'type' => 'textarea_medium' - ), - array( - 'name' => __('Level Limit', 'ignitiondeck'), - 'desc' => __('Restrict the number of buyers that can back this level', 'ignitiondeck'), - 'id' => $prefix . 'product_limit', - 'class' => $prefix . 'projectmeta_reward_limit', - 'show_help' => true, - 'type' => 'text_small' - ), - array( - 'name' => __('Level Order', 'ignitiondeck'), - 'desc' => __('Enter a number of 0 (first) or higher if you wish to customize the placement of this level', 'ignitiondeck'), - 'id' => $prefix.'projectmeta_level_order', - 'class' => $prefix . 'projectmeta_reward_limit', - 'show_help' => true, - 'type' => 'text_small' - ), - array( - 'type' => 'level1wrapbottom', - 'class' => 'projectmeta_none' - ), - array( - 'id' => $prefix . 'level', - 'class' => $prefix . 'projectmeta_full new_levels', - 'show_help' => false, - 'type' => 'product_levels' - ), - array( - 'id' => $prefix . 'addlevels', - 'class' => $prefix . 'projectmeta_full new_level', - 'type' => 'add_levels', - ), - - // Start setup custom metabox and fields for Project Timeline - array( - 'name' => __('Project Timeline', 'ignitiondeck'), - 'desc' => __('A rough timeline of the overall project. Ex. March 2016 - Contractor chosen', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => __('Event 1', 'ignitiondeck'), - 'type' => 'subtitle', - ), - array( - 'name' => __('What', 'ignitiondeck'), - 'id' => $prefix . 'product_image_3', - 'class' => $prefix . 'projectmeta_full', - 'show_help' => false, - 'type' => 'text' - ), - array( - 'name' => __('When', 'ignitiondeck'), - 'id' => $prefix . 'product_title_3', - 'class' => $prefix . 'projectmeta_full', - 'type' => 'text' - ), - array( - 'id' => $prefix . 'level', - 'class' => $prefix . 'projectmeta_full new_levels_3', - 'show_help' => false, - 'type' => 'product_levels_3' - ), - array( - 'id' => $prefix . 'addlevels', - 'class' => $prefix . 'projectmeta_full new_level_3', - 'type' => 'add_levels_3', - ), - - // Start setup custom metabox and fields for why invest part - array( - 'name' => __('Why Invest', 'ignitiondeck'), - 'desc' => __('A quantifiable reasoning behind investing in projects', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => __('Why Invest Description', 'ignitiondeck'), - 'desc' => __('General description about the pronmary reason for investing in this project 200-300 characters', 'ignitiondeck'), - 'id' => $prefix . 'why_invest', - 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => false, - 'type' => 'textarea_medium' - ), - array( - 'name' => __('Health Impact', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => 'Health Rating', - 'id' => $prefix . 'test_select', - 'show_option_none' => true, - 'type' => 'select', - 'options' => array( - '1' => __( '1', 'cmb2' ), - '2' => __( '2', 'cmb2' ), - '3' => __( '3', 'cmb2' ), - '4' => __( '4', 'cmb2' ), - '5' => __( '5', 'cmb2' ), - '6' => __( '6', 'cmb2' ), - '7' => __( '7', 'cmb2' ), - '8' => __( '8', 'cmb2' ), - '9' => __( '9', 'cmb2' ), - '10' => __( '10', 'cmb2' ), - ), - ), - array( - 'name' => __('Health', 'ignitiondeck'), - 'desc' => __('Describe why this project gets the health rating it has been given. Max 140 characters', 'ignitiondeck'), - 'id' => $prefix . 'health', - 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => false, - 'type' => 'textarea_medium' - ), - array( - 'name' => __('Financial Impact', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => 'Financial Rating', - 'id' => $prefix . 'test_select2', - 'show_option_none' => true, - 'type' => 'select', - 'options' => array( - '1' => __( '1', 'cmb2' ), - '2' => __( '2', 'cmb2' ), - '3' => __( '3', 'cmb2' ), - '4' => __( '4', 'cmb2' ), - '5' => __( '5', 'cmb2' ), - '6' => __( '6', 'cmb2' ), - '7' => __( '7', 'cmb2' ), - '8' => __( '8', 'cmb2' ), - '9' => __( '9', 'cmb2' ), - '10' => __( '10', 'cmb2' ), - ), - ), - array( - 'name' => __('Financial', 'ignitiondeck'), - 'desc' => __('Describe why this project gets the financial rating it has been given. Max 140 characters', 'ignitiondeck'), - 'id' => $prefix . 'Financial', - 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => false, - 'type' => 'textarea_medium' - ), - array( - 'name' => __('Environmental Impact', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => 'Environmental Rating', - 'id' => $prefix . 'test_select1', - 'show_option_none' => true, - 'type' => 'select', - 'options' => array( - '1' => __( '1', 'cmb2' ), - '2' => __( '2', 'cmb2' ), - '3' => __( '3', 'cmb2' ), - '4' => __( '4', 'cmb2' ), - '5' => __( '5', 'cmb2' ), - '6' => __( '6', 'cmb2' ), - '7' => __( '7', 'cmb2' ), - '8' => __( '8', 'cmb2' ), - '9' => __( '9', 'cmb2' ), - '10' => __( '10', 'cmb2' ), - ), - ), - array( - 'name' => __('Environmental', 'ignitiondeck'), - 'desc' => __('Describe why this project gets the environmental rating it has been given. Max 140 characters', 'ignitiondeck'), - 'id' => $prefix . 'Environmental', - 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => false, - 'type' => 'textarea_medium' - ), - array( - 'name' => __('Social Impact', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => 'Social Rating', - 'id' => $prefix . 'test_select3', - 'show_option_none' => true, - 'type' => 'select', - 'options' => array( - '1' => __( '1', 'cmb2' ), - '2' => __( '2', 'cmb2' ), - '3' => __( '3', 'cmb2' ), - '4' => __( '4', 'cmb2' ), - '5' => __( '5', 'cmb2' ), - '6' => __( '6', 'cmb2' ), - '7' => __( '7', 'cmb2' ), - '8' => __( '8', 'cmb2' ), - '9' => __( '9', 'cmb2' ), - '10' => __( '10', 'cmb2' ), - ), - ), - array( - 'name' => __('Social', 'ignitiondeck'), - 'desc' => __('Describe why this project gets the social rating it has been given. Max 140 characters', 'ignitiondeck'), - 'id' => $prefix . 'Social', - 'class' => $prefix . 'projectmeta_full tinymce', - 'show_help' => false, - 'type' => 'textarea_medium' - ), - array( - 'name' => __('Media', 'ignitiondeck'), - 'desc' => __('Add photos and video', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => __('Featured Image 1024px x 340px', 'ignitiondeck'), - 'desc' => __('First photo and thumbnail seen all over the site and posted to socail media', 'ignitiondeck'), - 'id' => $prefix . 'product_image1', - 'class' => $prefix . 'projectmeta_left', - 'show_help' => false, - 'type' => 'file' - ), - array( - 'name' => __('Image 2 1024px x 340px', 'ignitiondeck'), - 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), - 'id' => $prefix . 'product_image2', - 'class' => $prefix . 'projectmeta_left', - 'show_help' => false, - 'type' => 'file' - ), - array( - 'name' => __('Image 3 1024px x 340px', 'ignition'), - 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), - 'id' => $prefix . 'product_image3', - 'class' => $prefix . 'projectmeta_left', - 'show_help' => false, - 'type' => 'file' - ), - array( - 'name' => __('Image 4 1024px x 340px', 'ignition'), - 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), - 'id' => $prefix . 'product_image4', - 'class' => $prefix . 'projectmeta_left', - 'show_help' => false, - 'type' => 'file' - ), - ) - ); - return apply_filters('id_postmeta_boxes', $meta_boxes); -} - -function override_install_ign_metaboxes() { - global $pagenow; - if ($pagenow == 'post.php' || 'post-new.php') { - add_filter('ign_cmb_meta_boxes', 'override_ign_meta_boxes'); - require_once(ID_PATH.'ign_metabox/init.php'); - // Include & setup custom metabox and fields - } -} - -remove_action('init', 'install_ign_metaboxes'); -add_action('init', 'override_install_ign_metaboxes'); - - /*--------------------------------- Raised Funds Filter ------------------------------------*/ diff --git a/wordpress/wp-content/themes/backer/includes/overrides/project-edit.php b/wordpress/wp-content/themes/backer/includes/overrides/project-edit.php new file mode 100644 index 00000000..9f01c9a1 --- /dev/null +++ b/wordpress/wp-content/themes/backer/includes/overrides/project-edit.php @@ -0,0 +1,433 @@ + array( + 'name' => $tr_Projects, + 'singular_name' => $tr_Project, + 'add_new' => $tr_Add_New_Project, + 'add_new_item' => $tr_Add_New_Project, + 'edit' => $tr_Edit, + 'edit_item' => $tr_Edit_Project, + 'new_item' => $tr_New_Project, + 'view' => $tr_View_Project, + 'view_item' => $tr_View_Project, + 'search_items' =>$tr_Search_Project, + 'not_found' => $tr_No_Products_found , + 'not_found_in_trash' => $tr_No_Product_in_Trash, + ), + 'public' => true, + 'show_in_nav_menus' => true, + 'show_ui' => true, + 'publicly_queryable' => true, + 'exclude_from_search' => false, + 'hierarchical' => apply_filters('idcf_hierarchical', false), + 'menu_position' => 5, + 'capability_type' => 'post', + 'menu_icon' => plugins_url('/ignitiondeck-crowdfunding/images/ignitiondeck-menu.png'), + 'query_var' => true, + 'rewrite' => array( 'slug' => $slug, 'with_front' => true ), + 'has_archive' => $slug, + 'supports' => array('title', 'author', 'thumbnail'), + 'taxonomies' => array('category', 'post_tag', 'project_category'), + ) + ); +} +remove_action( 'init', 'ign_create_post_type' ); +add_action( 'init', 'override_ign_create_post_type' ); + +function override_ign_meta_boxes(array $meta_boxes) { + require ID_PATH.'languages/text_variables.php'; + $prefix = 'ign_'; + $meta_boxes[] = array( + 'id' => 'product_meta', + 'title' => $tr_Project, + 'pages' => array('ignition_product'), // post type + 'context' => 'normal', + 'priority' => 'high', + 'class' => $prefix . 'projectmeta', + 'fields' => array( + array( + 'name' => __('Project Location', 'ignitiondeck'), + 'desc' => __('This should be exact address of project', 'ignitiondeck'), + 'id' => $prefix . 'product_location', + 'class' => $prefix . 'projectmeta_full', + 'show_help' => false, + 'type' => 'text' + ), + array( + 'name' => __('Project Short Description', 'ignitiondeck'), + 'desc' => __('Max 140 chars', 'ignitiondeck'), + 'id' => $prefix . 'project_description', + 'class' => $prefix . 'projectmeta_full tinymce', + 'show_help' => false, + 'type' => 'textarea_medium' + ), + array( + 'name' => __('Project Long Description', 'ignitiondeck'), + 'desc' => __('History and back story behind the building and the people. No character limit.', 'ignitiondeck'), + 'id' => $prefix . 'project_long_description', + 'class' => $prefix . 'projectmeta_full tinymce', + 'show_help' => false, + 'type' => 'textarea_medium' + ), + array( + 'name' => __('About this Project', 'ignitiondeck'), + 'desc' => __('Specifics about the retrofit itself. No character limit.', 'ignitiondeck'), + 'id' => $prefix . 'about_project', + 'class' => $prefix . 'projectmeta_full tinymce', + 'show_help' => false, + 'type' => 'textarea_medium' + ), + array( + 'name' => __('What we’re installing', 'ignitiondeck'), + 'desc' => __('The exact details of the retrofit. Ex. New XR5 Boiler', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => __('Item 1', 'ignitiondeck'), + 'id' => $prefix . 'product_title_2', + 'class' => $prefix . 'projectmeta_full', + 'type' => 'text' + ), + array( + 'id' => $prefix . 'level', + 'class' => $prefix . 'projectmeta_full new_levels_2', + 'show_help' => false, + 'type' => 'product_levels_2' + ), + array( + 'id' => $prefix . 'addlevels', + 'class' => $prefix . 'projectmeta_full new_level_2', + 'type' => 'add_levels_2', + ), + array( + 'name' => __('Who is installing?', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => __('Contractor Information', 'ignitiondeck'), + 'desc' => __('This can be the name, address and website of the contractor', 'ignitiondeck'), + 'id' => $prefix . 'who_is_installing', + 'class' => $prefix . 'projectmeta_full tinymce', + 'show_help' => false, + 'type' => 'textarea_medium' + ), + array( + 'name' => __('Funding Details', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => __('Funding Goal', 'ignitiondeck'), + 'desc' => __('Amount you are seeking to raise (required)', 'ignitiondeck'), + 'id' => $prefix . 'fund_goal', + 'class' => $prefix . 'projectmeta_left', + 'show_help' => false, + 'type' => 'text_money' + ), + array( + 'name' => __('Fundraising End Date', 'ignitiondeck'), + 'desc' => __('Date funding will end (recommended)', 'ignitiondeck'), + 'id' => $prefix . 'fund_end', + 'class' => $prefix . 'projectmeta_left', + 'show_help' => false, + 'type' => 'text_date' + ), + array( + 'name' => __('Funding Levels', 'ignitiondeck'), + 'desc' => __('This part should be completed by an Admin that knows what they are doing. Otherwise leave blank.', 'ignitiondeck'), + 'type' => 'subtitle', + ), + array( + 'type' => 'level1wraptop', + 'class' => 'projectmeta_none' + ), + array( + 'name' => __('Funding Level 1', 'ignitiondeck'), + 'id' => $prefix . 'product_title', + 'class' => $prefix . 'projectmeta_full', + 'show_help' => false, + 'type' => 'text' + ), + array( + 'name' => __('Level Price', 'ignitiondeck'), + 'id' => $prefix . 'product_price', + 'class' => $prefix . 'projectmeta_reward_price', + 'type' => 'text_money' + ), + array( + 'name' => __('Level Short Description', 'ignitiondeck'), + 'desc' => __('Used in widgets sidebars, and in some cases, on the purchase form', 'ignitiondeck'), + 'id' => $prefix . 'product_short_description', + 'class' => $prefix . 'projectmeta_reward_desc', + 'show_help' => true, + 'type' => 'textarea_small' + ), + array( + 'name' => __('Level Long Description', 'ignitiondeck'), + 'desc' => __('For use on the project page and in level shortcodes/widgets', 'ignitiondeck'), + 'id' => $prefix . 'product_details', + 'class' => $prefix . 'projectmeta_reward_desc tinymce', + 'show_help' => true, + 'type' => 'textarea_medium' + ), + array( + 'name' => __('Level Limit', 'ignitiondeck'), + 'desc' => __('Restrict the number of buyers that can back this level', 'ignitiondeck'), + 'id' => $prefix . 'product_limit', + 'class' => $prefix . 'projectmeta_reward_limit', + 'show_help' => true, + 'type' => 'text_small' + ), + array( + 'name' => __('Level Order', 'ignitiondeck'), + 'desc' => __('Enter a number of 0 (first) or higher if you wish to customize the placement of this level', 'ignitiondeck'), + 'id' => $prefix.'projectmeta_level_order', + 'class' => $prefix . 'projectmeta_reward_limit', + 'show_help' => true, + 'type' => 'text_small' + ), + array( + 'type' => 'level1wrapbottom', + 'class' => 'projectmeta_none' + ), + array( + 'id' => $prefix . 'level', + 'class' => $prefix . 'projectmeta_full new_levels', + 'show_help' => false, + 'type' => 'product_levels' + ), + array( + 'id' => $prefix . 'addlevels', + 'class' => $prefix . 'projectmeta_full new_level', + 'type' => 'add_levels', + ), + + // Start setup custom metabox and fields for Project Timeline + array( + 'name' => __('Project Timeline', 'ignitiondeck'), + 'desc' => __('A rough timeline of the overall project. Ex. March 2016 - Contractor chosen', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => __('Event 1', 'ignitiondeck'), + 'type' => 'subtitle', + ), + array( + 'name' => __('What', 'ignitiondeck'), + 'id' => $prefix . 'product_image_3', + 'class' => $prefix . 'projectmeta_full', + 'show_help' => false, + 'type' => 'text' + ), + array( + 'name' => __('When', 'ignitiondeck'), + 'id' => $prefix . 'product_title_3', + 'class' => $prefix . 'projectmeta_full', + 'type' => 'text' + ), + array( + 'id' => $prefix . 'level', + 'class' => $prefix . 'projectmeta_full new_levels_3', + 'show_help' => false, + 'type' => 'product_levels_3' + ), + array( + 'id' => $prefix . 'addlevels', + 'class' => $prefix . 'projectmeta_full new_level_3', + 'type' => 'add_levels_3', + ), + + // Start setup custom metabox and fields for why invest part + array( + 'name' => __('Why Invest', 'ignitiondeck'), + 'desc' => __('A quantifiable reasoning behind investing in projects', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => __('Why Invest Description', 'ignitiondeck'), + 'desc' => __('General description about the pronmary reason for investing in this project 200-300 characters', 'ignitiondeck'), + 'id' => $prefix . 'why_invest', + 'class' => $prefix . 'projectmeta_full tinymce', + 'show_help' => false, + 'type' => 'textarea_medium' + ), + array( + 'name' => __('Health Impact', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => 'Health Rating', + 'id' => $prefix . 'test_select', + 'show_option_none' => true, + 'type' => 'select', + 'options' => array( + '1' => __( '1', 'cmb2' ), + '2' => __( '2', 'cmb2' ), + '3' => __( '3', 'cmb2' ), + '4' => __( '4', 'cmb2' ), + '5' => __( '5', 'cmb2' ), + '6' => __( '6', 'cmb2' ), + '7' => __( '7', 'cmb2' ), + '8' => __( '8', 'cmb2' ), + '9' => __( '9', 'cmb2' ), + '10' => __( '10', 'cmb2' ), + ), + ), + array( + 'name' => __('Health', 'ignitiondeck'), + 'desc' => __('Describe why this project gets the health rating it has been given. Max 140 characters', 'ignitiondeck'), + 'id' => $prefix . 'health', + 'class' => $prefix . 'projectmeta_full tinymce', + 'show_help' => false, + 'type' => 'textarea_medium' + ), + array( + 'name' => __('Financial Impact', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => 'Financial Rating', + 'id' => $prefix . 'test_select2', + 'show_option_none' => true, + 'type' => 'select', + 'options' => array( + '1' => __( '1', 'cmb2' ), + '2' => __( '2', 'cmb2' ), + '3' => __( '3', 'cmb2' ), + '4' => __( '4', 'cmb2' ), + '5' => __( '5', 'cmb2' ), + '6' => __( '6', 'cmb2' ), + '7' => __( '7', 'cmb2' ), + '8' => __( '8', 'cmb2' ), + '9' => __( '9', 'cmb2' ), + '10' => __( '10', 'cmb2' ), + ), + ), + array( + 'name' => __('Financial', 'ignitiondeck'), + 'desc' => __('Describe why this project gets the financial rating it has been given. Max 140 characters', 'ignitiondeck'), + 'id' => $prefix . 'Financial', + 'class' => $prefix . 'projectmeta_full tinymce', + 'show_help' => false, + 'type' => 'textarea_medium' + ), + array( + 'name' => __('Environmental Impact', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => 'Environmental Rating', + 'id' => $prefix . 'test_select1', + 'show_option_none' => true, + 'type' => 'select', + 'options' => array( + '1' => __( '1', 'cmb2' ), + '2' => __( '2', 'cmb2' ), + '3' => __( '3', 'cmb2' ), + '4' => __( '4', 'cmb2' ), + '5' => __( '5', 'cmb2' ), + '6' => __( '6', 'cmb2' ), + '7' => __( '7', 'cmb2' ), + '8' => __( '8', 'cmb2' ), + '9' => __( '9', 'cmb2' ), + '10' => __( '10', 'cmb2' ), + ), + ), + array( + 'name' => __('Environmental', 'ignitiondeck'), + 'desc' => __('Describe why this project gets the environmental rating it has been given. Max 140 characters', 'ignitiondeck'), + 'id' => $prefix . 'Environmental', + 'class' => $prefix . 'projectmeta_full tinymce', + 'show_help' => false, + 'type' => 'textarea_medium' + ), + array( + 'name' => __('Social Impact', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => 'Social Rating', + 'id' => $prefix . 'test_select3', + 'show_option_none' => true, + 'type' => 'select', + 'options' => array( + '1' => __( '1', 'cmb2' ), + '2' => __( '2', 'cmb2' ), + '3' => __( '3', 'cmb2' ), + '4' => __( '4', 'cmb2' ), + '5' => __( '5', 'cmb2' ), + '6' => __( '6', 'cmb2' ), + '7' => __( '7', 'cmb2' ), + '8' => __( '8', 'cmb2' ), + '9' => __( '9', 'cmb2' ), + '10' => __( '10', 'cmb2' ), + ), + ), + array( + 'name' => __('Social', 'ignitiondeck'), + 'desc' => __('Describe why this project gets the social rating it has been given. Max 140 characters', 'ignitiondeck'), + 'id' => $prefix . 'Social', + 'class' => $prefix . 'projectmeta_full tinymce', + 'show_help' => false, + 'type' => 'textarea_medium' + ), + array( + 'name' => __('Media', 'ignitiondeck'), + 'desc' => __('Add photos and video', 'ignitiondeck'), + 'type' => 'title', + ), + array( + 'name' => __('Featured Image 1024px x 340px', 'ignitiondeck'), + 'desc' => __('First photo and thumbnail seen all over the site and posted to socail media', 'ignitiondeck'), + 'id' => $prefix . 'product_image1', + 'class' => $prefix . 'projectmeta_left', + 'show_help' => false, + 'type' => 'file' + ), + array( + 'name' => __('Image 2 1024px x 340px', 'ignitiondeck'), + 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), + 'id' => $prefix . 'product_image2', + 'class' => $prefix . 'projectmeta_left', + 'show_help' => false, + 'type' => 'file' + ), + array( + 'name' => __('Image 3 1024px x 340px', 'ignition'), + 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), + 'id' => $prefix . 'product_image3', + 'class' => $prefix . 'projectmeta_left', + 'show_help' => false, + 'type' => 'file' + ), + array( + 'name' => __('Image 4 1024px x 340px', 'ignition'), + 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), + 'id' => $prefix . 'product_image4', + 'class' => $prefix . 'projectmeta_left', + 'show_help' => false, + 'type' => 'file' + ), + ) + ); + return apply_filters('id_postmeta_boxes', $meta_boxes); +} + +function override_install_ign_metaboxes() { + global $pagenow; + if ($pagenow == 'post.php' || 'post-new.php') { + add_filter('overrides_ign_cmb_meta_boxes', 'override_ign_meta_boxes'); + require_once('project-meta-boxes.php'); + } +} + +remove_action('init', 'install_ign_metaboxes'); +add_action('init', 'override_install_ign_metaboxes'); + +?> \ No newline at end of file diff --git a/wordpress/wp-content/themes/backer/includes/overrides/project-meta-boxes.php b/wordpress/wp-content/themes/backer/includes/overrides/project-meta-boxes.php new file mode 100644 index 00000000..407aea29 --- /dev/null +++ b/wordpress/wp-content/themes/backer/includes/overrides/project-meta-boxes.php @@ -0,0 +1,608 @@ +_meta_box = $meta_box; + + $upload = false; + foreach ( $meta_box['fields'] as $field ) { + if ( $field['type'] == 'file' || $field['type'] == 'file_list' || $field['type'] == 'wysiwyg') { + $upload = true; + break; + } + } + + $current_page = substr(strrchr($_SERVER['PHP_SELF'], '/'), 1, -4); + + if ( $upload && ( $current_page == 'page' || $current_page == 'page-new' || $current_page == 'post' || $current_page == 'post-new' ) ) { + add_action('admin_head', array(&$this, 'add_post_enctype')); + } + + add_action( 'admin_menu', array(&$this, 'add') ); + add_action( 'save_post', array(&$this, 'save'), 3, 2 ); + } + + function add_post_enctype() { + echo ' + '; + } + + /// Add metaboxes + function add() { + $this->_meta_box['context'] = empty($this->_meta_box['context']) ? 'normal' : $this->_meta_box['context']; + $this->_meta_box['priority'] = empty($this->_meta_box['priority']) ? 'high' : $this->_meta_box['priority']; + foreach ($this->_meta_box['pages'] as $page) { + add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']); + } + } + + // Show fields + function show() { + global $post; + + // Use nonce for verification + echo ''; + echo '
      '; + + foreach ( $this->_meta_box['fields'] as $field ) { + // Set up blank values for empty ones + if ( !isset($field['desc']) ) $field['desc'] = ''; + if ( !isset($field['std']) ) $field['std'] = ''; + if ( !isset($field['id']) ) $field['id'] = ''; + if ( !isset($field['name']) ) $field['name'] = ''; + if ( !isset($field['show_help']) ) $field['show_help'] = false; + $meta = get_post_meta( $post->ID, $field['id'], 'multicheck' != $field['type'] /* If multicheck this can be multiple values */ ); + + if ( $field['type'] == "wrapper_start" ) { + echo '
      '; + continue; + } + if ( $field['type'] == "wrapper_end" ) { + echo '
      '; + continue; + } + if ( $field['type'] == "level1wraptop" ) { + echo '
      '; + } + if ( $field['type'] == "level1wrapbottom" ) { + echo '
      '; + } + if ( $field['type'] == "level2wraptop" ) { + echo '
      '; + } + if ( $field['type'] == "level2wrapbottom" ) { + echo '
      '; + } + if ( $field['type'] == "level3wraptop" ) { + echo '
      '; + } + if ( $field['type'] == "level3wrapbottom" ) { + echo '
      '; + } + echo '
    • '; + + if ( $field['type'] == "title" ) { + echo '

      ', $field['name'], '', $field['desc'], '

      '; + } else if ( $field['type'] == "subtitle" ) { + echo '
      ', $field['name'], '', $field['desc'], '
      '; + } else if ($field['type'] == 'checkbox') { + echo '
      ', $field['desc'], '
      '; + echo ''; + echo ' '; + echo ' [?]'; + } else { + if( $field['show_help'] == true ) { + echo '[?] +
      ', $field['desc'], '
      '; + } + + else if($field['name']){ + echo ''; + } + echo '
      '; + } + switch ( $field['type'] ) { + case 'text': + echo '', + ' '; + break; + case 'text_small': + echo ' '; + break; + case 'text_medium': + echo ''; + break; + case 'text_date': + echo ' '; + break; + case 'text_money': + echo ' '; + break; + case 'textarea': + echo '', + ''; + break; + case 'textarea_code': + echo '', + ' '; + break; + case 'textarea_small': + echo '', + ' '; + break; + case 'textarea_medium': + echo '', + ' '; + break; + case 'select': + echo ''; + echo ' '; + break; + case 'radio_inline': + echo '
      '; + foreach ($field['options'] as $option) { + echo '
      ', $option['name'], '
      '; + } + echo '
      '; + echo ' '; + break; + case 'radio': + foreach ($field['options'] as $option) { + echo '

      ', $option['name'].'

      '; + } + echo ' '; + break; + case 'multicheck': + echo '
        '; + foreach ( $field['options'] as $value => $name ) { + // Append `[]` to the name to get multiple values + // Use in_array() to check whether the current option should be checked + echo '
      • '; + } + echo '
      '; + echo ' '; + break; + case 'wysiwyg': + echo '
      '; + echo '
      '; + echo '
      '; + echo ' '; + break; + case 'file_list': + echo ''; + echo ''; + echo ' '; + $args = array( + 'post_type' => 'attachment', + 'numberposts' => null, + 'post_status' => null, + 'post_parent' => $post->ID + ); + $attachments = get_posts($args); + if ($attachments) { + echo '
        '; + foreach ($attachments as $attachment) { + echo '
      • '.wp_get_attachment_link($attachment->ID, 'thumbnail', 0, 0, 'Download'); + echo ''; + echo apply_filters('the_title', ' '.$attachment->post_title); + echo '
      • '; + } + echo '
      '; + } + break; + case 'file': + echo '
      '; + echo ''; + echo '
      '; + echo '
      '; + if ( $meta != '' ) { + $check_image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $meta ); + if ( $check_image ) { + echo '
      '; + echo ''; + echo 'Remove Image
      '; + } else { + $parts = explode( "/", $meta ); + for( $i = 0; $i < sizeof( $parts ); ++$i ) { + $title = $parts[$i]; + } + echo 'File: ', $title, '    (Download / )'; + } + } + echo '
      '; + break; + case 'product_levels': + $meta_no_levels = get_post_meta( $post->ID, $name="ign_product_level_count", true ); + $levels_html = ''; + + if ($meta_no_levels > 0 || $meta_no_levels != "") { + $levels_html .= '
      '; + + for ($i=2 ; $i <= $meta_no_levels ; $i++) { + $meta_title = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_".($i)."_title", true )); + $meta_limit = get_post_meta( $post->ID, $name="ign_product_level_".($i)."_limit", true ); + $meta_order = get_post_meta( $post->ID, $name="ign_product_level_".($i)."_order", true ); + if (empty($meta_order)) { + $meta_order = 0; + } + $meta_price = get_post_meta( $post->ID, $name="ign_product_level_".($i)."_price", true ); + $meta_short_desc = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_".($i)."_short_desc", true )); + $meta_desc = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_".($i)."_desc", true )); + $levels_html .= ''. + '
      '. + '
      '. + '
      '. + '
      ' . + '
      '. + '
      '. + '
      '; + $levels_html .= '
      '; + } + + } else { + $levels_html .= '
      '; + } + echo apply_filters('id_product_levels_html_admin', $levels_html, $meta_no_levels, $post->ID); + break; + case 'add_levels': + echo ''; + break; + ////Project What we’re installing line html form start here + case 'product_levels_2': + $meta_no_levels_2 = get_post_meta( $post->ID, $name="ign_product_level_count_2", true ); + $levels_html_2 = ''; + //echo $meta_no_levels; + + if ($meta_no_levels_2 > 0 || $meta_no_levels_2 != "") { + $levels_html_2 .= '
      '; + + for ($i=2 ; $i <= $meta_no_levels_2 ; $i++) { + $filename = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_2_".($i)."_filename", true )); + $meta_title = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_2_".($i)."_title", true )); + if (empty($meta_order)) { + $meta_order = 0; + } + $levels_html_2 .= ''. + '

      '.__('Item ', 'ignitiondeck').' '.($i).'

      '. + '
      '. + '
      '; + $levels_html_2 .= '
      '; + } + + } else { + $levels_html_2 .= '
      '; + + $levels_html_2 .= '
      '; + } + echo apply_filters('id_product_levels_2_html_admin', $levels_html_2, $meta_no_levels_2, $post->ID); + break; + case 'add_levels_2': + echo ''; + break; + ////Project What we’re installing line html form end here + ////Project Timeline multiple line html form start here + case 'product_levels_3': + $meta_no_levels_3 = get_post_meta( $post->ID, $name="ign_product_level_count_3", true ); + $levels_html_3 = ''; + + if ($meta_no_levels_3 > 0 || $meta_no_levels_3 != "") { + $levels_html_3 .= '
      '; + + for ($i=2 ; $i <= $meta_no_levels_3 ; $i++) { + $what = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_3_".($i)."_what", true )); + $when = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_3_".($i)."_when", true )); + if (empty($meta_order)) { + $meta_order = 0; + } + $levels_html_3 .= ''. + '
      '.__('Event ', 'ignitiondeck').' '.($i).'
      '. + '
      '. + ''. + ''. + '
      '; + $levels_html_3 .= '
      '; + } + + } else { + $levels_html_3 .= '
      '; + } + echo apply_filters('id_product_levels_3_html_admin', $levels_html_3, $meta_no_levels_3, $post->ID); + break; + case 'add_levels_3': + echo ''; + break; + ////Project Timeline multiple line html form End here + case 'short_code': + echo '
      '; + break; + case 'headline1': + echo '

      '.$GLOBALS["tr_Headline1"].'

      '; + break; + case 'headline2': + echo '

      '.$GLOBALS["tr_Headline2"].'

      '; + break; + } + echo '','
    • '; + } + echo '
    '; + } + + // Save data from metabox + function save($post_id, $post) { + global $post; + + // verify nonce + if ( ! isset( $_POST['wp_meta_box_nonce'] ) || !wp_verify_nonce($_POST['wp_meta_box_nonce'], basename(__FILE__))) { + return $post_id; + } + + // check autosave + if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { + return $post_id; + } + + if (isset($_POST['wp-preview']) && $_POST['wp-preview'] == 'dopreview') { + return $post_id; + } + + // check permissions + if ( 'page' == $_POST['post_type'] ) { + if ( !current_user_can( 'edit_page', $post_id ) ) { + return $post_id; + } + } + + else if ( !current_user_can( 'edit_post', $post_id ) ) { + return $post_id; + } + + //=================================================================== + // Saving the post meta field in the product table as well + //=================================================================== + //echo "referrer: ".$_SERVER['HTTP_REFERER']."
    "; exit; + global $wpdb; + if (!empty($_POST['ign_product_price'])) { + //$product_price = 0.00; + $product_price = round(str_replace(",", "", esc_attr($_POST['ign_product_price'])), 2); //replacing commas with empty + } + else { + $product_price = ''; + } + + if ($post->post_type == 'ignition_product') { + if ( stristr($_SERVER['HTTP_REFERER'], "action=edit") !== false) { + + $project_id = get_post_meta($post_id, 'ign_project_id', true); + //$post_data = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."posts WHERE ID = '".$post_id."'"); + + + $product_goal = round(str_replace(",", "", esc_attr($_POST['ign_fund_goal'])), 2); //replacing commas with empty + update_post_meta($post_id, 'ign_project_id', $project_id); + $sql_update = $wpdb->prepare("UPDATE ".$wpdb->prefix."ign_products SET product_name = %s, + ign_product_title = %s, + ign_product_limit = %s, + product_details = %s, + product_price = %s, + product_url = %s, + goal = %s WHERE id = %d", esc_attr($_POST['post_title']), esc_attr($_POST['ign_product_title']), esc_attr($_POST['ign_product_limit']), esc_attr($_POST['ign_product_details']), $product_price, esc_attr($_POST['id_project_URL']).'/', $product_goal, $project_id); + $wpdb->query( $sql_update ); + do_action('id_update_project', $post_id, $project_id); + update_option('id_preview_data', serialize($_POST)); + update_option('id_products_notice', 'off'); + } else { + + $product_goal = round(str_replace(",", "", $_POST['ign_fund_goal']), 2); //replacing commas with empty + $sql_product = $wpdb->prepare("INSERT INTO ".$wpdb->prefix ."ign_products ( + product_image, + product_name, + product_url, + ign_product_title, + ign_product_limit, + product_details, + product_price, + goal, + created_at) VALUES ( + 'product image', + %s, + %s, + %s, + %s, + %s, + %s, + %s, + '".date('Y-m-d H:i:s')."' + )", esc_attr($_POST['post_title']), + esc_attr($_POST['id_project_URL']).'/' , + esc_attr($_POST['ign_product_title']) , + esc_attr($_POST['ign_product_limit']), + esc_attr($_POST['ign_product_details']), + $product_price, + $product_goal); + + $res = $wpdb->query( $sql_product ); + $product_id = $wpdb->insert_id; + update_post_meta($post_id, 'ign_project_id', $product_id); + do_action('id_create_project', $post_id, $product_id); + update_option('id_products_notice', 'off'); + } + } + + //=================================================================== + + foreach ( $this->_meta_box['fields'] as $field ) { + if ( !isset($field['desc']) ) $field['desc'] = ''; + if ( !isset($field['std']) ) $field['std'] = ''; + if ( !isset($field['id']) ) $field['id'] = ''; + if ( !isset($field['name']) ) $field['name'] = ''; + if ( !isset($field['show_help']) ) $field['show_help'] = false; + + $name = $field['id']; + $old = get_post_meta( $post_id, $name, 'multicheck' != $field['type'] /* If multicheck this can be multiple values */ ); + $new = isset( $_POST[$field['id']] ) ? $_POST[$field['id']] : null; + + if ( $field['type'] == 'wysiwyg' || $field['type'] == 'textarea_medium') { + $new = wpautop($new); + } + + if ( ($field['type'] == 'textarea') || ($field['type'] == 'textarea_small') ) { + $new = htmlspecialchars($new); + } + + if ( ($field['id'] == "ign_product_price") || ($field['id'] == "ign_fund_goal") ) { + $new = str_replace(",", "", $new); + } + + if ($field['id'] == "ign_product_name") { + $new = htmlspecialchars($new); + } + + // validate meta value + if ( isset($field['validate_func']) ) { + $ok = call_user_func(array('ign_cmb_Meta_Box_Validate', $field['validate_func']), $new); + if ( $ok === false ) { // pass away when meta value is invalid + continue; + } + } elseif ( 'multicheck' == $field['type'] ) { + // Do the saving in two steps: first get everything we don't have yet + // Then get everything we should not have anymore + if ( empty( $new ) ) { + $new = array(); + } + $aNewToAdd = array_diff( $new, $old ); + $aOldToDelete = array_diff( $old, $new ); + foreach ( $aNewToAdd as $newToAdd ) { + add_post_meta( $post_id, $name, $newToAdd, false ); + } + foreach ( $aOldToDelete as $oldToDelete ) { + delete_post_meta( $post_id, $name, $oldToDelete ); + } + } elseif ($new && $new != $old) { + update_post_meta($post_id, $name, $new); + } elseif ('' == $new && $old && $field['type'] != 'file') { + delete_post_meta($post_id, $name, $old); + } + } + + //=================================================================== + // Saving the product levels + //=================================================================== + if (isset($_POST['level-count'])) { + update_post_meta($post_id, "ign_product_level_count", $_POST['level-count']); + } + $j = 2; + //find a better way to declare this without using +1 + if (isset($_POST['levels'])) { + $custom_order = false; + $level_order = absint($_POST['ign_projectmeta_level_order']); + if ($level_order > 0) { + $custom_order = true; + } + if ($_POST['levels'] > 1 ) { + foreach ( $_POST['levels'] as $level ) { + update_post_meta($post_id, $meta_key="ign_product_level_".$j."_title", esc_attr($meta_value=$level['title'])); + update_post_meta($post_id, $meta_key="ign_product_level_".$j."_limit", $meta_value=$level['limit']); + update_post_meta($post_id, $meta_key="ign_product_level_".$j."_order", $meta_value=$level['order']); + update_post_meta($post_id, $meta_key="ign_product_level_".$j."_price", $meta_value=str_replace(",", "", $level['price'])); + update_post_meta($post_id, $meta_key="ign_product_level_".$j."_short_desc", esc_html($meta_value=$level['short_description'])); + update_post_meta($post_id, $meta_key="ign_product_level_".$j."_desc", esc_html($meta_value=$level['description'])); + if ($level['order'] > 0) { + $custom_order = true; + } + $j++; + } + } + update_post_meta($post_id, 'custom_level_order', $custom_order); + } + + + //=================================================================== + + //=================================================================== + // Saving the Who is installing + //=================================================================== + if (isset($_POST['level-count-2'])) { + update_post_meta($post_id, "ign_product_level_count_2", $_POST['level-count-2']); + } + $j = 2; + //find a better way to declare this without using +1 + + if (isset($_POST['levels_2'])) { + $custom_order = false; + $level_order = absint($_POST['ign_projectmeta_level_order_2']); + if ($level_order > 0) { + $custom_order = true; + } + if ($_POST['levels_2'] > 1 ) { + foreach ( $_POST['levels_2'] as $level_2 ) { + update_post_meta($post_id, $meta_key="ign_product_level_2_".$j."_filename", esc_attr($meta_value=$level_2['filename'])); + update_post_meta($post_id, $meta_key="ign_product_level_2_".$j."_title", $meta_value=$level_2['title_2']); + + if ($level_2['order'] > 0) { + $custom_order = true; + } + $j++; + } + } + update_post_meta($post_id, 'custom_level_order_2', $custom_order); + } + + //=================================================================== + + //=================================================================== + // Saving the Project Timeline + //=================================================================== + if (isset($_POST['level-count-3'])) { + update_post_meta($post_id, "ign_product_level_count_3", $_POST['level-count-3']); + } + $j = 2; + //find a better way to declare this without using +1 + + if (isset($_POST['levels_3'])) { + $custom_order = false; + $level_order = absint($_POST['ign_projectmeta_level_order_3']); + if ($level_order > 0) { + $custom_order = true; + } + if ($_POST['levels_3'] > 1 ) { + foreach ( $_POST['levels_3'] as $level_3 ) { + update_post_meta($post_id, $meta_key="ign_product_level_3_".$j."_what", esc_attr($meta_value=$level_3['what'])); + update_post_meta($post_id, $meta_key="ign_product_level_3_".$j."_when", $meta_value=$level_3['when']); + + if ($level_3['order'] > 0) { + $custom_order = true; + } + $j++; + } + } + update_post_meta($post_id, 'custom_level_order_3', $custom_order); + } + + //=================================================================== + } +} + +?> \ No newline at end of file diff --git a/wordpress/wp-content/themes/backer/includes/overrides/project-status.php b/wordpress/wp-content/themes/backer/includes/overrides/project-status.php new file mode 100644 index 00000000..8ac9f47e --- /dev/null +++ b/wordpress/wp-content/themes/backer/includes/overrides/project-status.php @@ -0,0 +1,229 @@ + _x( 'Closed', 'post' ), + 'public' => true, + 'show_in_admin_all_list' => true, + 'show_in_admin_status_list' => true, + 'label_count' => _n_noop( 'Closed (%s)', 'Closed (%s)' ) + ) ); + register_post_status( 'completed', array( + 'label' => _x( 'Completed', 'post' ), + 'public' => true, + 'show_in_admin_all_list' => true, + 'show_in_admin_status_list' => true, + 'label_count' => _n_noop( 'Completed (%s)', 'Completed (%s)' ) + ) ); + register_post_status( 'needsediting', array( + 'label' => _x( 'Needs Editing', 'post' ), + 'public' => true, + 'show_in_admin_all_list' => true, + 'show_in_admin_status_list' => true, + 'label_count' => _n_noop( 'Needs Editing (%s)', 'Needs Editing (%s)' ) + ) ); +} + +function append_project_status_list(){ + global $post; + $label = ''; + if($post->post_type == 'ignition_product'){ + $post_value = ""; + $original_status = ""; + if($post->post_status == 'closed'){ + $label = ' Closed'; + $post_value = '$("#original_publish, #publish").val("Update");'; + } else if($post->post_status == 'completed'){ + $label = ' Completed'; + $post_value = '$("#original_publish, #publish").val("Update");'; + } else if($post->post_status == 'needsediting'){ + $label = ' Needs Editing'; + $post_value = '$("#original_publish, #publish").val("Update");'; + } + echo ' + + '; + } +} +/*--------------------------------- + overrides for project admin +-----------------------------------*/ +function override_ign_change_columns( $cols ) { + require ID_PATH.'languages/text_variables.php'; + $cols = array( + 'cb' => '', + 'title' => $tr_Product, + 'author' => __('Author', 'ignitiondeck'), + 'type' => __('Type', 'ignitiondeck'), + 'status' => $tr_Status, + 'goal' => $tr_Funding_Goal, + 'raised' => $tr_Pledged, + 'enddate' => $tr_End_Date, + 'daysleft' => $tr_Days_Remaining , + ); + return apply_filters('id_project_columns', $cols); +} +remove_filter('manage_ignition_product_posts_columns', 'ign_change_columns'); +add_filter( "manage_ignition_product_posts_columns", "override_ign_change_columns" ); + +function override_ign_sortable_columns() { + $sortable_columns = array( + 'title' => 'title', + 'author' => 'author', + 'type' => 'type', + 'status' => 'status', + 'goal' => 'goal', + 'raised' => 'raised', + 'enddate' => 'enddate', + 'daysleft' => 'daysleft', + ); + return apply_filters('id_sortable_project_columns', $sortable_columns); +} +remove_filter('manage_edit-ignition_product_sortable_columns', 'ign_sortable_columns'); +add_filter( "manage_edit-ignition_product_sortable_columns", "override_ign_sortable_columns" ); + +function override_manage_ign_product_columns($column_name, $id) { + global $post; + require ID_PATH.'languages/text_variables.php'; + $post_id = $post->ID; + $project_id = get_post_meta($id, 'ign_project_id', true); + $project = new ID_Project($project_id); + $cCode = $project->currency_code(); + switch ($column_name) { + // display goal amount with currency formatting + case 'author': + echo (!empty($post->post_author) ? $post->post_author : __('None', 'ignitiondeck')); + break; + + case 'type': + $type = get_post_meta($post_id, 'ign_project_type', true); + if (isset($type)) { + if ($type == 'pwyw') { + $type = __('Pledge What You Want', 'Ignitiondeck'); + } + else if ($type == 'level-based') { + $type = __('Level-Based', 'ignitiondeck'); + } + } + $type = apply_filters('id_project_type', $type); + echo (isset($type) ? $type : ''); + break; + + case 'status': + $status = get_post_status_object($post->post_status); + echo $status->label; + break; + + case 'goal': + if (get_post_meta( $post->ID, 'ign_fund_goal', true)) { + $goal_amt = number_format(get_post_meta( $post->ID, 'ign_fund_goal', true), 2, '.', ','); + + setlocale(LC_MONETARY, 'en_US'); + echo //money_format('%(#10n', $goal_amt); + $cCode.$goal_amt; + } else { + echo ''.$tr_No_Goal_set.''; + } + break; + + case 'raised': + if (isset($project_id)) { + $project = new ID_Project($project_id); + $post_id = $project->get_project_postid(); + $raised = apply_filters('id_funds_raised', $project->get_project_raised(), $post_id); + echo $raised; + } + break; + // display end date + case 'enddate': + if (get_post_meta( $post->ID, 'ign_fund_end', true)) { + echo get_post_meta( $post->ID, 'ign_fund_end', true); + } else { + echo ''.$tr_No_Date_set.''; + } + break; + + // calculate days remaining + case 'daysleft': + if (get_post_meta( $post->ID, 'ign_fund_end', true)) { + $days_left = $project->days_left(); + //$ending = get_post_meta( $post->ID, 'ign_fund_end', true); + //$daysleft = ID_Project::days_left($ending); + echo $days_left; + } else { + echo ''.$tr_No_Date_set.''; + } + break; + + // return standard post columns + default: + break; + } // end switch +} +remove_action( 'manage_posts_custom_column', 'manage_ign_product_columns', 10); +add_action( 'manage_posts_custom_column', 'override_manage_ign_product_columns', 10, 2 ); + +function filter_by_project_status(){ + $type = 'post'; + if (isset($_GET['post_type'])) { + $type = $_GET['post_type']; + } + //only add filter to post type you want + if ('ignition_product' == $type){ + //change this to the list of values you want to show + //in 'label' => 'value' format + $values = array( + 'All Status' => 'any', + 'Closed' => 'closed', + 'Completed' => 'completed', + 'Needs Editing' => 'needsediting', + 'Published' => 'publish', + 'Pending Review' => 'pending', + 'Draft ' => 'draft', + ); + ?> + + query_vars['post_status'] = $_GET['project_status']; + } +} +add_filter( 'parse_query', 'status_project_filter' ); + +?> \ No newline at end of file -- GitLab From ef28a17f2f420d8e30247ddc51bdb61914f5234a Mon Sep 17 00:00:00 2001 From: markAking Date: Thu, 16 Jun 2016 15:03:29 -0400 Subject: [PATCH 13/15] all fields fixed up, more styles. fixed javascript. --- .../themes/backer/css/admin-style.css | 33 ++- .../includes/overrides/project-edit.php | 228 +++++++++------- .../includes/overrides/project-meta-boxes.php | 243 ++++++++++++------ .../themes/backer/single-ignition_product.php | 2 + 4 files changed, 323 insertions(+), 183 deletions(-) diff --git a/wordpress/wp-content/themes/backer/css/admin-style.css b/wordpress/wp-content/themes/backer/css/admin-style.css index c52f50ee..1b125739 100644 --- a/wordpress/wp-content/themes/backer/css/admin-style.css +++ b/wordpress/wp-content/themes/backer/css/admin-style.css @@ -1,52 +1,57 @@ -#product_meta label { +#poststuff #postbox-container-2 h3{ + font-size: 1.25rem; +} +.metabox-holder label { font-weight: bold; margin-bottom: 10px; display: inline-block; } -#product_meta label span{ +.metabox-holder label span{ display: block; font-weight: normal; } -#product_meta h4{ - margin: 30px 0 1rem; - padding-top: 30px; - border-top: 1px solid #CCC; +.metabox-holder h4{ + margin: 1rem 0; font-size: 1.2rem; line-height: 1.5rem; } -#product_meta h4 span{ +.metabox-holder h4 span{ display: block; font-weight: normal; font-size: .85rem; } -#product_meta h5{ +.metabox-holder h5{ margin: 1rem 0 0; font-size: 1rem; line-height: 1rem; font-weight: bold; } -#product_meta h5 span{ +.metabox-holder h5 span{ display: block; font-weight: normal; font-size: .85rem; } -#product_meta .new_levels_2{ +.metabox-holder .new_levels_2{ padding: 0; } -#product_meta .new_item{ +.metabox-holder .new_item{ padding: 10px 0; } -#product_meta .meta_wrapper{ +.metabox-holder .meta_wrapper{ margin: 10px 0; border-top: 1px solid #ccc; } -#product_meta .ign_projectmeta_left{ +.metabox-holder .ign_projectmeta_left{ float: none; } -#product_meta .ign_projectmeta_left label{ +.metabox-holder .ign_projectmeta_left label{ margin-bottom: 10px; display: inline-block; } +.metabox-holder .ign_projectmeta_full{ + padding: 10px 0; + width: 100%; +} #wp-admin-bar-vc-inline-admin-bar-link, td.column-title .edit_vc, .composer-switch .wpb_switch-to-front-composer, .composer-switch span.vc-spacer:nth-of-type(3), #wpb-edit-inline, #message.rs-update-notice-wrap, #wpb-custom-post-css, .vc_row_edit_clone_delete .vc_row_image, .vc_admin_label.admin_label_css_animation.hidden-label, .vc-license-activation-notice, #accordion-section-idc_menu_items { display: none !important; } diff --git a/wordpress/wp-content/themes/backer/includes/overrides/project-edit.php b/wordpress/wp-content/themes/backer/includes/overrides/project-edit.php index 9f01c9a1..be549732 100644 --- a/wordpress/wp-content/themes/backer/includes/overrides/project-edit.php +++ b/wordpress/wp-content/themes/backer/includes/overrides/project-edit.php @@ -45,102 +45,121 @@ function override_ign_meta_boxes(array $meta_boxes) { require ID_PATH.'languages/text_variables.php'; $prefix = 'ign_'; $meta_boxes[] = array( - 'id' => 'product_meta', - 'title' => $tr_Project, - 'pages' => array('ignition_product'), // post type + 'id' => 'project_detail', + 'title' => 'Project Details', + 'pages' => array('ignition_product'), 'context' => 'normal', 'priority' => 'high', 'class' => $prefix . 'projectmeta', 'fields' => array( array( - 'name' => __('Project Location', 'ignitiondeck'), - 'desc' => __('This should be exact address of project', 'ignitiondeck'), + 'name' => 'Project Location', + 'desc' => 'This should be exact address of project', 'id' => $prefix . 'product_location', 'class' => $prefix . 'projectmeta_full', 'show_help' => false, 'type' => 'text' ), array( - 'name' => __('Project Short Description', 'ignitiondeck'), - 'desc' => __('Max 140 chars', 'ignitiondeck'), + 'name' => 'Project Short Description', + 'desc' => 'Max 140 chars', 'id' => $prefix . 'project_description', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'name' => __('Project Long Description', 'ignitiondeck'), - 'desc' => __('History and back story behind the building and the people. No character limit.', 'ignitiondeck'), + 'name' => 'Project Long Description', + 'desc' => 'History and back story behind the building and the people. No character limit.', 'id' => $prefix . 'project_long_description', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'name' => __('About this Project', 'ignitiondeck'), - 'desc' => __('Specifics about the retrofit itself. No character limit.', 'ignitiondeck'), + 'name' => 'About this Project', + 'desc' => 'Specifics about the retrofit itself. No character limit.', 'id' => $prefix . 'about_project', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => false, 'type' => 'textarea_medium' ), + ) + ); + $meta_boxes[] = array( + 'id' => 'project_what', + 'title' => 'What we’re installing', + 'pages' => array('ignition_product'), + 'context' => 'normal', + 'priority' => 'high', + 'class' => $prefix . 'projectmeta', + 'fields' => array( array( - 'name' => __('What we’re installing', 'ignitiondeck'), - 'desc' => __('The exact details of the retrofit. Ex. New XR5 Boiler', 'ignitiondeck'), - 'type' => 'title', + 'name' => 'The exact details of the retrofit. Ex. New XR5 Boiler', + 'type' => 'description', ), array( - 'name' => __('Item 1', 'ignitiondeck'), + 'name' => 'Item 1', 'id' => $prefix . 'product_title_2', 'class' => $prefix . 'projectmeta_full', 'type' => 'text' ), array( - 'id' => $prefix . 'level', - 'class' => $prefix . 'projectmeta_full new_levels_2', + 'id' => $prefix . 'install_levels', + 'class' => $prefix . 'projectmeta_full install_level', 'show_help' => false, - 'type' => 'product_levels_2' + 'type' => 'install_level' ), array( - 'id' => $prefix . 'addlevels', - 'class' => $prefix . 'projectmeta_full new_level_2', - 'type' => 'add_levels_2', - ), - array( - 'name' => __('Who is installing?', 'ignitiondeck'), - 'type' => 'title', + 'id' => $prefix . 'add_install_level', + 'class' => $prefix . 'projectmeta_full install_level', + 'type' => 'add_install_level', ), + ), + ); + $meta_boxes[] = array( + 'id' => 'project_who', + 'title' => 'Who is installing?', + 'pages' => array('ignition_product'), + 'context' => 'normal', + 'priority' => 'high', + 'class' => $prefix . 'projectmeta', + 'fields' => array( array( - 'name' => __('Contractor Information', 'ignitiondeck'), - 'desc' => __('This can be the name, address and website of the contractor', 'ignitiondeck'), + 'name' => 'Contractor Information', + 'desc' => 'This can be the name, address and website of the contractor', 'id' => $prefix . 'who_is_installing', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => false, 'type' => 'textarea_medium' ), + ), + ); + $meta_boxes[] = array( + 'id' => 'project_funding', + 'title' => 'Funding Details', + 'pages' => array('ignition_product'), + 'context' => 'normal', + 'priority' => 'high', + 'class' => $prefix . 'projectmeta', + 'fields' => array( array( - 'name' => __('Funding Details', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => __('Funding Goal', 'ignitiondeck'), - 'desc' => __('Amount you are seeking to raise (required)', 'ignitiondeck'), + 'name' => 'Funding Goal', + 'desc' => 'Amount you are seeking to raise (required)', 'id' => $prefix . 'fund_goal', - 'class' => $prefix . 'projectmeta_left', 'show_help' => false, 'type' => 'text_money' ), array( - 'name' => __('Fundraising End Date', 'ignitiondeck'), - 'desc' => __('Date funding will end (recommended)', 'ignitiondeck'), + 'name' => 'Fundraising End Date', + 'desc' => 'Date funding will end (recommended)', 'id' => $prefix . 'fund_end', - 'class' => $prefix . 'projectmeta_left', 'show_help' => false, 'type' => 'text_date' ), array( - 'name' => __('Funding Levels', 'ignitiondeck'), - 'desc' => __('This part should be completed by an Admin that knows what they are doing. Otherwise leave blank.', 'ignitiondeck'), + 'name' => 'Funding Levels', + 'desc' => 'This part should be completed by an Admin that knows what they are doing. Otherwise leave blank.', 'type' => 'subtitle', ), array( @@ -148,45 +167,45 @@ function override_ign_meta_boxes(array $meta_boxes) { 'class' => 'projectmeta_none' ), array( - 'name' => __('Funding Level 1', 'ignitiondeck'), + 'name' => 'Funding Level 1', 'id' => $prefix . 'product_title', 'class' => $prefix . 'projectmeta_full', 'show_help' => false, 'type' => 'text' ), array( - 'name' => __('Level Price', 'ignitiondeck'), + 'name' => 'Level Price', 'id' => $prefix . 'product_price', 'class' => $prefix . 'projectmeta_reward_price', 'type' => 'text_money' ), array( - 'name' => __('Level Short Description', 'ignitiondeck'), - 'desc' => __('Used in widgets sidebars, and in some cases, on the purchase form', 'ignitiondeck'), + 'name' => 'Level Short Description', + 'desc' => 'Used in widgets sidebars, and in some cases, on the purchase form', 'id' => $prefix . 'product_short_description', 'class' => $prefix . 'projectmeta_reward_desc', 'show_help' => true, 'type' => 'textarea_small' ), array( - 'name' => __('Level Long Description', 'ignitiondeck'), - 'desc' => __('For use on the project page and in level shortcodes/widgets', 'ignitiondeck'), + 'name' => 'Level Long Description', + 'desc' => 'For use on the project page and in level shortcodes/widgets', 'id' => $prefix . 'product_details', 'class' => $prefix . 'projectmeta_reward_desc tinymce', 'show_help' => true, 'type' => 'textarea_medium' ), array( - 'name' => __('Level Limit', 'ignitiondeck'), - 'desc' => __('Restrict the number of buyers that can back this level', 'ignitiondeck'), + 'name' => 'Level Limit', + 'desc' => 'Restrict the number of buyers that can back this level', 'id' => $prefix . 'product_limit', 'class' => $prefix . 'projectmeta_reward_limit', 'show_help' => true, 'type' => 'text_small' ), array( - 'name' => __('Level Order', 'ignitiondeck'), - 'desc' => __('Enter a number of 0 (first) or higher if you wish to customize the placement of this level', 'ignitiondeck'), + 'name' => 'Level Order', + 'desc' => 'Enter a number of 0 (first) or higher if you wish to customize the placement of this level', 'id' => $prefix.'projectmeta_level_order', 'class' => $prefix . 'projectmeta_reward_limit', 'show_help' => true, @@ -207,58 +226,72 @@ function override_ign_meta_boxes(array $meta_boxes) { 'class' => $prefix . 'projectmeta_full new_level', 'type' => 'add_levels', ), - - // Start setup custom metabox and fields for Project Timeline + ), + ); + $meta_boxes[] = array( + 'id' => 'project_timeline', + 'title' => 'Project Timeline', + 'pages' => array('ignition_product'), + 'context' => 'normal', + 'priority' => 'high', + 'class' => $prefix . 'projectmeta', + 'fields' => array( array( - 'name' => __('Project Timeline', 'ignitiondeck'), - 'desc' => __('A rough timeline of the overall project. Ex. March 2016 - Contractor chosen', 'ignitiondeck'), - 'type' => 'title', + 'name' => 'A rough timeline of the overall project. Ex. March 2016 - Contractor chosen', + 'type' => 'description', ), array( - 'name' => __('Event 1', 'ignitiondeck'), + 'name' => 'Event 1', 'type' => 'subtitle', ), array( - 'name' => __('What', 'ignitiondeck'), + 'name' => 'What', 'id' => $prefix . 'product_image_3', 'class' => $prefix . 'projectmeta_full', 'show_help' => false, 'type' => 'text' ), array( - 'name' => __('When', 'ignitiondeck'), + 'name' => 'When', 'id' => $prefix . 'product_title_3', 'class' => $prefix . 'projectmeta_full', 'type' => 'text' ), array( - 'id' => $prefix . 'level', + 'id' => $prefix . 'project_timelines', 'class' => $prefix . 'projectmeta_full new_levels_3', 'show_help' => false, - 'type' => 'product_levels_3' + 'type' => 'project_timeline' ), array( - 'id' => $prefix . 'addlevels', + 'id' => $prefix . 'add_project_timeline', 'class' => $prefix . 'projectmeta_full new_level_3', - 'type' => 'add_levels_3', + 'type' => 'add_timeline', ), - - // Start setup custom metabox and fields for why invest part + ), + ); + $meta_boxes[] = array( + 'id' => 'project_invest', + 'title' => 'Why Invest', + 'pages' => array('ignition_product'), + 'context' => 'normal', + 'priority' => 'high', + 'class' => $prefix . 'projectmeta', + 'fields' => array( array( - 'name' => __('Why Invest', 'ignitiondeck'), - 'desc' => __('A quantifiable reasoning behind investing in projects', 'ignitiondeck'), - 'type' => 'title', + 'name' => 'A quantifiable reasoning behind investing in projects', + 'type' => 'description', ), array( - 'name' => __('Why Invest Description', 'ignitiondeck'), - 'desc' => __('General description about the pronmary reason for investing in this project 200-300 characters', 'ignitiondeck'), + 'name' => 'Why Invest Description', + 'desc' => 'General description about the pronmary reason for investing in this project 200-300 characters', 'id' => $prefix . 'why_invest', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'name' => __('Health Impact', 'ignitiondeck'), + 'name' => 'Health Impact', 'type' => 'title', ), array( @@ -280,15 +313,15 @@ function override_ign_meta_boxes(array $meta_boxes) { ), ), array( - 'name' => __('Health', 'ignitiondeck'), - 'desc' => __('Describe why this project gets the health rating it has been given. Max 140 characters', 'ignitiondeck'), + 'name' => 'Health', + 'desc' => 'Describe why this project gets the health rating it has been given. Max 140 characters', 'id' => $prefix . 'health', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'name' => __('Financial Impact', 'ignitiondeck'), + 'name' => 'Financial Impact', 'type' => 'title', ), array( @@ -310,15 +343,15 @@ function override_ign_meta_boxes(array $meta_boxes) { ), ), array( - 'name' => __('Financial', 'ignitiondeck'), - 'desc' => __('Describe why this project gets the financial rating it has been given. Max 140 characters', 'ignitiondeck'), + 'name' => 'Financial', + 'desc' => 'Describe why this project gets the financial rating it has been given. Max 140 characters', 'id' => $prefix . 'Financial', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'name' => __('Environmental Impact', 'ignitiondeck'), + 'name' => 'Environmental Impact', 'type' => 'title', ), array( @@ -340,15 +373,15 @@ function override_ign_meta_boxes(array $meta_boxes) { ), ), array( - 'name' => __('Environmental', 'ignitiondeck'), - 'desc' => __('Describe why this project gets the environmental rating it has been given. Max 140 characters', 'ignitiondeck'), + 'name' => 'Environmental', + 'desc' => 'Describe why this project gets the environmental rating it has been given. Max 140 characters', 'id' => $prefix . 'Environmental', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => false, 'type' => 'textarea_medium' ), array( - 'name' => __('Social Impact', 'ignitiondeck'), + 'name' => 'Social Impact', 'type' => 'title', ), array( @@ -370,51 +403,56 @@ function override_ign_meta_boxes(array $meta_boxes) { ), ), array( - 'name' => __('Social', 'ignitiondeck'), - 'desc' => __('Describe why this project gets the social rating it has been given. Max 140 characters', 'ignitiondeck'), + 'name' => 'Social', + 'desc' => 'Describe why this project gets the social rating it has been given. Max 140 characters', 'id' => $prefix . 'Social', 'class' => $prefix . 'projectmeta_full tinymce', 'show_help' => false, 'type' => 'textarea_medium' ), + ), + ); + $meta_boxes[] = array( + 'id' => 'project_media', + 'title' => 'Media', + 'pages' => array('ignition_product'), + 'context' => 'normal', + 'priority' => 'high', + 'class' => $prefix . 'projectmeta', + 'fields' => array( array( - 'name' => __('Media', 'ignitiondeck'), - 'desc' => __('Add photos and video', 'ignitiondeck'), - 'type' => 'title', - ), - array( - 'name' => __('Featured Image 1024px x 340px', 'ignitiondeck'), - 'desc' => __('First photo and thumbnail seen all over the site and posted to socail media', 'ignitiondeck'), + 'name' => 'Featured Image 1024px x 340px', + 'desc' => 'First photo and thumbnail seen all over the site and posted to socail media', 'id' => $prefix . 'product_image1', 'class' => $prefix . 'projectmeta_left', 'show_help' => false, 'type' => 'file' ), array( - 'name' => __('Image 2 1024px x 340px', 'ignitiondeck'), - 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), + 'name' => 'Image 2 1024px x 340px', + 'desc' => 'Additonal photos to show on produc pages', 'id' => $prefix . 'product_image2', 'class' => $prefix . 'projectmeta_left', 'show_help' => false, 'type' => 'file' ), array( - 'name' => __('Image 3 1024px x 340px', 'ignition'), - 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), + 'name' => 'Image 3 1024px x 340px', + 'desc' => 'Additonal photos to show on produc pages', 'id' => $prefix . 'product_image3', 'class' => $prefix . 'projectmeta_left', 'show_help' => false, 'type' => 'file' ), array( - 'name' => __('Image 4 1024px x 340px', 'ignition'), - 'desc' => __('Additonal photos to show on produc pages', 'ignitiondeck'), + 'name' => 'Image 4 1024px x 340px', + 'desc' => 'Additonal photos to show on produc pages', 'id' => $prefix . 'product_image4', 'class' => $prefix . 'projectmeta_left', 'show_help' => false, 'type' => 'file' ), - ) + ), ); return apply_filters('id_postmeta_boxes', $meta_boxes); } @@ -423,10 +461,10 @@ function override_install_ign_metaboxes() { global $pagenow; if ($pagenow == 'post.php' || 'post-new.php') { add_filter('overrides_ign_cmb_meta_boxes', 'override_ign_meta_boxes'); + require_once(ID_PATH.'ign_metabox/init.php'); require_once('project-meta-boxes.php'); } } - remove_action('init', 'install_ign_metaboxes'); add_action('init', 'override_install_ign_metaboxes'); diff --git a/wordpress/wp-content/themes/backer/includes/overrides/project-meta-boxes.php b/wordpress/wp-content/themes/backer/includes/overrides/project-meta-boxes.php index 407aea29..f74be8cd 100644 --- a/wordpress/wp-content/themes/backer/includes/overrides/project-meta-boxes.php +++ b/wordpress/wp-content/themes/backer/includes/overrides/project-meta-boxes.php @@ -104,6 +104,8 @@ class override_ign_cmb_Meta_Box { echo '

    ', $field['name'], '', $field['desc'], '

    '; } else if ( $field['type'] == "subtitle" ) { echo '
    ', $field['name'], '', $field['desc'], '
    '; + } else if ( $field['type'] == "description") { + echo '

    ', $field['name'], '

    '; } else if ($field['type'] == 'checkbox') { echo '
    ', $field['desc'], '
    '; echo ''; @@ -123,8 +125,7 @@ class override_ign_cmb_Meta_Box { } switch ( $field['type'] ) { case 'text': - echo '', - ' '; + echo ''; break; case 'text_small': echo ' '; @@ -151,8 +152,7 @@ class override_ign_cmb_Meta_Box { ' '; break; case 'textarea_medium': - echo '', - ' '; + echo ''; break; case 'select': echo ''; - echo ' '; break; case 'radio_inline': echo '
    '; @@ -168,13 +167,11 @@ class override_ign_cmb_Meta_Box { echo '
    ', $option['name'], '
    '; } echo '
    '; - echo ' '; break; case 'radio': foreach ($field['options'] as $option) { echo '

    ', $option['name'].'

    '; } - echo ' '; break; case 'multicheck': echo '
      '; @@ -183,56 +180,53 @@ class override_ign_cmb_Meta_Box { // Use in_array() to check whether the current option should be checked echo '
    • '; } - echo '
    '; - echo ' '; + echo ''; break; case 'wysiwyg': echo '
    '; echo '
    '; echo '
    '; - echo ' '; break; case 'file_list': echo ''; echo ''; - echo ' '; - $args = array( - 'post_type' => 'attachment', - 'numberposts' => null, - 'post_status' => null, - 'post_parent' => $post->ID - ); - $attachments = get_posts($args); - if ($attachments) { - echo '
      '; - foreach ($attachments as $attachment) { - echo '
    • '.wp_get_attachment_link($attachment->ID, 'thumbnail', 0, 0, 'Download'); - echo ''; - echo apply_filters('the_title', ' '.$attachment->post_title); - echo '
    • '; - } - echo '
    '; - } - break; + $args = array( + 'post_type' => 'attachment', + 'numberposts' => null, + 'post_status' => null, + 'post_parent' => $post->ID + ); + $attachments = get_posts($args); + if ($attachments) { + echo '
      '; + foreach ($attachments as $attachment) { + echo '
    • '.wp_get_attachment_link($attachment->ID, 'thumbnail', 0, 0, 'Download'); + echo ''; + echo apply_filters('the_title', ' '.$attachment->post_title); + echo '
    • '; + } + echo '
    '; + } + break; case 'file': echo '
    '; echo ''; echo '
    '; echo '
    '; - if ( $meta != '' ) { - $check_image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $meta ); - if ( $check_image ) { - echo '
    '; - echo ''; - echo 'Remove Image
    '; - } else { - $parts = explode( "/", $meta ); - for( $i = 0; $i < sizeof( $parts ); ++$i ) { - $title = $parts[$i]; - } - echo 'File: ', $title, '    (Download / )'; - } - } + if ( $meta != '' ) { + $check_image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $meta ); + if ( $check_image ) { + echo '
    '; + echo ''; + echo 'Remove Image
    '; + } else { + $parts = explode( "/", $meta ); + for( $i = 0; $i < sizeof( $parts ); ++$i ) { + $title = $parts[$i]; + } + echo 'File: ', $title, '    (Download / )'; + } + } echo '
    '; break; case 'product_levels': @@ -269,16 +263,16 @@ class override_ign_cmb_Meta_Box { echo apply_filters('id_product_levels_html_admin', $levels_html, $meta_no_levels, $post->ID); break; case 'add_levels': - echo ''; + echo ''; break; ////Project What we’re installing line html form start here - case 'product_levels_2': + case 'install_level': $meta_no_levels_2 = get_post_meta( $post->ID, $name="ign_product_level_count_2", true ); $levels_html_2 = ''; //echo $meta_no_levels; if ($meta_no_levels_2 > 0 || $meta_no_levels_2 != "") { - $levels_html_2 .= '
    '; + $levels_html_2 .= '
    '; for ($i=2 ; $i <= $meta_no_levels_2 ; $i++) { $filename = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_2_".($i)."_filename", true )); @@ -286,31 +280,29 @@ class override_ign_cmb_Meta_Box { if (empty($meta_order)) { $meta_order = 0; } - $levels_html_2 .= ''. - '

    '.__('Item ', 'ignitiondeck').' '.($i).'

    '. - '
    '. - '
    '; - $levels_html_2 .= '
    '; + $levels_html_2 .= ''. + ''. + ''. + '
    '; } + $levels_html_2 .= '
    '; } else { - $levels_html_2 .= '
    '; - - $levels_html_2 .= '
    '; + $levels_html_2 .= '
    '; } echo apply_filters('id_product_levels_2_html_admin', $levels_html_2, $meta_no_levels_2, $post->ID); break; - case 'add_levels_2': - echo ''; + case 'add_install_level': + echo ''; break; ////Project What we’re installing line html form end here ////Project Timeline multiple line html form start here - case 'product_levels_3': + case 'project_timeline': $meta_no_levels_3 = get_post_meta( $post->ID, $name="ign_product_level_count_3", true ); $levels_html_3 = ''; if ($meta_no_levels_3 > 0 || $meta_no_levels_3 != "") { - $levels_html_3 .= '
    '; + $levels_html_3 .= '
    '; for ($i=2 ; $i <= $meta_no_levels_3 ; $i++) { $what = stripslashes(get_post_meta( $post->ID, $name="ign_product_level_3_".($i)."_what", true )); @@ -318,22 +310,22 @@ class override_ign_cmb_Meta_Box { if (empty($meta_order)) { $meta_order = 0; } - $levels_html_3 .= ''. - '
    '.__('Event ', 'ignitiondeck').' '.($i).'
    '. - '
    '. - ''. - ''. - '
    '; - $levels_html_3 .= '
    '; + $levels_html_3 .= ''. + '
    Event '.($i).'
    '. + '
    '. + '
    '. + '
    '. + '
    '; + } - + $levels_html_3 .= ''; } else { - $levels_html_3 .= '
    '; + $levels_html_3 .= '
    '; } echo apply_filters('id_product_levels_3_html_admin', $levels_html_3, $meta_no_levels_3, $post->ID); break; - case 'add_levels_3': - echo ''; + case 'add_timeline': + echo ''; break; ////Project Timeline multiple line html form End here case 'short_code': @@ -537,9 +529,6 @@ class override_ign_cmb_Meta_Box { } update_post_meta($post_id, 'custom_level_order', $custom_order); } - - - //=================================================================== //=================================================================== // Saving the Who is installing @@ -569,8 +558,6 @@ class override_ign_cmb_Meta_Box { } update_post_meta($post_id, 'custom_level_order_2', $custom_order); } - - //=================================================================== //=================================================================== // Saving the Project Timeline @@ -605,4 +592,112 @@ class override_ign_cmb_Meta_Box { } } +function override_ign_cmb_editor_footer_scripts() { + global $post; + if (isset($post->post_type) && $post->post_type == 'ignition_product') { + ?> + + \ No newline at end of file diff --git a/wordpress/wp-content/themes/backer/single-ignition_product.php b/wordpress/wp-content/themes/backer/single-ignition_product.php index 8ad5518b..c41a8ab9 100644 --- a/wordpress/wp-content/themes/backer/single-ignition_product.php +++ b/wordpress/wp-content/themes/backer/single-ignition_product.php @@ -17,10 +17,12 @@ $product_location = get_post_meta( $post->ID, 'ign_product_location', true ); $project_description = get_post_meta( $post->ID, 'ign_project_description', true ); $project_long_description = get_post_meta( $post->ID, 'ign_project_long_description', true ); + $ign_product_level_count_2 = get_post_meta( $post->ID, 'ign_product_level_count_2', true ); $ign_fund_goal = get_post_meta( $post->ID, 'ign_fund_goal', true ); $ign_fund_raised = get_post_meta( $post->ID, 'ign_fund_raised', true ); $ign_days_left = get_post_meta( $post->ID, 'ign_days_left', true ); + $ign_test_select = get_post_meta( $post->ID, 'ign_test_select', true ); $ign_test_select1 = get_post_meta( $post->ID, 'ign_test_select1', true ); $ign_test_select2 = get_post_meta( $post->ID, 'ign_test_select2', true ); -- GitLab From 042ab3248319a3b4ec4d6f45c5a0b596d1f1358c Mon Sep 17 00:00:00 2001 From: markAking Date: Thu, 16 Jun 2016 15:12:28 -0400 Subject: [PATCH 14/15] edit of the column widths on admin screen --- .../wp-content/themes/backer/css/admin-style.css | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wordpress/wp-content/themes/backer/css/admin-style.css b/wordpress/wp-content/themes/backer/css/admin-style.css index 1b125739..99775dfb 100644 --- a/wordpress/wp-content/themes/backer/css/admin-style.css +++ b/wordpress/wp-content/themes/backer/css/admin-style.css @@ -1,6 +1,17 @@ #poststuff #postbox-container-2 h3{ font-size: 1.25rem; } +#poststuff #post-body.columns-2{ + margin-right: 30%; +} +#post-body.columns-2 #postbox-container-1 { + float: right; + margin-right: -43%; + width: 40%; +} +#poststuff #post-body.columns-2 #side-sortables{ + width: auto; +} .metabox-holder label { font-weight: bold; margin-bottom: 10px; -- GitLab From 4755d0fa5afce7a32ccdf4f1808813a1078a9634 Mon Sep 17 00:00:00 2001 From: markAking Date: Thu, 16 Jun 2016 15:24:29 -0400 Subject: [PATCH 15/15] fixing media elements on edit page --- .../themes/backer/includes/overrides/project-edit.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wordpress/wp-content/themes/backer/includes/overrides/project-edit.php b/wordpress/wp-content/themes/backer/includes/overrides/project-edit.php index be549732..39907599 100644 --- a/wordpress/wp-content/themes/backer/includes/overrides/project-edit.php +++ b/wordpress/wp-content/themes/backer/includes/overrides/project-edit.php @@ -33,7 +33,7 @@ function override_ign_create_post_type() { 'query_var' => true, 'rewrite' => array( 'slug' => $slug, 'with_front' => true ), 'has_archive' => $slug, - 'supports' => array('title', 'author', 'thumbnail'), + 'supports' => array('title', 'author'), 'taxonomies' => array('category', 'post_tag', 'project_category'), ) ); @@ -424,7 +424,7 @@ function override_ign_meta_boxes(array $meta_boxes) { 'name' => 'Featured Image 1024px x 340px', 'desc' => 'First photo and thumbnail seen all over the site and posted to socail media', 'id' => $prefix . 'product_image1', - 'class' => $prefix . 'projectmeta_left', + 'class' => $prefix . 'projectmeta_full', 'show_help' => false, 'type' => 'file' ), @@ -432,7 +432,7 @@ function override_ign_meta_boxes(array $meta_boxes) { 'name' => 'Image 2 1024px x 340px', 'desc' => 'Additonal photos to show on produc pages', 'id' => $prefix . 'product_image2', - 'class' => $prefix . 'projectmeta_left', + 'class' => $prefix . 'projectmeta_full', 'show_help' => false, 'type' => 'file' ), @@ -440,7 +440,7 @@ function override_ign_meta_boxes(array $meta_boxes) { 'name' => 'Image 3 1024px x 340px', 'desc' => 'Additonal photos to show on produc pages', 'id' => $prefix . 'product_image3', - 'class' => $prefix . 'projectmeta_left', + 'class' => $prefix . 'projectmeta_full', 'show_help' => false, 'type' => 'file' ), @@ -448,7 +448,7 @@ function override_ign_meta_boxes(array $meta_boxes) { 'name' => 'Image 4 1024px x 340px', 'desc' => 'Additonal photos to show on produc pages', 'id' => $prefix . 'product_image4', - 'class' => $prefix . 'projectmeta_left', + 'class' => $prefix . 'projectmeta_full', 'show_help' => false, 'type' => 'file' ), -- GitLab