Example #1
0
        $this->iFromColor = $aFrom;
        $this->iToColor = $aTo;
        $this->iStyle = $aStyle;
        $this->graph = new CanvasGraph($aWidth, $aHeight);
        $this->grad = new Gradient($this->graph->img);
        $this->grad->FilledRectangle(0, 0, $this->iWidth, $this->iHeight, $this->iFromColor, $this->iToColor, $this->iStyle);
        if ($aFileName != "") {
            $this->graph->Stroke($aFileName);
            echo "Image file '{$aFileName}' created.";
        } else {
            $this->graph->Stroke();
        }
    }
    function Run()
    {
        global $HTTP_POST_VARS;
        // Two modes:
        // 1) If the script is called with no posted arguments
        // we show the input form.
        // 2) If we have posted arguments we naivly assume that
        // we are called to do the image.
        if (@$_POST['ok'] === ' Ok ') {
            $this->GenGradImage();
        } else {
            $this->iForm->Run();
        }
    }
}
$driver = new Driver();
$driver->Run();
Example #2
0
                $e = BackendFactory::Create(BACKEND_PS, $encoder);
                set_exception_handler(array('Driver', 'ErrHandlerPS'));
                break;
            case 2:
                $e = BackendFactory::Create(BACKEND_PS, $encoder);
                $e->SetEPS();
                set_exception_handler(array('Driver', 'ErrHandlerPS'));
                break;
        }
        $e->SetHeight($aParams['height']);
        $e->SetVertical($aParams['rotate']);
        $e->SetModuleWidth($aParams['modulewidth']);
        $e->SetScale($aParams['scale']);
        $e->HideText($aParams['hide']);
        if ($aParams['output'] === 0) {
            $err = $e->Stroke($aParams['data'], $aParams['filename']);
        } else {
            $s = $e->Stroke($aParams['data'], $aParams['filename']);
            if ($aParams['filename'] == '') {
                // If no filename specified then return the generated postscript
                echo $s;
            }
        }
    }
}
$pa = new ParseArgs();
$params = $pa->Get();
$driver = new Driver();
$driver->Run($params);
// Successfull termination
exit(0);
Example #3
0
        global $HTTP_COOKIE_VARS;
        $this->iDB = DBFactory::InitDB();
        $this->iProjname = strtok(@$HTTP_COOKIE_VARS['ddda_project'], ':');
        if ($this->iProjname != '') {
            $this->iProjidx = strtok(':');
        } else {
            die('No project specified.');
        }
    }
    function Run($aClass, $aFlags = 0)
    {
        $dbremove = new RemoveDBClass($this->iDB);
        if ($dbremove->Run($this->iProjname, $aClass, $aFlags)) {
            echo "Class <b>{$aClass}</b> has been removed from JpGraph Database.";
        } else {
            Utils::Error("Can't remove class <b>{$aClass}</b> from JpGRaph Database.");
        }
    }
}
//==========================================================================
// Script entry point
// Read URL argument and create Driver
//==========================================================================
if (!isset($HTTP_GET_VARS['class'])) {
    Utils::Error("Must specify class to remove from db. Use syntax class=<class-name>");
} else {
    $class = urldecode($HTTP_GET_VARS['class']);
}
$driver = new Driver();
$driver->Run($class);