Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
atwellpub committed Jul 17, 2015
1 parent 50d9ca0 commit 6fc2c93
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ shared/languages/leads/_get-translations.bat
# Grunt
node_modules
Desktop.ini
.idea/
46 changes: 38 additions & 8 deletions classes/class.metaboxes.wp-lead.php
Original file line number Diff line number Diff line change
Expand Up @@ -832,12 +832,28 @@ public static function activity_navigation() {
global $post;


$nav_items = array(array('id' => 'lead-conversions', 'label' => __('Conversions', 'leads'), 'count' => self::get_conversion_count()), array('id' => 'lead-page-views', 'label' => __('Page Views', 'leads'), 'count' => get_post_meta($post->ID, 'wpleads_page_view_count', true)), array('id' => 'lead-comments', 'label' => __('Comments', 'leads'), 'count' => self::get_comment_count()), /*array(
'id'=>'lead-searches',
'label'=> __( 'Searches' , 'leads' ),
'count' => self::get_search_count()
),*/
array('id' => 'lead-tracked-links', 'label' => __('Custom Events', 'leads'), 'count' => self::get_custom_events_count()));
$nav_items = array(
array(
'id' => 'lead-conversions',
'label' => __('Conversions', 'leads'),
'count' => self::get_conversion_count()
),
array(
'id' => 'lead-page-views',
'label' => __('Page Views', 'leads'),
'count' => get_post_meta($post->ID, 'wpleads_page_view_count', true)
),
array(
'id' => 'lead-comments',
'label' => __('Comments', 'leads'),
'count' => self::get_comment_count()
),
array(
'id' => 'lead-tracked-links',
'label' => __('Custom Events', 'leads'),
'count' => self::get_custom_events_count()
)
);

$nav_items = apply_filters('wpl_lead_activity_tabs', $nav_items); ?>

Expand Down Expand Up @@ -894,6 +910,10 @@ public static function activity_conversions() {
$i = count(self::$conversions);
foreach (self::$conversions as $key => $value) {

if (!isset($value['id']) || !isset($value['datetime'])) {
continue;
}

$converted_page_id = $value['id'];
$converted_page_permalink = get_permalink($converted_page_id);
$converted_page_title = get_the_title($converted_page_id);
Expand Down Expand Up @@ -1141,7 +1161,7 @@ public static function activity_custom_events() {
global $post;
?>
<div id="lead-tracked-links" class='lead-activity'>
<h2><?php _e('Custom Events', 'cta'); ?></h2>
<h2><?php _e('Custom Events', 'leads'); ?></h2>
<?php


Expand All @@ -1152,6 +1172,11 @@ public static function activity_custom_events() {
foreach (self::$custom_events as $key => $event) {
$id = $event['tracking_id'];

/* skip events without dates */
if (!self::$custom_events[$key]['datetime']) {
continue;
}

$date_raw = new DateTime(self::$custom_events[$key]['datetime']);
$date_of_conversion = $date_raw->format('F jS, Y g:ia (l)');
$clean_date = $date_raw->format('Y-m-d H:i:s');
Expand All @@ -1171,7 +1196,7 @@ public static function activity_custom_events() {

}
} else {
printf(__('%1$s No custom events discovered! %2$s', 'cta'), '<span id=\'wpl-message-none\'>', '</span>');
printf(__('%1$s No custom events discovered! %2$s', 'leads'), '<span id=\'wpl-message-none\'>', '</span>');
}


Expand Down Expand Up @@ -1211,6 +1236,11 @@ public static function display_lead_conversion_paths() {

$c_count = 0;
foreach (self::$conversions as $key => $value) {

if (!isset($value['id']) || !isset($value['datetime'])) {
continue;
}

$c_array[$c_count]['page'] = $value['id'];
$c_array[$c_count]['date'] = $value['datetime'];
$c_array[$c_count]['conversion'] = 'yes';
Expand Down

0 comments on commit 6fc2c93

Please sign in to comment.