Source for file LContentBrick.php
Documentation is available at LContentBrick.php
* LContentBrick class file.
* @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
* Displays a brick with one item from LContent
* @package System.Web.UI.WebControls
* content for brick (propel object)
* Prepares core, adds admin snippets
Prado :: using("Lithron.LContent.LContentCore");
$admin = '<h4>Record</h4>' .
'<com:TListBox ID="ContentId" Width="100%" Rows="10"/>';
$admin .= '<com:TRequiredFieldValidator ' .
'ValidationGroup="' . $this->getUniqueValidationGroup() . '" ' .
'ControlToValidate="ContentId" ErrorMessage="Select a record!" />';
$this->addAdminSnippet($admin);
* @return id for selecting records
public function getDescriptiveName()
return "Content Record (basic)";
public function getHasAdministrationPage()
public function getAdministrationPage()
if ($this->getParameters() instanceof TMap)
$id= $this->getParameters()->itemAt("ContentId");
return "packages.LContent.AdminRecord&l_content_id={$id}&back_url=" . $this->Service->getServicePage(true);
* prepares admin or content, depending on panel
public function onLoad($param)
parent :: onLoad($param);
#$this->prepareAdmin(); // VERY UGLY! FIX ME, TODO, but works :(
Prado :: log("OnPreRender() LContentBrick ...", 1, "Lithron.LContent");
if ($this->getShowAdminPanel())
parent :: onPreRender($param); // important !
* gets data and performs databBind
$c->addAscendingOrderByColumn(LContentPeer::ALIAS);
LRightsManager::restrictCriteria($c, "LContentPeer", LPermissions::USAGE);
Prado :: log("Queried " . count($items) . " record(s)", 1, "Lithron.LContent");
foreach ($items as $item)
$ds[$item->getId()]= $item->getAlias();
$ds[$item->getId()]= $item->getHeadline(); // TODO - backward comp.
$this->AdminControls->ContentId->setDataSource($ds);
$this->AdminControls->ContentId->dataBind();
Prado :: log("Admin Datasource set!", 1, "Lithron.LContent");
Prado :: log("Error while databinding admin controls in brick: " . $e->getMessage(), 8, "Lithron.LContent");
* gets data and performs databBind
$p= $this->getParameters();
|