diff options
| author | lsces <lester@lsces.co.uk> | 2026-05-08 14:45:26 +0100 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2026-05-08 14:45:26 +0100 |
| commit | c34908d6afcc7fb5fd947ef34e11dedebeb6c537 (patch) | |
| tree | fabdec1692e15dd00dd8041a97544b113550956e /plugins/format.pearwiki_general.php | |
| parent | d0a919132b939e2381d6a0d5fb357fce62f976e4 (diff) | |
| download | liberty-c34908d6afcc7fb5fd947ef34e11dedebeb6c537.tar.gz liberty-c34908d6afcc7fb5fd947ef34e11dedebeb6c537.tar.bz2 liberty-c34908d6afcc7fb5fd947ef34e11dedebeb6c537.zip | |
pearwiki is currently untested and relies on pre php8 code so diable for now
Diffstat (limited to 'plugins/format.pearwiki_general.php')
| -rwxr-xr-x | plugins/format.pearwiki_general.php | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/plugins/format.pearwiki_general.php b/plugins/format.pearwiki_general.php deleted file mode 100755 index 0e13964..0000000 --- a/plugins/format.pearwiki_general.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php - -namespace Bitweaver\Liberty; - -/** - * @version $Revision$ - * @package liberty - * @subpackage plugins_format - */ - -/** - * definitions - */ -global $gLibertySystem; -if( @include_once 'PEAR/Registry.php' ) { - if( @include_once 'Text/Wiki.php' ) { - -$genPluginParams = array ( - 'store_function' => 'pearwiki_general_save_data', - 'verify_function' => 'pearwiki_general_verify_data', - 'plugin_type' => FORMAT_PLUGIN, - 'linebreak' => "\r\n" -); - -$reg = new \PEAR_Registry(); - -foreach( $reg->listPackages() as $package ) { - if( preg_match( '!^text_wiki!', $package )) { - // get package information - $inf = $reg->packageInfo( $package ); - - // package information is all over the place. this should clean it up a bit - if( !empty( $inf['name'] )) { - $package = $inf['name']; - } elseif( !empty( $inf['name'] )) { - $package = $inf['package']; - } else { - continue; - } - - // fetch parser name - $p = substr( $package, strlen( "text_wiki" )); - if( empty( $p )) { - $parser = "Text_Wiki"; - $parser_class = "Default"; - } else { - $parser = substr( $p,1 ); - $parser_class = $parser; - } - - $f = create_function('&$pParseHash, &$pCommonObject','return pearwiki_general_parse_data("'.$parser_class.'",$pParseHash, $pCommonObject);'); - $guid = "pearwiki_$parser"; - if (strlen($guid)>16) { - $guid = "pw_$parser"; - } - if (strlen($guid)>16) { - $guid = substr($guid,0,16); - } - $insPluginParams = [ - 'load_function' => $f, - 'edit_field' => "<input type=\"radio\" name=\"format_guid\" value=\"$guid\"", - 'description' => "Pear Wiki Parser for $parser Syntax.", - 'edit_label' => "$parser Syntax, parsed by Pear::Text_Wiki$p", - 'help_page' => "{$parser}Syntax", - 'auto_activate' => false, - ]; - $gLibertySystem->registerPlugin( $guid, array_merge($genPluginParams,$insPluginParams) ); - - } -} - - } -} - -function pearwiki_general_save_data( &$pParamHash ) { -} - -function pearwiki_general_verify_data( &$pParamHash ) { - $pParamHash['content_store']['data'] = $pParamHash['edit']; - return null; -} - -function pearwiki_general_parse_data( $parser_fmt, &$pParseHash, &$pCommonObject ) { - global $gBitSystem; - - if (!defined('PAGE_SEP')) { - define('PAGE_SEP', 'PAGE MARKER HERE*&^%$#^$%*PAGEMARKERHERE'); - } - $parser = \Text_Wiki::singleton($parser_fmt); - if (\PEAR::isError($parser)) { - $gBitSystem->fatalError( "There was an unknown error while constructing the PEAR parser." ); - } - global $gBitSystem; - if ($gBitSystem->isPackageActive('wiki')) { - $parser->setRenderConf('xhtml', 'wikilink', 'exists_callback', [ &$pCommonObject, 'pageExists' ] ); - $parser->setRenderConf('xhtml', 'wikilink', 'view_url', [ TIKI_PKG_URL.'index.php?page=' ] ); - $parser->setRenderConf('xhtml', 'wikilink', 'new_url', [ TIKI_PKG_URL.'edit.php?page=' ] ); - } - $parser->setRenderConf('xhtml', 'table', 'css_table', [ 'wikitable' ] ); - $xhtml = $parser->transform( $pParseHash['data'], 'Xhtml' ); - - return $xhtml; -} |
