XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
help.php
Go to the documentation of this file.
1 <?php
18 // Include header
19 include 'header.php';
20 
21 $page = system_CleanVars ( $_REQUEST, 'page', '', 'string' );
22 $mid = system_CleanVars ( $_REQUEST, 'mid', 0, 'int' );
23 
24 // Define main template
25 $xoopsOption['template_main'] = 'system_help.html';
27 // Define Stylesheet
28 $xoTheme->addStylesheet( XOOPS_URL . '/modules/system/css/admin.css' );
29 $xoTheme->addStylesheet( XOOPS_URL . '/modules/system/css/help.css' );
30 // Define Breadcrumb and tips
31 $xoBreadCrumb->addLink( _AM_SYSTEM_HELP, 'help.php' );
32 
33 if ( $mid > 0 ) {
34  $module_handler =& xoops_gethandler('module');
36 
37  $xoBreadCrumb->addLink( $module->getVar('name'), 'help.php?mid=' . $module->getVar('mid', 's') );
38  $xoBreadCrumb->addLink( system_adminVersion( $page, 'name' ) );
39  $xoBreadCrumb->render();
40 
41  if ( $module->getVar('dirname', 'e') == 'system' ) {
42 
43  xoops_load('xoopslists');
44 
45  $admin_dir = XOOPS_ROOT_PATH . '/modules/system/admin';
46  $dirlist = XoopsLists::getDirListAsArray($admin_dir);
47 
48  foreach($dirlist as $directory) {
49  if ( file_exists( $admin_dir . '/' . $directory . '/xoops_version.php' ) ) {
50 
51  require $admin_dir . '/' . $directory . '/xoops_version.php';
52 
53  if ($modversion['help']) {
54  $help['name'] = system_adminVersion( $directory, 'name' );
55  $help['link'] = 'help.php?mid=' . $mid . '&amp;' . system_adminVersion( $directory, 'help' );;
56  $xoopsTpl->append_by_ref( 'help', $help );
57  unset($help);
58  }
59  unset($modversion);
60  }
61  }
62  unset($dirlist);
63  } else {
64  $help = $module->toArray();
65  //$help['name'] = $module->getVar('dirname', 's');
66  $help['link'] = 'help.php?mid=' . $mid . '&amp;' . $module->getInfo('help');
67  $xoopsTpl->append_by_ref( 'help', $help );
68  unset($help);
69  }
70 
71  $xoopsTpl->assign( 'modname', $module->getVar('name') );
72 
73  if ( $page != '' ) {
74  // Call template
75  if ( file_exists( XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.html' ) ) {
76  $helpcontent = $xoopsTpl->fetch( XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.html' );
77  }else{
78  if ( file_exists( XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.html' ) ) {
79  $helpcontent = $xoopsTpl->fetch(XOOPS_ROOT_PATH.'/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.html');
80  } else {
81  $xoopsTpl->assign('load_error', 1);
82  }
83  }
84 
85  $xoopsTpl->assign('helpcontent', $helpcontent);
86 
87  } else {
88  if ( file_exists( XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/module_index.html' ) ) {
89  $helpcontent = $xoopsTpl->fetch( XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/module_index.html' );
90  }else{
91  $helpcontent = $module->getInfo('description');
92  $helpcontent = '<div id="non-modhelp">' . $helpcontent . '</div>';
93  }
94 
95  $xoopsTpl->assign('helpcontent', $helpcontent);
96 
97  }
98 
99 } else {
100  $xoBreadCrumb->render();
101  // Get Module Handler
104  $criteria->setOrder('weight');
105  // Get all installed modules
107  $listed_mods = array();
108  $i = 0;
109  $j = 0;
110  foreach ( $installed_mods as $module ) {
111  $list_help = array();
112  $listed_mods[$i] = $module->toArray();
113  $listed_mods[$i]['image'] = $module->getInfo('image');
114  $listed_mods[$i]['adminindex'] = $module->getInfo('adminindex');
115  $listed_mods[$i]['version'] = round( $module->getVar('version') / 100, 2 );
116  $listed_mods[$i]['last_update'] = formatTimestamp( $module->getVar('last_update'), 'm' );
117  $listed_mods[$i]['author'] = $module->getInfo('author');
118  $listed_mods[$i]['credits'] = $module->getInfo('credits');
119  $listed_mods[$i]['license'] = $module->getInfo('license');
120  $listed_mods[$i]['description'] = $module->getInfo('description');
121 
122  if ( $module->getVar('dirname', 'e') == 'system' ) {
123  xoops_load('xoopslists');
124 
125  $admin_dir = XOOPS_ROOT_PATH . '/modules/system/admin';
126  $dirlist = XoopsLists::getDirListAsArray($admin_dir);
127 
128  foreach($dirlist as $directory) {
129  if ( file_exists( $admin_dir . '/' . $directory . '/xoops_version.php' ) ) {
130 
131  require $admin_dir . '/' . $directory . '/xoops_version.php';
132 
133  if ($modversion['help']) {
134  $list_help[$j]['name'] = system_adminVersion( $directory, 'name' );
135  $list_help[$j]['link'] = 'help.php?mid=' . $module->getVar('mid', 'e') . '&amp;' . system_adminVersion( $directory, 'help' );
136  }
137  unset($modversion);
138  $j++;
139  }
140  }
141  unset($dirlist);
142  } else {
143  if ( $module->getInfo('help') != '' ) {
144  $list_help[$j]['name'] = $module->getVar('dirname', 's');
145  $list_help[$j]['link'] = 'help.php?mid=' . $module->getVar('mid', 'e') . '&amp;' . $module->getInfo('help');
146  }
147  }
148  $listed_mods[$i]['help_page'] = $list_help;
149  if ( $module->getInfo('help') == '' ) {
150  unset($listed_mods[$i]);
151  }
152  unset($list_help);
153  unset($module);
154  $i++;
155  $j++;
156  }
157  $xoopsTpl->assign('list_mods', $listed_mods);
158 
159  if ( file_exists( XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/help/help_center.html' ) ) {
160  $helpcontent = $xoopsTpl->fetch( XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/help/help_center.html' );
161  }else{
162  $helpcontent = '<div id="non-modhelp">' . _MD_CPANEL_HELPCENTER . '</div>';
163  }
164 
165  $xoopsTpl->assign('helpcontent', $helpcontent);
166 }
168 
169 ?>