/** * Get user data structure. May be depreciated. * * @since 0.1 * */ static function user_object_structure($args = '') { global $wp_crm, $wpdb; $defaults = array('table_cols' => 'false', 'root_only' => 'false'); $args = wp_parse_args($args, $defaults); foreach ($wpdb->get_results("SHOW COLUMNS FROM {$wpdb->users}") as $column) { $a[$column->Field] = CRM_UD_F::de_slug($column->Field); $table_cols[] = $column->Field; } if (!empty($wp_crm['data_structure']) && is_array($wp_crm['data_structure']['attributes'])) { foreach ($wp_crm['data_structure']['attributes'] as $attribute => $attribute_data) { $a[$attribute] = $attribute_data['title']; if ($args['root_only'] == 'true') { continue; } if (!empty($attribute_data['options'])) { foreach (explode(',', $attribute_data['options']) as $this_option) { $a[$attribute . '_' . CRM_UD_F::create_slug($this_option)] = $this_option; } } } } if ($args['table_cols'] == 'true') { return $table_cols; } return $a; }
<li> <input type="checkbox" value="<?php echo $key; ?> " <?php CRM_UD_UI::checked_in_array($key, $wp_crm['configuration']['overview_table_options']['main_view']); ?> name="wp_crm[configuration][overview_table_options][main_view][]" id="<?php echo $key . $rand; ?> " /> <label for="<?php echo $key . $rand; ?> "><?php echo $attribute_data['title'] ? $attribute_data['title'] : CRM_UD_F::de_slug($key); ?> <?php echo !empty($attribute_data['quick_description']) ? '<span class="description">' . $attribute_data['quick_description'] . '</span>' : ''; ?> </label> </li> <?php } ?> </ul> </div> </td> </tr>