ManiaLib 1.0b1 API Reference

Source for file standard.php

Documentation is available at standard.php

  1. <?php
  2. /**
  3.  * @author Maxime Raoust
  4.  * @copyright 2009-2010 NADEO
  5.  * @package ManiaLib
  6.  */
  7.  
  8. /**#@+
  9.  * @ignore
  10.  */
  11. require_onceAPP_FRAMEWORK_GUI_TOOLKIT_PATH.'GuiTools.class.php' );
  12. require_onceAPP_FRAMEWORK_GUI_TOOLKIT_PATH.'GuiDefaultStyles.class.php' );
  13. /**#@-*/
  14.  
  15. /**
  16.  * The GuiComponent is a generic and abstract element that only contains
  17.  * position, size and scale info.
  18.  * @package ManiaLib
  19.  * @subpackage GUIToolkit
  20.  */
  21. abstract class GuiComponent
  22. {
  23.     /**#@+
  24.      * @ignore
  25.      */
  26.     protected $posX 0;
  27.     protected $posY 0;
  28.     protected $posZ 0;
  29.     protected $sizeX;
  30.     protected $sizeY;
  31.     protected $scale;
  32.     /**#@-*/
  33.     
  34.     /**
  35.      * Sets the X position of the element
  36.      * @param float 
  37.      */
  38.     function setPositionX($posX)
  39.     {
  40.         $this->posX $posX;
  41.     }
  42.     
  43.     /**
  44.      * Sets the Y position of the element
  45.      * @param float 
  46.      */
  47.     function setPositionY($posY)
  48.     {
  49.         $this->posY $posY;
  50.     }
  51.     
  52.     /**
  53.      * Sets the Z position of the element
  54.      * @param float 
  55.      */
  56.     function setPositionZ($posZ)
  57.     {
  58.         $this->posZ $posZ;
  59.     }
  60.     
  61.     /**
  62.      * Sets the position of the element
  63.      * @param float 
  64.      * @param float 
  65.      * @param float 
  66.      */
  67.     function setPosition($posX 0$posY 0$posZ 0)
  68.     {
  69.         $this->posX $posX;
  70.         $this->posY $posY;
  71.         $this->posZ $posZ;
  72.     }
  73.     
  74.     /**
  75.      * Sets the width of the element
  76.      * @param float 
  77.      */
  78.     function setSizeX($sizeX)
  79.     {
  80.         $this->sizeX $sizeX;
  81.     }
  82.     
  83.     /**
  84.      * Sets the height of the element
  85.      * @param float 
  86.      */
  87.     function setSizeY($sizeY)
  88.     {
  89.         $this->sizeY $sizeY;
  90.     }
  91.     
  92.     /**
  93.      * Sets the size of the element
  94.      * @param float 
  95.      * @param float 
  96.      */
  97.     function setSize($sizeX$sizeY)
  98.     {
  99.         $this->sizeX $sizeX;
  100.         $this->sizeY $sizeY;
  101.     }
  102.     
  103.     /**
  104.      * Sets the scale factor of the element. 1=original size, 2=double size, 0.5
  105.      * =half size
  106.      * @param float 
  107.      */
  108.     function setScale($scale)
  109.     {
  110.         $this->scale $scale;
  111.     }
  112.     
  113.     /**
  114.      * Returns the X position of the element
  115.      * @return float 
  116.      */
  117.     function getPosX()
  118.     {
  119.         return $this->posX;
  120.     }
  121.     
  122.     /**
  123.      * Returns the Y position of the element
  124.      * @return float 
  125.      */
  126.     function getPosY()
  127.     {
  128.         return $this->posY;
  129.     }
  130.     
  131.     /**
  132.      * Returns the Z position of the element
  133.      * @return float 
  134.      */
  135.     function getPosZ()
  136.     {
  137.         return $this->posZ;
  138.     }
  139.     
  140.     /**
  141.      * Returns the width of the element
  142.      * @return float 
  143.      */
  144.     function getSizeX()
  145.     {
  146.         return $this->sizeX;
  147.     }
  148.     
  149.     /**
  150.      * Returns the height of the element
  151.      * @return float 
  152.      */
  153.     function getSizeY()
  154.     {
  155.         return $this->sizeY;
  156.     }
  157.     
  158.     /**
  159.      * Returns the scale of the element
  160.      * @return float 
  161.      */
  162.     function getScale()
  163.     {
  164.         return $this->scale;
  165.     }
  166. }
  167.  
  168. /**
  169.  * Base class for creating GUI elements
  170.  * @package ManiaLib
  171.  * @subpackage GUIToolkit
  172.  */
  173. abstract class GuiElement extends GuiComponent
  174. {
  175.     const USE_ABSOLUTE_URL = null;
  176.     
  177.     /**#@+
  178.      * @ignore
  179.      */
  180.     protected $style;
  181.     protected $subStyle;
  182.     protected $valign null;
  183.     protected $halign null;
  184.     protected $manialink;
  185.     protected $url;
  186.     protected $maniazone;
  187.     protected $bgcolor;
  188.     protected $addPlayerId;
  189.     protected $action;
  190.     protected $actionKey;
  191.     protected $image;
  192.     protected $imageid;
  193.     protected $imageFocus;
  194.     protected $imageFocusid;
  195.     protected $xmlTagName 'xmltag'// Redeclare this for each child
  196.     protected $xml;
  197.     /**#@-*/
  198.     
  199.     /**
  200.      * Manialink element default constructor. It's common to specify the size of
  201.      * the element in the constructor.
  202.      * 
  203.      * @param float Width of the element
  204.      * @param float Height of the element
  205.      */
  206.     function __construct($sizeX 20$sizeY 20)
  207.     {
  208.         $this->sizeX $sizeX;
  209.         $this->sizeY $sizeY;
  210.     }
  211.     
  212.     /**
  213.      * Sets the style of the element. See http://fish.stabb.de/styles/ of the
  214.      * manialink 'example' for more information on Manialink styles.
  215.      * @param string 
  216.      */
  217.     function setStyle($style)
  218.     {
  219.         $this->style $style;
  220.     }
  221.     
  222.     /**
  223.      * Sets the sub-style of the element. See http://fish.stabb.de/styles/ of
  224.      * the manialink 'example' for more information on Manialink styles.
  225.      * @param string 
  226.      */
  227.     function setSubStyle($substyle)
  228.     {
  229.         $this->subStyle $substyle;
  230.     }
  231.     
  232.     /**
  233.      * Sets the vertical alignment of the element.
  234.      * @param string Vertical alignment can be either "top", "center" or
  235.      *  "bottom"
  236.      */
  237.     function setValign($valign)
  238.     {
  239.         $this->valign $valign;
  240.     }
  241.     
  242.     /**
  243.      * Sets the horizontal alignment of the element
  244.      * @param string Horizontal alignement can be eithe "left", "center" or
  245.      *  "right"
  246.      */
  247.     function setHalign($halign)
  248.     {
  249.         $this->halign $halign;
  250.     }
  251.  
  252.     /**
  253.      * Sets the alignment of the element
  254.      * @param string Horizontal alignement can be eithe "left", "center" or
  255.      *  "right"
  256.      * @param string Vertical alignment can be either "top", "center" or
  257.      *  "bottom"
  258.      */
  259.     function setAlign($halign null$valign null)
  260.     {
  261.         $this->setHalign($halign);
  262.         $this->setValign($valign);
  263.     }
  264.  
  265.     /**
  266.      * Sets the Manialink of the element. It works as a hyperlink.
  267.      * @param string Can be either a short Manialink or an URL pointing to a
  268.      *  Manialink
  269.      */
  270.     function setManialink($manialink)
  271.     {
  272.         $this->manialink $manialink;
  273.     }
  274.  
  275.     /**
  276.      * Sets the hyperlink of the element
  277.      * @param string An URL
  278.      */
  279.     function setUrl($url)
  280.     {
  281.         $this->url $url;
  282.     }
  283.     
  284.     /**
  285.      * Sets the Maniazones link of the element
  286.      * @param string 
  287.      */
  288.     function setManiazone($maniazone)
  289.     {
  290.         $this->maniazone $maniazone;
  291.     }
  292.  
  293.     /**
  294.      * Adds the player information parameters ("playerlogin", "nickname",
  295.      * "path", "lang") to the URL when you click on the link
  296.      */
  297.     function addPlayerId()
  298.     {
  299.         $this->addPlayerId 1;
  300.     }
  301.     
  302.     /**
  303.      * Sets the action of the element. For example, if you use the action "0" in
  304.      * the explorer, it closes the explorer when you click on the element.
  305.      * @param int 
  306.      */
  307.     function setAction($action)
  308.     {
  309.         $this->action $action;
  310.     }
  311.  
  312.     /**
  313.      * Sets the action key associated to the element. Only works on dedicated
  314.      * servers.
  315.      * @param int 
  316.      */
  317.     function setActionKey($actionKey)
  318.     {
  319.         $this->actionKey $actionKey;
  320.     }
  321.  
  322.     /**
  323.      * Sets the background color of the element using a 3-digit RGB hexadecimal
  324.      * value. For example, "fff" is white and "000" is black
  325.      * @param string 3-digit RGB hexadecimal value
  326.      */
  327.     function setBgcolor($bgcolor)
  328.     {
  329.         $this->bgcolor $bgcolor;
  330.     }
  331.     
  332.     /**
  333.      * Applies an image to the element. If you don't specify the second
  334.      * parameter, it will look for the image in the path defined by the
  335.      * APP_IMAGE_DIR_URL constant
  336.      * @param string The image filename (or URL)
  337.      * @param string The URL that will be appended to the image. Use null if you
  338.      *  want to specify an absolute URL as first parameter
  339.      */
  340.     function setImage($image$absoluteUrl APP_IMAGE_DIR_URL)
  341.     {
  342.         $this->setStyle(null);
  343.         $this->setSubStyle(null);
  344.         if($absoluteUrl)
  345.         {
  346.             $this->image $absoluteUrl $image;
  347.         }
  348.         else
  349.         {
  350.             $this->image $image;
  351.         }
  352.     }
  353.     
  354.     /**
  355.      * Set the image id of the element, used for internationalization
  356.      */
  357.     function setImageid($imageid)
  358.     {
  359.         $this->setStyle(null);
  360.         $this->setSubStyle(null);
  361.         $this->imageid $imageid;
  362.     }
  363.  
  364.     /**
  365.      * Applies an image to the highlighter state of the element. The second
  366.      * parameter works just like GuiElement::setImage()
  367.      * @param string The image filename (or URL)
  368.      * @param string The URL that will be appended to the image. Use null if you
  369.      *  want to specify an absolute URL as first parameter
  370.      */
  371.     function setImageFocus($imageFocus$absoluteUrl APP_IMAGE_DIR_URL)
  372.     {
  373.         if($absoluteUrl)
  374.         {
  375.             $this->imageFocus $absoluteUrl $imageFocus;
  376.         }
  377.         else
  378.         {
  379.             $this->imageFocus $imageFocus;
  380.         }
  381.     }
  382.     
  383.     /**
  384.      * Set the image focus id of the element, used for internationalization
  385.      */
  386.     function setImageFocusid($imageFocusid)
  387.     {
  388.         $this->imageFocusid;
  389.     }
  390.     
  391.     /**
  392.      * Returns the style of the element
  393.      * @return string 
  394.      */
  395.     function getStyle()
  396.     {
  397.         return $this->style;
  398.     }
  399.  
  400.     /**
  401.      * Returns the substyle of the element
  402.      * @return string 
  403.      */
  404.     function getSubStyle()
  405.     {
  406.         return $this->subStyle;
  407.     }
  408.     
  409.     /**
  410.      * Returns the horizontal alignment of the element
  411.      * @return string 
  412.      */
  413.     function getHalign()
  414.     {
  415.         return $this->halign;
  416.     }
  417.     
  418.     /**
  419.      * Returns the vertical alignment of the element
  420.      * @return string 
  421.      */
  422.     function getValign()
  423.     {
  424.         return $this->valign;
  425.     }
  426.     
  427.     /**
  428.      * Returns the Manialink hyperlink of the element
  429.      * @return string 
  430.      */
  431.     function getManialink()
  432.     {
  433.         return $this->manialink;
  434.     }
  435.     
  436.     /**
  437.      * Returns the Maniazones hyperlink of the element
  438.      * @return string 
  439.      */
  440.     function getManiazone()
  441.     {
  442.         return $this->maniazone;
  443.     }
  444.     
  445.     /**
  446.      * Returns the hyperlink of the element
  447.      * @return string 
  448.      */
  449.     function getUrl()
  450.     {
  451.         return $this->url;
  452.     }
  453.     
  454.     /**
  455.      * Returns the action associated to the element
  456.      * @return int 
  457.      */
  458.     function getAction()
  459.     {
  460.         return $this->action;
  461.     }
  462.  
  463.     /**
  464.      * Returns the action key associated to the element
  465.      * @return int 
  466.      */
  467.     function getActionKey()
  468.     {
  469.         return $this->actionKey;
  470.     }
  471.     
  472.     /**
  473.      * Returns whether the elements adds player information parameter to the URL
  474.      * when it's clicked
  475.      * @return boolean 
  476.      */
  477.     function getAddPlayerId()
  478.     {
  479.         return $this->addPlayerId;
  480.     }
  481.  
  482.     /**
  483.      * Returns the background color of the element
  484.      * @return string 3-digit RGB hexadecimal value
  485.      */
  486.     function getBgcolor()
  487.     {
  488.         return $this->bgcolor;
  489.     }
  490.     
  491.     /**
  492.      * Returns the image placed in the element
  493.      * @return string The image URL
  494.      */
  495.     function getImage()
  496.     {
  497.         return $this->image;
  498.     }
  499.     
  500.     function getImageid()
  501.     {
  502.         return $this->imageid;
  503.     }
  504.  
  505.     /**
  506.      * Returns the image placed in the element in its highlighted state
  507.      * @return string The image URL
  508.      */
  509.     function getImageFocus()
  510.     {
  511.         return $this->imageFocus;
  512.     }
  513.     
  514.     function getImageFocusid()
  515.     {
  516.         return $this->imageFocusid;
  517.     }
  518.  
  519.     /**
  520.      * Imports links and actions from another Manialink element
  521.      * @param GuiElement The source object
  522.      */
  523.     function addLink(GuiElement $object)
  524.     {
  525.         $this->manialink $object->getManialink();
  526.         $this->url $object->getUrl();
  527.         $this->maniazone $object->getManiazone();
  528.         $this->action $object->getAction();
  529.         $this->actionKey $object->getActionKey();
  530.         if($object->getAddPlayerId())
  531.         {
  532.             $this->addPlayerId 1;
  533.         }
  534.     }
  535.  
  536.     /**
  537.      * Returns whether the object has a link or an action (either Manialink,
  538.      * Maniazones link, hyperlink or action)
  539.      * @return string 
  540.      */
  541.     function hasLink()
  542.     {
  543.         return $this->manialink || $this->url || $this->action || $this->maniazone;
  544.     }
  545.  
  546.     /**
  547.      * Override this method in subclasses to perform some action before
  548.      * rendering the element
  549.      * @ignore
  550.      */
  551.     protected function preFilter()
  552.     {
  553.  
  554.     }
  555.  
  556.     /**
  557.      * Override this method in subclasses to perform some action after rendering
  558.      * the element
  559.      * @ignore
  560.      */
  561.     protected function postFilter()
  562.     {
  563.  
  564.     }
  565.  
  566.     /**
  567.      * Saves the object in the Manialink object stack for further rendering.
  568.      * Thanks to the use of GuiElement::preFilter() and GuiElement::
  569.      * postFilter(), you shouldn't have to override this method
  570.      */
  571.     final function save()
  572.     {
  573.         // Optional pre filtering
  574.         $this->preFilter();
  575.         
  576.         // Layout handling
  577.         $layout end(Manialink::$parentLayouts);
  578.         if($layout instanceof AbstractLayout)
  579.         {
  580.             $layout->preFilter($this);
  581.             $this->posX += $layout->xIndex;
  582.             $this->posY += $layout->yIndex;
  583.             $this->posZ += $layout->zIndex;
  584.         }
  585.         
  586.         // DOM element creation
  587.         if($this->xmlTagName)
  588.         {
  589.             $this->xml Manialink::$domDocument->createElement($this->xmlTagName);
  590.             end(Manialink::$parentNodes)->appendChild($this->xml);
  591.             
  592.             // Add pos
  593.             if($this->posX || $this->posY || $this->posZ)
  594.             {
  595.                 $this->xml->setAttribute('posn'
  596.                     $this->posX.' '.$this->posY.' '.$this->posZ);
  597.             }
  598.     
  599.             // Add size
  600.             if($this->sizeX || $this->sizeY)
  601.             {
  602.                 $this->xml->setAttribute('sizen'$this->sizeX.' '.$this->sizeY);
  603.             }
  604.     
  605.             // Add alignement
  606.             if($this->halign !== null)
  607.                 $this->xml->setAttribute('halign'$this->halign);
  608.             if($this->valign !== null)
  609.                 $this->xml->setAttribute('valign'$this->valign);
  610.             if($this->scale !== null)
  611.                 $this->xml->setAttribute('scale'$this->scale);
  612.     
  613.             // Add styles
  614.             if($this->style !== null)
  615.                 $this->xml->setAttribute('style'$this->style);
  616.             if($this->subStyle !== null)
  617.                 $this->xml->setAttribute('substyle'$this->subStyle);
  618.             if($this->bgcolor !== null)
  619.                 $this->xml->setAttribute('bgcolor'$this->bgcolor);
  620.     
  621.             // Add links
  622.             if($this->addPlayerId !== null && Manialink::$linksEnabled)
  623.                 $this->xml->setAttribute('addplayerid'$this->addPlayerId);
  624.             if($this->manialink !== null && Manialink::$linksEnabled)
  625.                 $this->xml->setAttribute('manialink'$this->manialink);
  626.             if($this->url !== null && Manialink::$linksEnabled)
  627.                 $this->xml->setAttribute('url'$this->url);
  628.             if($this->maniazone !== null && Manialink::$linksEnabled)
  629.                 $this->xml->setAttribute('maniazone'$this->maniazone);
  630.     
  631.             // Add action
  632.             if($this->action !== null)
  633.                 $this->xml->setAttribute('action'$this->action);
  634.             if($this->actionKey !== null)
  635.                 $this->xml->setAttribute('actionkey'$this->actionKey);
  636.     
  637.             // Add images
  638.             if($this->image !== null)
  639.                 $this->xml->setAttribute('image'$this->image);
  640.             if($this->imageid !== null)
  641.                 $this->xml->setAttribute('imageid'$this->imageid);
  642.             if($this->imageFocus !== null)
  643.                 $this->xml->setAttribute('imagefocus'$this->imageFocus);
  644.             if($this->imageFocusid !== null)
  645.                 $this->xml->setAttribute('imagefocusid'$this->imageFocusid);    
  646.         }
  647.         
  648.         // Layout post filtering
  649.         if($layout instanceof AbstractLayout)
  650.         {
  651.             $layout->postFilter($this);
  652.         }
  653.         
  654.         // Post filtering
  655.         $this->postFilter();
  656.     }
  657. }
  658.  
  659. /**
  660.  * A blank element, useful to place gaps between elements when using layouts
  661.  * @package ManiaLib
  662.  * @subpackage GUIToolkit
  663.  */
  664. class Spacer extends GuiElement
  665. {
  666.     /**
  667.      * @ignore
  668.      */
  669.     protected $xmlTagName null;
  670.  
  671. /**
  672.  * Quad
  673.  * @package ManiaLib
  674.  * @subpackage GUIToolkit
  675.  */
  676. class Quad extends GuiElement
  677. {
  678.     /**#@+
  679.      * Manialink <b>style</b> for the <b>Quad</b> element 
  680.      */
  681.     const BgRaceScore2        = 'BgRaceScore2';
  682.     const Bgs1                = 'Bgs1';
  683.     const Bgs1InRace          = 'Bgs1InRace';
  684.     const BgsChallengeMedals  = 'BgsChallengeMedals';
  685.     const BgsPlayerCard       = 'BgsPlayerCard';
  686.     const Icons128x128_1      = 'Icons128x128_1';
  687.     const Icons128x32_1       = 'Icons128x32_1';
  688.     const Icons64x64_1        = 'Icons64x64_1';
  689.     const MedalsBig           = 'MedalsBig';
  690.     /**#@-*/
  691.     
  692.     /**#@+
  693.      * @ignore
  694.      */
  695.     protected $xmlTagName 'quad';
  696.     protected $style GuiDefaultStyles::Quad_Style;
  697.     protected $subStyle GuiDefaultStyles::Quad_Substyle;
  698.     /**#@-*/
  699. }
  700.  
  701. /**
  702.  * Icon
  703.  * Should be abstract some day, use classes like "Icons128x128_1" instead
  704.  * @package ManiaLib
  705.  * @subpackage GUIToolkit
  706.  */
  707. class Icon extends Quad
  708. {
  709.     /**#@+
  710.      * @ignore
  711.      */
  712.     protected $style GuiDefaultStyles::Icon_Style;
  713.     protected $subStyle GuiDefaultStyles::Icon_Substyle;
  714.     /**#@-*/
  715.  
  716.     function __construct($size 7)
  717.     {
  718.         $this->sizeX $size;
  719.         $this->sizeY $size;
  720.     }
  721. }
  722.  
  723. /**
  724.  * Bgs1 quad
  725.  * @package ManiaLib
  726.  * @subpackage GUIToolkit
  727.  */
  728. class Bgs1 extends Quad
  729. {
  730.     /**#@+
  731.      * @ignore
  732.      */
  733.     protected $style Quad::Bgs1;
  734.     protected $subStyle self::BgWindow1;
  735.     /**#@-*/
  736.     
  737.     const BgButtonBig      = 'BgButtonBig';
  738.     const BgButtonSmall    = 'BgButtonSmall';
  739.     const BgButton         = 'BgButton';
  740.     const BgCard           = 'BgCard';
  741.     const BgCard1          = 'BgCard1';
  742.     const BgCard2          = 'BgCard2';
  743.     const BgCard3          = 'BgCard3';
  744.     const BgCardChallenge  = 'BgCardChallenge';
  745.     const BgCardFolder     = 'BgCardFolder';
  746.     const BgCardList       = 'BgCardList';
  747.     const BgCardPlayer     = 'BgCardPlayer';
  748.     const BgCardBuddy       = 'BgCardBuddy';
  749.     const BgCardSystem     = 'BgCardSystem';
  750.     const BgCardZone       = 'BgCardZone';
  751.     const BgIconBorder     = 'BgIconBorder';
  752.     const BgList           = 'BgList';
  753.     const BgListLine       = 'BgListLine';
  754.     const BgPager          = 'BgPager';
  755.     const BgProgressBar    = 'BgProgressBar';
  756.     const BgSlider         = 'BgSlider';
  757.     const BgTitle2         = 'BgTitle2';
  758.     const BgTitle3         = 'BgTitle3';
  759.     const BgTitle3_1       = 'BgTitle3_1';
  760.     const BgTitle3_2       = 'BgTitle3_2';
  761.     const BgTitle3_3       = 'BgTitle3_3';
  762.     const BgTitle3_4       = 'BgTitle3_4';
  763.     const BgTitlePage      = 'BgTitlePage';
  764.     const BgWindow1        = 'BgWindow1';
  765.     const BgWindow2        = 'BgWindow2';
  766.     const BgWindow3        = 'BgWindow3';
  767.     const NavButtonBlink   = 'NavButtonBlink';
  768.     const NavButton        = 'NavButton';
  769.     const ProgressBarSmall = 'ProgressBarSmall';
  770.     const ProgressBar      = 'ProgressBar';
  771. }
  772.  
  773. /**
  774.  * Bgs1InRace quad
  775.  * @package ManiaLib
  776.  * @subpackage GUIToolkit
  777.  */    
  778. class Bgs1InRace extends Bgs1 
  779. {
  780.     /**
  781.      * @ignore
  782.      */
  783.     protected $style Quad::Bgs1InRace;
  784. }
  785.  
  786. /**
  787.  * BgRaceScore2 quad
  788.  * @package ManiaLib
  789.  * @subpackage GUIToolkit
  790.  */    
  791. class BgRaceScore2 extends Quad
  792. {
  793.     /**#@+
  794.      * @ignore
  795.      */
  796.     protected $style Quad::BgRaceScore2;
  797.     protected $subStyle self::BgCardServer;
  798.     /**#@-*/
  799.     
  800.     const BgCardServer                = 'BgCardServer';
  801.     const BgScores                    = 'BgScores';
  802.     const CupFinisher                 = 'CupFinisher';
  803.     const CupPotentialFinisher        = 'CupPotentialFinisher';
  804.     const Fame                        = 'Fame';
  805.     const Handle                      = 'Handle';
  806.     const HandleBlue                  = 'HandleBlue';
  807.     const HandleRed                   = 'HandleRed';
  808.     const IsLadderDisabled            = 'IsLadderDisabled';
  809.     const IsLocalPlayer               = 'IsLocalPlayer';
  810.     const LadderRank                  = 'LadderRank';
  811.     const Laps                        = 'Laps';
  812.     const Podium                      = 'Podium';
  813.     const Points                      = 'Points';
  814.     const SandTimer                   = 'SandTimer';
  815.     const ScoreLink                   = 'ScoreLink';
  816.     const ScoreReplay                 = 'ScoreReplay';
  817.     const SendScore                   = 'SendScore';
  818.     const Spectator                   = 'Spectator';
  819.     const Tv                          = 'Tv';
  820.     const Warmup                      = 'Warmup';
  821. }
  822.  
  823. /**
  824.  * BgsChallengeMedals quad
  825.  * @package ManiaLib
  826.  * @subpackage GUIToolkit
  827.  */    
  828. class BgsChallengeMedals extends Quad
  829. {
  830.     /**#@+
  831.      * @ignore
  832.      */
  833.     protected $style Quad::BgsChallengeMedals;
  834.     protected $subStyle self::BgBronze;
  835.     /**#@-*/
  836.     
  837.     const BgBronze                    = 'BgBronze';
  838.     const BgGold                      = 'BgGold';
  839.     const BgNadeo                     = 'BgNadeo';
  840.     const BgNotPlayed                 = 'BgNotPlayed';
  841.     const BgPlayed                    = 'BgPlayed';
  842.     const BgSilver                    = 'BgSilver';
  843. }
  844.  
  845. /**
  846.  * BgsPlayerCard quad
  847.  * @package ManiaLib
  848.  * @subpackage GUIToolkit
  849.  */    
  850. class BgsPlayerCard extends Quad
  851. {
  852.     /**#@+
  853.      * @ignore
  854.      */
  855.     protected $style Quad::BgsPlayerCard;
  856.     protected $subStyle self::BgActivePlayerCard;
  857.     /**#@-*/
  858.     
  859.     const BgActivePlayerCard    = 'BgActivePlayerCard';
  860.     const BgActivePlayerName    = 'BgActivePlayerName';
  861.     const BgActivePlayerScore   = 'BgActivePlayerScore';
  862.     const BgCard                = 'BgCard';
  863.     const BgCardSystem          = 'BgCardSystem';
  864.     const BgMediaTracker        = 'BgMediaTracker';
  865.     const BgPlayerCardBig       = 'BgPlayerCardBig';
  866.     const BgPlayerCardSmall     = 'BgPlayerCardSmall';
  867.     const BgPlayerCard          = 'BgPlayerCard';
  868.     const BgPlayerName          = 'BgPlayerName';
  869.     const BgPlayerScore         = 'BgPlayerScore';
  870.     const BgRacePlayerLine      = 'BgRacePlayerLine';
  871.     const BgRacePlayerName      = 'BgRacePlayerName';
  872.     const ProgressBar           = 'ProgressBar';
  873. }
  874.  
  875. /**
  876.  * Icons128x128_1 quad
  877.  * @package ManiaLib
  878.  * @subpackage GUIToolkit
  879.  */    
  880. class Icons128x128_1 extends Icon
  881. {
  882.     /**#@+
  883.      * @ignore
  884.      */
  885.     protected $style Quad::Icons128x128_1;
  886.     protected $subStyle self::Forever;
  887.     /**#@-*/
  888.     
  889.     const Advanced                    = 'Advanced';
  890.     const Back                        = 'Back';
  891.     const BackFocusable               = 'BackFocusable';
  892.     const Beginner                    = 'Beginner';
  893.     const Browse                      = 'Browse';
  894.     const Buddies                     = 'Buddies';
  895.     const Challenge                   = 'Challenge';
  896.     const ChallengeAuthor             = 'ChallengeAuthor';
  897.     const Coppers                     = 'Coppers';
  898.     const Create                      = 'Create';
  899.     const Credits                     = 'Credits';
  900.     const Custom                      = 'Custom';
  901.     const CustomStars                 = 'CustomStars';
  902.     const DefaultIcon                 = 'Default';
  903.     const Download                    = 'Download';
  904.     const Easy                        = 'Easy';
  905.     const Editor                      = 'Editor';
  906.     const Extreme                     = 'Extreme';
  907.     const Forever                     = 'Forever';
  908.     const GhostEditor                 = 'GhostEditor';
  909.     const Hard                        = 'Hard';
  910.     const Hotseat                     = 'Hotseat';
  911.     const Inputs                      = 'Inputs';
  912.     const Invite                      = 'Invite';
  913.     const LadderPoints                = 'LadderPoints';
  914.     const Lan                         = 'Lan';
  915.     const Launch                      = 'Launch';
  916.     const Load                        = 'Load';
  917.     const LoadTrack                   = 'LoadTrack';
  918.     const ManiaZones                  = 'ManiaZones';
  919.     const Manialink                   = 'Manialink';
  920.     const MedalCount                  = 'MedalCount';
  921.     const MediaTracker                = 'MediaTracker';
  922.     const Medium                      = 'Medium';
  923.     const Multiplayer                 = 'Multiplayer';
  924.     const Nations                     = 'Nations';
  925.     const NewTrack                    = 'NewTrack';
  926.     const Options                     = 'Options';
  927.     const Padlock                     = 'Padlock';
  928.     const Paint                       = 'Paint';
  929.     const Platform                    = 'Platform';
  930.     const PlayerPage                  = 'PlayerPage';
  931.     const Profile                     = 'Profile';
  932.     const ProfileAdvanced             = 'ProfileAdvanced';
  933.     const ProfileVehicle              = 'ProfileVehicle';
  934.     const Puzzle                      = 'Puzzle';
  935.     const Quit                        = 'Quit';
  936.     const Race                        = 'Race';
  937.     const Rankings                    = 'Rankings';
  938.     const Rankinks                    = 'Rankinks';
  939.     const Replay                      = 'Replay';
  940.     const Save                        = 'Save';
  941.     const ServersAll                  = 'ServersAll';
  942.     const ServersFavorites            = 'ServersFavorites';
  943.     const ServersSuggested            = 'ServersSuggested';
  944.     const Share                       = 'Share';
  945.     const ShareBlink                  = 'ShareBlink';
  946.     const SkillPoints                 = 'SkillPoints';
  947.     const Solo                        = 'Solo';
  948.     const Statistics                  = 'Statistics';
  949.     const Stunts                      = 'Stunts';
  950.     const United                      = 'United';
  951.     const Upload                      = 'Upload';
  952.     const Vehicles                    = 'Vehicles';
  953. }
  954.  
  955. /**
  956.  * Icons128x32_1 quad
  957.  * @package ManiaLib
  958.  * @subpackage GUIToolkit
  959.  */    
  960. class Icons128x32_1 extends Icon
  961. {
  962.     /**#@+
  963.      * @ignore
  964.      */
  965.     protected $style Quad::Icons128x32_1;
  966.     protected $subStyle self::RT_Cup;
  967.     /**#@-*/
  968.     
  969.     const RT_Cup                      = 'RT_Cup';
  970.     const RT_Laps                     = 'RT_Laps';
  971.     const RT_Rounds                   = 'RT_Rounds';
  972.     const RT_Stunts                   = 'RT_Stunts';
  973.     const RT_Team                     = 'RT_Team';
  974.     const RT_TimeAttack               = 'RT_TimeAttack';
  975.     const SliderBar                   = 'SliderBar';
  976.     const SliderBar2                  = 'SliderBar2';
  977.     const UrlBg                       = 'UrlBg';
  978. }
  979.  
  980. /**
  981.  * Icons64x64_1 quad
  982.  * @package ManiaLib
  983.  * @subpackage GUIToolkit
  984.  */    
  985. class Icons64x64_1 extends Icon
  986. {
  987.     /**#@+
  988.      * @ignore
  989.      */
  990.     protected $style Quad::Icons64x64_1;
  991.     protected $subStyle self::GenericButton;
  992.     /**#@-*/
  993.     
  994.     const Stereo3D                    = '3DStereo';
  995.     const ArrowBlue                   = 'ArrowBlue';
  996.     const ArrowDown                   = 'ArrowDown';
  997.     const ArrowFastNext               = 'ArrowFastNext';
  998.     const ArrowFastPrev               = 'ArrowFastPrev';
  999.     const ArrowFirst                  = 'ArrowFirst';
  1000.     const ArrowGreen                  = 'ArrowGreen';
  1001.     const ArrowLast                   = 'ArrowLast';
  1002.     const ArrowNext                   = 'ArrowNext';
  1003.     const ArrowPrev                   = 'ArrowPrev';
  1004.     const ArrowRed                    = 'ArrowRed';
  1005.     const ArrowUp                     = 'ArrowUp';
  1006.     const Browser                     = 'Browser';
  1007.     const Buddy                       = 'Buddy';
  1008.     const ButtonLeagues               = 'ButtonLeagues';
  1009.     const ButtonPlayers               = 'ButtonPlayers';
  1010.     const ButtonServers               = 'ButtonServers';
  1011.     const Camera                      = 'Camera';
  1012.     const CameraLocal                 = 'CameraLocal';
  1013.     const Check                       = 'Check';
  1014.     const ClipPause                   = 'ClipPause';
  1015.     const ClipPlay                    = 'ClipPlay';
  1016.     const ClipRewind                  = 'ClipRewind';
  1017.     const Close                       = 'Close';
  1018.     const DisplaySettings             = 'DisplaySettings';
  1019.     const EmptyIcon                   = 'Empty';
  1020.     const Finish                      = 'Finish';
  1021.     const FinishGrey                  = 'FinishGrey';
  1022.     const First                       = 'First';
  1023.     const GenericButton               = 'GenericButton';
  1024.     const Green                       = 'Green';
  1025.     const IconLeaguesLadder           = 'IconLeaguesLadder';
  1026.     const IconPlayers                 = 'IconPlayers';
  1027.     const IconPlayersLadder           = 'IconPlayersLadder';
  1028.     const IconServers                 = 'IconServers';
  1029.     const Inbox                       = 'Inbox';
  1030.     const LvlGreen                    = 'LvlGreen';
  1031.     const LvlRed                      = 'LvlRed';
  1032.     const LvlYellow                   = 'LvlYellow';
  1033.     const ManiaLinkHome               = 'ManiaLinkHome';
  1034.     const Maximize                    = 'Maximize';
  1035.     const MediaAudioDownloading       = 'MediaAudioDownloading';
  1036.     const MediaPlay                   = 'MediaPlay';
  1037.     const MediaStop                   = 'MediaStop';
  1038.     const MediaVideoDownloading       = 'MediaVideoDownloading';
  1039.     const Music                       = 'Music';
  1040.     const NewMessage                  = 'NewMessage';
  1041.     const NotBuddy                    = 'NotBuddy';
  1042.     const OfficialRace                = 'OfficialRace';
  1043.     const Opponents                   = 'Opponents';
  1044.     const Outbox                      = 'Outbox';
  1045.     const QuitRace                    = 'QuitRace';
  1046.     const RedHigh                     = 'RedHigh';
  1047.     const RedLow                      = 'RedLow';
  1048.     const Refresh                     = 'Refresh';
  1049.     const RestartRace                 = 'RestartRace';
  1050.     const Second                      = 'Second';
  1051.     const SliderCursor                = 'SliderCursor';
  1052.     const SliderCursor2               = 'SliderCursor2';
  1053.     const Sound                       = 'Sound';
  1054.     const StarGold                    = 'StarGold';
  1055.     const StateFavourite              = 'StateFavourite';
  1056.     const StatePrivate                = 'StatePrivate';
  1057.     const StateSuggested              = 'StateSuggested';
  1058.     const TV                          = 'TV';
  1059.     const TagTypeBronze               = 'TagTypeBronze';
  1060.     const TagTypeGold                 = 'TagTypeGold';
  1061.     const TagTypeNadeo                = 'TagTypeNadeo';
  1062.     const TagTypeNone                 = 'TagTypeNone';
  1063.     const TagTypeSilver               = 'TagTypeSilver';
  1064.     const Third                       = 'Third';
  1065.     const ToolLeague1                 = 'ToolLeague1';
  1066.     const ToolLeague2                 = 'ToolLeague2';
  1067.     const ToolLeague3                 = 'ToolLeague3';
  1068.     const ToolRoot                    = 'ToolRoot';
  1069.     const ToolTree                    = 'ToolTree';
  1070.     const ToolUp                      = 'ToolUp';
  1071.     const TrackInfo                   = 'TrackInfo';
  1072.     const Windowed                    = 'Windowed';
  1073.     const YellowHigh                  = 'YellowHigh';
  1074.     const YellowLow                   = 'YellowLow';
  1075. }
  1076.  
  1077. /**
  1078.  * MedalsBig quad
  1079.  * @package ManiaLib
  1080.  * @subpackage GUIToolkit
  1081.  */    
  1082. class MedalsBig extends Icon
  1083. {
  1084.     /**#@+
  1085.      * @ignore
  1086.      */
  1087.     protected $style Quad::MedalsBig;
  1088.     protected $subStyle self::MedalBronze;
  1089.     /**#@-*/
  1090.     
  1091.     const MedalBronze                 = 'MedalBronze';
  1092.     const MedalGold                   = 'MedalGold';
  1093.     const MedalGoldPerspective        = 'MedalGoldPerspective';
  1094.     const MedalNadeo                  = 'MedalNadeo';
  1095.     const MedalNadeoPerspective       = 'MedalNadeoPerspective';
  1096.     const MedalSilver                 = 'MedalSilver';
  1097.     const MedalSlot                   = 'MedalSlot';
  1098. }
  1099.  
  1100. /**
  1101.  * Icons64x64_1
  1102.  * @deprecated Use Icons64x64_1 instead
  1103.  * @package ManiaLib
  1104.  * @subpackage GUIToolkit
  1105.  * @ignore
  1106.  */
  1107. class Icon64 extends Icon
  1108. {
  1109.     protected $style GuiDefaultStyles::Icon64_Style;
  1110.     protected $subStyle GuiDefaultStyles::Icon64_Substyle;
  1111. }
  1112.  
  1113. /**
  1114.  * Icons128x32_1
  1115.  * @deprecated Use Icons128x32_1 instead
  1116.  * @package ManiaLib
  1117.  * @subpackage GUIToolkit
  1118.  * @ignore
  1119.  */
  1120. class Icon128 extends Icon
  1121. {
  1122.     protected $style GuiDefaultStyles::Icon128_Style;
  1123.     protected $subStyle GuiDefaultStyles::Icon128_Substyle;
  1124. }
  1125.  
  1126. /**
  1127.  * MedalsBig
  1128.  * @deprecated Use MedalsBig instead
  1129.  * @package ManiaLib
  1130.  * @subpackage GUIToolkit
  1131.  * @ignore
  1132.  */
  1133. class IconMedal extends Icon
  1134. {
  1135.     protected $style GuiDefaultStyles::IconMedal_Style;
  1136.     protected $subStyle GuiDefaultStyles::IconMedal_Substyle;
  1137. }
  1138.  
  1139. /**
  1140.  * Include
  1141.  * Manialink include tag, used to include another Manialink file inside a Manialink
  1142.  * Use the setUrl() method
  1143.  * Manialink::redirectManialink() is a shortcut
  1144.  * @package ManiaLib
  1145.  * @subpackage GUIToolkit
  1146.  */
  1147. class IncludeManialink extends GuiElement
  1148. {
  1149.     function __construct()
  1150.     {
  1151.     }
  1152.  
  1153.     protected $xmlTagName = 'include';
  1154.     protected $halign = null;
  1155.     protected $valign = null;
  1156.     protected $posX = null;
  1157.     protected $posY = null;
  1158.     protected $posZ = null;
  1159. }
  1160.  
  1161. /**
  1162.  * Format
  1163.  * @package ManiaLib
  1164.  * @subpackage GUIToolkit
  1165.  */
  1166. class Format extends GuiElement
  1167. {
  1168.     /**#@+
  1169.      * Manialink <b>styles</b> for the <b>Format</b> element and its children 
  1170.      */
  1171.     const TextButtonBig               = 'TextButtonBig';
  1172.     const TextButtonMedium            = 'TextButtonMedium';
  1173.     const TextButtonNav               = 'TextButtonNav';
  1174.     const TextButtonSmall             = 'TextButtonSmall';
  1175.     const TextCardInfoSmall           = 'TextCardInfoSmall';
  1176.     const TextCardMedium              = 'TextCardMedium';
  1177.     const TextCardRaceRank            = 'TextCardRaceRank';
  1178.     const TextCardScores2             = 'TextCardScores2';
  1179.     const TextCardSmallScores2        = 'TextCardSmallScores2';
  1180.     const TextCardSmallScores2Rank    = 'TextCardSmallScores2Rank';
  1181.     const TextChallengeNameMedal      = 'TextChallengeNameMedal';
  1182.     const TextChallengeNameMedalNone  = 'TextChallengeNameMedalNone';
  1183.     const TextChallengeNameMedium     = 'TextChallengeNameMedium';
  1184.     const TextChallengeNameSmall      = 'TextChallengeNameSmall';
  1185.     const TextCongratsBig             = 'TextCongratsBig';
  1186.     const TextCredits                 = 'TextCredits';
  1187.     const TextCreditsTitle            = 'TextCreditsTitle';
  1188.     const TextInfoMedium              = 'TextInfoMedium';
  1189.     const TextInfoSmall               = 'TextInfoSmall';
  1190.     const TextPlayerCardName          = 'TextPlayerCardName';
  1191.     const TextRaceChat                = 'TextRaceChat';
  1192.     const TextRaceChrono              = 'TextRaceChrono';
  1193.     const TextRaceChronoError         = 'TextRaceChronoError';
  1194.     const TextRaceChronoWarning       = 'TextRaceChronoWarning';
  1195.     const TextRaceMessage             = 'TextRaceMessage';
  1196.     const TextRaceStaticSmall         = 'TextRaceStaticSmall';
  1197.     const TextRaceValueSmall          = 'TextRaceValueSmall';
  1198.     const TextRankingsBig             = 'TextRankingsBig';
  1199.     const TextStaticMedium            = 'TextStaticMedium';
  1200.     const TextStaticSmall             = 'TextStaticSmall';
  1201.     const TextSubTitle1               = 'TextSubTitle1';
  1202.     const TextSubTitle2               = 'TextSubTitle2';
  1203.     const TextTips                    = 'TextTips';
  1204.     const TextTitle1                  = 'TextTitle1';
  1205.     const TextTitle2                  = 'TextTitle2';
  1206.     const TextTitle3                  = 'TextTitle3';
  1207.     const TextTitle2Blink             = 'TextTitle2Blink';
  1208.     const TextTitleError              = 'TextTitleError';
  1209.     const TextValueBig                = 'TextValueBig';
  1210.     const TextValueMedium             = 'TextValueMedium';
  1211.     const TextValueSmall              = 'TextValueSmall';
  1212.     /**#@-*/
  1213.     
  1214.     /**#@+
  1215.      * @ignore
  1216.      */
  1217.     protected $xmlTagName 'format';
  1218.     protected $halign null;
  1219.     protected $valign null;
  1220.     protected $posX null;
  1221.     protected $posY null;
  1222.     protected $posZ null;
  1223.     protected $style null;
  1224.     protected $subStyle null;
  1225.     protected $textSize;
  1226.     protected $textColor;
  1227.     /**#@-*/
  1228.  
  1229.     function __construct({}
  1230.     
  1231.     /**
  1232.      * Sets the text size
  1233.      * @param int 
  1234.      */
  1235.     function setTextSize($textsize)
  1236.     {
  1237.         $this->textSize $textsize;
  1238.         $this->setStyle(null);
  1239.         $this->setSubStyle(null);
  1240.     }
  1241.     
  1242.     /**
  1243.      * Sets the text color
  1244.      * @param string 3-digit RGB hexadecimal value
  1245.      */
  1246.     function setTextColor($textcolor)
  1247.     {
  1248.         $this->textColor $textcolor;
  1249.         $this->setStyle(null);
  1250.         $this->setSubStyle(null);
  1251.     }
  1252.     
  1253.     /**
  1254.      * Returns the text size
  1255.      * @return int 
  1256.      */
  1257.     function getTextSize()
  1258.     {
  1259.         return $this->textSize;
  1260.     }
  1261.  
  1262.     /**
  1263.      * Returns the text color
  1264.      * @return string 3-digit RGB hexadecimal value
  1265.      */
  1266.     function getTextColor()
  1267.     {
  1268.         return $this->textColor;
  1269.     }
  1270.  
  1271.     /**
  1272.      * @ignore
  1273.      */
  1274.     protected function postFilter()
  1275.     {
  1276.         if($this->textSize !== null)
  1277.             $this->xml->setAttribute('textsize'$this->textSize);
  1278.         if($this->textColor !== null)
  1279.             $this->xml->setAttribute('textcolor'$this->textColor);
  1280.     }
  1281. }
  1282.  
  1283. /**
  1284.  * Label
  1285.  * @package ManiaLib
  1286.  * @subpackage GUIToolkit
  1287.  */
  1288. class Label extends Format
  1289. {
  1290.     /**#@+
  1291.      * @ignore
  1292.      */
  1293.     protected $xmlTagName 'label';
  1294.     protected $style GuiDefaultStyles::Label_Style;
  1295.     protected $posX 0;
  1296.     protected $posY 0;
  1297.     protected $posZ 0;
  1298.     protected $text;
  1299.     protected $textid;
  1300.     protected $autonewline;
  1301.     protected $maxline;
  1302.     /**#@-*/
  1303.     
  1304.     function __construct($sizeX 20$sizeY 3)
  1305.     {
  1306.         $this->sizeX $sizeX;
  1307.         $this->sizeY $sizeY;
  1308.     }
  1309.     
  1310.     /**
  1311.      * Sets the text
  1312.      * @param string 
  1313.      */
  1314.     function setText($text)
  1315.     {
  1316.         $this->text $text;
  1317.     }
  1318.     
  1319.     /**
  1320.      * Sets the text Id for use with Manialink dictionaries
  1321.      */
  1322.     function setTextid($textid)
  1323.     {
  1324.         $this->textid $textid;
  1325.     }
  1326.     
  1327.     /**
  1328.      * Sets the maximum number of lines to display
  1329.      * @param int 
  1330.      */
  1331.     function setMaxline($maxline)
  1332.     {
  1333.         $this->maxline $maxline;
  1334.     }
  1335.     
  1336.     /**
  1337.      * Enables wraping the text into several lines if the line is too short
  1338.      */
  1339.     function enableAutonewline()
  1340.     {
  1341.         $this->autonewline 1;
  1342.     }
  1343.     
  1344.     /**
  1345.      * Returns the text
  1346.      * @return string 
  1347.      */
  1348.     function getText()
  1349.     {
  1350.         return $this->text;
  1351.     }
  1352.     
  1353.     /**
  1354.      * Returns the text Id
  1355.      * @return string 
  1356.      */
  1357.     function getTextid()
  1358.     {
  1359.         return $this->textid;
  1360.     }
  1361.     
  1362.     /**
  1363.      * Returns the maximum number of lines to display
  1364.      * @return int 
  1365.      */
  1366.     function getMaxline()
  1367.     {
  1368.         return $this->maxline;
  1369.     }
  1370.     
  1371.     /**
  1372.      * Returns whether word wrapping is enabled
  1373.      * @return boolean 
  1374.      */
  1375.     function getAutonewline()
  1376.     {
  1377.         return $this->autonewline;
  1378.     }
  1379.  
  1380.     /**
  1381.      * @ignore
  1382.      */
  1383.     protected function postFilter()
  1384.     {
  1385.         parent::postFilter();
  1386.         if($this->text !== null)
  1387.         {
  1388.             if(Manialink::$linksEnabled)
  1389.                 $this->xml->setAttribute('text'$this->text);
  1390.             else
  1391.                 $this->xml->setAttribute('text'TMStrings::stripLinks($this->text));
  1392.         }    
  1393.         if($this->textid !== null)
  1394.         {
  1395.             if(Manialink::$linksEnabled)
  1396.                 $this->xml->setAttribute('textid'$this->textid);
  1397.             else
  1398.                 $this->xml->setAttribute('textid'TMStrings::stripLinks($this->textid));
  1399.         }
  1400.         if($this->autonewline !== null)
  1401.             $this->xml->setAttribute('autonewline'$this->autonewline);
  1402.         if($this->maxline !== null)
  1403.             $this->xml->setAttribute('maxline'$this->maxline);
  1404.     }
  1405. }
  1406.  
  1407. /**
  1408.  * Entry
  1409.  * Input field for Manialinks
  1410.  * @package ManiaLib
  1411.  * @subpackage GUIToolkit
  1412.  */
  1413. class Entry extends Label
  1414. {
  1415.     /**#@+
  1416.      * @ignore
  1417.      */
  1418.     protected $xmlTagName 'entry';
  1419.     protected $style GuiDefaultStyles::Entry_Style;
  1420.     protected $name;
  1421.     protected $defaultValue;
  1422.     /**#@-*/
  1423.     
  1424.     /**
  1425.      * Sets the name of the entry. Will be used as the parameter name in the URL
  1426.      * when submitting the page
  1427.      * @param string 
  1428.      */
  1429.     function setName($name)
  1430.     {
  1431.         $this->name $name;
  1432.     }
  1433.     
  1434.     /**
  1435.      * Sets the default value of the entry
  1436.      * @param mixed 
  1437.      */
  1438.     function setDefault($value)
  1439.     {
  1440.         $this->defaultValue $value;
  1441.     }
  1442.     
  1443.     /**
  1444.      * Returns the name of the entry
  1445.      * @return string 
  1446.      */
  1447.     function getName()
  1448.     {
  1449.         return $this->name;
  1450.     }
  1451.     
  1452.     /**
  1453.      * Returns the default value of the entry
  1454.      * @return mixed 
  1455.      */
  1456.     function getDefault()
  1457.     {
  1458.         return $this->defaultValue;
  1459.     }
  1460.  
  1461.     /**
  1462.      * @ignore
  1463.      */
  1464.     protected function postFilter()
  1465.     {
  1466.         parent::postFilter();
  1467.         if($this->name !== null)
  1468.             $this->xml->setAttribute('name'$this->name);
  1469.         if($this->defaultValue !== null)
  1470.             $this->xml->setAttribute('default'$this->defaultValue);
  1471.     }
  1472. }
  1473.  
  1474. /**
  1475.  * FileEntry
  1476.  * File input field for Manialinks
  1477.  * @package ManiaLib
  1478.  * @subpackage GUIToolkit
  1479.  */
  1480. class FileEntry extends Entry
  1481. {
  1482.     /**#@+
  1483.      * @ignore 
  1484.      */
  1485.     protected $xmlTagName 'fileentry';
  1486.     protected $folder;
  1487.     /**#@-*/
  1488.     
  1489.     /**
  1490.      * Sets the default folder
  1491.      * @param string 
  1492.      */
  1493.     function setFolder($folder)
  1494.     {
  1495.         $this->folder $folder;
  1496.     }
  1497.  
  1498.     /**
  1499.      * Returns the default folder
  1500.      * @return string 
  1501.      */
  1502.     function getFolder()
  1503.     {
  1504.         return $this->folder;
  1505.     }
  1506.  
  1507.     /**
  1508.      * @ignore
  1509.      */
  1510.     protected function postFilter()
  1511.     {
  1512.         parent::postFilter();
  1513.         if($this->folder !== null)
  1514.             $this->xml->setAttribute('folder'$this->folder);
  1515.     }
  1516. }
  1517.  
  1518. /**
  1519.  * Button
  1520.  * @package ManiaLib
  1521.  * @subpackage GUIToolkit
  1522.  */
  1523. class Button extends Label
  1524. {
  1525.     const CardButttonMedium       = 'CardButtonMedium';
  1526.     const CardButttonMediumWide   = 'CardButtonMediumWide';
  1527.     const CardButtonSmallWide     = 'CardButtonSmallWide';
  1528.     const CardButtonSmall         = 'CardButtonSmall';
  1529.     
  1530.     /**#@+
  1531.      * @ignore 
  1532.      */
  1533.     protected $subStyle null;
  1534.     protected $style GuiDefaultStyles::Button_Style;
  1535.     /**#@-*/
  1536.     
  1537.     function __construct($sizeX 25$sizeY 3)
  1538.     {
  1539.         parent::__construct($sizeX$sizeY);        
  1540.     }
  1541. }
  1542.  
  1543. /**
  1544.  * Music
  1545.  * @package ManiaLib
  1546.  * @subpackage GUIToolkit
  1547.  */
  1548. class Music extends GuiElement
  1549. {
  1550.     /**#@+
  1551.      * @ignore 
  1552.      */
  1553.     protected $xmlTagName 'music';
  1554.     protected $halign null;
  1555.     protected $valign null;
  1556.     protected $posX null;
  1557.     protected $posY null;
  1558.     protected $posZ null;
  1559.     protected $data;
  1560.     /**#@-*/
  1561.     
  1562.     function __construct()
  1563.     {
  1564.     }
  1565.     
  1566.     /**
  1567.      * Sets the data to play. If you don't specify the second parameter, it will
  1568.      * look for the image in the path defined by the APP_DATA_DIR_URL constant
  1569.      * @param string The image filename (or URL)
  1570.      * @param string The URL that will be appended to the image. Use null if you
  1571.      *  want to specify an absolute URL as first parameter
  1572.      */
  1573.     function setData($filename$absoluteUrl APP_DATA_DIR_URL)
  1574.     {
  1575.         if($absoluteUrl)
  1576.         {
  1577.             $this->data $absoluteUrl $filename;
  1578.         }
  1579.         else
  1580.         {
  1581.             $this->data $filename;
  1582.         }
  1583.     }
  1584.     
  1585.     /**
  1586.      * Returns the data URL
  1587.      * @return string 
  1588.      */
  1589.     function getData()
  1590.     {
  1591.         return $this->data;
  1592.     }
  1593.  
  1594.     /**
  1595.      * @ignore
  1596.      */
  1597.     protected function postFilter()
  1598.     {
  1599.         if($this->data !== null)
  1600.             $this->xml->setAttribute('data'$this->data);
  1601.     }
  1602. }
  1603.  
  1604. /**
  1605.  * Audio player
  1606.  * @package ManiaLib
  1607.  * @subpackage GUIToolkit
  1608.  */
  1609. class Audio extends Music
  1610. {
  1611.     /**#@+
  1612.      * @ignore 
  1613.      */
  1614.     protected $xmlTagName 'music';
  1615.     protected $posX 0;
  1616.     protected $posY 0;
  1617.     protected $posZ 0;
  1618.     protected $play;
  1619.     protected $looping 0;
  1620.     /**#@-*/
  1621.  
  1622.     /**
  1623.      * Autoplay the data when it's done loading
  1624.      */
  1625.     function autoPlay()
  1626.     {
  1627.         $this->play 1;
  1628.     }
  1629.  
  1630.     /**
  1631.      * Loop when the end of the data is reached
  1632.      */
  1633.     function enableLooping()
  1634.     {
  1635.         $this->looping 1;
  1636.     }
  1637.  
  1638.     /**
  1639.      * Returns whether auto playing is enabled
  1640.      * @return boolean 
  1641.      */
  1642.     function getAutoPlay()
  1643.     {
  1644.         return $this->play;
  1645.     }
  1646.  
  1647.     /**
  1648.      * Returns whether looping is enabled
  1649.      * @return boolean 
  1650.      */
  1651.     function getLooping()
  1652.     {
  1653.         return $this->looping;
  1654.     }
  1655.  
  1656.     /**
  1657.      * @ignore
  1658.      */
  1659.     protected function postFilter()
  1660.     {
  1661.         parent::postFilter();
  1662.         if($this->play !== null)
  1663.             $this->xml->setAttribute('play'$this->play);
  1664.         if($this->looping !== null)
  1665.             $this->xml->setAttribute('looping'$this->looping);
  1666.     }
  1667. }
  1668.  
  1669. /**
  1670.  * Video
  1671.  * @package ManiaLib
  1672.  * @subpackage GUIToolkit
  1673.  */
  1674. class Video extends Audio
  1675. {
  1676.     /**
  1677.      * @ignore
  1678.      */
  1679.     protected $xmlTagName 'video';
  1680.  
  1681.     function __construct($sx 32$sy 24)
  1682.     {
  1683.         $this->sizeX $sx;
  1684.         $this->sizeY $sy;
  1685.     }
  1686. }
  1687. ?>