Commit 26d3cd28 authored by RobertPlummer's avatar RobertPlummer

[ENH] Moved most plugin/parsing functionality from tikilib to parserlib and...

[ENH] Moved most plugin/parsing functionality from tikilib to parserlib and did my best to hook it all back up in effort to refine the current parser and integrate the new one
parent 70ebf103
......@@ -16,6 +16,8 @@ require_once 'lib/profilelib/listlib.php';
$list = new Tiki_Profile_List;
$sources = $list->getSources();
$parserlib = TikiLib::lib('parser');
if ($prefs['profile_unapproved'] == 'y') {
Tiki_Profile::enableDeveloperMode();
}
......@@ -119,7 +121,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$dependencies[] = $d->pageUrl;
$userInput = array_merge($userInput, $d->getRequiredInput());
}
$parsed = $tikilib->parse_data($profile->pageContent);
$parsed = $parserlib->parse_data($profile->pageContent);
$installed = $installer->isInstalled($profile);
echo json_encode(array(
......
......@@ -11,9 +11,11 @@ if (strpos($_SERVER['SCRIPT_NAME'], basename(__FILE__)) !== false) {
exit;
}
$parserlib = TikiLib::lib('parser');
$plugins = array();
foreach($tikilib->plugin_get_list() as $name) {
$info = $tikilib->plugin_info($name);
foreach($parserlib->plugin_get_list() as $name) {
$info = $parserlib->plugin_info($name);
if (isset($info['prefs']) && is_array($info['prefs']) && count($info['prefs']) > 0) $plugins[$name] = $info;
}
$smarty->assign('plugins', $plugins);
......@@ -24,8 +26,8 @@ if (isset($_REQUEST['textareasetup']) && (!isset($_COOKIE['tab']) || $_COOKIE['t
// from tiki-admin_include_textarea.php
global $tikilib;
$pluginsAlias = $tikilib->plugin_get_list(false, true);
$pluginsReal = $tikilib->plugin_get_list(true, false);
$pluginsAlias = $parserlib->plugin_get_list(false, true);
$pluginsReal = $parserlib->plugin_get_list(true, false);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
global $cachelib;
require_once ('lib/cache/cachelib.php');
......@@ -55,9 +57,9 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['delete'])) {
if (!is_array($_POST['enabled'])) $_POST['enabled'] = array();
foreach($pluginsAlias as $name) {
$tikilib->plugin_alias_delete( $name );
$parserlib->plugin_alias_delete( $name );
}
$pluginsAlias = $tikilib->plugin_get_list(false, true);
$pluginsAlias = $parserlib->plugin_get_list(false, true);
}
if (isset($_POST['textareasetup']) && !in_array($_POST['plugin_alias'], $pluginsReal) && isset($_REQUEST["plugin_alias"]) && (!isset($_COOKIE['tab']) || $_COOKIE['tab'] == 3)) { // tab=3 is plugins alias tab (TODO improve)
$info = array(
......@@ -139,13 +141,13 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
}
}
}
$tikilib->plugin_alias_store($_POST['plugin_alias'], $info);
$parserlib->plugin_alias_store($_POST['plugin_alias'], $info);
if (!in_array($_POST['plugin_alias'], $pluginsAlias)) $pluginAlias[] = $_POST['plugins'];
foreach(glob('temp/cache/wikiplugin_*') as $file) unlink($file);
$pluginsAlias = $tikilib->plugin_get_list(false, true);
$pluginsAlias = $parserlib->plugin_get_list(false, true);
}
}
if (isset($_REQUEST['plugin_alias']) && $pluginInfo = $tikilib->plugin_alias_info($_REQUEST['plugin_alias'])) {
if (isset($_REQUEST['plugin_alias']) && $pluginInfo = $parserlib->plugin_alias_info($_REQUEST['plugin_alias'])) {
// Add an extra empty parameter to create new ones
$pluginInfo['description']['params']['__NEW__'] = array(
'name' => '',
......@@ -178,7 +180,7 @@ $smarty->assign('plugins_real', $pluginsReal);
if (isset($_REQUEST['disabled']) && $tiki_p_admin == 'y') {
$offset = 0;
$disabled = array();
foreach($tikilib->plugin_get_list() as $name) {
foreach($parserlib->plugin_get_list() as $name) {
if ($prefs["wikiplugin_$name"] == 'n') {
$allDisabled[] = $name;
}
......@@ -190,7 +192,7 @@ if (isset($_REQUEST['disabled']) && $tiki_p_admin == 'y') {
}
$offset += $prefs['maxRecords'];
foreach ($pages['data'] as $page) {
$plugins = $tikilib->getPlugins($page['data'], $allDisabled);
$plugins = $parserlib->getPlugins($page['data'], $allDisabled);
if (!empty($plugins)) {
foreach ($plugins as $plugin) {
if (!in_array($plugin[1], $disabled)) {
......
......@@ -357,6 +357,8 @@ class AdminLib extends TikiLib
// changed for virtualhost support
function dump() {
global $tikidomain, $prefs;
$parserlib = TikiLib::lib('parser');
$dump_path = "dump";
if ($tikidomain) {
$dump_path.= "/$tikidomain";
......@@ -372,7 +374,7 @@ class AdminLib extends TikiLib
while ($res = $result->fetchRow()) {
$pageName = $res["pageName"] . '.html';
$dat = $this->parse_data($res["data"]);
$dat = $parserlib->parse_data($res["data"]);
// Now change index.php?page=foo to foo.html
// and index.php to HomePage.html
$dat = preg_replace("/tiki-index.php\?page=([^\'\"\$]+)/", "$1.html", $dat);
......
......@@ -484,6 +484,8 @@ class BlogLib extends TikiDb_Bridge
global $tikilib, $tiki_p_admin_comments, $tiki_p_admin, $tiki_p_blog_admin, $tiki_p_blog_post, $user;
global $commentslib; require_once('lib/comments/commentslib.php');
$parserlib = TikiLib::lib('parser');
if (!is_object($commentslib)) {
$commentslib = new Comments();
}
......@@ -551,7 +553,7 @@ class BlogLib extends TikiDb_Bridge
$res['avatar'] = $tikilib->get_user_avatar($res['user']);
if (isset($res['excerpt'])) {
$res['excerpt'] = $tikilib->parse_data($res['excerpt'], array('is_html' => true));
$res['excerpt'] = $parserlib->parse_data($res['excerpt'], array('is_html' => true));
}
$ret[] = $res;
......
......@@ -1558,7 +1558,8 @@ class Comments extends TikiLib
function parse_comment_data($data) {
global $prefs, $tikilib, $section;
$parserlib = TikiLib::lib('parser');
if (($prefs['feature_forum_parse'] == 'y' && $section == 'forums') || $prefs['section_comments_parse'] == 'y') {
return $this->parse_data($data);
}
......@@ -1580,7 +1581,8 @@ class Comments extends TikiLib
$data = preg_replace("/\[([^\]\|]+)\]/", '<a class="commentslink" href="$1">$1</a>', $data);
// smileys
$data = $tikilib->parse_smileys($data);
$data = $parserlib->parse_smileys($data);
$data = preg_replace("/---/", "<hr/>", $data);
// replace --- with <hr/>
......
......@@ -1694,7 +1694,8 @@ class FileGalLib extends TikiLib
function syncFileBacklinks($data, $context) {
global $tikilib;
$fileIds = array();
$plugins = $tikilib->getPlugins($data, array('IMG', 'FILE'));
$parserlib = TikiLib::lib('parser');
$plugins = $parserlib->getPlugins($data, array('IMG', 'FILE'));
foreach ($plugins as $plugin) {
if (!empty($plugin['arguments']['fileId'])) {
$fileIds[] = $plugin['arguments']['fileId'];
......
......@@ -534,8 +534,8 @@ class WikiParserLexer {
preg_match('/^\{([a-z]+)/', $yy_->yytext, $pluginName);
preg_match('/[ ].*?[}]|[/}]/', $yy_->yytext, $pluginParams);
$yy_->yytext = array(
"name"=> $pluginName[0],
"params"=> $pluginParams,
"name"=> $pluginName[1],
"params"=> $pluginParams[0],
"body"=> ''
);
return 8;
......@@ -547,8 +547,8 @@ class WikiParserLexer {
if (!isset($yy->pluginStack)) $yy->pluginStack = array();
array_push($yy->pluginStack, (object)array(
"name"=> $pluginName[0],
"params"=> $pluginParams
"name"=> $pluginName[1],
"params"=> $pluginParams[0]
));
return 9;
......@@ -556,6 +556,7 @@ class WikiParserLexer {
break;
case 3:
if ($yy->pluginStack) {
preg_match('/'.$yy->pluginStack[count($yy->pluginStack) - 1]->name.'/', $yy_->yytext, $pluginExists);
if (
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -7,7 +7,9 @@
function prefs_wikiplugin_list($partial = false) {
global $tikilib;
$parserlib = TikiLib::lib('parser');
// Note that most of these will be disabled by an other feature check.
$defaultPlugins = array(
'article' => 'y',
......@@ -120,8 +122,8 @@ function prefs_wikiplugin_list($partial = false) {
$prefs = array();
foreach( $tikilib->plugin_get_list() as $plugin ) {
$info = $tikilib->plugin_info( $plugin );
foreach( $parserlib->plugin_get_list() as $plugin ) {
$info = $parserlib->plugin_info( $plugin );
if (empty($info['prefs'])) $info['prefs'] = array();
$dependencies = array_diff( $info['prefs'], array( 'wikiplugin_' . $plugin ) );
......
......@@ -7,7 +7,8 @@
function prefs_wikiplugininline_list($partial = false) {
global $tikilib;
$parserlib = TikiLib::lib('parser');
$defaultInline = array(
'file' => 'y',
'getaccesstoken' => 'y',
......@@ -54,8 +55,8 @@ function prefs_wikiplugininline_list($partial = false) {
$prefs = array();
foreach( $tikilib->plugin_get_list() as $plugin ) {
$info = $tikilib->plugin_info( $plugin );
foreach( $parserlib->plugin_get_list() as $plugin ) {
$info = $parserlib->plugin_info( $plugin );
$prefs['wikiplugininline_' . $plugin] = array(
'name' => tr('Inline plugin %0', $info['name'] ),
......
......@@ -1665,8 +1665,9 @@ class Tiki_Profile_InstallHandler_PluginAlias extends Tiki_Profile_InstallHandle
$name = $data['name'];
unset( $data['name'] );
$tikilib->plugin_alias_store( $name, $data );
$parserlib = TikiLib::lib('parser');
$parserlib->plugin_alias_store( $name, $data );
return $name;
}
......
......@@ -182,7 +182,8 @@ class Tiki_Profile
{
global $tikilib, $wikilib;
require_once 'lib/wiki/wikilib.php';
$parserlib = TikiLib::lib('parser');
$profile = new self;
$profile->domain = 'tiki://local';
$profile->profile = $pageName;
......@@ -191,7 +192,7 @@ class Tiki_Profile
$info = $tikilib->get_page_info( $pageName );
$content = html_entity_decode( $info['data'] );
$tikilib->parse_wiki_argvariable($content);
$parserlib->parse_wiki_argvariable($content);
$profile->loadYaml( $content );
return $profile;
......
......@@ -17,6 +17,8 @@ class ShoutboxLib extends TikiLib
{
function list_shoutbox($offset, $maxRecords, $sort_mode, $find) {
global $prefs;
$parserlib = TikiLib::lib('parser');
if ($find) {
$mid = " where (`message` like ?)";
$bindvars = array('%'.$find.'%');
......@@ -53,7 +55,7 @@ class ShoutboxLib extends TikiLib
$wrap_at = 25;
$res["message"] = preg_replace('/(\s*)([^\;>\s]{'.$wrap_at.',})([^&]<|$)/e', "'\\1'.wordwrap('\\2', '".$wrap_at."', '<span></span>', 1).'\\3'", $res["message"]);
// emoticons support
$res["message"] = $this->parse_smileys($res["message"]);
$res["message"] = $parserlib->parse_smileys($res["message"]);
$ret[] = $res;
}
$retval = array();
......
......@@ -16,8 +16,9 @@ function smarty_block_wikiplugin( $params, $content, &$smarty, $repeat = false )
$name = $params['_name'];
unset( $params['_name'] );
return $tikilib->plugin_execute( $name, $content, $params, 0, false, array(
$parserlib = TikiLib::lib('parser');
return $parserlib->plugin_execute( $name, $content, $params, 0, false, array(
'context_format' => 'html',
'ck_editor' => false,
) );
......
......@@ -24,7 +24,8 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
*/
function smarty_modifier_simplewiki($string) {
global $tikilib;
$parserlib = TikiLib::lib('parser');
$string = htmlentities( $string, ENT_QUOTES, 'UTF-8' );
return $tikilib->parse_data_simple( $string );
return $parserlib->parse_data_simple( $string );
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -62,7 +62,8 @@ abstract class Toolbar
public static function getList( $include_custom = true ) // {{{
{
global $tikilib;
$plugins = $tikilib->plugin_get_list();
$parserlib = TikiLib::lib('parser');
$plugins = $parserlib->plugin_get_list();
foreach( $plugins as & $name ) {
$name = "wikiplugin_$name";
......@@ -1374,9 +1375,11 @@ class ToolbarWikiplugin extends Toolbar
public static function fromName( $name ) // {{{
{
global $tikilib;
$parserlib = TikiLib::lib('parser');
if( substr( $name, 0, 11 ) == 'wikiplugin_' ) {
$name = substr( $name, 11 );
if( $info = $tikilib->plugin_info( $name ) ) {
if( $info = $parserlib->plugin_info( $name ) ) {
if (isset($info['icon']) and $info['icon'] != '') {
$icon = $info['icon'];
} else {
......@@ -1410,8 +1413,9 @@ class ToolbarWikiplugin extends Toolbar
function isAccessible() // {{{
{
global $tikilib;
$parserlib = TikiLib::lib('parser');
$dummy_output = '';
return parent::isAccessible() && $tikilib->plugin_enabled( $this->pluginName, $dummy_output );
return parent::isAccessible() && $parserlib->plugin_enabled( $this->pluginName, $dummy_output );
} // }}}
private static function getToken( $name ) // {{{
......
......@@ -42,6 +42,8 @@ function wikiplugin_button_info() {
function wikiplugin_button($data, $params) {
global $tikilib,$smarty;
$parserlib = TikiLib::lib('parser');
if (empty($params['href'])) {
return tra('Incorrect param');
}
......@@ -58,7 +60,7 @@ function wikiplugin_button($data, $params) {
}
// Parse wiki argument variables in the url, if any (i.e.: {{itemId}} for it's numeric value).
$tikilib->parse_wiki_argvariable($params['href']);
$parserlib->parse_wiki_argvariable($params['href']);
include_once($path);
$func = 'smarty_function_button';
......
......@@ -132,7 +132,9 @@ function wikiplugin_include($data, $params, $offset) {
$text = implode("\n", $explText);
}
}
$tikilib->parse_wiki_argvariable($text);
$parserlib = TikiLib::lib('parser');
$parserlib->parse_wiki_argvariable($text);
// append an edit button
global $smarty;
if (isset($perms) && $perms['tiki_p_edit'] === 'y') {
......
......@@ -381,7 +381,9 @@ function get_plugin_info($sPluginFile) {
$sPlugin= $match[1];
include_once(PLUGINS_DIR.'/'.$sPluginFile);
global $tikilib;
$infoPlugin = $tikilib->plugin_info($sPlugin);
$parserlib = TikiLib::lib('parser');
$infoPlugin = $parserlib->plugin_info($sPlugin);
$numparams = isset($infoPlugin['params']) ? count($infoPlugin['params']) : 0;
return $infoPlugin;
}
......
......@@ -42,6 +42,8 @@ function wikiplugin_randominclude($data, $params) {
return '';
}
$text = $data['data'];
$tikilib->parse_wiki_argvariable($text);
$parserlib = TikiLib::lib('parser');
$parserlib->parse_wiki_argvariable($text);
return $text;
}
......@@ -326,6 +326,8 @@ function wikiplugin_tracker_name($fieldId, $name, $field_errors)
function wikiplugin_tracker($data, $params)
{
global $tikilib, $userlib, $dbTiki, $user, $group, $page, $tiki_p_admin_trackers, $smarty, $prefs, $trklib, $tiki_p_view, $captchalib;
$parserlib = TikiLib::lib('parser');
static $iTRACKER = 0;
++$iTRACKER;
if (isset($params['itemId']) && empty($params['itemId']))
......@@ -414,7 +416,7 @@ function wikiplugin_tracker($data, $params)
if (isset($values)) {
if (!is_array($values)) {
$values = $tikilib->quotesplit(':', $values);
$values = $parserlib->quotesplit(':', $values);
foreach ($values as $i=>$v) {
$values[$i] = preg_replace('/^"(.*)"$/', '$1', $v);
}
......
......@@ -330,7 +330,8 @@ class WikiRenderer
);
if ($this->raw) {
$pdata = $tikilib->parse_data_raw($this->content_to_render);
$parserlib = TikiLib::lib('parser');
$pdata = $parserlib->parse_data_raw($this->content_to_render);
} else {
$pdata = $wikilib->parse_data($this->content_to_render, $parse_options);
}
......
......@@ -814,12 +814,14 @@ class WikiLib extends TikiLib
function list_plugins($with_help = false, $area_id = 'editwiki') {
global $prefs;
$parserlib = TikiLib::lib('parser');
if ($with_help) {
global $cachelib, $headerlib, $prefs;
if (empty($_REQUEST['xjxfun'])) { $headerlib->add_jsfile( 'tiki-jsplugin.php?language='.$prefs['language'], 'dynamic' ); }
$cachetag = 'plugindesc' . $this->get_language() . $area_id . '_js=' . $prefs['javascript_enabled'];
if (! $plugins = $cachelib->getSerialized( $cachetag ) ) {
$list = $this->plugin_get_list();
$list = $parserlib->plugin_get_list();
$plugins = array();
foreach ($list as $name) {
......@@ -856,9 +858,10 @@ class WikiLib extends TikiLib
//
function get_plugin_description($name, &$enabled, $area_id = 'editwiki') {
global $tikilib;
$parserlib = TikiLib::lib('parser');
$data = '';
if( ( ! $info = $this->plugin_info( $name ) ) && $this->plugin_exists( $name, true ) )
if( ( ! $info = $parserlib->plugin_info( $name ) ) && $parserlib->plugin_exists( $name, true ) )
{
$enabled = true;
......
......@@ -99,7 +99,7 @@ class XmlLib extends TikiLib
function export_page($page)
{
global $tikilib, $prefs, $smarty, $tikidomain;
$parserlib = TikiLib::lib('parser');
$info = $tikilib->get_page_info($page);
if (empty($info)) {
$this->errors[] = 'Page does not exist';
......@@ -126,7 +126,7 @@ class XmlLib extends TikiLib
if ($prefs['feature_wiki_pictures'] == 'y' && $this->config['images'] && preg_match_all('/\{img\s*\(?([^\}]+)\)?\s*\}/i', $info['data'], $matches)) {
global $tikiroot;
foreach ($matches[1] as $match) {
$args = $tikilib->plugin_split_args($match);
$args = $parserlib->plugin_split_args($match);
if (empty($args['src'])) {
} elseif (preg_match('|img/wiki_up/(.*)|', $args['src'], $m)) {
$file = empty($tikidomain)?$args['src']: str_replace('img/wiki_up/', "img/wiki_up/$tikidomain/", $args['src']);
......
......@@ -214,8 +214,10 @@ if (count($_REQUEST) == 0) {
}
$plugins = array();
foreach($tikilib->plugin_get_list() as $name) {
$info = $tikilib->plugin_info($name);
$parserlib = TikiLib::lib('parser');
foreach($parserlib->plugin_get_list() as $name) {
$info = $parserlib->plugin_info($name);
if (isset($info['prefs']) && is_array($info['prefs']) && count($info['prefs']) > 0) $plugins[$name] = $info;
}
$smarty->assign('plugins', $plugins);
......
......@@ -132,7 +132,8 @@ $(window).load(function(){
$smarty->assign('headtitle', tra('Preview'));
$data = '<div id="c1c2"><div id="wrapper"><div id="col1"><div id="tiki-center" class="wikitext">';
if (has_autosave($_REQUEST['editor_id'], $_REQUEST['autoSaveId'])) {
$data .= $tikilib->parse_data_raw($editlib->partialParseWysiwygToWiki(get_autosave($_REQUEST['editor_id'], $_REQUEST['autoSaveId'])));
$parserlib = TikiLib::lib('parser');
$data .= $parserlib->parse_data_raw($editlib->partialParseWysiwygToWiki(get_autosave($_REQUEST['editor_id'], $_REQUEST['autoSaveId'])));
} else {
if ($autoSaveIdParts[1] == 'wiki_page') {
global $wikilib; include_once('lib/wiki/wikilib.php');
......
......@@ -174,7 +174,8 @@ if (isset($_REQUEST["blogpriv"]) && $_REQUEST["blogpriv"] == 'on') {
if (isset($_REQUEST["preview"])) {
$post_info = array();
$parsed_data = $tikilib->apply_postedit_handlers($edit_data);
$parserlib = TikiLib::lib('parser');
$parsed_data = $parserlib->apply_postedit_handlers($edit_data);
$parsed_data = $tikilib->parse_data($parsed_data, array('is_html' => $is_wysiwyg));
$smarty->assign('data', $edit_data);
$post_info['parsed_data'] = $parsed_data;
......
......@@ -789,8 +789,8 @@ $smarty->assign('pagedata', $parsed);
// apply the optional post edit filters before preview
if (isset($_REQUEST["preview"])) {
$parsed = $tikilib->apply_postedit_handlers($parsed);
$parserlib = TikiLib::lib('parser');
$parsed = $parserlib->apply_postedit_handlers($parsed);
if ($_SESSION['wysiwyg'] === 'y' && $prefs['wysiwyg_wiki_parsed'] === 'y') {
$parsed = $editlib->partialParseWysiwygToWiki( $parsed );
......@@ -911,7 +911,8 @@ if (isset($_REQUEST["save"]) && (strtolower($_REQUEST['page']) !== 'sandbox' ||
// Parse $edit and eliminate image references to external URIs (make them internal)
$edit = $imagegallib->capture_images($edit);
// apply the optional page edit filters before data storage
$edit = $tikilib->apply_postedit_handlers($edit);
$parserlib = TikiLib::lib('parser');
$edit = $parserlib->apply_postedit_handlers($edit);
$exist = $tikilib->page_exists($_REQUEST['page']);
// If page exists
if(!$exist) {
......
......@@ -11,6 +11,8 @@ include_once('lib/structures/structlib.php');
include_once('lib/wiki/wikilib.php');
$parserlib = TikiLib::lib('parser');
if ($prefs['feature_categories'] == 'y') {
global $categlib;
if (!is_object($categlib)) {
......@@ -140,7 +142,7 @@ $smarty->assign('cached_page', 'n');
// Get ~pp~, ~np~ and <pre> out of the way. --rlpowell, 24 May 2004
$preparsed = array();
$noparsed = array();
$tikilib->parse_first( $info["data"], $preparsed, $noparsed );
$parserlib->parse_first( $info["data"], $preparsed, $noparsed );
$pdata = $wikilib->get_parse($page, $canBeRefreshed);
......
......@@ -31,6 +31,8 @@ $all = empty( $_REQUEST['plugin'] );
$files = array();
$parserlib = TikiLib::lib('parser');
if( $all )
{
$cache = "temp/cache/wikiplugin_ALL_".$_REQUEST['language'];
......@@ -42,8 +44,8 @@ if( $all )
}
include 'tiki-setup.php';
$plugins = $tikilib->plugin_get_list();
$plugins = $parserlib->plugin_get_list();
}
else
{
......@@ -67,7 +69,7 @@ ob_start();
?>
if( typeof tiki_plugins == 'undefined' ) { var tiki_plugins = {}; }
<?php foreach( $plugins as $plugin ):
if( ! $info = $tikilib->plugin_info( $plugin ) )
if( ! $info = $parserlib->plugin_info( $plugin ) )
continue;
?>
tiki_plugins.<?php echo $plugin ?> = <?php echo json_encode( $info ) ?>;
......
......@@ -10,24 +10,26 @@ $access->check_feature('wiki_validate_plugin');
$access->check_permission('tiki_p_plugin_approve');
$smarty->assign('headtitle', tra('Plugin Approval'));
$parserlib = TikiLib::lib('parser');
if (isset($_POST['submit_mult']) && ($_POST['submit_mult'] == 'clear') && is_array($_POST['clear'])) {
foreach($_POST['clear'] as $fp) {
$tikilib->plugin_clear_fingerprint($fp);
$parserlib->plugin_clear_fingerprint($fp);
}
}
if (isset($_POST['submit_mult']) && ($_POST['submit_mult'] == 'approve') && is_array($_POST['clear'])) {
foreach($_POST['clear'] as $fp) {
$tikilib->approve_selected_pending_plugings($fp);
$parserlib->approve_selected_pending_plugings($fp);
}
}
if (isset($_REQUEST['approveone'])) {
$tikilib->approve_selected_pending_plugings($_REQUEST['approveone']);
$parserlib->approve_selected_pending_plugings($_REQUEST['approveone']);
}
if (isset($_REQUEST['clearone'])) {
$tikilib->plugin_clear_fingerprint($_REQUEST['clearone']);
$parserlib->plugin_clear_fingerprint($_REQUEST['clearone']);
}
......@@ -35,9 +37,9 @@ if (isset($_REQUEST['clearone'])) {
if (isset($_POST['approveall'])) {
$tikilib->approve_all_pending_plugins();
$parserlib->approve_all_pending_plugins();
}
$smarty->assign('plugin_list', $tikilib->list_plugins_pending_approval());
$smarty->assign('plugin_list', $parserlib->list_plugins_pending_approval());
$smarty->assign('mid', 'tiki-plugins.tpl');
$smarty->display("tiki.tpl");
......@@ -14,6 +14,9 @@ if (!isset($_REQUEST["articleId"])) {
$smarty->display("error.tpl");
die;
}
$parserlib = TikiLib::lib('parser');
$article_data = $artlib->get_article($_REQUEST["articleId"]);
$tikilib->get_perm_object($_REQUEST['articleId'], 'article');
if ($article_data === false) {
......@@ -117,7 +120,8 @@ if( $prefs['article_paginate'] == 'y' ) {
// Get ~pp~, ~np~ and <pre> out of the way. --rlpowell, 24 May 2004
$preparsed = array();
$noparsed = array();
$tikilib->parse_first($article_data["body"], $preparsed, $noparsed);
$parserlib->parse_first($article_data["body"], $preparsed, $noparsed);
$pages = $artlib->get_number_of_pages($article_data["body"]);
$article_data["body"] = $artlib->get_page($article_data["body"], $_REQUEST['page']);
$smarty->assign('pages', $pages);
......@@ -135,7 +139,8 @@ if( $prefs['article_paginate'] == 'y' ) {
$smarty->assign('last_page', $pages);
$smarty->assign('pagenum', $_REQUEST['page']);
// Put ~pp~, ~np~ and <pre> back. --rlpowell, 24 May 2004
$tikilib->replace_preparse($article_data["body"], $preparsed, $noparsed);
$parserlib = TikiLib::lib('parser');
$parserlib->replace_preparse($article_data["body"], $preparsed, $noparsed);
}
if ($prefs["article_custom_attributes"] == 'y') {
$t_article_attributes = $artlib->get_article_attributes($article_data["articleId"]);
......
......@@ -84,8 +84,9 @@ if ($prefs['count_admin_pvs'] == 'y' || $user != 'admin') {
}
// Get page data
$parserlib = TikiLib::lib('parser');
$info = $tikilib->get_page_info($page);
$pdata = $tikilib->parse_data_raw($info["data"]);
$pdata = $parserlib->parse_data_raw($info["data"]);
if (!isset($_REQUEST['pagenum']))
$_REQUEST['pagenum'] = 1;
......@@ -95,8 +96,8 @@ $pdata = $wikilib->get_page($pdata, $_REQUEST['pagenum']);
$smarty->assign('pages', $pages);
// Put ~pp~, ~np~ and <pre> back. --rlpowell, 24 May 2004
$tikilib->replace_preparse( $info["data"], $preparsed, $noparsed );
$tikilib->replace_preparse( $pdata, $preparsed, $noparsed );
$parserlib->replace_preparse( $info["data"], $preparsed, $noparsed );
$parserlib->replace_preparse( $pdata, $preparsed, $noparsed );
$smarty->assign_by_ref('parsed', $pdata);
//$smarty->assign_by_ref('lastModif',date("l d of F, Y [H:i:s]",$info["lastModif"]));
......
......@@ -15,7 +15,7 @@ $page = $_POST['page'];
$plugin = strtolower( basename( $_POST['type'] ) );
$type = strtoupper( $plugin );
if( ! $meta = $tikilib->plugin_info( $plugin ) )
if( ! $meta = $parserlib->plugin_info( $plugin ) )
exit;
if( ! isset( $_POST['message'] ) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment