/*
wp_redirect:
/wrong-hash
/download-expired
/ip-not-valied
/no-such-product
/product-not-exist
*/
// Redirection Path
$this->fields['opsd_download_url_path'] = array(
'type' => 'text'
, 'default' => ''
, 'group' => 'general'
, 'placeholder' => '/file-download/'
, 'css' => 'width:100%;'
, 'title' => __('URL Path', 'secure-downloads')
, 'description' => '(' . __('Optional' , 'secure-downloads') . ') ' . __('Enter URL path, that will exist in secret URL' , 'secure-downloads')
, 'description_tag' => ''
);
// Redirection Path
$this->fields['opsd_protected_directory_name_level1'] = array(
'type' => 'text'
, 'default' => ''
, 'group' => 'general'
, 'placeholder' => 'opsd_XXXXXXXXXX'
, 'css' => 'width:100%;'
, 'title' => __('Upload Folder', 'secure-downloads')
, 'description' => __('Path to upload folder' , 'secure-downloads')
, 'description_tag' => ''
);
// Secret Key
$this->fields['opsd_secret_key'] = array(
'type' => 'text'
, 'default' => wp_generate_password( 30, false, false )
, 'group' => 'general'
, 'placeholder' => wp_generate_password( 30, false, false )
, 'css' => 'width:100%;'
, 'title' => __('Secret Key', 'secure-downloads')
, 'description' => __('Enter your secret key. Secure link hash will be generated from it. Please keep it secure.' , 'secure-downloads')
, 'description_tag' => ''
);
// Default Expiration
$options = array(
'+5 minutes' => '5 ' . __('minutes', 'secure-downloads')
, '+15 minutes' => '15 ' . __('minutes', 'secure-downloads')
, '+30 minutes' => '30 ' . __('minutes', 'secure-downloads')
, '+45 minutes' => '45 ' . __('minutes', 'secure-downloads')
, '+1 hour' => '1 ' . __('hour', 'secure-downloads')
, '+6 hours' => '6 ' . __('hours', 'secure-downloads')
, '+12 hours' => '12 ' . __('hours', 'secure-downloads')
, '+24 hours' => '24 ' . __('hours', 'secure-downloads')
, '+3 days' => '3 ' . __('days', 'secure-downloads')
, '+5 days' => '5 ' . __('days', 'secure-downloads')
, '+7 days' => '7 ' . __('days', 'secure-downloads')
, '+30 days' => '30 ' . __('days', 'secure-downloads')
, '+90 days' => '90 ' . __('days', 'secure-downloads')
, '+365 days' => '1 ' . __('year', 'secure-downloads')
, '0' => __('Never', 'secure-downloads') //FixIn: 1.2.2.2
);
$this->fields['opsd_defualt_expiration'] = array(
'type' => 'select'
, 'default' => '+24 hours'
//, 'value' => '/css/skins/standard.css' //This will override value loaded from DB
, 'title' => __('Default Expiration', 'secure-downloads')
, 'description' => __('Select default expiration time of link' , 'secure-downloads')
, 'options' => $options
, 'group' => 'general'
);
// Default IP Lock
$this->fields['opsd_defualt_iplock'] = array(
'type' => 'text'
, 'default' => ''
, 'group' => 'general'
, 'placeholder' => '0.0.0.0'
, 'css' => 'width:17em;'
, 'title' => __('Default IP address loc', 'secure-downloads')
, 'description' => __('Enter default IP address for grant access to download file only for specific IP. Or leave empty for having no lock.' , 'secure-downloads')
. ''
. ''. __('Note', '') . '! '
. __('To specify an IP range for grant access, use configuration like', 'secure-downloads') . ' '
. '
' . __('Example', 'secure-downloads') . ' 1: 195.47.89'
. '
' . __('Example', 'secure-downloads') . ' 2: 195.47'
. '
' . __('Example', 'secure-downloads') . ' 3: 195'
. '
'
);
//
//
// get_opsd_option( 'opsd_url_wrong_hash' )
// get_opsd_option( 'opsd_url_download_expired' )
// get_opsd_option( 'opsd_url_ip_not_valied' )
// get_opsd_option( 'opsd_url_file_not_exist' )
// get_opsd_option( 'opsd_url_error_opening_file' )
$name_of_field = 'opsd_url_wrong_hash';
$this->fields[ $name_of_field . '_prefix' ] = array(
'type' => 'pure_html'
, 'group' => 'warning_url'
, 'html' => '
| '
. OPSD_Settings_API::label_static( 'set_gen_' . $name_of_field
, array( 'title' => __( 'Wrong hash', 'secure-downloads' ), 'label_css' => '' )
)
. ' |
|
'
);
$name_of_field = 'opsd_url_download_expired';
$this->fields[ $name_of_field . '_prefix' ] = array(
'type' => 'pure_html'
, 'group' => 'warning_url'
, 'html' => '
| '
. OPSD_Settings_API::label_static( 'set_gen_' . $name_of_field
, array( 'title' => __( 'Link Expired', 'secure-downloads' ), 'label_css' => '' )
)
. ' |
|
'
);
$name_of_field = 'opsd_url_ip_not_valied';
$this->fields[ $name_of_field . '_prefix' ] = array(
'type' => 'pure_html'
, 'group' => 'warning_url'
, 'html' => '
| '
. OPSD_Settings_API::label_static( 'set_gen_' . $name_of_field
, array( 'title' => __( 'IP Not Valid', 'secure-downloads' ), 'label_css' => '' )
)
. ' |
|
'
);
$name_of_field = 'opsd_url_file_not_exist';
$this->fields[ $name_of_field . '_prefix' ] = array(
'type' => 'pure_html'
, 'group' => 'warning_url'
, 'html' => '
| '
. OPSD_Settings_API::label_static( 'set_gen_' . $name_of_field
, array( 'title' => __( 'File not exist', 'secure-downloads' ), 'label_css' => '' )
)
. ' |
|
'
);
$name_of_field = 'opsd_url_error_opening_file';
$this->fields[ $name_of_field . '_prefix' ] = array(
'type' => 'pure_html'
, 'group' => 'warning_url'
, 'html' => '
| '
. OPSD_Settings_API::label_static( 'set_gen_' . $name_of_field
, array( 'title' => __( 'Error File Opening', 'secure-downloads' ), 'label_css' => '' )
)
. ' |
|
'
);
//
//
// CSV Separator ////////////////////////////////////////////////////////
$field_options = array(
',' => ', - ' . __( 'comma', 'secure-downloads' )
, ';' => '; - ' . __( 'semicolon', 'secure-downloads' )
, '|' => '| - ' . __( 'vertical bar', 'secure-downloads' )
, '^' => '^ - ' . __( 'caret', 'secure-downloads' )
);
$this->fields['opsd_csv_separator'] = array(
'type' => 'select'
, 'default' => $default_options_values['opsd_csv_separator'] //';'
, 'title' => __('CSV field separator', 'secure-downloads')
, 'description' => sprintf(__('Select CSV separator of data field.' ,'secure-downloads'),'','')
, 'options' => $field_options
, 'group' => 'opsd_listing'
);
// Divider ///////////////////////////////////////////////////////////////
$this->fields['hr_opsd_csv_separator_separator'] = array( 'type' => 'hr', 'group' => 'opsd_listing' );
// Dates Format ////////////////////////////////////////////////////////
$this->fields['opsd_date_format_html_prefix'] = array(
'type' => 'pure_html'
, 'group' => 'opsd_listing'
, 'html' => '
| '.
OPSD_Settings_API::label_static( 'set_gen_opsd_date_format'
, array( 'title'=> __('Date Format' , 'secure-downloads'), 'label_css' => 'margin: 0.25em 0 !important;vertical-align: middle;' ) )
.' |
|
'
);
// Time Format
// $this->fields = apply_filters( 'opsd_settings_opsd_time_format', $this->fields, $default_options_values );
// Time Format /////////////////////////////////////////////////////////////
$this->fields['opsd_time_format_html_prefix'] = array(
'type' => 'pure_html'
, 'group' => 'opsd_listing'
, 'html' => '
| '.
OPSD_Settings_API::label_static( 'set_gen_opsd_time_format'
, array( 'title'=> __('Time Format' ,'secure-downloads'), 'label_css' => 'margin: 0.25em 0 !important;vertical-align: middle;' ) )
.' |
|
'
);
//
//