当前位置: 首页>>代码示例>>PHP>>正文


PHP grocery_CRUD::get_js_files方法代码示例

本文整理汇总了PHP中grocery_CRUD::get_js_files方法的典型用法代码示例。如果您正苦于以下问题:PHP grocery_CRUD::get_js_files方法的具体用法?PHP grocery_CRUD::get_js_files怎么用?PHP grocery_CRUD::get_js_files使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在grocery_CRUD的用法示例。


在下文中一共展示了grocery_CRUD::get_js_files方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     $crud = new grocery_CRUD();
     $crud->set_theme('bootstrap');
     $crud->set_table('user');
     $crud->set_subject('Gebruiker');
     // hide fields
     $crud->columns('is_super_user', 'is_active', 'screen_name', 'email', 'gebruikersgroepen');
     // new_password and new_password repeat are needed to make formvalidation work
     // id is needed to make the email unique check work
     $crud->fields('id', 'is_active', 'screen_name', 'email', 'gebruikersgroepen', 'password', 'new_password', 'new_password_repeat');
     $crud->required_fields('email', 'screen_name', 'is_active');
     $crud->set_relation_n_n('gebruikersgroepen', 'user_x_user_group', 'user_group', 'user_id', 'user_group_id', 'name');
     $crud->field_type('id', 'hidden');
     $crud->field_type('new_password_repeat', 'hidden');
     $crud->field_type('password', 'hidden');
     $crud->display_as('is_active', 'Actief');
     $crud->display_as('screen_name', 'Schermnaam');
     $crud->display_as('is_super_user', '');
     $crud->display_as('new_password', 'Wachtwoord');
     if ($crud->getState() == 'read') {
         $crud->field_type('new_password', 'hidden');
     } else {
         $crud->callback_field('new_password', array($this, 'edit_field_callback_new_password'));
     }
     $crud->field_type('is_active', 'dropdown', array('yes' => 'ja', 'no' => 'nee'));
     $crud->callback_column('is_active', array($this, 'callback_list_is_active'));
     $crud->callback_column('is_super_user', array($this, 'callback_list_is_super_user'));
     $crud->callback_before_insert(array($this, 'before_insert_update_callback'));
     $crud->callback_before_update(array($this, 'before_insert_update_callback'));
     $crud->callback_after_insert(array($this, 'after_insert_callback'));
     $crud->callback_after_update(array($this, 'after_update_callback'));
     if ($crud->getState() === 'update_validation' or $crud->getState() === 'insert_validation') {
         $crud->set_rules('email', 'E-mail', 'required|valid_email|callback_email_unique_check');
         $crud->set_rules('screen_name', 'Schermnaam', 'required');
         if ($this->input->post('new_password') != '' or !$this->input->post('id')) {
             $crud->set_rules('new_password', 'Nieuw wachtwoord', 'required|min_length[10]|matches[new_password_repeat]');
             $crud->set_rules('new_password_repeat', 'Herhaal nieuw wachtwoord', '');
         }
         $this->form_validation->set_message('matches', 'De wachtwoorden zijn niet aan elkaar gelijk.');
     }
     // render the crud HTML
     $crud_output = $crud->render();
     //get the needed css and javascript files
     $this->javascript_files = $crud->get_js_files();
     $this->css_files = $crud->get_css_files();
     // put the crud content in the right position
     $this->views['content'] = $crud_output->output;
     $this->css[] = $this->load->view('admin/user/css/index.css', array(), true);
     // add javascript and css to make the password generate and change function possible
     if ($crud->getState() === 'add' or $crud->getState() === 'edit') {
         $this->css[] = $this->load->view('admin/user/css/edit_user.css', array(), true);
         $this->javascript[] = $this->load->view('admin/user/js/edit_user.js', array(), true);
     }
     // create the layout-HTML and show it to the user
     $this->_layout();
 }
开发者ID:BitmanNL,项目名称:traffictower-cms,代码行数:57,代码来源:TT_user.php

