Phundament-Components
[ class tree: Phundament-Components ] [ index: Phundament-Components ] [ all elements ]

Source for file LAnchorForm.php

Documentation is available at LAnchorForm.php

  1. <?php
  2. /**
  3.  * Class file.
  4.  *
  5.  * @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
  6.  * @copyright 2005, diemeisterei GmbH. All rights reserved.
  7.  * @author $Author: schmunk $
  8.  * @version $Revision: 236 $  $Date: 2006-05-30 23:39:46 +0200 (Di, 30 Mai 2006) $ $HeadURL: https://svn.sourceforge.net/svnroot/lithron/trunk/packages/LContainer/LBrick.php $
  9.  * @package Phundament.Components
  10.  * @subpackage Web.UI
  11.  */
  12.  
  13. /**
  14.  * LAnchorForm
  15.  *
  16.  * Subclass of TForm with the additional ability to submit to an anchor
  17.  *
  18.  * @package System.Web.UI.WebControls
  19.  * @subpackage Common
  20.  */
  21. class LAnchorForm extends TForm
  22. {
  23.     /**
  24.      * adds the ancor javascript
  25.      * @param unused generic parameter
  26.      */
  27.     public function onInit($param)
  28.     {
  29.         parent::onInit($param);
  30.         Prado::trace("OnInit() ...""Lithron.LAnchorForm");
  31.  
  32.  
  33. $ascript = <<<EOS
  34. var submitToAnchor = "";
  35. function afSubmit(theform)
  36. {
  37.     if (submitToAnchor == "") return;
  38.     newaction = theform.action+"#"+submitToAnchor;
  39.     theform.action = newaction;
  40. }
  41. EOS;
  42.  
  43.         $cs $this->getPage()->getClientScript();
  44.         $cs->registerBeginScript("AnchorForm"$ascript);
  45.         $this->Attributes->add("onsubmit""afSubmit(this);");
  46.     }
  47. }
  48.  
  49. ?>

Documentation generated on Sun, 25 Feb 2007 16:09:38 +0100 by phpDocumentor 1.3.1