Vergleich admin/modules/config/attachment_types.php - 1.8.25 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 89Zeile 89
				"maxsize" => $maxsize,
"icon" => $db->escape_string($mybb->input['icon']),
'enabled' => $mybb->get_input('enabled', MyBB::INPUT_INT),

				"maxsize" => $maxsize,
"icon" => $db->escape_string($mybb->input['icon']),
'enabled' => $mybb->get_input('enabled', MyBB::INPUT_INT),

 
				'forcedownload' => $mybb->get_input('forcedownload', MyBB::INPUT_INT),

				'groups' => $db->escape_string($mybb->get_input('groups')),
'forums' => $db->escape_string($mybb->get_input('forums')),
'avatarfile' => $mybb->get_input('avatarfile', MyBB::INPUT_INT)

				'groups' => $db->escape_string($mybb->get_input('groups')),
'forums' => $db->escape_string($mybb->get_input('forums')),
'avatarfile' => $mybb->get_input('avatarfile', MyBB::INPUT_INT)

Zeile 278Zeile 279
	<script type=\"text/javascript\">
checkAction('forums');
</script>";

	<script type=\"text/javascript\">
checkAction('forums');
</script>";

 
	
$mybb->input['forcedownload'] = $mybb->get_input('forcedownload', MyBB::INPUT_INT);


$form_container = new FormContainer($lang->add_new_attachment_type);


$form_container = new FormContainer($lang->add_new_attachment_type);

	$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_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->output_row($lang->enabled, '', $form->generate_yes_no_radio('enabled', $mybb->input['enabled']), 'enabled');


	$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->get_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->get_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->get_input('mimetype'), array('id' => 'mimetype')), 'mimetype');
$form_container->output_row($lang->maximum_file_size, $lang->maximum_file_size_desc.$limit_string, $form->generate_numeric_field('maxsize', $mybb->get_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->get_input('icon'), array('id' => 'icon')), 'icon');
$form_container->output_row($lang->enabled, '', $form->generate_yes_no_radio('enabled', $mybb->get_input('enabled')), 'enabled');
$form_container->output_row($lang->forcedownload, $lang->forcedownload_desc, $form->generate_yes_no_radio('forcedownload', $mybb->get_input('forcedownload')), 'forcedownload');

	$form_container->output_row($lang->available_to_groups, '', $groups_select_code, '', array(), array('id' => 'row_groups'));
$form_container->output_row($lang->available_in_forums, '', $forums_select_code, '', array(), array('id' => 'row_forums'));

	$form_container->output_row($lang->available_to_groups, '', $groups_select_code, '', array(), array('id' => 'row_groups'));
$form_container->output_row($lang->available_in_forums, '', $forums_select_code, '', array(), array('id' => 'row_forums'));

	$form_container->output_row($lang->avatar_file, $lang->avatar_file_desc, $form->generate_yes_no_radio('avatarfile', $mybb->input['avatarfile']), 'avatarfile');

	$form_container->output_row($lang->avatar_file, $lang->avatar_file_desc, $form->generate_yes_no_radio('avatarfile', $mybb->get_input('avatarfile')), 'avatarfile');


$form_container->end();



$form_container->end();


Zeile 296Zeile 300

$form->output_submit_wrapper($buttons);
$form->end();


$form->output_submit_wrapper($buttons);
$form->end();





	$page->output_footer();
}


	$page->output_footer();
}