示例2: index

 public function index($log_type = NULL)
 {
     $this->load->model('shared/log_model');
     $this->config->load('grocery_crud');
     $this->config->set_item('grocery_crud_character_limiter', 0);
     $crud = new grocery_CRUD();
     if ($crud->getState() == 'list') {
         // get all known log types
         $log_types = $this->log_model->get_log_types();
         $this->views['content'] = $this->load->view('admin/log/action_selector', array('log_types' => $log_types, 'selected_log_type' => $log_type), TRUE);
         $this->javascript[] = $this->load->view('admin/log/js/action_selector.js', NULL, TRUE);
     }
     if (!is_null($log_type) && $log_type != 'ajax_list' && $log_type != 'export' && $log_type != 'print' && $log_type != 'ajax_list_info') {
         $crud->where(array('action' => $log_type));
         $crud->unset_columns('action');
     }
     $crud->set_theme('bootstrap');
     $crud->set_table('log');
     $crud->set_subject('Logs');
     // Op twee velden orderen. Grocerycrud houd zich niet aan de Codeigniter active record
     // maar dit werkt.
     $crud->order_by('date_created desc, id', 'desc');
     $crud->columns('date_created', 'action', 'message', 'user_id');
     $crud->set_relation('user_id', 'user', 'screen_name');
     $crud->display_as('user_id', 'Gebruiker');
     $crud->display_as('date_created', 'Tijd');
     $crud->display_as('action', 'Actie');
     $crud->display_as('message', 'Bericht');
     $crud->display_as('ip_hash', 'IP-hash');
     $crud->unset_add();
     $crud->unset_edit();
     $crud->unset_delete();
     // render the crud HTML
     $crud_output = $crud->render();
     //get the needed css and javascript files
     $this->javascript_files = $crud->get_js_files();
     $this->css_files = $crud->get_css_files();
     if (isset($this->views['content'])) {
         $this->views['content'] .= $crud_output->output;
     } else {
         $this->views['content'] = $crud_output->output;
     }
     $this->_layout();
 }
开发者ID:BitmanNL,项目名称:traffictower-cms,代码行数:44,代码来源:TT_log.php

示例3: index

 public function index()
 {
     $crud = new grocery_CRUD();
     // crud settings
     $crud->set_theme('bootstrap');
     $crud->set_table('user_group');
     $crud->set_subject('Gebruikersgroepen');
     $crud->columns('name', 'key');
     $crud->display_as('name', 'Naam');
     $crud->required_fields('name');
     $crud->callback_before_insert(array($this, 'before_insert'));
     $crud->change_field_type('key', 'invisible');
     $crud->set_relation_n_n('gebruikers', 'user_x_user_group', 'user', 'user_group_id', 'user_id', 'email');
     // render the crud HTML
     $crud_output = $crud->render();
     $this->javascript_files = $crud->get_js_files();
     $this->css_files = $crud->get_css_files();
     $this->views['content'] = $crud_output->output;
     $this->_layout();
 }
开发者ID:BitmanNL,项目名称:traffictower-cms,代码行数:20,代码来源:TT_user_group.php

示例4: paragraph

 public function paragraph()
 {
     if (!is_super_user()) {
         redirect(site_url('admin/help'));
     }
     $this->load->config('grocery_crud');
     $this->config->set_item('grocery_crud_text_editor_type', 'minimal');
     $crud = new grocery_CRUD();
     $crud->set_theme('bootstrap');
     $crud->set_table('help_paragraph');
     $crud->set_subject("Documentatie alinea's");
     $crud->unset_add_fields('date_modified');
     $crud->unset_edit_fields('page_id', 'date_modified');
     $crud->field_type('date_created', 'invisible');
     $crud->field_type('user_id', 'invisible');
     $crud->field_type('order', 'hidden');
     $crud->callback_add_field('page_id', array($this, 'paragraph_callback_add_field_page_id'));
     $crud->callback_before_insert(array($this, 'paragraph_callback_before_insert'));
     $crud->callback_before_update(array($this, 'paragraph_callback_before_update'));
     $crud->callback_after_insert(array($this, 'save_to_sql'));
     $crud->callback_after_update(array($this, 'save_to_sql'));
     $crud->callback_after_delete(array($this, 'save_to_sql'));
     $crud->required_fields('key', 'title', 'content', 'is_visible');
     // render the crud HTML
     $crud_output = $crud->render();
     if ($crud->getState() == 'list') {
         redirect(site_url('admin/help'));
     } else {
         if ($crud->getState() == 'success') {
             $this->session->set_flashdata('form_submit', 'success');
             $this->session->set_flashdata('form_message', 'Alinea met succes opgeslagen.');
             $state = $crud->getStateInfo();
             $this->load->model('admin/help_model');
             $paragraph = $this->help_model->get_paragraph($state->primary_key, 'off');
             redirect(site_url('admin/help/index/' . $paragraph['page_id'] . '#' . $paragraph['key']));
         }
     }
     $this->javascript_files = $crud->get_js_files();
     $this->css_files = $crud->get_css_files();
     $this->views['content'] = $crud_output->output;
     $this->_layout();
 }
