- <?php
-
-
- /**
- * 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: 237 $ $Date: 2006-05-31 01:45:51 +0200 (Mi, 31 Mai 2006) $
- * @package Lithron.LContainer
- * @subpackage WebControls
- */
-
- /**
- * Basic functions for bricks & cell, i.e. search
- *
- * @package System.Web.UI.WebControls
- * @subpackage BrickSupport
- */
-
- if (Prado::getPathOfAlias("LContainer") === null)
- {
- Prado :: setPathOfAlias("LContainer", dirname(__FILE__));
- Prado :: using("LContainer.db.propel.*");
- Prado :: using("LContainer.db.propel.l_container.*");
- }
- class LContainerCore extends TControl
- {
- private $_map;
-
- function __construct()
- {
- $this->buildMapping();
- }
-
- function findPageByBrick($brickClass, $brickId)
- {
- #var_dump($this->_map);
- if (isset ($this->_map[$brickClass][$brickId]))
- {
- Prado :: trace(count($this->_map[$brickClass][$brickId]) . " pages found for {$brickClass} {$brickId}", "Lithron.LContainer");
- return ($this->_map[$brickClass][$brickId]);
- }
- else
- {
- Prado :: trace("No pages found {$brickClass} {$brickId}", "Lithron.LContainer");
- return null;
- }
-
- }
-
- function buildMapping()
- {
- $conn= $this->Application->getModule("database")->getConnection("l_container", "propel");
- $c= new Criteria();
- if (!$this->User->isInRole("Admin")) $c->add(LContainerBrickPeer :: STATUS, 1);
- #$c->add(LContainerBrickPeer :: PAGE, $this->Service->getServicePage());
- #$c->addAscendingOrderByColumn(LContainerBrickPeer :: RANK);
- $all= LContainerBrickPeer :: doSelect($c, $conn);
- foreach ($all AS $record)
- {
- $array= unserialize(base64_decode($record->getParameters()));
- if (!isset ($array['ContentId']))
- continue;
- #echo $array['ContentId'];
- #var_dump($array);
- $this->_map[$record->getControl()][$array['ContentId']][]= $record->getPage();
- }
- }
-
- }
- ?>