コード例 #1
0
ファイル: bloodline.plugin.php プロジェクト: enminc/bloodline
    $valid = $Bloodline->verify($content);
    //---------------
    // Reporting
    //---------------
    if ($valid) {
        // Get the tag map etc.
        $content = $Bloodline->markup($content);
    } else {
        print '<div style="margin:10px; padding:20px; border:1px solid red; background-color:pink; border-radius: 5px; width:500px;">
		<span style="color:red; font-weight:bold;">Error</span><br />
		<p>The following errors were detected:</p>' . $Bloodline->error . '</div>';
        die('Invalid!');
    }
    // Rude behavior prints the markup and exits.
    if ($action == 'rude') {
        print $content . $Bloodline->get_report($modx->resource->get('contentType'));
        exit;
    } elseif ($action == 'report') {
        print $Bloodline->get_report($modx->resource->get('contentType'));
        exit;
    } elseif ($action == 'raw') {
        print '<pre>' . str_replace(array('[', ']'), array('&#91;', '&#93;'), print_r($Bloodline->report, true)) . '</pre>';
        print $Bloodline->to_js();
        exit;
    }
    $report = $Bloodline->get_report($modx->resource->get('contentType'));
    // See https://github.com/craftsmancoding/bloodline/issues/4
    if ($modx->resource->Template->get('static')) {
        $content = $modx->resource->get('content');
        $modx->resource->set('content', $content . $report);
    } else {