<?php
require $GLOBALS['usersdir'] . 'plugin/ly_ueditor_plus/ly_ueditor_plus_core.php';
#注册插件
RegisterPlugin("ly_ueditor_plus", "ActivePlugin_ly_ueditor_plus");

function ActivePlugin_ly_ueditor_plus()
{
    global $zbp;
    if (ly_ueditor_plus('ised') && strpos($zbp->currenturl, 'act=ArticleEdt') !== false && array_search('UEditor', $zbp->activedapps) === false) {
        $zbp->activedapps[] = 'UEditor';
    }
    if (ly_ueditor_plus('isrr')) {
        Add_Filter_Plugin('Filter_Plugin_Edit_Begin', 'ly_ueditor_plus_Edit_Begin');
    }
    Add_Filter_Plugin('Filter_Plugin_Zbp_PreLoad', 'ly_ueditor_plus_Zbp_Load_Pre');
    Add_Filter_Plugin('Filter_Plugin_Zbp_Load_Pre', 'ly_ueditor_plus_Zbp_Load_Pre');
    Add_Filter_Plugin('Filter_Plugin_PostArticle_Succeed', 'ly_ueditor_plus_Succeed');
}
function InstallPlugin_ly_ueditor_plus() {}
function UninstallPlugin_ly_ueditor_plus() {}
function ly_ueditor_plus_addscript_begin()
{
    ly_ueditor_plus_core::addscript_begin();
}
function ly_ueditor_plus_addscript_end()
{
    ly_ueditor_plus_core::addscript_end();
}
function ly_ueditor_plus_SyntaxHighlighter_print()
{
    ly_ueditor_plus_core::SyntaxHighlighter_print();
}
function ly_ueditor_plus_Succeed($article)
{
    ly_ueditor_plus_core::Succeed($article);
}
function ly_ueditor_plus_Edit_Begin()
{
    ly_ueditor_plus_core::Edit_Begin();
}
function ly_ueditor_plus_Zbp_Load_Pre()
{
    return ly_ueditor_plus_core::Zbp_Load_Pre();
}
function ly_ueditor_plus($a = '', $v = '')
{
    if ($a) {
        global $zbp;
        $v = $zbp->Config('ly_ueditor_plus')->HasKey($a) ? $zbp->Config('ly_ueditor_plus')->$a : $v;
        return $v;
    }
}