wp/wp-content/plugins/portfolio/inc/demo-data/class-bws-demo-data.php
changeset 16 a86126ab1dd4
parent 12 d8a8807227e4
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
     1 <?php
     1 <?php
     2 
     2 
     3 /**
     3 /**
     4  * Load demo data
     4  * Load demo data
     5  * @version 1.0.3
     5  * @version 1.0.4
     6  */
     6  */
     7 
     7 
     8 if ( ! class_exists( 'Bws_Demo_Data' ) ) {
     8 if ( ! class_exists( 'Bws_Demo_Data' ) ) {
     9 	class Bws_Demo_Data {
     9 	class Bws_Demo_Data {
    10 		private $bws_plugin_text_domain, $bws_plugin_prefix, $bws_plugin_page, $bws_plugin_name, $bws_plugin_basename, $bws_demo_options, $bws_demo_folder;
    10 		private $bws_plugin_text_domain, $bws_plugin_prefix, $bws_plugin_page, $bws_plugin_name, $bws_plugin_basename, $bws_demo_options, $bws_demo_folder;
   530 			return $done;
   530 			return $done;
   531 		}
   531 		}
   532 
   532 
   533 		function bws_handle_demo_notice( $show_demo_notice ) {
   533 		function bws_handle_demo_notice( $show_demo_notice ) {
   534 
   534 
   535 			if ( 1 == $show_demo_notice ) {
   535 			if ( 1 == $show_demo_notice && empty( $this->bws_demo_options ) ) {
   536 				global $wp_version;
   536 				global $wp_version;
   537 
   537 
   538 				if ( isset( $_POST['bws_hide_demo_notice'] ) && check_admin_referer( $this->bws_plugin_basename, 'bws_demo_nonce_name' ) ) {
   538 				if ( isset( $_POST['bws_hide_demo_notice'] ) && check_admin_referer( $this->bws_plugin_basename, 'bws_demo_nonce_name' ) ) {
   539 					$plugin_options = get_option( $this->bws_plugin_prefix . 'options' );
   539 					$plugin_options = get_option( $this->bws_plugin_prefix . 'options' );
   540 					$plugin_options['display_demo_notice'] = 0;
   540 					$plugin_options['display_demo_notice'] = 0;
   580 							.rtl #bws_handle_notice_form {
   580 							.rtl #bws_handle_notice_form {
   581 								left: 0;
   581 								left: 0;
   582 							}
   582 							}
   583 						</style>
   583 						</style>
   584 					<?php } ?>
   584 					<?php } ?>
   585 					<div class="update-nag" style="position: relative;">
   585                     <div class="notice" style="position: relative;">
   586 						<form id="bws_handle_notice_form" action="" method="post">
   586                         <form id="bws_handle_notice_form" action="" method="post">
   587 							<button class="notice-dismiss bws_hide_demo_notice" title="<?php _e( 'Close notice', $this->bws_plugin_text_domain ); ?>"></button>
   587                             <button class="notice-dismiss bws_hide_demo_notice" title="<?php _e( 'Close notice', $this->bws_plugin_text_domain ); ?>"></button>
   588 							<input type="hidden" name="bws_hide_demo_notice" value="hide" />
   588                             <input type="hidden" name="bws_hide_demo_notice" value="hide" />
   589 							<?php wp_nonce_field( $this->bws_plugin_basename, 'bws_demo_nonce_name' ); ?>
   589 							<?php wp_nonce_field( $this->bws_plugin_basename, 'bws_demo_nonce_name' ); ?>
   590 						</form>
   590                         </form>
   591 						<div style="margin: 0 20px;"><?php printf( __( 'Do you want to install demo content and settings for %s (You can do this later using Import / Export settings)?', $this->bws_plugin_text_domain ), '<a href="edit.php?post_type=bws-portfolio&page=portfolio.php">Portfolio by BestWebSoft</a>' ); ?>&nbsp;<a href="<?php echo admin_url( 'admin.php?page=' . $this->bws_plugin_page ); ?>"><?php _e( 'Yes, install demo now', $this->bws_plugin_text_domain ); ?></a></div>
   591                         <p>
   592 					</div>
   592 							<?php printf(
       
   593 								__( 'Do you want to install demo content and settings for %s now?', $this->bws_plugin_text_domain ),
       
   594 								'<b>' . $this->bws_plugin_name . ' by BestWebSoft</b>'
       
   595 							); ?>&nbsp;<a href="<?php echo admin_url( 'admin.php?page=' . $this->bws_plugin_page ); ?>"><?php _e( 'Yes, install demo data', $this->bws_plugin_text_domain ); ?></a>
       
   596                         </p>
       
   597                     </div>
   593 				<?php }
   598 				<?php }
   594 			}
   599 			}
   595 		}
   600 		}
   596 
   601 
   597 		/**
   602 		/**