CMSimple_XH 開発者ドキュメント
CoreConfigFileEdit.php
1 <?php
2 
16 namespace XH;
17 
29 {
37  public function __construct()
38  {
39  global $pth, $cf, $tx;
40 
41  parent::__construct();
42  $this->varName = 'cf';
43  $this->params = array(
44  'form' => 'array',
45  'file' => 'config',
46  'action' => 'save'
47  );
48  $this->redir = '?file=config&action=array&xh_success=config';
49  $this->cfg = array();
50  $fn = $pth['folder']['cmsimple'] . 'metaconfig.php';
51  if (is_readable($fn)) {
52  include $fn;
53  }
54  foreach ($cf as $cat => $opts) {
55  $this->cfg[$cat] = array();
56  foreach ($opts as $name => $val) {
57  // The following are there for backwards compatibility,
58  // and have to be suppressed in the config form.
59  if ($cat == 'security' && $name == 'type'
60  || $cat == 'scripting' && $name == 'regexp'
61  || $cat == 'site' && $name == 'title'
62  || $cat == 'xhtml'
63  ) {
64  continue;
65  }
66  $omcf = isset($mcf[$cat][$name]) ? $mcf[$cat][$name] : null;
67  $hint = isset($tx['help']["${cat}_$name"])
68  ? $tx['help']["${cat}_$name"] : null;
69  $this->cfg[$cat][$name] = $this->option($omcf, $val, $hint);
70  }
71  if (empty($this->cfg[$cat])) {
72  unset($this->cfg[$cat]);
73  }
74  }
75  }
76 }
$cf
Definition: cms.php:272
$tx
Definition: cms.php:363
$pth
Definition: cms.php:230