- <?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: 255 $ $Date: 2006-06-06 02:32:26 +0200 (Di, 06 Jun 2006) $
- * @package Lithron.LContent
- * @subpackage Pages
- */
-
- /**
- * List view of content administration
- *
- * @package Lithron.LContent
- * @subpackage Pages
- */
-
- class AdminList extends TPage
- {
- /**
- * LContentCore instance
- */
- private $Core;
-
- /**
- * @ignore
- */
- public function onInit($param)
- {
- $this->Core= new LContentCore;
- $this->Master->enlargeContent();
- parent :: onInit($param);
- }
-
- /**
- * @ignore
- */
- public function onLoad($param)
- {
- if (!$this->IsPostBack)
- {
- /*$result = $this->Core->getRecordsByCriteria();
- $result = "";
- if (is_array($result))
- {
- $this->Repeater->DataSource = $result;
- $this->setViewstate("Records", $result);
- $this->Repeater->dataBind();
- }*/
- $this->searchClicked($this, null);
- #$this->Repeater->DataSource= array ();
- #$this->Repeater->dataBind();
- $this->SearchType->setDataSource(LContentCore :: getConfiguration("AvailableTypes"));
- $this->SearchType->dataBind();
- }
- else
- {
- $this->Repeater->DataSource= $this->getViewstate("Records");
- $this->Repeater->dataBind();
- }
- parent :: onLoad($param);
- }
-
- /**
- * Calls core function
- */
- public function deleteClicked($sender, $param)
- {
- $this->Core->deleteRecordById($sender->getCommandParameter());
- #var_dump($sender->getCommandParameter());
- }
- /**
- * Calls core function
- */
- public function editClicked($sender, $param)
- {
- Prado :: trace("Redirecting ...", "Lithron.LContentCore");
- Lithron :: saveLogging($this->Application);
- #echo Prado::vardump($sender);
- #return;
- $url= $this->Request->constructUrl("page", "packages.LContent.AdminRecord", array (
- "l_content_id" => $sender->getCommandParameter()));
- $this->Response->redirect($url);
- }
-
- public function createClicked($sender, $param)
- {
- Prado :: trace("Redirecting ...", "Lithron.LContentCore");
- Lithron :: saveLogging($this->Application);
- $url= $this->Request->constructUrl("page", "packages.LContent.AdminRecord");
- $this->Response->redirect($url);
- }
-
- public function searchClicked($sender, $param)
- {
- // query records
- $Criteria= new LContentCriteria;
- $Criteria->setSearchString($sender->Page->SearchString->getText());
- $Criteria->setType($sender->Page->SearchType->getSelectedValue());
- $status= $sender->Page->SearchStatus->getSelectedValue();
- if ($status != "all")
- {
- echo $status;
- $Criteria->setStatus($status);
- }
-
- $c= $Criteria->build();
-
- $c->setLimit($sender->Page->SearchLimit->getSelectedValue());
-
- switch ($sender->Page->SearchOrder->getSelectedValue())
- {
- case "Rank" :
- $c->addAscendingOrderByColumn(LContentPeer :: RANK);
- break;
- case "Headline" :
- $c->addAscendingOrderByColumn(LContentPeer :: HEADLINE);
- break;
- default :
- $c->addDescendingOrderByColumn(LContentPeer :: LAST_EDIT);
- break;
- }
-
- $items= LContentCore :: queryRecords($c);
-
- $this->setViewstate("Records", $items);
- $this->Repeater->DataSource= $items;
- #$this->Repeater->ActivePageIndex = 0;
- $this->Repeater->dataBind();
- }
-
- }
- ?>