/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Freelink.php |
---|
New file |
0,0 → 1,34 |
<?php |
class Text_Wiki_Render_Latex_Freelink extends Text_Wiki_Render { |
var $conf = array( |
'pages' => array(), |
'view_url' => 'http://example.com/index.php?page=%s', |
'new_url' => 'http://example.com/new.php?page=%s', |
'new_text' => '?' |
); |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
// get nice variable names (page, text, anchor) |
extract($options); |
return "$text\\footnote\{$anchor} "; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Newline.php |
---|
New file |
0,0 → 1,12 |
<?php |
class Text_Wiki_Render_Latex_Newline extends Text_Wiki_Render { |
function token($options) |
{ |
return "\n"; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Url.php |
---|
New file |
0,0 → 1,35 |
<?php |
class Text_Wiki_Render_Latex_Url extends Text_Wiki_Render { |
var $conf = array( |
'target' => false, |
'images' => true, |
'img_ext' => array('jpg', 'jpeg', 'gif', 'png') |
); |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
// create local variables from the options array (text, |
// href, type) |
extract($options); |
return " $text\\footnote\{$href}"; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Emphasis.php |
---|
New file |
0,0 → 1,29 |
<?php |
class Text_Wiki_Render_Latex_Emphasis extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
if ($options['type'] == 'start') { |
return '\textsl{'; |
} |
if ($options['type'] == 'end') { |
return '}'; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Code.php |
---|
New file |
0,0 → 1,26 |
<?php |
class Text_Wiki_Render_Latex_Code extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
$text = $options['text']; |
return "\\begin{verbatim}\n$text\n\\end{verbatim}\n\n"; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Strong.php |
---|
New file |
0,0 → 1,30 |
<?php |
class Text_Wiki_Render_Latex_Strong extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
if ($options['type'] == 'start') { |
return '\textbf{'; |
} |
if ($options['type'] == 'end') { |
return '}'; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Center.php |
---|
New file |
0,0 → 1,33 |
<?php |
class Text_Wiki_Render_Latex_Center extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
return 'Center: NI'; |
if ($options['type'] == 'start') { |
//return "\n<center>\n"; |
return '<div style="text-align: center;">'; |
} |
if ($options['type'] == 'end') { |
//return "</center>\n"; |
return '</div>'; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Phplookup.php |
---|
New file |
0,0 → 1,34 |
<?php |
class Text_Wiki_Render_Latex_Phplookup extends Text_Wiki_Render { |
var $conf = array('target' => '_blank'); |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
return 'Phplookup: NI'; |
$text = trim($options['text']); |
$target = $this->getConf('target', ''); |
if ($target) { |
$target = " target=\"$target\""; |
} |
return "<a$target href=\"http://php.net/$text\">$text</a>"; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Superscript.php |
---|
New file |
0,0 → 1,31 |
<?php |
class Text_Wiki_Render_Latex_Superscript extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
return 'Superscript: NI'; |
if ($options['type'] == 'start') { |
return '<sup>'; |
} |
if ($options['type'] == 'end') { |
return '</sup>'; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Include.php |
---|
New file |
0,0 → 1,8 |
<?php |
class Text_Wiki_Render_Latex_Include extends Text_Wiki_Render { |
function token() |
{ |
return ''; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Colortext.php |
---|
New file |
0,0 → 1,58 |
<?php |
class Text_Wiki_Render_Latex_Colortext extends Text_Wiki_Render { |
var $colors = array( |
'aqua', |
'black', |
'blue', |
'fuchsia', |
'gray', |
'green', |
'lime', |
'maroon', |
'navy', |
'olive', |
'purple', |
'red', |
'silver', |
'teal', |
'white', |
'yellow' |
); |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
return 'Colortext: NI'; |
$type = $options['type']; |
$color = $options['color']; |
if (! in_array($color, $this->colors)) { |
$color = '#' . $color; |
} |
if ($type == 'start') { |
return "<span style=\"color: $color;\">"; |
} |
if ($options['type'] == 'end') { |
return '</span>'; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Break.php |
---|
New file |
0,0 → 1,24 |
<?php |
class Text_Wiki_Render_Latex_Break extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
return "\\newline\n"; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Toc.php |
---|
New file |
0,0 → 1,30 |
<?php |
class Text_Wiki_Render_Latex_Toc extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
if($options['type'] == 'list_start') { |
return "\\tableofcontents\n\n"; |
} |
return ''; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Function.php |
---|
New file |
0,0 → 1,23 |
<?php |
class Text_Wiki_Render_Latex_Function extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
return "Function: NI"; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Table.php |
---|
New file |
0,0 → 1,93 |
<?php |
class Text_Wiki_Render_Latex_Table extends Text_Wiki_Render { |
var $cell_id = 0; |
var $cell_count = 0; |
var $is_spanning = false; |
var $conf = array( |
'css_table' => null, |
'css_tr' => null, |
'css_th' => null, |
'css_td' => null |
); |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
// make nice variable names (type, attr, span) |
extract($options); |
switch ($type) |
{ |
case 'table_start': |
$this->cell_count = $cols; |
$tbl_start = '\begin{tabular}{|'; |
for ($a=0; $a < $this->cell_count; $a++) { |
$tbl_start .= 'l|'; |
} |
$tbl_start .= "}\n"; |
return $tbl_start; |
case 'table_end': |
return "\\hline\n\\end{tabular}\n"; |
case 'row_start': |
$this->is_spanning = false; |
$this->cell_id = 0; |
return "\\hline\n"; |
case 'row_end': |
return "\\\\\n"; |
case 'cell_start': |
if ($span > 1) { |
$col_spec = ''; |
if ($this->cell_id == 0) { |
$col_spec = '|'; |
} |
$col_spec .= 'l|'; |
$this->cell_id += $span; |
$this->is_spanning = true; |
return "\\multicolumn\{$span}\{$col_spec}{"; |
} |
$this->cell_id += 1; |
return ''; |
case 'cell_end': |
$out = ''; |
if ($this->is_spanning) { |
$this->is_spanning = false; |
$out = '}'; |
} |
if ($this->cell_id != $this->cell_count) { |
$out .= ' & '; |
} |
return $out; |
default: |
return ''; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Raw.php |
---|
New file |
0,0 → 1,23 |
<?php |
class Text_Wiki_Render_Latex_Raw extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
return "Raw: ".$options['text']; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Deflist.php |
---|
New file |
0,0 → 1,53 |
<?php |
class Text_Wiki_Render_Latex_Deflist extends Text_Wiki_Render { |
var $conf = array( |
'css_dl' => null, |
'css_dt' => null, |
'css_dd' => null |
); |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
$type = $options['type']; |
switch ($type) |
{ |
case 'list_start': |
return "\\begin{description}\n"; |
case 'list_end': |
return "\\end{description}\n\n"; |
case 'term_start': |
return '\item['; |
case 'term_end': |
return '] '; |
case 'narr_start': |
return '{'; |
case 'narr_end': |
return "}\n"; |
default: |
return ''; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Horiz.php |
---|
New file |
0,0 → 1,23 |
<?php |
class Text_Wiki_Render_Latex_Horiz extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
return "\n\\noindent\\rule{\\textwidth}{1pt}\n"; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Prefilter.php |
---|
New file |
0,0 → 1,40 |
<?php |
/* vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +----------------------------------------------------------------------+ |
// | PHP version 4 | |
// +----------------------------------------------------------------------+ |
// | Copyright (c) 1997-2003 The PHP Group | |
// +----------------------------------------------------------------------+ |
// | This source file is subject to version 2.0 of the PHP license, | |
// | that is bundled with this package in the file LICENSE, and is | |
// | available through the world-wide-web at | |
// | http://www.php.net/license/2_02.txt. | |
// | If you did not receive a copy of the PHP license and are unable to | |
// | obtain it through the world-wide-web, please send a note to | |
// | license@php.net so we can mail you a copy immediately. | |
// +----------------------------------------------------------------------+ |
// | Authors: Jeremy Cowgar <jeremy@cowgar.com> | |
// +----------------------------------------------------------------------+ |
// |
// $Id: Prefilter.php,v 1.1 2005-01-20 19:43:20 jpm Exp $ |
/** |
* |
* This class implements a Text_Wiki_Render_Latex to "pre-filter" source text so |
* that line endings are consistently \n, lines ending in a backslash \ |
* are concatenated with the next line, and tabs are converted to spaces. |
* |
* @author Jeremy Cowgar <jeremy@cowgar.com> |
* |
* @package Text_Wiki |
* |
*/ |
class Text_Wiki_Render_Latex_Prefilter extends Text_Wiki_Render { |
function token() |
{ |
return ''; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Heading.php |
---|
New file |
0,0 → 1,33 |
<?php |
class Text_Wiki_Render_Latex_Heading extends Text_Wiki_Render { |
function token($options) |
{ |
// get nice variable names (type, level) |
extract($options); |
if ($type == 'start') { |
switch ($level) |
{ |
case '1': |
return '\part{'; |
case '2': |
return '\section{'; |
case '3': |
return '\subsection{'; |
case '4': |
return '\subsubsection{'; |
case '5': |
return '\paragraph{'; |
case '6': |
return '\subparagraph{'; |
} |
} |
if ($type == 'end') { |
return "}\n"; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Tighten.php |
---|
New file |
0,0 → 1,9 |
<?php |
class Text_Wiki_Render_Latex_Tighten extends Text_Wiki_Render { |
function token() |
{ |
return ''; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Html.php |
---|
New file |
0,0 → 1,25 |
<?php |
class Text_Wiki_Render_Latex_Html extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
print_r($this); |
return ''; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Interwiki.php |
---|
New file |
0,0 → 1,60 |
<?php |
class Text_Wiki_Render_Latex_Interwiki extends Text_Wiki_Render { |
var $conf = array( |
'sites' => array( |
'MeatBall' => 'http://www.usemod.com/cgi-bin/mb.pl?%s', |
'Advogato' => 'http://advogato.org/%s', |
'Wiki' => 'http://c2.com/cgi/wiki?%s' |
), |
'target' => '_blank' |
); |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
$site = $options['site']; |
$page = $options['page']; |
$text = $options['text']; |
if (isset($this->conf['sites'][$site])) { |
$href = $this->conf['sites'][$site]; |
} else { |
return $text; |
} |
// old form where page is at end, |
// or new form with %s placeholder for sprintf()? |
if (strpos($href, '%s') === false) { |
// use the old form |
$href = $href . $page; |
} else { |
// use the new form |
$href = sprintf($href, $page); |
} |
// allow for alternative targets |
$target = $this->getConf('target', ''); |
if ($target && trim($target) != '') { |
$target = " target=\"$target\""; |
} |
return "$text\\footnote\{$href}"; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Italic.php |
---|
New file |
0,0 → 1,5 |
<?php |
class Text_Wiki_Render_Latex_Italic extends Text_Wiki_Render_Latex_Emphasis { |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Paragraph.php |
---|
New file |
0,0 → 1,31 |
<?php |
class Text_Wiki_Render_Latex_Paragraph extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
extract($options); //type |
if ($type == 'start') { |
return ''; |
} |
if ($type == 'end') { |
return "\n\n"; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Blockquote.php |
---|
New file |
0,0 → 1,36 |
<?php |
class Text_Wiki_Render_Latex_Blockquote extends Text_Wiki_Render { |
var $conf = array('css' => null); |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
$type = $options['type']; |
$level = $options['level']; |
// starting |
if ($type == 'start') { |
return "\\begin{quote}\n"; |
} |
// ending |
if ($type == 'end') { |
return "\\end{quote}\n\n"; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Anchor.php |
---|
New file |
0,0 → 1,33 |
<?php |
/** |
* |
* This class renders an anchor target name in LaTeX. |
* |
* $Id: Anchor.php,v 1.1 2005-01-20 19:43:20 jpm Exp $ |
* |
* @author Jeremy Cowgar <jeremy@cowgar.com> |
* |
* @package Text_Wiki |
* |
*/ |
class Text_Wiki_Render_Latex_Anchor extends Text_Wiki_Render { |
function token($options) |
{ |
extract($options); // $type, $name |
if ($type == 'start') { |
//return sprintf('<a id="%s">',$name); |
return ''; |
} |
if ($type == 'end') { |
//return '</a>'; |
return ''; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/List.php |
---|
New file |
0,0 → 1,57 |
<?php |
class Text_Wiki_Render_Latex_List extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* This rendering method is syntactically and semantically compliant |
* with XHTML 1.1 in that sub-lists are part of the previous list item. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
// make nice variables (type, level, count) |
extract($options); |
switch ($type) |
{ |
case 'bullet_list_start': |
return "\\begin{itemize}\n"; |
case 'bullet_list_end': |
return "\\end{itemize}\n"; |
case 'number_list_start': |
return "\\begin{enumerate}\n"; |
case 'number_list_end': |
return "\\end{enumerate}\n"; |
case 'bullet_item_start': |
case 'number_item_start': |
return "\\item{"; |
case 'bullet_item_end': |
case 'number_item_end': |
return "}\n"; |
default: |
// ignore item endings and all other types. |
// item endings are taken care of by the other types |
// depending on their place in the list. |
return ''; |
break; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Embed.php |
---|
New file |
0,0 → 1,23 |
<?php |
class Text_Wiki_Render_Latex_Embed extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
return "Embed: ".$options['text']; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Delimiter.php |
---|
New file |
0,0 → 1,25 |
<?php |
class Text_Wiki_Render_Latex_Delimiter extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
// TODO: Is this where I can do some LaTeX escaping for items |
// such as $ { } _ ? |
return "Delimiter: ".$options['text']; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Bold.php |
---|
New file |
0,0 → 1,4 |
<?php |
class Text_Wiki_Render_Latex_Bold extends Text_Wiki_Render_Latex_Strong {} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Wikilink.php |
---|
New file |
0,0 → 1,60 |
<?php |
class Text_Wiki_Render_Latex_Wikilink extends Text_Wiki_Render { |
var $conf = array( |
'pages' => array(), |
'view_url' => 'http://example.com/index.php?page=%s', |
'new_url' => 'http://example.com/new.php?page=%s', |
'new_text' => '?' |
); |
/** |
* |
* Renders a token into XHTML. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
// make nice variable names (page, anchor, text) |
extract($options); |
// are we checking page existence? |
$list =& $this->getConf('pages'); |
if (is_array($list)) { |
// yes, check against the page list |
$exists = in_array($page, $list); |
} else { |
// no, assume it exists |
$exists = true; |
} |
// convert *after* checking against page names so as not to mess |
// up what the user typed and what we're checking. |
$page = htmlspecialchars($page); |
$anchor = htmlspecialchars($anchor); |
$text = htmlspecialchars($text); |
$href = $this->getConf('view_url'); |
if (strpos($href, '%s') === false) { |
// use the old form (page-at-end) |
$href = $href . $page . $anchor; |
} else { |
// use the new form (sprintf format string) |
$href = sprintf($href, $page . $anchor); |
} |
// get the CSS class and generate output |
$css = $this->formatConf(' class="%s"', 'css'); |
return "$text\\footnote\{$href}"; |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Image.php |
---|
New file |
0,0 → 1,70 |
<?php |
class Text_Wiki_Render_Latex_Image extends Text_Wiki_Render { |
var $conf = array( |
'base' => '/' |
); |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
return 'Image: NI'; |
$src = '"' . |
$this->getConf('base', '/') . |
$options['src'] . '"'; |
if (isset($options['attr']['link'])) { |
// this image has a link |
if (strpos($options['attr']['link'], '://')) { |
// it's a URL |
$href = $options['attr']['link']; |
} else { |
$href = $this->wiki->getRenderConf('xhtml', 'wikilink', 'view_url') . |
$options['attr']['link']; |
} |
} else { |
// image is not linked |
$href = null; |
} |
// unset these so they don't show up as attributes |
unset($options['attr']['link']); |
$attr = ''; |
$alt = false; |
foreach ($options['attr'] as $key => $val) { |
if (strtolower($key) == 'alt') { |
$alt = true; |
} |
$attr .= " $key=\"$val\""; |
} |
// always add an "alt" attribute per Stephane Solliec |
if (! $alt) { |
$attr .= ' alt="' . basename($options['src']) . '"'; |
} |
if ($href) { |
return "<a href=\"$href\"><img src=$src$attr/></a>"; |
} else { |
return "<img src=$src$attr/>"; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Tt.php |
---|
New file |
0,0 → 1,30 |
<?php |
class Text_Wiki_Render_Latex_tt extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
if ($options['type'] == 'start') { |
return '\texttt{'; |
} |
if ($options['type'] == 'end') { |
return '}'; |
} |
} |
} |
?> |
/tags/v5.0-ouadji/api/pear/Text/Wiki/Render/Latex/Revise.php |
---|
New file |
0,0 → 1,38 |
<?php |
class Text_Wiki_Render_Latex_Revise extends Text_Wiki_Render { |
/** |
* |
* Renders a token into text matching the requested format. |
* |
* @access public |
* |
* @param array $options The "options" portion of the token (second |
* element). |
* |
* @return string The text rendered from the token options. |
* |
*/ |
function token($options) |
{ |
if ($options['type'] == 'del_start') { |
return '\sout{'; |
} |
if ($options['type'] == 'del_end') { |
return '}'; |
} |
if ($options['type'] == 'ins_start') { |
return '\underline{'; |
} |
if ($options['type'] == 'ins_end') { |
return '}'; |
} |
} |
} |
?> |