Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://svn.php.net/repository/pear/packages/Text_Wiki/trunk@191862 c90b9560-bf6c-de11-be94-00142212c4b1
- Loading branch information
bertrand Gugger
committed
Jul 30, 2005
1 parent
50e0d22
commit afcc98e
Showing
43 changed files
with
1,470 additions
and
523 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,48 @@ | ||
<?php | ||
|
||
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: | ||
/** | ||
* | ||
* This class renders an anchor target name in XHTML. | ||
* | ||
* @author Manuel Holtgrewe <purestorm at ggnore dot net> | ||
* | ||
* @author Paul M. Jones <pmjones at ciaweb dot net> | ||
* | ||
* @package Text_Wiki | ||
* | ||
*/ | ||
* Anchor rule end renderer for Xhtml | ||
* | ||
* PHP versions 4 and 5 | ||
* | ||
* @category Text | ||
* @package Text_Wiki | ||
* @author Paul M. Jones <pmjones@php.net> | ||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 | ||
* @version CVS: $Id$ | ||
* @link http://pear.php.net/package/Text_Wiki | ||
*/ | ||
|
||
/** | ||
* This class renders an anchor target name in XHTML. | ||
* | ||
* @category Text | ||
* @package Text_Wiki | ||
* @author Paul M. Jones <pmjones@php.net> | ||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 | ||
* @version Release: @package_version@ | ||
* @link http://pear.php.net/package/Text_Wiki | ||
*/ | ||
class Text_Wiki_Render_Xhtml_Anchor extends Text_Wiki_Render { | ||
|
||
var $conf = array( | ||
'css' => null | ||
); | ||
|
||
function token($options) | ||
{ | ||
extract($options); // $type, $name | ||
|
||
if ($type == 'start') { | ||
$css = $this->formatConf(' class="%s"', 'css'); | ||
$format = "<a$css id=\"%s\">"; | ||
return sprintf($format, htmlentities($name)); | ||
} | ||
|
||
if ($type == 'end') { | ||
return '</a>'; | ||
} | ||
} | ||
} | ||
|
||
?> | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,69 @@ | ||
<?php | ||
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: | ||
/** | ||
* Blockquote rule end renderer for Xhtml | ||
* | ||
* PHP versions 4 and 5 | ||
* | ||
* @category Text | ||
* @package Text_Wiki | ||
* @author Paul M. Jones <pmjones@php.net> | ||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 | ||
* @version CVS: $Id$ | ||
* @link http://pear.php.net/package/Text_Wiki | ||
*/ | ||
|
||
/** | ||
* This class renders a blockquote in XHTML. | ||
* | ||
* @category Text | ||
* @package Text_Wiki | ||
* @author Paul M. Jones <pmjones@php.net> | ||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 | ||
* @version Release: @package_version@ | ||
* @link http://pear.php.net/package/Text_Wiki | ||
*/ | ||
class Text_Wiki_Render_Xhtml_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']; | ||
|
||
// set up indenting so that the results look nice; we do this | ||
// in two steps to avoid str_pad mathematics. ;-) | ||
$pad = str_pad('', $level, "\t"); | ||
$pad = str_replace("\t", ' ', $pad); | ||
|
||
// pick the css type | ||
$css = $this->formatConf(' class="%s"', 'css'); | ||
|
||
// starting | ||
if ($type == 'start') { | ||
return "$pad<blockquote$css>"; | ||
} | ||
|
||
// ending | ||
if ($type == 'end') { | ||
return $pad . "</blockquote>\n"; | ||
} | ||
} | ||
} | ||
?> | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,57 @@ | ||
<?php | ||
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: | ||
/** | ||
* Bold rule end renderer for Xhtml | ||
* | ||
* PHP versions 4 and 5 | ||
* | ||
* @category Text | ||
* @package Text_Wiki | ||
* @author Paul M. Jones <pmjones@php.net> | ||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 | ||
* @version CVS: $Id$ | ||
* @link http://pear.php.net/package/Text_Wiki | ||
*/ | ||
|
||
/** | ||
* This class renders bold text in XHTML. | ||
* | ||
* @category Text | ||
* @package Text_Wiki | ||
* @author Paul M. Jones <pmjones@php.net> | ||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 | ||
* @version Release: @package_version@ | ||
* @link http://pear.php.net/package/Text_Wiki | ||
*/ | ||
class Text_Wiki_Render_Xhtml_Bold 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) | ||
{ | ||
if ($options['type'] == 'start') { | ||
$css = $this->formatConf(' class="%s"', 'css'); | ||
return "<b$css>"; | ||
} | ||
|
||
if ($options['type'] == 'end') { | ||
return '</b>'; | ||
} | ||
} | ||
} | ||
?> | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,57 @@ | ||
<?php | ||
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: | ||
/** | ||
* Box rule end renderer for Xhtml | ||
* | ||
* PHP versions 4 and 5 | ||
* | ||
* @category Text | ||
* @package Text_Wiki | ||
* @author Paul M. Jones <pmjones@php.net> | ||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 | ||
* @version CVS: $Id$ | ||
* @link http://pear.php.net/package/Text_Wiki | ||
*/ | ||
|
||
/** | ||
* This class renders a box drawn in XHTML. | ||
* | ||
* @category Text | ||
* @package Text_Wiki | ||
* @author Paul M. Jones <pmjones@php.net> | ||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 | ||
* @version Release: @package_version@ | ||
* @link http://pear.php.net/package/Text_Wiki | ||
*/ | ||
class Text_Wiki_Render_Xhtml_Box 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) | ||
{ | ||
if ($options['type'] == 'start') { | ||
$css = $this->formatConf(' class="%s"', 'css'); | ||
return "<div class='simplebox'$css>"; | ||
} | ||
|
||
if ($options['type'] == 'end') { | ||
return '</div>'; | ||
} | ||
} | ||
} | ||
?> | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,52 @@ | ||
<?php | ||
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: | ||
/** | ||
* Break rule end renderer for Xhtml | ||
* | ||
* PHP versions 4 and 5 | ||
* | ||
* @category Text | ||
* @package Text_Wiki | ||
* @author Paul M. Jones <pmjones@php.net> | ||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 | ||
* @version CVS: $Id$ | ||
* @link http://pear.php.net/package/Text_Wiki | ||
*/ | ||
|
||
/** | ||
* This class renders line breaks in XHTML. | ||
* | ||
* @category Text | ||
* @package Text_Wiki | ||
* @author Paul M. Jones <pmjones@php.net> | ||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 | ||
* @version Release: @package_version@ | ||
* @link http://pear.php.net/package/Text_Wiki | ||
*/ | ||
class Text_Wiki_Render_Xhtml_Break 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) | ||
{ | ||
$css = $this->formatConf(' class="%s"', 'css'); | ||
return "<br$css />\n"; | ||
} | ||
} | ||
|
||
?> | ||
?> |
Oops, something went wrong.