Zeile 46 | Zeile 46 |
---|
$mybb->input['extension'] = substr($mybb->input['extension'], 1); }
|
$mybb->input['extension'] = substr($mybb->input['extension'], 1); }
|
$maxsize = $mybb->get_input('maxsize', 1);
| $maxsize = $mybb->get_input('maxsize', MyBB::INPUT_INT);
|
if($maxsize == 0) {
| if($maxsize == 0) {
|
Zeile 66 | Zeile 66 |
---|
$plugins->run_hooks("admin_config_attachment_types_add_commit");
// Log admin action
|
$plugins->run_hooks("admin_config_attachment_types_add_commit");
// Log admin action
|
log_admin_action($atid, $mybb->input['extension']);
| log_admin_action($atid, htmlspecialchars_uni($mybb->input['extension']));
|
$cache->update_attachtypes();
| $cache->update_attachtypes();
|
Zeile 124 | Zeile 124 |
---|
$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->file_extension." <em>*</em>", $lang->file_extension_desc, $form->generate_text_box('extension', $mybb->input['extension'], array('id' => 'extension')), 'extension'); $form_container->output_row($lang->mime_type." <em>*</em>", $lang->mime_type_desc, $form->generate_text_box('mimetype', $mybb->input['mimetype'], array('id' => 'mimetype')), 'mimetype');
|
$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->file_extension." <em>*</em>", $lang->file_extension_desc, $form->generate_text_box('extension', $mybb->input['extension'], array('id' => 'extension')), 'extension'); $form_container->output_row($lang->mime_type." <em>*</em>", $lang->mime_type_desc, $form->generate_text_box('mimetype', $mybb->input['mimetype'], array('id' => 'mimetype')), 'mimetype');
|
$form_container->output_row($lang->maximum_file_size, $lang->maximum_file_size_desc.$limit_string, $form->generate_text_box('maxsize', $mybb->input['maxsize'], array('id' => 'maxsize')), 'maxsize');
| $form_container->output_row($lang->maximum_file_size, $lang->maximum_file_size_desc.$limit_string, $form->generate_numeric_field('maxsize', $mybb->input['maxsize'], array('id' => 'maxsize', 'min' => 0)), 'maxsize');
|
$form_container->output_row($lang->attachment_icon, $lang->attachment_icon_desc, $form->generate_text_box('icon', $mybb->input['icon'], array('id' => 'icon')), 'icon');
$form_container->end();
| $form_container->output_row($lang->attachment_icon, $lang->attachment_icon_desc, $form->generate_text_box('icon', $mybb->input['icon'], array('id' => 'icon')), 'icon');
$form_container->end();
|
Zeile 139 | Zeile 139 |
---|
if($mybb->input['action'] == "edit") {
|
if($mybb->input['action'] == "edit") {
|
$query = $db->simple_select("attachtypes", "*", "atid='".$mybb->get_input('atid', 1)."'");
| $query = $db->simple_select("attachtypes", "*", "atid='".$mybb->get_input('atid', MyBB::INPUT_INT)."'");
|
$attachment_type = $db->fetch_array($query);
if(!$attachment_type['atid'])
| $attachment_type = $db->fetch_array($query);
if(!$attachment_type['atid'])
|
Zeile 178 | Zeile 178 |
---|
"name" => $db->escape_string($mybb->input['name']), "mimetype" => $db->escape_string($mybb->input['mimetype']), "extension" => $db->escape_string($mybb->input['extension']),
|
"name" => $db->escape_string($mybb->input['name']), "mimetype" => $db->escape_string($mybb->input['mimetype']), "extension" => $db->escape_string($mybb->input['extension']),
|
"maxsize" => $mybb->get_input('maxsize', 1),
| "maxsize" => $mybb->get_input('maxsize', MyBB::INPUT_INT),
|
"icon" => $db->escape_string($mybb->input['icon']) );
| "icon" => $db->escape_string($mybb->input['icon']) );
|
Zeile 187 | Zeile 187 |
---|
$db->update_query("attachtypes", $updated_type, "atid='{$attachment_type['atid']}'");
// Log admin action
|
$db->update_query("attachtypes", $updated_type, "atid='{$attachment_type['atid']}'");
// Log admin action
|
log_admin_action($attachment_type['atid'], $mybb->input['extension']);
| log_admin_action($attachment_type['atid'], htmlspecialchars_uni($mybb->input['extension']));
|
$cache->update_attachtypes();
| $cache->update_attachtypes();
|
Zeile 239 | Zeile 239 |
---|
$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->file_extension." <em>*</em>", $lang->file_extension_desc, $form->generate_text_box('extension', $mybb->input['extension'], array('id' => 'extension')), 'extension'); $form_container->output_row($lang->mime_type." <em>*</em>", $lang->mime_type_desc, $form->generate_text_box('mimetype', $mybb->input['mimetype'], array('id' => 'mimetype')), 'mimetype');
|
$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->file_extension." <em>*</em>", $lang->file_extension_desc, $form->generate_text_box('extension', $mybb->input['extension'], array('id' => 'extension')), 'extension'); $form_container->output_row($lang->mime_type." <em>*</em>", $lang->mime_type_desc, $form->generate_text_box('mimetype', $mybb->input['mimetype'], array('id' => 'mimetype')), 'mimetype');
|
$form_container->output_row($lang->maximum_file_size, $lang->maximum_file_size_desc.$limit_string, $form->generate_text_box('maxsize', $mybb->input['maxsize'], array('id' => 'maxsize')), 'maxsize');
| $form_container->output_row($lang->maximum_file_size, $lang->maximum_file_size_desc.$limit_string, $form->generate_numeric_field('maxsize', $mybb->input['maxsize'], array('id' => 'maxsize', 'min' => 0)), 'maxsize');
|
$form_container->output_row($lang->attachment_icon, $lang->attachment_icon_desc, $form->generate_text_box('icon', $mybb->input['icon'], array('id' => 'icon')), 'icon');
$form_container->end();
| $form_container->output_row($lang->attachment_icon, $lang->attachment_icon_desc, $form->generate_text_box('icon', $mybb->input['icon'], array('id' => 'icon')), 'icon');
$form_container->end();
|
Zeile 259 | Zeile 259 |
---|
admin_redirect("index.php?module=config-attachment_types"); }
|
admin_redirect("index.php?module=config-attachment_types"); }
|
$query = $db->simple_select("attachtypes", "*", "atid='".$mybb->get_input('atid', 1)."'");
| $query = $db->simple_select("attachtypes", "*", "atid='".$mybb->get_input('atid', MyBB::INPUT_INT)."'");
|
$attachment_type = $db->fetch_array($query);
if(!$attachment_type['atid'])
| $attachment_type = $db->fetch_array($query);
if(!$attachment_type['atid'])
|
Zeile 274 | Zeile 274 |
---|
{ $db->delete_query("attachtypes", "atid='{$attachment_type['atid']}'");
|
{ $db->delete_query("attachtypes", "atid='{$attachment_type['atid']}'");
|
$cache->update_attachtypes();
$plugins->run_hooks("admin_config_attachment_types_delete_commit");
| $plugins->run_hooks("admin_config_attachment_types_delete_commit");
$cache->update_attachtypes();
|
// Log admin action
|
// Log admin action
|
log_admin_action($attachment_type['atid'], $attachment_type['extension']);
| log_admin_action($attachment_type['atid'], htmlspecialchars_uni($attachment_type['extension']));
|
flash_message($lang->success_attachment_type_deleted, 'success'); admin_redirect("index.php?module=config-attachment_types"); } else
|
flash_message($lang->success_attachment_type_deleted, 'success'); admin_redirect("index.php?module=config-attachment_types"); } else
|
{
| {
|
$page->output_confirm_action("index.php?module=config-attachment_types&action=delete&atid={$attachment_type['atid']}", $lang->confirm_attachment_type_deletion); } }
| $page->output_confirm_action("index.php?module=config-attachment_types&action=delete&atid={$attachment_type['atid']}", $lang->confirm_attachment_type_deletion); } }
|
Zeile 307 | Zeile 307 |
---|
$plugins->run_hooks("admin_config_attachment_types_start");
$page->output_nav_tabs($sub_tabs, 'attachment_types');
|
$plugins->run_hooks("admin_config_attachment_types_start");
$page->output_nav_tabs($sub_tabs, 'attachment_types');
|
|
|
$table = new Table; $table->construct_header($lang->extension, array("colspan" => 2)); $table->construct_header($lang->mime_type);
| $table = new Table; $table->construct_header($lang->extension, array("colspan" => 2)); $table->construct_header($lang->mime_type);
|
Zeile 318 | Zeile 318 |
---|
while($attachment_type = $db->fetch_array($query)) { // Just show default icons in ACP
|
while($attachment_type = $db->fetch_array($query)) { // Just show default icons in ACP
|
$attachment_type['icon'] = str_replace("{theme}", "images", $attachment_type['icon']);
| $attachment_type['icon'] = htmlspecialchars_uni(str_replace("{theme}", "images", $attachment_type['icon'])); if(my_strpos($attachment_type['icon'], "p://") || substr($attachment_type['icon'], 0, 1) == "/") { $image = $attachment_type['icon']; } else { $image = "../".$attachment_type['icon']; }
|
if(!$attachment_type['icon'] || $attachment_type['icon'] == "images/attachtypes/") { $attachment_type['icon'] = " "; } else {
|
if(!$attachment_type['icon'] || $attachment_type['icon'] == "images/attachtypes/") { $attachment_type['icon'] = " "; } else {
|
$attachment_type['icon'] = "<img src=\"../{$attachment_type['icon']}\" title=\"{$attachment_type['name']}\" alt=\"\" />";
| $attachment_type['name'] = htmlspecialchars_uni($attachment_type['name']); $attachment_type['icon'] = "<img src=\"{$image}\" title=\"{$attachment_type['name']}\" alt=\"\" />";
|
}
$table->construct_cell($attachment_type['icon'], array("width" => 1)); $table->construct_cell("<strong>.{$attachment_type['extension']}</strong>");
|
}
$table->construct_cell($attachment_type['icon'], array("width" => 1)); $table->construct_cell("<strong>.{$attachment_type['extension']}</strong>");
|
$table->construct_cell($attachment_type['mimetype']);
| $table->construct_cell(htmlspecialchars_uni($attachment_type['mimetype']));
|
$table->construct_cell(get_friendly_size(($attachment_type['maxsize']*1024)), array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=config-attachment_types&action=edit&atid={$attachment_type['atid']}\">{$lang->edit}</a>", array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=config-attachment_types&action=delete&atid={$attachment_type['atid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_attachment_type_deletion}')\">{$lang->delete}</a>", array("class" => "align_center"));
| $table->construct_cell(get_friendly_size(($attachment_type['maxsize']*1024)), array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=config-attachment_types&action=edit&atid={$attachment_type['atid']}\">{$lang->edit}</a>", array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=config-attachment_types&action=delete&atid={$attachment_type['atid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_attachment_type_deletion}')\">{$lang->delete}</a>", array("class" => "align_center"));
|