Vergleich admin/modules/config/calendars.php - 1.8.3 - 1.8.36

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 26Zeile 26
	$sub_tabs['add_calendar'] = array(
'title' => $lang->add_calendar,
'link' => "index.php?module=config-calendars&action=add",

	$sub_tabs['add_calendar'] = array(
'title' => $lang->add_calendar,
'link' => "index.php?module=config-calendars&action=add",

 
		'description' => $lang->add_calendar_desc

	);
}


	);
}


Zeile 53Zeile 54
		{
$calendar = array(
"name" => $db->escape_string($mybb->input['name']),

		{
$calendar = array(
"name" => $db->escape_string($mybb->input['name']),

				"disporder" => (int)$mybb->input['disporder'],
"startofweek" => (int)$mybb->input['startofweek'],
"eventlimit" => (int)$mybb->input['eventlimit'],
"showbirthdays" => (int)$mybb->input['showbirthdays'],
"moderation" => (int)$mybb->input['moderation'],
"allowhtml" => $db->escape_string($mybb->input['allowhtml']),
"allowmycode" => $db->escape_string($mybb->input['allowmycode']),
"allowimgcode" => $db->escape_string($mybb->input['allowimgcode']),
"allowvideocode" => $db->escape_string($mybb->input['allowvideocode']),
"allowsmilies" => $db->escape_string($mybb->input['allowsmilies'])

				"disporder" => $mybb->get_input('disporder', MyBB::INPUT_INT),
"startofweek" => $mybb->get_input('startofweek', MyBB::INPUT_INT),
"eventlimit" => $mybb->get_input('eventlimit', MyBB::INPUT_INT),
"showbirthdays" => $mybb->get_input('showbirthdays', MyBB::INPUT_INT),
"moderation" => $mybb->get_input('moderation', MyBB::INPUT_INT),
"allowhtml" => $mybb->get_input('allowhtml', MyBB::INPUT_INT),
"allowmycode" => $mybb->get_input('allowmycode', MyBB::INPUT_INT),
"allowimgcode" => $mybb->get_input('allowimgcode', MyBB::INPUT_INT),
"allowvideocode" => $mybb->get_input('allowvideocode', MyBB::INPUT_INT),
"allowsmilies" => $mybb->get_input('allowsmilies', MyBB::INPUT_INT)

			);

$plugins->run_hooks("admin_config_calendars_add_commit_start");

			);

$plugins->run_hooks("admin_config_calendars_add_commit_start");

Zeile 87Zeile 88
				"moderation" => 0
)
);

				"moderation" => 0
)
);

	}

	}


$page->add_breadcrumb_item($lang->add_calendar);
$page->output_header($lang->calendars." - ".$lang->add_calendar);


$page->add_breadcrumb_item($lang->add_calendar);
$page->output_header($lang->calendars." - ".$lang->add_calendar);


$sub_tabs['add_calendar'] = array(
'title' => $lang->add_calendar,
'link' => "index.php?module=config-calendars&action=add",
'description' => $lang->add_calendar_desc
);










	$page->output_nav_tabs($sub_tabs, 'add_calendar');
$form = new Form("index.php?module=config-calendars&action=add", "post");

	$page->output_nav_tabs($sub_tabs, 'add_calendar');
