Phundament-Packages
[ class tree: Phundament-Packages ] [ index: Phundament-Packages ] [ 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: 601 $  $Date: 2007-02-24 23:49:30 +0100 (Sa, 24 Feb 2007) $
  11.  * @package Phundament.Packages
  12.  * @subpackage LContent
  13.  */
  14.  
  15. /**
  16.  * List view of content administration
  17.  *
  18.  * @package Admin.Pages
  19.  * @subpackage LContent
  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.         parent :: onInit($param);
  35.         $this->Corenew LContentCore// TODO - has to exist when deleting a record
  36.  
  37.         #$this->Application->getModule("database")->getConnection("l_content", "propel");
  38.     }
  39.  
  40.     /**
  41.      * @ignore
  42.      */
  43.     public function onLoad($param)
  44.     {
  45.         if (!$this->IsPostBack)
  46.         {
  47.             $this->searchClicked($thisnull);
  48.             $_ds array(=> "All Types");
  49.             $_ds array_merge($_dsLContentCore :: getConfiguration("AvailableTypes"));
  50.             $this->SearchType->setDataSource($_ds);
  51.             $this->SearchType->dataBind();
  52.         }
  53.         else
  54.         {
  55.             $this->Repeater->DataSource$this->getViewstate("Records");
  56.             $this->Repeater->dataBind();
  57.         }
  58.         parent :: onLoad($param);
  59.     }
  60.  
  61.     /**
  62.      * Calls core function
  63.      */
  64.     public function deleteClicked($sender$param)
  65.     {
  66.         $this->Core->deleteRecordById($sender->getCommandParameter());
  67.     }
  68.     /**
  69.      * Calls core function
  70.      */
  71.     public function editClicked($sender$param)
  72.     {
  73.         Prado :: trace("Redirecting ...""Lithron.LContentCore");
  74.         Lithron :: saveLogging($this->Application);
  75.         $url$this->Service->constructUrl("packages.LContent.AdminRecord",
  76.             array ("l_content_id" => $sender->getCommandParameter())false);
  77.         $this->Response->redirect($url);
  78.     }
  79.  
  80.     public function createClicked($sender$param)
  81.     {
  82.         Prado :: trace("Redirecting ...""Lithron.LContentCore");
  83.         Lithron :: saveLogging($this->Application);
  84.         $url$this->Service->constructUrl("packages.LContent.AdminRecord");
  85.         $this->Response->redirect($url);
  86.     }
  87.  
  88.     public function searchClicked($sender$param)
  89.     {
  90.         // query records
  91.         $Criterianew LContentCriteria;
  92.         $Criteria->setSearchString($sender->Page->SearchString->getText());
  93.         $Criteria->setType($sender->Page->SearchType->getSelectedValue());
  94.         $status$sender->Page->SearchStatus->getSelectedValue();
  95.         if ($status != "all")
  96.         {
  97.             $Criteria->setStatus($status);
  98.         }
  99.         $culture$sender->Page->SearchCulture->getSelectedValue();
  100.         if ($culture == "all")
  101.         {
  102.             $Criteria->setIgnoreCulture(true);
  103.         }
  104.  
  105.         $c$Criteria->build();
  106.  
  107.         $owner$sender->Page->SearchUser->getSelectedValue();
  108.         if ($owner == "mine")
  109.         {
  110.             $c->addAnd(LContentPeer::USER$this->User->Name);
  111.         }
  112.         $c->setLimit($sender->Page->SearchLimit->getSelectedValue());
  113.         LRightsManager::restrictCriteria($c"LContentPeer"LPermissions::USAGE );
  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.         #return;
  129.         $itemsLContentCore :: queryRecords($c);
  130.  
  131.         $this->setViewstate("Records"$items);
  132.         $this->Repeater->DataSource$items;
  133.         #$this->Repeater->ActivePageIndex = 0;
  134.         $this->Repeater->dataBind();
  135.     }
  136.  
  137. }
  138. ?>

Documentation generated on Sun, 25 Feb 2007 16:09:29 +0100 by phpDocumentor 1.3.1