Vergleich admin/modules/config/mod_tools.php - 1.4.0 - 1.4.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: mod_tools.php 3790 2008-04-23 22:50:33Z Tikitiki $

 * $Id: mod_tools.php 5379 2011-02-21 11:06:42Z Tomm $

 */



 */



Zeile 175Zeile 175
		
if($mybb->input['forum_type'] == 2)
{

		
if($mybb->input['forum_type'] == 2)
{

 
			$forum_checked[1] = '';
$forum_checked[2] = "checked=\"checked\"";


			if(count($mybb->input['forum_1_forums']) < 1)
{
$errors[] = $lang->error_no_forums_selected;
}

			if(count($mybb->input['forum_1_forums']) < 1)
{
$errors[] = $lang->error_no_forums_selected;
}

		}

		}

		else
{

		else
{

 
			$forum_checked[1] = "checked=\"checked\"";
$forum_checked[2] = '';


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

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

		}


		}


		
if($mybb->input['approvethread'] != '' && $mybb->input['approvethread'] != 'approve' && $mybb->input['approvethread'] != 'unapprove' && $mybb->input['approvethread'] != 'toggle')
{
$mybb->input['approvethread'] = '';

		
if($mybb->input['approvethread'] != '' && $mybb->input['approvethread'] != 'approve' && $mybb->input['approvethread'] != 'unapprove' && $mybb->input['approvethread'] != 'toggle')
{
$mybb->input['approvethread'] = '';

		}

		}

		
if($mybb->input['openthread'] != '' && $mybb->input['openthread'] != 'open' && $mybb->input['openthread'] != 'close' && $mybb->input['openthread'] != 'toggle')
{

		
if($mybb->input['openthread'] != '' && $mybb->input['openthread'] != 'open' && $mybb->input['openthread'] != 'close' && $mybb->input['openthread'] != 'toggle')
{

Zeile 197Zeile 203
		}

if($mybb->input['move_type'] == 2)

		}

