root/trunk/admin/settings.php

Revision 1761, 1.1 KB (checked in by driehle, 3 months ago)

Draft for #199 and #201

Line 
1<?php
2 include_once('.'.DIRECTORY_SEPARATOR.'auth.php');
3 define("JLOG_ADMIN", true);
4 require_once('..'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.'prepend.inc.php');
5 require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'url_syntax.php');
6 require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'settings.class.php');
7 require(JLOG_BASEPATH.'admin'.DIRECTORY_SEPARATOR.'blog.func.php');
8
9 $c['meta']['title'] = $l['admin']['m_title'];
10 $c['main'] = output_admin_menu()."<h2>".$l['admin']['m_title']."</h2>";
11
12 $settings = new Settings($l);
13 if($_POST) {
14  $settings->importDataByArray(strip($_POST));
15  if(count($errors = $settings->validate()) == 0) {
16   if(count($errors = $settings->do_settings()) == 0) {
17    $c['main'] .= $l['admin']['m_settings_ok'];
18   }
19
20  }
21  if(count($errors) > 0) {
22   $c['main'] .= error_output($errors);
23   $c['main'] .= $settings->form_output();
24  }
25 }
26 else {
27  $settings->importDataByConstants();
28  $c['main'] .= $settings->form_output();
29 }
30require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'update.php');
31require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php');
32echo $body;
33?>
Note: See TracBrowser for help on using the browser.