Zeile 328Zeile 332
		if(!$errors)
{
if($mybb->input['mimetype'] == "images/attachtypes/")

		if(!$errors)
{
if($mybb->input['mimetype'] == "images/attachtypes/")

			{

			{

				$mybb->input['mimetype'] = '';

				$mybb->input['mimetype'] = '';

			}

			}


if(substr($mybb->input['extension'], 0, 1) == '.')
{
$mybb->input['extension'] = substr($mybb->input['extension'], 1);


if(substr($mybb->input['extension'], 0, 1) == '.')
{
$mybb->input['extension'] = substr($mybb->input['extension'], 1);

			}

			}


foreach(array('groups', 'forums') as $key)
{


foreach(array('groups', 'forums') as $key)
{

Zeile 373Zeile 377
				"maxsize" => $mybb->get_input('maxsize', MyBB::INPUT_INT),
"icon" => $db->escape_string($mybb->input['icon']),
'enabled' => $mybb->get_input('enabled', MyBB::INPUT_INT),

				"maxsize" => $mybb->get_input('maxsize', MyBB::INPUT_INT),
"icon" => $db->escape_string($mybb->input['icon']),
'enabled' => $mybb->get_input('enabled', MyBB::INPUT_INT),

 
				'forcedownload' => $mybb->get_input('forcedownload', MyBB::INPUT_INT),

				'groups' => $db->escape_string($mybb->get_input('groups')),
'forums' => $db->escape_string($mybb->get_input('forums')),
'avatarfile' => $mybb->get_input('avatarfile', MyBB::INPUT_INT)
);

$plugins->run_hooks("admin_config_attachment_types_edit_commit");

				'groups' => $db->escape_string($mybb->get_input('groups')),
'forums' => $db->escape_string($mybb->get_input('forums')),
'avatarfile' => $mybb->get_input('avatarfile', MyBB::INPUT_INT)
);

$plugins->run_hooks("admin_config_attachment_types_edit_commit");





			$db->update_query("attachtypes", $updated_type, "atid='{$attachment_type['atid']}'");

			$db->update_query("attachtypes", $updated_type, "atid='{$attachment_type['atid']}'");





			// Log admin action
log_admin_action($attachment_type['atid'], $mybb->input['extension']);

$cache->update_attachtypes();

			// Log admin action
log_admin_action($attachment_type['atid'], $mybb->input['extension']);

$cache->update_attachtypes();





			flash_message($lang->success_attachment_type_updated, 'success');
admin_redirect("index.php?module=config-attachment_types");
}
}

$page->add_breadcrumb_item($lang->edit_attachment_type);

			flash_message($lang->success_attachment_type_updated, 'success');
admin_redirect("index.php?module=config-attachment_types");
}
}

$page->add_breadcrumb_item($lang->edit_attachment_type);

	$page->output_header($lang->attachment_types." - ".$lang->edit_attachment_type);

	$page->output_header($lang->attachment_types." - ".$lang->edit_attachment_type);


