<commit_before><?php
/**
 * Z-Blog with PHP
 * @author
 * @copyright (C) RainbowSoft Studio
 * @version 2.0 2013-07-05
 */

require '../function/c_system_base.php';
require '../function/c_system_admin.php';

$zbp->CheckGzip();
$zbp->Load();

$action = 'ModuleEdt';
if (!$zbp->CheckRights($action)) {
    $zbp->ShowError(6, __FILE__, __LINE__);
    die();
}

$blogtitle = $lang['msg']['module_edit'];


require ZBP_PATH . 'zb_system/admin/admin_header.php';
require ZBP_PATH . 'zb_system/admin/admin_top.php';

?>
<?php

$modid = null;
$mod = null;

if (isset($_GET['source'])) {
    if (GetVars('source', 'GET') == 'theme') {
        $mod = new Module;
        $mod->Name = GetVars('filename', 'GET');
        $mod->FileName = GetVars('filename', 'GET');
        $mod->HtmlID = GetVars('filename', 'GET');
        $mod->Source = 'theme';
        if ($mod->FileName) {
            $mod->Content = file_get_contents($zbp->usersdir . 'theme/' . $zbp->theme . '/include/' . $mod->FileName . '.php');
        }
    }
} elseif (isset($_GET['filename'])) {
    $array = $zbp->GetModuleList(
        array('*'),
        array(array('=', 'mod_FileName', GetVars('filename', 'GET'))),
        null,
        array(1),
        null
    );

    if (count($array) == 0) {
        $zbp->ShowError(69);
    }

    $mod = $array[0];
} else {
    if (isset($_GET['id'])) {
        $modid = (integer) GetVars('id', 'GET');
    } else {
        $modid = 0;
    }

    $mod = $zbp->GetModuleByID($modid);
}
if ($mod->Type == 'ul') {
    $mod->Content = str_replace("</li>", "</li>\r\n", $mod->Content);
}

$islock = '';
if ($mod->Source == 'system' || $mod->Source == 'theme') {
    $islock = 'readonly="readonly"';
}
if ($mod->Source == 'theme' && $mod->FileName == '') {
    $islock = '';
    $mod->Name = 'newmodule';
    $mod->HtmlID = 'newmodule';
}
$ishide = '';
if ($mod->Source == 'theme') {
    $ishide = 'style="display:none;"';
}
?>
<div id="divMain">
<div class="divHeader2">
<?php echo $lang['msg']['module_edit']?></div>
<div class="SubMenu">
<?php
foreach ($GLOBALS['hooks']['Filter_Plugin_Module_Edit_SubMenu'] as $fpname => &$fpsignal) {
    $fpname();
}
?>
</div>
<div id="divMain2" class="edit tag_edit">
<form id="edit" name="edit" method="post" action="#">
    <input id="edtID" name="ID" type="hidden" value="<?php echo $mod->ID;?>" />
    <input id="edtSource" name="Source" type="hidden" value="<?php echo $mod->Source;?>" />
    <p <?php echo $ishide?>
        >
        <span class="title">
            <?php echo $lang['msg']['name']?>:</span>
        <span class="star">(*)</span>
        <br />
        <input id="edtName" class="edit" size="40" name="Name" maxlength="<?php echo $option['ZC_MODULE_NAME_MAX']; ?>" type="text" value="<?php echo $mod->Name;?>" />
         (
        <?php echo $lang['msg']['hide_title']?>
        :
        <input type="text" id="IsHideTitle" name="IsHideTitle" class="checkbox" value="<?php echo $mod->IsHideTitle;?>"/>)</p>
    <p>
        <span class="title">
            <?php echo $lang['msg']['filename']?>:</span>
        <span class="star">(*)</span>
        <br />
        <input id="edtFileName" <?php echo $islock?> class="edit" size="40" name="FileName" type="text" value="<?php echo $mod->FileName;?>" /></p>
    <p <?php echo $ishide?>>
        <span class="title">
            <?php echo $lang['msg']['htmlid']?>:</span>
        <span class="star">(*)</span>
        <br />
        <input id="edtHtmlID" class="edit" size="40" name="HtmlID" type="text" value="<?php echo $mod->HtmlID;?>" /></p>
    <p <?php echo $ishide?>><commit_msg>修正此处的输出未过滤问题<commit_after><?php
/**
 * Z-Blog with PHP
 * @author
 * @copyright (C) RainbowSoft Studio
 * @version 2.0 2013-07-05
 */

