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

Source for file LMediaContainer.php

Documentation is available at LMediaContainer.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: 273 $ $Date: 2006-06-13 01:26:06 +0200 (Di, 13 Jun 2006) $
  11. * @package Lithron.LMediaManager
  12. * @subpackage WebControls
  13. */
  14.  
  15. /**
  16. * Default display template for media files
  17. *
  18. * Extends this class, if you need your own templates.
  19. *
  20. * @package System.Web.UI.WebControls
  21. * @subpackage MetaData
  22. */
  23.  
  24. class LMediaContainer extends LMetaDataContent
  25. {
  26. private $_info;
  27. private $Core;
  28.  
  29. /**
  30. * prepares data
  31. * @todo array sorting
  32. */
  33. function onPreRender()
  34. {
  35. if (is_array($this->getData()))
  36. foreach ($this->getData() AS $d)
  37. {
  38. $ids[]= $d['MetaRecordId'];
  39. $this->_info[$d['MetaRecordId']]= array (
  40. $d['Description'],
  41. $d['Rank']
  42. );
  43. }
  44. else
  45. {
  46. $ids= array ();
  47. $this->setVisible(false);
  48. return;
  49. }
  50. #echo "<hr>";
  51. #var_dump($ids);
  52. #echo "<hr>";
  53. $Criteria= new LMediaCriteria;
  54. $Criteria->setRecordIds($ids);
  55. $items= LMediaManagerCore :: queryRecords($Criteria->build());
  56. #if (!is_array($this->getData()))
  57. #{
  58. #}
  59. $sorted= array ();
  60. #var_dump ($this->_info);
  61. foreach ($items AS $key => $record)
  62. {
  63. $id= $record->getId();
  64. $newId= $this->_info[$id][1];
  65. while (!empty ($sorted[$newId]))
  66. {
  67. $newId= $newId . "!";
  68. }
  69. #echo $newId;
  70. $sorted[$newId]= $record;
  71.  
  72. ksort($sorted);
  73. #var_dump($sorted);
  74. /*echo rsort($sorted);
  75. var_dump($sorted);*/
  76. $this->Repeater->setDataSource($sorted);
  77. $this->Repeater->dataBind();
  78.  
  79. }
  80. }
  81. function updateItem($sender, $param)
  82. {
  83. $id= $param->getItem()->MetaRecordId->Text;
  84. $param->getItem()->Description->Text= $this->_info[$id][0];
  85. }
  86. }
  87. ?>

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