XOOPS  2.6.0
maintenance.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 */
11 
24 {
28  public function __construct($obj = null)
29  {
30  }
31 
36  public function getMaintenance()
37  {
38  $maintenance = new Maintenance();
39  parent::__construct('', "form_maintenance", "center.php", 'post', true);
40 
41  $cache = new Xoops\Form\Select(_AM_MAINTENANCE_CENTER_CACHE, "cache", '', 3, true);
42  $cache->setDescription(\XoopsBaseConfig::get('var-path') . "/cache/smarty_cache/<br />" . \XoopsBaseConfig::get('var-path') . "/cache/smarty_compile/<br />" . \XoopsBaseConfig::get('var-path') . "/cache/xoops_cache/");
44  $cache->addOptionArray($cache_arr);
45  $this->addElement($cache);
46 
47  $this->addElement(new Xoops\Form\RadioYesNo(_AM_MAINTENANCE_CENTER_SESSION, 'session', ''));
48 
50  $tables_tray->setDescription(_AM_MAINTENANCE_CENTER_TABLES_DESC);
51  $select_tables = new Xoops\Form\Select('', "tables", '', 7, true);
52  $select_tables->addOptionArray($maintenance->displayTables(true));
53  $tables_tray->addElement($select_tables, false);
54  $choice = new Xoops\Form\Select('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . _AM_MAINTENANCE_AND . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', "maintenance", '', 4, true);
55  $options = array(
58  );
59  $choice->addOptionArray($options);
60  $tables_tray->addElement($choice, false);
61  $this->addElement($tables_tray);
62 
63  $this->addElement(new Xoops\Form\Hidden("op", "maintenance_save"));
64  $this->addElement(new Xoops\Form\Button("", "maintenance_save", XoopsLocale::A_SUBMIT, "submit"));
65  }
66 
70  public function getDump()
71  {
73  $maintenance = new Maintenance();
74  parent::__construct('', "form_dump", "dump.php", 'post', true);
75 
77  $select_tables1 = new Xoops\Form\Select('', "dump_tables", '', 7, true);
78  $select_tables1->addOptionArray($maintenance->displayTables(true));
79  $dump_tray->addElement($select_tables1, false);
80  $ele = new Xoops\Form\Select('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . _AM_MAINTENANCE_OR . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'dump_modules', '', 7, true);
81  $module_list = XoopsLists::getModulesList();
82  $module_handler = $xoops->getHandlerModule();
83  foreach ($module_list as $file) {
84  if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $file . '/xoops_version.php')) {
85  clearstatcache();
86  $file = trim($file);
87  $module = $module_handler->create();
88  $module->loadInfo($file);
89  if ($module->getInfo('tables') && $xoops->isActiveModule($file)) {
90  $ele->addOption($module->getInfo('dirname'), $module->getInfo('name'));
91  }
92  unset($module);
93  }
94  }
95  $dump_tray->addElement($ele);
96  $this->addElement($dump_tray);
97 
98  $this->addElement(new Xoops\Form\RadioYesNo(_AM_MAINTENANCE_DUMP_DROP, 'drop', 1));
99 
100  $this->addElement(new Xoops\Form\Hidden("op", "dump_save"));
101  $this->addElement(new Xoops\Form\Button("", "dump_save", XoopsLocale::A_SUBMIT, "submit"));
102  }
103 }
const _AM_MAINTENANCE_CENTER_TABLES_DESC
Definition: admin.php:47
const A_SUBMIT
Definition: en_US.php:128
static getInstance()
Definition: Xoops.php:160
const _AM_MAINTENANCE_CENTER_CHOICE2
Definition: admin.php:35
if(!isset($xoops->paths[$path_type])) if($path_type== 'var') $file
Definition: browse.php:55
addElement(Element $formElement, $required=false)
Definition: Form.php:206
const _AM_MAINTENANCE_OR
Definition: admin.php:25
$options['editor']
const _AM_MAINTENANCE_CENTER_CHOICE3
Definition: admin.php:36
const _AM_MAINTENANCE_CENTER_XOOPS_CACHE
Definition: admin.php:57
const _AM_MAINTENANCE_CENTER_SESSION
Definition: admin.php:52
const _AM_MAINTENANCE_AND
Definition: admin.php:23
const _AM_MAINTENANCE_CENTER_CACHE
Definition: admin.php:32
$xoops
Definition: admin.php:25
const _AM_MAINTENANCE_DUMP_DROP
Definition: admin.php:64
const _AM_MAINTENANCE_CENTER_SMARTY_CACHE
Definition: admin.php:55
static fileExists($file)
Definition: xoopsload.php:506
static get($name)
const _AM_MAINTENANCE_CENTER_SMARTY_COMPILE
Definition: admin.php:56
$module
Definition: main.php:52
const _AM_MAINTENANCE_DUMP_TABLES_OR_MODULES
Definition: admin.php:76
$module_handler
Definition: main.php:55
const _AM_MAINTENANCE_CENTER_TABLES
Definition: admin.php:45
const _AM_MAINTENANCE_CENTER_CHOICE4
Definition: admin.php:37
const _AM_MAINTENANCE_CENTER_CHOICE1
Definition: admin.php:34