Author: f1gm3nt
Date: 2010-03-26 21:34:36 +0100 (Fri, 26 Mar 2010)
New Revision: 28816

Modified:
   plugins/sfSvgPlugin/lib/sfSvgPlugin.class.php
Log:
still in development, not working properly, code not clean, need to commit so I 
can work on at home

Modified: plugins/sfSvgPlugin/lib/sfSvgPlugin.class.php
===================================================================
--- plugins/sfSvgPlugin/lib/sfSvgPlugin.class.php       2010-03-26 19:49:41 UTC 
(rev 28815)
+++ plugins/sfSvgPlugin/lib/sfSvgPlugin.class.php       2010-03-26 20:34:36 UTC 
(rev 28816)
@@ -7,27 +7,28 @@
  * such as histogram, pie, etc
  *
  * @author Joshua Estes <http://www.ScenicCityLabs.com>
+ * @package SfSvgPlugin
+ * @subpackage symfony
  */
 class sfSvgPlugin
 {
   
-  protected $width       = '100%';
-  protected $height      = '100%';
-  protected $contentType = 'image/svg+xml';
+  protected $width       = '200'; // Canvas Size
+  protected $height      = '200'; // canvas size
+  protected $contentType = 'image/svg+xml'; // used in header(content-type)
   protected $x           = 0;
   protected $y           = 0;
 
+  // this is the variable that holds all of the elements used to generate a 
svg image
   protected $elements    = array();
+  protected $title       = '';
+  protected $description = '';
 
   /**
    * Class constructor
-   *
    */
-  function  __construct()
-  {
+  function construct() {}
 
-  }
-
   /**
    * Will set the width of the image
    *
@@ -69,14 +70,49 @@
   }
 
   /**
+   * Sets the title of the image
+   *
+   * @param <type> $title Title of the SVG image
+   */
+  function setTitle($title)
+  {
+    $this->title = $title;
+  }
+
+  /**
+   * Returns title of the svg image
+   *
+   * @return <type> Title of the SVG image
+   */
+  function getTitle()
+  {
+    return $this->title;
+  }
+
+  function setDescription($description)
+  {
+    $this->description = $description;
+  }
+
+  function getDescription()
+  {
+    return $this->description;
+  }
+
+  /**
    * returns the xml of the svg image
    *
    * @return <type> xml
    */
   function render()
   {
-    // convert all the elements to xml
-    $xml = '';
+    // output xml
+    $xml  = '<?xml version="1.0" encoding="iso-8859-1"?>';
+    $xml .= '<svg width="'.$this->width.'" height="'.$this->height.'" 
xmlns:svg="http://www.w3.org/2000/svg"; xmlns="http://www.w3.org/2000/svg";>';
+    $xml .= '<title>'.$this->getTitle().'</title>';
+    $xml .= '<desc>'.$this->getDescription().'</desc>';
+    $xml .= $elements;
+    $xml .= '</svg>';
     return $xml;
   }
 

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to