XOOPS  2.6.0
index.php
Go to the documentation of this file.
1 <?php
19 include __DIR__ . '/header.php';
20 
22 
23 switch ($op) {
24  case 'save':
25  if (!$xoops->security()->check()) {
26  $xoops->redirect('index.php', 5, implode(',', $xoops->security()->getErrors()));
27  }
28  if ($type == 'config') {
29  $config = $xcaptcha_handler->VerifyData();
30  $xcaptcha_handler->writeConfig('captcha.config', $config);
31  $xoops->redirect('index.php?type=config', 5, _AM_XCAPTCHA_SAVED);
32  } else {
33  if ($xcaptcha_handler->loadPluginHandler($type)) {
34  $config = $xcaptcha_handler->Pluginhandler->VerifyData();
35  $xcaptcha_handler->writeConfig('captcha.config.' . $type, $config);
36  $xoops->redirect('index.php?type=' . $type, 5, _AM_XCAPTCHA_SAVED);
37  }
38  }
39  break;
40 
41  case 'default':
42  default:
43  $type = isset($type) ? $type : 'config';
44 
45  $xoops->header();
46  $xoops->theme()->addStylesheet('modules/xcaptcha/css/moduladmin.css');
47 
48  $admin_page = new \Xoops\Module\Admin();
49  if ($type == 'config') {
50  $admin_page->displayNavigation('index.php?type=config');
51  $admin_page->addInfoBox(_AM_XCAPTCHA_FORM);
52  $form = $xoops->getModuleForm($xcaptcha_handler, 'captcha', 'xcaptcha');
53  $admin_page->addInfoBoxLine($form->render());
54  } else {
55  if ($plugin = $xcaptcha_handler->loadPluginHandler($type)) {
56  $title = constant('_XCAPTCHA_FORM_' . strtoupper($type));
57  $form = $xoops->getModuleForm($plugin, $type, 'xcaptcha');
58  $admin_page->addInfoBox($title);
59  $admin_page->addInfoBoxLine($form->render());
60  } else {
61  $xoops->redirect('index.php', 5, _AM_XCAPTCHA_ERROR);
62  }
63  }
64  $admin_page->displayIndex();
65 
66  break;
67 }
68 include __DIR__ . '/footer.php';
$xcaptcha_handler
Definition: header.php:40
$op
Definition: index.php:33
static getInstance()
Definition: Xoops.php:160
const _AM_XCAPTCHA_SAVED
Definition: admin.php:22
$form
Definition: xoops_code.php:21
$type
Definition: misc.php:33
$admin_page
Definition: index.php:56
return $config
const _AM_XCAPTCHA_FORM
Definition: admin.php:21
if(file_exists($mainfile)) elseif(file_exists(__DIR__. '/install/index.php')) $xoops
Definition: index.php:36