Lithron.LContainer
[ class tree: Lithron.LContainer ] [ index: Lithron.LContainer ] [ all elements ]

Source for file LContainerCore.php

Documentation is available at LContainerCore.php

  1. <?php
  2.  
  3.  
  4. /**
  5. * class file.
  6. *
  7. * @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
  8. * @copyright 2005, diemeisterei GmbH. All rights reserved.
  9. * @author $Author: schmunk $
  10. * @version $Revision: 237 $ $Date: 2006-05-31 01:45:51 +0200 (Mi, 31 Mai 2006) $
  11. * @package Lithron.LContainer
  12. * @subpackage WebControls
  13. */
  14.  
  15. /**
  16. * Basic functions for bricks & cell, i.e. search
  17. *
  18. * @package System.Web.UI.WebControls
  19. * @subpackage BrickSupport
  20. */
  21.  
  22. if (Prado::getPathOfAlias("LContainer") === null)
  23. {
  24. Prado :: setPathOfAlias("LContainer", dirname(__FILE__));
  25. Prado :: using("LContainer.db.propel.*");
  26. Prado :: using("LContainer.db.propel.l_container.*");
  27. }
  28. class LContainerCore extends TControl
  29. {
  30. private $_map;
  31.  
  32. function __construct()
  33. {
  34. $this->buildMapping();
  35. }
  36.  
  37. function findPageByBrick($brickClass, $brickId)
  38. {
  39. #var_dump($this->_map);
  40. if (isset ($this->_map[$brickClass][$brickId]))
  41. {
  42. Prado :: trace(count($this->_map[$brickClass][$brickId]) . " pages found for {$brickClass} {$brickId}", "Lithron.LContainer");
  43. return ($this->_map[$brickClass][$brickId]);
  44. }
  45. else
  46. {
  47. Prado :: trace("No pages found {$brickClass} {$brickId}", "Lithron.LContainer");
  48. return null;
  49. }
  50.  
  51. }
  52.  
  53. function buildMapping()
  54. {
  55. $conn= $this->Application->getModule("database")->getConnection("l_container", "propel");
  56. $c= new Criteria();
  57. if (!$this->User->isInRole("Admin")) $c->add(LContainerBrickPeer :: STATUS, 1);
  58. #$c->add(LContainerBrickPeer :: PAGE, $this->Service->getServicePage());
  59. #$c->addAscendingOrderByColumn(LContainerBrickPeer :: RANK);
  60. $all= LContainerBrickPeer :: doSelect($c, $conn);
  61. foreach ($all AS $record)
  62. {
  63. $array= unserialize(base64_decode($record->getParameters()));
  64. if (!isset ($array['ContentId']))
  65. continue;
  66. #echo $array['ContentId'];
  67. #var_dump($array);
  68. $this->_map[$record->getControl()][$array['ContentId']][]= $record->getPage();
  69. }
  70. }
  71.  
  72. }
  73. ?>

Documentation generated on Tue, 20 Jun 2006 05:15:01 +0200 by phpDocumentor 1.3.0RC4