Edit File by line
/home/barbar84/www/wp-conte.../plugins/file-man.../applicat.../pages
File: controls.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
$settings = $this->get();
[1] Fix | Delete
$locales = $this->langs->locales();
[2] Fix | Delete
$path = str_replace('\\','/', ABSPATH);
[3] Fix | Delete
$url = site_url();
[4] Fix | Delete
$type = (isset($_GET['status']) && !empty($_GET['status']) ? intval($_GET['status']) : '' );
[5] Fix | Delete
$message = ($type == '2') ? 'Unable to save settings.' : 'Settings updated successfully.';
[6] Fix | Delete
$roles = $this->wpUserRoles();
[7] Fix | Delete
$cm_themes = class_fma_main::cm_themes();
[8] Fix | Delete
?>
[9] Fix | Delete
<?php echo class_fma_admin_menus::shortcodeUpdateNotice();?>
[10] Fix | Delete
<div class="wrap fma" style="background:#fff; padding: 20px; border:1px solid #ccc;">
[11] Fix | Delete
<h3><?php _e('Settings','file-manager-advanced')?> <?php if(!class_exists('file_manager_advanced_shortcode')) { ?><a href="https://advancedfilemanager.com/pricing" class="button button-primary" target="_blank"><?php _e('Buy Shortcode Addon','file-manager-advanced')?></a><?php } ?> <a href="https://advancedfilemanager.com/documentation/" class="button" target="_blank"><?php _e('Documentation','file-manager-advanced')?></a></h3>
[12] Fix | Delete
<p style="width:100%; text-align:right;" class="description">
[13] Fix | Delete
<span id="thankyou"><?php _e('Thank you for using <a href="https://wordpress.org/plugins/file-manager-advanced/">File Manager Advanced</a>. If happy then ','file-manager-advanced')?>
[14] Fix | Delete
<a href="https://wordpress.org/support/plugin/file-manager-advanced/reviews/?filter=5"><?php _e('Rate Us','file-manager-advanced')?> <img src="<?php echo plugins_url( 'images/5stars.png', __FILE__ );?>" style="width:100px; top: 11px; position: relative;"></a></span>
[15] Fix | Delete
</p>
[16] Fix | Delete
<?php $this->save();
[17] Fix | Delete
if(isset($type) && !empty($type)) {
[18] Fix | Delete
if($type == '1') { ?>
[19] Fix | Delete
<div class="updated notice">
[20] Fix | Delete
<p><?php echo esc_attr( $message ) ?></p>
[21] Fix | Delete
</div>
[22] Fix | Delete
<?php } else if($type == '2') { ?>
[23] Fix | Delete
<div class="error notice">
[24] Fix | Delete
<p><?php echo esc_attr( $message ) ?></p>
[25] Fix | Delete
</div>
[26] Fix | Delete
<?php }
[27] Fix | Delete
}
[28] Fix | Delete
?>
[29] Fix | Delete
<form action="<?php echo admin_url('admin.php?page=file_manager_advanced_controls');?>" method="post">
[30] Fix | Delete
<?php wp_nonce_field( 'fmaform', '_fmaform' ); ?>
[31] Fix | Delete
<table class="form-table">
[32] Fix | Delete
<tbody>
[33] Fix | Delete
<tr>
[34] Fix | Delete
<th>
[35] Fix | Delete
<?php _e('Who can access File Manager?', 'file-manager-advanced');?>
[36] Fix | Delete
</th>
[37] Fix | Delete
<td>
[38] Fix | Delete
<?php
[39] Fix | Delete
unset($roles['administrator']); ?>
[40] Fix | Delete
<?php if(is_multisite()):
[41] Fix | Delete
$checked = '';
[42] Fix | Delete
if(isset($settings['fma_user_roles'])):
[43] Fix | Delete
if(in_array('administrator', $settings['fma_user_roles'])) {
[44] Fix | Delete
$checked = 'checked=checked';
[45] Fix | Delete
}
[46] Fix | Delete
endif;
[47] Fix | Delete
?>
[48] Fix | Delete
<input type="checkbox" value="superadmin" name="fma_user_role[]" checked="checked" disabled="disabled" /> <?php _e('Super Admin (Default)','file-manager-advanced');?> <br/>
[49] Fix | Delete
<input type="checkbox" value="administrator" name="fma_user_role[]" <?php echo esc_attr($checked); ?> /> <?php _e('Administrator','file-manager-advanced');?> <br/>
[50] Fix | Delete
<?php else : ?>
[51] Fix | Delete
<input type="checkbox" value="administrator" name="fma_user_role[]" checked="checked" disabled="disabled" /> <?php _e('Administrator (Default)','file-manager-advanced');?> <br/>
[52] Fix | Delete
<?php endif; ?>
[53] Fix | Delete
<?php
[54] Fix | Delete
foreach($roles as $key => $role) {
[55] Fix | Delete
$checked = '';
[56] Fix | Delete
if(isset($settings['fma_user_roles'])):
[57] Fix | Delete
if(in_array($key, $settings['fma_user_roles'])) {
[58] Fix | Delete
$checked = 'checked=checked';
[59] Fix | Delete
}
[60] Fix | Delete
endif;
[61] Fix | Delete
?>
[62] Fix | Delete
<input type="checkbox" value="<?php echo esc_attr($key);?>" name="fma_user_role[]" <?php echo esc_attr($checked); ?> /> <?php echo esc_attr($role['name']);?> <br/>
[63] Fix | Delete
<?php } ?>
[64] Fix | Delete
</td>
[65] Fix | Delete
</tr>
[66] Fix | Delete
<tr>
[67] Fix | Delete
<th><?php _e('Theme','file-manager-advanced')?></th>
[68] Fix | Delete
<td>
[69] Fix | Delete
<select name="fma_theme" id="fma_theme">
[70] Fix | Delete
<option value="light" <?php echo(isset($settings['fma_theme']) && $settings['fma_theme'] == 'light') ? 'selected="selected"' : '';?>><?php _e('Light','file-manager-advanced')?></option>
[71] Fix | Delete
<option value="dark" <?php echo(isset($settings['fma_theme']) && $settings['fma_theme'] == 'dark') ? 'selected="selected"' : '';?>><?php _e('Dark','file-manager-advanced')?></option>
[72] Fix | Delete
<option value="grey" <?php echo(isset($settings['fma_theme']) && $settings['fma_theme'] == 'grey') ? 'selected="selected"' : '';?>><?php _e('Grey','file-manager-advanced')?></option>
[73] Fix | Delete
<option value="windows10" <?php echo(isset($settings['fma_theme']) && $settings['fma_theme'] == 'windows10') ? 'selected="selected"' : '';?>><?php _e('Windows 10','file-manager-advanced')?></option>
[74] Fix | Delete
<option value="bootstrap" <?php echo(isset($settings['fma_theme']) && $settings['fma_theme'] == 'bootstrap') ? 'selected="selected"' : '';?>><?php _e('Bootstrap','file-manager-advanced')?></option>
[75] Fix | Delete
</select>
[76] Fix | Delete
<p class="description"><?php _e('Select file manager advanced theme. Default: Light','file-manager-advanced')?></p>
[77] Fix | Delete
</td>
[78] Fix | Delete
</tr>
[79] Fix | Delete
<tr>
[80] Fix | Delete
<th><?php _e('Language','file-manager-advanced')?></th>
[81] Fix | Delete
<td>
[82] Fix | Delete
<select name="fma_locale" id="fma_locale">
[83] Fix | Delete
<?php foreach($locales as $key => $locale) { ?>
[84] Fix | Delete
<option value="<?php echo esc_attr($locale);?>" <?php echo (isset($settings['fma_locale']) && $settings['fma_locale'] == $locale) ? 'selected="selected"' : '';?>><?php echo esc_attr($key);?></option>
[85] Fix | Delete
<?php } ?>
[86] Fix | Delete
</select>
[87] Fix | Delete
<p class="description"><?php _e('Select file manager advanced language. Default: en (English)','file-manager-advanced');?></p>
[88] Fix | Delete
</td>
[89] Fix | Delete
</tr>
[90] Fix | Delete
<tr>
[91] Fix | Delete
<th><?php _e('Public Root Path','file-manager-advanced')?></th>
[92] Fix | Delete
<td>
[93] Fix | Delete
<input name="public_path" type="text" id="public_path" value="<?php echo isset($settings['public_path']) && !empty($settings['public_path']) ? esc_attr($settings['public_path']) : esc_attr($path);?>" class="regular-text">
[94] Fix | Delete
<p class="description"><?php _e('File Manager Advanced Root Path, you can change according to your choice.','file-manager-advanced');?></p>
[95] Fix | Delete
<p>Default: <code><?php echo esc_attr($path);?></code></p>
[96] Fix | Delete
</td>
[97] Fix | Delete
</tr>
[98] Fix | Delete
<tr>
[99] Fix | Delete
<th><?php _e('Files URL','file-manager-advanced')?></th>
[100] Fix | Delete
<td>
[101] Fix | Delete
<input name="public_url" type="text" id="public_url" value="<?php echo isset($settings['public_url']) && !empty($settings['public_url']) ? esc_url($settings['public_url']) : esc_url($url);?>" class="regular-text">
[102] Fix | Delete
<p class="description"><?php _e('File Manager Advanced Files URL, you can change according to your choice.','file-manager-advanced');?></p>
[103] Fix | Delete
<p>Default: <code><?php echo esc_url($url);?></code></p>
[104] Fix | Delete
</td>
[105] Fix | Delete
</tr>
[106] Fix | Delete
<tr>
[107] Fix | Delete
<th><?php _e('Maximum Upload Size','file-manager-advanced')?></th>
[108] Fix | Delete
<td>
[109] Fix | Delete
<input type="text" name="upload_max_size" id="upload_max_size" class="regular-text" value="<?php echo isset($settings['upload_max_size']) && !empty($settings['upload_max_size']) ? esc_attr($settings['upload_max_size']) : 0;?>">
[110] Fix | Delete
<div>
[111] Fix | Delete
<p>
[112] Fix | Delete
<?php _e('Maximum upload file size. This size is per files. Can be set as number with unit like 10M, 500K, 1G. 0 means unlimited upload.','file-manager-advanced');?>
[113] Fix | Delete
</p>
[114] Fix | Delete
</div>
[115] Fix | Delete
</td>
[116] Fix | Delete
</tr>
[117] Fix | Delete
<tr>
[118] Fix | Delete
<th><?php _e('Default View Type','file-manager-advanced')?></th>
[119] Fix | Delete
<td>
[120] Fix | Delete
<?php
[121] Fix | Delete
foreach(FMA_UI as $ui) {
[122] Fix | Delete
$checked = '';
[123] Fix | Delete
if(isset($settings['display_ui_options'])) {
[124] Fix | Delete
if(in_array($ui, $settings['display_ui_options'])) {
[125] Fix | Delete
$checked = 'checked=checked';
[126] Fix | Delete
}
[127] Fix | Delete
} else {
[128] Fix | Delete
$checked = 'checked=checked';
[129] Fix | Delete
}
[130] Fix | Delete
?>
[131] Fix | Delete
<input type="checkbox" value="<?php echo esc_attr($ui);?>" name="display_ui_options[]" <?php echo esc_attr($checked); ?> /> <?php echo esc_attr($ui);?> <br/>
[132] Fix | Delete
<?php } ?>
[133] Fix | Delete
<p><?php _e('You can control the view of file manager. By default, all options are checked.','file-manager-advanced');?></p>
[134] Fix | Delete
</td>
[135] Fix | Delete
</tr>
[136] Fix | Delete
<tr>
[137] Fix | Delete
<th><?php _e('Hide File Path on Preview ?','file-manager-advanced');
[138] Fix | Delete
?></th>
[139] Fix | Delete
<td>
[140] Fix | Delete
<input name="hide_path" type="checkbox" id="hide_path" value="1" <?php echo isset($settings['hide_path']) && ($settings['hide_path'] == '1') ? 'checked="checked"' : '';?>>
[141] Fix | Delete
<p class="description"><?php _e('Hide real path of file on preview.','file-manager-advanced')?></p>
[142] Fix | Delete
<p>Default: <code><?php _e('Disabled','file-manager-advanced')?></code></p>
[143] Fix | Delete
</td>
[144] Fix | Delete
</tr>
[145] Fix | Delete
<tr>
[146] Fix | Delete
<th><?php _e('Enable Trash?','file-manager-advanced');
[147] Fix | Delete
?></th>
[148] Fix | Delete
<td>
[149] Fix | Delete
<input name="enable_trash" type="checkbox" id="enable_trash" value="1" <?php echo isset($settings['enable_trash']) && ($settings['enable_trash'] == '1') ? 'checked="checked"' : '';?>>
[150] Fix | Delete
<p class="description"><?php _e('Deleted files will go to trash folder, you can restore later.','file-manager-advanced')?></p>
[151] Fix | Delete
<p>Default: <code><?php _e('Disabled','file-manager-advanced')?></code></p>
[152] Fix | Delete
</td>
[153] Fix | Delete
</tr>
[154] Fix | Delete
<tr>
[155] Fix | Delete
<th><?php _e('Display .htaccess?','file-manager-advanced');
[156] Fix | Delete
?></th>
[157] Fix | Delete
<td>
[158] Fix | Delete
<input name="enable_htaccess" type="checkbox" id="enable_htaccess" value="1" <?php echo isset($settings['enable_htaccess']) && ($settings['enable_htaccess'] == '1') ? 'checked="checked"' : '';?>>
[159] Fix | Delete
<p class="description"><?php _e('Will Display .htaccess file (if exists) in file manager.','file-manager-advanced')?></p>
[160] Fix | Delete
<p>Default: <code><?php _e('Disabled','file-manager-advanced')?></code></p>
[161] Fix | Delete
</td>
[162] Fix | Delete
</tr>
[163] Fix | Delete
<tr>
[164] Fix | Delete
<th><?php _e('Mimetypes allowed to upload','file-manager-advanced')?></th>
[165] Fix | Delete
<td>
[166] Fix | Delete
<textarea name="fma_upload_allow" id="fma_upload_allow" class="large-text" rows="3" cols="30"><?php echo isset($settings['fma_upload_allow']) && !empty($settings['fma_upload_allow']) ? esc_attr($settings['fma_upload_allow']) : 'all';?></textarea>
[167] Fix | Delete
<p class="description"><?php _e('Enter Mimetypes allowed to upload, multiple comma(,) separated. Example: <code>image/vnd.adobe.photoshop,image/png</code>','file-manager-advanced')?></p>
[168] Fix | Delete
<p>Default: <code><?php _e('all','file-manager-advanced')?></code> <a href="https://advancedfilemanager.com/advanced-file-manager-mime-types/" target="_blank"><?php _e('MIME Types Help', 'file-manager-advanced'); ?></a></p>
[169] Fix | Delete
</td>
[170] Fix | Delete
</tr>
[171] Fix | Delete
<tr>
[172] Fix | Delete
<th><?php _e('Code Editor Theme <sup style="color:red;">New</sup>','file-manager-advanced')?></th>
[173] Fix | Delete
<td>
[174] Fix | Delete
<select name="fma_cm_theme" id="fma_cm_theme">
[175] Fix | Delete
<?php foreach ($cm_themes as $key => $val) :
[176] Fix | Delete
$selected = "";
[177] Fix | Delete
if(isset($settings['fma_cm_theme'])) {
[178] Fix | Delete
if($key == $settings['fma_cm_theme']) {
[179] Fix | Delete
$selected = 'selected=selected';
[180] Fix | Delete
}
[181] Fix | Delete
}
[182] Fix | Delete
?>
[183] Fix | Delete
<option value="<?php echo $key; ?>" <?php echo $selected;?>><?php _e($val,'file-manager-advanced')?></option>
[184] Fix | Delete
<?php endforeach;?>
[185] Fix | Delete
</select>
[186] Fix | Delete
<p class="description"><?php _e('Select code editor theme. Default: default','file-manager-advanced')?></p>
[187] Fix | Delete
</td>
[188] Fix | Delete
</tr>
[189] Fix | Delete
</tbody>
[190] Fix | Delete
</table>
[191] Fix | Delete
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes"></p>
[192] Fix | Delete
</form>
[193] Fix | Delete
</div>
[194] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function