コード例 #1
0
 protected function displayShapeInfo(AbstractShape $oShape)
 {
     $this->append('<div class="infoBlk" id="div' . $oShape->getHashCode() . 'Info">');
     $this->append('<dl>');
     $this->append('<dt>HashCode</dt><dd>' . $oShape->getHashCode() . '</dd>');
     $this->append('<dt>Offset X</dt><dd>' . $oShape->getOffsetX() . '</dd>');
     $this->append('<dt>Offset Y</dt><dd>' . $oShape->getOffsetY() . '</dd>');
     $this->append('<dt>Height</dt><dd>' . $oShape->getHeight() . '</dd>');
     $this->append('<dt>Width</dt><dd>' . $oShape->getWidth() . '</dd>');
     $this->append('<dt>Rotation</dt><dd>' . $oShape->getRotation() . '°</dd>');
     $this->append('<dt>Hyperlink</dt><dd>' . ucfirst(var_export($oShape->hasHyperlink(), true)) . '</dd>');
     $this->append('<dt>Fill</dt><dd>@Todo</dd>');
     $this->append('<dt>Border</dt><dd>@Todo</dd>');
     if ($oShape instanceof MemoryDrawing) {
         ob_start();
         call_user_func($oShape->getRenderingFunction(), $oShape->getImageResource());
         $sShapeImgContents = ob_get_contents();
         ob_end_clean();
         $this->append('<dt>Mime-Type</dt><dd>' . $oShape->getMimeType() . '</dd>');
         $this->append('<dt>Image</dt><dd><img src="data:' . $oShape->getMimeType() . ';base64,' . base64_encode($sShapeImgContents) . '"></dd>');
     } else {
         // Add another shape
     }
     $this->append('</dl>');
     $this->append('</div>');
 }