forked from besstiolle/markdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParser.module.php
42 lines (40 loc) · 1.64 KB
/
Parser.module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
class Parser extends CMSModule
{
function GetName() {return 'Parser';}
function GetFriendlyName() {return $this->Lang('friendlyname');}
function GetVersion() {return '1.0.0';}
function GetDependencies() {return array();}
function GetHelp() {return $this->Lang('help');}
function GetAuthor() {return 'Kevin Danezis (aka Bess)';}
function GetAuthorEmail() {return 'contact at furie point be';}
function GetChangeLog() {return $this->Lang('changelog');}
function GetAdminDescription() {return $this->Lang('moddescription');}
function MinimumCMSVersion() {return "1.11.13";}
function IsPluginModule() {return false;}
function HasAdmin() {return true;}
function GetAdminSection() {return 'extensions';}
function VisibleToAdminUser() {return true;}
function InitializeFrontend() {}
function InitializeAdmin() {}
function AllowSmartyCaching() {return true;}
function LazyLoadFrontend() {return true;}
function LazyLoadAdmin() {return true;}
function InstallPostMessage() {return $this->Lang('postinstall');}
function UninstallPostMessage() {return $this->Lang('postuninstall');}
function UninstallPreMessage() {return $this->Lang('really_uninstall');}
function DisplayErrorPage($msg) {echo "<h3>".$msg."</h3>";}
function CreateStaticRoutes() {}
function GetParserInstance($engineType = null){
if(empty($engineType)){
$engineType = $this->GetPreference('default_engine',Engine::$PARSDOWN);
}
return Engine::initInstance($engineType);
}
static function exec_parser($text){
$config = cmsms()->GetConfig();
include_once($config['root_path'].'/modules/Parser/lib/class.Engine.php');
return Engine::initInstance()->process($text);
}
}
?>