Lines Matching refs:ins

153     function parse_instructions($id, &$ins)
158 $num = count($ins);
170 if ($ins[$i][0] == 'section_open') {
171 $lvl = $ins[$i][1][0];
175 if ($ins[$i][0] == 'plugin' && $ins[$i][1][0] == 'mediasyntax_include') {
179 $mode = $ins[$i][1][1][0];
182 $ns = str_replace(':', '/', cleanID($ins[$i][1][1][1]));
184 $flags = $ins[$i][1][1][3];
195 $ins_start = array_slice($ins, 0, $i + 1);
196 $ins_end = array_slice($ins, $i + 1);
197 $ins = array_merge($ins_start, $ins_inc, $ins_end);
199 unset($ins[$i]);
209 $tag = $ins[$i][1][1][1];
211 $flags = $ins[$i][1][1][3];
221 $ins_start = array_slice($ins, 0, $i + 1);
222 $ins_end = array_slice($ins, $i + 1);
223 $ins = array_merge($ins_start, $ins_inc, $ins_end);
225 unset($ins[$i]);
230 $page = cleanID($this->_apply_macro($ins[$i][1][1][1]));
237 $sect = $ins[$i][1][1][2];
238 $flags = $ins[$i][1][1][3];
241 $ins[$i][1][1][4] = $scope;
247 $ins[$i] = $this->_footer($page, $sect, '', $flags, 0);
249 unset($ins[$i]);
255 $ins_start = array_slice($ins, 0, $i + 1);
256 $ins_end = array_slice($ins, $i + 1);
258 $ins = array_merge($ins_start, $ins_inc, $ins_end);
259 $num = count($ins);
289 array_push($ins, $ins_meta);
303 $ins = p_cached_instructions(wikiFN($page));
305 $this->_convert_instructions($ins, $lvl, $page, $sect, $flags);
306 return $ins;
323 function _convert_instructions(&$ins, $lvl, $page, $sect, $flags)
328 $this->_get_section($ins, $sect); // section required
332 $this->_get_firstsec($ins, $page); // only first section
336 $num = count($ins);
345 switch ($ins[$i][0]) {
349 unset($ins[$i]);
354 $sect_title = $ins[$i][1][0];
365 if (!$lvl_max || ($ins[$i][1][1] < $lvl_max)) {
366 $lvl_max = $ins[$i][1][1];
374 if ($ins[$i][1][0][0] == '.') {
375 if ($ins[$i][1][0][1] == '.') {
376 $ins[$i][1][0] = getNS($ns) . ':' . substr($ins[$i][1][0], 2); // parent namespace
378 $ins[$i][1][0] = $ns . ':' . substr($ins[$i][1][0], 1); // current namespace
380 } elseif (strpos($ins[$i][1][0], ':') === false) {
381 $ins[$i][1][0] = $ns . ':' . $ins[$i][1][0]; // relative links
386 switch ($ins[$i][1][0]) {
392 unset($ins[$i]);
412 if ($ins[$idx][0] == 'header') {
414 unset($ins[$idx]);
420 $lvl_new = (($ins[$idx][1][1] + $diff) > 5) ? 5 : ($ins[$idx][1][1] + $diff);
421 $ins[$idx][1][1] = $lvl_new;
426 $this->_permalink($ins[$idx], $page, $sect, $flags);
441 $lvl_new = (($ins[$idx][1][0] + $diff) > 5) ? 5 : ($ins[$idx][1][0] + $diff);
442 $ins[$idx][1][0] = $lvl_new;
458 $this->_editbtn($ins, $page, $sect, $sect_title);
463 $ins[] = $this->_footer($page, $sect, $sect_title, $flags, $footer_lvl);
467 array_unshift($ins, array('plugin', array('include_div', array('open', $page))));
468 array_push($ins, array('plugin', array('include_div', array('close'))));
472 array_unshift($ins, array('section_close', array()));
473 $ins[] = array('section_open', array($lvl));
482 function _append_includeins(&$ins, $id, $flags)
492 $ins = array_merge($ins, array($ins_tmp));
514 function _editbtn(&$ins, $page, $sect, $sect_title)
519 $ins[] = $editbtn;
527 function _permalink(&$ins, $page, $sect, $flags)
529 $ins[0] = 'plugin';
530 $ins[1] = array('mediasyntax_header', array($ins[1][0], $ins[1][1], $page, $sect, $flags));
538 function _get_section(&$ins, $sect)
540 $num = count($ins);
546 if ($ins[$i][0] == 'header') {
549 if (cleanID($ins[$i][1][0]) == $sect) {
551 $lvl = $ins[$i][1][1];
552 } elseif ($offset && $lvl && ($ins[$i][1][1] <= $lvl)) {
560 if (is_array($ins)) {
561 $ins = array_slice($ins, $offset, $end);
570 function _get_firstsec(&$ins, $page)
572 $num = count($ins);
575 if ($ins[$i][0] == 'section_close') {
578 if (($first_sect) && ($ins[$i][0] == 'section_open')) {
579 $ins = array_slice($ins, 0, $first_sect);
580 $ins[] = array('p_open', array());
581 $ins[] = array('internallink', array($page, $this->getLang('readmore')));
582 $ins[] = array('p_close', array());
583 $ins[] = array('section_close', array());