Пример #1
0
function delete_tab($data)
{
    $panel = $data['panel'];
    $user = $data['user'];
    ossim_valid($panel, OSS_DIGIT, 'illegal:' . _("Tab"));
    ossim_valid($user, OSS_USER, 'illegal:' . _("User"));
    if (ossim_error()) {
        $info_error = "Error: " . ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $info_error;
        return $return;
    }
    if (!get_user_valid($user)) {
        $return['error'] = TRUE;
        $return['msg'] = _('You do not have permission to delete this tab');
        return $return;
    }
    try {
        $tab = new Dashboard_tab($panel, $user);
        if ($tab->is_locked()) {
            $return['error'] = TRUE;
            $return['msg'] = _("You cannot modify this tab");
            return $return;
        }
        $tab->delete();
    } catch (Exception $e) {
        $return['error'] = TRUE;
        $return['msg'] = $e->getMessage();
        return $return;
    }
    $return['error'] = FALSE;
    $return['msg'] = _("Tab deleted successfully");
    return $return;
}
Пример #2
0
function save_widgets_order($conn, $data)
{
    $panel = $data['panel'];
    $widgets = $data['widgets'];
    ossim_valid($panel, OSS_DIGIT, 'illegal:' . _("Panel"));
    if (ossim_error()) {
        $info_error = "Error: " . ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $info_error;
        return $return;
    }
    list($user, $edit) = get_tabs_data_aux();
    if (!$edit) {
        $return['error'] = TRUE;
        $return['msg'] = _("You have to be in edit mode to achieve this action");
        return $return;
    }
    try {
        $tab = new Dashboard_tab($panel);
    } catch (Exception $e) {
        $return['error'] = TRUE;
        $return['msg'] = $e->getMessage();
        return $return;
    }
    if ($tab->is_locked()) {
        $return['error'] = TRUE;
        $return['msg'] = _("You cannot modify this tab");
        return $return;
    }
    if (is_array($widgets) && !empty($widgets)) {
        foreach ($widgets as $widget) {
            ossim_valid($widget['col'], OSS_DIGIT, 'illegal:' . _("Widget Column"));
            ossim_valid($widget['fil'], OSS_DIGIT, 'illegal:' . _("Widget Row"));
            ossim_valid($widget['id'], OSS_DIGIT, 'illegal:' . _("Widget ID"));
            if (ossim_error()) {
                $info_error = "Error: " . ossim_get_error();
                ossim_clean_error();
                $return['error'] = TRUE;
                $return['msg'] = $info_error;
                return $return;
            }
            $sql = "UPDATE dashboard_widget_config SET col = ?, fil = ? WHERE id = ? and panel_id=? and user=?";
            $params = array($widget['col'], $widget['fil'], $widget['id'], $panel, $user);
            if ($conn->Execute($sql, $params) === FALSE) {
                $return['error'] = TRUE;
                $return['msg'] = $conn->ErrorMsg() . '.';
                return $return;
            }
        }
    }
    $return['error'] = FALSE;
    $return['msg'] = _("Dashboard Configuration Saved");
    return $return;
}
Пример #3
0
echo $enable;
?>
</span>
				    </a>
				</td>
			</tr>
						
			<tr>
				<td class="noborder"><?php 
echo $default;
?>
</td>
			</tr>
			
			<?php 
if (!$tab->is_locked()) {
    ?>
		
				
			<tr>
				<td class="noborder">
				    <a class='change_title' href='javascript:;'>
				        <div class='change_title div_list ui-icon ui-icon-pencil'></div>
				        <span><?php 
    echo _("Change Title");
    ?>
</span>
				    </a>
				</td>							
			</tr>