Example #1
0
function getName($filename)
{
    var_dump(preg_replace('/^\\_/', '', getPart($filename)[0]));
}
Example #2
0
<?php

// $Id$
require_once "inc/stdLib.php";
include "inc/crmLib.php";
$part = $_GET["part"];
$daten = getPart($part);
?>
<html>
    <head><title>Artikelsuche</title>
    <script language="JavaScript">
    <!--
        function auswahl() {
            nr = document.parts.Alle.selectedIndex;
            if ( nr == 0 ) return; 
            val = document.parts.Alle.options[nr].value;
            txt = document.parts.parttext.value;
            if ( txt == '' ) txt=document.parts.Alle.options[nr].text;
            qty = document.parts.qty.value;
            line = qty + " * " + txt;
            value = qty+'|'+val+'|'+txt;
            NeuerEintrag = new Option(line, value, false, true);
            opener.document.getElementById('parts').options[opener.document.getElementById('parts').length] = NeuerEintrag;
        };
        function chgtxt() {
            nr = document.parts.Alle.selectedIndex;
            if ( nr == 0 ) return; 
            txt = document.parts.Alle.options[nr].text;
            document.parts.parttext.value = txt;
        };
    //-->
Example #3
0
 private function printView()
 {
     $value = "";
     if ($this->tag["type"] == "chapter") {
         $part = getPart($this->tag["book_id"]);
         $value .= "<h3>Chapter " . $this->tag["book_id"] . ": " . $this->tag["name"] . "</h3>";
         $value .= "<p>This tag corresponds to <a href='" . href("chapter/" . $this->tag["book_id"]) . "'>Chapter " . $this->tag["book_id"] . ": " . parseAccents($this->tag["name"]) . "</a> of <a href='" . href("browse#" . partToIdentifier($part)) . "'>" . parseAccents($part) . "</a>, and contains no further text. To view the contents of the first section in this chapter, go to the next tag.</p>";
         $value .= "<p>This chapter contains the following tags</p>";
         $value .= "<div id='control'>";
         $value .= "<p><a href='#'><img src='" . href("js/jquery-treeview/images/minus.gif") . "'> Collapse all</a>";
         $value .= " ";
         $value .= "<a href='#'><img src='" . href("js/jquery-treeview/images/plus.gif") . "'> Expand all</a>";
         $value .= "</div>";
         $value .= "<div id='treeview'>";
         $value .= "<a href='" . href("tag/" . $this->tag["tag"]) . "'>Tag " . $this->tag["tag"] . "</a> points to Chapter " . $this->tag["book_id"] . ": " . parseAccents($this->tag["name"]);
         $value .= printToC($this->tag["book_id"]);
         $value .= "</div>";
         $value .= "<script type='text/javascript' src='" . href("js/chapter.js") . "'></script>";
     } else {
         // only display for non-chapters
         $value .= "<p id='code-link' class='toggle'><a href='#code'>code</a></p>";
         $value .= "<blockquote class='rendered'>";
         $value .= convertLaTeX($this->tag["tag"], $this->tag["file"], $this->tag["value"]);
         // handle footnotes
         global $footnotes;
         $value .= "<div class='footnotes'>";
         $value .= "<ol>";
         foreach ($footnotes as $i => $footnote) {
             $value .= "<li class='footnote' id='fn:" . $i . "'>" . $footnote . "<a href='#fnref:" . $i . "' title='return to main text'> &uarr;</a>";
         }
         $value .= "</ol>";
         $value .= "</div>";
         $value .= "</blockquote>";
     }
     // only display for non-chapters
     if ($this->tag["type"] != "chapter") {
         $value .= "<p id='rendered-link' class='toggle'><a href='#rendered'>view</a></p>";
         $value .= "<div id='code'>";
         $value .= "<p>The code snippet corresponding to this tag is a part of the file <a href='https://github.com/stacks/stacks-project/blob/master/" . $this->tag["file"] . ".tex'><var>" . $this->tag["file"] . ".tex</var></a> and is located in <a href='https://github.com/stacks/stacks-project/blob/master/" . $this->tag["file"] . ".tex#L" . $this->tag["begin"] . "-" . $this->tag["end"] . "'>lines " . $this->tag["begin"] . "&ndash;" . $this->tag["end"] . "</a> (see <a href='" . href("tags#stacks-epoch") . "'>updates</a> for more information).";
         $value .= "<pre><code>";
         $code = preprocessCode($this->tag["value"]);
         // link labels to the corresponding tag
         $count = preg_match_all('/\\\\label{([\\w-\\*]+)}/', $code, $references);
         for ($i = 0; $i < $count; ++$i) {
             $code = str_replace($references[0][$i], "\\label{<a href='" . href("tag/" . getTagWithLabel($this->tag["file"] . "-" . $references[1][$i])) . "'>" . $references[1][$i] . "</a>}", $code);
         }
         $value .= $code;
         $value .= "</code></pre>";
         $value .= "</div>";
     }
     $value .= $this->printNavigation();
     return $value;
 }