/** constructor, sets basic xcrud vars (they can be changed by public pethods) */ protected function __construct() { Xcrud_config::$scripts_url = $this->_check_url(Xcrud_config::$scripts_url, true); Xcrud_config::$editor_url = $this->_check_url(Xcrud_config::$editor_url); Xcrud_config::$editor_init_url = $this->_check_url(Xcrud_config::$editor_init_url); $this->limit = Xcrud_config::$limit; $this->limit_list = Xcrud_config::$limit_list; $this->column_cut = Xcrud_config::$column_cut; $this->show_primary_ai_field = Xcrud_config::$show_primary_ai_field; $this->show_primary_ai_column = Xcrud_config::$show_primary_ai_column; $this->benchmark = Xcrud_config::$benchmark; $this->start_minimized = Xcrud_config::$start_minimized; $this->remove_confirm = Xcrud_config::$remove_confirm; $this->upload_folder_def = Xcrud_config::$upload_folder_def; $this->theme = Xcrud_config::$theme; $this->is_print = Xcrud_config::$enable_printout; $this->is_title = Xcrud_config::$enable_table_title; $this->is_csv = Xcrud_config::$enable_csv_export; $this->is_numbers = Xcrud_config::$enable_numbers; $this->is_pagination = Xcrud_config::$enable_pagination; $this->is_search = Xcrud_config::$enable_search; $this->is_limitlist = Xcrud_config::$enable_limitlist; $this->is_sortable = Xcrud_config::$enable_sorting; $this->language = Xcrud_config::$language; $this->search_pattern = Xcrud_config::$search_pattern; $this->demo_mode = Xcrud_config::$demo_mode; }
public static function load_js() { $out = ''; if (self::$instance) { $instance = reset(self::$instance); $language = $instance->language; $lang_arr = $instance->lang_arr; } else { $language = Xcrud_config::$language; $lang_arr = self::_get_language_static(); } if (!self::$css_loaded && !self::$instance) { Xcrud_config::$scripts_url = self::check_url(Xcrud_config::$scripts_url, true); Xcrud_config::$editor_url = self::check_url(Xcrud_config::$editor_url); Xcrud_config::$editor_init_url = self::check_url(Xcrud_config::$editor_init_url); } if (self::$js_loaded) { self::error('Xcrud\'s scripts already rendered! Please, set <strong>$manual_load = true</strong> in your configuration file'); } self::$js_loaded = true; if (Xcrud_config::$load_jquery) { $out .= '<script src="' . Xcrud_config::$scripts_url . '/' . Xcrud_config::$plugins_uri . '/jquery.min.js"></script>'; } if (Xcrud_config::$jquery_no_conflict) { $out .= ' <script type="text/javascript"> <!-- jQuery.noConflict(); --> </script>'; } if (Xcrud_config::$load_jquery_ui) { $out .= '<script src="' . Xcrud_config::$scripts_url . '/' . Xcrud_config::$plugins_uri . '/jquery-ui/jquery-ui.min.js"></script>'; } if (Xcrud_config::$load_jcrop) { $out .= '<script src="' . Xcrud_config::$scripts_url . '/' . Xcrud_config::$plugins_uri . '/jcrop/jquery.Jcrop.min.js"></script>'; } if (Xcrud_config::$load_bootstrap) { $out .= '<script src="' . Xcrud_config::$scripts_url . '/' . Xcrud_config::$plugins_uri . '/bootstrap/js/bootstrap.min.js"></script>'; } $out .= '<script src="' . Xcrud_config::$scripts_url . '/' . Xcrud_config::$plugins_uri . '/timepicker/jquery-ui-timepicker-addon.js"></script>'; if (Xcrud_config::$editor_url) { $out .= '<script src="' . Xcrud_config::$editor_url . '"></script>'; } if (Xcrud_config::$load_googlemap) { $out .= '<script src="//maps.google.com/maps/api/js?sensor=false&language=' . $language . '"></script>'; } $out .= '<script src="' . Xcrud_config::$scripts_url . '/' . Xcrud_config::$plugins_uri . '/xcrud.js"></script>'; $config = array('url' => Xcrud_config::$scripts_url . '/' . Xcrud_config::$ajax_uri, 'editor_url' => Xcrud_config::$editor_url, 'editor_init_url' => Xcrud_config::$editor_init_url, 'force_editor' => Xcrud_config::$force_editor, 'date_first_day' => Xcrud_config::$date_first_day, 'date_format' => Xcrud_config::$date_format, 'time_format' => Xcrud_config::$time_format, 'lang' => $lang_arr, 'rtl' => Xcrud_config::$is_rtl ? 1 : 0); $out .= ' <script type="text/javascript"> <!-- var xcrud_config = ' . json_encode($config) . '; --> </script>'; if ($language != 'en') { if (is_file(XCRUD_PATH . '/' . Xcrud_config::$lang_path . '/datepicker/jquery.ui.datepicker-' . $language . '.js')) { $out .= '<script src="' . Xcrud_config::$scripts_url . '/' . Xcrud_config::$lang_uri . '/datepicker/jquery.ui.datepicker-' . $language . '.js"></script>'; } if (is_file(XCRUD_PATH . '/' . Xcrud_config::$lang_path . '/timepicker/jquery-ui-timepicker-' . $language . '.js')) { $out .= '<script src="' . Xcrud_config::$scripts_url . '/' . Xcrud_config::$lang_uri . '/timepicker/jquery-ui-timepicker-' . $language . '.js"></script>'; } } return $out; }
<?php Xcrud_config::$editor_url = dirname($_SERVER["SCRIPT_NAME"]) . '/../editors/ckeditor/ckeditor.js'; // can be set in config $xcrud = Xcrud::get_instance(); $xcrud->table('orders'); $xcrud->change_type('status', 'select', '', 'On Hold,In Process,Resolved,Shipped,Disputed,Cancelled'); $xcrud->change_type('orderDate', 'none'); echo $xcrud->render();