Skip to content

Commit

Permalink
remove a million whitespaces.
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Prosser <[email protected]>
  • Loading branch information
Simon Prosser committed Apr 19, 2013
1 parent 7c44121 commit 0af9e43
Show file tree
Hide file tree
Showing 227 changed files with 10,349 additions and 10,355 deletions.
72 changes: 36 additions & 36 deletions admin/actions.admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/**
* Show Options Panel after theme activation
*
*
* @package PageLines Framework
* @subpackage Redirects
* @since 1.0.0
Expand All @@ -15,7 +15,7 @@

/**
* Add Javascript for Layout Controls from the Layout UI class
*
*
* @package PageLines Framework
* @subpackage LayoutUI
* @since 2.0.b3
Expand All @@ -37,9 +37,9 @@
* @return string
*/
function pagelines_admin_body_class( $class ){

$class = $class.'pagelines_ui';

return $class;
}
/**
Expand All @@ -64,7 +64,7 @@ function pagelines_check_php(){
*
* AJAX OPTION SAVING
* Used to save via AJAX theme options and image uploads
*
*
* @package PageLines Framework
* @since 1.2.0
*/
Expand All @@ -78,33 +78,33 @@ function pagelines_ajax_callback() {
$setting = $_POST['setting'];
$button_id = $_POST['oid'];

$pieces = explode( 'OID', $_POST['oid'] );
$pieces = explode( 'OID', $_POST['oid'] );
$oid = $pieces[0];
$parent_oid = ( isset($pieces[1]) ) ? $pieces[1] : null;

// Uploads
if( $save_type == 'upload' ) {


$arr_file_type = wp_check_filetype( basename( $_FILES[$button_id]['name'] ));

$uploaded_file_type = $arr_file_type['type'];

// Set an array containing a list of acceptable formats
$allowed_file_types = array( 'image/jpg','image/jpeg','image/gif','image/png', 'image/x-icon');

if( in_array( $uploaded_file_type, $allowed_file_types ) ) {

$filename = $_FILES[ $button_id ];
$filename['name'] = preg_replace( '/[^a-zA-Z0-9._\-]/', '', $filename['name'] );
$filename['name'] = preg_replace( '/[^a-zA-Z0-9._\-]/', '', $filename['name'] );

$override['test_form'] = false;
$override['action'] = 'wp_handle_upload';
$override['action'] = 'wp_handle_upload';

$uploaded_file = wp_handle_upload( $filename, $override );

$upload_tracking[] = $button_id;

plupop( $oid, $uploaded_file['url'], array( 'setting' => $setting, 'parent' => $parent_oid ) );

$name = 'PageLines- ' . addslashes( $filename['name'] );
Expand All @@ -120,24 +120,24 @@ function pagelines_ajax_callback() {
$attach_id = wp_insert_attachment( $attachment, $uploaded_file['file'] );
$attach_data = wp_generate_attachment_metadata( $attach_id, $uploaded_file['file'] );
wp_update_attachment_metadata( $attach_id, $attach_data );

} else
$uploaded_file['error'] = __( 'Unsupported file type!', 'pagelines' );

if( !empty( $uploaded_file['error'] ) )
echo sprintf( __('Upload Error: %s', 'pagelines' ) , $uploaded_file['error'] );
else{
//print_r($r);
echo $uploaded_file['url']; // Is the Response

}
} elseif( $save_type == 'image_reset' ){
plupop( $oid, null, array( 'setting' => $setting, 'parent' => $parent_oid ) );
}

die();
}

/**
* (AJAX) Save Template Map
*
Expand Down Expand Up @@ -176,12 +176,12 @@ function ajax_save_template_map() {
save_template_map( $templatemap );

PageLinesRenderCSS::flush_version( false );

echo true;

die();
}

/**
* Ajax Save Options Callback
*
Expand Down Expand Up @@ -214,7 +214,7 @@ function pagelines_ajax_save_option_callback() {
*/
add_action( 'admin_init', 'pagelines_inline_help' );
function pagelines_inline_help() {

$pl_help = new PageLines_Inline_Help;
}

Expand Down Expand Up @@ -266,13 +266,13 @@ function pl_post_columns($columns) {
function pl_posts_show_columns($name) {
global $post;
switch ($name) {

case 'feature':
if( has_post_thumbnail( $post->ID )) {
the_post_thumbnail( array(48,48) );
}
break;

break;
}
}

Expand All @@ -292,17 +292,17 @@ function pl_page_show_columns($name) {
switch ($name) {
case 'template':
$template = get_post_meta( $post->ID, '_wp_page_template', true );
if ( 'default' == $template ) {

if ( 'default' == $template ) {
_e( 'Default', 'pagelines' );
break;
}

$file = sprintf( '%s/%s', PL_PARENT_DIR, $template );

if ( !is_file( $file ) )
$file = sprintf( '%s/%s', CHILD_DIR, $template );

if ( !is_file( $file ) ) {
printf( '<a href="%s">%s</a>', admin_url( sprintf( 'post.php?post=%s&action=edit', $post->ID ) ), __( 'No Template Assigned', 'pagelines' ) ) ;
break;
Expand All @@ -314,16 +314,16 @@ function pl_page_show_columns($name) {
$template = $data['name'];
else
$template = __( 'Default', 'pagelines' );

echo $template;
break;

case 'feature':
if( has_post_thumbnail( $post->ID )) {
the_post_thumbnail( array(48,48) );
}
break;

break;
}
}

Expand Down
Loading

0 comments on commit 0af9e43

Please sign in to comment.