コード例 #1
0
ファイル: Controller.php プロジェクト: tlandn/akvo-web
 private function _initForms()
 {
     // Set View Script Base Paths
     KwgP\Form::setViewScriptBasePaths(Config::getFormViewScriptBasePaths());
     // Set Translation Language
     $aTranslations = (require_once JsonData_Plugin_Dir . '/resources/Zend/languages/nl/Zend_Validate.php');
     $oTranslator = new \Zend_Translate(array('adapter' => 'array', 'content' => $aTranslations, 'locale' => 'nl'));
     \Zend_Validate::setDefaultTranslator($oTranslator);
 }
コード例 #2
0
ファイル: FormHandler.php プロジェクト: tlandn/akvo-web
 public function remove()
 {
     $aContent = array();
     $aContent['redirect'] = JDConfig::getHomeRedirectUrl();
     if (!isset($_GET['id'])) {
     }
     $iId = $_GET['id'];
     $oDaoJsonData = new JsonDataDao();
     $aDetail = $oDaoJsonData->fetchFeed($iId);
     if (!empty($aDetail)) {
         $bStatus = $oDaoJsonData->deleteFeed($iId);
         if (is_int($bStatus)) {
             $aFeedQueues = $oDaoJsonData->fetchFeedQueue($iId);
             //get all feedques with same id
             $aToBeDeleteId = array();
             foreach ($aFeedQueues as $aFeedRaw) {
                 $aToBeDeleteId[] = $aFeedRaw['id'];
             }
             array_map(array(&$oDaoJsonData, 'deleteFeedQueue'), $aToBeDeleteId);
             //delete all feed associate with id
             $oFeed = new JsonDataFeed();
             $oFeed->removeFeedDir($aDetail['feed_slug']);
             //remove files and directory
         }
     }
     //        var_dump($bStatus);
     //        var_dump(JDConfig::getHomeRedirectUrl());
     //        die();
     if ($bStatus != false) {
         $aContent['redirect'] = JDConfig::getHomeRedirectUrl();
     }
     return $aContent;
 }