$form = new Form("index.php?module=config-calendars&action=add", "post");







	if($errors)
{
$page->output_inline_error($errors);
}

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

	if($errors)
{
$page->output_inline_error($errors);
}

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

	$form_container->output_row($lang->name." <em>*</em>", "", $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
$form_container->output_row($lang->display_order, $lang->display_order_desc, $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder')), 'disporder');

	$form_container->output_row($lang->name." <em>*</em>", "", $form->generate_text_box('name', $mybb->get_input('name'), array('id' => 'name')), 'name');
$form_container->output_row($lang->display_order, $lang->display_order_desc, $form->generate_numeric_field('disporder', $mybb->get_input('disporder'), array('id' => 'disporder', 'min' => 0)), 'disporder');

	$select_list = array($lang->sunday, $lang->monday, $lang->tuesday, $lang->wednesday, $lang->thursday, $lang->friday, $lang->saturday);

	$select_list = array($lang->sunday, $lang->monday, $lang->tuesday, $lang->wednesday, $lang->thursday, $lang->friday, $lang->saturday);

	$form_container->output_row($lang->week_start, $lang->week_start_desc, $form->generate_select_box('startofweek', $select_list, $mybb->input['startofweek'], array('id' => 'startofweek')), 'startofweek');
$form_container->output_row($lang->event_limit, $lang->event_limit_desc, $form->generate_numeric_field('eventlimit', $mybb->input['eventlimit'], array('id' => 'eventlimit')), 'eventlimit');
$form_container->output_row($lang->show_birthdays, $lang->show_birthdays_desc, $form->generate_yes_no_radio('showbirthdays', $mybb->input['showbirthdays'], true));
$form_container->output_row($lang->moderate_events, $lang->moderate_events_desc, $form->generate_yes_no_radio('moderation', $mybb->input['moderation'], true));
$form_container->output_row($lang->allow_html, "", $form->generate_yes_no_radio('allowhtml', $mybb->input['allowhtml']));
$form_container->output_row($lang->allow_mycode, "", $form->generate_yes_no_radio('allowmycode', $mybb->input['allowmycode']));
$form_container->output_row($lang->allow_img, "", $form->generate_yes_no_radio('allowimgcode', $mybb->input['allowimgcode']));
$form_container->output_row($lang->allow_video, "", $form->generate_yes_no_radio('allowvideocode', $mybb->input['allowvideocode']));
$form_container->output_row($lang->allow_smilies, "", $form->generate_yes_no_radio('allowsmilies', $mybb->input['allowsmilies']));

	$form_container->output_row($lang->week_start, $lang->week_start_desc, $form->generate_select_box('startofweek', $select_list, $mybb->get_input('startofweek'), array('id' => 'startofweek')), 'startofweek');
$form_container->output_row($lang->event_limit, $lang->event_limit_desc, $form->generate_numeric_field('eventlimit', $mybb->get_input('eventlimit'), array('id' => 'eventlimit', 'min' => 0)), 'eventlimit');
$form_container->output_row($lang->show_birthdays, $lang->show_birthdays_desc, $form->generate_yes_no_radio('showbirthdays', $mybb->get_input('showbirthdays'), true));
$form_container->output_row($lang->moderate_events, $lang->moderate_events_desc, $form->generate_yes_no_radio('moderation', $mybb->get_input('moderation'), true));
$form_container->output_row($lang->allow_html, "", $form->generate_yes_no_radio('allowhtml', $mybb->get_input('allowhtml')));
$form_container->output_row($lang->allow_mycode, "", $form->generate_yes_no_radio('allowmycode', $mybb->get_input('allowmycode')));
$form_container->output_row($lang->allow_img, "", $form->generate_yes_no_radio('allowimgcode', $mybb->get_input('allowimgcode')));
$form_container->output_row($lang->allow_video, "", $form->generate_yes_no_radio('allowvideocode', $mybb->get_input('allowvideocode')));
$form_container->output_row($lang->allow_smilies, "", $form->generate_yes_no_radio('allowsmilies', $mybb->get_input('allowsmilies')));

	$form_container->end();

$buttons[] = $form->generate_submit_button($lang->save_calendar);

	$form_container->end();

$buttons[] = $form->generate_submit_button($lang->save_calendar);

Zeile 134Zeile 128
{
$usergroups = array();


{
$usergroups = array();


	$query = $db->simple_select("calendars", "*", "cid='".$mybb->get_input('cid', 1)."'");

	$query = $db->simple_select("calendars", "*", "cid='".$mybb->get_input('cid', MyBB::INPUT_INT)."'");

	$calendar = $db->fetch_array($query);

// Does the calendar not exist?

	$calendar = $db->fetch_array($query);

// Does the calendar not exist?

Zeile 151Zeile 145
	{
$usergroups[$usergroup['gid']] = $usergroup;
}

	{
$usergroups[$usergroup['gid']] = $usergroup;
}

 

$existing_permissions = array();


$query = $db->simple_select("calendarpermissions", "*", "cid='{$calendar['cid']}'");
while($existing = $db->fetch_array($query))


$query = $db->simple_select("calendarpermissions", "*", "cid='{$calendar['cid']}'");
while($existing = $db->fetch_array($query))

Zeile 162Zeile 158
	{
foreach(array_keys($usergroups) as $group_id)
{

	{
foreach(array_keys($usergroups) as $group_id)
{

			$permissions = $mybb->input['permissions'][$group_id];









			if(isset($mybb->input['permissions'][$group_id]))
{
$permissions = $mybb->input['permissions'][$group_id];
}
else
{
$permissions = array();
}


			$db->delete_query("calendarpermissions", "cid='{$calendar['cid']}' AND gid='".(int)$group_id."'");


			$db->delete_query("calendarpermissions", "cid='{$calendar['cid']}' AND gid='".(int)$group_id."'");


			if(!$mybb->input['default_permissions'][$group_id])

			if(empty($mybb->input['default_permissions'][$group_id]))

			{
foreach(array('canviewcalendar','canaddevents','canbypasseventmod','canmoderateevents') as $calendar_permission)
{

			{
foreach(array('canviewcalendar','canaddevents','canbypasseventmod','canmoderateevents') as $calendar_permission)
{

					if($permissions[$calendar_permission] == 1)
{

					if(!empty($permissions[$calendar_permission]))
{

						$permissions_array[$calendar_permission] = 1;

						$permissions_array[$calendar_permission] = 1;

					}

					}

					else
{
$permissions_array[$calendar_permission] = 0;

					else
{
$permissions_array[$calendar_permission] = 0;

Zeile 181Zeile 185
				$permissions_array['gid'] = (int)$group_id;
$permissions_array['cid'] = $calendar['cid'];
$db->insert_query("calendarpermissions", $permissions_array);

				$permissions_array['gid'] = (int)$group_id;
$permissions_array['cid'] = $calendar['cid'];
$db->insert_query("calendarpermissions", $permissions_array);

			}

			}

		}

$plugins->run_hooks("admin_config_calendars_permissions_commit");

		}

$plugins->run_hooks("admin_config_calendars_permissions_commit");

Zeile 197Zeile 201
	$page->add_breadcrumb_item($calendar['name'], "index.php?module=config-calendars&amp;action=edit&amp;cid={$calendar['cid']}");
$page->add_breadcrumb_item($lang->permissions);
$page->output_header($lang->calendars." - ".$lang->edit_permissions);

	$page->add_breadcrumb_item($calendar['name'], "index.php?module=config-calendars&amp;action=edit&amp;cid={$calendar['cid']}");
$page->add_breadcrumb_item($lang->permissions);
$page->output_header($lang->calendars." - ".$lang->edit_permissions);





	$form = new Form("index.php?module=config-calendars&amp;action=permissions", "post");
echo $form->generate_hidden_field("cid", $calendar['cid']);


	$form = new Form("index.php?module=config-calendars&amp;action=permissions", "post");
echo $form->generate_hidden_field("cid", $calendar['cid']);


Zeile 208Zeile 212
	$table->construct_header($lang->permissions_bypass_moderation, array("class" => "align_center", "width" => "10%"));
$table->construct_header($lang->permissions_moderator, array("class" => "align_center", "width" => "10%"));
$table->construct_header($lang->permissions_all, array("class" => "align_center", "width" => "10%"));

	$table->construct_header($lang->permissions_bypass_moderation, array("class" => "align_center", "width" => "10%"));
$table->construct_header($lang->permissions_moderator, array("class" => "align_center", "width" => "10%"));
$table->construct_header($lang->permissions_all, array("class" => "align_center", "width" => "10%"));





	foreach($usergroups as $usergroup)
{

	foreach($usergroups as $usergroup)
{

		if($existing_permissions[$usergroup['gid']])

		if(!empty($existing_permissions[$usergroup['gid']]))

		{
$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;

		{
$perms = $existing_permissions[$usergroup['gid']];
$default_checked = false;

Zeile 261Zeile 265
	}
$table->output("{$lang->calendar_permissions_for} {$calendar['name']}");


	}
$table->output("{$lang->calendar_permissions_for} {$calendar['name']}");


	if(!$no_results)
{
$buttons[] = $form->generate_submit_button($lang->save_permissions);
$form->output_submit_wrapper($buttons);
}

	$buttons[] = $form->generate_submit_button($lang->save_permissions);
$form->output_submit_wrapper($buttons);





$form->end();



$form->end();


Zeile 275Zeile 276

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


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

	$query = $db->simple_select("calendars", "*", "cid='".$mybb->get_input('cid', 1)."'");

	$query = $db->simple_select("calendars", "*", "cid='".$mybb->get_input('cid', MyBB::INPUT_INT)."'");

	$calendar = $db->fetch_array($query);

// Does the calendar not exist?

	$calendar = $db->fetch_array($query);

// Does the calendar not exist?

Zeile 303Zeile 304
		{
$updated_calendar = array(
"name" => $db->escape_string($mybb->input['name']),

		{
$updated_calendar = array(
"name" => $db->escape_string($mybb->input['name']),

				"disporder" => (int)$mybb->input['disporder'],
"startofweek" => (int)$mybb->input['startofweek'],
"eventlimit" => (int)$mybb->input['eventlimit'],
"showbirthdays" => (int)$mybb->input['showbirthdays'],
"moderation" => (int)$mybb->input['moderation'],
"allowhtml" => $db->escape_string($mybb->input['allowhtml']),
"allowmycode" => $db->escape_string($mybb->input['allowmycode']),
"allowimgcode" => $db->escape_string($mybb->input['allowimgcode']),
"allowvideocode" => $db->escape_string($mybb->input['allowvideocode']),
"allowsmilies" => $db->escape_string($mybb->input['allowsmilies'])

				"disporder" => $mybb->get_input('disporder', MyBB::INPUT_INT),
"startofweek" => $mybb->get_input('startofweek', MyBB::INPUT_INT),
"eventlimit" => $mybb->get_input('eventlimit', MyBB::INPUT_INT),
"showbirthdays" => $mybb->get_input('showbirthdays', MyBB::INPUT_INT),
"moderation" => $mybb->get_input('moderation', MyBB::INPUT_INT),
"allowhtml" => $mybb->get_input('allowhtml', MyBB::INPUT_INT),
"allowmycode" => $mybb->get_input('allowmycode', MyBB::INPUT_INT),
"allowimgcode" => $mybb->get_input('allowimgcode', MyBB::INPUT_INT),
"allowvideocode" => $mybb->get_input('allowvideocode', MyBB::INPUT_INT),
"allowsmilies" => $mybb->get_input('allowsmilies', MyBB::INPUT_INT)

			);

$plugins->run_hooks("admin_config_calendars_edit_commit");


			);

$plugins->run_hooks("admin_config_calendars_edit_commit");


			$db->update_query("calendars", $updated_calendar, "cid = '".$mybb->get_input('cid', 1)."'");

			$db->update_query("calendars", $updated_calendar, "cid='{$calendar['cid']}'");


// Log admin action
log_admin_action($calendar['cid'], $mybb->input['name']);


// Log admin action
log_admin_action($calendar['cid'], $mybb->input['name']);

Zeile 352Zeile 353

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


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

	$form_container->output_row($lang->display_order." <em>*</em>", $lang->display_order_desc, $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder')), 'disporder');

	$form_container->output_row($lang->display_order." <em>*</em>", $lang->display_order_desc, $form->generate_numeric_field('disporder', $mybb->input['disporder'], array('id' => 'disporder', 'min' => 0)), 'disporder');

	$select_list = array($lang->sunday, $lang->monday, $lang->tuesday, $lang->wednesday, $lang->thursday, $lang->friday, $lang->saturday);
$form_container->output_row($lang->week_start, $lang->week_start_desc, $form->generate_select_box('startofweek', $select_list, $mybb->input['startofweek'], array('id' => 'startofweek')), 'startofweek');

	$select_list = array($lang->sunday, $lang->monday, $lang->tuesday, $lang->wednesday, $lang->thursday, $lang->friday, $lang->saturday);
$form_container->output_row($lang->week_start, $lang->week_start_desc, $form->generate_select_box('startofweek', $select_list, $mybb->input['startofweek'], array('id' => 'startofweek')), 'startofweek');

	$form_container->output_row($lang->event_limit, $lang->event_limit_desc, $form->generate_numeric_field('eventlimit', $mybb->input['eventlimit'], array('id' => 'eventlimit')), 'eventlimit');

	$form_container->output_row($lang->event_limit, $lang->event_limit_desc, $form->generate_numeric_field('eventlimit', $mybb->input['eventlimit'], array('id' => 'eventlimit', 'min' => 0)), 'eventlimit');

	$form_container->output_row($lang->show_birthdays, $lang->show_birthdays_desc, $form->generate_yes_no_radio('showbirthdays', $mybb->input['showbirthdays'], true));
$form_container->output_row($lang->moderate_events, $lang->moderate_events_desc, $form->generate_yes_no_radio('moderation', $mybb->input['moderation'], true));
$form_container->output_row($lang->allow_html, "", $form->generate_yes_no_radio('allowhtml', $mybb->input['allowhtml']));

	$form_container->output_row($lang->show_birthdays, $lang->show_birthdays_desc, $form->generate_yes_no_radio('showbirthdays', $mybb->input['showbirthdays'], true));
$form_container->output_row($lang->moderate_events, $lang->moderate_events_desc, $form->generate_yes_no_radio('moderation', $mybb->input['moderation'], true));
$form_container->output_row($lang->allow_html, "", $form->generate_yes_no_radio('allowhtml', $mybb->input['allowhtml']));

Zeile 375Zeile 376

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


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

	$query = $db->simple_select("calendars", "*", "cid='".$mybb->get_input('cid', 1)."'");

	$query = $db->simple_select("calendars", "*", "cid='".$mybb->get_input('cid', MyBB::INPUT_INT)."'");

	$calendar = $db->fetch_array($query);

// Does the calendar not exist?

	$calendar = $db->fetch_array($query);

// Does the calendar not exist?

Zeile 388Zeile 389
	$plugins->run_hooks("admin_config_calendars_delete");

// User clicked no

	$plugins->run_hooks("admin_config_calendars_delete");

// User clicked no

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

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

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

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

Zeile 457Zeile 458
	{
$calendar['name'] = htmlspecialchars_uni($calendar['name']);
$table->construct_cell("<a href=\"index.php?module=config-calendars&amp;action=edit&amp;cid={$calendar['cid']}\"><strong>{$calendar['name']}</strong></a>");

	{
$calendar['name'] = htmlspecialchars_uni($calendar['name']);
$table->construct_cell("<a href=\"index.php?module=config-calendars&amp;action=edit&amp;cid={$calendar['cid']}\"><strong>{$calendar['name']}</strong></a>");

		$table->construct_cell($form->generate_numeric_field("disporder[{$calendar['cid']}]", $calendar['disporder'], array('id' => 'disporder', 'style' => 'width: 80%', 'class' => 'align_center')));

		$table->construct_cell($form->generate_numeric_field("disporder[{$calendar['cid']}]", $calendar['disporder'], array('id' => 'disporder', 'style' => 'width: 80%', 'class' => 'align_center', 'min' => 0)));

		$table->construct_cell("<a href=\"index.php?module=config-calendars&amp;action=edit&amp;cid={$calendar['cid']}\">{$lang->edit}</a>", array("width" => 100, "class" => "align_center"));
$table->construct_cell("<a href=\"index.php?module=config-calendars&amp;action=permissions&amp;cid={$calendar['cid']}\">{$lang->permissions}</a>", array("width" => 100, "class" => "align_center"));
$table->construct_cell("<a href=\"index.php?module=config-calendars&amp;action=delete&amp;cid={$calendar['cid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_calendar_deletion}')\">{$lang->delete}</a>", array("width" => 100, "class" => "align_center"));
$table->construct_row();
}


		$table->construct_cell("<a href=\"index.php?module=config-calendars&amp;action=edit&amp;cid={$calendar['cid']}\">{$lang->edit}</a>", array("width" => 100, "class" => "align_center"));
$table->construct_cell("<a href=\"index.php?module=config-calendars&amp;action=permissions&amp;cid={$calendar['cid']}\">{$lang->permissions}</a>", array("width" => 100, "class" => "align_center"));
$table->construct_cell("<a href=\"index.php?module=config-calendars&amp;action=delete&amp;cid={$calendar['cid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_calendar_deletion}')\">{$lang->delete}</a>", array("width" => 100, "class" => "align_center"));
$table->construct_row();
}


	if($table->num_rows()  == 0)


	$no_results = false;
if($table->num_rows() == 0)

	{
$table->construct_cell($lang->no_calendars, array('colspan' => 5));
$table->construct_row();

	{
$table->construct_cell($lang->no_calendars, array('colspan' => 5));
$table->construct_row();