Lines Matching refs:ins
255 $ins = array(
261 $ins = array(array('internallink', array(':'.$key,$title)));
264 $ins = array();
271 $ins = p_cached_instructions(wikiFN($page), false, $page);
274 $ins = array();
277 … $this->_convert_instructions($ins, $lvl, $page, $sect, $flags, $root_id, $included_pages);
279 return $ins;
295 …function _convert_instructions(&$ins, $lvl, $page, $sect, $flags, $root_id, $included_pages = arra… argument
300 $this->_get_section($ins, $sect); // section required
304 $this->_get_firstsec($ins, $page, $flags); // only first section
307 $num = count($ins);
316 $this->adapt_links($ins, $page, $included_pages);
319 switch($ins[$i][0]) {
323 unset($ins[$i]);
328 $sect_title = $ins[$i][1][0];
339 if(!$lvl_max || ($ins[$i][1][1] < $lvl_max)) {
340 $lvl_max = $ins[$i][1][1];
345 unset($ins[$i]);
351 unset($ins[$i]);
354 $this->adapt_links($ins[$i][1][0], $page, $included_pages);
358 switch($ins[$i][1][0]) {
366 unset($ins[$i]);
371 $ins[$i][1][1][4] += $lvl;
380 $endpos = $ins[$i][1][1][0];
381 unset($ins[$i]);
403 if($ins[$idx][0] == 'header') {
404 … if ($section_close_at === false && isset($ins[$idx+1]) && $ins[$idx+1][0] == 'section_open') {
411 unset ($ins[$idx]);
417 $lvl_new = (($ins[$idx][1][1] + $diff) > 5) ? 5 : ($ins[$idx][1][1] + $diff);
418 $ins[$idx][1][1] = $lvl_new;
421 if($ins[$idx][1][1] <= $conf['maxseclevel'])
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 array_push($ins, array('plugin', array('include_closelastsecedit', array($endpos))));
465 …$this->_editbtn($ins, $page, $sect, $sect_title, ($flags['redirect'] ? $root_id : false), $include…
470 $ins[] = $this->_footer($page, $sect, $sect_title, $flags, $footer_lvl, $root_id);
476 $ins[] = array('section_close', array());
477 array_unshift($ins, array('section_open', array($lvl)));
479 $section_close_idx = array_search($section_close_at, array_keys($ins));
481 $before_ins = array_slice($ins, 0, $section_close_idx);
482 $after_ins = array_slice($ins, $section_close_idx);
483 … $ins = array_merge($before_ins, array(array('section_close', array())), $after_ins);
484 array_unshift($ins, array('section_open', array($lvl)));
490 …array_unshift($ins, array('plugin', array('include_wrap', array('open', $page, $flags['redirect'],…
492 array_unshift($ins, array('entity', array($flags['beforeeach'])));
493 array_push($ins, array('plugin', array('include_wrap', array('close'))));
495 array_push($ins, array('entity', array($flags['aftereach'])));
499 array_unshift($ins, array('section_close', array()));
500 $ins[] = array('section_open', array($lvl));
521 function _editbtn(&$ins, $page, $sect, $sect_title, $root_id, $hid = '') { argument
526 $ins[] = $editbtn;
534 function _permalink(&$ins, $page, $sect, $flags) { argument
535 $ins[0] = 'plugin';
536 …$ins[1] = array('include_header', array($ins[1][0], $ins[1][1], $ins[1][2], $page, $sect, $flags));
542 * @param array $ins The instructions that shall be adapted
546 private function adapt_links(&$ins, $page, $included_pages = null) { argument
547 $num = count($ins);
551 …if (strpos($ins[$i][0], 'link') !== false && isset($ins[$i][1][1]) && is_array($ins[$i][1][1]) && …
553 $media_id = (new GenericResolver($page))->resolveId($ins[$i][1][1]['src']);
556 $ins[$i][1][1]['src'] = $media_id;
558 switch($ins[$i][0]) {
563 $link_id = $ins[$i][1][0];
574 $ins[$i][1][0] = ($link_params != '') ? $link_id.'?'.$link_params : $link_id;
576 if ($ins[$i][0] == 'internallink' && !empty($included_pages)) {
579 $link_id = $ins[$i][1][0];
592 $ins[$i][0] = 'locallink';
593 $ins[$i][1][0] = $hash;
597 $ins[$i][0] = 'plugin';
598 …$ins[$i][1] = array('include_locallink', array($included_pages[$link_id]['hid'], $ins[$i][1][1], $…
607 $ins[$i][0] = 'internallink';
608 $ins[$i][1][0] = ':'.$page.'#'.$ins[$i][1][0];
620 function _get_section(&$ins, $sect) { argument
621 $num = count($ins);
630 if ($ins[$i][0] == 'header') {
633 if (sectionID($ins[$i][1][0], $check) == $sect) {
635 $lvl = $ins[$i][1][1];
636 } elseif ($offset && $lvl && ($ins[$i][1][1] <= $lvl)) {
638 …$endpos = $ins[$i][1][2]; // the position directly after the found section, needed for the section…
645 if(is_array($ins)) {
646 $ins = array_slice($ins, $offset, $end);
648 $ins[] = array('plugin', array('include_closelastsecedit', array($endpos)));
657 function _get_firstsec(&$ins, $page, $flags) { argument
658 $num = count($ins);
662 if($ins[$i][0] == 'section_close') {
665 if ($ins[$i][0] == 'header') {
672 $endpos = $ins[$i][1][2];
676 if(($first_sect) && ($ins[$i][0] == 'section_open')) {
677 $ins = array_slice($ins, 0, $first_sect);
679 $ins[] = array('plugin', array('include_readmore', array($page)));
681 $ins[] = array('section_close', array());
683 $ins[] = array('plugin', array('include_closelastsecedit', array($endpos)));