XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
page_pathsettings.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
29 require_once './include/common.inc.php';
30 defined('XOOPS_INSTALL') or die('XOOPS Installation wizard die');
31 
32 include_once './class/pathcontroller.php';
33 
35 $pageHasHelp = true;
36 
37 $ctrl = new PathStuffController($wizard->configs['xoopsPathDefault'], $wizard->configs['dataPath']);
38 
39 if ($_SERVER['REQUEST_METHOD'] == 'GET' && @$_GET['var'] && @$_GET['action'] == 'checkpath') {
40  $path = $_GET['var'];
41  $ctrl->xoopsPath[$path] = htmlspecialchars( trim($_GET['path']) );
42  echo genPathCheckHtml( $path, $ctrl->checkPath($path) );
43  exit();
44 }
45 $ctrl->execute();
46 if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
47  return;
48 }
49 ob_start();
50 ?>
51 <script type="text/javascript">
52 function removeTrailing(id, val) {
53  if (val[val.length-1] == '/') {
54  val = val.substr(0, val.length-1);
55  $(id).value = val;
56  }
57  return val;
58 }
59 
60 function updPath( key, val ) {
61  val = removeTrailing(key, val);
62  new Ajax.Updater(
63  key+'pathimg', '<?php echo $_SERVER['PHP_SELF']; ?>',
64  { method:'get',parameters:'action=checkpath&var='+key+'&path='+val }
65  );
66  $(key+'perms').style.display='none';
67 }
68 </script>
69 <fieldset>
70  <legend><?php echo XOOPS_PATHS; ?></legend>
71 
72  <label class="xolabel" for="root"><?php echo XOOPS_ROOT_PATH_LABEL; ?></label>
73  <div class="xoform-help"><?php echo XOOPS_ROOT_PATH_HELP; ?></div>
74  <input type="text" name="root" id="root" value="<?php echo $ctrl->xoopsPath['root']; ?>" onchange="updPath('root', this.value)" />
75  <span id="rootpathimg"><?php echo genPathCheckHtml( 'root', $ctrl->validPath['root'] ); ?></span>
76  <?php
77  if ($ctrl->validPath['root'] && !empty( $ctrl->permErrors['root'])) {
78  echo '<div id="rootperms" class="x2-note">';
79  echo CHECKING_PERMISSIONS . '<br /><p>' . ERR_NEED_WRITE_ACCESS . '</p>';
80  echo '<ul class="diags">';
81  foreach ($ctrl->permErrors['root'] as $path => $result) {
82  if ($result) {
83  echo '<li class="success">' . sprintf(IS_WRITABLE, $path) . '</li>';
84  } else {
85  echo '<li class="failure">' . sprintf(IS_NOT_WRITABLE, $path) . '</li>';
86  }
87  }
88  echo '</ul>';
89  } else {
90  echo '<div id="rootperms" class="x2-note" style="display: none;" />';
91  }
92  ?>
93  </div>
94 
95  <label class="xolabel" for="data"><?php echo XOOPS_DATA_PATH_LABEL; ?></label>
96  <div class="xoform-help"><?php echo XOOPS_DATA_PATH_HELP; ?></div>
97  <input type="text" name="data" id="data" value="<?php echo $ctrl->xoopsPath['data']; ?>" onchange="updPath('data', this.value)" />
98  <span id="datapathimg"><?php echo genPathCheckHtml('data', $ctrl->validPath['data'] ); ?></span>
99  <?php
100  if ($ctrl->validPath['data'] && !empty( $ctrl->permErrors['data'])) {
101  echo '<div id="dataperms" class="x2-note">';
102  echo CHECKING_PERMISSIONS . '<br /><p>' . ERR_NEED_WRITE_ACCESS . '</p>';
103  echo '<ul class="diags">';
104  foreach ($ctrl->permErrors['data'] as $path => $result) {
105  if ($result) {
106  echo '<li class="success">' . sprintf(IS_WRITABLE, $path) . '</li>';
107  } else {
108  echo '<li class="failure">' . sprintf(IS_NOT_WRITABLE, $path) . '</li>';
109  }
110  }
111  echo '</ul>';
112  } else {
113  echo '<div id="dataperms" class="x2-note" style="display: none;" />';
114  }
115  ?>
116  </div>
117 
118  <label class="xolabel" for="lib"><?php echo XOOPS_LIB_PATH_LABEL; ?></label>
119  <div class="xoform-help"><?php echo XOOPS_LIB_PATH_HELP; ?></div>
120  <input type="text" name="lib" id="lib" value="<?php echo $ctrl->xoopsPath['lib']; ?>" onchange="updPath('lib', this.value)" />
121  <span id="libpathimg"><?php echo genPathCheckHtml('lib', $ctrl->validPath['lib']); ?></span>
122  <div id="libperms" class="x2-note" style="display: none;" />
123 </fieldset>
124 
125 <fieldset>
126  <legend><?php echo XOOPS_URLS; ?></legend>
127  <label class="xolabel" for="url"><?php echo XOOPS_URL_LABEL; ?></label>
128  <div class="xoform-help"><?php echo XOOPS_URL_HELP; ?></div>
129  <input type="text" name="URL" id="url" value="<?php echo $ctrl->xoopsUrl; ?>" onchange="removeTrailing('url', this.value)" />
130 </fieldset>
131 
132 <?php
133 $content = ob_get_contents();
134 ob_end_clean();
135 
136 include './include/install_tpl.php';
137 ?>