コード例 #1
0
ファイル: AuditLog.php プロジェクト: klebercarvalho/demo
 public function AjaxInspector()
 {
     if (!$this->_plugin->settings->CurrentUserCan('view')) {
         die('Access Denied.');
     }
     if (!isset($_REQUEST['occurrence'])) {
         die('Occurrence parameter expected.');
     }
     $occ = new WSAL_DB_Occurrence();
     $occ->Load('id = %d', array((int) $_REQUEST['occurrence']));
     echo '<!DOCTYPE html><html><head>';
     echo '<link rel="stylesheet" id="open-sans-css" href="' . $this->_plugin->GetBaseUrl() . '/css/nice_r.css" type="text/css" media="all">';
     echo '<script type="text/javascript" src="' . $this->_plugin->GetBaseUrl() . '/js/nice_r.js"></script>';
     echo '<style type="text/css">';
     echo 'html, body { margin: 0; padding: 0; }';
     echo '.nice_r { position: absolute; padding: 8px; }';
     echo '.nice_r a { overflow: visible; }';
     echo '</style>';
     echo '</head><body>';
     $nicer = new WSAL_Nicer($occ->GetMetaArray());
     $nicer->render();
     echo '</body></html>';
     die;
 }
コード例 #2
0
ファイル: Sandbox.php プロジェクト: klebercarvalho/demo
    public function AjaxExecuteResponse()
    {
        echo '<!DOCTYPE html><html><head>';
        echo '<link rel="stylesheet" id="open-sans-css" href="' . $this->_plugin->GetBaseUrl() . '/css/nice_r.css" type="text/css" media="all">';
        echo '<script type="text/javascript" src="' . $this->_plugin->GetBaseUrl() . '/js/nice_r.js"></script>';
        echo '<style type="text/css">';
        echo 'html, body { margin: 0; padding: 0; }';
        echo '.nice_r { position: absolute; padding: 8px; }';
        echo '.nice_r a { overflow: visible; }';
        echo '.faerror { font: 14px Arial; background: #FCC; text-align: center; padding: 32px; }';
        echo '</style>';
        echo '</head><body>';
        if (($e = error_get_last()) && !isset($this->exec_data['Errors']) && !count($this->exec_data['Errors'])) {
            $this->HandleError($e['type'], $e['message'], $e['file'], $e['line']);
        }
        if (count($this->exec_data)) {
            $result = new WSAL_Nicer($this->exec_data);
            $result->render();
        } else {
            echo '<div class="faerror">FATAL ERROR</div>';
        }
        if (count($this->exec_info)) {
            ?>
<script type="text/javascript">
				window.parent.SandboxUpdateState(<?php 
            $res = array();
            foreach ($this->exec_info as $key => $val) {
                if ($key && $key[0] != '_') {
                    $res[$key] = $val;
                }
            }
            echo json_encode($res);
            ?>
);
			</script><?php 
        }
        echo '</body></html>';
    }