require '../function/c_system_base.php';
require '../function/c_system_admin.php';

$zbp->CheckGzip();
$zbp->Load();

$action = 'ModuleEdt';
if (!$zbp->CheckRights($action)) {
    $zbp->ShowError(6, __FILE__, __LINE__);
    die();
}

$blogtitle = $lang['msg']['module_edit'];


require ZBP_PATH . 'zb_system/admin/admin_header.php';
require ZBP_PATH . 'zb_system/admin/admin_top.php';

?>
<?php

$modid = null;
$mod = null;

if (isset($_GET['source'])) {
    if (GetVars('source', 'GET') == 'theme') {
        $mod = new Module;
        $mod->Name = GetVars('filename', 'GET');
        $mod->FileName = GetVars('filename', 'GET');
        $mod->HtmlID = GetVars('filename', 'GET');
        $mod->Source = 'theme';
        if ($mod->FileName) {
            $mod->Content = file_get_contents($zbp->usersdir . 'theme/' . $zbp->theme . '/include/' . $mod->FileName . '.php');
        }
    }
} elseif (isset($_GET['filename'])) {
    $array = $zbp->GetModuleList(
        array('*'),
        array(array('=', 'mod_FileName', GetVars('filename', 'GET'))),
        null,
        array(1),
        null
    );

    if (count($array) == 0) {
        $zbp->ShowError(69);
    }

    $mod = $array[0];
} else {
    if (isset($_GET['id'])) {
        $modid = (integer) GetVars('id', 'GET');
    } else {
        $modid = 0;
    }

    $mod = $zbp->GetModuleByID($modid);
}
if ($mod->Type == 'ul') {
    $mod->Content = str_replace("</li>", "</li>\r\n", $mod->Content);
}

$islock = '';
if ($mod->Source == 'system' || $mod->Source == 'theme') {
    $islock = 'readonly="readonly"';
}
if ($mod->Source == 'theme' && $mod->FileName == '') {
    $islock = '';
    $mod->Name = 'newmodule';
    $mod->HtmlID = 'newmodule';
}
$ishide = '';
if ($mod->Source == 'theme') {
    $ishide = 'style="display:none;"';
}
?>
<div id="divMain">
<div class="divHeader2">
<?php echo $lang['msg']['module_edit']?></div>
<div class="SubMenu">
<?php
foreach ($GLOBALS['hooks']['Filter_Plugin_Module_Edit_SubMenu'] as $fpname => &$fpsignal) {
    $fpname();
}
?>
</div>
<div id="divMain2" class="edit tag_edit">
<form id="edit" name="edit" method="post" action="#">
    <input id="edtID" name="ID" type="hidden" value="<?php echo $mod->ID;?>" />
    <input id="edtSource" name="Source" type="hidden" value="<?php echo $mod->Source;?>" />
    <p <?php echo $ishide?>
        >
        <span class="title">
            <?php echo $lang['msg']['name']?>:</span>
        <span class="star">(*)</span>
        <br />
        <input id="edtName" class="edit" size="40" name="Name" maxlength="<?php echo $option['ZC_MODULE_NAME_MAX']; ?>" type="text" value="<?php echo TransferHTML($mod->Name, '[html-format]');?>" />
         (
        <?php echo $lang['msg']['hide_title']?>
        :
        <input type="text" id="IsHideTitle" name="IsHideTitle" class="checkbox" value="<?php echo $mod->IsHideTitle;?>"/>)</p>
    <p>
        <span class="title">
            <?php echo $lang['msg']['filename']?>:</span>
        <span class="star">(*)</span>
        <br />
        <input id="edtFileName" <?php echo $islock?> class="edit" size="40" name="FileName" type="text" value="<?php echo TransferHTML($mod->FileName, '[html-format]');?>" /></p>
    <p <?php echo $ishide?>>
        <span class="title">
            <?php echo $lang['msg']['htmlid']?>:</span>
        <span class="star">(*)</span>
        <br />
        <input id="edtHtmlID" class="edit" size="40" name="HtmlID" type="text" value="<?php echo TransferHTML($mod->HtmlID, '[html-format]');?>" /></p>
    <p <?php echo $ishide?>>
{'fraction_non_alphanumeric': 0.24608193566125927, 'fraction_numerical': 0.006873797085510036, 'mean_word_length': 3.217391304347826, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 181, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5193876', 'n_tokens_mistral': 2605, 'n_tokens_neox': 2591, 'n_words': 504}