- <?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: 273 $ $Date: 2006-06-13 01:26:06 +0200 (Di, 13 Jun 2006) $
- * @package Lithron.LMediaManager
- * @subpackage WebControls
- */
-
- /**
- * Default display template for media files
- *
- * Extends this class, if you need your own templates.
- *
- * @package System.Web.UI.WebControls
- * @subpackage MetaData
- */
-
- class LMediaContainer extends LMetaDataContent
- {
- private $_info;
- private $Core;
-
- /**
- * prepares data
- * @todo array sorting
- */
- function onPreRender()
- {
- if (is_array($this->getData()))
- foreach ($this->getData() AS $d)
- {
- $ids[]= $d['MetaRecordId'];
- $this->_info[$d['MetaRecordId']]= array (
- $d['Description'],
- $d['Rank']
- );
- }
- else
- {
- $ids= array ();
- $this->setVisible(false);
- return;
- }
- #echo "<hr>";
- #var_dump($ids);
- #echo "<hr>";
- $Criteria= new LMediaCriteria;
- $Criteria->setRecordIds($ids);
- $items= LMediaManagerCore :: queryRecords($Criteria->build());
- #if (!is_array($this->getData()))
- #{
- #}
- $sorted= array ();
- #var_dump ($this->_info);
- foreach ($items AS $key => $record)
- {
- $id= $record->getId();
- $newId= $this->_info[$id][1];
- while (!empty ($sorted[$newId]))
- {
- $newId= $newId . "!";
- }
- #echo $newId;
- $sorted[$newId]= $record;
-
- ksort($sorted);
- #var_dump($sorted);
- /*echo rsort($sorted);
- var_dump($sorted);*/
- $this->Repeater->setDataSource($sorted);
- $this->Repeater->dataBind();
-
- }
- }
- function updateItem($sender, $param)
- {
- $id= $param->getItem()->MetaRecordId->Text;
- $param->getItem()->Description->Text= $this->_info[$id][0];
- }
- }
- ?>