$news->semester = $_POST['semester']; $news->updateamum = date('Y-m-d H:i:s'); $news->updatevon = $uid; $news->datum = $datum_obj->formatDatum($_POST['datum'], 'Y-m-d'); $news->datum_bis = $datum_obj->formatDatum($_POST['datum_bis'], 'Y-m-d'); if ($news->content_id == '') { $studiengang = new studiengang(); $studiengang->load($_POST['studiengang_kz']); $content = new content(); $content->template_kurzbz = 'news'; $content->oe_kurzbz = $studiengang->oe_kurzbz; $content->aktiv = true; $content->menu_open = false; $content->insertamum = date('Y-m-d H:i:s'); $content->insertvon = $uid; if (!$content->save(true)) { die($content->errormsg); } $news->content_id = $content->content_id; } if (!$news->save()) { die($news->errormsg); } $news_id = $news->news_id; //ContentSprache $sprachen = array(DEFAULT_LANGUAGE); foreach ($_POST as $key => $value) { if (mb_strstr($key, 'contentsprache_id_')) { $sprachen[] = mb_substr($key, strlen('contentsprache_id_')); } }
public function addaction() { $c = new content(); if ($this->input->post("id") !== FALSE) { $c->get_by_id($this->input->post("id")); } else { if ($this->input->post("id") === FALSE) { $c->user = $this->ion_auth->get_user(); $c->user = $c->user->id; } } $c->parent_section = $this->input->post("parent_section"); $c->parent_content = $this->input->post("parent_content"); $c->title = $this->input->post("title"); $c->cell = $this->input->post("cell"); $c->sort = $this->input->post("sort"); $c->path = $this->input->post("path"); $c->type = $this->input->post("type"); $c->subsection = $this->input->post("subsection") == FALSE ? FALSE : TRUE; $c->view = $this->input->post("view"); $c->info = $this->input->post("info"); $c->filter = $this->input->post("filter"); // this is a workaround, cuz it makes 2 newline characters // and i don't know what the hell is wrong with it. $c->filter = str_replace("\n\n", "\n", $c->filter); $p = new Content($c->parent_content); if ($this->input->post("id") === FALSE) { $this->add_info(lang('system_content_added')); } else { $this->ajax = TRUE; $this->print_text(lang('system_content_edited')); } $c->save(); }
} $c->parent_section = $ci->input->post("parent_section"); $c->parent_content = $ci->input->post("parent_content"); $c->cell = $ci->input->post("cell"); $c->sort = $ci->input->post("sort"); $c->path = $ci->input->post("path"); $c->type = $ci->input->post("type"); $c->subsection = $ci->input->post("subsection") == NULL ? FALSE : TRUE; $c->view = $ci->input->post("view"); $c->addin = $ci->input->post("addin"); $old_edit = $c->can_edit(); $c->edit = $ci->input->post("edit"); $c->del = $ci->input->post("del"); $c->info = $ci->input->post("info"); if (!$ci->input->post("id")) { $p = new content(); $p->get_by_id($c->parent_content); $c->attach($ci->vunsy->section, $p, $c->cell, $c->sort); } $p = new Section(); $p->get_by_id($c->parent_section); if ($p->can_addin() and !$ci->input->post("id") or $ci->input->post("id") and $old_edit) { $c->save(); if ($ci->input->post("id")) { redirect($ci->app->app_url("data/{$c->id}")); } else { $ci->app->add_info('Content added'); } } else { $ci->app->add_error('Permission denied ! please check your root adminstrator for permissions'); }
$sichtbar = isset($_POST['sichtbar']); $aktiv = isset($_POST['aktiv']); $menu_open = isset($_POST['menu_open']); $template_kurzbz = $_POST['template_kurzbz']; $beschreibung = $_POST['beschreibung']; if ($content->getContent($content_id, $sprache, $version)) { $content->titel = $titel; $content->oe_kurzbz = $oe_kurzbz; $content->sichtbar = $sichtbar; $content->aktiv = $aktiv; $content->menu_open = $menu_open; $content->template_kurzbz = $template_kurzbz; $content->updateamum = date('Y-m-d H:i:s'); $content->updatevon = $user; $content->beschreibung = $beschreibung; if ($content->save()) { if ($content->saveContentSprache()) { $message .= '<span class="ok">Daten erfolgreich gespeichert</span>'; } else { $message .= '<span class="error">' . $content->errormsg . '</span>'; } } else { $message .= '<span class="error">' . $content->errormsg . '</span>'; } } else { $message .= '<span class="error">' . $content->errormsg . '</span>'; } break; case 'prefs_reviewed': //Review und sichtbar schalten $bf = new benutzerfunktion();