Source for file LMetaDataContainer.php
Documentation is available at LMetaDataContainer.php
* @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
* @copyright 2005, diemeisterei GmbH. All rights reserved.
* @author $Author: schmunk $
* @version $Revision: 601 $ $Date: 2007-02-24 23:49:30 +0100 (Sa, 24 Feb 2007) $
* @package Phundament.Packages
* Wrapper for displaying IMetaData components
* @package System.Web.UI.WebControls
* creates controls, if defined in config
#Prado::log("OnInit() LMetaDataContainer", 1,"Lithron.LMetaData");
$this->autogenerateControls();
$this->setEnableViewState(false); // otherwise problems in Postback
parent :: onInit($param);
* creates controls, if defined in config
#Prado::log("OnLoad() LMetaDataContainer", 1,"Lithron.LMetaData");
#$this->autogenerateControls();
parent :: onLoad($param);
* fills the controls with data
#Prado::log("OnPreRender() LMetaDataContainer", 1,"Lithron.LMetaData");
parent :: onPreRender($param);
private function autogenerateControls()
$meta_data= $this->Application->getModule("meta_data");
$config= $meta_data->getConfiguration();
$key= $this->getMetaId() . ":Container";
if (isset ($config[$key]))
$controls= $config[$key];
// only if not defined in template
#Prado::log("Auto-generating meta data controls for ".$key, TLogger::DEBUG, "Lithron.LMetaData");
foreach ($controls AS $c)
$new->setMetaId($c['id']);
private function applyData()
$_obj= $this->getDataObject();
#Prado::log("Applying data for LMetaDataContainer [".$this->Id."]", 1,"Lithron.LMetaData");
if (isset ($_obj[self :: DATA_KEY]) && is_array($_obj[self :: DATA_KEY]))
foreach ($_obj[self :: DATA_KEY] AS $id => $data)
$control= $this->findControlByMetaId($id);
if (!$control instanceof TControl)
$control= $this->findControl($id);
$control->setData($data);
#Prado::log("Setting meta data [{$id}]", 1,"Lithron.LMetaData");
Prado::log("Component [{$id}] has no meta data (setter)", 1,"Lithron.LMetaData");
{#$this->setVisible("false");
private function findControlByMetaId($metaId)
foreach ($this->Controls AS $c)
$cMetaId= $c->getMetaId();
|