| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  |  * @package    CleverStyle CMS | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * @subpackage System module | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * @category   modules | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * @author     Nazar Mokrynskyi <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * @copyright  Copyright (c) 2015, Nazar Mokrynskyi | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * @license    MIT License, see license.txt | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  | namespace cs\modules\System\admin\Controller; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | use | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | 	cs\Config, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | 	cs\DB, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | 	cs\Index, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | 	cs\Language, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  | 	h; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | trait components { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | 	static function components_blocks () { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | 		$Index       = Index::instance(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | 		$Index->form = false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  | 		$Index->content( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | 			h::cs_system_admin_blocks_list() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | 		); | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 24 |  |  | 	} | 
            
                                                                        
                            
            
                                    
            
            
                | 25 |  |  | 	static function components_databases () { | 
            
                                                                        
                            
            
                                    
            
            
                | 26 |  |  | 		$Config              = Config::instance(); | 
            
                                                                        
                            
            
                                    
            
            
                | 27 |  |  | 		$L                   = Language::instance(); | 
            
                                                                        
                            
            
                                    
            
            
                | 28 |  |  | 		$Index               = Index::instance(); | 
            
                                                                        
                            
            
                                    
            
            
                | 29 |  |  | 		$Index->apply_button = true; | 
            
                                                                        
                            
            
                                    
            
            
                | 30 |  |  | 		$Index->content( | 
            
                                                                        
                            
            
                                    
            
            
                | 31 |  |  | 			h::cs_system_admin_databases_list(). | 
            
                                                                        
                            
            
                                    
            
            
                | 32 |  |  | 			static::vertical_table( | 
            
                                                                        
                            
            
                                    
            
            
                | 33 |  |  | 				[ | 
            
                                                                        
                            
            
                                    
            
            
                | 34 |  |  | 					[ | 
            
                                                                        
                            
            
                                    
            
            
                | 35 |  |  | 						h::info('db_balance'), | 
            
                                                                        
                            
            
                                    
            
            
                | 36 |  |  | 						h::radio( | 
            
                                                                        
                            
            
                                    
            
            
                | 37 |  |  | 							[ | 
            
                                                                        
                            
            
                                    
            
            
                | 38 |  |  | 								'name'    => 'core[db_balance]', | 
            
                                                                        
                            
            
                                    
            
            
                | 39 |  |  | 								'checked' => $Config->core['db_balance'], | 
            
                                                                        
                            
            
                                    
            
            
                | 40 |  |  | 								'value'   => [0, 1], | 
            
                                                                        
                            
            
                                    
            
            
                | 41 |  |  | 								'in'      => [$L->off, $L->on] | 
            
                                                                        
                            
            
                                    
            
            
                | 42 |  |  | 							] | 
            
                                                                        
                            
            
                                    
            
            
                | 43 |  |  | 						) | 
            
                                                                        
                            
            
                                    
            
            
                | 44 |  |  | 					], | 
            
                                                                        
                            
            
                                    
            
            
                | 45 |  |  | 					[ | 
            
                                                                        
                            
            
                                    
            
            
                | 46 |  |  | 						h::info('db_mirror_mode'), | 
            
                                                                        
                            
            
                                    
            
            
                | 47 |  |  | 						h::radio( | 
            
                                                                        
                            
            
                                    
            
            
                | 48 |  |  | 							[ | 
            
                                                                        
                            
            
                                    
            
            
                | 49 |  |  | 								'name'    => 'core[db_mirror_mode]', | 
            
                                                                        
                            
            
                                    
            
            
                | 50 |  |  | 								'checked' => $Config->core['db_mirror_mode'], | 
            
                                                                        
                            
            
                                    
            
            
                | 51 |  |  | 								'value'   => [DB::MIRROR_MODE_MASTER_MASTER, DB::MIRROR_MODE_MASTER_SLAVE], | 
            
                                                                        
                            
            
                                    
            
            
                | 52 |  |  | 								'in'      => [$L->master_master, $L->master_slave] | 
            
                                                                        
                            
            
                                    
            
            
                | 53 |  |  | 							] | 
            
                                                                        
                            
            
                                    
            
            
                | 54 |  |  | 						) | 
            
                                                                        
                            
            
                                    
            
            
                | 55 |  |  | 					] | 
            
                                                                        
                            
            
                                    
            
            
                | 56 |  |  | 				] | 
            
                                                                        
                            
            
                                    
            
            
                | 57 |  |  | 			) | 
            
                                                                        
                            
            
                                    
            
            
                | 58 |  |  | 		); | 
            
                                                                        
                            
            
                                    
            
            
                | 59 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  | 	static function components_modules () { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  | 		$Index       = Index::instance(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  | 		$Index->form = false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  | 		$Index->content( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  | 			h::cs_system_admin_modules_list() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  | 	static function components_plugins () { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  | 		$Index       = Index::instance(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  | 		$Index->form = false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  | 		$Index->content( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  | 			h::cs_system_admin_plugins_list() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  | 	static function components_storages () { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  | 		$Index       = Index::instance(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  | 		$Index->form = false; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  | 		$Index->content( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  | 			h::cs_system_admin_storages_list() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  | 		); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  | 	} | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 81 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 82 |  |  |  |