Changeset 886172
- Timestamp:
- 04/02/2014 06:48:49 AM (10 years ago)
- Location:
- photostream-sync/branches/ux-refresh
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
photostream-sync/branches/ux-refresh/class-photostream-client.php
r884718 r886172 81 81 $response = wp_remote_post( $url, array( 'body' => $body ) ); 82 82 if( is_wp_error( $response ) ) { 83 $end_message = '<br /><a href="' . esc_url( $__photostream->get_admin_page() ) . '" > Go Back and try again!</a>';83 $end_message = '<br /><a href="' . esc_url( $__photostream->get_admin_page() ) . '" > </a>'; 84 84 wp_die( $response->get_error_message().$end_message ); 85 85 } -
photostream-sync/branches/ux-refresh/class-photostream-list-table.php
r886143 r886172 56 56 57 57 $actions = array( 58 'edit' => sprintf( '<a href="%s" class="edit" >%s</a>', $edit_photostream_link, esc_html__( 'Edit' ) ),59 'import' => sprintf( '<a href="%s" class="import" >%s</a>', $import_photostream_link, esc_html__( 'Import' ) ),60 'delete' => sprintf( '<a href="%s" class="delete" >%s</a>', $delete_photostream_link, esc_html__( 'Delete' ) )58 'edit' => sprintf( '<a href="%s" class="edit" >%s</a>', $edit_photostream_link, esc_html__( 'Edit' ) ), 59 'import' => sprintf( '<a href="%s" class="import" >%s</a>', $import_photostream_link, esc_html__( 'Import' ) ), 60 'delete' => sprintf( '<a href="%s" class="delete" >%s</a>', $delete_photostream_link, esc_html__( 'Delete' ) ) 61 61 62 62 ); 63 63 64 $sync_icon = ( $item['sync'] ? '<div class="dashicons dashicons-backup" title="' . esc_attr__( 'Syncing Enabled' ) . '"></div> ' : '' );64 $sync_icon = ( $item['sync'] ? '<div class="dashicons dashicons-backup" title="' . esc_attr__( 'Syncing Enabled' ) . '"></div> ' : '' ); 65 65 $actions['info'] = $__photostream->get_processed_media_info( $item['key'] ); 66 66 … … 106 106 107 107 // 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text 108 'photostream' => esc_html__( 'Photostream' ),109 'link' => esc_html__( 'Link' ),110 'as_author' => esc_html__( 'Post as' ),108 'photostream' => esc_html__( 'Photostream' ), 109 'link' => esc_html__( 'Link' ), 110 'as_author' => esc_html__( 'Post as'), 111 111 112 112 -
photostream-sync/branches/ux-refresh/photostream-sync.php
r886153 r886172 49 49 load_plugin_textdomain( 'photostream' ); 50 50 $page = add_media_page( 51 esc_html( __( 'Photostreams' ) ),52 esc_html( __( 'Photostreams' ) ),51 esc_html( __( 'Photostreams' ) ), 52 esc_html( __( 'Photostreams' ) ), 53 53 'import', // @todo: change permission so that people that can uplaod media can add a photo stream 54 54 'photostream', … … 60 60 61 61 function add_action_links( $links ) { 62 $links['settings'] = '<a href="'.esc_url( $this->admin_page ).'">'. __( 'Settings' ) . '</a>';62 $links['settings'] = '<a href="'.esc_url( $this->admin_page ).'">'. __( 'Settings' ) . '</a>'; 63 63 return $links; 64 64 } … … 88 88 function display_text_transform_options() { 89 89 ?><div class="transform_options"> 90 <a href="#" onClick="jQuery(this).parent().find('div:first').toggle('fast'); return false;"> Show Options</a>90 <a href="#" onClick="jQuery(this).parent().find('div:first').toggle('fast'); return false;"></a> 91 91 <div> 92 92 stream->title, stream->key<br/> 93 93 owner->firstName, owner->lastName, owner->fullName<br/> 94 image->caption, image->guid, image->date(<a href="http://us2.php.net/manual/en/function.date.php" target="_blank"> format</a>)<br/>95 batch->guid, batch->date(<a href="http://us2.php.net/manual/en/function.date.php" target="_blank"> format</a>)<br/>96 fetch->date(<a href="http://us2.php.net/manual/en/function.date.php" target="_blank"> format</a>)94 image->caption, image->guid, image->date(<a href="http://us2.php.net/manual/en/function.date.php" target="_blank"></a>)<br/> 95 batch->guid, batch->date(<a href="http://us2.php.net/manual/en/function.date.php" target="_blank"></a>)<br/> 96 fetch->date(<a href="http://us2.php.net/manual/en/function.date.php" target="_blank"></a>) 97 97 </div> 98 98 </div> … … 115 115 $this->view = ( isset( $_GET['view'] ) && in_array( $_GET['view'], array( 'init', 'add', 'edit', 'import', 'delete', 'add_import' ) ) ? $_GET['view'] : 'init' ); 116 116 $this->key = ( isset( $_GET['key'] ) && in_array( $_GET['key'] , $streams ) ? $_GET['key'] : false ); 117 $invalid_key = __( 'Sorry, the stream you are looking for doesn\'t exits' );117 $invalid_key = __( 'Sorry, the stream you are looking for doesn\'t exits' ); 118 118 ?> 119 119 <div class="wrap photostream-wrap"> 120 120 <h2> 121 <?php esc_html_e( 'Photostreams' ); ?>121 <?php esc_html_e( 'Photostreams' ); ?> 122 122 <?php if( in_array( $this->view, array( 'edit', 'import', 'delete' )) ) { ?> 123 <a class="return-to" href="<?php echo esc_url( $this->admin_page ); ?>"><?php _e( 'Back to Photostreams'); ?></a>123 <a class="return-to" href="<?php echo esc_url( $this->admin_page ); ?>"><?php '); ?></a> 124 124 <?php } ?> 125 125 </h2> … … 189 189 ?> 190 190 <div class="ps-sync-manage" > 191 <h3><?php _e('Manage Your Streams'); ?></h3>191 <h3><?php ); ?></h3> 192 192 <?php 193 193 // include the lis … … 273 273 274 274 function admin_ui_add_step( $step_count ) { 275 $steps = array( __( 'Add URL' ) , __( 'Configure Photostream' ) , __( 'Import Media' ) );275 $steps = array( __( 'Add URL'' ) ); 276 276 ?><ul class="steps-shell"> <?php 277 277 for($i = 0; isset( $steps[$i] ) ;$i++ ) { … … 282 282 } 283 283 ?> 284 <li class="<?php echo $class; ?>"><?php echo __( 'Step' ) . ' ' . ( $i + 1 ); ?>: <span><?php echo $steps[$i]; ?></span></li>284 <li class="<?php echo $class; ?>"><?php echo ; ?></span></li> 285 285 <?php 286 286 } ?> … … 295 295 */ 296 296 function admin_ui_add_url() { ?> 297 <h3> Add Photostream</h3>297 <h3></h3> 298 298 <div class="add-photostream-url"> 299 299 <form method="post"> 300 300 <?php wp_nonce_field( 'ps-sync-add-1', 'ps-nonce' ); ?> 301 301 <input type="hidden" name="section" value="add-url" /> 302 <strong><?php esc_html_e('Photostream URL' ); ?></strong><br />302 <strong><?php esc_html_e('Photostream URL'); ?></strong><br /> 303 303 304 304 <input id="photostream-url" class="regular-text code" type="text" value="" placeholder="https://www.icloud.com/photostream/" name="photostream-url"> 305 <input id="submit-add-photosteam-url" class="button button-primary submit-form" type="submit" value="<?php esc_attr_e( 'Next' ); ?>" name="submit" /><span class="spinner"></span>306 <p id="help-message"><em><?php esc_html_e( 'Enter the URL of your public iCloud photostream' ); echo '<br />'; _e('It should look something like this'); ?> "https://www.icloud.com/photostream/#nnnnnnnnnnnnn".</em></p>305 <input id="submit-add-photosteam-url" class="button button-primary submit-form" type="submit" value="<?php esc_attr_e( 'Next' ); ?>" name="submit" /><span class="spinner"></span> 306 <p id="help-message"><em><?php esc_html_e( 'Enter the URL of your public iCloud photostream''); ?> "https://www.icloud.com/photostream/#nnnnnnnnnnnnn".</em></p> 307 307 <input name="step" type="hidden" value="2" /> 308 308 </form> 309 309 </div> 310 310 <div class="info-box"> 311 <strong><?php _e('Steps to create a public photostreams URL on the iPhone' ); ?></strong>311 <strong><?php _e('Steps to create a public photostreams URL on the iPhone'); ?></strong> 312 312 <ol> 313 <li><?php _e('Open the photos app' );?></li>314 <li><?php _e('Tap "Photo Stream" (bottom)' );?></li>315 <li><?php _e('Tap + (top)' );?></li>316 <li><?php _e('Give it a name, make sure "Public Website" is "On"' );?></li>317 <li><?php _e('Tap Create (top)' );?></li>318 <li><?php _e('Back at the list get the details for this new Stream (tap the blue right arrow)' );?></li>319 <li><?php _e('Down at the bottom is the link to the photostream.' );?></li>313 <li><?php _e('Open the photos app');?></li> 314 <li><?php _e('Tap "Photo Stream" (bottom)');?></li> 315 <li><?php _e('Tap + (top)');?></li> 316 <li><?php _e('Give it a name, make sure "Public Website" is "On"');?></li> 317 <li><?php _e('Tap Create (top)');?></li> 318 <li><?php _e('Back at the list get the details for this new Stream (tap the blue right arrow)');?></li> 319 <li><?php _e('Down at the bottom is the link to the photostream.');?></li> 320 320 </ol> 321 321 </div> … … 330 330 function admin_ui_add_step2() { ?> 331 331 <div class="stream-info"> 332 <h3><?php _e('Addingphotostream'); ?>: <em><?php echo esc_html( $this->add_data['title'] ); ?></em></h3>333 <p class="info"><strong><?php echo esc_html( $this->add_data['title'] ); ?></strong> <?php _e( 'photostream contains');?> <?php echo $this->add_data['stream_media_info']; ?>. <a target="_blank" href="<?php echo esc_url($this->add_data['url']); ?>" title="<?php _e( 'Go to photo stream '); ?>. <?php echo esc_attr( $this->add_data['title'] ); ?>">Visit photostream</a> #<?php echo esc_html( $this->add_data['key'] ); ?></p>332 <h3><?php photostream'); ?>: <em><?php echo esc_html( $this->add_data['title'] ); ?></em></h3> 333 <p class="info"><strong><?php echo esc_html( $this->add_data['title'] ); ?></strong> <?php </a> #<?php echo esc_html( $this->add_data['key'] ); ?></p> 334 334 </div> 335 335 <?php … … 348 348 ?> 349 349 <div class="stream-info"> 350 <h3><?php _e('Editing photostream'); ?>: <em><?php echo esc_html( $stream->title ); ?></em></h3>351 <p class="info"><strong><?php echo esc_html( $stream->title ); ?></strong> <?php __( 'photostream added' ); ?> <?php echo $this->get_processed_media_info( $this->key ); ?>. <a target="_blank" href="<?php echo esc_url( $url ); ?>" title="<?php _e( 'Go to photo stream ' ); ?>. <?php echo esc_attr( $stream->title ); ?>">Visit photostream</a> #<?php echo esc_html( $this->key ); ?></p>350 <h3><?php ); ?>: <em><?php echo esc_html( $stream->title ); ?></em></h3> 351 <p class="info"><strong><?php echo esc_html( $stream->title ); ?></strong> <?php </a> #<?php echo esc_html( $this->key ); ?></p> 352 352 </div> 353 353 <?php … … 404 404 405 405 $messages = array( 406 'gallery' => _n_noop('%s Gallery', '%s Galleries' ),406 'gallery' => _n_noop('%s Gallery', '%s Galleries'), 407 407 'photo' => _n_noop('%s Picture', '%s Pictures'), 408 408 'video' => _n_noop('%s Video', '%s Videos') … … 412 412 $first_seperater = $second_seperater = ' '.__('and').' '; 413 413 if( $number_of_galleries > 0 ) { 414 $display_galleries = "<strong>" . esc_html( sprintf( translate_nooped_plural( $messages['gallery'], $number_of_galleries ), $number_of_galleries ) ) ."</strong>";414 $display_galleries = "<strong>" . esc_html( sprintf( translate_nooped_plural( $messages['gallery'], $number_of_galleries ), $number_of_galleries ) ) ."</strong>"; 415 415 } else { 416 416 $first_seperater = ''; … … 418 418 419 419 if( $number_of_photos > 0 ) { 420 $display_photos = "<strong>" . esc_html( sprintf( translate_nooped_plural( $messages['photo'], $number_of_photos ), $number_of_photos ) ) ."</strong>";420 $display_photos = "<strong>" . esc_html( sprintf( translate_nooped_plural( $messages['photo'], $number_of_photos ), $number_of_photos ) ) ."</strong>"; 421 421 } 422 422 423 423 if( $number_of_videos > 0 ) { 424 $display_videos = "<strong>" . esc_html( sprintf( translate_nooped_plural( $messages['video'], $number_of_videos ), $number_of_videos ) ) ."</strong>";424 $display_videos = "<strong>" . esc_html( sprintf( translate_nooped_plural( $messages['video'], $number_of_videos ), $number_of_videos ) ) ."</strong>"; 425 425 $second_seperater = ( !empty( $display_photos ) ? ", " : "" ); 426 426 } else { … … 447 447 wp_enqueue_script( 'photostream-add' ); 448 448 wp_localize_script( 'photostream-add', 'photostream_add', array( 449 'show' => 'Show Advanced Options',450 'hide' => 'Hide Advanced Options'449 'show' => , 450 'hide' => 451 451 )); 452 452 switch( $action ) { … … 499 499 <tbody> 500 500 <tr > 501 <th><?php esc_html_e( 'Enable Syncing' ); ?></th>501 <th><?php esc_html_e( 'Enable Syncing' ); ?></th> 502 502 <td> 503 503 <input type="hidden" name="photostream<?php echo $form_section; ?>[enabled]" value="0"/> 504 504 <input type="checkbox" name="photostream<?php echo $form_section; ?>[enabled]" value="1" <?php checked( true, $stream->enabled ); ?> /> 505 <span class="help"><?php esc_html_e( 'Enable, or disable whether importing should happen for this stream.' ); ?></span>505 <span class="help"><?php esc_html_e( 'Enable, or disable whether importing should happen for this stream.' ); ?></span> 506 506 </td> 507 507 … … 509 509 </tbody> 510 510 </table> 511 <h3><?php _e( 'Gallery Settings' ); ?></h3>511 <h3><?php _e( 'Gallery Settings' ); ?></h3> 512 512 <table class="form-table"> 513 513 <tbody> … … 517 517 <input type="text" name="photostream<?php echo $form_section; ?>[post_title]" value="<?php esc_attr_e( $stream->post_title ); ?>" 518 518 placeholder="stream->title - batch->date(Y-m-d)" class="regular-text" /> 519 <p class="help"><?php esc_html_e( 'Configure the post title for gallery posts. Click "show options" for formatting help.' ); ?></p>519 <p class="help"><?php esc_html_e( 'Configure the post title for gallery posts. Click "show options" for formatting help.' ); ?></p> 520 520 <?php $this->display_text_transform_options(); ?> 521 521 </td> 522 522 </tr> 523 523 <tr> 524 <th><?php esc_html_e( 'Gallery Author' ); ?></th>524 <th><?php esc_html_e( 'Gallery Author' ); ?></th> 525 525 <td> 526 526 <?php wp_dropdown_users( array( 'name' => 'photostream' . $form_section . '[user]' , 'selected' => $stream->user) ); ?> 527 <span class="help"><?php esc_html_e( 'Choose the WordPress user that this plugin is acting as when importing this photostream.' ); ?></span>527 <span class="help"><?php esc_html_e( 'Choose the WordPress user that this plugin is acting as when importing this photostream.' ); ?></span> 528 528 </td> 529 529 </tr> 530 530 <tr> 531 <th><?php esc_html_e( 'Default Password' ); ?></th>531 <th><?php esc_html_e( 'Default Password' ); ?></th> 532 532 <td><input name="photostream<?php echo $form_section; ?>[password]" class="regular-text" type="text" value="<?php esc_attr_e( $stream->password ); ?>" /> 533 <p class="help"><?php esc_html_e( 'Password Protect all gallery posts made during import' ); ?></p>533 <p class="help"><?php esc_html_e( 'Password Protect all gallery posts made during import' ); ?></p> 534 534 </td> 535 535 </tr> 536 536 537 537 <tr> 538 <th><?php esc_html_e( 'Gallery Caption Use' ); ?></th>538 <th><?php esc_html_e( 'Gallery Caption Use' ); ?></th> 539 539 <td> 540 540 <select name="photostream<?php echo $form_section; ?>[use_caption]"> 541 <option value="" ><?php esc_html_e( 'Do not use caption' ); ?></option>542 <option value="above" <?php selected( 'above', $stream->use_caption ); ?> ><?php esc_html_e( "Place the caption above the gallery" ); ?></option>543 <option value="below" <?php selected( 'below', $stream->use_caption ); ?> ><?php esc_html_e( "Place the caption below the gallery" ); ?></option>541 <option value="" ><?php esc_html_e( 'Do not use caption' ); ?></option> 542 <option value="above" <?php selected( 'above', $stream->use_caption ); ?> ><?php esc_html_e( "Place the caption above the gallery" ); ?></option> 543 <option value="below" <?php selected( 'below', $stream->use_caption ); ?> ><?php esc_html_e( "Place the caption below the gallery" ); ?></option> 544 544 </select> 545 <p class="help"><?php esc_html_e( 'Configure how a caption should be included in the gallery posts when one is available.' ); ?></p>545 <p class="help"><?php esc_html_e( 'Configure how a caption should be included in the gallery posts when one is available.' ); ?></p> 546 546 </td> 547 547 </tr> 548 548 <tr> 549 <th><?php esc_html_e( 'Gallery Publishing' ); ?></th>549 <th><?php esc_html_e( 'Gallery Publishing' ); ?></th> 550 550 <td> 551 551 <select name="photostream<?php echo $form_section; ?>[post_status]"> 552 <option value="publish" <?php selected( 'publish', $stream->post_status ); ?> > Publish</option>553 <option value="draft" <?php selected( 'draft', $stream->post_status ); ?> > Draft</option>552 <option value="publish" <?php selected( 'publish', $stream->post_status ); ?> ></option> 553 <option value="draft" <?php selected( 'draft', $stream->post_status ); ?> ></option> 554 554 </select> 555 <span class="help"><?php esc_html_e( 'Choose whether gallery posts should be published automatically or kept as drafts.' ); ?></span>555 <span class="help"><?php esc_html_e( 'Choose whether gallery posts should be published automatically or kept as drafts.' ); ?></span> 556 556 </td> 557 557 </tr> 558 558 <tr> 559 <th><?php esc_html_e( 'Gallery Tags' ); ?></th>559 <th><?php esc_html_e( 'Gallery Tags' ); ?></th> 560 560 <td> 561 <p class="help"><?php esc_html_e( 'Choose one or more tags for gallery posts.' ); ?></p>561 <p class="help"><?php esc_html_e( 'Choose one or more tags for gallery posts.' ); ?></p> 562 562 <div class="tagsdiv" id="post_tag"> 563 563 <div id="#tagsdiv-post_tag"> 564 564 <div class="jaxtag"> 565 565 <div class="nojs-tags hide-if-js"> 566 <p> Add or remove tags</p>566 <p></p> 567 567 <textarea id="tax-input-post_tag" class="the-tags" cols="20" rows="3" name="photostream<?php echo $form_section; ?>[tags]"><?php esc_attr_e( implode( ', ', $stream->tags ) ); ?></textarea></div> 568 568 <div class="ajaxtag hide-if-no-js"> 569 <label for="new-tag-post_tag" class="screen-reader-text"> Tags</label>570 <div class="taghint" style=""> Add New Tag</div>569 <label for="new-tag-post_tag" class="screen-reader-text"></label> 570 <div class="taghint" style=""></div> 571 571 <p><input type="text" placeholder="tag1, tag2, tag3" value="" autocomplete="off" size="16" class="newtag form-input-tip" name="newtag[post_tag]" id="new-tag-post_tag"> 572 572 <input type="button" value="Add" class="button tagadd"></p> 573 573 </div> 574 <p class="howto"> Separate tags with commas</p>574 <p class="howto"></p> 575 575 </div> 576 576 <div class="tagchecklist"></div> … … 582 582 </tr> 583 583 <tr> 584 <th><?php esc_html_e( 'Gallery Categories' ); ?></th>584 <th><?php esc_html_e( 'Gallery Categories' ); ?></th> 585 585 <td> 586 586 <ul class="gallery-categories"><?php wp_category_checklist( 0, 0, $stream->cats ); ?></ul> 587 <p class="help"><?php esc_html_e( 'Choose one or more categories for gallery posts.' ); ?></p>587 <p class="help"><?php esc_html_e( 'Choose one or more categories for gallery posts.' ); ?></p> 588 588 </td> 589 589 <?php … … 593 593 </tbody> 594 594 </table> 595 <p><a href="#advance-settings" id="advance-settings-toggle"><?php _e( 'Show Advance Settings' ); ?></a></p>595 <p><a href="#advance-settings" id="advance-settings-toggle"><?php _e( 'Show Advance Settings' ); ?></a></p> 596 596 597 597 <div class="advance-settings" > 598 <h3><?php _e( 'Advance Settings' ); ?></h3>598 <h3><?php _e( 'Advance Settings' ); ?></h3> 599 599 <table class="form-table"> 600 600 <tbody> 601 601 <tr> 602 <th><?php esc_html_e( 'Gallery Post Type' ); ?></th>602 <th><?php esc_html_e( 'Gallery Post Type' ); ?></th> 603 603 <td> 604 604 <select name="photostream<?php echo $form_section; ?>[post_type]"> … … 607 607 <?php } ?> 608 608 </select> 609 <p class="help"><?php esc_html_e( 'Choose a post type for gallery posts. This is an advanced setting for users writing themes around this plugin.' ); ?></p>609 <p class="help"><?php esc_html_e( 'Choose a post type for gallery posts. This is an advanced setting for users writing themes around this plugin.' ); ?></p> 610 610 </td> 611 611 </tr> 612 612 <tr> 613 <th><?php esc_html_e( 'Gallery Shortcode' ); ?></th>613 <th><?php esc_html_e( 'Gallery Shortcode' ); ?></th> 614 614 <td> 615 615 <input name="photostream<?php echo $form_section; ?>[gallery_shortcode]" type="text" placeholder="[gallery]" value="<?php esc_attr_e($stream->gallery_shortcode); ?>" /> 616 <p class="help"><?php esc_html_e( 'Choose a custom gallery shortcode for gallery posts. This is an advanced setting and is best left alone unless you have a specific reason to change it.' ); ?></p>616 <p class="help"><?php esc_html_e( 'Choose a custom gallery shortcode for gallery posts. This is an advanced setting and is best left alone unless you have a specific reason to change it.' ); ?></p> 617 617 </td> 618 618 </tr> … … 621 621 <td> 622 622 <input name="photostream<?php echo $form_section; ?>[video_shortcode]" type="text" placeholder="loop='off' autoplay='off'" value="<?php esc_attr_e($stream->video_shortcode); ?>" /> 623 <p class="help"><?php esc_html_e( 'Add parameters to the [video] shortcode. This goes inside the shortcode so, unlike the gallery setting, you should not supply the entire shortcode. This is an advanced setting and is best left alone unless you have a specific reason to change it.' ); ?></p>623 <p class="help"><?php esc_html_e( 'Add parameters to the [video] shortcode. This goes inside the shortcode so, unlike the gallery setting, you should not supply the entire shortcode. This is an advanced setting and is best left alone unless you have a specific reason to change it.' ); ?></p> 624 624 </td> 625 625 </tr> 626 626 627 627 <tr> 628 <th><?php esc_html_e( 'Media Filename Config' ); ?></th>628 <th><?php esc_html_e( 'Media Filename Config' ); ?></th> 629 629 <td> 630 630 <input … … 634 634 value="<?php esc_attr_e( $stream->rename_file ); ?>" 635 635 placeholder="stream->title - owner->fullName -- file->date(Y-m-d).jpg"/> 636 <p class="help"><?php esc_html_e( 'Configure the filename to save imported media as. Click "show options" for formatting help.' ); ?></p>636 <p class="help"><?php esc_html_e( 'Configure the filename to save imported media as. Click "show options" for formatting help.' ); ?></p> 637 637 <?php $this->display_text_transform_options(); ?> 638 638 </td> … … 644 644 645 645 <?php 646 $submit_text = ( ( 'edit' == $this->view ) ? __( 'Update Photostream' ) : __( 'Add Photostream and Import Media' ) );646 $submit_text = ( ( 'edit' == $this->view ) ? __( 'Update Photostream'' ) ); 647 647 $this->display_submit_form( $submit_text ); ?> 648 648 </form> … … 659 659 </div> 660 660 661 <span class="cancel-link"> <?php _e( 'or' ); ?>662 <a href="<?php echo esc_url( $this->admin_page ); ?>"><?php _e( 'cancel return to Photostreams'); ?></a></span>661 <span class="cancel-link"> <?php ' ); ?> 662 <a href="<?php echo esc_url( $this->admin_page ); ?>"><?php '); ?></a></span> 663 663 <?php 664 664 } … … 672 672 673 673 if( !$this->key ) { 674 return $this->display_error( 'Sorry but this key doesn\'t stream to exits' );674 return $this->display_error( 'Sorry but this key doesn\'t stream to exits' ); 675 675 } 676 676 … … 680 680 681 681 if( !is_object($client ) ) 682 return $this->display_error( 'It seems that the shotostream URL is offline' );682 return $this->display_error( 'It seems that the shotostream URL is offline' ); 683 683 684 684 $data = $client->get(); 685 685 $url = $client->get_url(); 686 686 if( !is_object( $data ) ) 687 return $this->display_error( 'It seems that the shotostream URL is offline' );687 return $this->display_error( 'It seems that the shotostream URL is offline' ); 688 688 689 689 … … 695 695 unset( $client ); ?> 696 696 <div class="stream-info"> 697 <h3><?php _e('Importing photostream'); ?>: <em><?php echo esc_html( $stream->title ); ?></em></h3>698 <p class="info"><strong><?php echo esc_html( $stream->title ); ?></strong> <?php _e( 'photostream contains');?> <?php echo $this->get_stream_media_info( $data, count( $groups ) ); ?>. <a target="_blank" href="<?php echo esc_url( $url ); ?>" title="<?php _e( 'Go to photo stream '); ?>. <?php echo esc_attr( $stream->title ); ?>">Visit photostream</a> #<?php echo esc_html( $this->key ); ?></p>697 <h3><?php ); ?>: <em><?php echo esc_html( $stream->title ); ?></em></h3> 698 <p class="info"><strong><?php echo esc_html( $stream->title ); ?></strong> <?php </a> #<?php echo esc_html( $this->key ); ?></p> 699 699 </div> 700 700 … … 721 721 722 722 if ( $tag_list ) { 723 $utility_text = __( 'Gallery was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.' );723 $utility_text = __( 'Gallery was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.' ); 724 724 } elseif ( $categories_list ) { 725 $utility_text = __( 'Gallery was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.' );725 $utility_text = __( 'Gallery was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.' ); 726 726 } else { 727 $utility_text = __( 'Gallery was posted on %3$s<span class="by-author"> by %4$s</span>.' );727 $utility_text = __( 'Gallery was posted on %3$s<span class="by-author"> by %4$s</span>.' ); 728 728 } 729 729 730 730 switch( get_post_status() ) { 731 731 case 'publish': 732 $view_link = '<a class="button" href="' . get_permalink( ) . '" >'. __( 'View' ) . '</a>';732 $view_link = '<a class="button" href="' . get_permalink( ) . '" >'.' ) . '</a>'; 733 733 break; 734 734 735 735 default: 736 $view_link = '<a class="button" href="' . site_url( '?p='.get_the_ID() ) . '" >'. __( 'Preview' ) . '</a>';736 $view_link = '<a class="button" href="' . site_url( '?p='.get_the_ID() ) . '" >'.' ) . '</a>'; 737 737 break; 738 738 } … … 740 740 <div class="gallery"> 741 741 <h4><?php the_title(); ?> </h4> 742 <a href="<?php echo get_edit_post_link(); ?>" class="button"> Edit</a> <span class="separator">|</span> <?php echo $view_link; ?>742 <a href="<?php echo get_edit_post_link(); ?>" class="button"></a> <span class="separator">|</span> <?php echo $view_link; ?> 743 743 <p class="byline"><?php printf( $utility_text, $categories_list, $tag_list, $date, get_the_author() ); ?></p> 744 744 <ul id="gallery-<?php echo esc_attr( get_the_id() ); ?>" class="attachemnt-grid"></ul> … … 749 749 } else { 750 750 // No posts found 751 _e( "No Galleries Found!");751 ); 752 752 } 753 753 /* Restore original Post Data */ … … 766 766 'photos' => $photos_data, 767 767 'stream_key' => $this->key, 768 'start_text' => __( 'Start Importing of Media' ),769 'done' => __( 'Done' ),770 'finished' => __( 'Success, we just finish adding all media' ) .' <a href="'. $this->admin_page. '">'.__('return to photostreams'). '</a>.',771 'close' => __( 'If you leave this page your import will be interupted' )768 'start_text' => __( 'Start Importing of Media'), 769 'done' => __( 'Done' ), 770 'finished' => __( 'Success, we just finish adding all media''). '</a>.', 771 'close' => __( 'If you leave this page your import will be interupted' ) 772 772 ); 773 773 … … 785 785 <p><?php echo esc_html( $error ); ?></p> 786 786 <?php if( ! in_array( $this->view, array( 'add', 'init' ) ) ) { ?> 787 <p><a href="<?php echo esc_url( $this->admin_page ); ?>"><?php _e( 'Return to managephotostream' ); ?></a></p>787 <p><a href="<?php echo esc_url( $this->admin_page ); ?>"><?php _e(photostream' ); ?></a></p> 788 788 <?php } ?> 789 789 </div> … … 809 809 ?> 810 810 <div class="stream-info"> 811 <h3><?php _e('Deletingphotostream'); ?>: <em><?php echo esc_html( $stream->title ); ?></em></h3>812 <p class="info"><strong><?php echo esc_html( $stream->title ); ?></strong> <?php _e( 'photostream has' ); ?> <?php echo $this->get_processed_media_info( $this->key ); ?>. <a target="_blank" href="<?php echo esc_url( $url ); ?>" title="<?php _e( 'Go to photo stream ' ); ?>. <?php echo esc_attr( $stream->title ); ?>">Visit photostream</a> #<?php echo esc_html( $this->key ); ?></p>811 <h3><?php photostream'); ?>: <em><?php echo esc_html( $stream->title ); ?></em></h3> 812 <p class="info"><strong><?php echo esc_html( $stream->title ); ?></strong> <?php </a> #<?php echo esc_html( $this->key ); ?></p> 813 813 </div> 814 814 … … 820 820 <p> 821 821 <?php 822 _e( 'Are you sure you want to delete this' );822 ' ); 823 823 echo ' <strong>' . esc_html( $stream->title ). '</strong> ' ; 824 _e( 'photostream?' );824 ' ); 825 825 ?></p> 826 826 827 <p><label><input type="checkbox" name="delete_galleries" /> <?php _e('Also delete the associated'); ?> <?php echo $galleries_display; ?></label></p>828 <p><label><input type="checkbox" name="delete_media" /> <?php _e('Also delete the associated'); ?> <?php echo $media_display; ?></label></p>829 830 <?php $this->display_submit_form( __('Delete Photostream' ) ); ?>827 <p><label><input type="checkbox" name="delete_galleries" /> <?php ); ?> <?php echo $galleries_display; ?></label></p> 828 <p><label><input type="checkbox" name="delete_media" /> <?php ); ?> <?php echo $media_display; ?></label></p> 829 830 <?php $this->display_submit_form( __('Delete Photostream') ); ?> 831 831 832 832 </form> … … 847 847 848 848 if ( !wp_verify_nonce( $_POST['ps-nonce'], 'ps-sync-add-1' ) ){ 849 $this->error_message = __( 'Can\'t do that!' );849 $this->error_message = __( 'Can\'t do that!' ); 850 850 return; 851 851 } … … 854 854 $key = $this->parse_user_input_photostream_key( $_POST['photostream-url'] ); 855 855 if( !$key ) { 856 $this->error_message = __( 'Photostream URL was not right, please try again!' );856 $this->error_message = __( 'Photostream URL was not right, please try again!' ); 857 857 return; 858 858 } 859 859 860 860 if( in_array( $key, $this->get_streams() ) ){ 861 $this->error_message = __( 'Sorry, you can\'t add the same stream twice.' );861 $this->error_message = __( 'Sorry, you can\'t add the same stream twice.' ); 862 862 return; 863 863 } … … 865 865 $client = new Photostream_Client( $key ); 866 866 if( !is_object($client ) ) { 867 $this->error_message = __( 'Sorry something went wrong here and we couldn\'t find your photos.' );867 $this->error_message = __( 'Sorry something went wrong here and we couldn\'t find your photos.' ); 868 868 return; 869 869 } … … 872 872 873 873 if( !is_object( $data ) ) { 874 $this->error_message = __( 'Double check your photostream URL. It doesn\'t work!' );874 $this->error_message = __( 'Double check your photostream URL. It doesn\'t work!' ); 875 875 return; 876 876 } 877 877 if( sizeof( $data->photos ) < 1 ) { 878 $this->error_message = __( 'It looks like you don\'t have any media in this photostream!' );878 $this->error_message = __( 'It looks like you don\'t have any media in this photostream!' ); 879 879 return; 880 880 } … … 900 900 901 901 if ( !wp_verify_nonce( $_POST['ps-nonce'], 'ps-sync-add-2' ) ){ 902 $this->error_message = __( 'Can\'t do that!' );902 $this->error_message = __( 'Can\'t do that!' ); 903 903 return false; 904 904 } … … 939 939 940 940 if ( !wp_verify_nonce( $_POST['ps-nonce'], 'photostream-delete-'.$key ) ){ 941 $this->error_message = __( 'Can\'t do that!' );941 $this->error_message = __( 'Can\'t do that!' ); 942 942 return; 943 943 } … … 1175 1175 ) ); 1176 1176 if( empty( $group_posts ) ){ 1177 $this->error_message = __( 'You first need to create the Gallery' );1177 $this->error_message = __( 'You first need to create the Gallery' ); 1178 1178 return; 1179 1179 } … … 1183 1183 1184 1184 if( !is_object($client ) ) { 1185 $this->error_message = __( 'It seems that the shotostream URL is offline' );1185 $this->error_message = __( 'It seems that the shotostream URL is offline' ); 1186 1186 return; 1187 1187 } … … 1190 1190 1191 1191 if( !is_object( $data ) ) { 1192 $this->error_message = __( 'It seems that the shotostream URL is offline' );1192 $this->error_message = __( 'It seems that the shotostream URL is offline' ); 1193 1193 } 1194 1194 1195 1195 if( sizeof( $data->photos ) < 1 ) { 1196 $this->error_message = __( 'It looks like you don\'t have any media in this photostream!' );1196 $this->error_message = __( 'It looks like you don\'t have any media in this photostream!' ); 1197 1197 } 1198 1198 … … 1209 1209 1210 1210 if ( ! current_user_can( 'upload_files' ) ) 1211 die( json_encode( array( 'success' => __( "Your user account doesn't have permission to upload media" ) ) ) );1211 die( json_encode( array( 'success' => __( "Your user account doesn't have permission to upload media" ) ) ) ); 1212 1212 1213 1213 @set_time_limit( 900 ); // 5 minutes per image should be … … 1803 1803 'validation', 1804 1804 0, 1805 sprintf( __('%s does not look like a valid Photostream key.' ), $key )1805 sprintf( __('%s does not look like a valid Photostream key.'), $key ) 1806 1806 ); 1807 1807 return false; … … 1829 1829 $schedules['quarter_hourly'] = array( 1830 1830 'interval' => 900, 1831 'display' => __( 'Every 15 minutes' ),1831 'display' => __( 'Every 15 minutes' ), 1832 1832 ); 1833 1833 return $schedules;
Note: See TracChangeset
for help on using the changeset viewer.