Пример #1
0
 /**
  * Edits the infotexts, which are placed below the Meallist
  */
 function EditInfotext()
 {
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     $gsManager = new GlobalSettingsManager();
     $infotexts = $gsManager->getInfoTexts();
     if (count($infotexts) != 2) {
         $this->mealInterface->dieError($this->msg['err_get_infotexts']);
     }
     if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['infotext1'], $_POST['infotext2'])) {
         $infotext1new = $_POST['infotext1'];
         $infotext2new = $_POST['infotext2'];
         if ($infotext1new == '') {
             $infotext1new = ' ';
         }
         if ($infotext2new == '') {
             $infotext2new = ' ';
         }
         try {
             $gsManager->setInfoTexts($infotext1new, $infotext2new);
         } catch (Exception $e) {
             $this->mealInterface->dieError($this->msg['err_edit_infotexts'] . $e->getMessage());
         }
         $this->mealInterface->FinEditInfotexts($infotext1new, $infotext2new);
     } else {
         $it1 = 'da';
         $it2 = 'bu';
         $it1 = $infotexts[0];
         $it2 = $infotexts[1];
         $this->mealInterface->EditInfotexts($it1, $it2);
     }
 }