function _table_view_settings() { if (is_route_method(array('records' => array('index', 'sort_full_table')))) { $res = $this->user_settings->get_setting($this->user_id, 'assets', 'full'); if ($res) { $this->frozen_column = $res->frozen_column; $this->column_order = json_decode($res->view_settings, true); } else { $assets_tables_data = array(); $assets_tables_data['user_id'] = $this->user_id; $assets_tables_data['table_type'] = 'assets'; $assets_tables_data['table_subtype'] = 'full'; $assets_tables_data['frozen_column'] = '0'; $table_order = $this->config->item('assets_setting'); $full_table_order = $table_order['full']; foreach ($full_table_order as $key => $value) { $views_settings[] = array("title" => $key, "field" => $value, "hidden" => 0); } $assets_tables_data['view_settings'] = json_encode($views_settings); $assets_tables_data['created_at'] = date('Y-m-d H:i:s'); $this->user_settings->insert_settings($assets_tables_data); $this->frozen_column = 0; $this->column_order = $views_settings; } } if (is_route_method(array('instantiations' => array('index', 'instantiation_table', 'update_user_settings')))) { $res = $this->user_settings->get_setting($this->user_id, 'instantiation', 'full'); if ($res) { $this->frozen_column = $res->frozen_column; $this->column_order = json_decode($res->view_settings, true); } else { $assets_tables_data = array(); $assets_tables_data['user_id'] = $this->user_id; $assets_tables_data['table_type'] = 'instantiation'; $assets_tables_data['table_subtype'] = 'full'; $assets_tables_data['frozen_column'] = '0'; $table_order = $this->config->item('instantiation_setting'); $full_table_order = $table_order['full']; foreach ($full_table_order as $key => $value) { $views_settings[] = array("title" => $key, "field" => $value, "hidden" => 0); } $assets_tables_data['view_settings'] = json_encode($views_settings); $assets_tables_data['created_at'] = date('Y-m-d H:i:s'); $this->user_settings->insert_settings($assets_tables_data); $this->frozen_column = 0; $this->column_order = $views_settings; } } }
<?php if (is_route_method(array('records' => array('index', 'flagged'), 'instantiations' => array('index')))) { ?> <ul class="records-nav"> <li class="<?php echo active_anchor('records', array('index', 'flagged')); ?> "><a href="<?php echo site_url('records/index'); ?> ">Assets</a></li> <li class="<?php echo active_anchor('instantiations', array('index', 'detail')); ?> "><a href="<?php echo site_url('instantiations/index'); ?> ">Instantiations</a></li> </ul> <?php }
</ul> </div><!--/.nav-collapse --> <?php } ?> </div> </div> </div> <div class="container" style="width:960px;margin:0 auto;margin-top: 55px;"> <div class="content" > <?php if (is_route_method(array('settings' => array('index', 'edit_profile'), 'templatemanager' => array('add', 'lists', 'edit', 'details', 'readmessage', 'manage_crawford')))) { ?> <ul class="records-nav"> <?php if ($this->can_compose_alert || $this->role_id == 20) { ?> <li class="<?php echo active_anchor('templatemanager', array('add', 'lists', 'edit', 'details', 'readmessage')); ?> "><a href="<?php echo site_url('templatemanager/lists'); ?> " >Email Template</a></li> <?php } ?>