public function doGet(WebAppRequest $req, WebAppResponse $res) { // Bootstraps Innomatic require_once 'innomatic/core/InnomaticContainer.php'; $innomatic = InnomaticContainer::instance('innomaticcontainer'); // Sets Innomatic base URL $baseUrl = ''; $webAppPath = $req->getUrlPath(); if (!is_null($webAppPath) && $webAppPath != '/') { $baseUrl = $req->generateControllerPath($webAppPath, true); } $innomatic->setBaseUrl($baseUrl); $innomatic->setInterface(InnomaticContainer::INTERFACE_WEB); $home = WebAppContainer::instance('webappcontainer')->getCurrentWebApp()->getHome(); $innomatic->bootstrap($home, $home . 'core/conf/innomatic.ini'); $id = basename($req->getParameter('id')); //$id = basename($_GET['id']); $args = unserialize(file_get_contents(InnomaticContainer::instance('innomaticcontainer')->getHome() . 'core/temp/phplot/' . $id)); require_once 'phplot/PHPlot.php'; $graph = new PHPlot($args['width'], $args['height']); $graph->SetIsInline('1'); //$graph->SetDataColors( array("blue",'white'),array("black") ); //$graph->$line_style = array('dashed','dashed','solid','dashed','dashed','solid'); // Base $graph->SetDataValues($args['data']); $graph->SetPlotType($args['plottype']); // Appearance $graph->SetPointShape($args['pointshape']); $graph->SetPointSize($args['pointsize']); $graph->SetTitle($args['title']); // Color $graph->SetBackgroundColor($args['backgroundcolor']); $graph->SetGridColor($args['gridcolor']); if (count($args['legend'])) { $graph->SetLegend($args['legend']); } $graph->SetLineWidth($args['linewidth']); $graph->SetTextColor($args['textcolor']); $graph->SetDataColors(array(array(145, 165, 207), array(114, 167, 112), array(71, 85, 159), array(175, 83, 50), array(247, 148, 53), array(240, 231, 125), array(154, 204, 203), array(201, 164, 196)), 'black'); //$graph->data_color = array( array(145,165,207), array(114,167,112), array(71,85,159), array(175,83,50), array(247,148,53), array(240,231,125), array(154,204,203), array(201,164,196) ); //array('blue','green','yellow','red','orange'); $graph->DrawGraph(); unlink(InnomaticContainer::instance('innomaticcontainer')->getHome() . 'core/temp/phplot/' . $id); }
public static function load(Context $context, Page $page, Grid $grid, $module, $name, $counter, $row, $column, $position, $params = array()) { if (!strlen($module)) { return; } $block_yml_file = $context->getBlocksHome($module) . $name . '.local.yml'; if (!file_exists($block_yml_file)) { $block_yml_file = $context->getBlocksHome($module) . $name . '.yml'; } if (!file_exists($block_yml_file)) { $context->getResponse()->sendError(WebAppResponse::SC_INTERNAL_SERVER_ERROR, 'Missing block definition file ' . $name . '.yml'); return; } // Imports block class and return an instance $def = yaml_parse_file($block_yml_file); $fqcn = $def['class']; if (!strlen($fqcn)) { // @todo convert to new class loader $fqcn = '\\Innomedia\\EmptyBlock'; } // @todo convert to new namespace convention if (!class_exists($fqcn)) { $context->getResponse()->sendError(WebAppResponse::SC_INTERNAL_SERVER_ERROR, 'Missing class ' . $fqcn); return; } $tpl_root = $context->getBlocksHome($module); $tpl_file = ''; $locales = $context->getLocales(); foreach ($locales as $locale) { if (file_exists($tpl_root . $name . '_' . $locale . '.local.tpl.php')) { // Local template for given language exists $tpl_file = $tpl_root . $name . '_' . $locale . '.local.tpl.php'; break; } if (file_exists($tpl_root . $name . '_' . $locale . '.tpl.php')) { // Template for given language exists $tpl_file = $tpl_root . $name . '_' . $locale . '.tpl.php'; break; } } if (!strlen($tpl_file)) { $webapp = WebAppContainer::instance('\\Innomatic\\Webapp\\WebAppContainer')->getCurrentWebApp(); if (file_exists($tpl_root . $webapp->getInitParameter('InnomediaDefaultLanguage') . '.' . $name . '.local.tpl.php')) { // Local template for default language exists $tpl_file = $tpl_root . $webapp->getInitParameter('InnomediaDefaultLanguage') . '.' . $name . '.local.tpl.php'; } elseif (file_exists($tpl_root . $webapp->getInitParameter('InnomediaDefaultLanguage') . '.' . $name . '.tpl.php')) { // Template for default language exists $tpl_file = $tpl_root . $webapp->getInitParameter('InnomediaDefaultLanguage') . '.' . $name . '.tpl.php'; } elseif (file_exists($tpl_root . $name . '.local.tpl.php')) { // Local template for no specific language exists $tpl_file = $tpl_root . $name . '.local.tpl.php'; } else { // Template for no specific language exists $tpl_file = $tpl_root . $name . '.tpl.php'; } } // Build block $obj = new $fqcn($tpl_file); $obj->setPage($page)->setGrid($grid); // Set block counter $obj->setCounter($counter)->setRow($row)->setColumn($column)->setPosition($position); // Set block parameters $obj->setParameters($params); // Set block types $obj->setTypes(isset($def['types']) && is_array($def['types']) ? $def['types'] : array()); return $obj; }
function PrintImage() { // Browser cache stuff submitted by Thiemo Nagel if (!$this->browser_cache && !$this->is_inline) { WebAppContainer::instance('webappcontainer')->getProcessor()->getResponse()->addHeader('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); WebAppContainer::instance('webappcontainer')->getProcessor()->getResponse()->addHeader('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT'); WebAppContainer::instance('webappcontainer')->getProcessor()->getResponse()->addHeader('Cache-Control: no-cache, must-revalidate'); WebAppContainer::instance('webappcontainer')->getProcessor()->getResponse()->addHeader('Pragma: no-cache'); } switch ($this->file_format) { case 'png': if (!$this->is_inline) { WebAppContainer::instance('webappcontainer')->getProcessor()->getResponse()->addHeader('Content-type: image/png'); } if ($this->is_inline && $this->output_file != '') { ImagePng($this->img, $this->output_file); } else { ImagePng($this->img); } break; case 'jpg': if (!$this->is_inline) { WebAppContainer::instance('webappcontainer')->getProcessor()->getResponse()->addHeader('Content-type: image/jpeg'); } if ($this->is_inline && $this->output_file != '') { ImageJPEG($this->img, $this->output_file); } else { ImageJPEG($this->img); } break; case 'gif': if (!$this->is_inline) { WebAppContainer::instance('webappcontainer')->getProcessor()->getResponse()->addHeader('Content-type: image/gif'); } if ($this->is_inline && $this->output_file != '') { ImageGIF($this->img, $this->output_file); } else { ImageGIF($this->img); } break; case 'wbmp': // wireless bitmap, 2 bit. if (!$this->is_inline) { WebAppContainer::instance('webappcontainer')->getProcessor()->getResponse()->addHeader('Content-type: image/wbmp'); } if ($this->is_inline && $this->output_file != '') { ImageWBMP($this->img, $this->output_file); } else { ImageWBMP($this->img); } break; default: $this->PrintError('PrintImage(): Please select an image type!'); break; } return TRUE; }
<?php /** * index.php * * Copyright (c) 1999-2003 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * This file simply takes any attempt to view source files and sends those * people to the login screen. At this point no attempt is made to see if * the person is logged or not. * * $Id: index.php,v 1.1 2003-06-21 13:17:16 alex Exp $ */ WebAppContainer::instance('webappcontainer')->getProcessor()->getResponse()->addHeader("Location:../index.php"); /* pretty impressive huh? */