开发者ID:BitmanNL,项目名称:traffictower-cms,代码行数:42,代码来源:TT_help.php

示例5: index

 public function index($language = '')
 {
     // bepaal de taal
     $data['languages'] = $this->config->item('languages');
     $data['language_data'] = $this->config->item('language_data');
     if (!in_array($language, $data['languages'])) {
         $data['language'] = $data['languages'][0];
     } else {
         $data['language'] = $language;
     }
     // voor de callback
     $this->language = $data['language'];
     $crud = new grocery_CRUD();
     $crud->set_theme('bootstrap');
     $crud->set_table('app_email');
     $crud->set_subject('E-mail');
     $crud->where('language', $data['language']);
     $crud->unset_print();
     $crud->unset_export();
     $crud->unset_read();
     if (!is_super_user()) {
         $crud->unset_add();
         $crud->unset_delete();
         $fields = array('subject', 'message');
         // get email if state is edit to retrieve availability for from and to
         if ($crud->getState() == 'edit' || $crud->getState() == 'update' || $crud->getState() == 'update_validation' || $crud->getState() == 'read') {
             // edit state -> get item
             $email_id = $this->uri->rsegment($this->uri->total_rsegments());
             if (intval($email_id)) {
                 $this->load->model('admin/app_email_model');
                 $email = $this->app_email_model->get_by_id($email_id);
                 if ($email['from_available'] == 'yes') {
                     $fields[] = 'from_name';
                     $fields[] = 'from_email';
                 }
                 if ($email['to_available'] == 'yes') {
                     $fields[] = 'to_name';
                     $fields[] = 'to_email';
                 }
             }
         }
         $crud->fields($fields);
         $crud->required_fields($fields);
         $crud->columns('subject', 'message');
     } else {
         $crud->required_fields('key', 'subject', 'from_available', 'to_available', 'template');
         $crud->columns('key', 'subject', 'message', 'from_available', 'to_available', 'template');
     }
     $crud->display_as('key', 'Sleutel')->display_as('subject', 'Onderwerp')->display_as('message', 'Bericht')->display_as('from_available', 'Afzender')->display_as('to_available', 'Ontvanger')->display_as('from_name', 'Naam afzender')->display_as('from_email', 'E-mail afzender')->display_as('to_name', 'Naam ontvanger')->display_as('to_email', 'E-mail ontvanger');
     $crud->field_type('from_available', 'dropdown', array('no' => 'Instellen in code', 'yes' => 'Instellen in CMS'));
     $crud->field_type('to_available', 'dropdown', array('no' => 'Instellen in code', 'yes' => 'Instellen in CMS'));
     $crud->callback_before_insert(array($this, 'before_insert_callback'));
     $crud->change_field_type('language', 'invisible');
     // render the crud HTML
     $crud_output = $crud->render();
     $this->javascript_files = $crud->get_js_files();
     $this->css_files = $crud->get_css_files();
     $data['state'] = $crud->getState();
     $this->javascript[] = $this->load->view('admin/email/js/index.js', NULL, TRUE);
     $this->views['content'] = $this->load->view('admin/email/index', $data, TRUE);
     $this->views['content'] .= $crud_output->output;
     $this->_layout();
 }
开发者ID:BitmanNL,项目名称:traffictower-cms,代码行数:63,代码来源:TT_email.php


注:本文中的grocery_CRUD::get_js_files方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。