Beispiel #1
0
 function methodDefault()
 {
     $iPage = (int) $this->getRequest("page", 1);
     $iRecordPerPage = 20;
     $aKeys = $this->getDBQuery("RepositoryListValuesTable")->select("distinct(listkey) as listkey")->orderBy("listkey asc")->execute();
     $this->oView->addVar("aKeys", $aKeys);
     $oQuery = $this->getDBQuery("RepositoryListValuesTable")->limit($iRecordPerPage)->offset(($iPage - 1) * $iRecordPerPage)->orderBy("listkey asc, weight asc, listvalue asc");
     $oCountQuery = $this->getDBQuery("RepositoryListValuesTable");
     $sFilter = $this->getFilter();
     if (!empty($sFilter)) {
         $oQuery->where("listkey=?", $sFilter);
         $oCountQuery->where("listkey=?", $sFilter);
     }
     $this->oView->addVar("filter_listkey", $sFilter);
     $aList = $oQuery->execute();
     //for more condition, add where clause
     $iCount = FlexiModelUtil::getRecordCount($oCountQuery);
     //var_dump($iCount);
     $this->oView->addPaging($iCount, $iRecordPerPage, $iPage, array(), null);
     $this->oView->addVar("aList", $aList->toArray());
     if (FlexiConfig::$sFramework == "modx" || FlexiConfig::$sFramework == "modx2") {
         $sForm = $this->renderMarkup($this->loadForm());
         $this->oView->addVar("form", $sForm);
     }
     return true;
 }