function checkConfig() { $this->cookie = cookie::getInstance(); if (!$this->cookie->check("logged")) { return; } $conf = new configuration(); $row = $conf->findBy('name', 'blog_feedburner_rssLink'); $setupMsg = "<p style=\"border:1px solid #f00;background-color:#ff0;padding:10px;font-size:15px;\">Please <a href=\"{$this->registry->path}admin/config#blog_feedburner_rssLink\">setup</a> the feedburner plugin.</p>"; if (!$row) { echo $setupMsg; } else { if (!preg_match(VALID_URL, $row['value'])) { echo $setupMsg; } } }
public function config($id = null) { if ($this->data) { $C = new configuration(); foreach ($this->data as $name => $value) { if ($C->findBy("name", $name)) { //updating $C['value'] = trim($value); $C->save(); } else { //adding new record. $C = new configuration(); $new_value = array(); $new_value['name'] = $name; $new_value['value'] = $value; $new_value['id_user'] = 1; $C->prepareFromArray($new_value); $C->save(); } } $this->redirect("admin/config"); } $this->registry->conf = $this->conf; $this->registry->userConf = $this->userConf; $this->plugin->call('admin_init_config'); $this->view->conf = $this->registry->conf; $this->view->userConf = $this->registry->userConf; $this->view->setLayout("admin"); $this->render(); }