@@ -27,52 +27,52 @@ |
||
27 | 27 | $sysPathIcon32 = $moduleInfo->getInfo('sysicons32'); |
28 | 28 | |
29 | 29 | $adminmenu[] = [ |
30 | - 'title' => _MI_WGGITHUB_ADMENU1, |
|
31 | - 'link' => 'admin/index.php', |
|
32 | - 'icon' => $sysPathIcon32.'/dashboard.png', |
|
30 | + 'title' => _MI_WGGITHUB_ADMENU1, |
|
31 | + 'link' => 'admin/index.php', |
|
32 | + 'icon' => $sysPathIcon32.'/dashboard.png', |
|
33 | 33 | ]; |
34 | 34 | $adminmenu[] = [ |
35 | - 'title' => _MI_WGGITHUB_ADMENU2, |
|
36 | - 'link' => 'admin/settings.php', |
|
37 | - 'icon' => 'assets/icons/32/blank.gif', |
|
35 | + 'title' => _MI_WGGITHUB_ADMENU2, |
|
36 | + 'link' => 'admin/settings.php', |
|
37 | + 'icon' => 'assets/icons/32/blank.gif', |
|
38 | 38 | ]; |
39 | 39 | $adminmenu[] = [ |
40 | - 'title' => _MI_WGGITHUB_ADMENU3, |
|
41 | - 'link' => 'admin/directories.php', |
|
42 | - 'icon' => 'assets/icons/32/blank.gif', |
|
40 | + 'title' => _MI_WGGITHUB_ADMENU3, |
|
41 | + 'link' => 'admin/directories.php', |
|
42 | + 'icon' => 'assets/icons/32/blank.gif', |
|
43 | 43 | ]; |
44 | 44 | $adminmenu[] = [ |
45 | - 'title' => _MI_WGGITHUB_ADMENU4, |
|
46 | - 'link' => 'admin/requests.php', |
|
47 | - 'icon' => 'assets/icons/32/blank.gif', |
|
45 | + 'title' => _MI_WGGITHUB_ADMENU4, |
|
46 | + 'link' => 'admin/requests.php', |
|
47 | + 'icon' => 'assets/icons/32/blank.gif', |
|
48 | 48 | ]; |
49 | 49 | $adminmenu[] = [ |
50 | - 'title' => _MI_WGGITHUB_ADMENU5, |
|
51 | - 'link' => 'admin/repositories.php', |
|
52 | - 'icon' => 'assets/icons/32/blank.gif', |
|
50 | + 'title' => _MI_WGGITHUB_ADMENU5, |
|
51 | + 'link' => 'admin/repositories.php', |
|
52 | + 'icon' => 'assets/icons/32/blank.gif', |
|
53 | 53 | ]; |
54 | 54 | $adminmenu[] = [ |
55 | - 'title' => _MI_WGGITHUB_ADMENU6, |
|
56 | - 'link' => 'admin/readmes.php', |
|
57 | - 'icon' => 'assets/icons/32/addlink.png', |
|
55 | + 'title' => _MI_WGGITHUB_ADMENU6, |
|
56 | + 'link' => 'admin/readmes.php', |
|
57 | + 'icon' => 'assets/icons/32/addlink.png', |
|
58 | 58 | ]; |
59 | 59 | $adminmenu[] = [ |
60 | - 'title' => _MI_WGGITHUB_ADMENU7, |
|
61 | - 'link' => 'admin/releases.php', |
|
62 | - 'icon' => 'assets/icons/32/blank.gif', |
|
60 | + 'title' => _MI_WGGITHUB_ADMENU7, |
|
61 | + 'link' => 'admin/releases.php', |
|
62 | + 'icon' => 'assets/icons/32/blank.gif', |
|
63 | 63 | ]; |
64 | 64 | $adminmenu[] = [ |
65 | - 'title' => _MI_WGGITHUB_ADMENU8, |
|
66 | - 'link' => 'admin/permissions.php', |
|
67 | - 'icon' => $sysPathIcon32.'/permissions.png', |
|
65 | + 'title' => _MI_WGGITHUB_ADMENU8, |
|
66 | + 'link' => 'admin/permissions.php', |
|
67 | + 'icon' => $sysPathIcon32.'/permissions.png', |
|
68 | 68 | ]; |
69 | 69 | $adminmenu[] = [ |
70 | - 'title' => _MI_WGGITHUB_ADMENU9, |
|
71 | - 'link' => 'admin/feedback.php', |
|
72 | - 'icon' => $sysPathIcon32.'/mail_foward.png', |
|
70 | + 'title' => _MI_WGGITHUB_ADMENU9, |
|
71 | + 'link' => 'admin/feedback.php', |
|
72 | + 'icon' => $sysPathIcon32.'/mail_foward.png', |
|
73 | 73 | ]; |
74 | 74 | $adminmenu[] = [ |
75 | - 'title' => _MI_WGGITHUB_ABOUT, |
|
76 | - 'link' => 'admin/about.php', |
|
77 | - 'icon' => $sysPathIcon32.'/about.png', |
|
75 | + 'title' => _MI_WGGITHUB_ABOUT, |
|
76 | + 'link' => 'admin/about.php', |
|
77 | + 'icon' => $sysPathIcon32.'/about.png', |
|
78 | 78 | ]; |
@@ -19,9 +19,9 @@ |
||
19 | 19 | * @min_xoops 2.5.10 |
20 | 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
21 | 21 | */ |
22 | -require __DIR__ . '/header.php'; |
|
22 | +require __DIR__.'/header.php'; |
|
23 | 23 | $templateMain = 'wggithub_admin_about.tpl'; |
24 | 24 | $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('about.php')); |
25 | 25 | $adminObject::setPaypal('6KJ7RW5DR3VTJ'); |
26 | 26 | $GLOBALS['xoopsTpl']->assign('about', $adminObject->renderAbout(false)); |
27 | -require __DIR__ . '/footer.php'; |
|
27 | +require __DIR__.'/footer.php'; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | use XoopsModules\Wggithub\Constants; |
26 | 26 | use XoopsModules\Wggithub\Common; |
27 | 27 | |
28 | -require __DIR__ . '/header.php'; |
|
28 | +require __DIR__.'/header.php'; |
|
29 | 29 | // It recovered the value of argument op in URL$ |
30 | 30 | $op = Request::getCmd('op', 'list'); |
31 | 31 | // Request dir_id |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | } |
56 | 56 | // Display Navigation |
57 | 57 | if ($directoriesCount > $limit) { |
58 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | - $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
58 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
59 | + $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
60 | 60 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
61 | 61 | } |
62 | 62 | } else { |
@@ -161,4 +161,4 @@ discard block |
||
161 | 161 | } |
162 | 162 | break; |
163 | 163 | } |
164 | -require __DIR__ . '/footer.php'; |
|
164 | +require __DIR__.'/footer.php'; |
@@ -31,109 +31,109 @@ |
||
31 | 31 | // Request dir_id |
32 | 32 | $dirId = Request::getInt('dir_id'); |
33 | 33 | switch ($op) { |
34 | - case 'list': |
|
35 | - default: |
|
36 | - // Define Stylesheet |
|
37 | - $GLOBALS['xoTheme']->addStylesheet($style, null); |
|
38 | - $start = Request::getInt('start', 0); |
|
39 | - $limit = Request::getInt('limit', $helper->getConfig('adminpager')); |
|
40 | - $templateMain = 'wggithub_admin_directories.tpl'; |
|
41 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php')); |
|
42 | - $adminObject->addItemButton(_AM_WGGITHUB_ADD_DIRECTORY, 'directories.php?op=new', 'add'); |
|
43 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
44 | - $directoriesCount = $directoriesHandler->getCountDirectories(); |
|
45 | - $directoriesAll = $directoriesHandler->getAllDirectories($start, $limit); |
|
46 | - $GLOBALS['xoopsTpl']->assign('directories_count', $directoriesCount); |
|
47 | - $GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL); |
|
48 | - $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
49 | - // Table view directories |
|
50 | - if ($directoriesCount > 0) { |
|
51 | - foreach (\array_keys($directoriesAll) as $i) { |
|
52 | - $directory = $directoriesAll[$i]->getValuesDirectories(); |
|
53 | - $GLOBALS['xoopsTpl']->append('directories_list', $directory); |
|
54 | - unset($directory); |
|
55 | - } |
|
56 | - // Display Navigation |
|
57 | - if ($directoriesCount > $limit) { |
|
58 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | - $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
60 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
|
61 | - } |
|
62 | - } else { |
|
63 | - $GLOBALS['xoopsTpl']->assign('error', _AM_WGGITHUB_THEREARENT_DIRECTORIES); |
|
64 | - } |
|
65 | - break; |
|
66 | - case 'new': |
|
67 | - $templateMain = 'wggithub_admin_directories.tpl'; |
|
68 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php')); |
|
69 | - $adminObject->addItemButton(_AM_WGGITHUB_DIRECTORIES_LIST, 'directories.php', 'list'); |
|
70 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
71 | - // Form Create |
|
72 | - $directoriesObj = $directoriesHandler->create(); |
|
73 | - $form = $directoriesObj->getFormDirectories(); |
|
74 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
75 | - break; |
|
76 | - case 'save': |
|
77 | - // Security Check |
|
78 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
79 | - \redirect_header('directories.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
80 | - } |
|
81 | - if ($dirId > 0) { |
|
82 | - $directoriesObj = $directoriesHandler->get($dirId); |
|
83 | - } else { |
|
84 | - $directoriesObj = $directoriesHandler->create(); |
|
85 | - } |
|
86 | - // Set Vars |
|
87 | - $directoriesObj->setVar('dir_name', Request::getString('dir_name', '')); |
|
88 | - $directoriesObj->setVar('dir_type', Request::getInt('dir_type', 0)); |
|
89 | - $directoriesObj->setVar('dir_autoupdate', Request::getInt('dir_autoupdate', 0)); |
|
90 | - $directoriesObj->setVar('dir_online', Request::getInt('dir_online', 0)); |
|
34 | + case 'list': |
|
35 | + default: |
|
36 | + // Define Stylesheet |
|
37 | + $GLOBALS['xoTheme']->addStylesheet($style, null); |
|
38 | + $start = Request::getInt('start', 0); |
|
39 | + $limit = Request::getInt('limit', $helper->getConfig('adminpager')); |
|
40 | + $templateMain = 'wggithub_admin_directories.tpl'; |
|
41 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php')); |
|
42 | + $adminObject->addItemButton(_AM_WGGITHUB_ADD_DIRECTORY, 'directories.php?op=new', 'add'); |
|
43 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
44 | + $directoriesCount = $directoriesHandler->getCountDirectories(); |
|
45 | + $directoriesAll = $directoriesHandler->getAllDirectories($start, $limit); |
|
46 | + $GLOBALS['xoopsTpl']->assign('directories_count', $directoriesCount); |
|
47 | + $GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL); |
|
48 | + $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
49 | + // Table view directories |
|
50 | + if ($directoriesCount > 0) { |
|
51 | + foreach (\array_keys($directoriesAll) as $i) { |
|
52 | + $directory = $directoriesAll[$i]->getValuesDirectories(); |
|
53 | + $GLOBALS['xoopsTpl']->append('directories_list', $directory); |
|
54 | + unset($directory); |
|
55 | + } |
|
56 | + // Display Navigation |
|
57 | + if ($directoriesCount > $limit) { |
|
58 | + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | + $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
60 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
|
61 | + } |
|
62 | + } else { |
|
63 | + $GLOBALS['xoopsTpl']->assign('error', _AM_WGGITHUB_THEREARENT_DIRECTORIES); |
|
64 | + } |
|
65 | + break; |
|
66 | + case 'new': |
|
67 | + $templateMain = 'wggithub_admin_directories.tpl'; |
|
68 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php')); |
|
69 | + $adminObject->addItemButton(_AM_WGGITHUB_DIRECTORIES_LIST, 'directories.php', 'list'); |
|
70 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
71 | + // Form Create |
|
72 | + $directoriesObj = $directoriesHandler->create(); |
|
73 | + $form = $directoriesObj->getFormDirectories(); |
|
74 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
75 | + break; |
|
76 | + case 'save': |
|
77 | + // Security Check |
|
78 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
79 | + \redirect_header('directories.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
80 | + } |
|
81 | + if ($dirId > 0) { |
|
82 | + $directoriesObj = $directoriesHandler->get($dirId); |
|
83 | + } else { |
|
84 | + $directoriesObj = $directoriesHandler->create(); |
|
85 | + } |
|
86 | + // Set Vars |
|
87 | + $directoriesObj->setVar('dir_name', Request::getString('dir_name', '')); |
|
88 | + $directoriesObj->setVar('dir_type', Request::getInt('dir_type', 0)); |
|
89 | + $directoriesObj->setVar('dir_autoupdate', Request::getInt('dir_autoupdate', 0)); |
|
90 | + $directoriesObj->setVar('dir_online', Request::getInt('dir_online', 0)); |
|
91 | 91 | $directoriesObj->setVar('dir_filterrelease', Request::getInt('dir_filterrelease', 0)); |
92 | - $directoryDatecreatedObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('dir_datecreated')); |
|
93 | - $directoriesObj->setVar('dir_datecreated', $directoryDatecreatedObj->getTimestamp()); |
|
94 | - $directoriesObj->setVar('dir_submitter', Request::getInt('dir_submitter', 0)); |
|
95 | - // Insert Data |
|
96 | - if ($directoriesHandler->insert($directoriesObj)) { |
|
97 | - \redirect_header('directories.php?op=list', 2, _AM_WGGITHUB_FORM_OK); |
|
98 | - } |
|
99 | - // Get Form |
|
100 | - $GLOBALS['xoopsTpl']->assign('error', $directoriesObj->getHtmlErrors()); |
|
101 | - $form = $directoriesObj->getFormDirectories(); |
|
102 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
103 | - break; |
|
104 | - case 'edit': |
|
105 | - $templateMain = 'wggithub_admin_directories.tpl'; |
|
106 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php')); |
|
107 | - $adminObject->addItemButton(_AM_WGGITHUB_ADD_DIRECTORY, 'directories.php?op=new', 'add'); |
|
108 | - $adminObject->addItemButton(_AM_WGGITHUB_DIRECTORIES_LIST, 'directories.php', 'list'); |
|
109 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
110 | - // Get Form |
|
111 | - $directoriesObj = $directoriesHandler->get($dirId); |
|
112 | - $form = $directoriesObj->getFormDirectories(); |
|
113 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
114 | - break; |
|
115 | - case 'delete': |
|
116 | - $templateMain = 'wggithub_admin_directories.tpl'; |
|
117 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php')); |
|
118 | - $directoriesObj = $directoriesHandler->get($dirId); |
|
119 | - $dirName = $directoriesObj->getVar('dir_name'); |
|
120 | - if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { |
|
121 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
122 | - \redirect_header('directories.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors())); |
|
123 | - } |
|
124 | - if ($directoriesHandler->delete($directoriesObj)) { |
|
125 | - \redirect_header('directories.php', 3, _AM_WGGITHUB_FORM_DELETE_OK); |
|
126 | - } else { |
|
127 | - $GLOBALS['xoopsTpl']->assign('error', $directoriesObj->getHtmlErrors()); |
|
128 | - } |
|
129 | - } else { |
|
130 | - $xoopsconfirm = new Common\XoopsConfirm( |
|
131 | - ['ok' => 1, 'dir_id' => $dirId, 'op' => 'delete'], |
|
132 | - $_SERVER['REQUEST_URI'], |
|
133 | - \sprintf(_AM_WGGITHUB_FORM_SURE_DELETE, $directoriesObj->getVar('dir_name'))); |
|
134 | - $form = $xoopsconfirm->getFormXoopsConfirm(); |
|
135 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
136 | - } |
|
137 | - break; |
|
92 | + $directoryDatecreatedObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('dir_datecreated')); |
|
93 | + $directoriesObj->setVar('dir_datecreated', $directoryDatecreatedObj->getTimestamp()); |
|
94 | + $directoriesObj->setVar('dir_submitter', Request::getInt('dir_submitter', 0)); |
|
95 | + // Insert Data |
|
96 | + if ($directoriesHandler->insert($directoriesObj)) { |
|
97 | + \redirect_header('directories.php?op=list', 2, _AM_WGGITHUB_FORM_OK); |
|
98 | + } |
|
99 | + // Get Form |
|
100 | + $GLOBALS['xoopsTpl']->assign('error', $directoriesObj->getHtmlErrors()); |
|
101 | + $form = $directoriesObj->getFormDirectories(); |
|
102 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
103 | + break; |
|
104 | + case 'edit': |
|
105 | + $templateMain = 'wggithub_admin_directories.tpl'; |
|
106 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php')); |
|
107 | + $adminObject->addItemButton(_AM_WGGITHUB_ADD_DIRECTORY, 'directories.php?op=new', 'add'); |
|
108 | + $adminObject->addItemButton(_AM_WGGITHUB_DIRECTORIES_LIST, 'directories.php', 'list'); |
|
109 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
110 | + // Get Form |
|
111 | + $directoriesObj = $directoriesHandler->get($dirId); |
|
112 | + $form = $directoriesObj->getFormDirectories(); |
|
113 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
114 | + break; |
|
115 | + case 'delete': |
|
116 | + $templateMain = 'wggithub_admin_directories.tpl'; |
|
117 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('directories.php')); |
|
118 | + $directoriesObj = $directoriesHandler->get($dirId); |
|
119 | + $dirName = $directoriesObj->getVar('dir_name'); |
|
120 | + if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { |
|
121 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
122 | + \redirect_header('directories.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors())); |
|
123 | + } |
|
124 | + if ($directoriesHandler->delete($directoriesObj)) { |
|
125 | + \redirect_header('directories.php', 3, _AM_WGGITHUB_FORM_DELETE_OK); |
|
126 | + } else { |
|
127 | + $GLOBALS['xoopsTpl']->assign('error', $directoriesObj->getHtmlErrors()); |
|
128 | + } |
|
129 | + } else { |
|
130 | + $xoopsconfirm = new Common\XoopsConfirm( |
|
131 | + ['ok' => 1, 'dir_id' => $dirId, 'op' => 'delete'], |
|
132 | + $_SERVER['REQUEST_URI'], |
|
133 | + \sprintf(_AM_WGGITHUB_FORM_SURE_DELETE, $directoriesObj->getVar('dir_name'))); |
|
134 | + $form = $xoopsconfirm->getFormXoopsConfirm(); |
|
135 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
136 | + } |
|
137 | + break; |
|
138 | 138 | } |
139 | 139 | require __DIR__ . '/footer.php'; |
@@ -50,26 +50,26 @@ |
||
50 | 50 | // Upload Folders |
51 | 51 | $configurator = new Common\Configurator(); |
52 | 52 | if ($configurator->uploadFolders && \is_array($configurator->uploadFolders)) { |
53 | - foreach (\array_keys($configurator->uploadFolders) as $i) { |
|
54 | - $folder[] = $configurator->uploadFolders[$i]; |
|
55 | - } |
|
53 | + foreach (\array_keys($configurator->uploadFolders) as $i) { |
|
54 | + $folder[] = $configurator->uploadFolders[$i]; |
|
55 | + } |
|
56 | 56 | } |
57 | 57 | // Uploads Folders Created |
58 | 58 | foreach (\array_keys($folder) as $i) { |
59 | - $adminObject->addConfigBoxLine($folder[$i], 'folder'); |
|
60 | - $adminObject->addConfigBoxLine(array($folder[$i], '777'), 'chmod'); |
|
59 | + $adminObject->addConfigBoxLine($folder[$i], 'folder'); |
|
60 | + $adminObject->addConfigBoxLine(array($folder[$i], '777'), 'chmod'); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // Render Index |
64 | 64 | $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('index.php')); |
65 | 65 | // Test Data |
66 | 66 | if ($helper->getConfig('displaySampleButton')) { |
67 | - \xoops_loadLanguage('admin/modulesadmin', 'system'); |
|
68 | - include_once \dirname(__DIR__) . '/testdata/index.php'; |
|
69 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_ADD_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=load', 'add'); |
|
70 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_SAVE_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=save', 'add'); |
|
67 | + \xoops_loadLanguage('admin/modulesadmin', 'system'); |
|
68 | + include_once \dirname(__DIR__) . '/testdata/index.php'; |
|
69 | + $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_ADD_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=load', 'add'); |
|
70 | + $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_SAVE_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=save', 'add'); |
|
71 | 71 | // $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_EXPORT_SCHEMA'), '__DIR__ . /../../testdata/index.php?op=exportschema', 'add'); |
72 | - $adminObject->displayButton('left'); |
|
72 | + $adminObject->displayButton('left'); |
|
73 | 73 | } |
74 | 74 | $GLOBALS['xoopsTpl']->assign('index', $adminObject->displayIndex()); |
75 | 75 | // End Test Data |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | |
24 | 24 | use XoopsModules\Wggithub\Common; |
25 | 25 | |
26 | -include_once \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
27 | -require __DIR__ . '/header.php'; |
|
26 | +include_once \dirname(__DIR__).'/preloads/autoloader.php'; |
|
27 | +require __DIR__.'/header.php'; |
|
28 | 28 | |
29 | 29 | // Template Index |
30 | 30 | $templateMain = 'wggithub_admin_index.tpl'; |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | // InfoBox Statistics |
41 | 41 | $adminObject->addInfoBox(_AM_WGGITHUB_STATISTICS); |
42 | 42 | // Info elements |
43 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . _AM_WGGITHUB_THEREARE_SETTINGS . '</label>', $countSettings)); |
|
44 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . _AM_WGGITHUB_THEREARE_DIRECTORIES . '</label>', $countDirectories)); |
|
45 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . _AM_WGGITHUB_THEREARE_REQUESTS . '</label>', $countRequests)); |
|
46 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . _AM_WGGITHUB_THEREARE_REPOSITORIES . '</label>', $countRepositories)); |
|
47 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . _AM_WGGITHUB_THEREARE_READMES . '</label>', $countReadmes)); |
|
48 | -$adminObject->addInfoBoxLine(\sprintf( '<label>' . _AM_WGGITHUB_THEREARE_RELEASES . '</label>', $countReleases)); |
|
43 | +$adminObject->addInfoBoxLine(\sprintf('<label>'._AM_WGGITHUB_THEREARE_SETTINGS.'</label>', $countSettings)); |
|
44 | +$adminObject->addInfoBoxLine(\sprintf('<label>'._AM_WGGITHUB_THEREARE_DIRECTORIES.'</label>', $countDirectories)); |
|
45 | +$adminObject->addInfoBoxLine(\sprintf('<label>'._AM_WGGITHUB_THEREARE_REQUESTS.'</label>', $countRequests)); |
|
46 | +$adminObject->addInfoBoxLine(\sprintf('<label>'._AM_WGGITHUB_THEREARE_REPOSITORIES.'</label>', $countRepositories)); |
|
47 | +$adminObject->addInfoBoxLine(\sprintf('<label>'._AM_WGGITHUB_THEREARE_READMES.'</label>', $countReadmes)); |
|
48 | +$adminObject->addInfoBoxLine(\sprintf('<label>'._AM_WGGITHUB_THEREARE_RELEASES.'</label>', $countReleases)); |
|
49 | 49 | |
50 | 50 | // Upload Folders |
51 | 51 | $configurator = new Common\Configurator(); |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | // Test Data |
66 | 66 | if ($helper->getConfig('displaySampleButton')) { |
67 | 67 | \xoops_loadLanguage('admin/modulesadmin', 'system'); |
68 | - include_once \dirname(__DIR__) . '/testdata/index.php'; |
|
69 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_ADD_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=load', 'add'); |
|
70 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_SAVE_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=save', 'add'); |
|
68 | + include_once \dirname(__DIR__).'/testdata/index.php'; |
|
69 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_ADD_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=load', 'add'); |
|
70 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_SAVE_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=save', 'add'); |
|
71 | 71 | // $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_EXPORT_SCHEMA'), '__DIR__ . /../../testdata/index.php?op=exportschema', 'add'); |
72 | 72 | $adminObject->displayButton('left'); |
73 | 73 | } |
74 | 74 | $GLOBALS['xoopsTpl']->assign('index', $adminObject->displayIndex()); |
75 | 75 | // End Test Data |
76 | -require __DIR__ . '/footer.php'; |
|
76 | +require __DIR__.'/footer.php'; |
@@ -20,8 +20,8 @@ |
||
20 | 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
21 | 21 | */ |
22 | 22 | if (isset($templateMain)) { |
23 | - $GLOBALS['xoopsTpl']->assign('maintainedby', $helper->getConfig('maintainedby')); |
|
24 | - $GLOBALS['xoopsTpl']->display("db:{$templateMain}"); |
|
23 | + $GLOBALS['xoopsTpl']->assign('maintainedby', $helper->getConfig('maintainedby')); |
|
24 | + $GLOBALS['xoopsTpl']->display("db:{$templateMain}"); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | xoops_cp_footer(); |
@@ -31,111 +31,111 @@ |
||
31 | 31 | // Request rel_id |
32 | 32 | $relId = Request::getInt('rel_id'); |
33 | 33 | switch ($op) { |
34 | - case 'list': |
|
35 | - default: |
|
36 | - // Define Stylesheet |
|
37 | - $GLOBALS['xoTheme']->addStylesheet($style, null); |
|
38 | - $start = Request::getInt('start', 0); |
|
39 | - $limit = Request::getInt('limit', $helper->getConfig('adminpager')); |
|
40 | - $templateMain = 'wggithub_admin_releases.tpl'; |
|
41 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('releases.php')); |
|
42 | - $adminObject->addItemButton(_AM_WGGITHUB_ADD_RELEASE, 'releases.php?op=new', 'add'); |
|
43 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
44 | - $releasesCount = $releasesHandler->getCountReleases(); |
|
45 | - $releasesAll = $releasesHandler->getAllReleases($start, $limit); |
|
46 | - $GLOBALS['xoopsTpl']->assign('releases_count', $releasesCount); |
|
47 | - $GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL); |
|
48 | - $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
49 | - // Table view releases |
|
50 | - if ($releasesCount > 0) { |
|
51 | - foreach (\array_keys($releasesAll) as $i) { |
|
52 | - $release = $releasesAll[$i]->getValuesReleases(); |
|
53 | - $GLOBALS['xoopsTpl']->append('releases_list', $release); |
|
54 | - unset($release); |
|
55 | - } |
|
56 | - // Display Navigation |
|
57 | - if ($releasesCount > $limit) { |
|
58 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | - $pagenav = new \XoopsPageNav($releasesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
60 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
|
61 | - } |
|
62 | - } else { |
|
63 | - $GLOBALS['xoopsTpl']->assign('error', _AM_WGGITHUB_THEREARENT_RELEASES); |
|
64 | - } |
|
65 | - break; |
|
66 | - case 'new': |
|
67 | - $templateMain = 'wggithub_admin_releases.tpl'; |
|
68 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('releases.php')); |
|
69 | - $adminObject->addItemButton(_AM_WGGITHUB_RELEASES_LIST, 'releases.php', 'list'); |
|
70 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
71 | - // Form Create |
|
72 | - $releasesObj = $releasesHandler->create(); |
|
73 | - $form = $releasesObj->getFormReleases(); |
|
74 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
75 | - break; |
|
76 | - case 'save': |
|
77 | - // Security Check |
|
78 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
79 | - \redirect_header('releases.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
80 | - } |
|
81 | - if ($relId > 0) { |
|
82 | - $releasesObj = $releasesHandler->get($relId); |
|
83 | - } else { |
|
84 | - $releasesObj = $releasesHandler->create(); |
|
85 | - } |
|
86 | - // Set Vars |
|
87 | - $releasesObj->setVar('rel_repoid', Request::getInt('rel_repoid', 0)); |
|
88 | - $releasesObj->setVar('rel_type', Request::getInt('rel_type', 0)); |
|
89 | - $releasesObj->setVar('rel_name', Request::getString('rel_name', '')); |
|
90 | - $releasePublishedatObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('rel_publishedat')); |
|
91 | - $releasesObj->setVar('rel_publishedat', $releasePublishedatObj->getTimestamp()); |
|
92 | - $releasesObj->setVar('rel_tarballurl', Request::getString('rel_tarballurl', '')); |
|
93 | - $releasesObj->setVar('rel_zipballurl', Request::getString('rel_zipballurl', '')); |
|
94 | - $releaseDatecreatedObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('rel_datecreated')); |
|
95 | - $releasesObj->setVar('rel_datecreated', $releaseDatecreatedObj->getTimestamp()); |
|
96 | - $releasesObj->setVar('rel_submitter', Request::getInt('rel_submitter', 0)); |
|
97 | - // Insert Data |
|
98 | - if ($releasesHandler->insert($releasesObj)) { |
|
99 | - \redirect_header('releases.php?op=list', 2, _AM_WGGITHUB_FORM_OK); |
|
100 | - } |
|
101 | - // Get Form |
|
102 | - $GLOBALS['xoopsTpl']->assign('error', $releasesObj->getHtmlErrors()); |
|
103 | - $form = $releasesObj->getFormReleases(); |
|
104 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
105 | - break; |
|
106 | - case 'edit': |
|
107 | - $templateMain = 'wggithub_admin_releases.tpl'; |
|
108 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('releases.php')); |
|
109 | - $adminObject->addItemButton(_AM_WGGITHUB_ADD_RELEASE, 'releases.php?op=new', 'add'); |
|
110 | - $adminObject->addItemButton(_AM_WGGITHUB_RELEASES_LIST, 'releases.php', 'list'); |
|
111 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
112 | - // Get Form |
|
113 | - $releasesObj = $releasesHandler->get($relId); |
|
114 | - $form = $releasesObj->getFormReleases(); |
|
115 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
116 | - break; |
|
117 | - case 'delete': |
|
118 | - $templateMain = 'wggithub_admin_releases.tpl'; |
|
119 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('releases.php')); |
|
120 | - $releasesObj = $releasesHandler->get($relId); |
|
121 | - $relName = $releasesObj->getVar('rel_name'); |
|
122 | - if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { |
|
123 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
124 | - \redirect_header('releases.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors())); |
|
125 | - } |
|
126 | - if ($releasesHandler->delete($releasesObj)) { |
|
127 | - \redirect_header('releases.php', 3, _AM_WGGITHUB_FORM_DELETE_OK); |
|
128 | - } else { |
|
129 | - $GLOBALS['xoopsTpl']->assign('error', $releasesObj->getHtmlErrors()); |
|
130 | - } |
|
131 | - } else { |
|
132 | - $xoopsconfirm = new Common\XoopsConfirm( |
|
133 | - ['ok' => 1, 'rel_id' => $relId, 'op' => 'delete'], |
|
134 | - $_SERVER['REQUEST_URI'], |
|
135 | - \sprintf(_AM_WGGITHUB_FORM_SURE_DELETE, $releasesObj->getVar('rel_name'))); |
|
136 | - $form = $xoopsconfirm->getFormXoopsConfirm(); |
|
137 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
138 | - } |
|
139 | - break; |
|
34 | + case 'list': |
|
35 | + default: |
|
36 | + // Define Stylesheet |
|
37 | + $GLOBALS['xoTheme']->addStylesheet($style, null); |
|
38 | + $start = Request::getInt('start', 0); |
|
39 | + $limit = Request::getInt('limit', $helper->getConfig('adminpager')); |
|
40 | + $templateMain = 'wggithub_admin_releases.tpl'; |
|
41 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('releases.php')); |
|
42 | + $adminObject->addItemButton(_AM_WGGITHUB_ADD_RELEASE, 'releases.php?op=new', 'add'); |
|
43 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
44 | + $releasesCount = $releasesHandler->getCountReleases(); |
|
45 | + $releasesAll = $releasesHandler->getAllReleases($start, $limit); |
|
46 | + $GLOBALS['xoopsTpl']->assign('releases_count', $releasesCount); |
|
47 | + $GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL); |
|
48 | + $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
49 | + // Table view releases |
|
50 | + if ($releasesCount > 0) { |
|
51 | + foreach (\array_keys($releasesAll) as $i) { |
|
52 | + $release = $releasesAll[$i]->getValuesReleases(); |
|
53 | + $GLOBALS['xoopsTpl']->append('releases_list', $release); |
|
54 | + unset($release); |
|
55 | + } |
|
56 | + // Display Navigation |
|
57 | + if ($releasesCount > $limit) { |
|
58 | + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | + $pagenav = new \XoopsPageNav($releasesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
60 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
|
61 | + } |
|
62 | + } else { |
|
63 | + $GLOBALS['xoopsTpl']->assign('error', _AM_WGGITHUB_THEREARENT_RELEASES); |
|
64 | + } |
|
65 | + break; |
|
66 | + case 'new': |
|
67 | + $templateMain = 'wggithub_admin_releases.tpl'; |
|
68 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('releases.php')); |
|
69 | + $adminObject->addItemButton(_AM_WGGITHUB_RELEASES_LIST, 'releases.php', 'list'); |
|
70 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
71 | + // Form Create |
|
72 | + $releasesObj = $releasesHandler->create(); |
|
73 | + $form = $releasesObj->getFormReleases(); |
|
74 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
75 | + break; |
|
76 | + case 'save': |
|
77 | + // Security Check |
|
78 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
79 | + \redirect_header('releases.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
80 | + } |
|
81 | + if ($relId > 0) { |
|
82 | + $releasesObj = $releasesHandler->get($relId); |
|
83 | + } else { |
|
84 | + $releasesObj = $releasesHandler->create(); |
|
85 | + } |
|
86 | + // Set Vars |
|
87 | + $releasesObj->setVar('rel_repoid', Request::getInt('rel_repoid', 0)); |
|
88 | + $releasesObj->setVar('rel_type', Request::getInt('rel_type', 0)); |
|
89 | + $releasesObj->setVar('rel_name', Request::getString('rel_name', '')); |
|
90 | + $releasePublishedatObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('rel_publishedat')); |
|
91 | + $releasesObj->setVar('rel_publishedat', $releasePublishedatObj->getTimestamp()); |
|
92 | + $releasesObj->setVar('rel_tarballurl', Request::getString('rel_tarballurl', '')); |
|
93 | + $releasesObj->setVar('rel_zipballurl', Request::getString('rel_zipballurl', '')); |
|
94 | + $releaseDatecreatedObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('rel_datecreated')); |
|
95 | + $releasesObj->setVar('rel_datecreated', $releaseDatecreatedObj->getTimestamp()); |
|
96 | + $releasesObj->setVar('rel_submitter', Request::getInt('rel_submitter', 0)); |
|
97 | + // Insert Data |
|
98 | + if ($releasesHandler->insert($releasesObj)) { |
|
99 | + \redirect_header('releases.php?op=list', 2, _AM_WGGITHUB_FORM_OK); |
|
100 | + } |
|
101 | + // Get Form |
|
102 | + $GLOBALS['xoopsTpl']->assign('error', $releasesObj->getHtmlErrors()); |
|
103 | + $form = $releasesObj->getFormReleases(); |
|
104 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
105 | + break; |
|
106 | + case 'edit': |
|
107 | + $templateMain = 'wggithub_admin_releases.tpl'; |
|
108 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('releases.php')); |
|
109 | + $adminObject->addItemButton(_AM_WGGITHUB_ADD_RELEASE, 'releases.php?op=new', 'add'); |
|
110 | + $adminObject->addItemButton(_AM_WGGITHUB_RELEASES_LIST, 'releases.php', 'list'); |
|
111 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
112 | + // Get Form |
|
113 | + $releasesObj = $releasesHandler->get($relId); |
|
114 | + $form = $releasesObj->getFormReleases(); |
|
115 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
116 | + break; |
|
117 | + case 'delete': |
|
118 | + $templateMain = 'wggithub_admin_releases.tpl'; |
|
119 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('releases.php')); |
|
120 | + $releasesObj = $releasesHandler->get($relId); |
|
121 | + $relName = $releasesObj->getVar('rel_name'); |
|
122 | + if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { |
|
123 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
124 | + \redirect_header('releases.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors())); |
|
125 | + } |
|
126 | + if ($releasesHandler->delete($releasesObj)) { |
|
127 | + \redirect_header('releases.php', 3, _AM_WGGITHUB_FORM_DELETE_OK); |
|
128 | + } else { |
|
129 | + $GLOBALS['xoopsTpl']->assign('error', $releasesObj->getHtmlErrors()); |
|
130 | + } |
|
131 | + } else { |
|
132 | + $xoopsconfirm = new Common\XoopsConfirm( |
|
133 | + ['ok' => 1, 'rel_id' => $relId, 'op' => 'delete'], |
|
134 | + $_SERVER['REQUEST_URI'], |
|
135 | + \sprintf(_AM_WGGITHUB_FORM_SURE_DELETE, $releasesObj->getVar('rel_name'))); |
|
136 | + $form = $xoopsconfirm->getFormXoopsConfirm(); |
|
137 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
138 | + } |
|
139 | + break; |
|
140 | 140 | } |
141 | 141 | require __DIR__ . '/footer.php'; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | use XoopsModules\Wggithub\Constants; |
26 | 26 | use XoopsModules\Wggithub\Common; |
27 | 27 | |
28 | -require __DIR__ . '/header.php'; |
|
28 | +require __DIR__.'/header.php'; |
|
29 | 29 | // It recovered the value of argument op in URL$ |
30 | 30 | $op = Request::getCmd('op', 'list'); |
31 | 31 | // Request rel_id |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | } |
56 | 56 | // Display Navigation |
57 | 57 | if ($releasesCount > $limit) { |
58 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | - $pagenav = new \XoopsPageNav($releasesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
58 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
59 | + $pagenav = new \XoopsPageNav($releasesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
60 | 60 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
61 | 61 | } |
62 | 62 | } else { |
@@ -138,4 +138,4 @@ discard block |
||
138 | 138 | } |
139 | 139 | break; |
140 | 140 | } |
141 | -require __DIR__ . '/footer.php'; |
|
141 | +require __DIR__.'/footer.php'; |
@@ -31,106 +31,106 @@ |
||
31 | 31 | // Request req_id |
32 | 32 | $reqId = Request::getInt('req_id'); |
33 | 33 | switch ($op) { |
34 | - case 'list': |
|
35 | - default: |
|
36 | - // Define Stylesheet |
|
37 | - $GLOBALS['xoTheme']->addStylesheet($style, null); |
|
38 | - $start = Request::getInt('start', 0); |
|
39 | - $limit = Request::getInt('limit', $helper->getConfig('adminpager')); |
|
40 | - $templateMain = 'wggithub_admin_requests.tpl'; |
|
41 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('requests.php')); |
|
42 | - $adminObject->addItemButton(_AM_WGGITHUB_ADD_REQUEST, 'requests.php?op=new', 'add'); |
|
43 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
44 | - $requestsCount = $requestsHandler->getCountRequests(); |
|
45 | - $requestsAll = $requestsHandler->getAllRequests($start, $limit); |
|
46 | - $GLOBALS['xoopsTpl']->assign('requests_count', $requestsCount); |
|
47 | - $GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL); |
|
48 | - $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
49 | - // Table view requests |
|
50 | - if ($requestsCount > 0) { |
|
51 | - foreach (\array_keys($requestsAll) as $i) { |
|
52 | - $request = $requestsAll[$i]->getValuesRequests(); |
|
53 | - $GLOBALS['xoopsTpl']->append('requests_list', $request); |
|
54 | - unset($request); |
|
55 | - } |
|
56 | - // Display Navigation |
|
57 | - if ($requestsCount > $limit) { |
|
58 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | - $pagenav = new \XoopsPageNav($requestsCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
60 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
|
61 | - } |
|
62 | - } else { |
|
63 | - $GLOBALS['xoopsTpl']->assign('error', _AM_WGGITHUB_THEREARENT_REQUESTS); |
|
64 | - } |
|
65 | - break; |
|
66 | - case 'new': |
|
67 | - $templateMain = 'wggithub_admin_requests.tpl'; |
|
68 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('requests.php')); |
|
69 | - $adminObject->addItemButton(_AM_WGGITHUB_REQUESTS_LIST, 'requests.php', 'list'); |
|
70 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
71 | - // Form Create |
|
72 | - $requestsObj = $requestsHandler->create(); |
|
73 | - $form = $requestsObj->getFormRequests(); |
|
74 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
75 | - break; |
|
76 | - case 'save': |
|
77 | - // Security Check |
|
78 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
79 | - \redirect_header('requests.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
80 | - } |
|
81 | - if ($reqId > 0) { |
|
82 | - $requestsObj = $requestsHandler->get($reqId); |
|
83 | - } else { |
|
84 | - $requestsObj = $requestsHandler->create(); |
|
85 | - } |
|
86 | - // Set Vars |
|
87 | - $requestsObj->setVar('req_request', Request::getString('req_request', '')); |
|
88 | - $requestsObj->setVar('req_result', Request::getString('req_result', '')); |
|
89 | - $requestDatecreatedObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('req_datecreated')); |
|
90 | - $requestsObj->setVar('req_datecreated', $requestDatecreatedObj->getTimestamp()); |
|
91 | - $requestsObj->setVar('req_submitter', Request::getInt('req_submitter', 0)); |
|
92 | - // Insert Data |
|
93 | - if ($requestsHandler->insert($requestsObj)) { |
|
94 | - \redirect_header('requests.php?op=list', 2, _AM_WGGITHUB_FORM_OK); |
|
95 | - } |
|
96 | - // Get Form |
|
97 | - $GLOBALS['xoopsTpl']->assign('error', $requestsObj->getHtmlErrors()); |
|
98 | - $form = $requestsObj->getFormRequests(); |
|
99 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
100 | - break; |
|
101 | - case 'edit': |
|
102 | - $templateMain = 'wggithub_admin_requests.tpl'; |
|
103 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('requests.php')); |
|
104 | - $adminObject->addItemButton(_AM_WGGITHUB_ADD_REQUEST, 'requests.php?op=new', 'add'); |
|
105 | - $adminObject->addItemButton(_AM_WGGITHUB_REQUESTS_LIST, 'requests.php', 'list'); |
|
106 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
107 | - // Get Form |
|
108 | - $requestsObj = $requestsHandler->get($reqId); |
|
109 | - $form = $requestsObj->getFormRequests(); |
|
110 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
111 | - break; |
|
112 | - case 'delete': |
|
113 | - $templateMain = 'wggithub_admin_requests.tpl'; |
|
114 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('requests.php')); |
|
115 | - $requestsObj = $requestsHandler->get($reqId); |
|
116 | - $reqRequest = $requestsObj->getVar('req_request'); |
|
117 | - if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { |
|
118 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
119 | - \redirect_header('requests.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors())); |
|
120 | - } |
|
121 | - if ($requestsHandler->delete($requestsObj)) { |
|
122 | - \redirect_header('requests.php', 3, _AM_WGGITHUB_FORM_DELETE_OK); |
|
123 | - } else { |
|
124 | - $GLOBALS['xoopsTpl']->assign('error', $requestsObj->getHtmlErrors()); |
|
125 | - } |
|
126 | - } else { |
|
127 | - $xoopsconfirm = new Common\XoopsConfirm( |
|
128 | - ['ok' => 1, 'req_id' => $reqId, 'op' => 'delete'], |
|
129 | - $_SERVER['REQUEST_URI'], |
|
130 | - \sprintf(_AM_WGGITHUB_FORM_SURE_DELETE, $requestsObj->getVar('req_request'))); |
|
131 | - $form = $xoopsconfirm->getFormXoopsConfirm(); |
|
132 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
133 | - } |
|
134 | - break; |
|
34 | + case 'list': |
|
35 | + default: |
|
36 | + // Define Stylesheet |
|
37 | + $GLOBALS['xoTheme']->addStylesheet($style, null); |
|
38 | + $start = Request::getInt('start', 0); |
|
39 | + $limit = Request::getInt('limit', $helper->getConfig('adminpager')); |
|
40 | + $templateMain = 'wggithub_admin_requests.tpl'; |
|
41 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('requests.php')); |
|
42 | + $adminObject->addItemButton(_AM_WGGITHUB_ADD_REQUEST, 'requests.php?op=new', 'add'); |
|
43 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
44 | + $requestsCount = $requestsHandler->getCountRequests(); |
|
45 | + $requestsAll = $requestsHandler->getAllRequests($start, $limit); |
|
46 | + $GLOBALS['xoopsTpl']->assign('requests_count', $requestsCount); |
|
47 | + $GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL); |
|
48 | + $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
49 | + // Table view requests |
|
50 | + if ($requestsCount > 0) { |
|
51 | + foreach (\array_keys($requestsAll) as $i) { |
|
52 | + $request = $requestsAll[$i]->getValuesRequests(); |
|
53 | + $GLOBALS['xoopsTpl']->append('requests_list', $request); |
|
54 | + unset($request); |
|
55 | + } |
|
56 | + // Display Navigation |
|
57 | + if ($requestsCount > $limit) { |
|
58 | + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | + $pagenav = new \XoopsPageNav($requestsCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
60 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
|
61 | + } |
|
62 | + } else { |
|
63 | + $GLOBALS['xoopsTpl']->assign('error', _AM_WGGITHUB_THEREARENT_REQUESTS); |
|
64 | + } |
|
65 | + break; |
|
66 | + case 'new': |
|
67 | + $templateMain = 'wggithub_admin_requests.tpl'; |
|
68 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('requests.php')); |
|
69 | + $adminObject->addItemButton(_AM_WGGITHUB_REQUESTS_LIST, 'requests.php', 'list'); |
|
70 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
71 | + // Form Create |
|
72 | + $requestsObj = $requestsHandler->create(); |
|
73 | + $form = $requestsObj->getFormRequests(); |
|
74 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
75 | + break; |
|
76 | + case 'save': |
|
77 | + // Security Check |
|
78 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
79 | + \redirect_header('requests.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
80 | + } |
|
81 | + if ($reqId > 0) { |
|
82 | + $requestsObj = $requestsHandler->get($reqId); |
|
83 | + } else { |
|
84 | + $requestsObj = $requestsHandler->create(); |
|
85 | + } |
|
86 | + // Set Vars |
|
87 | + $requestsObj->setVar('req_request', Request::getString('req_request', '')); |
|
88 | + $requestsObj->setVar('req_result', Request::getString('req_result', '')); |
|
89 | + $requestDatecreatedObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('req_datecreated')); |
|
90 | + $requestsObj->setVar('req_datecreated', $requestDatecreatedObj->getTimestamp()); |
|
91 | + $requestsObj->setVar('req_submitter', Request::getInt('req_submitter', 0)); |
|
92 | + // Insert Data |
|
93 | + if ($requestsHandler->insert($requestsObj)) { |
|
94 | + \redirect_header('requests.php?op=list', 2, _AM_WGGITHUB_FORM_OK); |
|
95 | + } |
|
96 | + // Get Form |
|
97 | + $GLOBALS['xoopsTpl']->assign('error', $requestsObj->getHtmlErrors()); |
|
98 | + $form = $requestsObj->getFormRequests(); |
|
99 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
100 | + break; |
|
101 | + case 'edit': |
|
102 | + $templateMain = 'wggithub_admin_requests.tpl'; |
|
103 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('requests.php')); |
|
104 | + $adminObject->addItemButton(_AM_WGGITHUB_ADD_REQUEST, 'requests.php?op=new', 'add'); |
|
105 | + $adminObject->addItemButton(_AM_WGGITHUB_REQUESTS_LIST, 'requests.php', 'list'); |
|
106 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
107 | + // Get Form |
|
108 | + $requestsObj = $requestsHandler->get($reqId); |
|
109 | + $form = $requestsObj->getFormRequests(); |
|
110 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
111 | + break; |
|
112 | + case 'delete': |
|
113 | + $templateMain = 'wggithub_admin_requests.tpl'; |
|
114 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('requests.php')); |
|
115 | + $requestsObj = $requestsHandler->get($reqId); |
|
116 | + $reqRequest = $requestsObj->getVar('req_request'); |
|
117 | + if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { |
|
118 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
119 | + \redirect_header('requests.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors())); |
|
120 | + } |
|
121 | + if ($requestsHandler->delete($requestsObj)) { |
|
122 | + \redirect_header('requests.php', 3, _AM_WGGITHUB_FORM_DELETE_OK); |
|
123 | + } else { |
|
124 | + $GLOBALS['xoopsTpl']->assign('error', $requestsObj->getHtmlErrors()); |
|
125 | + } |
|
126 | + } else { |
|
127 | + $xoopsconfirm = new Common\XoopsConfirm( |
|
128 | + ['ok' => 1, 'req_id' => $reqId, 'op' => 'delete'], |
|
129 | + $_SERVER['REQUEST_URI'], |
|
130 | + \sprintf(_AM_WGGITHUB_FORM_SURE_DELETE, $requestsObj->getVar('req_request'))); |
|
131 | + $form = $xoopsconfirm->getFormXoopsConfirm(); |
|
132 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
133 | + } |
|
134 | + break; |
|
135 | 135 | } |
136 | 136 | require __DIR__ . '/footer.php'; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | use XoopsModules\Wggithub\Constants; |
26 | 26 | use XoopsModules\Wggithub\Common; |
27 | 27 | |
28 | -require __DIR__ . '/header.php'; |
|
28 | +require __DIR__.'/header.php'; |
|
29 | 29 | // It recovered the value of argument op in URL$ |
30 | 30 | $op = Request::getCmd('op', 'list'); |
31 | 31 | // Request req_id |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | } |
56 | 56 | // Display Navigation |
57 | 57 | if ($requestsCount > $limit) { |
58 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | - $pagenav = new \XoopsPageNav($requestsCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
58 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
59 | + $pagenav = new \XoopsPageNav($requestsCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
60 | 60 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
61 | 61 | } |
62 | 62 | } else { |
@@ -133,4 +133,4 @@ discard block |
||
133 | 133 | } |
134 | 134 | break; |
135 | 135 | } |
136 | -require __DIR__ . '/footer.php'; |
|
136 | +require __DIR__.'/footer.php'; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | use XoopsModules\Wggithub\Constants; |
26 | 26 | use XoopsModules\Wggithub\Common; |
27 | 27 | |
28 | -require __DIR__ . '/header.php'; |
|
28 | +require __DIR__.'/header.php'; |
|
29 | 29 | // It recovered the value of argument op in URL$ |
30 | 30 | $op = Request::getCmd('op', 'list'); |
31 | 31 | // Request repo_id |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | } |
56 | 56 | // Display Navigation |
57 | 57 | if ($repositoriesCount > $limit) { |
58 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | - $pagenav = new \XoopsPageNav($repositoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
58 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
59 | + $pagenav = new \XoopsPageNav($repositoriesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
60 | 60 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
61 | 61 | } |
62 | 62 | } else { |
@@ -168,4 +168,4 @@ discard block |
||
168 | 168 | } |
169 | 169 | break; |
170 | 170 | } |
171 | -require __DIR__ . '/footer.php'; |
|
171 | +require __DIR__.'/footer.php'; |
@@ -31,116 +31,116 @@ |
||
31 | 31 | // Request repo_id |
32 | 32 | $repoId = Request::getInt('repo_id'); |
33 | 33 | switch ($op) { |
34 | - case 'list': |
|
35 | - default: |
|
36 | - // Define Stylesheet |
|
37 | - $GLOBALS['xoTheme']->addStylesheet($style, null); |
|
38 | - $start = Request::getInt('start', 0); |
|
39 | - $limit = Request::getInt('limit', $helper->getConfig('adminpager')); |
|
40 | - $templateMain = 'wggithub_admin_repositories.tpl'; |
|
41 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('repositories.php')); |
|
42 | - $adminObject->addItemButton(_AM_WGGITHUB_ADD_REPOSITORY, 'repositories.php?op=new', 'add'); |
|
43 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
44 | - $repositoriesCount = $repositoriesHandler->getCountRepositories(); |
|
45 | - $repositoriesAll = $repositoriesHandler->getAllRepositories($start, $limit); |
|
46 | - $GLOBALS['xoopsTpl']->assign('repositories_count', $repositoriesCount); |
|
47 | - $GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL); |
|
48 | - $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
49 | - // Table view repositories |
|
50 | - if ($repositoriesCount > 0) { |
|
51 | - foreach (\array_keys($repositoriesAll) as $i) { |
|
52 | - $repository = $repositoriesAll[$i]->getValuesRepositories(); |
|
53 | - $GLOBALS['xoopsTpl']->append('repositories_list', $repository); |
|
54 | - unset($repository); |
|
55 | - } |
|
56 | - // Display Navigation |
|
57 | - if ($repositoriesCount > $limit) { |
|
58 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | - $pagenav = new \XoopsPageNav($repositoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
60 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
|
61 | - } |
|
62 | - } else { |
|
63 | - $GLOBALS['xoopsTpl']->assign('error', _AM_WGGITHUB_THEREARENT_REPOSITORIES); |
|
64 | - } |
|
65 | - break; |
|
66 | - case 'new': |
|
67 | - $templateMain = 'wggithub_admin_repositories.tpl'; |
|
68 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('repositories.php')); |
|
69 | - $adminObject->addItemButton(_AM_WGGITHUB_REPOSITORIES_LIST, 'repositories.php', 'list'); |
|
70 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
71 | - // Form Create |
|
72 | - $repositoriesObj = $repositoriesHandler->create(); |
|
73 | - $form = $repositoriesObj->getFormRepositories(); |
|
74 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
75 | - break; |
|
76 | - case 'save': |
|
77 | - // Security Check |
|
78 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
79 | - \redirect_header('repositories.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
80 | - } |
|
81 | - if ($repoId > 0) { |
|
82 | - $repositoriesObj = $repositoriesHandler->get($repoId); |
|
83 | - } else { |
|
84 | - $repositoriesObj = $repositoriesHandler->create(); |
|
85 | - } |
|
86 | - // Set Vars |
|
87 | - $repositoriesObj->setVar('repo_nodeid', Request::getString('repo_nodeid', '')); |
|
88 | - $repositoriesObj->setVar('repo_user', Request::getString('repo_user', '')); |
|
89 | - $repositoriesObj->setVar('repo_name', Request::getString('repo_name', '')); |
|
90 | - $repositoriesObj->setVar('repo_fullname', Request::getString('repo_fullname', '')); |
|
91 | - $repositoryCreatedatObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('repo_createdat')); |
|
92 | - $repositoriesObj->setVar('repo_createdat', $repositoryCreatedatObj->getTimestamp()); |
|
93 | - $repositoryUpdatedatObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('repo_updatedat')); |
|
94 | - $repositoriesObj->setVar('repo_updatedat', $repositoryUpdatedatObj->getTimestamp()); |
|
95 | - $repositoriesObj->setVar('repo_htmlurl', Request::getString('repo_htmlurl', '')); |
|
34 | + case 'list': |
|
35 | + default: |
|
36 | + // Define Stylesheet |
|
37 | + $GLOBALS['xoTheme']->addStylesheet($style, null); |
|
38 | + $start = Request::getInt('start', 0); |
|
39 | + $limit = Request::getInt('limit', $helper->getConfig('adminpager')); |
|
40 | + $templateMain = 'wggithub_admin_repositories.tpl'; |
|
41 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('repositories.php')); |
|
42 | + $adminObject->addItemButton(_AM_WGGITHUB_ADD_REPOSITORY, 'repositories.php?op=new', 'add'); |
|
43 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
44 | + $repositoriesCount = $repositoriesHandler->getCountRepositories(); |
|
45 | + $repositoriesAll = $repositoriesHandler->getAllRepositories($start, $limit); |
|
46 | + $GLOBALS['xoopsTpl']->assign('repositories_count', $repositoriesCount); |
|
47 | + $GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL); |
|
48 | + $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
49 | + // Table view repositories |
|
50 | + if ($repositoriesCount > 0) { |
|
51 | + foreach (\array_keys($repositoriesAll) as $i) { |
|
52 | + $repository = $repositoriesAll[$i]->getValuesRepositories(); |
|
53 | + $GLOBALS['xoopsTpl']->append('repositories_list', $repository); |
|
54 | + unset($repository); |
|
55 | + } |
|
56 | + // Display Navigation |
|
57 | + if ($repositoriesCount > $limit) { |
|
58 | + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
59 | + $pagenav = new \XoopsPageNav($repositoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
60 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
|
61 | + } |
|
62 | + } else { |
|
63 | + $GLOBALS['xoopsTpl']->assign('error', _AM_WGGITHUB_THEREARENT_REPOSITORIES); |
|
64 | + } |
|
65 | + break; |
|
66 | + case 'new': |
|
67 | + $templateMain = 'wggithub_admin_repositories.tpl'; |
|
68 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('repositories.php')); |
|
69 | + $adminObject->addItemButton(_AM_WGGITHUB_REPOSITORIES_LIST, 'repositories.php', 'list'); |
|
70 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
71 | + // Form Create |
|
72 | + $repositoriesObj = $repositoriesHandler->create(); |
|
73 | + $form = $repositoriesObj->getFormRepositories(); |
|
74 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
75 | + break; |
|
76 | + case 'save': |
|
77 | + // Security Check |
|
78 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
79 | + \redirect_header('repositories.php', 3, \implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
80 | + } |
|
81 | + if ($repoId > 0) { |
|
82 | + $repositoriesObj = $repositoriesHandler->get($repoId); |
|
83 | + } else { |
|
84 | + $repositoriesObj = $repositoriesHandler->create(); |
|
85 | + } |
|
86 | + // Set Vars |
|
87 | + $repositoriesObj->setVar('repo_nodeid', Request::getString('repo_nodeid', '')); |
|
88 | + $repositoriesObj->setVar('repo_user', Request::getString('repo_user', '')); |
|
89 | + $repositoriesObj->setVar('repo_name', Request::getString('repo_name', '')); |
|
90 | + $repositoriesObj->setVar('repo_fullname', Request::getString('repo_fullname', '')); |
|
91 | + $repositoryCreatedatObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('repo_createdat')); |
|
92 | + $repositoriesObj->setVar('repo_createdat', $repositoryCreatedatObj->getTimestamp()); |
|
93 | + $repositoryUpdatedatObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('repo_updatedat')); |
|
94 | + $repositoriesObj->setVar('repo_updatedat', $repositoryUpdatedatObj->getTimestamp()); |
|
95 | + $repositoriesObj->setVar('repo_htmlurl', Request::getString('repo_htmlurl', '')); |
|
96 | 96 | $repositoriesObj->setVar('repo_prerelease', Request::getInt('repo_prerelease', 0)); |
97 | 97 | $repositoriesObj->setVar('repo_release', Request::getInt('repo_release', 0)); |
98 | - $repositoriesObj->setVar('repo_status', Request::getInt('repo_status', 0)); |
|
99 | - $repositoryDatecreatedObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('repo_datecreated')); |
|
100 | - $repositoriesObj->setVar('repo_datecreated', $repositoryDatecreatedObj->getTimestamp()); |
|
101 | - $repositoriesObj->setVar('repo_submitter', Request::getInt('repo_submitter', 0)); |
|
102 | - // Insert Data |
|
103 | - if ($repositoriesHandler->insert($repositoriesObj)) { |
|
104 | - \redirect_header('repositories.php?op=list', 2, _AM_WGGITHUB_FORM_OK); |
|
105 | - } |
|
106 | - // Get Form |
|
107 | - $GLOBALS['xoopsTpl']->assign('error', $repositoriesObj->getHtmlErrors()); |
|
108 | - $form = $repositoriesObj->getFormRepositories(); |
|
109 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
110 | - break; |
|
111 | - case 'edit': |
|
112 | - $templateMain = 'wggithub_admin_repositories.tpl'; |
|
113 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('repositories.php')); |
|
114 | - $adminObject->addItemButton(_AM_WGGITHUB_ADD_REPOSITORY, 'repositories.php?op=new', 'add'); |
|
115 | - $adminObject->addItemButton(_AM_WGGITHUB_REPOSITORIES_LIST, 'repositories.php', 'list'); |
|
116 | - $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
117 | - // Get Form |
|
118 | - $repositoriesObj = $repositoriesHandler->get($repoId); |
|
119 | - $form = $repositoriesObj->getFormRepositories(); |
|
120 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
121 | - break; |
|
122 | - case 'delete': |
|
123 | - $templateMain = 'wggithub_admin_repositories.tpl'; |
|
124 | - $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('repositories.php')); |
|
125 | - $repositoriesObj = $repositoriesHandler->get($repoId); |
|
126 | - $repoName = $repositoriesObj->getVar('repo_name'); |
|
127 | - if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { |
|
128 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
129 | - \redirect_header('repositories.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors())); |
|
130 | - } |
|
131 | - if ($repositoriesHandler->delete($repositoriesObj)) { |
|
132 | - \redirect_header('repositories.php', 3, _AM_WGGITHUB_FORM_DELETE_OK); |
|
133 | - } else { |
|
134 | - $GLOBALS['xoopsTpl']->assign('error', $repositoriesObj->getHtmlErrors()); |
|
135 | - } |
|
136 | - } else { |
|
137 | - $xoopsconfirm = new Common\XoopsConfirm( |
|
138 | - ['ok' => 1, 'repo_id' => $repoId, 'op' => 'delete'], |
|
139 | - $_SERVER['REQUEST_URI'], |
|
140 | - \sprintf(_AM_WGGITHUB_FORM_SURE_DELETE, $repositoriesObj->getVar('repo_name'))); |
|
141 | - $form = $xoopsconfirm->getFormXoopsConfirm(); |
|
142 | - $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
143 | - } |
|
144 | - break; |
|
98 | + $repositoriesObj->setVar('repo_status', Request::getInt('repo_status', 0)); |
|
99 | + $repositoryDatecreatedObj = \DateTime::createFromFormat(_SHORTDATESTRING, Request::getString('repo_datecreated')); |
|
100 | + $repositoriesObj->setVar('repo_datecreated', $repositoryDatecreatedObj->getTimestamp()); |
|
101 | + $repositoriesObj->setVar('repo_submitter', Request::getInt('repo_submitter', 0)); |
|
102 | + // Insert Data |
|
103 | + if ($repositoriesHandler->insert($repositoriesObj)) { |
|
104 | + \redirect_header('repositories.php?op=list', 2, _AM_WGGITHUB_FORM_OK); |
|
105 | + } |
|
106 | + // Get Form |
|
107 | + $GLOBALS['xoopsTpl']->assign('error', $repositoriesObj->getHtmlErrors()); |
|
108 | + $form = $repositoriesObj->getFormRepositories(); |
|
109 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
110 | + break; |
|
111 | + case 'edit': |
|
112 | + $templateMain = 'wggithub_admin_repositories.tpl'; |
|
113 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('repositories.php')); |
|
114 | + $adminObject->addItemButton(_AM_WGGITHUB_ADD_REPOSITORY, 'repositories.php?op=new', 'add'); |
|
115 | + $adminObject->addItemButton(_AM_WGGITHUB_REPOSITORIES_LIST, 'repositories.php', 'list'); |
|
116 | + $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left')); |
|
117 | + // Get Form |
|
118 | + $repositoriesObj = $repositoriesHandler->get($repoId); |
|
119 | + $form = $repositoriesObj->getFormRepositories(); |
|
120 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
121 | + break; |
|
122 | + case 'delete': |
|
123 | + $templateMain = 'wggithub_admin_repositories.tpl'; |
|
124 | + $GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('repositories.php')); |
|
125 | + $repositoriesObj = $repositoriesHandler->get($repoId); |
|
126 | + $repoName = $repositoriesObj->getVar('repo_name'); |
|
127 | + if (isset($_REQUEST['ok']) && 1 == $_REQUEST['ok']) { |
|
128 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
129 | + \redirect_header('repositories.php', 3, \implode(', ', $GLOBALS['xoopsSecurity']->getErrors())); |
|
130 | + } |
|
131 | + if ($repositoriesHandler->delete($repositoriesObj)) { |
|
132 | + \redirect_header('repositories.php', 3, _AM_WGGITHUB_FORM_DELETE_OK); |
|
133 | + } else { |
|
134 | + $GLOBALS['xoopsTpl']->assign('error', $repositoriesObj->getHtmlErrors()); |
|
135 | + } |
|
136 | + } else { |
|
137 | + $xoopsconfirm = new Common\XoopsConfirm( |
|
138 | + ['ok' => 1, 'repo_id' => $repoId, 'op' => 'delete'], |
|
139 | + $_SERVER['REQUEST_URI'], |
|
140 | + \sprintf(_AM_WGGITHUB_FORM_SURE_DELETE, $repositoriesObj->getVar('repo_name'))); |
|
141 | + $form = $xoopsconfirm->getFormXoopsConfirm(); |
|
142 | + $GLOBALS['xoopsTpl']->assign('form', $form->render()); |
|
143 | + } |
|
144 | + break; |
|
145 | 145 | } |
146 | 146 | require __DIR__ . '/footer.php'; |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | $myts = MyTextSanitizer::getInstance(); |
41 | 41 | // |
42 | 42 | if (!isset($xoopsTpl) || !\is_object($xoopsTpl)) { |
43 | - include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
44 | - $xoopsTpl = new \XoopsTpl(); |
|
43 | + include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
44 | + $xoopsTpl = new \XoopsTpl(); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // Load languages |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | |
51 | 51 | // Local admin menu class |
52 | 52 | if (\file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))) { |
53 | - include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); |
|
53 | + include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'); |
|
54 | 54 | } else { |
55 | - \redirect_header('../../../admin.php', 5, _AM_MODULEADMIN_MISSING); |
|
55 | + \redirect_header('../../../admin.php', 5, _AM_MODULEADMIN_MISSING); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | xoops_cp_header(); |
@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
21 | 21 | */ |
22 | 22 | |
23 | -include dirname(__DIR__, 3) . '/include/cp_header.php'; |
|
24 | -include_once \dirname(__DIR__) . '/include/common.php'; |
|
23 | +include dirname(__DIR__, 3).'/include/cp_header.php'; |
|
24 | +include_once \dirname(__DIR__).'/include/common.php'; |
|
25 | 25 | |
26 | -$sysPathIcon16 = '../' . $GLOBALS['xoopsModule']->getInfo('sysicons16'); |
|
27 | -$sysPathIcon32 = '../' . $GLOBALS['xoopsModule']->getInfo('sysicons32'); |
|
26 | +$sysPathIcon16 = '../'.$GLOBALS['xoopsModule']->getInfo('sysicons16'); |
|
27 | +$sysPathIcon32 = '../'.$GLOBALS['xoopsModule']->getInfo('sysicons32'); |
|
28 | 28 | $pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin'); |
29 | -$modPathIcon16 = WGGITHUB_URL . '/' . $GLOBALS['xoopsModule']->getInfo('modicons16') . '/'; |
|
30 | -$modPathIcon32 = WGGITHUB_URL . '/' . $GLOBALS['xoopsModule']->getInfo('modicons32') . '/'; |
|
29 | +$modPathIcon16 = WGGITHUB_URL.'/'.$GLOBALS['xoopsModule']->getInfo('modicons16').'/'; |
|
30 | +$modPathIcon32 = WGGITHUB_URL.'/'.$GLOBALS['xoopsModule']->getInfo('modicons32').'/'; |
|
31 | 31 | |
32 | 32 | // Get instance of module |
33 | 33 | $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $myts = MyTextSanitizer::getInstance(); |
41 | 41 | // |
42 | 42 | if (!isset($xoopsTpl) || !\is_object($xoopsTpl)) { |
43 | - include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
43 | + include_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
44 | 44 | $xoopsTpl = new \XoopsTpl(); |
45 | 45 | } |
46 | 46 | |
@@ -64,4 +64,4 @@ discard block |
||
64 | 64 | $GLOBALS['xoopsTpl']->assign('modPathIcon32', $modPathIcon32); |
65 | 65 | |
66 | 66 | $adminObject = \Xmf\Module\Admin::getInstance(); |
67 | -$style = WGGITHUB_URL . '/assets/css/admin/style.css'; |
|
67 | +$style = WGGITHUB_URL.'/assets/css/admin/style.css'; |