Completed
Push — master ( 266444...2ebe1b )
by Michael
01:31
created

admin/log.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
12
/**
13
 * Contact module
14
 *
15
 * @copyright   XOOPS Project (https://xoops.org)
16
 * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
17
 * @author      Kazumi Ono (aka Onokazu)
18
 * @author      Trabis <[email protected]>
19
 * @author      Hossein Azizabadi (AKA Voltan)
20
 */
21
22
use Xmf\Request;
23
24
// Call header
25
require __DIR__ . '/admin_header.php';
26
// Display Admin header
27
xoops_cp_header();
28
// Define default value
29
$op = Request::getString('op', 'form');
30
31
switch ($op) {
32 View Code Duplication
    case 'form':
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
33
        // prune manager
34
        $form   = new XoopsThemeForm(_AM_CONTACT_LOGS_FORM, 'logs', 'log.php', 'post', true);
35
        $column = new XoopsFormSelect(_AM_CONTACT_LOGS_COLUMN, 'column', 'contact_phone');
36
        $column->addOption('contact_phone', _AM_CONTACT_LOGS_COLUMN_PHONE);
37
        $column->addOption('contact_url', _AM_CONTACT_LOGS_COLUMN_URL);
38
        $column->addOption('contact_mail', _AM_CONTACT_LOGS_COLUMN_MAIL);
39
        $form->addElement($column);
40
        $form->addElement(new XoopsFormHidden('op', 'getlog'));
41
        $form->addElement(new XoopsFormButton('', 'post', _SUBMIT, 'submit'));
42
        $GLOBALS['xoopsTpl']->assign('form', $form->render());
43
        break;
44
45
    case 'getlog':
46
        $column = Request::getString('column', '');
47
        $log    = $contactHandler->contactLogs($column);
48
        $GLOBALS['xoopsTpl']->assign('logs', $log);
49
        break;
50
}
51
52
$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation(basename(__FILE__)));
53
// Call template file
54
$GLOBALS['xoopsTpl']->display(XOOPS_ROOT_PATH . '/modules/contact/templates/admin/contact_logs.tpl');
55
// Call footer
56
require __DIR__ . '/admin_footer.php';
57