Exemplo n.º 1
0
 public function zipJs($build)
 {
     if (!$build) {
         return;
     }
     //Allow sufficient time
     set_time_limit(0);
     /**
      * Recompress all the files
      */
     $ajax = new CalemZipJustAjaxJs();
     $ajax->process();
     $calemeam = new CalemZipJustCalemJs();
     $calemeam->process();
     $metadata = new CalemZipMetadataJs();
     $metadata->process();
     $message = new CalemZipMessageJs();
     $message->process();
     $groupUser = new CalemZipGroupUserJs();
     $groupUser->package();
     //Global custom info
     $md = new CalemZipCustomMetadataJs();
     $md->package();
     $md = new CalemZipCustomDropdownJs();
     $md->package();
     $md = new CalemZipCustomMessageAllJs();
     $md->package();
     //Converting report
     $tmRpt = microtime(true);
     $rpt = new CalemConvertReportBatch();
     $countRpt = $rpt->process();
     return array('reportTime' => array('start' => $tmRpt, 'end' => microtime(true)));
 }
Exemplo n.º 2
0
 public function swapDropdownEntry($fldAr)
 {
     //Modifying files
     $path = _CALEM_DIR_ . 'custom/global/dropdown/';
     $file = $fldAr['tableId'] . '.dropdown';
     $fullPath = $path . $file;
     $md = $this->loadDataFromFile($fullPath, $path, $file, $fldAr);
     //Swap two keys
     $mdNew = array();
     foreach ($md as $key => $value) {
         if ($key == $fldAr['id']) {
             $mdNew[$fldAr['swapId']] = $md[$fldAr['swapId']];
         } else {
             if ($key == $fldAr['swapId']) {
                 $mdNew[$fldAr['id']] = $md[$fldAr['id']];
             } else {
                 $mdNew[$key] = $md[$key];
             }
         }
     }
     //Now write the file back.
     $rt = $this->storeFile($fldAr, $mdNew, $fullPath);
     if ($rt['status'] != 0) {
         return $rt;
     }
     //Let's repackage dropdown
     $cm = new CalemZipCustomDropdownJs();
     $cm->package();
     //So this is a success
     return array('id' => $fldAr['id'], 'status' => 0);
 }