Skip to content

Commit

Permalink
More code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejarrett committed Mar 21, 2014
1 parent f99c24b commit 64fbc49
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions includes/meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,16 @@ public function metabox_content( $object, $section ) {
'end' => '',
);

$user_interval = WP_Stream_Reports_Settings::get_user_options( 'interval', $default_interval );
$user_interval = WP_Stream_Reports_Settings::get_user_options( 'interval', $default_interval );
$user_interval_key = $user_interval['key'];

$available_intervals = $date->get_predefined_intervals();
if ( array_key_exists( $user_interval_key, $available_intervals ) ) {
$user_interval['start'] = $available_intervals[ $user_interval_key ]['start'];
$user_interval['end'] = $available_intervals[ $user_interval_key ]['end'];
$user_interval['end'] = $available_intervals[ $user_interval_key ]['end'];
}

$records = $this->load_metabox_records( $args, $user_interval );
$records = $this->load_metabox_records( $args, $user_interval );

switch ( $chart_type ) {
case 'pie':
Expand All @@ -162,19 +162,19 @@ public function metabox_content( $object, $section ) {
$data_group = isset( $args['data_group'] ) ? $args['data_group'] : null;

$data_types = array(
'all' => __( 'All Activity', 'stream-report' ),
'all' => __( 'All Activity', 'stream-reports' ),
array(
'title' => __( 'Connector Activity', 'stream-report' ),
'title' => __( 'Connector Activity', 'stream-reports' ),
'group' => 'connector',
'options' => WP_Stream_Connectors::$term_labels['stream_connector'],
),
array(
'title' => __( 'Context Activity', 'stream-report' ),
'title' => __( 'Context Activity', 'stream-reports' ),
'group' => 'context',
'options' => WP_Stream_Connectors::$term_labels['stream_context'],
),
array(
'title' => __( 'Actions Activity', 'stream-report' ),
'title' => __( 'Actions Activity', 'stream-reports' ),
'group' => 'action',
'options' => WP_Stream_Connectors::$term_labels['stream_action'],
),
Expand Down Expand Up @@ -403,7 +403,7 @@ public function save_metabox_config() {

// Store the chart configuration
self::$sections[ $id ] = $input;

// Update the database option
WP_Stream_Reports_Settings::update_user_option( 'sections', self::$sections );
}
Expand Down
6 changes: 3 additions & 3 deletions views/meta-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<div class="inside">

<select class="chart-option chart-dataset">
<?php foreach ( $data_types as $section_key => $section ) :
if( is_string( $section ) ) :?>
<?php foreach ( $data_types as $section_key => $section ) : ?>
<?php if ( is_string( $section ) ) : ?>
<option data-group="other" value="<?php echo esc_attr( $section_key ) ?>" <?php selected( $section_key === $data_type ) ?>>
<?php echo esc_html( $section ) ?>
</option>
<?php else: ?>
<?php else : ?>
<optgroup label="<?php echo esc_attr( $section['title'] ) ?>">
<?php foreach ( $section['options'] as $type => $text ) : ?>
<option data-group="<?php echo esc_attr( $section['group'] ) ?>" value="<?php echo esc_attr( $type ) ?>" <?php selected( $type === $data_type ) ?>>
Expand Down

0 comments on commit 64fbc49

Please sign in to comment.