Added permission settings for all blocks;
Modified calendar, custom & links module to work with the new permission settings for all blocks; Added language variables for links block;
This commit is contained in:
@@ -299,7 +299,7 @@ class portal_calendar_module
|
||||
$event_end_time = trim(request_var('event_end_time', ''));
|
||||
$event_all_day = request_var('event_all_day', false); // default to false
|
||||
$event_url = request_var('event_url', ' ');
|
||||
$event_permission = request_var('permission-setting', array(0 => ''));
|
||||
$event_permission = request_var('permission-setting-calendar', array(0 => ''));
|
||||
$groups_ary = array();
|
||||
|
||||
/*
|
||||
@@ -461,7 +461,7 @@ class portal_calendar_module
|
||||
'EVENT_START_TIME' => ($action != 'add') ? $user->format_date($events[$link_id]['start_time'], 'G:i') : '',
|
||||
'EVENT_END_DAY' => ($action != 'add' && ($events[$link_id]['start_time'] - $events[$link_id]['end_time']) != true) ? $user->format_date($events[$link_id]['end_time'], 'Y-m-d') : '',
|
||||
'EVENT_END_TIME' => ($action != 'add' && ($events[$link_id]['start_time'] - $events[$link_id]['end_time']) != true) ? $user->format_date($events[$link_id]['end_time'], 'G:i') : '',
|
||||
'EVENT_ALL_DAY' => ($events[$link_id]['start_time'] - $events[$link_id]['end_time']) ? true : false,
|
||||
'EVENT_ALL_DAY' => (isset($events[$link_id]['start_time']) && ($events[$link_id]['start_time'] - $events[$link_id]['end_time'])) ? true : false,
|
||||
'EVENT_URL' => (isset($events[$link_id]['url']) && $action != 'add') ? $events[$link_id]['url'] : '',
|
||||
|
||||
//'U_BACK' => $u_action,
|
||||
@@ -479,7 +479,7 @@ class portal_calendar_module
|
||||
$result = $db->sql_query($sql);
|
||||
while($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_block_vars('permission_setting', array(
|
||||
$template->assign_block_vars('permission_setting_calendar', array(
|
||||
'SELECTED' => (in_array($row['group_id'], $groups_ary)) ? true : false,
|
||||
'GROUP_NAME' => (isset($user->lang['G_' . $row['group_name']])) ? $user->lang['G_' . $row['group_name']] : $row['group_name'],
|
||||
'GROUP_ID' => $row['group_id'],
|
||||
|
||||
@@ -76,12 +76,15 @@ class portal_custom_module
|
||||
|
||||
$title = (!empty($config['board3_custom_' . $module_id . '_title'])) ? ((isset($user->lang[$config['board3_custom_' . $module_id . '_title']])) ? $user->lang[$config['board3_custom_' . $module_id . '_title']] : $config['board3_custom_' . $module_id . '_title']) : $user->lang[$this->name];
|
||||
|
||||
return array(
|
||||
'template' => 'custom_center.html',
|
||||
'title' => $title,
|
||||
'code' => $assign_code,
|
||||
'image_src' => '', // no image for center blocks
|
||||
);
|
||||
if(!empty($assign_code))
|
||||
{
|
||||
return array(
|
||||
'template' => 'custom_center.html',
|
||||
'title' => $title,
|
||||
'code' => $assign_code,
|
||||
'image_src' => '', // no image for center blocks
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function get_template_side($module_id)
|
||||
@@ -109,12 +112,15 @@ class portal_custom_module
|
||||
|
||||
$title = (!empty($config['board3_custom_' . $module_id . '_title'])) ? ((isset($user->lang[$config['board3_custom_' . $module_id . '_title']])) ? $user->lang[$config['board3_custom_' . $module_id . '_title']] : $config['board3_custom_' . $module_id . '_title']) : $user->lang[$this->name];
|
||||
|
||||
return array(
|
||||
'template' => 'custom_side.html',
|
||||
'title' => $title,
|
||||
'code' => $assign_code,
|
||||
'image_src' => (!empty($config['board3_custom_' . $module_id . '_image_src'])) ? $config['board3_custom_' . $module_id . '_image_src'] : $this->image_src,
|
||||
);
|
||||
if(!empty($assign_code))
|
||||
{
|
||||
return array(
|
||||
'template' => 'custom_side.html',
|
||||
'title' => $title,
|
||||
'code' => $assign_code,
|
||||
'image_src' => (!empty($config['board3_custom_' . $module_id . '_image_src'])) ? $config['board3_custom_' . $module_id . '_image_src'] : $this->image_src,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function get_template_acp($module_id)
|
||||
|
||||
@@ -209,7 +209,7 @@ class portal_links_module
|
||||
$link_type = request_var('link_type', 2); // default to B3_LINK_EXT, no categories in Links block
|
||||
$link_url = request_var('link_url', ' ');
|
||||
$link_url = str_replace('&', '&', $link_url);
|
||||
$link_permission = request_var('permission-setting', array(0 => ''));
|
||||
$link_permission = request_var('permission-setting-link', array(0 => ''));
|
||||
$groups_ary = array();
|
||||
|
||||
// get groups and check if the selected groups actually exist
|
||||
@@ -370,7 +370,7 @@ class portal_links_module
|
||||
$result = $db->sql_query($sql);
|
||||
while($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_block_vars('permission_setting', array(
|
||||
$template->assign_block_vars('permission_setting_link', array(
|
||||
'SELECTED' => (in_array($row['group_id'], $groups_ary)) ? true : false,
|
||||
'GROUP_NAME' => (isset($user->lang['G_' . $row['group_name']])) ? $user->lang['G_' . $row['group_name']] : $row['group_name'],
|
||||
'GROUP_ID' => $row['group_id'],
|
||||
|
||||
Reference in New Issue
Block a user