Lines Matching refs:instr

188                     $instr = array();
213 $instr = $this->_mergeWithHeaders($instr, $instructions, 1);
228 $instr = array_merge($instr, $instructions, $sitepagebreak);
231 $instr = array_merge($instr, $instructions);
235 if (!empty($instr)) {
236 if ( $this->_cleanAllInstructions($instr, true) ) {
242 // print "<pre>"; print_r($instr); print "</pre>";
243 $this->_render_output($renderer, $mode, $instr);
327 private function _render_output($renderer, $mode, $instr) {
338 $content = p_render($mode, $instr, $info);
352 foreach ($instr as $instruction) {
363 private function _convertInstructions($instr, $id, &$renderer, $depth = 1) {
367 $n = count($instr);
371 if ((substr($instr[$i][0], 0, 12) == 'internallink')) {
372 $this->_convert_link($renderer, $instr[$i], $id);
374 else if ((substr($instr[$i][0], 0, 13) == 'internalmedia')) {
375 $this->_convert_media($renderer, $instr[$i], $id);
377 else if ((substr($instr[$i][0], 0, 6) == 'header')) {
378 $this->_convert_header($renderer, $instr[$i], $depth-1); // -1 because the depth starts at 1
380 else if ((substr($instr[$i][0], 0, 12) == 'section_open')) {
381 $this->_convert_section($renderer, $instr[$i], $depth-1); // -1 because the depth starts at 1
386 if ($instr[0][0] == 'document_start')
387 return array_slice($instr, 1, -1);
389 return $instr;
395 private function _convert_link(&$renderer, &$instr, $id) {
400 resolve_pageid(getNS($id), $instr[1][0], $exists);
401 list($pageID, $pageReference) = explode("#", $instr[1][0], 2);
410 $instr[1][0] = $ID . "#" . $pageNameLink;
415 $instr = array(
417 array($instr[1][1]),
418 $instr[2]
426 private function _convert_media(&$renderer, &$instr, $id) {
431 resolve_mediaid(getNS($id), $instr[1][0], $exists);
437 private function _convert_header(&$renderer, &$instr, $depth) {
439 $instr[1][1] += $depth;
445 private function _convert_section(&$renderer, &$instr, $depth) {
447 $instr[1][0] += $depth;
575 private function _cleanAllInstructions(&$instr, $advanced=false) {
576 $this->_cleanInstructions($instr, '/p_(close|open)/');
577 $this->_cleanInstructions($instr, '/section_(close|open)/');
578 $this->_cleanInstructions($instr, '/listu_(close|open)/');
579 $this->_cleanInstructions($instr, '/listo_(close|open)/');
588 for( $i=0; $i<count($instr); $i++ ) {
590 $hasMoreEntries = count($instr)-1 > $i;
592 if ( $instr[$i][0] == 'header' ) {
597 if ( $instr[$i][1][0] == 'siteexport_toctools' && $instr[$i][1][0][0] != 'pagebreak' ) {
598 if ( $currentMergeHint != null && $instr[$i][1][1][2] == $currentMergeHint[1][1][2] ) {
600 if ( $instr[$i][1][1][1] == 'end' ) {
603 for( $ii=$i+1; $ii<count($instr); $ii++ ) {
604 if ( $instr[$ii][0] == 'header' ) {
607 } else if ( $instr[$ii][1][0] == 'siteexport_toctools' && $instr[$ii][1][0][0] != 'pagebreak' ) {
608 if ( $instr[$ii][1][1][2] == $currentMergeHint[1][1][2] && $instr[$ii][1][1][1] == 'start' ) {
621 // print "<pre>NOT Splicing away ". print_r($instr[$i], true) . "</pre>";
624 // print "<pre>Splicing away ". print_r($instr[$i], true) . "</pre>";
628 array_splice($instr, $i--, 1);
630 // print "<p>Resetting Mergehint '" . $instr[$i][1][1][2] . "' == '" . $currentMergeHint[1][1][2] . "'</p>";
631 $currentMergeHint = $instr[$i];
632 $listOfMergeHintNames[] = $instr[$i][1][1][2];
638 print "<pre>" . print_r($instr, 1) . "</pre>";
645 for( $i=0; $i<count($instr); $i++ ) {
646 if ( $instr[$i][1][0] == 'siteexport_toctools' && $instr[$i][1][0][0] != 'pagebreak' ) {
647 array_splice($instr, $i--, 1);