@@ -60,10 +60,7 @@ public function __construct($id, $mode, \Doku_Renderer $renderer, SearchConfig $
6060 $ this ->mode = $ mode ;
6161 $ this ->renderer = $ renderer ;
6262 $ this ->searchConfig = $ searchConfig ;
63- $ this ->data = $ searchConfig ->getConf ();
64- $ this ->columns = $ searchConfig ->getColumns ();
65- $ this ->result = $ this ->searchConfig ->execute ();
66- $ this ->resultCount = $ this ->searchConfig ->getCount ();
63+ $ this ->data = $ this ->searchConfig ->getConf ();
6764 $ this ->helper = plugin_load ('helper ' , 'struct_config ' );
6865 }
6966
@@ -104,6 +101,15 @@ public function getScopeClasses()
104101 return $ classes ;
105102 }
106103
104+ public function executeSearch ()
105+ {
106+ $ this ->columns = $ this ->searchConfig ->getColumns ();
107+ $ this ->result = $ this ->searchConfig ->execute ();
108+ $ this ->resultCount = $ this ->searchConfig ->getCount ();
109+
110+ $ this ->postSearch ();
111+ }
112+
107113 /**
108114 * Render the actual output to the renderer
109115 *
@@ -120,6 +126,9 @@ abstract public function render($showNotFound = false);
120126 */
121127 public function startScope ()
122128 {
129+ if ($ this ->mode !== 'metadata ' ) {
130+ $ this ->executeSearch ();
131+ }
123132 if ($ this ->mode == 'xhtml ' ) {
124133 $ classes = $ this ->getScopeClasses ();
125134
@@ -130,6 +139,16 @@ public function startScope()
130139 }
131140 }
132141
142+ /**
143+ * Child classes can set their own class properties based on search result
144+ *
145+ * @return void
146+ */
147+ public function postSearch ()
148+ {
149+ return ;
150+ }
151+
133152 /**
134153 * Closes anything opened in startScope()
135154 *
0 commit comments