$sub_tabs['edit_attachment_type'] = array(
'title' => $lang->edit_attachment_type,


$sub_tabs['edit_attachment_type'] = array(
'title' => $lang->edit_attachment_type,

Zeile 508Zeile 513
			</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"groups\" value=\"none\" {$group_checked['none']} class=\"groups_forums_groups_check\" onclick=\"checkAction('groups');\" style=\"vertical-align: middle;\" /> <strong>{$lang->none}</strong></label></dt>

			</table>
</dd>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"groups\" value=\"none\" {$group_checked['none']} class=\"groups_forums_groups_check\" onclick=\"checkAction('groups');\" style=\"vertical-align: middle;\" /> <strong>{$lang->none}</strong></label></dt>

	</dl>

	</dl>

	<script type=\"text/javascript\">
checkAction('groups');
</script>";

	<script type=\"text/javascript\">
checkAction('groups');
</script>";

Zeile 538Zeile 543
	{
$forum_checked['none'] = 'checked="checked"';
}

	{
$forum_checked['none'] = 'checked="checked"';
}





	$forums_select_code = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"forums\" value=\"all\" {$forum_checked['all']} class=\"forums_forums_groups_check\" onclick=\"checkAction('forums');\" style=\"vertical-align: middle;\" /> <strong>{$lang->all_forums}</strong></label></dt>

	$forums_select_code = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"forums\" value=\"all\" {$forum_checked['all']} class=\"forums_forums_groups_check\" onclick=\"checkAction('forums');\" style=\"vertical-align: middle;\" /> <strong>{$lang->all_forums}</strong></label></dt>

Zeile 556Zeile 561
	<script type=\"text/javascript\">
checkAction('forums');
</script>";

	<script type=\"text/javascript\">
checkAction('forums');
</script>";

 

$mybb->input['forcedownload'] = $mybb->get_input('forcedownload', MyBB::INPUT_INT);


$form_container = new FormContainer($lang->edit_attachment_type);
$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');


$form_container = new FormContainer($lang->edit_attachment_type);
$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');

Zeile 564Zeile 571
	$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->output_row($lang->enabled, '', $form->generate_yes_no_radio('enabled', $mybb->input['enabled']), 'enabled');

	$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->output_row($lang->enabled, '', $form->generate_yes_no_radio('enabled', $mybb->input['enabled']), 'enabled');

 
	$form_container->output_row($lang->forcedownload, $lang->forcedownload_desc, $form->generate_yes_no_radio('forcedownload', $mybb->input['forcedownload']), 'forcedownload');

	$form_container->output_row($lang->available_to_groups, '', $groups_select_code, '', array(), array('id' => 'row_groups'));
$form_container->output_row($lang->available_in_forums, '', $forums_select_code, '', array(), array('id' => 'row_forums'));
$form_container->output_row($lang->avatar_file, $lang->avatar_file_desc, $form->generate_yes_no_radio('avatarfile', $mybb->input['avatarfile']), 'avatarfile');

	$form_container->output_row($lang->available_to_groups, '', $groups_select_code, '', array(), array('id' => 'row_groups'));
$form_container->output_row($lang->available_in_forums, '', $forums_select_code, '', array(), array('id' => 'row_forums'));
$form_container->output_row($lang->avatar_file, $lang->avatar_file_desc, $form->generate_yes_no_radio('avatarfile', $mybb->input['avatarfile']), 'avatarfile');

Zeile 580Zeile 588

if($mybb->input['action'] == "delete")
{


if($mybb->input['action'] == "delete")
{

	if($mybb->input['no'])

	if($mybb->get_input('no'))

	{
admin_redirect("index.php?module=config-attachment_types");
}

	{
admin_redirect("index.php?module=config-attachment_types");
}

Zeile 618Zeile 626

if($mybb->input['action'] == 'toggle_status')
{


if($mybb->input['action'] == 'toggle_status')
{

	if(!verify_post_check($mybb->input['my_post_key']))

	if(!verify_post_check($mybb->get_input('my_post_key')))

	{
flash_message($lang->invalid_post_verify_key2, 'error');

	{
flash_message($lang->invalid_post_verify_key2, 'error');

		admin_redirect('index.php?module=config-attachment_types');
}

$atid = $mybb->get_input('atid', MyBB::INPUT_INT);


		admin_redirect('index.php?module=config-attachment_types');
}

$atid = $mybb->get_input('atid', MyBB::INPUT_INT);


	$query = $db->simple_select('attachtypes', '*', "atid='{$atid}'");
$attachment_type = $db->fetch_array($query);


	$query = $db->simple_select('attachtypes', '*', "atid='{$atid}'");
$attachment_type = $db->fetch_array($query);


Zeile 643Zeile 651
	{
$update_array['enabled'] = 0;
$phrase = $lang->success_deactivated_attachment_type;

	{
$update_array['enabled'] = 0;
$phrase = $lang->success_deactivated_attachment_type;

	}


	}


	$plugins->run_hooks('admin_config_attachment_types_toggle_status_commit');

	$plugins->run_hooks('admin_config_attachment_types_toggle_status_commit');





	$db->update_query('attachtypes', $update_array, "atid='{$atid}'");

$cache->update_attachtypes();

	$db->update_query('attachtypes', $update_array, "atid='{$atid}'");

$cache->update_attachtypes();





	// Log admin action
log_admin_action($atid, $attachment_type['extension'], $update_array['enabled']);


	// Log admin action
log_admin_action($atid, $attachment_type['extension'], $update_array['enabled']);


Zeile 675Zeile 683
	$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');

 

$query = $db->simple_select("attachtypes", "COUNT(atid) AS attachtypes");
$total_rows = $db->fetch_field($query, "attachtypes");

$pagenum = $mybb->get_input('page', MyBB::INPUT_INT);
if($pagenum)
{
$start = ($pagenum - 1) * 20;
$pages = ceil($total_rows / 20);
if($pagenum > $pages)
{
$start = 0;
$pagenum = 1;
}
}
else
{
$start = 0;
$pagenum = 1;
}


$table = new Table;
$table->construct_header($lang->extension, array("colspan" => 2));


$table = new Table;
$table->construct_header($lang->extension, array("colspan" => 2));

Zeile 683Zeile 711
	$table->construct_header($lang->maximum_size, array("class" => "align_center"));
$table->construct_header($lang->controls, array("class" => "align_center"));


	$table->construct_header($lang->maximum_size, array("class" => "align_center"));
$table->construct_header($lang->controls, array("class" => "align_center"));


	$query = $db->simple_select("attachtypes", "*", "", array('order_by' => 'extension'));

	$query = $db->simple_select("attachtypes", "*", "", array('limit_start' => $start, 'limit' => 20, 'order_by' => 'extension'));

	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

Zeile 742Zeile 770
	}

$table->output($lang->attachment_types);

	}

$table->output($lang->attachment_types);

 

echo "<br />".draw_admin_pagination($pagenum, "20", $total_rows, "index.php?module=config-attachment_types&amp;page={page}");


$page->output_footer();
}


$page->output_footer();
}