Example #1
0
?>
;
document.onmousemove = schemaMousemove;
document.onmouseup = function (ev) {
	schemaMouseup(ev, '<?php 
echo js_escape(DB);
?>
');
};
</script>
<?php 
foreach ($schema as $name => $table) {
    echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;' onmousedown='schemaMousedown(this, event);'>";
    echo '<a href="' . h(ME) . 'table=' . urlencode($name) . '"><b>' . h($name) . "</b></a>";
    foreach ($table["fields"] as $field) {
        $val = '<span' . type_class($field["type"]) . ' title="' . h($field["full_type"] . ($field["null"] ? " NULL" : '')) . '">' . h($field["field"]) . '</span>';
        echo "<br>" . ($field["primary"] ? "<i>{$val}</i>" : $val);
    }
    foreach ((array) $table["references"] as $target_name => $refs) {
        foreach ($refs as $left => $ref) {
            $left1 = $left - $table_pos[$name][1];
            $i = 0;
            foreach ($ref[0] as $source) {
                echo "\n<div class='references' title='" . h($target_name) . "' id='refs{$left}-" . $i++ . "' style='left: {$left1}" . "em; top: " . $table["fields"][$source]["pos"] . "em; padding-top: .5em;'><div style='border-top: 1px solid Gray; width: " . -$left1 . "em;'></div></div>";
            }
        }
    }
    foreach ((array) $referenced[$name] as $target_name => $refs) {
        foreach ($refs as $left => $columns) {
            $left1 = $left - $table_pos[$name][1];
            $i = 0;
Example #2
0
 private function getMode($picture)
 {
     if ($picture instanceof Picture) {
         return self::MODE_DEFAULT;
     }
     if ($picture instanceof GamePicture) {
         return self::MODE_GAME;
     }
     if ($picture instanceof PlatformPicture) {
         return self::MODE_PLATFORM;
     }
     throw new InvalidArgumentException("Invalid use of " . type_class($picture) . " in ImageManager");
 }