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

Source for file LInterlinkBaseSelection.php

Documentation is available at LInterlinkBaseSelection.php

  1. <?php
  2.  
  3. /**
  4.  * class file.
  5.  *
  6.  * @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
  7.  * @copyright 2005, diemeisterei GmbH. All rights reserved.
  8.  * @author $Author: schmunk $
  9.  * @version $Revision: 353 $  $Date: 2006-10-26 12:20:27 +0200 (Thu, 26 Oct 2006) $
  10.  * @package Phundament.Packages
  11.  * @subpackage LInterlink
  12.  */
  13.  
  14. /**
  15.  * Wrapper for administration of IMetaData components
  16.  *
  17.  * @package System.Web.UI.WebControls
  18.  * @subpackage Interlink
  19.  */
  20. class LInterlinkBaseSelection extends TWebControl implements INamingContainer
  21. {
  22.     protected $_key = "none";
  23.     protected $_source_id = 0;
  24.     protected $_hidden_field = null;
  25.     
  26.     public function getKey()
  27.     {
  28.         return $this->_key;
  29.     }
  30.  
  31.     public function setKey($value)
  32.     
  33.         $this->_key = TPropertyValue::ensureString($value);
  34.     }
  35.     
  36.     public function getSourceId()
  37.     {
  38.         return $this->_source_id;
  39.     }
  40.  
  41.     public function setSourceId($value)
  42.     {
  43.         $this->_source_id = TPropertyValue::ensureString($value);
  44.     }
  45.  
  46.     public function onLoad($param)
  47.     {
  48.         parent :: onLoad($param);
  49.  
  50.         $this->_hidden_field = new THiddenField();
  51.         $this->Controls[$this->_hidden_field;
  52.  
  53.         $core $this->Application->getModule("interlink");
  54.         $categories array_keys($core->getCategories($this->Key));
  55.         
  56.         foreach($categories as $cat)
  57.         {
  58.             $class $core->getSelectionControlClassName($this->Key$cat);
  59.             $c new $class;
  60.             $this->Controls[$c;
  61.             $rel $core->loadRelation($this->Key$cat$this->SourceId);
  62.             $c->setRelation($rel);
  63.             $c->onNeedRelationPersistence[array($this"persistRelation");
  64.         }
  65.     }
  66.     
  67.     public function persistRelation($sender$param)
  68.     {
  69.         $rel $sender->getRelation();
  70.         $rel->save();
  71.     }
  72.     
  73. }
  74. ?>

Documentation generated on Sun, 25 Feb 2007 16:10:43 +0100 by phpDocumentor 1.3.1