Changeset 3730:5c45a5df9a59 for admin/help.php
- Timestamp:
- 03/08/18 17:58:39 (8 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
admin/help.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
admin/help.php
r3647 r3730 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 12 13 require dirname(__FILE__) .'/../inc/admin/prepend.php';13 require dirname(__FILE__) . '/../inc/admin/prepend.php'; 14 14 15 15 dcPage::check('usage,contentadmin'); 16 16 17 $helpPage = function() 18 { 19 $ret = array('content' => '', 'title' => ''); 17 $helpPage = function () { 18 $ret = array('content' => '', 'title' => ''); 20 19 21 $args = func_get_args(); 22 if (empty($args)) { 23 return $ret; 24 }; 20 $args = func_get_args(); 21 if (empty($args)) { 22 return $ret; 23 } 24 ; 25 25 26 global $__resources;27 if (empty($__resources['help'])) {28 return $ret;29 }26 global $__resources; 27 if (empty($__resources['help'])) { 28 return $ret; 29 } 30 30 31 $content = ''; 32 $title = ''; 33 foreach ($args as $v) 34 { 35 if (is_object($v) && isset($v->content)) { 36 $content .= $v->content; 37 continue; 38 } 31 $content = ''; 32 $title = ''; 33 foreach ($args as $v) { 34 if (is_object($v) && isset($v->content)) { 35 $content .= $v->content; 36 continue; 37 } 39 38 40 if (!isset($__resources['help'][$v])) {41 continue;42 }43 $f = $__resources['help'][$v];44 if (!file_exists($f) || !is_readable($f)) {45 continue;46 }39 if (!isset($__resources['help'][$v])) { 40 continue; 41 } 42 $f = $__resources['help'][$v]; 43 if (!file_exists($f) || !is_readable($f)) { 44 continue; 45 } 47 46 48 $fc = file_get_contents($f);49 if (preg_match('|<body[^>]*?>(.*?)</body>|ms',$fc,$matches)) {50 $content .= $matches[1];51 if (preg_match('|<title[^>]*?>(.*?)</title>|ms',$fc,$matches)) {52 $title = $matches[1];53 }54 } else {55 $content .= $fc;56 }57 }47 $fc = file_get_contents($f); 48 if (preg_match('|<body[^>]*?>(.*?)</body>|ms', $fc, $matches)) { 49 $content .= $matches[1]; 50 if (preg_match('|<title[^>]*?>(.*?)</title>|ms', $fc, $matches)) { 51 $title = $matches[1]; 52 } 53 } else { 54 $content .= $fc; 55 } 56 } 58 57 59 if (trim($content) == '') {60 return $ret;61 }58 if (trim($content) == '') { 59 return $ret; 60 } 62 61 63 $ret['content'] = $content;64 if ($title != '') {65 $ret['title'] = $title;66 }67 return $ret;62 $ret['content'] = $content; 63 if ($title != '') { 64 $ret['title'] = $title; 65 } 66 return $ret; 68 67 }; 69 68 70 $help_page = !empty($_GET['page']) ? html::escapeHTML($_GET['page']) : 'index';69 $help_page = !empty($_GET['page']) ? html::escapeHTML($_GET['page']) : 'index'; 71 70 $content_array = $helpPage($help_page); 72 71 if (($content_array['content'] == '') || ($help_page == 'index')) { 73 $content_array = $helpPage('index');72 $content_array = $helpPage('index'); 74 73 } 75 74 if ($content_array['title'] != '') { 76 $breadcrumb = dcPage::breadcrumb(77 array(78 __('Global help')=> $core->adminurl->get("admin.help"),79 $content_array['title'] => ''80 ));75 $breadcrumb = dcPage::breadcrumb( 76 array( 77 __('Global help') => $core->adminurl->get("admin.help"), 78 $content_array['title'] => '' 79 )); 81 80 } else { 82 $breadcrumb = dcPage::breadcrumb(83 array(84 __('Global help') => ''85 ));81 $breadcrumb = dcPage::breadcrumb( 82 array( 83 __('Global help') => '' 84 )); 86 85 } 87 86 … … 89 88 -------------------------------------------------------- */ 90 89 dcPage::open(__('Global help'), 91 dcPage::jsPageTabs('first-step'),92 $breadcrumb90 dcPage::jsPageTabs('first-step'), 91 $breadcrumb 93 92 ); 94 93
Note: See TracChangeset
for help on using the changeset viewer.
