/**
  * Fügt einen Eintrag in die Datenbank ein. Wird von der Methode _create() aufgerufen.
  *
  * @param array $data Datenarray
  */
 private function _add2mysql($data)
 {
     /*Parameter kontrollieren */
     if (!is_array($data) || empty($data)) {
         throw new CMSException(array('content' => 'wrong_param_array'), EXCEPTION_MODULE_CODE, "", array('content' => 'runtime_error'));
     }
     /*Modus Content hinzufügen */
     $sql = "INSERT INTO `content` (`content_ID`, `content_title`, `content_text`, `content_time`, `content_archiv`) VALUES (";
     $sql .= "'', '" . $this->_mysql->escapeString($data['c_title']) . "', '" . $this->_mysql->escapeString($this->_cutSessID($data['c_text'])) . "', NOW(),";
     if ($data['c_hide'] == true) {
         $sql .= "'yes'";
     } else {
         $sql .= "'no'";
     }
     $sql .= ")";
     $this->_mysql->query($sql);
     if ($data['m_ignore'] != true) {
         $c_ID = $this->_mysql->insert_id();
         $sql = "INSERT INTO `menu` (`menu_ID`, `menu_topid`, `menu_name`, `menu_position`, `menu_page`, `menu_pagetyp`, `menu_display`) VALUES (";
         $sql .= "'', '" . $this->_mysql->escapeString($data['m_topid']) . "', '" . $this->_mysql->escapeString($data['m_name']) . "', '" . $this->_mysql->escapeString($data['m_pos']) . "', '{$c_ID}', 'pag',";
         if ($data['m_display'] == true) {
             $sql .= "'1'";
         } else {
             $sql .= "'0'";
         }
         $sql .= ")";
         $this->_mysql->query($sql);
     }
 }
Пример #2
0
 /**
  * Fügt einen Eintrag in die Datenbank ein. Wird von der Methode _create() aufgerufen.
  *
  * @param array $data Datenarray von checkformdata
  */
 private function _add2mysql($data)
 {
     /*Parameter kontrollieren */
     if (!is_array($data) || empty($data)) {
         throw new CMSException(array('menu' => 'wrong_param_array'), EXCEPTION_MODULE_CODE, array('menu' => 'runtime_error'));
     }
     $sql = "INSERT INTO `menu` (`menu_ID`, `menu_topid`, `menu_name`, `menu_position`, `menu_page`, `menu_pagetyp`," . " `menu_display`) VALUES ('', '" . $this->_mysql->escapeString($data['m_topid']) . "', " . "'" . $this->_mysql->escapeString($data['m_name']) . "', '" . $this->_mysql->escapeString($data['m_pos']) . "', " . "'" . $this->_mysql->escapeString($data['m_page']) . "', '" . $this->_mysql->escapeString($data['m_modus']) . "',";
     if ($data['m_display'] == true) {
         $sql .= "'1'";
     } else {
         $sql .= "'0'";
     }
     $sql .= ")";
     $this->_mysql->query($sql);
     if ($this->_mysql->insert_id() == $data['m_topid']) {
         $error_str = $this->_config_textes['Menu']['menu_ID_impossible'];
         throw new Exception($error_str, EXCEPTION_CORE_CODE, $this->_config_textes['Menu']['lucky_dog']);
     }
 }