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

Source for file AdminList.php

Documentation is available at AdminList.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: 255 $ $Date: 2006-06-06 02:32:26 +0200 (Di, 06 Jun 2006) $
  11. * @package Lithron.LContent
  12. * @subpackage Pages
  13. */
  14.  
  15. /**
  16. * List view of content administration
  17. *
  18. * @package Lithron.LContent
  19. * @subpackage Pages
  20. */
  21.  
  22. class AdminList extends TPage
  23. {
  24. /**
  25. * LContentCore instance
  26. */
  27. private $Core;
  28.  
  29. /**
  30. * @ignore
  31. */
  32. public function onInit($param)
  33. {
  34. $this->Core= new LContentCore;
  35. $this->Master->enlargeContent();
  36. parent :: onInit($param);
  37. }
  38.  
  39. /**
  40. * @ignore
  41. */
  42. public function onLoad($param)
  43. {
  44. if (!$this->IsPostBack)
  45. {
  46. /*$result = $this->Core->getRecordsByCriteria();
  47. $result = "";
  48. if (is_array($result))
  49. {
  50. $this->Repeater->DataSource = $result;
  51. $this->setViewstate("Records", $result);
  52. $this->Repeater->dataBind();
  53. }*/
  54. $this->searchClicked($this, null);
  55. #$this->Repeater->DataSource= array ();
  56. #$this->Repeater->dataBind();
  57. $this->SearchType->setDataSource(LContentCore :: getConfiguration("AvailableTypes"));
  58. $this->SearchType->dataBind();
  59. }
  60. else
  61. {
  62. $this->Repeater->DataSource= $this->getViewstate("Records");
  63. $this->Repeater->dataBind();
  64. }
  65. parent :: onLoad($param);
  66. }
  67.  
  68. /**
  69. * Calls core function
  70. */
  71. public function deleteClicked($sender, $param)
  72. {
  73. $this->Core->deleteRecordById($sender->getCommandParameter());
  74. #var_dump($sender->getCommandParameter());
  75. }
  76. /**
  77. * Calls core function
  78. */
  79. public function editClicked($sender, $param)
  80. {
  81. Prado :: trace("Redirecting ...", "Lithron.LContentCore");
  82. Lithron :: saveLogging($this->Application);
  83. #echo Prado::vardump($sender);
  84. #return;
  85. $url= $this->Request->constructUrl("page", "packages.LContent.AdminRecord", array (
  86. "l_content_id" => $sender->getCommandParameter()));
  87. $this->Response->redirect($url);
  88. }
  89.  
  90. public function createClicked($sender, $param)
  91. {
  92. Prado :: trace("Redirecting ...", "Lithron.LContentCore");
  93. Lithron :: saveLogging($this->Application);
  94. $url= $this->Request->constructUrl("page", "packages.LContent.AdminRecord");
  95. $this->Response->redirect($url);
  96. }
  97.  
  98. public function searchClicked($sender, $param)
  99. {
  100. // query records
  101. $Criteria= new LContentCriteria;
  102. $Criteria->setSearchString($sender->Page->SearchString->getText());
  103. $Criteria->setType($sender->Page->SearchType->getSelectedValue());
  104. $status= $sender->Page->SearchStatus->getSelectedValue();
  105. if ($status != "all")
  106. {
  107. echo $status;
  108. $Criteria->setStatus($status);
  109. }
  110.  
  111. $c= $Criteria->build();
  112.  
  113. $c->setLimit($sender->Page->SearchLimit->getSelectedValue());
  114.  
  115. switch ($sender->Page->SearchOrder->getSelectedValue())
  116. {
  117. case "Rank" :
  118. $c->addAscendingOrderByColumn(LContentPeer :: RANK);
  119. break;
  120. case "Headline" :
  121. $c->addAscendingOrderByColumn(LContentPeer :: HEADLINE);
  122. break;
  123. default :
  124. $c->addDescendingOrderByColumn(LContentPeer :: LAST_EDIT);
  125. break;
  126. }
  127.  
  128. $items= LContentCore :: queryRecords($c);
  129.  
  130. $this->setViewstate("Records", $items);
  131. $this->Repeater->DataSource= $items;
  132. #$this->Repeater->ActivePageIndex = 0;
  133. $this->Repeater->dataBind();
  134. }
  135.  
  136. }
  137. ?>

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