/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @return mixed */ public function handle($request, Closure $next) { $auth = Auth::guard('backend'); if ($auth->check() and $auth->user()->hasRole('login')) { return redirect(backend_url()); } return $next($request); }
public function handle() { $password = str_random(8); $user = $this->reflink->user; Bus::dispatch(new EmailSend('user_new_password', ['password' => $password, 'name' => $user->name, 'email' => $user->email])); $user->password = $password; $user->save(); backend_auth()->login($user); $this->redirectUrl = backend_url(); $this->message = trans(Password::PASSWORD_RESET); }
private function _login_form() { if (is_logged_in()) { backend_url(); } // Libreary $this->load->library('form_validation'); // Validation Rules $this->form_validation->set_rules('email', '"' . tr('_GLOBAL_email_') . '"', 'required|valid_email|trim'); $this->form_validation->set_rules('password', '"' . tr('_GLOBAL_password_') . '"', 'required|trim'); // Error Class $data['form_class'] = ''; $data['form_error_class']['email'] = ''; $data['form_error_class']['password'] = ''; // Redirect $this->session->keep_flashdata('redirect'); // Auth Login Form if ($this->input->post('email') || $this->input->post('password')) { // Check Validation if (!$this->form_validation->run()) { // Message Data $data['form_class'] = 'danger'; $data['form_error'] = validation_errors(); $data['form_error_class']['email'] = form_error('email') ? 'has-error' : 'has-success'; $data['form_error_class']['password'] = form_error('password') ? 'has-error' : 'has-success'; } else { // Form Values $form['email'] = $this->input->post('email', TRUE); $form['password'] = $this->input->post('password', TRUE); $form['remember'] = $this->input->post('remember', TRUE); // Load library $this->load->model('auth_model'); // Check if user can login if ($this->auth_model->login($form)) { $redirect = $this->session->flashdata('redirect'); if (isset($redirect)) { redirect($redirect, 'refresh'); } else { redirect('backend'); } } else { // Message Data $data['form_class'] = 'danger'; $data['form_error'] = $this->auth_model->error; } } } // Seo Data $data['seo_description'] = tr('_SEO_PAGE_LOGIN_description_'); $data['seo_keywords'] = tr('_SEO_PAGE_AUTH_LOGIN_keywords_'); $data['seo_title'] = tr('_SEO_PAGE_AUTH_LOGIN_title_'); // Render Template $this->template->set('template', 'login')->set('views', 'auth/login')->set('data', $data)->render(); }
/** * Protect a backend controller / function * * Default use is to bar non-members * A user group can be specified to limit to that user group * * @access public * @param string user group */ function secure_restrict() { if (!current_user('secure')) { if (!$this->logged_in()) { $this->CI->session->set_flashdata('error', 'You must log in to see this content.'); } else { $this->CI->session->set_flashdata('msg', 'You must re-enter your password to see this content.'); } redirect(backend_url('/session/login')); } }
/** * 信息提示 * * @access public * @param string * @param string * @param bool * @param string * @return void */ public function _message($msg, $goto = '', $auto = TRUE, $fix = '', $pause = 3000) { if ($goto == '') { $goto = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : site_url(); } else { $goto = strpos($goto, 'http') !== false ? $goto : backend_url($goto); } $goto .= $fix; $this->_template('sys_message', array('msg' => $msg, 'goto' => $goto, 'auto' => $auto, 'pause' => $pause)); echo $this->output->get_output(); exit; }
/** * Constructor * * @access public */ function Preferences() { $this->CI =& get_instance(); $query = $this->CI->db->get('general', 1, 0); $this->prefs = $query->row(); // Set the default language to our global language $this->CI->config->set_item('language', $this->prefs->language); // Global config overrides if ($this->CI->config->item('system_locked')) { $this->prefs->locked = 1; } // Backend URLs $this->set('backend_base_url', backend_url('')); $this->set('backend_login', backend_url('session/login')); }
/** * 默认入口 * * @access public * @param int * @return void */ public function view($role = 0) { $offset = $this->input->get('page', TRUE) ? $this->input->get('page', TRUE) : 0; $data['list'] = $this->user_mdl->get_users($role, 15, $offset); $data['role'] = $role; $data['roles'] = $this->user_mdl->get_roles(); //加载分页 $this->load->library('pagination'); $config['base_url'] = backend_url('user/view') . '?dilicms'; $config['per_page'] = 15; $config['page_query_string'] = TRUE; $config['query_string_segment'] = 'page'; $config['total_rows'] = $this->user_mdl->get_users_num($role); $this->pagination->initialize($config); $data['pagination'] = $this->pagination->create_links(); $this->_template('user_list', $data); }
public function add() { // Libreary $this->load->library('form_validation'); // Validation Rules $this->form_validation->set_rules('name', '"' . tr('_GLOBAL_name_') . '"', 'required|trim'); $this->form_validation->set_rules('lastname', '"' . tr('_GLOBAL_lastname_') . '"', 'required|trim'); $this->form_validation->set_rules('email', '"' . tr('_GLOBAL_email_') . '"', 'required|valid_email|trim'); $this->form_validation->set_rules('email_repeat', '"' . tr('_GLOBAL_email_repeat_') . '"', 'required|valid_email|matches[email]|trim'); $this->form_validation->set_rules('password', '"' . tr('_GLOBAL_password_') . '"', 'required|trim|min_length[6]|password_check[1,1,1]'); $this->form_validation->set_rules('password_repeat', '"' . tr('_GLOBAL_password_repeat_') . '"', 'required|matches[password]|trim'); // Form Error Content // Return Data $json = array('csrf' => array($this->security->get_csrf_token_name() => $this->security->get_csrf_hash())); // Check Validation if (!$this->form_validation->run()) { $json['status'] = FALSE; $json['message'] = validation_errors(); $json['rules'] = array('name' => form_error('name') ? 'has-error' : 'has-success', 'lastname' => form_error('lastname') ? 'has-error' : 'has-success', 'email' => form_error('email') ? 'has-error' : 'has-success', 'email_repeat' => form_error('email_repeat') ? 'has-error' : 'has-success', 'password' => form_error('password') ? 'has-error' : 'has-success', 'password_repeat' => form_error('password_repeat') ? 'has-error' : 'has-success'); } else { // Load library $this->load->model('auth_model'); // Form Values $form['name'] = $this->input->post('name', TRUE); $form['lastname'] = $this->input->post('lastname', TRUE); $form['email'] = $this->input->post('email', TRUE); $form['email_repeat'] = $this->input->post('email_repeat', TRUE); $form['password'] = $this->input->post('password', TRUE); $form['password_repeat'] = $this->input->post('password_repeat', TRUE); if ($this->auth_model->create_account($form, 1, 1)) { $json['status'] = TRUE; $json['redirect'] = backend_url(array('users', 'edit', $this->auth_model->id)); } else { $json['status'] = FALSE; $json['message'] = $this->auth_model->error; } } // Output $this->output->set_header('Content-Type: application/json; charset=utf-8')->set_content_type('application/json')->set_output(json_encode($json)); }
');}">删除</a> </li> <?php } ?> <?php } ?> </ul> <script> var base_url = '<?php echo base_url(); ?> ' ,backend_url = '<?php echo backend_url() . $this->uri->segment(1); ?> /',attachment_url = '<?php echo $this->platform->file_url(); ?> '; var thumbDefaultSize = '<?php echo $thumb_default_size; ?> '; </script> <link rel="stylesheet" href="js/contextMenu/jquery.contextMenu.css" /> <script src="js/contextMenu/jquery.contextMenu.js"></script> <script src="js/contextMenu/jquery.ui.position.js"></script> <script src="js/dili_utility/upload.js"></script>
function plugin_url($plugin, $controller, $method = 'index', $qs = array()) { $ci =& get_instance(); if (false and $ci->config->item('index_page') === '') { return backend_url("plugin/{$name}/{$controller}/{$method}", http_build_query($qs)); } $qs['plugin'] = $plugin; $qs['c'] = $controller; $qs['m'] = $method; return backend_url('module/run', http_build_query($qs)); }
public function registerMedia() { $errors = view()->shared('errors'); $this->templateScripts = ['CURRENT_URL' => $this->request->url(), 'SITE_URL' => url()->current(), 'BASE_URL' => backend_url(), 'BACKEND_PATH' => backend_url_segment(), 'BACKEND_RESOURCES' => resources_url(), 'PUBLIC_URL' => url()->current(), 'LOCALE' => Lang::getLocale(), 'ROUTE' => !is_null($this->getRouter()) ? $this->getRouter()->currentRouteAction() : null, 'ROUTE_PATH' => $this->getRouterPath(), 'REQUEST_TYPE' => $this->requestType, 'USER_ID' => backend_auth()->id(), 'MESSAGE_ERRORS' => !is_null($errors) ? $errors->getBag('default') : [], 'MESSAGE_SUCCESS' => (array) $this->session->get('success', [])]; }
/** * Formateamos los resultados para mejor visibilidad * * @access private * @param array $users Array con todos los usuarios * @param bool $single Indica si debe solo devolver la primera fila * @param array $return Variable de retorono de informacion * @return array Devuelve el array con los datos formateados */ private function _parse_users($users = array(), $single = FALSE, $return = array()) { foreach ($users as $user) { $return[] = array('id' => $user['id'], 'url_delete' => backend_url(array('users', 'delete', $user['id'])), 'url_edit' => backend_url(array('users', 'edit', $user['id'])), 'url_change_password' => backend_url(array('users', 'change-password', $user['id'])), 'remember_token' => $user['remember_token'], 'register_token' => $user['register_token'], 'register_status' => $user['register_status'], 'forgot_token' => $user['forgot_token'], 'forgot_fecha' => $user['forgot_fecha'], 'forgot_status' => $user['forgot_status'], 'date_last_login' => date('d-m-Y', strtotime($user['date_last_login'])), 'date_last_mod_password' => date('d-m-Y', strtotime($user['date_last_mod_password'])), 'date_last_mod_profile' => date('d-m-Y', strtotime($user['date_last_mod_profile'])), 'date_register' => date('d-m-Y', strtotime($user['date_register'])), 'name' => $user['name'], 'lastname' => $user['lastname'], 'email' => $user['email'], 'password' => $user['password'], 'cargo' => $user['cargo'], 'vat' => $user['vat'], 'phone' => $user['phone'], 'mobile_phone' => $user['mobile_phone'], 'fax' => $user['fax'], 'address' => $user['address'], 'description' => $user['description'], 'status_id' => $user['status_id'], 'status' => tr('_GLOBAL' . $user['status']), 'permission_id' => $user['permission_id'], 'permission' => tr('_GLOBAL' . $user['permission']), 'permission_class' => $user['permission_class'], 'language' => $user['language'], 'language_id' => $user['language_id'], 'avatar' => !empty($user['avatar']) ? $this->template->thumb('uploads', $user['avatar'], array('w' => 150, 'h' => 150, 'type' => 'resize')) : $this->template->thumb('img', '_avatars/avatar.png', array('w' => 150, 'h' => 150, 'type' => 'resize'))); } unset($users, $user); return $single ? $return[0] : $return; }
<div class="page-header page-header-block"> <div class="page-header-section"> <h4 class="title semibold"><?php echo tr('_BACKEND_configure_categories_'); ?> </h4> </div> <div class="page-header-section"> <div class="toolbar"> <a href="<?php echo backend_url(array('bloger', 'categories')); ?> " class="btn btn-danger"> <i class="ico-arrow-left"></i> <?php echo tr('_BACKEND_go_back_'); ?> </a> </div> </div> </div> <div class="row"> <?php echo form_open(NULL, array('class' => 'form-horizontal form-bordered form-ajax', 'id' => 'categories_edit_form', 'role' => 'form')); ?> <div class="col-lg-12"> <div class="panel"> <div class="panel-body pt0 pb0"> <div class="form-group header bgcolor-default">
</td> <td><?php echo $v->name; ?> </td> <td><?php echo $v->status == 1 ? '正常' : '冻结'; ?> </td> <td> <a href="<?php echo backend_url('user/edit/' . $v->uid); ?> "><img class="operator" src="images/icon_edit.gif" alt="修改" title="修改"></a> <a class="confirm_delete" href="<?php echo backend_url('user/del/' . $v->uid); ?> "><img class="operator" src="images/icon_del.gif" alt="删除" title="删除"></a> </td> </tr> <?php } ?> </tbody> </table> </div> <div class="pages_bar pagination"><?php echo $pagination; ?> </div> <script language="javascript">
<div class="form-group"> <label for="old_password" class="col-sm-3 control-label"><?php echo tr('_GLOBAL_old_password_'); ?> </label> <div class="col-sm-5"> <?php echo form_password(array('name' => 'old_password', 'value' => set_value('old_password'), 'id' => 'old_password', 'class' => 'form-control', 'required' => 'required')); ?> <?php if ((bool) $this->settings_model->system['_user_forgot_enabled_'] === TRUE) { ?> <p class="help-block"><a href="<?php echo backend_url(array('auth', 'forgot')); ?> "><?php echo tr('_PAGE_AUTH_SIDEBAR_LINKS_forgot_'); ?> </a></p> <?php } ?> </div> </div> <div class="form-group"> <label for="new_password" class="col-sm-3 control-label"><?php echo tr('_GLOBAL_new_password_');
public function index() { backend_url(); }
/** * 过滤模型菜单 * * @access private * @param string * @param string * @return void */ private function _filter_content_menus($class_name, $method_name) { //1 $this->_current_menu = 1; $this->left_menus =& $this->top_menus[$this->_current_menu]['sub_menus']; $extra = $this->ci->input->get('model'); foreach ($this->left_menus as $vkey => &$v) { foreach ($v['sub_menus'] as $jkey => &$j) { if ($j['class_name'] == $class_name and $j['method_name'] == $method_name and ($j['extra'] == $extra and $vkey == 0) || ($j['extra'] == $extra and $vkey == 1)) { $j['current'] = TRUE; } if ($this->ci->_admin->role == 1) { continue; } $right = $j['class_name'] . '@' . $j['method_name']; if (!in_array($right, $this->rights['rights']) || (!in_array($j['extra'], $this->rights['models']) and $vkey == 0) || (!in_array($j['extra'], $this->rights['category_models']) and $vkey == 1)) { unset($this->left_menus[$vkey]['sub_menus'][$jkey]); } } if (!$v['sub_menus']) { unset($this->left_menus[$vkey]); } } //设定默认链接 if ($_item = @reset($this->left_menus[0]['sub_menus'])) { if (!$this->_default_link) { $this->_default_link = backend_url($_item['class_name'] . '/view', 'model=' . $_item['extra']); } } }
" data-modal-id="#image-edit-<?php echo $img['id']; ?> " title="<?php echo tr('_GLOBAL_edit_'); ?> " > <i class="glyphicon glyphicon-edit"></i> </button> <button class="btn btn-sm btn-danger dialog-ajax" data-url="<?php echo backend_url(array('gallery', 'image-delete', $img['id'])); ?> " data-message="<img src='<?php echo $this->template->thumb('uploads', $img['url'], array('w' => 600, 'h' => 400, 'type' => 'stretch')); ?> ' class='img-responsive'>" data-title="<?php echo tr('_GLOBAL_DIALOG_DELETE_GALLERY_IMAGE_title_'); ?> " data-confirm-label="<?php echo tr('_GLOBAL_confirm_'); ?> " data-cancel-label="<?php
</td> <td> <a href="<?php echo backend_url('category/edit/' . $v->id); ?> "><img class="operator" src="images/icon_edit.gif" alt="修改" title="修改"></a> <a class="confirm_delete" href="<?php echo backend_url('category/del/' . $v->id); ?> "><img class="operator" src="images/icon_del.gif" alt="删除" title="删除"></a> <a href="<?php echo backend_url('category/fields/' . $v->id); ?> ">字段管理</a> <a href="<?php echo backend_url('category_content/view', 'model=' . $v->name); ?> ">列表</a> </td> </tr> <?php } ?> </tbody> </table> </div> <script language="javascript"> $('a.confirm_delete').click(function(){ return confirm('是否要删除所选分类模型?'); }); </script>
<aside class="right-side"> <section class="content-header"> <h1><?php echo tr('_BACKEND_phpinfo_'); ?> </h1> <div class="pull-right toolbar"> <a href="<?php echo backend_url(array('system-settings')); ?> " class="btn btn-sm-block btn-danger"> <i class="fa fa-arrow-left"></i> <?php echo tr('_BACKEND_go_back_'); ?> </a> </div> <div class="clearfix"></div> </section> <section class="content"> <div class="row"> <div class="col-lg-12"> <?php echo phpinfo(); ?> </div> </div> </section> </aside>
</div> <div class="operating" style="overflow:visible"> <?php if ($model['hasattach']) { ?> <div class="search f_r" style="position:relative"> <button class="btn" type="button" hidefocus="true" onclick="$('#dili_uploader').toggle('slow');"><span class="add">附件列表</span></button> <?php $this->load->view('sys_uploader'); ?> </div> <?php } ?> <a class="hack_ie" href="<?php echo backend_url('content/view', 'model=' . $model['name']); ?> "> <button class="operating_btn" type="button"> <span>返回列表</span> </button> </a> </div> </div> <div class="content_box"> <div class="content form_content"> <?php echo form_open_multipart('content/save?model=' . $model['name'] . '&id=' . (isset($content['id']) ? $content['id'] : '')); ?> <table class="form_table" > <col width="150px" />
/** * 分页处理 * * @access private * @param array * @return array */ private function _pagination($model) { $this->load->library('pagination'); $config['base_url'] = backend_url('category_content/view'); $config['per_page'] = $model['perpage']; $config['uri_segment'] = 3; $config['suffix'] = '?model=' . $model['name']; $condition = array('classid >' => '0'); $data['where'] = array(); //暂时无搜索 $level = $this->input->get('u_c_level', TRUE) ? $this->input->get('u_c_level', TRUE) : 0; $config['suffix'] .= '&level=' . $level; $data['where']['u_c_level'] = $level; $condition['parentid ='] = $level; $this->plugin_manager->trigger('querying', $condition); $config['total_rows'] = $this->db->where($condition)->count_all_results($this->db->dbprefix('u_c_') . $model['name']); $this->db->from($this->db->dbprefix('u_c_') . $model['name']); $this->db->select('classid, parentid'); $this->db->where($condition); foreach ($model['listable'] as $v) { $this->db->select($model['fields'][$v]['name']); } $this->db->offset($this->uri->segment($config['uri_segment'], 0)); $this->db->limit($config['per_page']); $data['list'] = $this->db->get()->result(); $this->plugin_manager->trigger('listing', $data['list']); if ($level != 0) { $data['parent'] = $this->db->where('classid', $level)->get($this->db->dbprefix('u_c_') . $model['name'])->row(); $data['next_level'] = $data['parent']->level + 1; } else { $data['parent'] = NULL; $data['next_level'] = 1; } $data['path'] = $this->_find_path($data['next_level']); $config['first_url'] = $config['base_url'] . $config['suffix']; $this->pagination->initialize($config); $data['pagination'] = $this->pagination->create_links(); return $data; }
?> " href="<?php echo site_url(backend_url('settings')); ?> "> <div class="icon" id="settings_icon"></div> Settings <p>Global Board Settings</p> </a> </li> <li> <a class="<?php echo $section == 'statistics' ? 'selected' : ''; ?> " href="<?php echo site_url(backend_url('statistics')); ?> "> <div class="icon" id="statistics_icon"></div> Statistics <p>Visitors, Posts, Page Views</p> </a> </li> </ul> </div> </div> <!-- End Sidebar --> <?php } ?>
/** * Content Home Page * * @access public */ function index() { $this->layout->gen_crumb(array(backend_url('') => 'Backend', backend_url('content') => 'Content')); $this->layout->render('content/home'); }
<aside class="right-side"> <section class="content-header"> <h1><?php echo tr('_BACKEND_templates_emails_'); ?> </h1> <div class="toolbar"> <a href="<?php echo backend_url(array('emails')); ?> " class="btn btn-sm-block btn-danger"> <i class="fa fa-arrow-left"></i> <?php echo tr('_BACKEND_go_back_'); ?> </a> </div> <div class="clearfix"></div> </section> <section class="content"> <div class="row"> <div class="col-md-12"> <div class="box box-black box-solid"> <div class="box-header"> <h3 class="box-title"><?php echo tr('_BACKEND_configure_template_list_'); ?> </h3> </div>
<div class="col-md-12"> <div class="box box-black box-solid"> <div class="box-header"> <h3 class="box-title"> <?php echo all_languages($data['language'], 'text'); ?> </h3> </div> <div class="box-body"> <table id="translations-table" data-url="<?php echo backend_url(array('languages', 'translations', $data['language'])); ?> " class="table table-bordered table-striped table-hover table-datatables-server"> <thead> <tr> <th><?php echo tr('_GLOBAL_translation_key_'); ?> </th> <th class="hidden-xs hidden-sm"><?php echo tr('_GLOBAL_translation_text_'); ?> </th> <th width="130px" class="text-center"><?php echo tr('_GLOBAL_actions_'); ?>
/** * 生成LINKED_MENU类型控件HTML * * @access private * @param array * @param string * @return string */ private function _linked_menu($field, $default) { $html = ''; if (!$field['values']) { return '请设置数据源'; } if (count($options = explode('|', $field['values'])) != 4) { return '数据源格式不正确'; } $ci =& get_instance(); if (!$ci->platform->cache_exists(DILICMS_SHARE_PATH . 'settings/category/data_' . $options[0] . '.php')) { return '分类模型数据不存在!'; } for ($i = 1; $i <= $options[2]; $i++) { $html .= '<select class="linked_menu_' . $options[0] . '"><option value="">请选择</option></select>'; } $html .= '<input type="hidden" value="' . $default . '" name="' . $field['name'] . '" id="' . $field['name'] . '" />'; $html .= '<button type="button" onclick="linked_menu_insert(\'linked_menu_' . $options[0] . '\',\'' . $field['name'] . '\',' . $options[3] . ');" class="button"><span>添加</span></button>'; $html .= '<div class="linked_menu"><ul id="linked_menu_' . $options[0] . '_list">'; if ($default) { $ci->settings->load('category/data_' . $options[0]); $model_data =& setting('category'); $default = explode('|', $default); foreach ($default as $v) { $v = str_replace(',', '', $v); $k = explode('-', $v); foreach ($k as &$kk) { $kk = isset($model_data[$options[0]][$kk][$options[1]]) ? $model_data[$options[0]][$kk][$options[1]] : 'undefined'; } $html .= '<li><em class="value">' . $v . '</em><em>' . implode('-', $k) . '</em><span onclick="linked_menu_delete(\'linked_menu_' . $options[0] . '\',\'' . $field['name'] . '\', this);">移除</span></li>'; } } $html .= '</ul></div>'; $html .= '<script language="javascript">$(".linked_menu_' . $options[0] . '").ld({ajaxOptions : {"url" : "' . backend_url('ld/json/' . $options[0] . '/' . $options[1]) . '"},style : {"width" : 120},field:{region_id:"classid",region_name:"' . $options[1] . '",parent_id:"parentid"}});</script>'; return $html; }
?> " class="btn btn-primary"> <i class="fa fa-plus"></i> <?php echo tr('_BACKEND_add_entry_'); ?> </a> <a href="<?php echo backend_url(array('bloger', 'categories')); ?> " class="btn btn-warning"> <i class="fa fa-tags"></i> <?php echo tr('_BACKEND_categories_'); ?> </a> <a href="<?php echo backend_url(array('bloger')); ?> " class="btn btn-danger"> <i class="fa fa-arrow-left"></i> <?php echo tr('_BACKEND_go_back_'); ?> </a> </div> <div class="clearfix"></div> <?php $this->template->view('bloger/modal/_category_add'); ?> </section> <section class="content"> <div class="row"> <div class="col-lg-9">
?> " title="<?php echo tr('_GLOBAL_desactivate_tooltip_'); ?> " > <i class="glyphicon glyphicon-ok"></i> </button> <?php } else { ?> <button class="btn btn-danger change-status" data-url="<?php echo backend_url(array('helper', 'change-status')); ?> " data-table="blog" data-column="uID_estados" data-value="<?php echo $entry['status_id']; ?> " data-id="uID" data-id-value="<?php echo $entry['id']; ?> " data-pk="uID" data-pk-value="<?php
/** * 分页处理 * * @access private * @param array * @return array */ private function _pagination($model) { $this->load->library('pagination'); $config['base_url'] = backend_url('content/view'); $config['per_page'] = $model['perpage']; $config['uri_segment'] = 3; $config['suffix'] = '?model=' . $model['name']; $condition = array('id >' => '0'); $data['where'] = array(); foreach ($model['searchable'] as $v) { $this->field_behavior->on_do_search($model['fields'][$v], $condition, $data['where'], $config['suffix']); } $this->plugin_manager->trigger('querying', $condition); $config['total_rows'] = $this->db->where($condition)->count_all_results($this->db->dbprefix('u_m_') . $model['name']); $this->db->from($this->db->dbprefix('u_m_') . $model['name']); $this->db->select('id, create_time'); $this->db->where($condition); $this->field_behavior->set_extra_condition(); foreach ($model['listable'] as $v) { $this->db->select($model['fields'][$v]['name']); } $this->db->order_by('create_time', 'DESC'); $this->db->offset($this->uri->segment($config['uri_segment'], 0)); $this->db->limit($config['per_page']); $data['list'] = $this->db->get()->result(); $this->plugin_manager->trigger('listing', $data['list']); $config['first_url'] = $config['base_url'] . $config['suffix']; $this->pagination->initialize($config); $data['pagination'] = $this->pagination->create_links(); return $data; }