XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
admin_gui.php
Go to the documentation of this file.
1 <?php
2 /*
3 Theme name: Two Point Six
4 Theme URI: http://www.redmexico.com.mx
5 Version: 1.0
6 Author: bitcero
7 Author URI: http://www.bitcero.info
8 */
9 
10 load_theme_locale('twop6','',true);
11 
13 
14 define('TWOP6_PATH', RMCPATH.'/themes/twop6');
15 define('TWOP6_URL', RMCURL.'/themes/twop6');
16 
17 include_once TWOP6_PATH.'/class/twop6functions.class.php';
19 
20 // Cookies
21 //RMTemplate::get()->add_local_script('jquery.ck.js', 'rmcommon','include');
22 
23 // Get current module menu
24 if($xoopsModule->dirname()!='rmcommon' && $xoopsModule->dirname()!='system')
25  $xoFunc->currentModuleMenu();
26 
27 // Common Utilities module menu
28 $rmcommon_menu = $xoFunc->moduleMenu('rmcommon');
29 
30 // System module menu
31 $system_menu = $xoFunc->moduleMenu('system');
32 
33 // Other Menus
34 $other_menu = RMEvents::get()->run_event('twop6.other.menu');
35 
36 // Left Widgets
37 $left_widgets = array();
38 $left_widgets = RMEvents::get()->run_event('rmcommon.load.left.widgets', $left_widgets);
39 
40 // Right widgets
41 $right_widgets = array();
42 $right_widgets = RMEvents::get()->run_event('rmcommon.load.right.widgets', $right_widgets);
43 
44 $tp6Span = 12;
45 if($left_widgets)
46  $tp6Span -= 2;
47 
49  $tp6Span -= 3;
50 
51 $this->add_theme_style('bootstrap.min.css','twop6');
52 $this->add_theme_style('2.6.css','twop6');
53 $this->add_theme_style('font-awesome.min.css','twop6');
54 $this->add_theme_style('jquery.window.css','twop6');
55 $this->add_theme_script('bootstrap.min.js', 'twop6');
56 $this->add_theme_script('2.6.js', 'twop6');
57 $this->add_theme_script('jquery.window.min.js', 'twop6');
58 
59 // Delete unused scripts and styles
60 $content = preg_replace("/<script.*".str_replace("/",'\/', XOOPS_URL)."\/js\/.*/",'', $content);
61 $content = preg_replace("/<link.*".str_replace("/",'\/', XOOPS_URL)."\/css\/.*\/>/",'', $content);
62 
63 $tp6Alerts = array(
64  RMMSG_ERROR => 'alert-error',
65  RMMSG_INFO => 'alert-info',
66  RMMSG_OTHER => '',
67  RMMSG_SAVED => 'alert-success',
68  RMMSG_SUCCESS => 'alert-success',
69  RMMSG_WARN => 'alert-block'
70 );
71 
72 $this->add_head_script("twop6_url = '".TWOP6_URL."';");
73 $this->add_head_script("xoUrl = '".XOOPS_URL."';");
74 
75 $xoModules = include('include/modules.php');
76 
77 $sUrls = '';
78 $sNames = '';
79 foreach($xoModules as $mod){
80  $sUrls .= $sUrls=='' ? '"'.$mod['admin_link'].'"' : ',"'.$mod['admin_link'].'"';
81  $sNames .= $sNames=='' ? '"'.$mod['name'].'"' : ',"'.$mod['name'].'"';
82 }
83 
84 // rmcommon pages
85 $sUrls .= ',
86  "'.XOOPS_URL.'/modules/rmcommon/users.php",
87  "'.XOOPS_URL.'/modules/rmcommon/comments.php",
88  "'.XOOPS_URL.'/modules/rmcommon/images.php",
89  "'.XOOPS_URL.'/modules/rmcommon/modules.php",
90  "'.XOOPS_URL.'/modules/rmcommon/blocks.php",
91  "'.XOOPS_URL.'/modules/rmcommon/plugins.php"';
92 
93 $sNames .= ',
94  "'.__('Users management','twop6').'",
95  "'.__('Comments management','twop6').'",
96  "'.__('Images manager','twop6').'",
97  "'.__('Modules manager','twop6').'",
98  "'.__('Blocks manager','twop6').'",
99  "'.__('Plugins manager','twop6').'"';
100 
101 // system preferences
102 $sUrls .= ',"'.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=show&confcat_id=1",
103  "'.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=show&confcat_id=2",
104  "'.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=show&confcat_id=3",
105  "'.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=show&confcat_id=4",
106  "'.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=show&confcat_id=5",
107  "'.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=show&confcat_id=6",
108  "'.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=show&confcat_id=7"';
109 $sNames .= ',"'.__('General preferences','twop6').'",
110  "'.__('Users settings','twop6').'",
111  "'.__('Meta tags and footer','twop6').'",
112  "'.__('Word censor','twop6').'",
113  "'.__('Search options','twop6').'",
114  "'.__('Email settings','twop6').'",
115  "'.__('Authentication options','twop6').'"';
116 
117 global $rmEvents;
118 $sData = $rmEvents->run_event('twop6.get.typeahead', array('names' => $sNames, 'urls' => $sUrls));
119 
120 $this->add_head_script('var sObject = {urls: ['.$sData['urls'].'], names: ['.$sData['names'].']};');
121 
122 unset($sUrls, $sNames);
123 
124 // Has main?
125 if($xoopsModule->hasmain()){
126  $mainLink = XOOPS_URL.'/modules/'.$xoopsModule->dirname();
127  if(is_file(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/class/'.$xoopsModule->dirname().'controller.php')){
128  include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/class/'.$xoopsModule->dirname().'controller.php';
129  $class = ucfirst($xoopsModule->dirname()).'Controller';
130  if(class_exists($class)){
131  $controller = new $class();
132  $mainLink = $controller->get_main_link();
133  }
134  }
135 }
136 
137 // Display theme
138 include_once TWOP6_PATH.'/theme.php';