if($mybb->input['move_type'] == 2)

		{




		{
$move_checked[1] = '';
$move_checked[2] = "checked=\"checked\"";


			if(!$mybb->input['move_1_forum'])
{
$errors[] = $lang->error_no_move_forum_selected;

			if(!$mybb->input['move_1_forum'])
{
$errors[] = $lang->error_no_move_forum_selected;

			}


			}


			if($mybb->input['move_2_redirect'] != 1 && $mybb->input['move_2_redirect'] != 0)
{
$mybb->input['move_2_redirect'] = 0;

			if($mybb->input['move_2_redirect'] != 1 && $mybb->input['move_2_redirect'] != 0)
{
$mybb->input['move_2_redirect'] = 0;

Zeile 211Zeile 220
			if(!isset($mybb->input['move_3_redirecttime']))
{
$mybb->input['move_3_redirecttime'] = '';

			if(!isset($mybb->input['move_3_redirecttime']))
{
$mybb->input['move_3_redirecttime'] = '';

			}
}

			}
}

		else

		else

		{




		{
$move_checked[1] = "checked=\"checked\"";
$move_checked[2] = '';


			$mybb->input['move_1_forum'] = '';
$mybb->input['move_2_redirect'] = 0;
$mybb->input['move_3_redirecttime'] = '';
}

if($mybb->input['copy_type'] == 2)

			$mybb->input['move_1_forum'] = '';
$mybb->input['move_2_redirect'] = 0;
$mybb->input['move_3_redirecttime'] = '';
}

if($mybb->input['copy_type'] == 2)

		{




		{
$copy_checked[1] = '';
$copy_checked[2] = "checked=\"checked\"";


			if(!$mybb->input['copy_1_forum'])
{
$errors[] = $lang->error_no_copy_forum_selected;

			if(!$mybb->input['copy_1_forum'])
{
$errors[] = $lang->error_no_copy_forum_selected;

Zeile 229Zeile 244
		}
else
{

		}
else
{

 
			$copy_checked[1] = "checked=\"checked\"";
$copy_checked[2] = '';


			$mybb->input['copy_1_forum'] = '';
}


			$mybb->input['copy_1_forum'] = '';
}


Zeile 249Zeile 267
				'addreply' => $mybb->input['newreply'],
'replysubject' => $mybb->input['newreplysubject']
);

				'addreply' => $mybb->input['newreply'],
'replysubject' => $mybb->input['newreplysubject']
);

			

			

			$update_tool['type'] = 't';
$update_tool['threadoptions'] = $db->escape_string(serialize($thread_options));
$update_tool['name'] = $db->escape_string($mybb->input['title']);

			$update_tool['type'] = 't';
$update_tool['threadoptions'] = $db->escape_string(serialize($thread_options));
$update_tool['name'] = $db->escape_string($mybb->input['title']);

Zeile 281Zeile 299
	$page->output_header($lang->mod_tools." - ".$lang->edit_thread_tool);

$form = new Form("index.php?module=config/mod_tools&amp;action=edit_thread_tool", 'post');

	$page->output_header($lang->mod_tools." - ".$lang->edit_thread_tool);

$form = new Form("index.php?module=config/mod_tools&amp;action=edit_thread_tool", 'post');

	echo $form->generate_hidden_field("tid", $mybb->input['tid']);

if($errors)
{
$page->output_inline_error($errors);
}
else
{
$query = $db->simple_select("modtools", "*", "tid = '{$mybb->input['tid']}'");
$modtool = $db->fetch_array($query);
$thread_options = unserialize($modtool['threadoptions']);

$mybb->input['title'] = $modtool['name'];
$mybb->input['description'] = $modtool['description'];
$mybb->input['forum_1_forums'] = explode(",", $modtool['forums']);

if(!$modtool['forums'] || $modtool['forums'] == -1)
{
$forum_checked[1] = "checked=\"checked\"";
$forum_checked[2] = '';
}
else
{
$forum_checked[1] = '';
$forum_checked[2] = "checked=\"checked\"";
}

$mybb->input['approvethread'] = $thread_options['approvethread'];
$mybb->input['openthread'] = $thread_options['openthread'];
$mybb->input['move_1_forum'] = $thread_options['movethread'];

	echo $form->generate_hidden_field("tid", $mybb->input['tid']);

if($errors)
{
$page->output_inline_error($errors);
}
else
{
$query = $db->simple_select("modtools", "*", "tid = '{$mybb->input['tid']}'");
$modtool = $db->fetch_array($query);
$thread_options = unserialize($modtool['threadoptions']);

$mybb->input['title'] = $modtool['name'];
$mybb->input['description'] = $modtool['description'];
$mybb->input['forum_1_forums'] = explode(",", $modtool['forums']);

if(!$modtool['forums'] || $modtool['forums'] == -1)
{
$forum_checked[1] = "checked=\"checked\"";
$forum_checked[2] = '';
}
else
{
$forum_checked[1] = '';
$forum_checked[2] = "checked=\"checked\"";
}

$mybb->input['approvethread'] = $thread_options['approvethread'];
$mybb->input['openthread'] = $thread_options['openthread'];
$mybb->input['move_1_forum'] = $thread_options['movethread'];

		$mybb->input['move_2_redirect'] = $thread_options['movethreadredirect'];
$mybb->input['move_3_redirecttime'] = $thread_options['movethreadredirectexpire'];


		$mybb->input['move_2_redirect'] = $thread_options['movethreadredirect'];
$mybb->input['move_3_redirecttime'] = $thread_options['movethreadredirectexpire'];


Zeile 318Zeile 336
		{
$move_checked[1] = "checked=\"checked\"";
$move_checked[2] = '';

		{
$move_checked[1] = "checked=\"checked\"";
$move_checked[2] = '';

		}

		}

		else
{
$move_checked[1] = '';

		else
{
$move_checked[1] = '';

Zeile 341Zeile 359
		$mybb->input['mergethreads'] = $thread_options['mergethreads'];
$mybb->input['deletepoll'] = $thread_options['deletepoll'];
$mybb->input['removeredirects'] = $thread_options['removeredirects'];

		$mybb->input['mergethreads'] = $thread_options['mergethreads'];
$mybb->input['deletepoll'] = $thread_options['deletepoll'];
$mybb->input['removeredirects'] = $thread_options['removeredirects'];

		$mybb->input['newsubject'] = $thread_options['newsubject'];
$mybb->input['newreply'] = $thread_options['addreply'];
$mybb->input['newreplysubject'] = $thread_options['replysubject'];
}

$form_container = new FormContainer($lang->general_options);
$form_container->output_row($lang->name." <em>*</em>", '', $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->short_description." <em>*</em>", '', $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');


$actions = "<script type=\"text/javascript\">
function checkAction(id)
{
var checked = '';

$$('.'+id+'s_check').each(function(e)
{
if(e.checked == true)
{
checked = e.value;
}
});
$$('.'+id+'s').each(function(e)
{
Element.hide(e);
});
if($(id+'_'+checked))
{
Element.show(id+'_'+checked);
}
}
</script>
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"forum_type\" value=\"1\" {$forum_checked[1]} class=\"forums_check\" onclick=\"checkAction('forum');\" style=\"vertical-align: middle;\" /> <strong>{$lang->all_forums}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"forum_type\" value=\"2\" {$forum_checked[2]} class=\"forums_check\" onclick=\"checkAction('forum');\" style=\"vertical-align: middle;\" /> <strong>{$lang->select_forums}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"forum_2\" class=\"forums\">
<table cellpadding=\"4\">
<tr>
<td valign=\"top\"><small>{$lang->forums_colon}</small></td>
<td>".$form->generate_forum_select('forum_1_forums[]', $mybb->input['forum_1_forums'], array('multiple' => true, 'size' => 5))."</td>
</tr>
</table>
</dd>
</dl>
<script type=\"text/javascript\">
checkAction('forum');
</script>";
$form_container->output_row($lang->available_in_forums." <em>*</em>", '', $actions);
$form_container->end();

$approve_unapprove = array(
'' => $lang->no_change,
'approve' => $lang->approve,
'unapprove' => $lang->unapprove,
'toggle' => $lang->toggle
);

$open_close = array(
'' => $lang->no_change,
'open' => $lang->open,
'close' => $lang->close,
'toggle' => $lang->toggle
);

$form_container = new FormContainer($lang->thread_moderation);
$form_container->output_row($lang->approve_unapprove." <em>*</em>", '', $form->generate_select_box('approvethread', $approve_unapprove, $mybb->input['approvethread'], array('id' => 'approvethread')), 'approvethread');
$form_container->output_row($lang->open_close_thread." <em>*</em>", '', $form->generate_select_box('openthread', $open_close, $mybb->input['openthread'], array('id' => 'openthread')), 'openthread');


$actions = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"move_type\" value=\"1\" {$move_checked[1]} class=\"moves_check\" onclick=\"checkAction('move');\" style=\"vertical-align: middle;\" /> <strong>{$lang->do_not_move_thread}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"move_type\" value=\"2\" {$move_checked[2]} class=\"moves_check\" onclick=\"checkAction('move');\" style=\"vertical-align: middle;\" /> <strong>{$lang->move_thread}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"move_2\" class=\"moves\">
<table cellpadding=\"4\">
<tr>
<td><small>{$lang->forum_to_move_to}</small></td>
<td>".$form->generate_forum_select('move_1_forum', $mybb->input['move_1_forum'])."</td>
</tr>
<tr>
<td><small>{$lang->leave_redirect}</small></td>
<td>".$form->generate_yes_no_radio('move_2_redirect', $mybb->input['move_2_redirect'], array('style' => 'width: 2em;'))."</td>
</tr>
<tr>
<td><small>{$lang->delete_redirect_after}</small></td>
<td>".$form->generate_text_box('move_3_redirecttime', $mybb->input['move_3_redirecttime'], array('style' => 'width: 2em;'))." {$lang->days}</td>
</tr>
</table>
</dd>
</dl>
<script type=\"text/javascript\">
checkAction('move');
</script>";
$form_container->output_row($lang->move_thread." <em>*</em>", $lang->move_thread_desc, $actions);

$actions = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"copy_type\" value=\"1\" {$copy_checked[1]} class=\"copys_check\" onclick=\"checkAction('copy');\" style=\"vertical-align: middle;\" /> <strong>{$lang->do_not_copy_thread}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"copy_type\" value=\"2\" {$copy_checked[2]} class=\"copys_check\" onclick=\"checkAction('copy');\" style=\"vertical-align: middle;\" /> <strong>{$lang->copy_thread}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"copy_2\" class=\"copys\">
<table cellpadding=\"4\">
<tr>
<td><small>{$lang->forum_to_copy_to}</small></td>
<td>".$form->generate_forum_select('copy_1_forum', $mybb->input['copy_1_forum'])."</td>
</tr>
</table>

		$mybb->input['newsubject'] = $thread_options['newsubject'];
$mybb->input['newreply'] = $thread_options['addreply'];
$mybb->input['newreplysubject'] = $thread_options['replysubject'];
}

$form_container = new FormContainer($lang->general_options);
$form_container->output_row($lang->name." <em>*</em>", '', $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->short_description." <em>*</em>", '', $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');


$actions = "<script type=\"text/javascript\">
function checkAction(id)
{
var checked = '';

$$('.'+id+'s_check').each(function(e)
{
if(e.checked == true)
{
checked = e.value;
}
});
$$('.'+id+'s').each(function(e)
{
Element.hide(e);
});
if($(id+'_'+checked))
{
Element.show(id+'_'+checked);
}
}
</script>
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"forum_type\" value=\"1\" {$forum_checked[1]} class=\"forums_check\" onclick=\"checkAction('forum');\" style=\"vertical-align: middle;\" /> <strong>{$lang->all_forums}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"forum_type\" value=\"2\" {$forum_checked[2]} class=\"forums_check\" onclick=\"checkAction('forum');\" style=\"vertical-align: middle;\" /> <strong>{$lang->select_forums}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"forum_2\" class=\"forums\">
<table cellpadding=\"4\">
<tr>
<td valign=\"top\"><small>{$lang->forums_colon}</small></td>
<td>".$form->generate_forum_select('forum_1_forums[]', $mybb->input['forum_1_forums'], array('multiple' => true, 'size' => 5))."</td>
</tr>
</table>
</dd>
</dl>
<script type=\"text/javascript\">
checkAction('forum');
</script>";
$form_container->output_row($lang->available_in_forums." <em>*</em>", '', $actions);
$form_container->end();

$approve_unapprove = array(
'' => $lang->no_change,
'approve' => $lang->approve,
'unapprove' => $lang->unapprove,
'toggle' => $lang->toggle
);

$open_close = array(
'' => $lang->no_change,
'open' => $lang->open,
'close' => $lang->close,
'toggle' => $lang->toggle
);

$form_container = new FormContainer($lang->thread_moderation);
$form_container->output_row($lang->approve_unapprove." <em>*</em>", '', $form->generate_select_box('approvethread', $approve_unapprove, $mybb->input['approvethread'], array('id' => 'approvethread')), 'approvethread');
$form_container->output_row($lang->open_close_thread." <em>*</em>", '', $form->generate_select_box('openthread', $open_close, $mybb->input['openthread'], array('id' => 'openthread')), 'openthread');


$actions = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"move_type\" value=\"1\" {$move_checked[1]} class=\"moves_check\" onclick=\"checkAction('move');\" style=\"vertical-align: middle;\" /> <strong>{$lang->do_not_move_thread}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"move_type\" value=\"2\" {$move_checked[2]} class=\"moves_check\" onclick=\"checkAction('move');\" style=\"vertical-align: middle;\" /> <strong>{$lang->move_thread}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"move_2\" class=\"moves\">
<table cellpadding=\"4\">
<tr>
<td><small>{$lang->forum_to_move_to}</small></td>
<td>".$form->generate_forum_select('move_1_forum', $mybb->input['move_1_forum'])."</td>
</tr>
<tr>
<td><small>{$lang->leave_redirect}</small></td>
<td>".$form->generate_yes_no_radio('move_2_redirect', $mybb->input['move_2_redirect'], array('style' => 'width: 2em;'))."</td>
</tr>
<tr>
<td><small>{$lang->delete_redirect_after}</small></td>
<td>".$form->generate_text_box('move_3_redirecttime', $mybb->input['move_3_redirecttime'], array('style' => 'width: 2em;'))." {$lang->days}</td>
</tr>
</table>
</dd>
</dl>
<script type=\"text/javascript\">
checkAction('move');
</script>";
$form_container->output_row($lang->move_thread." <em>*</em>", $lang->move_thread_desc, $actions);

$actions = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"copy_type\" value=\"1\" {$copy_checked[1]} class=\"copys_check\" onclick=\"checkAction('copy');\" style=\"vertical-align: middle;\" /> <strong>{$lang->do_not_copy_thread}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"copy_type\" value=\"2\" {$copy_checked[2]} class=\"copys_check\" onclick=\"checkAction('copy');\" style=\"vertical-align: middle;\" /> <strong>{$lang->copy_thread}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"copy_2\" class=\"copys\">
<table cellpadding=\"4\">
<tr>
<td><small>{$lang->forum_to_copy_to}</small></td>
<td>".$form->generate_forum_select('copy_1_forum', $mybb->input['copy_1_forum'])."</td>
</tr>
</table>

		</dd>
</dl>
<script type=\"text/javascript\">

		</dd>
</dl>
<script type=\"text/javascript\">

Zeile 480Zeile 498
	if($mybb->request_method == 'post')
{
if(trim($mybb->input['title']) == "")

	if($mybb->request_method == 'post')
{
if(trim($mybb->input['title']) == "")

		{

		{

			$errors[] = $lang->error_missing_title;

			$errors[] = $lang->error_missing_title;

		}


		}


		if(trim($mybb->input['description']) == "")

		if(trim($mybb->input['description']) == "")

		{

		{

			$errors[] = $lang->error_missing_description;
}

if($mybb->input['forum_type'] == 2)
{

			$errors[] = $lang->error_missing_description;
}

if($mybb->input['forum_type'] == 2)
{

 
			$forum_checked[1] = '';
$forum_checked[2] = "checked=\"checked\"";


			if(count($mybb->input['forum_1_forums']) < 1)
{
$errors[] = $lang->error_no_forums_selected;

			if(count($mybb->input['forum_1_forums']) < 1)
{
$errors[] = $lang->error_no_forums_selected;

			}
}
else
{
$mybb->input['forum_1_forums'] = '';

			}





		}

		}

		









		else
{
$forum_checked[1] = "checked=\"checked\"";
$forum_checked[2] = '';

$mybb->input['forum_1_forums'] = '';
}



		if($mybb->input['approvethread'] != '' && $mybb->input['approvethread'] != 'approve' && $mybb->input['approvethread'] != 'unapprove' && $mybb->input['approvethread'] != 'toggle')

		if($mybb->input['approvethread'] != '' && $mybb->input['approvethread'] != 'approve' && $mybb->input['approvethread'] != 'unapprove' && $mybb->input['approvethread'] != 'toggle')

		{

		{

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

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

		}

		}

		
if($mybb->input['openthread'] != '' && $mybb->input['openthread'] != 'open' && $mybb->input['openthread'] != 'close' && $mybb->input['openthread'] != 'toggle')
{

		
if($mybb->input['openthread'] != '' && $mybb->input['openthread'] != 'open' && $mybb->input['openthread'] != 'close' && $mybb->input['openthread'] != 'toggle')
{

Zeile 514Zeile 538
		
if($mybb->input['move_type'] == 2)
{

		
if($mybb->input['move_type'] == 2)
{

 
			$move_checked[1] = '';
$move_checked[2] = "checked=\"checked\"";


			if(!$mybb->input['move_1_forum'])
{
$errors[] = $lang->error_no_move_forum_selected;

			if(!$mybb->input['move_1_forum'])
{
$errors[] = $lang->error_no_move_forum_selected;

Zeile 521Zeile 548
		}
else
{

		}
else
{

 
			$move_checked[1] = "checked=\"checked\"";
$move_checked[2] = '';


			$mybb->input['move_1_forum'] = '';
$mybb->input['move_2_redirect'] = 0;
$mybb->input['move_3_redirecttime'] = '';

			$mybb->input['move_1_forum'] = '';
$mybb->input['move_2_redirect'] = 0;
$mybb->input['move_3_redirecttime'] = '';

Zeile 528Zeile 558
		
if($mybb->input['copy_type'] == 2)
{

		
if($mybb->input['copy_type'] == 2)
{

 
			$copy_checked[1] = '';
$copy_checked[2] = "checked=\"checked\"";


			if(!$mybb->input['copy_1_forum'])
{
$errors[] = $lang->error_no_copy_forum_selected;

			if(!$mybb->input['copy_1_forum'])
{
$errors[] = $lang->error_no_copy_forum_selected;

			}

			}

		}
else
{

		}
else
{

 
			$copy_checked[1] = "checked=\"checked\"";
$copy_checked[2] = '';


			$mybb->input['copy_1_forum'] = '';
}


			$mybb->input['copy_1_forum'] = '';
}


Zeile 561Zeile 597
			$new_tool['name'] = $db->escape_string($mybb->input['title']);
$new_tool['description'] = $db->escape_string($mybb->input['description']);
$new_tool['forums'] = '';

			$new_tool['name'] = $db->escape_string($mybb->input['title']);
$new_tool['description'] = $db->escape_string($mybb->input['description']);
$new_tool['forums'] = '';

 
			$new_tool['postoptions'] = '';

			
if($mybb->input['forum_type'] == 2)
{

			
if($mybb->input['forum_type'] == 2)
{

Zeile 575Zeile 612
			}
else
{

			}
else
{

				$new_tools['forums'] = "-1";

				$new_tool['forums'] = "-1";

			}

$tid = $db->insert_query("modtools", $new_tool);

$plugins->run_hooks("admin_config_mod_tools_add_thread_tool_commit");

			}

$tid = $db->insert_query("modtools", $new_tool);

$plugins->run_hooks("admin_config_mod_tools_add_thread_tool_commit");


// Log admin action


// Log admin action

			log_admin_action($tid, $mybb->input['title']);

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

			log_admin_action($tid, $mybb->input['title']);

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

	}


	}


	$page->add_breadcrumb_item($lang->add_new_thread_tool);
$page->output_header($lang->mod_tools." - ".$lang->add_new_thread_tool);

$sub_tabs['thread_tools'] = array(
'title' => $lang->thread_tools,
'link' => "index.php?module=config/mod_tools"

	$page->add_breadcrumb_item($lang->add_new_thread_tool);
$page->output_header($lang->mod_tools." - ".$lang->add_new_thread_tool);

$sub_tabs['thread_tools'] = array(
'title' => $lang->thread_tools,
'link' => "index.php?module=config/mod_tools"

	);

	);

	$sub_tabs['add_thread_tool'] = array(
'title'=> $lang->add_new_thread_tool,
'link' => "index.php?module=config/mod_tools&amp;action=add_thread_tool",

	$sub_tabs['add_thread_tool'] = array(
'title'=> $lang->add_new_thread_tool,
'link' => "index.php?module=config/mod_tools&amp;action=add_thread_tool",

Zeile 643Zeile 680
		$mybb->input['newsubject'] = '{subject}';
$mybb->input['newreply'] = '';
$mybb->input['newreplysubject'] = '{subject}';

		$mybb->input['newsubject'] = '{subject}';
$mybb->input['newreply'] = '';
$mybb->input['newreplysubject'] = '{subject}';

	}

$form_container = new FormContainer($lang->general_options);
$form_container->output_row($lang->name." <em>*</em>", '', $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->short_description." <em>*</em>", '', $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');


$actions = "<script type=\"text/javascript\">
function checkAction(id)
{
var checked = '';

$$('.'+id+'s_check').each(function(e)
{
if(e.checked == true)
{
checked = e.value;
}
});
$$('.'+id+'s').each(function(e)
{
Element.hide(e);
});
if($(id+'_'+checked))
{
Element.show(id+'_'+checked);
}
}
</script>
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"forum_type\" value=\"1\" {$forum_checked[1]} class=\"forums_check\" onclick=\"checkAction('forum');\" style=\"vertical-align: middle;\" /> <strong>{$lang->all_forums}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"forum_type\" value=\"2\" {$forum_checked[2]} class=\"forums_check\" onclick=\"checkAction('forum');\" style=\"vertical-align: middle;\" /> <strong>{$lang->select_forums}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"forum_2\" class=\"forums\">
<table cellpadding=\"4\">
<tr>
<td valign=\"top\"><small>{$lang->forums_colon}</small></td>
<td>".$form->generate_forum_select('forum_1_forums[]', $mybb->input['forum_1_forums'], array('multiple' => true, 'size' => 5))."</td>
</tr>
</table>
</dd>
</dl>
<script type=\"text/javascript\">
checkAction('forum');
</script>";
$form_container->output_row($lang->available_in_forums." <em>*</em>", '', $actions);
$form_container->end();

$approve_unapprove = array(
'' => $lang->no_change,
'approve' => $lang->approve,
'unapprove' => $lang->unapprove,
'toggle' => $lang->toggle
);

$open_close = array(
'' => $lang->no_change,
'open' => $lang->open,
'close' => $lang->close,
'toggle' => $lang->toggle
);

$form_container = new FormContainer($lang->thread_moderation);
$form_container->output_row($lang->approve_unapprove." <em>*</em>", '', $form->generate_select_box('approvethread', $approve_unapprove, $mybb->input['approvethread'], array('id' => 'approvethread')), 'approvethread');
$form_container->output_row($lang->open_close_thread." <em>*</em>", '', $form->generate_select_box('openthread', $open_close, $mybb->input['openthread'], array('id' => 'openthread')), 'openthread');


$actions = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"move_type\" value=\"1\" {$move_checked[1]} class=\"moves_check\" onclick=\"checkAction('move');\" style=\"vertical-align: middle;\" /> <strong>{$lang->do_not_move_thread}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"move_type\" value=\"2\" {$move_checked[2]} class=\"moves_check\" onclick=\"checkAction('move');\" style=\"vertical-align: middle;\" /> <strong>{$lang->move_thread}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"move_2\" class=\"moves\">
<table cellpadding=\"4\">
<tr>
<td><small>{$lang->forum_to_move_to}</small></td>
<td>".$form->generate_forum_select('move_1_forum', $mybb->input['move_1_forum'])."</td>
</tr>

	}

$form_container = new FormContainer($lang->general_options);
$form_container->output_row($lang->name." <em>*</em>", '', $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->short_description." <em>*</em>", '', $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');


$actions = "<script type=\"text/javascript\">
function checkAction(id)
{
var checked = '';

$$('.'+id+'s_check').each(function(e)
{
if(e.checked == true)
{
checked = e.value;
}
});
$$('.'+id+'s').each(function(e)
{
Element.hide(e);
});
if($(id+'_'+checked))
{
Element.show(id+'_'+checked);
}
}
</script>
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"forum_type\" value=\"1\" {$forum_checked[1]} class=\"forums_check\" onclick=\"checkAction('forum');\" style=\"vertical-align: middle;\" /> <strong>{$lang->all_forums}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"forum_type\" value=\"2\" {$forum_checked[2]} class=\"forums_check\" onclick=\"checkAction('forum');\" style=\"vertical-align: middle;\" /> <strong>{$lang->select_forums}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"forum_2\" class=\"forums\">
<table cellpadding=\"4\">
<tr>
<td valign=\"top\"><small>{$lang->forums_colon}</small></td>
<td>".$form->generate_forum_select('forum_1_forums[]', $mybb->input['forum_1_forums'], array('multiple' => true, 'size' => 5))."</td>
</tr>
</table>
</dd>
</dl>
<script type=\"text/javascript\">
checkAction('forum');
</script>";
$form_container->output_row($lang->available_in_forums." <em>*</em>", '', $actions);
$form_container->end();

$approve_unapprove = array(
'' => $lang->no_change,
'approve' => $lang->approve,
'unapprove' => $lang->unapprove,
'toggle' => $lang->toggle
);

$open_close = array(
'' => $lang->no_change,
'open' => $lang->open,
'close' => $lang->close,
'toggle' => $lang->toggle
);

$form_container = new FormContainer($lang->thread_moderation);
$form_container->output_row($lang->approve_unapprove." <em>*</em>", '', $form->generate_select_box('approvethread', $approve_unapprove, $mybb->input['approvethread'], array('id' => 'approvethread')), 'approvethread');
$form_container->output_row($lang->open_close_thread." <em>*</em>", '', $form->generate_select_box('openthread', $open_close, $mybb->input['openthread'], array('id' => 'openthread')), 'openthread');


$actions = "
<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\">
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"move_type\" value=\"1\" {$move_checked[1]} class=\"moves_check\" onclick=\"checkAction('move');\" style=\"vertical-align: middle;\" /> <strong>{$lang->do_not_move_thread}</strong></label></dt>
<dt><label style=\"display: block;\"><input type=\"radio\" name=\"move_type\" value=\"2\" {$move_checked[2]} class=\"moves_check\" onclick=\"checkAction('move');\" style=\"vertical-align: middle;\" /> <strong>{$lang->move_thread}</strong></label></dt>
<dd style=\"margin-top: 4px;\" id=\"move_2\" class=\"moves\">
<table cellpadding=\"4\">
<tr>
<td><small>{$lang->forum_to_move_to}</small></td>
<td>".$form->generate_forum_select('move_1_forum', $mybb->input['move_1_forum'])."</td>
</tr>

				<tr>
<td><small>{$lang->leave_redirect}</small></td>
<td>".$form->generate_yes_no_radio('move_2_redirect', $mybb->input['move_2_redirect'], array('style' => 'width: 2em;'))."</td>

				<tr>
<td><small>{$lang->leave_redirect}</small></td>
<td>".$form->generate_yes_no_radio('move_2_redirect', $mybb->input['move_2_redirect'], array('style' => 'width: 2em;'))."</td>

Zeile 786Zeile 823
	if($mybb->request_method == 'post')
{
if(trim($mybb->input['title']) == "")

	if($mybb->request_method == 'post')
{
if(trim($mybb->input['title']) == "")

		{

		{

			$errors[] = $lang->error_missing_title;

			$errors[] = $lang->error_missing_title;

		}


		}


		if(trim($mybb->input['description']) == "")

		if(trim($mybb->input['description']) == "")

		{

		{

			$errors[] = $lang->error_missing_description;
}

if($mybb->input['forum_type'] == 2)

			$errors[] = $lang->error_missing_description;
}

if($mybb->input['forum_type'] == 2)

		{

		{

			if(count($mybb->input['forum_1_forums']) < 1)
{
$errors[] = $lang->error_no_forums_selected;

			if(count($mybb->input['forum_1_forums']) < 1)
{
$errors[] = $lang->error_no_forums_selected;

			}
}
else
{

			}
}
else
{

			$mybb->input['forum_1_forums'] = '';
}

			$mybb->input['forum_1_forums'] = '';
}

		

		

		if($mybb->input['approvethread'] != '' && $mybb->input['approvethread'] != 'approve' && $mybb->input['approvethread'] != 'unapprove' && $mybb->input['approvethread'] != 'toggle')

		if($mybb->input['approvethread'] != '' && $mybb->input['approvethread'] != 'approve' && $mybb->input['approvethread'] != 'unapprove' && $mybb->input['approvethread'] != 'toggle')

		{

		{

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

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

		}

		}

		
if($mybb->input['openthread'] != '' && $mybb->input['openthread'] != 'open' && $mybb->input['openthread'] != 'close' && $mybb->input['openthread'] != 'toggle')
{

		
if($mybb->input['openthread'] != '' && $mybb->input['openthread'] != 'open' && $mybb->input['openthread'] != 'close' && $mybb->input['openthread'] != 'toggle')
{

Zeile 820Zeile 857
		if($mybb->input['move_type'] == 2)
{
if(!$mybb->input['move_1_forum'])

		if($mybb->input['move_type'] == 2)
{
if(!$mybb->input['move_1_forum'])

			{

			{

				$errors[] = $lang->error_no_move_forum_selected;

				$errors[] = $lang->error_no_move_forum_selected;

			}
}

			}
}

		else

		else

		{

		{

			$mybb->input['move_1_forum'] = '';
$mybb->input['move_2_redirect'] = 0;
$mybb->input['move_3_redirecttime'] = '';

			$mybb->input['move_1_forum'] = '';
$mybb->input['move_2_redirect'] = 0;
$mybb->input['move_3_redirecttime'] = '';

Zeile 837Zeile 874
			{
$errors[] = $lang->error_no_copy_forum_selected;
}

			{
$errors[] = $lang->error_no_copy_forum_selected;
}

		}

		}

		else

		else

		{

		{

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

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

		}


		}


		if($mybb->input['approveposts'] != '' && $mybb->input['approveposts'] != 'approve' && $mybb->input['approveposts'] != 'unapprove' && $mybb->input['approveposts'] != 'toggle')

		if($mybb->input['approveposts'] != '' && $mybb->input['approveposts'] != 'approve' && $mybb->input['approveposts'] != 'unapprove' && $mybb->input['approveposts'] != 'toggle')

		{

		{

			$mybb->input['approveposts'] = '';
}


			$mybb->input['approveposts'] = '';
}


		if($mybb->input['splitposts'] < -2)
{
$mybb->input['splitposts'] = -1;
}

if($mybb->input['splitpostsclose'] == 1)
{

		if($mybb->input['splitposts'] < -2)
{
$mybb->input['splitposts'] = -1;
}

if($mybb->input['splitpostsclose'] == 1)
{

			$mybb->input['splitpostsclose'] = 'close';

			$mybb->input['splitpostsclose'] = 'close';

		}

		}

		else

		else

		{

		{

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

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

		}

if($mybb->input['splitpostsstick'] == 1)
{
$mybb->input['splitpostsstick'] = 'stick';
}
else
{
$mybb->input['splitpostsstick'] = '';

		}

if($mybb->input['splitpostsstick'] == 1)
{
$mybb->input['splitpostsstick'] = 'stick';
}
else
{
$mybb->input['splitpostsstick'] = '';

		}

if($mybb->input['splitpostsunapprove'] == 1)

		}

if($mybb->input['splitpostsunapprove'] == 1)

Zeile 878Zeile 915
		else
{
$mybb->input['splitpostsunapprove'] = '';

		else
{
$mybb->input['splitpostsunapprove'] = '';

		}

if(!$errors)
{

		}

if(!$errors)
{

			$thread_options = array(
'deletethread' => $mybb->input['deletethread'],
'approvethread' => $mybb->input['approvethread'],

			$thread_options = array(
'deletethread' => $mybb->input['deletethread'],
'approvethread' => $mybb->input['approvethread'],

Zeile 961Zeile 998
		$mybb->input['title'] = $modtool['name'];
$mybb->input['description'] = $modtool['description'];
$mybb->input['forum_1_forums'] = explode(",", $modtool['forums']);

		$mybb->input['title'] = $modtool['name'];
$mybb->input['description'] = $modtool['description'];
$mybb->input['forum_1_forums'] = explode(",", $modtool['forums']);

		

		

		if(!$modtool['forums'] || $modtool['forums'] == -1)

		if(!$modtool['forums'] || $modtool['forums'] == -1)

		{

		{

			$forum_checked[1] = "checked=\"checked\"";
$forum_checked[2] = '';

			$forum_checked[1] = "checked=\"checked\"";
$forum_checked[2] = '';

		}
else

		}
else

		{
$forum_checked[1] = '';
$forum_checked[2] = "checked=\"checked\"";

		{
$forum_checked[1] = '';
$forum_checked[2] = "checked=\"checked\"";

		}

		}

		
$mybb->input['approvethread'] = $thread_options['approvethread'];
$mybb->input['openthread'] = $thread_options['openthread'];
$mybb->input['move_1_forum'] = $thread_options['movethread'];
$mybb->input['move_2_redirect'] = $thread_options['movethreadredirect'];
$mybb->input['move_3_redirecttime'] = $thread_options['movethreadredirectexpire'];

		
$mybb->input['approvethread'] = $thread_options['approvethread'];
$mybb->input['openthread'] = $thread_options['openthread'];
$mybb->input['move_1_forum'] = $thread_options['movethread'];
$mybb->input['move_2_redirect'] = $thread_options['movethreadredirect'];
$mybb->input['move_3_redirecttime'] = $thread_options['movethreadredirectexpire'];

		
if(!$thread_options['movethread'])
{
$move_checked[1] = "checked=\"checked\"";
$move_checked[2] = '';
}
else
{
$move_checked[1] = '';
$move_checked[2] = "checked=\"checked\"";
}


		
if(!$thread_options['movethread'])
{
$move_checked[1] = "checked=\"checked\"";
$move_checked[2] = '';
}
else
{
$move_checked[1] = '';
$move_checked[2] = "checked=\"checked\"";
}


		if(!$thread_options['copythread'])
{
$copy_checked[1] = "checked=\"checked\"";
$copy_checked[2] = '';

		if(!$thread_options['copythread'])
{
$copy_checked[1] = "checked=\"checked\"";
$copy_checked[2] = '';

		}

		}

		else
{
$copy_checked[1] = '';

		else
{
$copy_checked[1] = '';

Zeile 1006Zeile 1043
		$mybb->input['newsubject'] = $thread_options['newsubject'];
$mybb->input['newreply'] = $thread_options['addreply'];
$mybb->input['newreplysubject'] = $thread_options['replysubject'];

		$mybb->input['newsubject'] = $thread_options['newsubject'];
$mybb->input['newreply'] = $thread_options['addreply'];
$mybb->input['newreplysubject'] = $thread_options['replysubject'];

		

		

		if($post_options['splitposts'] == '-1')
{
$do_not_split_checked = ' selected="selected"';
$split_same_checked = '';

		if($post_options['splitposts'] == '-1')
{
$do_not_split_checked = ' selected="selected"';
$split_same_checked = '';

		}

		}

		else if($post_options['splitposts'] == '-2')
{
$do_not_split_checked = '';
$split_same_checked = ' selected="selected"';
}

		else if($post_options['splitposts'] == '-2')
{
$do_not_split_checked = '';
$split_same_checked = ' selected="selected"';
}

		

		

		$mybb->input['deleteposts'] = $post_options['deleteposts'];
$mybb->input['mergeposts'] = $post_options['mergeposts'];
$mybb->input['approveposts'] = $post_options['approveposts'];

if($post_options['splitpostsclose'] == 'close')

		$mybb->input['deleteposts'] = $post_options['deleteposts'];
$mybb->input['mergeposts'] = $post_options['mergeposts'];
$mybb->input['approveposts'] = $post_options['approveposts'];

if($post_options['splitpostsclose'] == 'close')

		{

		{

			$mybb->input['splitpostsclose'] = '1';
}
else

			$mybb->input['splitpostsclose'] = '1';
}
else

Zeile 1074Zeile 1111
            }
});
$$('.'+id+'s').each(function(e)

            }
});
$$('.'+id+'s').each(function(e)

        {

        {

        	Element.hide(e);
});
if($(id+'_'+checked))

        	Element.hide(e);
});
if($(id+'_'+checked))

Zeile 1125Zeile 1162
	$form_container->output_row($lang->split_thread_subject, $lang->split_thread_subject_desc, $form->generate_text_box('splitpostsnewsubject', $mybb->input['splitpostsnewsubject'], array('id' => 'splitpostsnewsubject ')), 'newreplysubject');
$form_container->output_row($lang->add_new_split_reply, $lang->add_new_split_reply_desc, $form->generate_text_area('splitpostsaddreply', $mybb->input['splitpostsaddreply'], array('id' => 'splitpostsaddreply')), 'splitpostsaddreply');
$form_container->output_row($lang->split_reply_subject, $lang->split_reply_subject_desc, $form->generate_text_box('splitpostsreplysubject', $mybb->input['splitpostsreplysubject'], array('id' => 'splitpostsreplysubject')), 'splitpostsreplysubject');

	$form_container->output_row($lang->split_thread_subject, $lang->split_thread_subject_desc, $form->generate_text_box('splitpostsnewsubject', $mybb->input['splitpostsnewsubject'], array('id' => 'splitpostsnewsubject ')), 'newreplysubject');
$form_container->output_row($lang->add_new_split_reply, $lang->add_new_split_reply_desc, $form->generate_text_area('splitpostsaddreply', $mybb->input['splitpostsaddreply'], array('id' => 'splitpostsaddreply')), 'splitpostsaddreply');
$form_container->output_row($lang->split_reply_subject, $lang->split_reply_subject_desc, $form->generate_text_box('splitpostsreplysubject', $mybb->input['splitpostsreplysubject'], array('id' => 'splitpostsreplysubject')), 'splitpostsreplysubject');

	$form_container->end();

	$form_container->end();

	
$open_close = array(
'' => $lang->no_change,

	
$open_close = array(
'' => $lang->no_change,

Zeile 1156Zeile 1193
				<tr>
<td><small>{$lang->delete_redirect_after}</small></td>
<td>".$form->generate_text_box('move_3_redirecttime', $mybb->input['move_3_redirecttime'], array('style' => 'width: 2em;'))." {$lang->days}</td>

				<tr>
<td><small>{$lang->delete_redirect_after}</small></td>
<td>".$form->generate_text_box('move_3_redirecttime', $mybb->input['move_3_redirecttime'], array('style' => 'width: 2em;'))." {$lang->days}</td>

				</tr>
</table>
</dd>
</dl>

				</tr>
</table>
</dd>
</dl>

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

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

Zeile 1217Zeile 1254
		
if($mybb->input['forum_type'] == 2)
{

		
if($mybb->input['forum_type'] == 2)
{

 
			$forum_checked[1] = '';
$forum_checked[2] = "checked=\"checked\"";


			if(count($mybb->input['forum_1_forums']) < 1)
{
$errors[] = $lang->error_no_forums_selected;

			if(count($mybb->input['forum_1_forums']) < 1)
{
$errors[] = $lang->error_no_forums_selected;

			}
}
else
{
$mybb->input['forum_1_forums'] = '';
}






			}
}
else
{
$forum_checked[1] = "checked=\"checked\"";
$forum_checked[2] = '';

$mybb->input['forum_1_forums'] = '';
}



		if($mybb->input['approvethread'] != '' && $mybb->input['approvethread'] != 'approve' && $mybb->input['approvethread'] != 'unapprove' && $mybb->input['approvethread'] != 'toggle')
{
$mybb->input['approvethread'] = '';

		if($mybb->input['approvethread'] != '' && $mybb->input['approvethread'] != 'approve' && $mybb->input['approvethread'] != 'unapprove' && $mybb->input['approvethread'] != 'toggle')
{
$mybb->input['approvethread'] = '';

		}


		}


		if($mybb->input['openthread'] != '' && $mybb->input['openthread'] != 'open' && $mybb->input['openthread'] != 'close' && $mybb->input['openthread'] != 'toggle')

		if($mybb->input['openthread'] != '' && $mybb->input['openthread'] != 'open' && $mybb->input['openthread'] != 'close' && $mybb->input['openthread'] != 'toggle')

		{

		{

			$mybb->input['openthread'] = '';
}

if($mybb->input['move_type'] == 2)
{

			$mybb->input['openthread'] = '';
}

if($mybb->input['move_type'] == 2)
{

 
			$move_checked[1] = '';
$move_checked[2] = "checked=\"checked\"";


			if(!$mybb->input['move_1_forum'])
{
$errors[] = $lang->error_no_move_forum_selected;
}

			if(!$mybb->input['move_1_forum'])
{
$errors[] = $lang->error_no_move_forum_selected;
}

		}
else
{




		}
else
{
$move_checked[1] = "checked=\"checked\"";
$move_checked[2] = '';


			$mybb->input['move_1_forum'] = '';
$mybb->input['move_2_redirect'] = 0;
$mybb->input['move_3_redirecttime'] = '';

			$mybb->input['move_1_forum'] = '';
$mybb->input['move_2_redirect'] = 0;
$mybb->input['move_3_redirecttime'] = '';

		}

		}

		
if($mybb->input['copy_type'] == 2)
{

		
if($mybb->input['copy_type'] == 2)
{

 
			$copy_checked[1] = '';
$copy_checked[2] = "checked=\"checked\"";


			if(!$mybb->input['copy_1_forum'])
{
$errors[] = $lang->error_no_copy_forum_selected;

			if(!$mybb->input['copy_1_forum'])
{
$errors[] = $lang->error_no_copy_forum_selected;

Zeile 1261Zeile 1313
		}
else
{

		}
else
{

 
			$copy_checked[1] = 'checked=\"checked\"';
$copy_checked[2] = '';


			$mybb->input['copy_1_forum'] = '';
}


			$mybb->input['copy_1_forum'] = '';
}