Skip to content

Commit

Permalink
Converting wp-lead post type module to OOP
Browse files Browse the repository at this point in the history
  • Loading branch information
atwellpub committed Aug 4, 2015
1 parent 2440ee2 commit 0389075
Show file tree
Hide file tree
Showing 6 changed files with 854 additions and 853 deletions.
85 changes: 14 additions & 71 deletions classes/class.metaboxes.wp-lead.php
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,20 @@ public static function display_full_contact_details($values, $type) {
*/
public static function setup_tabs() {

$tabs = array(array('id' => 'wpleads_lead_tab_main', 'label' => __('Profile', 'leads')), array('id' => 'wpleads_lead_tab_activity', 'label' => __('Activity', 'leads')), array('id' => 'wpleads_lead_tab_conversions', 'label' => __('Conversion Path', 'leads')), array('id' => 'wpleads_lead_tab_raw_form_data', 'label' => __('Logs', 'leads')));
$tabs = array(
array(
'id' => 'wpleads_lead_tab_main',
'label' => __('Profile', 'leads')
),
array(
'id' => 'wpleads_lead_tab_activity',
'label' => __('Activity', 'leads')
),
array(
'id' => 'wpleads_lead_tab_conversions',
'label' => __('Conversion Path', 'leads')
)
);

self::$tabs = apply_filters('wpl_lead_tabs', $tabs);

Expand Down Expand Up @@ -1468,76 +1481,6 @@ public static function display_main() {
</div>
</div>

<div class="lead-profile-section" id="wpleads_lead_tab_raw_form_data">
<div id="raw-data-display">
<div class="nav-container">
<nav>
<ul>
<li class="active"><a href="index.html"><?php _e('All', 'leads'); ?></a></li>
<li><a href="index.html"><?php _e('Form Data', 'leads'); ?></a></li>
<li><a href="index.html"><?php _e('Page Data', 'leads'); ?></a></li>
<li><a href="index.html"><?php _e('Event Data', 'leads'); ?></a></li>
</ul>
</nav>
</div>

<?php

// Get Raw form Data
$raw_data = get_post_meta($post->ID, 'wpleads_raw_post_data', true);
if ($raw_data) {
$raw_data = json_decode(stripslashes($raw_data), true);
$raw_data = ($raw_data) ? $raw_data : array();
echo "<h2>" . __('Form Inputs with Values', 'leads') . "</h2>";
echo "<span id='click-to-map'></span>";
echo "<div id='wpl-raw-form-data-table'>";
foreach ($raw_data as $key => $value) {
?>
<div class="wpl-raw-data-tr">
<span class="wpl-raw-data-td-label">
<?php echo __('Input name:', 'leads') . " <span class='lead-key-normal'>" . $key . "</span> &rarr; values:"; ?>
</span>
<span class="wpl-raw-data-td-value">
<?php
if (is_array($value)) {
$value = array_filter($value);
$value = array_unique($value);
$num_loop = 1;
foreach ($value as $k => $v) {
echo "<span class='" . $key . "-" . $num_loop . " possible-map-value'>" . $v . "</span>";
$num_loop++;
}
} else {
echo "<span class='" . $key . "-1 possible-map-value'>" . $value . "</span>";
}
?>
</span>
<span class="map-raw-field"><span
class="map-this-text">Map this field to lead</span><span style="display:none;"
class='lead_map_select'><select
name="NOA" class="field_map_select"></select></span><span
class="apply-map button button-primary"
style="display:none;">Apply</span></span>
</div>
<?php

}
echo "<div id='raw-array'>";
echo "<h2>" . __('Raw Form Data Array', 'leads') . "</h2>";
echo "<pre>";
print_r($raw_data);
echo "</pre>";
echo "</div>";
echo "</div>";
} else {
//echo "<span id='wpl-message-none'>". __( 'No raw data found!' ,'leads') ."</span>";
}

?>

</div>
<!-- end #raw-data-display -->
</div>

<?php
do_action('wpl_print_lead_tab_sections');
Expand Down
Loading

0 comments on commit 0389075

Please sign in to comment.