if ($d['lastonline']) { if (time() - $d['lastonline'] > ConfigHelper::getConfig('phpui.lastonline_limit')) { $myfill = $squareshape->addFill($im_d_off, SWFFILL_TILED_BITMAP); } else { $myfill = $squareshape->addFill($im_d_on, SWFFILL_TILED_BITMAP); } } else { $myfill = $squareshape->addFill($im_d_unk, SWFFILL_TILED_BITMAP); } $myfill->scaleto(9, 9); $squareshape->setRightFill($myfill); $squareshape->drawLine(15, 0); $squareshape->drawLine(0, 15); $squareshape->drawLine(-15, 0); $squareshape->drawLine(0, -15); $button->addShape($squareshape, SWFBUTTON_HIT | SWFBUTTON_UP | SWFBUTTON_DOWN | SWFBUTTON_OVER); $button->addAction(new SWFAction("this.getURL('?m=netdevinfo&id=" . $deviceid . "');"), SWFBUTTON_MOUSEDOWN); // press $i = $m->add($button); $i->moveTo($px, $py); if ($devip = $DB->GetCol('SELECT INET_NTOA(ipaddr) FROM vnodes WHERE ownerid = 0 AND netdev = ? ORDER BY ipaddr LIMIT 4', array($deviceid))) { if (isset($devip[0])) { drawtext($px + 16, $py - (isset($devip[1]) ? 16 : 8), $devip[0], 0, 0, 255); } if (isset($devip[1])) { drawtext($px + 16, $py - 8, $devip[1], 0, 0, 255); } if (isset($devip[2])) { drawtext($px + 16, $py + 16, $devip[2], 0, 0, 255);
#!/usr/bin/php -c. <?php $m = new SWFMovie(7); $s = new SWFShape(); $s->setLine(4, 25, 0, 0, 128); $s->movePenTo(5, 5); $s->drawLineTo(0, 10); $bl = new SWFBlur(5, 5, 2); $c = array(); $c["red"] = 0; $c['green'] = 0; $c['blue'] = 0; $c['alpha'] = 0xff; $f = new SWFFilter(SWFFILTER_TYPE_GLOW, $c, $bl, 1.0, SWFFILTER_MODE_INNER | SWFFILTER_MODE_KO); $bu = new SWFButton(); $bu->addShape($s, SWFBUTTON_UP | SWFBUTTON_HIT | SWFBUTTON_OVER | SWFBUTTON_DOWN); $item = $m->add($bu); $item->addFilter($f); $m->save("test03.swf");
/** * Draw an ellipse * * Parameter array: * 'x' : int X center point * 'y' : int Y center point * 'rx' : int X radius * 'ry' : int Y radius * 'fill' : mixed [optional] The fill color * 'line' : mixed [optional] The line color * 'url' : string [optional] Target URL * * @param array $params Parameter array * * @return void */ function ellipse($params) { $x = $this->_getX($params['x']); $y = $this->_getY($params['y']); $rx = $this->_getX($params['rx']); $ry = $this->_getY($params['ry']); // calculate scale factors $scaleX = 1.0; $scaleY = 1.0; $moveX = 0; $moveY = 0; if ($rx > $ry) { $scaleY = $ry / $rx; $moveY = $ry * (1 - $scaleY); } elseif ($rx < $ry) { $scaleX = $rx / $ry; $moveX = $rx * (1 - $scaleX); } $fillColor = isset($params['fill']) ? $params['fill'] : false; $lineColor = isset($params['line']) ? $params['line'] : false; $fillColor = $this->_getFillStyle($fillColor); $lineColor = $this->_getLineStyle($lineColor); $shape = new SWFShape(); $shape->setRightFill($fillColor[0], $fillColor[1], $fillColor[2]); $shape->movePenTo($x, $y); $shape->setLine(1, $lineColor[0], $lineColor[1], $lineColor[2]); if (count($fillColor)) { $shape->setRightFill($fillColor[0], $fillColor[1], $fillColor[2]); } $shape->drawCircle(max($rx, $ry)); if (isset($params['url'])) { $button = new SWFButton(); $button->addShape($shape, SWFBUTTON_HIT | SWFBUTTON_UP | SWFBUTTON_DOWN | SWFBUTTON_OVER); $button->addAction(new SWFAction("getURL('{$params['url']}');"), SWFBUTTON_MOUSEUP); $ellipse = $this->_canvas->add($button); } else { $ellipse = $this->_canvas->add($shape); } $ellipse->move($moveX, $moveY); $ellipse->scaleTo($scaleX, $scaleY); parent::ellipse($params); }
$fp = fopen("/tmp/debug.txt","w"); fputs($fp,"coid=$coid\ntype=$type\ntext=".($objs[$coid]->title)."\n"); fclose($fp); */ switch ($type) { case 'title': // Entire movie will get key events - make shape that covers the whole thing $s = new SWFShape(); $s->setRightFill($s->addFill(0, 0, 0)); $s->drawLine($dx, 0); $s->drawLine(0, $dy); $s->drawLine(-$dx, 0); $s->drawLine(0, -$dy); // Need a button to receive the key events - shape from above $b = new SWFButton(); $b->addShape($s, SWFBUTTON_KEYPRESS); // Space bar or Enter takes us to the next slide if ($slideNum < $maxSlideNum) { $next = $slideNum + 1; $b->addAction(new SWFAction("getURL('http://{$_SERVER['HTTP_HOST']}{$baseDir}{$showScript}/{$currentPres}/{$next}','_self');"), swfbutton_keypress(' ')); $b->addAction(new SWFAction("getURL('http://{$_SERVER['HTTP_HOST']}{$baseDir}{$showScript}/{$currentPres}/{$next}','_self');"), swfbutton_keypress(chr(13))); } // Backspace or DEL bar takes us to the previous slide if ($slideNum > 0) { $prev = $slideNum - 1; $b->addAction(new SWFAction("getURL('http://{$_SERVER['HTTP_HOST']}{$baseDir}{$showScript}/{$currentPres}/{$prev}','_self');"), swfbutton_keypress(chr(8))); $b->addAction(new SWFAction("getURL('http://{$_SERVER['HTTP_HOST']}{$baseDir}{$showScript}/{$currentPres}/{$prev}','_self');"), swfbutton_keypress(chr(127))); } // ESC reloads the current slide $b->addAction(new SWFAction("getURL('http://{$_SERVER['HTTP_HOST']}{$baseDir}{$showScript}/{$currentPres}/{$slideNum}','_self');"), swfbutton_keypress(chr(27))); // ? brings up the help page