@@ -53,6 +53,10 @@ class Documentation
5353 */
5454 public $ db ;
5555
56+ /**
57+ * @var string
58+ */
59+ public $ baseUrl = 'admin/tools/ui ' ;
5660
5761 /**
5862 * Constructor
@@ -82,8 +86,6 @@ private function setMenu()
8286
8387 $ hookmanager ->initHooks (array ('uidocumentation ' ));
8488
85- $ baseUrl = 'admin/tools/ui ' ;
86-
8789 // Go back to Dolibarr
8890 $ this ->menu ['BackToDolibarr ' ] = array (
8991 'url ' => DOL_URL_ROOT ,
@@ -93,18 +95,18 @@ private function setMenu()
9395
9496 // Home for Ui documentation
9597 $ this ->menu ['DocumentationHome ' ] = array (
96- 'url ' => dol_buildpath ($ baseUrl .'/index.php ' , 1 ),
98+ 'url ' => dol_buildpath ($ this -> baseUrl .'/index.php ' , 1 ),
9799 'icon ' => 'fas fa-book ' ,
98100 'submenu ' => array (),
99101 );
100102
101103 // Components
102104 $ this ->menu ['Components ' ] = array (
103- 'url ' => dol_buildpath ($ baseUrl .'/components/index.php ' , 1 ),
105+ 'url ' => dol_buildpath ($ this -> baseUrl .'/components/index.php ' , 1 ),
104106 'icon ' => 'fas fa-th-large ' ,
105107 'submenu ' => array (
106108 'Badges ' => array (
107- 'url ' => dol_buildpath ($ baseUrl .'/components/badges.php ' , 1 ),
109+ 'url ' => dol_buildpath ($ this -> baseUrl .'/components/badges.php ' , 1 ),
108110 'icon ' => 'fas fa-certificate pictofixedwidth ' ,
109111 'submenu ' => array (),
110112 'summary ' => array (
@@ -118,7 +120,7 @@ private function setMenu()
118120 ),
119121 ),
120122 'Buttons ' => array (
121- 'url ' => dol_buildpath ($ baseUrl .'/components/buttons.php ' , 1 ),
123+ 'url ' => dol_buildpath ($ this -> baseUrl .'/components/buttons.php ' , 1 ),
122124 'icon ' => 'fas fa-mouse pictofixedwidth ' ,
123125 'submenu ' => array (),
124126 'summary ' => array (
@@ -128,7 +130,7 @@ private function setMenu()
128130 ),
129131 ),
130132 'Icons ' => array (
131- 'url ' => dol_buildpath ($ baseUrl .'/components/icons.php ' , 1 ),
133+ 'url ' => dol_buildpath ($ this -> baseUrl .'/components/icons.php ' , 1 ),
132134 'icon ' => 'far fa-flag pictofixedwidth ' ,
133135 'submenu ' => array (),
134136 'summary ' => array (
@@ -137,7 +139,7 @@ private function setMenu()
137139 ),
138140 ),
139141 'Progress ' => array (
140- 'url ' => dol_buildpath ($ baseUrl .'/components/progress-bars.php ' , 1 ),
142+ 'url ' => dol_buildpath ($ this -> baseUrl .'/components/progress-bars.php ' , 1 ),
141143 'icon ' => 'fas fa-battery-half pictofixedwidth ' ,
142144 'submenu ' => array (),
143145 'summary ' => array (
@@ -147,7 +149,7 @@ private function setMenu()
147149 ),
148150 ),
149151 'Event Message ' => array (
150- 'url ' => dol_buildpath ($ baseUrl .'/components/event-message.php ' , 1 ),
152+ 'url ' => dol_buildpath ($ this -> baseUrl .'/components/event-message.php ' , 1 ),
151153 'icon ' => 'fas fa-comments pictofixedwidth ' ,
152154 'submenu ' => array (),
153155 'summary ' => array (
@@ -156,12 +158,13 @@ private function setMenu()
156158 )
157159 ),
158160 'Inputs ' => array (
159- 'url ' => dol_buildpath ($ baseUrl .'/components/inputs.php ' , 1 ),
161+ 'url ' => dol_buildpath ($ this -> baseUrl .'/components/inputs.php ' , 1 ),
160162 'icon ' => 'fas fa-comments pictofixedwidth ' ,
161163 'submenu ' => array (),
162164 'summary ' => array (
163165 'DocBasicUsage ' => '#setinputssection-basicusage ' ,
164166 'DocHelperFunctionsInputUsage ' => '#setinputssection-helperfunctions ' ,
167+ 'DocHelperFunctionsGetSearchFilterToolInput ' => '#setinputssection-getSearchFilterToolInput ' ,
165168 )
166169 ),
167170 ),
@@ -172,7 +175,7 @@ private function setMenu()
172175
173176 // Elements
174177 $ this ->menu ['Content ' ] = array (
175- 'url ' => dol_buildpath ($ baseUrl .'/content/index.php ' , 1 ),
178+ 'url ' => dol_buildpath ($ this -> baseUrl .'/content/index.php ' , 1 ),
176179 'icon ' => 'fas fa-th-large ' ,
177180 'submenu ' => array (
178181 'Tables ' => array (
@@ -181,14 +184,16 @@ private function setMenu()
181184 'submenu ' => array (),
182185 'summary ' => array (
183186 'DocBasicUsage ' => '#tablesection-basicusage ' ,
184- 'DocTableWithFilters ' => '#tablesection-withfilters '
187+ 'DocTableWithFilters ' => '#tablesection-withfilters ' ,
188+ 'DocTableBeforeFilters ' => '#tablesection-beforefilters ' ,
189+ 'DocTableCSSClass ' => '#tablesection-cssclasses ' ,
185190 ),
186191 ),
187192 )
188193 );
189194
190195 $ parameters = array (
191- 'baseUrl ' => $ baseUrl ,
196+ 'baseUrl ' => $ this -> baseUrl ,
192197 );
193198 $ action = '' ;
194199
@@ -413,6 +418,13 @@ public function showCode($lines = array(), $option = 'html')
413418 {
414419 require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php ' ;
415420 print '<div class="documentation-code"> ' ;
421+
422+ if (isset ($ lines [0 ])) {
423+ if ($ option === 'html ' && strpos (strtolower ($ lines [0 ]), '<!doctype ' ) === false ) {
424+ array_unshift ($ lines , '<!DOCTYPE html> ' , '' );
425+ }
426+ }
427+
416428 $ content = implode ("\n" , $ lines ) . "\n" ;
417429 $ doleditor = new DolEditor (md5 ($ content ), $ content , '' , 0 , 'Basic ' , 'In ' , true , false , 'ace ' , 0 , '99% ' , 1 );
418430 print $ doleditor ->Create (1 , '' , false , '' , $ option );
0 commit comments