<?php $grid_method = get_grid_method_from_page(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>[[page_title]]</title> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_app_var('DEFAULT_CHARSET'); ?> "> <link rel="shortcut icon" href="http://<?php echo $_SERVER['SERVER_NAME']; ?> /favicon.ico" type="image/x-icon"> <!-- css --> <link rel="stylesheet" href="/css/all.css" type="text/css" media="screen"/> <?php $user = $this->session->all_userdata(); if (!empty($user)) { $client = call_model_function('model_clients', 'model_clients', 'get_records', array('client_id' => $user['client_id'])); $theme = call_model_function('model_themes', 'model_themes', 'get_records', array('theme_id' => $client[0]['client_theme_id'])); } if (empty($theme)) { $theme = call_model_function('model_themes', 'model_themes', 'get_records', array('theme_default_flag' => '1')); } $theme_path = $theme[0]['theme_path']; $theme_sub_path = $theme[0]['theme_sub_path']; $theme_jquery_path = $theme[0]['theme_jquery_path']; ?>
function _get_tab_columns($client_tab_id = 0) { $this->_secure(5); $grid_method = get_grid_method_from_page(); $result = array(); $user = $this->session->all_userdata(); $filter_display = get_user_preference('filter_display'); if ($grid_method == 'jqgrid' || $grid_method == 'slick') { $names = array(); $field_width = 95; $date_width = 80; if ($filter_display == '0') { $field_width = 150; } } else { $field_width = '95px'; $date_width = '95px'; if ($filter_display == '0') { $field_width = '112px'; $date_width = '112px'; } } $this->load->model('model_client_tabs'); $client_tabs = $this->model_client_tabs->get_records(array('client_id' => $user['client_id'], 'security_level' => $user['user_security_level'])); $site_title_name = get_app_var('SITE_TITLE_NAME'); if (!empty($client_tabs)) { if ($grid_method == 'jqgrid') { $result[] = array('name' => 'actions', 'index' => 'actions', 'datatype' => 'T', 'width' => 35, 'sortable' => false, 'frozen' => true, 'resizable' => false, 'align' => 'center', 'sorttype' => 'text', 'title' => false); $result[] = array('name' => 'site_title', 'index' => 'site_title', 'datatype' => 'T', 'sorttype' => 'text', 'hidden' => false, 'classes' => 'site_title tooltip', 'width' => 250, 'frozen' => true, 'title' => false); $names[] = ''; $names[] = $site_title_name; } elseif ($grid_method == 'slick') { $result[] = array('id' => 'actions', 'name' => '', 'toolTip' => 'Actions', 'headerCssClass' => 'tooltip', 'field' => 'actions', 'width' => 45, 'searchable' => false, 'sortable' => false, 'orderable' => false, 'attributeType' => 'T', 'attributeID' => 0); $result[] = array('id' => 'site_title', 'name' => $site_title_name, 'toolTip' => 'Site title derived on Masterdash', 'headerCssClass' => 'tooltip', 'field' => 'site_title', 'width' => 250, 'searchable' => true, 'sortable' => true, 'sorttype' => 'text', 'orderable' => false, 'attributeType' => 'T', 'attributeID' => 0); } else { $result[] = array('sName' => 'site_title', 'sTitle' => '<span>' . $site_title_name . '</span>', 'sClass' => 'site_title', 'sType' => 'string', 'bVisible' => true); } foreach ($client_tabs as $client_tab) { $visible = false; if ($client_tab['client_tab_id'] == $client_tab_id || $client_tab_id == 'all') { $visible = true; } $tab_attributes = $client_tab['tab_attributes']; if (!empty($tab_attributes)) { foreach ($tab_attributes as $tab_attribute) { $type = $grid_method == 'jqgrid' || $grid_method == 'slick' ? 'text' : 'string'; if ($tab_attribute['attribute_value_type'] == 'D') { $type = 'date'; } elseif ($tab_attribute['attribute_value_type'] == 'M') { $type = 'time'; } elseif ($tab_attribute['attribute_value_type'] == 'PC' || $tab_attribute['attribute_value_type'] == 'PT') { $type = $grid_method == 'jqgrid' || $grid_method == 'slick' ? 'text' : 'html'; } elseif ($tab_attribute['attribute_value_type'] == 'F') { $type = $grid_method == 'jqgrid' || $grid_method == 'slick' ? 'float' : 'text'; } elseif ($tab_attribute['attribute_value_type'] == 'I') { $type = $grid_method == 'jqgrid' || $grid_method == 'slick' ? 'integer' : 'text'; } if ($grid_method == 'jqgrid') { $class = $tab_attribute['attribute_array_index'] . ' ' . $type . ($type == 'float' || $type == 'integer' ? ' tooltip_right' : ' tooltip'); $result[] = array('name' => $tab_attribute['attribute_array_index'], 'index' => $tab_attribute['attribute_array_index'], 'datatype' => $tab_attribute['attribute_value_type'], 'classes' => $class, 'sorttype' => $type, 'width' => $type == 'date' ? $date_width : $field_width, 'align' => $type == 'date' || $type == 'time' ? 'center' : ($type == 'float' || $type == 'integer' ? 'right' : 'left'), 'hidden' => $visible ? false : true); $names[] = $tab_attribute['attribute_name']; } elseif ($grid_method == 'slick') { if ($visible) { $class = $tab_attribute['attribute_array_index'] . ' ' . $type; $result[] = array('id' => $tab_attribute['attribute_array_index'], 'name' => $tab_attribute['attribute_name'], 'toolTip' => $tab_attribute['attribute_description'], 'field' => $tab_attribute['attribute_array_index'], 'width' => $type == 'date' ? $date_width : $field_width, 'headerCssClass' => 'tooltip', 'cssClass' => $class, 'searchable' => true, 'sortable' => true, 'sorttype' => $type, 'orderable' => $client_tab_id == 'all' || $user['user_security_level'] < 50 ? false : true, 'attributeType' => $tab_attribute['attribute_value_type'], 'attributeID' => $tab_attribute['attribute_id']); } } else { $class = $tab_attribute['attribute_array_index'] . ' ' . $type; $result[] = array('sName' => $tab_attribute['attribute_array_index'], 'sTitle' => '<span>' . teaser($tab_attribute['attribute_name'], 30) . '</span>', 'sClass' => $class, 'sType' => $type, 'sWidth' => $field_width, 'bVisible' => $visible); } } } } } if ($grid_method == 'jqgrid') { $result = array('names' => $names, 'columns' => $result); } elseif ($grid_method == 'slick') { $result = array('columns' => $result); } return $result; }
function sites_common_control() { $data = array(); $ie = 0; $chrome = 0; $this->load->library('user_agent'); $browser = $this->agent->browser(); $version = $this->agent->version(); if ($browser == 'Internet Explorer' || $browser == 'MSIE') { $ie = $version; } elseif ($browser == 'Chrome') { $chrome = 1; } $data['ie'] = $ie; $data['chrome'] = $chrome; $grid_method = get_grid_method_from_page(); if ($grid_method == 'jqgrid') { $data['action_view'] = 'javascript/sites_common_control_grid'; } elseif ($grid_method == 'slick') { $data['action_view'] = 'javascript/sites_common_control_slick'; } else { $data['action_view'] = 'javascript/sites_common_control'; } $this->load->view('layouts/blank', $data); }