Facebook
From Scribby Agouti, 4 Years ago, written in PHP.
Embed
Download Paste or View Raw
Hits: 240
  1. public function cbInit()
  2.         {
  3.                 # START CONFIGURATION DO NOT REMOVE THIS LINE
  4.                 $this->title_field = "title";
  5.                 $this->limit = "20";
  6.                 $this->orderby = "id,desc";
  7.                 $this->global_privilege = false;
  8.                 $this->button_table_action = true;
  9.                 $this->button_bulk_action = true;
  10.                 $this->button_action_style = "button_icon";
  11.                 $this->button_add = true;
  12.                 $this->button_edit = true;
  13.                 $this->button_delete = true;
  14.                 $this->button_detail = true;
  15.                 $this->button_show = true;
  16.                 $this->button_filter = true;
  17.                 $this->button_import = false;
  18.                 $this->button_export = false;
  19.                 $this->table = "slider";
  20.                 # END CONFIGURATION DO NOT REMOVE THIS LINE
  21.  
  22.                 # START COLUMNS DO NOT REMOVE THIS LINE
  23.                 $this->col                                                              = [];
  24.                 $this->col[]                                                    = [
  25.                         "label"                                                         => "Страница",
  26.                         "name"                                                          => "page",
  27.                         "callback_php"                                          => '$this->callback_page($row);'
  28.                 ];
  29.                 $this->col[]                                                    = [
  30.                         "label"                                                         => "Заголовок",
  31.                         "name"                                                          => "title"
  32.                 ];
  33.                 $this->col[]                                                    = [
  34.                         "label"                                                         => "Время задержки слайда (сек)",
  35.                         "name"                                                          => "time"
  36.                 ];
  37.                 # END COLUMNS DO NOT REMOVE THIS LINE
  38.  
  39.                 # START FORM DO NOT REMOVE THIS LINE
  40.                 $this->form                                                     = [];
  41.                 $this->form[]                                                   = [
  42.                         'label'                                                         => 'Страница',
  43.                         'name'                                                          => 'page',
  44.                         'type'                                                          => 'select',
  45.                         'validation'                                            => 'required',
  46.                         'width'                                                         => 'col-sm-10',
  47.                         'dataenum'                                                      => '/|ГЛАВНАЯ;faq|КАК ИГРАТЬ;clubs|НАШИ КЛУБЫ;schedule|ТУРНИРЫ'
  48.                 ];
  49.                 $this->form[]                                                   = [
  50.                         'label'                                                         => 'Заголовок',
  51.                         'name'                                                          => 'title',
  52.                         'type'                                                          => 'text',
  53.                         'validation'                                            => 'required|string|min:3|max:255',
  54.                         'width'                                                         => 'col-sm-10'
  55.                 ];
  56.                 $this->form[]                                                   = [
  57.                         'label'                                                         => 'Время задержки слайда (сек)',
  58.                         'name'                                                          => 'time',
  59.                         'type'                                                          => 'number',
  60.                         'validation'                                            => 'required',
  61.                         'width'                                                         => 'col-sm-10'
  62.                 ];
  63.                 # END FORM DO NOT REMOVE THIS LINE
  64.                
  65.  
  66.                 /*
  67.                  | ----------------------------------------------------------------------
  68.                  | Sub Module
  69.                  | ----------------------------------------------------------------------    
  70.                 | @label          = Label of action
  71.                 | @path           = Path of sub module
  72.                 | @foreign_key    = foreign key of sub table/module
  73.                 | @button_color   = Bootstrap Class (primary,success,warning,danger)
  74.                 | @button_icon    = Font Awesome Class
  75.                 | @parent_columns = Sparate with comma, e.g : name,created_at
  76.                  |
  77.                 */
  78.                 $this->sub_module = array();
  79.  
  80.                 /*
  81.                  | ----------------------------------------------------------------------
  82.                  | Add More Action Button / Menu
  83.                  | ----------------------------------------------------------------------    
  84.                  | @label       = Label of action
  85.                  | @url         = Target URL, you can use field alias. e.g : [id], [name], [title], etc
  86.                  | @icon        = Font awesome class icon. e.g : fa fa-bars
  87.                  | @color          = Default is primary. (primary, warning, succecss, info)    
  88.                  | @showIf         = If condition when action show. Use field alias. e.g : [id] == 1
  89.                  |
  90.                 */
  91.                 $this->addaction = array();
  92.  
  93.                 /*
  94.                  | ----------------------------------------------------------------------
  95.                  | Add More Button Selected
  96.                  | ----------------------------------------------------------------------    
  97.                  | @label       = Label of action
  98.                  | @icon           = Icon from fontawesome
  99.                  | @name           = Name of button
  100.                  | Then about the action, you should code at actionButtonSelected method
  101.                  |
  102.                 */
  103.                 $this->button_selected = array();
  104.  
  105.                 /*
  106.                  | ----------------------------------------------------------------------
  107.                  | Add alert message to this module at overheader
  108.                  | ----------------------------------------------------------------------    
  109.                  | @message = Text of message
  110.                  | @type    = warning,success,danger,info        
  111.                  |
  112.                 */
  113.                 $this->alert = array();
  114.  
  115.                 /*
  116.                  | ----------------------------------------------------------------------
  117.                  | Add more button to header button
  118.                  | ----------------------------------------------------------------------    
  119.                  | @label = Name of button
  120.                  | @url   = URL Target
  121.                  | @icon  = Icon from Awesome.
  122.                  |
  123.                 */
  124.                 $this->index_button = array();
  125.  
  126.                 /*
  127.                  | ----------------------------------------------------------------------
  128.                  | Customize Table Row Color
  129.                  | ----------------------------------------------------------------------    
  130.                  | @condition = If condition. You may use field alias. E.g : [id] == 1
  131.                  | @color = Default is none. You can use bootstrap success,info,warning,danger,primary.        
  132.                  |
  133.                 */
  134.                 $this->table_row_color = array();
  135.  
  136.                 /*
  137.                  | ----------------------------------------------------------------------
  138.                  | You may use this bellow array to add statistic at dashboard
  139.                  | ----------------------------------------------------------------------
  140.                  | @label, @count, @icon, @color
  141.                  |
  142.                 */
  143.                 $this->index_statistic = array();
  144.  
  145.                 /*
  146.                  | ----------------------------------------------------------------------
  147.                  | Add javascript at body
  148.                  | ----------------------------------------------------------------------
  149.                  | javascript code in the variable
  150.                  | $this->script_js = "function() { ... }";
  151.                  |
  152.                 */
  153.                 $this->script_js = NULL;
  154.  
  155.                 /*
  156.                  | ----------------------------------------------------------------------
  157.                  | Include HTML Code before index table
  158.                  | ----------------------------------------------------------------------
  159.                  | html code to display it before index table
  160.                  | $this->pre_index_html = "<p>test</p>";
  161.                  |
  162.                 */
  163.                 $this->pre_index_html = null;
  164.  
  165.                 /*
  166.                  | ----------------------------------------------------------------------
  167.                  | Include HTML Code after index table
  168.                  | ----------------------------------------------------------------------
  169.                  | html code to display it after index table
  170.                  | $this->post_index_html = "<p>test</p>";
  171.                  |
  172.                 */
  173.                 $this->post_index_html = null;
  174.  
  175.                 /*
  176.                  | ----------------------------------------------------------------------
  177.                  | Include Javascript File
  178.                  | ----------------------------------------------------------------------
  179.                  | URL of your javascript each array
  180.                  | $this->load_js[] = asset("myfile.js");
  181.                  |
  182.                 */
  183.                 $this->load_js = array();
  184.  
  185.                 /*
  186.                  | ----------------------------------------------------------------------
  187.                  | Add css style at body
  188.                  | ----------------------------------------------------------------------
  189.                  | css code in the variable
  190.                  | $this->style_css = ".style{....}";
  191.                  |
  192.                 */
  193.                 $this->style_css = NULL;
  194.  
  195.                 /*
  196.                  | ----------------------------------------------------------------------
  197.                  | Include css File
  198.                  | ----------------------------------------------------------------------
  199.                  | URL of your css each array
  200.                  | $this->load_css[] = asset("myfile.css");
  201.                  |
  202.                 */
  203.                 $this->load_css = array();
  204.  
  205.         }
  206.