wp/wp-content/plugins/portfolio/inc/class-prtfl-settings.php
changeset 16 a86126ab1dd4
parent 12 d8a8807227e4
child 19 3d72ae0968f4
equal deleted inserted replaced
15:3d4e9c994f10 16:a86126ab1dd4
     1 <?php
     1 <?php
     2 /**
     2 /**
     3  * Displays the content on the plugin settings page
     3  * Displays the content on the plugin settings page
     4  */
     4  */
     5 
       
     6 require_once( dirname( dirname( __FILE__ ) ) . '/bws_menu/class-bws-settings.php' );
       
     7 
     5 
     8 if ( ! class_exists( 'Prtfl_Settings_Tabs' ) ) {
     6 if ( ! class_exists( 'Prtfl_Settings_Tabs' ) ) {
     9 	class Prtfl_Settings_Tabs extends Bws_Settings_Tabs {
     7 	class Prtfl_Settings_Tabs extends Bws_Settings_Tabs {
    10 		public $wp_image_sizes = array();
     8 		public $wp_image_sizes = array();
    11 		public $cstmsrch_options, $fields;
     9 		public $cstmsrch_options, $fields;
    22 		public function __construct( $plugin_basename ) {
    20 		public function __construct( $plugin_basename ) {
    23 			global $prtfl_options, $prtfl_plugin_info, $prtfl_BWS_demo_data;
    21 			global $prtfl_options, $prtfl_plugin_info, $prtfl_BWS_demo_data;
    24 
    22 
    25 			$tabs = array(
    23 			$tabs = array(
    26 				'settings' 		=> array( 'label' => __( 'Settings', 'portfolio' ) ),
    24 				'settings' 		=> array( 'label' => __( 'Settings', 'portfolio' ) ),
       
    25 				'project' 		=> array( 'label' => __( 'Project', 'portfolio' ) ),
    27 				'misc' 			=> array( 'label' => __( 'Misc', 'portfolio' ) ),
    26 				'misc' 			=> array( 'label' => __( 'Misc', 'portfolio' ) ),
    28 				'custom_code' 	=> array( 'label' => __( 'Custom Code', 'portfolio' ) ),
    27 				'custom_code' 	=> array( 'label' => __( 'Custom Code', 'portfolio' ) ),
    29 				'import-export' => array( 'label' => __( 'Import / Export', 'portfolio' ) ),
    28 				'import-export' => array( 'label' => __( 'Import / Export', 'portfolio' ) ),
    30 				'license'		=> array( 'label' => __( 'License Key', 'portfolio' ) ),
    29 				'license'		=> array( 'label' => __( 'License Key', 'portfolio' ) ),
    31 			);
    30 			);
    37 				'default_options' 	 => prtfl_get_options_default(),
    36 				'default_options' 	 => prtfl_get_options_default(),
    38 				'options' 			 => $prtfl_options,
    37 				'options' 			 => $prtfl_options,
    39 				'tabs' 				 => $tabs,
    38 				'tabs' 				 => $tabs,
    40 				'wp_slug'			 => 'portfolio',
    39 				'wp_slug'			 => 'portfolio',
    41 				'demo_data'			 => $prtfl_BWS_demo_data,
    40 				'demo_data'			 => $prtfl_BWS_demo_data,
    42 				'pro_page' 			 => 'edit.php?post_type=bws-portfolio&page=portfolio-pro.php',
       
    43 				'bws_license_plugin' => 'portfolio-pro/portfolio-pro.php',
       
    44 				'link_key' 			 => 'f047e20c92c972c398187a4f70240285',
    41 				'link_key' 			 => 'f047e20c92c972c398187a4f70240285',
    45 				'link_pn' 			 => '74',
    42 				'link_pn' 			 => '74',
    46 			) );
    43 			) );
    47 
    44 
    48 			$wp_sizes = get_intermediate_image_sizes();
    45 			$wp_sizes = get_intermediate_image_sizes();
    80 				'technologies'		=> __( 'Technologies', 'portfolio' ),
    77 				'technologies'		=> __( 'Technologies', 'portfolio' ),
    81 				'date'				=> __( 'Date of completion', 'portfolio' ),
    78 				'date'				=> __( 'Date of completion', 'portfolio' ),
    82 				'link'				=> __( 'Link', 'portfolio' ),
    79 				'link'				=> __( 'Link', 'portfolio' ),
    83 				'shrdescription'	=> __( 'Short Description', 'portfolio' ),
    80 				'shrdescription'	=> __( 'Short Description', 'portfolio' ),
    84 				'description'		=> __( 'Description', 'portfolio' ),
    81 				'description'		=> __( 'Description', 'portfolio' ),
    85 				'svn'				=> __( 'SVN URL', 'portfolio' )
    82 
    86 			);
    83 			);
    87 
    84 
    88 			add_action( get_parent_class( $this ) . '_display_custom_messages', array( $this, 'display_custom_messages' ) );
    85 			add_action( get_parent_class( $this ) . '_display_custom_messages', array( $this, 'display_custom_messages' ) );
    89 			add_action( get_parent_class( $this ) . '_additional_misc_options_affected', array( $this, 'additional_misc_options_affected' ) );
    86 			add_action( get_parent_class( $this ) . '_additional_misc_options_affected', array( $this, 'additional_misc_options_affected' ) );
    90 			add_action( get_parent_class( $this ) . '_additional_import_export_options', array( $this, 'additional_import_export_options' ) );
    87 			add_action( get_parent_class( $this ) . '_additional_import_export_options', array( $this, 'additional_import_export_options' ) );
    97 		 * @param  void
    94 		 * @param  void
    98 		 * @return array    The action results
    95 		 * @return array    The action results
    99 		 */
    96 		 */
   100 		public function save_options() {
    97 		public function save_options() {
   101 
    98 
   102 			$this->options["custom_image_row_count"] = intval( $_POST['prtfl_custom_image_row_count'] );
    99 			$message = $notice = $error = '';
   103 			$this->options["custom_portfolio_row_count"] = intval( $_POST['prtfl_portfolio_custom_row_count'] );
   100 
   104 			if ( 1 > $this->options["custom_image_row_count"] )
   101 			$this->options["custom_image_row_count"] = absint( $_POST['prtfl_custom_image_row_count'] );
   105 				$this->options["custom_image_row_count"] = 1;
   102 			$this->options["custom_portfolio_row_count"] = absint( $_POST['prtfl_portfolio_custom_row_count'] );
   106 			if ( 1 > $this->options["custom_portfolio_row_count"] )
       
   107 				$this->options["custom_portfolio_row_count"] = 1;
       
   108 
   103 
   109 			$new_image_size_photo 		= esc_attr( $_POST['prtfl_image_size_photo'] );
   104 			$new_image_size_photo 		= esc_attr( $_POST['prtfl_image_size_photo'] );
   110 			$custom_image_size_w_photo 	= intval( $_POST['prtfl_custom_image_size_w_photo'] );
   105 			$custom_image_size_w_photo 	= intval( $_POST['prtfl_custom_image_size_w_photo'] );
   111 			$custom_image_size_h_photo 	= intval( $_POST['prtfl_custom_image_size_h_photo'] );
   106 			$custom_image_size_h_photo 	= intval( $_POST['prtfl_custom_image_size_h_photo'] );
   112 			$custom_size_px_photo 		= array( $custom_image_size_w_photo, $custom_image_size_h_photo );
   107 			$custom_size_px_photo 		= array( $custom_image_size_w_photo, $custom_image_size_h_photo );
   157 			if ( ! empty( $need_image_update ) ) {
   152 			if ( ! empty( $need_image_update ) ) {
   158 				$this->options['need_image_update'] = __( 'Custom image size was changed. You need to update project images.', 'portfolio' );
   153 				$this->options['need_image_update'] = __( 'Custom image size was changed. You need to update project images.', 'portfolio' );
   159 			}
   154 			}
   160 
   155 
   161 			$this->options["link_additional_field_for_non_registered"] = isset( $_REQUEST["prtfl_link_additional_field_for_non_registered"] ) ? 1 : 0;
   156 			$this->options["link_additional_field_for_non_registered"] = isset( $_REQUEST["prtfl_link_additional_field_for_non_registered"] ) ? 1 : 0;
       
   157 			$this->options["svn_text_field"] = sanitize_text_field( $_REQUEST["prtfl_svn_text_field"] );
       
   158 			$this->options["svn_additional_field_for_non_logged"] = isset( $_REQUEST["prtfl_svn_additional_field_for_non_logged"] ) ? 1 : 0;
       
   159 			$this->options["svn_additional_field"] = isset( $_REQUEST["prtfl_svn_additional_field"] ) ? 1 : 0;
   162 
   160 
   163 			foreach ( $this->fields as $field_key => $field_title ) {
   161 			foreach ( $this->fields as $field_key => $field_title ) {
   164 				$this->options[ $field_key . '_additional_field'] = isset( $_REQUEST['prtfl_' . $field_key . '_additional_field'] ) ? 1 : 0;
   162 				$this->options[ $field_key . '_additional_field'] = isset( $_REQUEST['prtfl_' . $field_key . '_additional_field'] ) ? 1 : 0;
   165 				$this->options[ $field_key . '_text_field'] = stripslashes( esc_html( $_REQUEST['prtfl_' . $field_key . '_text_field'] ) );
   163 				$this->options[ $field_key . '_text_field'] = stripslashes( sanitize_text_field( $_REQUEST['prtfl_' . $field_key . '_text_field'] ) );
   166 			}
   164 
   167 
   165 			}
   168 			$this->options['screenshot_text_field'] = stripslashes( esc_html( $_REQUEST['prtfl_screenshot_text_field'] ) );
   166 
   169 
   167 			$this->options['screenshot_text_field'] = stripslashes( sanitize_text_field( $_REQUEST['prtfl_screenshot_text_field'] ) );
   170 			$slug = strtolower( trim( stripslashes( esc_html( $_POST['prtfl_slug'] ) ) ) );
   168 
   171 			$slug = preg_replace( "/[^a-z0-9\s-]/", "", $slug );
   169 			if ( $this->options["slug"] != $_POST['prtfl_slug'] )
   172 			$slug = trim( preg_replace( "/[\s-]+/", " ", $slug ) );
       
   173 			$slug = preg_replace( "/\s/", "-", $slug );
       
   174 			if ( $this->options["slug"] != $slug ) {
       
   175 				$this->options["flush_rewrite_rules"] = 1;
   170 				$this->options["flush_rewrite_rules"] = 1;
   176 			}
   171 			$this->options["slug"] = sanitize_title( $_POST['prtfl_slug'] );
   177 			$this->options["slug"] = $slug;
       
   178 
   172 
   179 			/**
   173 			/**
   180 			 * rewriting post types name with unique one from default options
   174 			 * rewriting post types name with unique one from default options
   181 			 */
   175 			 */
   182 			if ( ! empty( $_POST['prtfl_rename_post_type'] ) ) {
   176 			if ( ! empty( $_POST['prtfl_rename_post_type'] ) ) {
   255 			<h3 class="bws_tab_label"><?php _e( 'Portfolio Settings', 'portfolio' ); ?></h3>
   249 			<h3 class="bws_tab_label"><?php _e( 'Portfolio Settings', 'portfolio' ); ?></h3>
   256 			<?php $this->help_phrase(); ?>
   250 			<?php $this->help_phrase(); ?>
   257 			<hr>
   251 			<hr>
   258 			<table class="form-table">
   252 			<table class="form-table">
   259 				<tr valign="top">
   253 				<tr valign="top">
       
   254 					<th scope="row"><?php _e( 'Portfolio Page', 'portfolio' ); ?></th>
       
   255 					<td>
       
   256 						<?php wp_dropdown_pages( array(
       
   257 							'depth'                 => 0,
       
   258 							'selected'              => $this->options['page_id_portfolio_template'],
       
   259 							'name'                  => 'prtfl_page_id_portfolio_template',
       
   260 							'show_option_none'		=> '...'
       
   261 						) ); ?>
       
   262 						<div class="bws_info"><?php _e( 'Base page where all existing projects will be displayed.' , 'portfolio'); ?></div>
       
   263 					</td>
       
   264 				</tr>
       
   265 				<tr valign="top">
   260 					<th scope="row"><?php _e( 'Number of Columns', 'portfolio' ); ?> </th>
   266 					<th scope="row"><?php _e( 'Number of Columns', 'portfolio' ); ?> </th>
   261 					<td>
   267 					<td>
   262 						<input<?php echo $this->change_permission_attr; ?> type="number" name="prtfl_portfolio_custom_row_count" min="1" max="10000" value="<?php echo $this->options["custom_portfolio_row_count"]; ?>" /> <?php _e( 'columns', 'portfolio' ); ?>
   268 						<input<?php echo $this->change_permission_attr; ?> type="number" name="prtfl_portfolio_custom_row_count" min="1" max="10000" value="<?php echo $this->options["custom_portfolio_row_count"]; ?>" /> <?php _e( 'columns', 'portfolio' ); ?>
   263 						<div class="bws_info"><?php printf( __( 'Number of portfolio columns (default is %s).', 'portfolio' ), '1' ); ?></div>
   269 						<div class="bws_info"><?php printf( __( 'Number of portfolio columns (default is %s).', 'portfolio' ), '1' ); ?></div>
   264 					</td>
   270 					</td>
   265 				</tr>
   271 				</tr>
   266 				<tr valign="top">
   272 				<tr valign="top">
   267 					<th scope="row"><?php _e( 'Number of image Columns', 'portfolio' ); ?> </th>
   273 					<th scope="row"><?php _e( 'Number of Image Columns', 'portfolio' ); ?> </th>
   268 					<td>
   274 					<td>
   269 						<input type="number" name="prtfl_custom_image_row_count" min="1" max="10000" value="<?php echo $this->options["custom_image_row_count"]; ?>" /> <?php _e( 'columns', 'portfolio' ); ?>
   275 						<input type="number" name="prtfl_custom_image_row_count" min="1" max="10000" value="<?php echo $this->options["custom_image_row_count"]; ?>" /> <?php _e( 'columns', 'portfolio' ); ?>
   270 						 <div class="bws_info"><?php printf( __( 'Number of image columns (default is %s).', 'portfolio' ), '3' ); ?></div>
   276 						 <div class="bws_info"><?php printf( __( 'Number of image columns (default is %s).', 'portfolio' ), '3' ); ?></div>
   271 					</td>
   277 					</td>
   272 				</tr>
   278 				</tr>
   287 					<td>
   293 					<td>
   288 						<input type="number" name="prtfl_custom_image_size_w_photo" min="1" max="10000" value="<?php echo $this->options['custom_size_px']['portfolio-photo-thumb'][0]; ?>" /> x <input type="number" name="prtfl_custom_image_size_h_photo" min="1" max="10000" value="<?php echo $this->options['custom_size_px']['portfolio-photo-thumb'][1]; ?>" /> px <div class="bws_info"><?php _e( "Adjust these values based on the number of columns in your project. This won't affect the full size of your images in the lightbox.", 'portfolio' ); ?></div>
   294 						<input type="number" name="prtfl_custom_image_size_w_photo" min="1" max="10000" value="<?php echo $this->options['custom_size_px']['portfolio-photo-thumb'][0]; ?>" /> x <input type="number" name="prtfl_custom_image_size_h_photo" min="1" max="10000" value="<?php echo $this->options['custom_size_px']['portfolio-photo-thumb'][1]; ?>" /> px <div class="bws_info"><?php _e( "Adjust these values based on the number of columns in your project. This won't affect the full size of your images in the lightbox.", 'portfolio' ); ?></div>
   289 					</td>
   295 					</td>
   290 				</tr>
   296 				</tr>
   291 				<tr valign="top">
   297 				<tr valign="top">
   292 					<th scope="row"><?php _e( 'Portfolio Page', 'portfolio' ); ?></th>
       
   293 					<td>
       
   294 						<?php wp_dropdown_pages( array(
       
   295 							'depth'                 => 0,
       
   296 							'selected'              => $this->options['page_id_portfolio_template'],
       
   297 							'name'                  => 'prtfl_page_id_portfolio_template',
       
   298 							'show_option_none'		=> '...'
       
   299 						) ); ?>
       
   300 						<div class="bws_info"><?php _e( 'Base page where all existing projects will be displayed.' , 'portfolio'); ?></div>
       
   301 					</td>
       
   302 				</tr>
       
   303 				<tr valign="top">
       
   304 					<th scope="row"><?php _e( 'Cover Image Size', 'portfolio' ); ?> </th>
   298 					<th scope="row"><?php _e( 'Cover Image Size', 'portfolio' ); ?> </th>
   305 					<td>
   299 					<td>
   306 						<select name="prtfl_image_size_album">
   300 						<select name="prtfl_image_size_album">
   307 							<?php foreach ( $this->wp_image_sizes as $data ) { ?>
   301 							<?php foreach ( $this->wp_image_sizes as $data ) { ?>
   308 								<option value="<?php echo $data['value']; ?>" <?php selected( $data['value'], $this->options['image_size_album'] ); ?>><?php echo $data['name']; ?></option>
   302 								<option value="<?php echo $data['value']; ?>" <?php selected( $data['value'], $this->options['image_size_album'] ); ?>><?php echo $data['name']; ?></option>
   309 							<?php } ?>
   303 							<?php } ?>
   310 							<option value="portfolio-thumb" <?php selected( 'portfolio-thumb', $this->options['image_size_album'] ); ?> class="bws_option_affect" data-affect-show=".prtfl_for_custom_image_size_album"><?php _e( 'Custom', 'portfolio' ); ?></option>
   304 							<option value="portfolio-thumb" <?php selected( 'portfolio-thumb', $this->options['image_size_album'] ); ?> class="bws_option_affect" data-affect-show=".prtfl_for_custom_image_size_album"><?php _e( 'Custom', 'portfolio' ); ?></option>
   311 						</select>
   305 						</select>
   312 						<div class="bws_info"><?php _e( 'Maximum cover image size. Custom uses the Image Dimensions values.', 'portfolio' ); ?></div>
   306 						<div class="bws_info"><?php _e( 'Maximum cover image size. "Custom" uses the Image Dimensions values.', 'portfolio' ); ?></div>
   313 					</td>
   307 					</td>
   314 				</tr>
   308 				</tr>
       
   309                 <tr valign="top" class="prtfl_for_custom_image_size_album">
       
   310                     <th scope="row"><?php _e( 'Custom Cover Image Size', 'portfolio' ); ?> </th>
       
   311                     <td>
       
   312                         <input type="number" name="prtfl_custom_image_size_w_album" min="1" max="10000" value="<?php echo $this->options['custom_size_px']['portfolio-thumb'][0]; ?>" /> x <input type="number" name="prtfl_custom_image_size_h_album" min="1" max="10000" value="<?php echo $this->options['custom_size_px']['portfolio-thumb'][1]; ?>" /> px
       
   313                     </td>
       
   314                 </tr>
   315             </table>
   315             </table>
   316             <?php if ( ! $this->hide_pro_tabs ) { ?>
   316             <?php if ( ! $this->hide_pro_tabs ) { ?>
   317                 <div class="bws_pro_version_bloc">
   317                 <div class="bws_pro_version_bloc">
   318                     <div class="bws_pro_version_table_bloc">
   318                     <div class="bws_pro_version_table_bloc">
   319                         <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e( 'Close', 'portfolio' ); ?>"></button>
   319                         <button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e( 'Close', 'portfolio' ); ?>"></button>
   320                         <div class="bws_table_bg"></div>
   320                         <div class="bws_table_bg"></div>
   321                         <table class="form-table bws_pro_version">
   321                         <table class="form-table bws_pro_version">
   322                             <tr valign="top">
   322                             <tr valign="top">
   323                                 <th scope="row"><?php _e( 'Slider Image Size', 'portfolio' ); ?> </th>
   323                                 <th scope="row"><?php _e( 'Slider Image Size', 'portfolio' ); ?> </th>
   324                                 <td>
   324                                 <td>
   325                                     <select name="prtfl_image_size_slider">
   325                                     <select disabled="disabled" name="prtfl_image_size_slider">
   326                                         <option value="large">Large (1024 × 1024)</option>
   326                                         <option value="large">Large (1024 × 1024)</option>
   327                                     </select>
   327                                     </select>
   328                                     <div class="bws_info"><?php _e( 'Maximum slider image size. Custom uses the Image Dimensions values.', 'portfolio-pro' ); ?></div>
   328                                     <div class="bws_info"><?php _e( 'Maximum slider image size. "Custom" uses the Image Dimensions values.', 'portfolio' ); ?></div>
       
   329                                 </td>
       
   330                             </tr>
       
   331                             <tr valign="top">
       
   332                                 <th scope="row"><?php _e( 'Sort Projects Option', 'portfolio' ); ?></th>
       
   333                                 <td>
       
   334                                     <label>
       
   335                                         <input type="checkbox" name="prtfl_sorting_selectbox" value="1" disabled="disabled" /> <span class="bws_info"><?php _e( 'Enable to display sort projects manually by date or title.', 'portfolio' ); ?></span>
       
   336                                     </label>
   329                                 </td>
   337                                 </td>
   330                             </tr>
   338                             </tr>
   331                         </table>
   339                         </table>
   332                     </div>
   340                     </div>
   333                     <?php $this->bws_pro_block_links(); ?>
   341                     <?php $this->bws_pro_block_links(); ?>
   334                 </div>
   342                 </div>
   335             <?php } ?>
   343             <?php } ?>
   336             <table class="form-table">
   344             <table class="form-table">
   337 				<tr valign="top" class="prtfl_for_custom_image_size_album">
       
   338 					<th scope="row"><?php _e( 'Custom Cover Image Size', 'portfolio' ); ?> </th>
       
   339 					<td>
       
   340 						<input type="number" name="prtfl_custom_image_size_w_album" min="1" max="10000" value="<?php echo $this->options['custom_size_px']['portfolio-thumb'][0]; ?>" /> x <input type="number" name="prtfl_custom_image_size_h_album" min="1" max="10000" value="<?php echo $this->options['custom_size_px']['portfolio-thumb'][1]; ?>" /> px
       
   341 					</td>
       
   342 				</tr>
       
   343 				<tr valign="top">
   345 				<tr valign="top">
   344 					<th scope="row"><?php _e( 'Sort Projects by', 'portfolio' ); ?></th>
   346 					<th scope="row"><?php _e( 'Sort Projects by', 'portfolio' ); ?></th>
   345 					<td>
   347 					<td>
   346 						<select name="prtfl_order_by">
   348 						<select name="prtfl_order_by">
   347 							<option value="ID" <?php selected( 'ID', $this->options["order_by"] ); ?>><?php _e( 'Project ID', 'portfolio' ); ?></option>
   349 							<option value="ID" <?php selected( 'ID', $this->options["order_by"] ); ?>><?php _e( 'Project ID', 'portfolio' ); ?></option>
   371 				<div class="bws_pro_version_bloc">
   373 				<div class="bws_pro_version_bloc">
   372 					<div class="bws_pro_version_table_bloc">
   374 					<div class="bws_pro_version_table_bloc">
   373 						<button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e( 'Close', 'portfolio' ); ?>"></button>
   375 						<button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e( 'Close', 'portfolio' ); ?>"></button>
   374 						<div class="bws_table_bg"></div>
   376 						<div class="bws_table_bg"></div>
   375 						<table class="form-table bws_pro_version">
   377 						<table class="form-table bws_pro_version">
   376 							<tr valign="top">
       
   377 								<th scope="row"><?php _e( 'Manual Sorting', 'portfolio' ); ?></th>
       
   378 								<td>
       
   379 									<label>
       
   380 										<input type="checkbox" name="prtfl_sorting_selectbox" value="1" disabled="disabled" /> <span class="bws_info"><?php _e( 'Enable to sort projects manually by date or title.', 'portfolio' ); ?></span>
       
   381 									</label>
       
   382 								</td>
       
   383 							</tr>
       
   384 							<tr valign="top">
   378 							<tr valign="top">
   385 								<th scope="row"><?php _e( 'Lightbox Helper', 'portfolio' ); ?></th>
   379 								<th scope="row"><?php _e( 'Lightbox Helper', 'portfolio' ); ?></th>
   386 								<td>
   380 								<td>
   387 									<input disabled type="checkbox" name="" /> <span class="bws_info"><?php _e( 'Enable to use a lightbox helper navigation between images.', 'portfolio' ); ?></span>
   381 									<input disabled type="checkbox" name="" /> <span class="bws_info"><?php _e( 'Enable to use a lightbox helper navigation between images.', 'portfolio' ); ?></span>
   388 								</td>
   382 								</td>
   408 						<label>
   402 						<label>
   409 							<input type="checkbox" name="prtfl_link_additional_field_for_non_registered" value="1" id="prtfl_link_additional_field_for_non_registered" <?php checked( 1, $this->options['link_additional_field_for_non_registered'] ); ?> /> <span class="bws_info"><?php _e( 'Enable to display link field as a text for non-registered users.', 'portfolio' ); ?></span>
   403 							<input type="checkbox" name="prtfl_link_additional_field_for_non_registered" value="1" id="prtfl_link_additional_field_for_non_registered" <?php checked( 1, $this->options['link_additional_field_for_non_registered'] ); ?> /> <span class="bws_info"><?php _e( 'Enable to display link field as a text for non-registered users.', 'portfolio' ); ?></span>
   410 						</label>
   404 						</label>
   411 					</td>
   405 					</td>
   412 				</tr>
   406 				</tr>
   413 				<tr valign="top">
   407 			</table>
   414 					<th scope="row"><?php _e( 'Projects Fields', 'portfolio' ); ?> </th>
   408         <?php }
       
   409 
       
   410 		/**
       
   411 		 *
       
   412 		 */
       
   413 
       
   414 		public function tab_project() { ?>
       
   415 			<h3 class="bws_tab_label"><?php _e( 'Single Project Settings', 'portfolio' ); ?></h3>
       
   416 			<?php $this->help_phrase(); ?>
       
   417 			<hr>
       
   418 			<table class="form-table">
       
   419 				<tr valign="top">
       
   420 					<th scope="row" class="prtfl_table_project"><?php _e( 'Projects Fields', 'portfolio' ); ?> </th>
   415 					<td>
   421 					<td>
   416 						<fieldset>
   422 						<fieldset>
   417 							<?php foreach ( $this->fields as $field_key => $field_title ) { ?>
   423 							<?php foreach ( $this->fields as $field_key => $field_title ) { ?>
   418 								<label>
   424 								<label class="prtfl_label_project">
   419 									<input<?php echo $this->change_permission_attr; ?> type="checkbox" name="prtfl_<?php echo $field_key; ?>_additional_field" value="1" <?php checked( 1, $this->options[ $field_key . '_additional_field'] ); ?> />
   425 									<input<?php echo $this->change_permission_attr; ?> type="checkbox" name="prtfl_<?php echo $field_key; ?>_additional_field" value="1" <?php checked( 1, $this->options[ $field_key . '_additional_field'] ); ?> />
   420 									 <?php echo $field_title; ?>
   426 									 <?php echo $field_title; ?>
   421 									<br>
   427 									<br>
   422 									<input<?php echo $this->change_permission_attr; ?> type="text" name="prtfl_<?php echo $field_key; ?>_text_field" maxlength="250" value="<?php echo $this->options[ $field_key . '_text_field']; ?>" />
   428 									<input<?php echo $this->change_permission_attr; ?> class="prtfl_input_project" type="text" name="prtfl_<?php echo $field_key; ?>_text_field" maxlength="250" value="<?php echo $this->options[ $field_key . '_text_field']; ?>" />
   423 								</label>
   429 								</label>
   424 								<br />
   430 								<br />
   425 							<?php } ?>
   431 							<?php } ?>
   426 							<label>
   432 							<label class="prtfl_label_project">
       
   433 								<input<?php echo $this->change_permission_attr; ?> type="checkbox" name="prtfl_svn_additional_field" value="1" <?php checked( 1, $this->options["svn_additional_field"] ); ?> />
       
   434 								 <?php _e( 'Source Files, URL', 'portfolio' ); ?>
       
   435 							</label>
       
   436 							<label class="prtfl_label_project" id="prtfl_non_logged">
       
   437 								<input<?php echo $this->change_permission_attr; ?> type="checkbox" name="prtfl_svn_additional_field_for_non_logged" value="1" <?php checked( 1, $this->options["svn_additional_field_for_non_logged"] ); ?> />
       
   438 								 <?php _e( 'Display only for logged-in users', 'portfolio' ); ?>
       
   439 							</label> 
       
   440 							<label class="prtfl_label_project">
       
   441 								<input<?php echo $this->change_permission_attr; ?> class="prtfl_input_project" type="text" name="prtfl_svn_text_field" maxlength="250" value= "<?php echo $this->options["svn_text_field"]; ?>" />
       
   442 							</label>
       
   443 							<label class="prtfl_label_project">
   427 								 <?php _e( '"More screenshots" block', 'portfolio' ); ?>
   444 								 <?php _e( '"More screenshots" block', 'portfolio' ); ?>
   428 								<br>
   445 								<br>
   429 								<input type="text" name="prtfl_screenshot_text_field" maxlength="250" value="<?php echo $this->options["screenshot_text_field"]; ?>" />								
   446 								<input class="prtfl_input_project" type="text" name="prtfl_screenshot_text_field" maxlength="250" value="<?php echo $this->options["screenshot_text_field"]; ?>" />
   430 							</label>
   447 							</label>
   431 						</fieldset>
   448 						</fieldset>
   432 					</td>
   449 					</td>
   433 				</tr>
   450 				</tr>
   434 			</table>
   451 			</table>
   436 				<div class="bws_pro_version_bloc">
   453 				<div class="bws_pro_version_bloc">
   437 					<div class="bws_pro_version_table_bloc">
   454 					<div class="bws_pro_version_table_bloc">
   438 						<button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e( 'Close', 'portfolio' ); ?>"></button>
   455 						<button type="submit" name="bws_hide_premium_options" class="notice-dismiss bws_hide_premium_options" title="<?php _e( 'Close', 'portfolio' ); ?>"></button>
   439 						<div class="bws_table_bg"></div>
   456 						<div class="bws_table_bg"></div>
   440 						<table class="form-table bws_pro_version">
   457 						<table class="form-table bws_pro_version">
   441 							<tr valign="top">
   458 							<tr>
   442 								<th scope="row"><?php _e( 'Projects Fields', 'portfolio' ); ?></th>
   459 								<th scope="row" class="prtfl_table_project"><?php _e( 'Projects Fields', 'portfolio' ); ?></th>
   443 								<td>
   460 								<td>
   444 									<fieldset>
   461 									<fieldset>
   445 										<label>
   462 										<label class="prtfl_label_project">
   446 											<input type="checkbox" name="prtfl_categories_additional_field" value="1" disabled="disabled" />
   463 											<input type="checkbox" name="prtfl_categories_additional_field" value="1" disabled="disabled" />
   447 											 <?php _e( 'Categories', 'portfolio' ); ?><br />
   464 											 <?php _e( 'Categories', 'portfolio' ); ?><br />
   448 											<input type="text" name="prtfl_categories_text_field" value="<?php _e( 'Categories', 'portfolio' ); ?>:" disabled="disabled" />											
   465 											<input class="prtfl_input_project" type="text" name="prtfl_categories_text_field" value="<?php _e( 'Categories', 'portfolio' ); ?>:" disabled="disabled" />
   449 										</label><br />
   466 										</label><br />
   450 										<label>
   467 										<label class="prtfl_label_project">
   451 											<input type="checkbox" name="prtfl_sectors_additional_field" value="1" disabled="disabled" />
   468 											<input type="checkbox" name="prtfl_sectors_additional_field" value="1" disabled="disabled" />
   452 											 <?php _e( 'Sectors', 'portfolio' ); ?><br />
   469 											 <?php _e( 'Sectors', 'portfolio' ); ?><br />
   453 											<input type="text" name="prtfl_sectors_text_field" value="<?php _e( 'Sectors', 'portfolio' ); ?>:" disabled="disabled" />											
   470 											<input class="prtfl_input_project" type="text" name="prtfl_sectors_text_field" value="<?php _e( 'Sectors', 'portfolio' ); ?>:" disabled="disabled" />
   454 										</label><br />
   471 										</label><br />
   455 										<label>
   472 										<label class="prtfl_label_project">
   456 											<input type="checkbox" name="prtfl_services_additional_field" value="1" disabled="disabled" />
   473 											<input type="checkbox" name="prtfl_services_additional_field" value="1" disabled="disabled" />
   457 											 <?php _e( 'Services', 'portfolio' ); ?><br />
   474 											 <?php _e( 'Services', 'portfolio' ); ?><br />
   458 											<input type="text" name="prtfl_services_text_field" value="<?php _e( 'Services', 'portfolio' ); ?>:" disabled="disabled" />											
   475 											<input class="prtfl_input_project" type="text" name="prtfl_services_text_field" value="<?php _e( 'Services', 'portfolio' ); ?>:" disabled="disabled" />
   459 										</label><br />
   476 										</label><br />
   460 										<label>
   477 										<label class="prtfl_label_project">
   461 											<input type="checkbox" name="prtfl_client_additional_field" value="1" disabled="disabled" />
   478 											<input type="checkbox" name="prtfl_client_additional_field" value="1" disabled="disabled" />
   462 											 <?php _e( 'Client', 'portfolio' ); ?><br />
   479 											 <?php _e( 'Client', 'portfolio' ); ?><br />
   463 											<input type="text" name="prtfl_client_text_field" value="<?php _e( 'Client', 'portfolio' ); ?>:" disabled="disabled" />											
   480 											<input class="prtfl_input_project" type="text" name="prtfl_client_text_field" value="<?php _e( 'Client', 'portfolio' ); ?>:" disabled="disabled" />
   464 										</label><br />
   481 										</label><br />
   465 										<label><input type="checkbox" name="prtfl_disbable_screenshot_block" value="1" disabled="disabled" /> <?php _e( '"More screenshots" block', 'portfolio' ); ?></label><br />
   482 										<label><input type="checkbox" name="prtfl_disbable_screenshot_block" value="1" disabled="disabled" /> <?php _e( '"More screenshots" block', 'portfolio' ); ?></label><br />
   466 									</fieldset>
   483 									</fieldset>
   467 								</td>
   484 								</td>
   468 							</tr>
   485 							</tr>