@@ -41,136 +41,136 @@ |
||
| 41 | 41 | $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
| 42 | 42 | |
| 43 | 43 | switch ($op) { |
| 44 | - case 'save': |
|
| 45 | - if ($cat_id) { |
|
| 46 | - $category_obj = $categoryHandler->get($cat_id); |
|
| 47 | - } else { |
|
| 48 | - $category_obj = $categoryHandler->create(); |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - $category_obj->setVar('cat_title', $_POST['cat_title']); |
|
| 52 | - $category_obj->setVar('cat_order', $_POST['cat_order']); |
|
| 53 | - |
|
| 54 | - if (!$categoryHandler->insert($category_obj)) { |
|
| 55 | - $message = planet_constant('AM_ERROR'); |
|
| 56 | - } else { |
|
| 57 | - $message = planet_constant('AM_DBUPDATED'); |
|
| 58 | - } |
|
| 59 | - redirect_header('admin.category.php', 2, $message); |
|
| 60 | - |
|
| 61 | - // no break |
|
| 62 | - case 'del': |
|
| 63 | - if (!is_array($cat_id)) { |
|
| 64 | - $cat_id = [$cat_id]; |
|
| 65 | - } |
|
| 66 | - foreach ($cat_id as $cid) { |
|
| 67 | - $category_obj = $categoryHandler->get($cid); |
|
| 68 | - if (!$categoryHandler->delete($category_obj)) { |
|
| 69 | - } |
|
| 70 | - } |
|
| 71 | - $message = planet_constant('AM_DBUPDATED'); |
|
| 72 | - redirect_header('admin.category.php', 2, $message); |
|
| 73 | - |
|
| 74 | - // no break |
|
| 75 | - case 'order': |
|
| 76 | - $count = count($_POST['cat_order']); |
|
| 77 | - for ($i = 0; $i < $count; ++$i) { |
|
| 78 | - $category_obj = $categoryHandler->get($_POST['cat'][$i]); |
|
| 79 | - $category_obj->setVar('cat_order', $_POST['cat_order'][$i]); |
|
| 80 | - $categoryHandler->insert($category_obj, true); |
|
| 81 | - unset($category_obj); |
|
| 82 | - } |
|
| 83 | - $message = planet_constant('AM_DBUPDATED'); |
|
| 84 | - redirect_header('admin.category.php', 2, $message); |
|
| 85 | - |
|
| 86 | - // no break |
|
| 87 | - case 'edit': |
|
| 88 | - $category_obj = $categoryHandler->get($cat_id); |
|
| 89 | - $form = new XoopsThemeForm(_EDIT, 'edit', xoops_getenv('PHP_SELF'), 'post', true); |
|
| 90 | - $form->addElement(new XoopsFormText(planet_constant('AM_TITLE'), 'cat_title', 50, 80, $category_obj->getVar('cat_title', 'E')), true); |
|
| 91 | - $form->addElement(new XoopsFormText(planet_constant('AM_ORDER'), 'cat_order', 5, 10, $category_obj->getVar('cat_order')), false); |
|
| 92 | - $form->addElement(new XoopsFormHidden('category', $cat_id)); |
|
| 93 | - $form->addElement(new XoopsFormHidden('op', 'save')); |
|
| 94 | - |
|
| 95 | - $button_tray = new XoopsFormElementTray('', ''); |
|
| 96 | - $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
| 97 | - $button_tray->addElement($butt_save); |
|
| 98 | - $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset'); |
|
| 99 | - $button_tray->addElement($butt_cancel); |
|
| 100 | - $form->addElement($button_tray); |
|
| 101 | - |
|
| 102 | - echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . '</legend>'; |
|
| 103 | - echo '<br>'; |
|
| 104 | - $form->display(); |
|
| 105 | - echo '</fieldset>'; |
|
| 106 | - break; |
|
| 107 | - |
|
| 108 | - default: |
|
| 109 | - $crit = new Criteria('1', 1); |
|
| 110 | - $crit->setSort('cat_order'); |
|
| 111 | - $crit->setOrder('ASC'); |
|
| 112 | - $categories = $categoryHandler->getList($crit); |
|
| 113 | - $blog_counts = $blogHandler->getCountsByCategory(); |
|
| 114 | - foreach (array_keys($categories) as $cid) { |
|
| 115 | - if (!empty($blog_counts[$cid])) { |
|
| 116 | - $categories[$cid] .= ' (' . (int)$blog_counts[$cid] . ')'; |
|
| 117 | - } |
|
| 118 | - } |
|
| 119 | - |
|
| 120 | - echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant('AM_LIST') . '</legend>'; |
|
| 121 | - echo "<br style=\"clear:both;\">"; |
|
| 122 | - |
|
| 123 | - echo "<form name='list' method='post'>"; |
|
| 124 | - echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
|
| 125 | - echo "<tr align='center'>"; |
|
| 126 | - echo "<th class='bg3' width='5%'>" . planet_constant('AM_ORDER') . '</td>'; |
|
| 127 | - echo "<th align='left' class='bg3' width='80%'>" . planet_constant('AM_TITLE') . '</td>'; |
|
| 128 | - echo "<th class='bg3' width='5%'>" . planet_constant('AM_BLOGCOUNT') . '</td>'; |
|
| 129 | - echo "<th class='bg3' width='5%'>" . planet_constant('AM_ACTIONS') . '</td>'; |
|
| 130 | - // echo "<td class='bg3' width='5%'>" . _DELETE . "</td>"; |
|
| 131 | - |
|
| 132 | - echo '</tr>'; |
|
| 133 | - |
|
| 134 | - $ii = 0; |
|
| 135 | - foreach (array_keys($categories) as $cid) { |
|
| 136 | - echo "<tr class='odd' align='left'>"; |
|
| 137 | - echo "<td><input type='hidden' name='cat[]' value='" . $cid . "'>"; |
|
| 138 | - echo "<input type='text' name='cat_order[]' value='" . ($ii * 10) . "'></td>"; |
|
| 139 | - echo '<td>' . $categories[$cid] . '</td>'; |
|
| 140 | - echo "<td align='center'>" . @$blog_counts[$cid] . '</td>'; |
|
| 141 | - |
|
| 142 | - echo "<td align='center'><a href='admin.category.php?op=edit &category='" . $cid . "' title='" . _EDIT . "'><img src='" . $pathIcon16 . "/edit.png '" . "alt='" . _EDIT . "' title='" . _EDIT . "' </a> |
|
| 44 | + case 'save': |
|
| 45 | + if ($cat_id) { |
|
| 46 | + $category_obj = $categoryHandler->get($cat_id); |
|
| 47 | + } else { |
|
| 48 | + $category_obj = $categoryHandler->create(); |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + $category_obj->setVar('cat_title', $_POST['cat_title']); |
|
| 52 | + $category_obj->setVar('cat_order', $_POST['cat_order']); |
|
| 53 | + |
|
| 54 | + if (!$categoryHandler->insert($category_obj)) { |
|
| 55 | + $message = planet_constant('AM_ERROR'); |
|
| 56 | + } else { |
|
| 57 | + $message = planet_constant('AM_DBUPDATED'); |
|
| 58 | + } |
|
| 59 | + redirect_header('admin.category.php', 2, $message); |
|
| 60 | + |
|
| 61 | + // no break |
|
| 62 | + case 'del': |
|
| 63 | + if (!is_array($cat_id)) { |
|
| 64 | + $cat_id = [$cat_id]; |
|
| 65 | + } |
|
| 66 | + foreach ($cat_id as $cid) { |
|
| 67 | + $category_obj = $categoryHandler->get($cid); |
|
| 68 | + if (!$categoryHandler->delete($category_obj)) { |
|
| 69 | + } |
|
| 70 | + } |
|
| 71 | + $message = planet_constant('AM_DBUPDATED'); |
|
| 72 | + redirect_header('admin.category.php', 2, $message); |
|
| 73 | + |
|
| 74 | + // no break |
|
| 75 | + case 'order': |
|
| 76 | + $count = count($_POST['cat_order']); |
|
| 77 | + for ($i = 0; $i < $count; ++$i) { |
|
| 78 | + $category_obj = $categoryHandler->get($_POST['cat'][$i]); |
|
| 79 | + $category_obj->setVar('cat_order', $_POST['cat_order'][$i]); |
|
| 80 | + $categoryHandler->insert($category_obj, true); |
|
| 81 | + unset($category_obj); |
|
| 82 | + } |
|
| 83 | + $message = planet_constant('AM_DBUPDATED'); |
|
| 84 | + redirect_header('admin.category.php', 2, $message); |
|
| 85 | + |
|
| 86 | + // no break |
|
| 87 | + case 'edit': |
|
| 88 | + $category_obj = $categoryHandler->get($cat_id); |
|
| 89 | + $form = new XoopsThemeForm(_EDIT, 'edit', xoops_getenv('PHP_SELF'), 'post', true); |
|
| 90 | + $form->addElement(new XoopsFormText(planet_constant('AM_TITLE'), 'cat_title', 50, 80, $category_obj->getVar('cat_title', 'E')), true); |
|
| 91 | + $form->addElement(new XoopsFormText(planet_constant('AM_ORDER'), 'cat_order', 5, 10, $category_obj->getVar('cat_order')), false); |
|
| 92 | + $form->addElement(new XoopsFormHidden('category', $cat_id)); |
|
| 93 | + $form->addElement(new XoopsFormHidden('op', 'save')); |
|
| 94 | + |
|
| 95 | + $button_tray = new XoopsFormElementTray('', ''); |
|
| 96 | + $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
| 97 | + $button_tray->addElement($butt_save); |
|
| 98 | + $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset'); |
|
| 99 | + $button_tray->addElement($butt_cancel); |
|
| 100 | + $form->addElement($button_tray); |
|
| 101 | + |
|
| 102 | + echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . '</legend>'; |
|
| 103 | + echo '<br>'; |
|
| 104 | + $form->display(); |
|
| 105 | + echo '</fieldset>'; |
|
| 106 | + break; |
|
| 107 | + |
|
| 108 | + default: |
|
| 109 | + $crit = new Criteria('1', 1); |
|
| 110 | + $crit->setSort('cat_order'); |
|
| 111 | + $crit->setOrder('ASC'); |
|
| 112 | + $categories = $categoryHandler->getList($crit); |
|
| 113 | + $blog_counts = $blogHandler->getCountsByCategory(); |
|
| 114 | + foreach (array_keys($categories) as $cid) { |
|
| 115 | + if (!empty($blog_counts[$cid])) { |
|
| 116 | + $categories[$cid] .= ' (' . (int)$blog_counts[$cid] . ')'; |
|
| 117 | + } |
|
| 118 | + } |
|
| 119 | + |
|
| 120 | + echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant('AM_LIST') . '</legend>'; |
|
| 121 | + echo "<br style=\"clear:both;\">"; |
|
| 122 | + |
|
| 123 | + echo "<form name='list' method='post'>"; |
|
| 124 | + echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
|
| 125 | + echo "<tr align='center'>"; |
|
| 126 | + echo "<th class='bg3' width='5%'>" . planet_constant('AM_ORDER') . '</td>'; |
|
| 127 | + echo "<th align='left' class='bg3' width='80%'>" . planet_constant('AM_TITLE') . '</td>'; |
|
| 128 | + echo "<th class='bg3' width='5%'>" . planet_constant('AM_BLOGCOUNT') . '</td>'; |
|
| 129 | + echo "<th class='bg3' width='5%'>" . planet_constant('AM_ACTIONS') . '</td>'; |
|
| 130 | + // echo "<td class='bg3' width='5%'>" . _DELETE . "</td>"; |
|
| 131 | + |
|
| 132 | + echo '</tr>'; |
|
| 133 | + |
|
| 134 | + $ii = 0; |
|
| 135 | + foreach (array_keys($categories) as $cid) { |
|
| 136 | + echo "<tr class='odd' align='left'>"; |
|
| 137 | + echo "<td><input type='hidden' name='cat[]' value='" . $cid . "'>"; |
|
| 138 | + echo "<input type='text' name='cat_order[]' value='" . ($ii * 10) . "'></td>"; |
|
| 139 | + echo '<td>' . $categories[$cid] . '</td>'; |
|
| 140 | + echo "<td align='center'>" . @$blog_counts[$cid] . '</td>'; |
|
| 141 | + |
|
| 142 | + echo "<td align='center'><a href='admin.category.php?op=edit &category='" . $cid . "' title='" . _EDIT . "'><img src='" . $pathIcon16 . "/edit.png '" . "alt='" . _EDIT . "' title='" . _EDIT . "' </a> |
|
| 143 | 143 | <a href='admin.category.php?op=del &category='" . $cid . "' title='" . _DELETE . "'><img src='" . $pathIcon16 . "/delete.png '" . " alt='" . _EDIT . "' title='" . _DELETE . "' </a></td>"; |
| 144 | - echo '</tr>'; |
|
| 145 | - ++$ii; |
|
| 146 | - } |
|
| 147 | - echo "<tr class='even' align='center'>"; |
|
| 148 | - echo "<td colspan='5'>"; |
|
| 149 | - echo "<input name='submit' value='" . _SUBMIT . "' type='submit'>"; |
|
| 150 | - echo "<input name='' value='" . _CANCEL . "' type='reset'>"; |
|
| 151 | - echo "<input name='op' value='order' type='hidden'>"; |
|
| 152 | - echo '</td>'; |
|
| 153 | - echo '</tr>'; |
|
| 154 | - echo '</table></form>'; |
|
| 155 | - echo "</fieldset><br style='clear:both;'>"; |
|
| 156 | - |
|
| 157 | - $form = new XoopsThemeForm(_ADD, 'mod', xoops_getenv('PHP_SELF'), 'post', true); |
|
| 158 | - $form->addElement(new XoopsFormText(planet_constant('AM_TITLE'), 'cat_title', 50, 80), true); |
|
| 159 | - $form->addElement(new XoopsFormText(planet_constant('AM_ORDER'), 'cat_order', 5, 10), false); |
|
| 160 | - $form->addElement(new XoopsFormHidden('op', 'save')); |
|
| 161 | - |
|
| 162 | - $button_tray = new XoopsFormElementTray('', ''); |
|
| 163 | - $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
| 164 | - $button_tray->addElement($butt_save); |
|
| 165 | - $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset'); |
|
| 166 | - $button_tray->addElement($butt_cancel); |
|
| 167 | - $form->addElement($button_tray); |
|
| 168 | - |
|
| 169 | - echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _ADD . '</legend>'; |
|
| 170 | - echo '<br>'; |
|
| 171 | - $form->display(); |
|
| 172 | - echo '</fieldset>'; |
|
| 173 | - break; |
|
| 144 | + echo '</tr>'; |
|
| 145 | + ++$ii; |
|
| 146 | + } |
|
| 147 | + echo "<tr class='even' align='center'>"; |
|
| 148 | + echo "<td colspan='5'>"; |
|
| 149 | + echo "<input name='submit' value='" . _SUBMIT . "' type='submit'>"; |
|
| 150 | + echo "<input name='' value='" . _CANCEL . "' type='reset'>"; |
|
| 151 | + echo "<input name='op' value='order' type='hidden'>"; |
|
| 152 | + echo '</td>'; |
|
| 153 | + echo '</tr>'; |
|
| 154 | + echo '</table></form>'; |
|
| 155 | + echo "</fieldset><br style='clear:both;'>"; |
|
| 156 | + |
|
| 157 | + $form = new XoopsThemeForm(_ADD, 'mod', xoops_getenv('PHP_SELF'), 'post', true); |
|
| 158 | + $form->addElement(new XoopsFormText(planet_constant('AM_TITLE'), 'cat_title', 50, 80), true); |
|
| 159 | + $form->addElement(new XoopsFormText(planet_constant('AM_ORDER'), 'cat_order', 5, 10), false); |
|
| 160 | + $form->addElement(new XoopsFormHidden('op', 'save')); |
|
| 161 | + |
|
| 162 | + $button_tray = new XoopsFormElementTray('', ''); |
|
| 163 | + $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
| 164 | + $button_tray->addElement($butt_save); |
|
| 165 | + $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset'); |
|
| 166 | + $button_tray->addElement($butt_cancel); |
|
| 167 | + $form->addElement($button_tray); |
|
| 168 | + |
|
| 169 | + echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _ADD . '</legend>'; |
|
| 170 | + echo '<br>'; |
|
| 171 | + $form->display(); |
|
| 172 | + echo '</fieldset>'; |
|
| 173 | + break; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | xoops_cp_footer(); |
@@ -31,44 +31,44 @@ discard block |
||
| 31 | 31 | error_reporting(0); |
| 32 | 32 | |
| 33 | 33 | if (empty(Request::getString('print_data', '', 'POST'))) { |
| 34 | - //$_POST['print_data'])) |
|
| 34 | + //$_POST['print_data'])) |
|
| 35 | 35 | |
| 36 | - if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
|
| 37 | - $args['article'] = @$args_num[0]; |
|
| 38 | - } |
|
| 36 | + if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
|
| 37 | + $args['article'] = @$args_num[0]; |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - $article_id = Request::getInt('article', @$args['article'], 'POST');//(int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
| 40 | + $article_id = Request::getInt('article', @$args['article'], 'POST');//(int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
| 41 | 41 | |
| 42 | - $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 43 | - $article_obj = $articleHandler->get($article_id); |
|
| 42 | + $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 43 | + $article_obj = $articleHandler->get($article_id); |
|
| 44 | 44 | |
| 45 | - $article_data = []; |
|
| 45 | + $article_data = []; |
|
| 46 | 46 | |
| 47 | - // title |
|
| 48 | - $article_data['title'] = $article_obj->getVar('art_title'); |
|
| 47 | + // title |
|
| 48 | + $article_data['title'] = $article_obj->getVar('art_title'); |
|
| 49 | 49 | |
| 50 | - $article_data['author'] = $article_obj->getVar('art_author'); |
|
| 50 | + $article_data['author'] = $article_obj->getVar('art_author'); |
|
| 51 | 51 | |
| 52 | - // source |
|
| 53 | - $article_data['source'] = $article_obj->getVar('art_link'); |
|
| 52 | + // source |
|
| 53 | + $article_data['source'] = $article_obj->getVar('art_link'); |
|
| 54 | 54 | |
| 55 | - // publish time |
|
| 56 | - $article_data['time'] = $article_obj->getTime('l'); |
|
| 55 | + // publish time |
|
| 56 | + $article_data['time'] = $article_obj->getTime('l'); |
|
| 57 | 57 | |
| 58 | - // summary |
|
| 59 | - $article_data['summary'] =& $article_obj->getSummary(); |
|
| 58 | + // summary |
|
| 59 | + $article_data['summary'] =& $article_obj->getSummary(); |
|
| 60 | 60 | |
| 61 | - // text of page |
|
| 62 | - $article_data['text'] = $article_obj->getVar('art_content'); |
|
| 61 | + // text of page |
|
| 62 | + $article_data['text'] = $article_obj->getVar('art_content'); |
|
| 63 | 63 | |
| 64 | - $print_data['title'] = $article_data['title']; |
|
| 65 | - $print_data['author'] = $article_data['author']; |
|
| 66 | - $print_data['date'] = $article_data['time']; |
|
| 67 | - $print_data['summary'] = empty($article_data['summary']) ? '' : planet_constant('MD_SUMMARY') . ': ' . $article_data['summary']; |
|
| 68 | - $print_data['content'] = $article_data['text']; |
|
| 69 | - $print_data['url'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/view.article.php' . URL_DELIMITER . 'c' . $category_id . '/' . $article_id . '/p' . $page; |
|
| 64 | + $print_data['title'] = $article_data['title']; |
|
| 65 | + $print_data['author'] = $article_data['author']; |
|
| 66 | + $print_data['date'] = $article_data['time']; |
|
| 67 | + $print_data['summary'] = empty($article_data['summary']) ? '' : planet_constant('MD_SUMMARY') . ': ' . $article_data['summary']; |
|
| 68 | + $print_data['content'] = $article_data['text']; |
|
| 69 | + $print_data['url'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/view.article.php' . URL_DELIMITER . 'c' . $category_id . '/' . $article_id . '/p' . $page; |
|
| 70 | 70 | } else { |
| 71 | - $print_data = unserialize(base64_decode(Request::getString('print_data', '', 'POST')));//$_POST['print_data'])); |
|
| 71 | + $print_data = unserialize(base64_decode(Request::getString('print_data', '', 'POST')));//$_POST['print_data'])); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $print_data['image'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/' . $xoopsModule->getInfo('image'); |
@@ -99,36 +99,36 @@ discard block |
||
| 99 | 99 | </style>\n"; |
| 100 | 100 | echo "</head>\n"; |
| 101 | 101 | echo "<body style='background-color:#ffffff; color:#000000; font-family: Arial' onload='window.print()'>\n" |
| 102 | - . "<div style='float:center; width: 750px; border: 1px solid #000; padding: 20px;'>\n" |
|
| 103 | - . "<div style='text-align: center; display: block; margin: 0 0 6px 0; padding: 5px;'>\n" |
|
| 104 | - . "<img src='" |
|
| 105 | - . $print_data['image'] |
|
| 106 | - . "' border='0' alt='" |
|
| 107 | - . $print_data['module'] |
|
| 108 | - . "'>\n" |
|
| 109 | - . '<h2>' |
|
| 110 | - . $print_data['title'] |
|
| 111 | - . "</h2>\n" |
|
| 112 | - . "</div>\n" |
|
| 113 | - . "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 2px solid #ccc;'></div>\n"; |
|
| 102 | + . "<div style='float:center; width: 750px; border: 1px solid #000; padding: 20px;'>\n" |
|
| 103 | + . "<div style='text-align: center; display: block; margin: 0 0 6px 0; padding: 5px;'>\n" |
|
| 104 | + . "<img src='" |
|
| 105 | + . $print_data['image'] |
|
| 106 | + . "' border='0' alt='" |
|
| 107 | + . $print_data['module'] |
|
| 108 | + . "'>\n" |
|
| 109 | + . '<h2>' |
|
| 110 | + . $print_data['title'] |
|
| 111 | + . "</h2>\n" |
|
| 112 | + . "</div>\n" |
|
| 113 | + . "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 2px solid #ccc;'></div>\n"; |
|
| 114 | 114 | echo(empty($print_data['author']) ? '' : '<div>' . planet_constant('MD_AUTHOR') . ': ' . $print_data['author'] . "</div>\n") |
| 115 | - . '<div>' |
|
| 116 | - . planet_constant('MD_DATE') |
|
| 117 | - . ': ' |
|
| 118 | - . $print_data['date'] |
|
| 119 | - . "</div>\n" |
|
| 120 | - . (empty($article_data['summary']) ? '' : "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 1px solid #ccc;'></div>\n" . '<div>' . $print_data['summary'] . "</div>\n") |
|
| 121 | - . "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 1px solid #ccc;'></div>\n" |
|
| 122 | - . '<div>' |
|
| 123 | - . $print_data['content'] |
|
| 124 | - . "</div>\n" |
|
| 125 | - . "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 2px solid #ccc;'></div>\n" |
|
| 126 | - . '<div>' |
|
| 127 | - . $print_data['module'] |
|
| 128 | - . "</div>\n" |
|
| 129 | - . '<div>URL: ' |
|
| 130 | - . $print_data['url'] |
|
| 131 | - . "</div>\n" |
|
| 132 | - . "</div>\n" |
|
| 133 | - . "</body>\n</html>\n"; |
|
| 115 | + . '<div>' |
|
| 116 | + . planet_constant('MD_DATE') |
|
| 117 | + . ': ' |
|
| 118 | + . $print_data['date'] |
|
| 119 | + . "</div>\n" |
|
| 120 | + . (empty($article_data['summary']) ? '' : "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 1px solid #ccc;'></div>\n" . '<div>' . $print_data['summary'] . "</div>\n") |
|
| 121 | + . "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 1px solid #ccc;'></div>\n" |
|
| 122 | + . '<div>' |
|
| 123 | + . $print_data['content'] |
|
| 124 | + . "</div>\n" |
|
| 125 | + . "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 2px solid #ccc;'></div>\n" |
|
| 126 | + . '<div>' |
|
| 127 | + . $print_data['module'] |
|
| 128 | + . "</div>\n" |
|
| 129 | + . '<div>URL: ' |
|
| 130 | + . $print_data['url'] |
|
| 131 | + . "</div>\n" |
|
| 132 | + . "</div>\n" |
|
| 133 | + . "</body>\n</html>\n"; |
|
| 134 | 134 | exit(); |
@@ -17,8 +17,8 @@ discard block |
||
| 17 | 17 | include __DIR__ . '/header.php'; |
| 18 | 18 | |
| 19 | 19 | if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
| 20 | - $args['article'] = @$args_num[0]; |
|
| 21 | - $args['op'] = @$args_str[0]; |
|
| 20 | + $args['article'] = @$args_num[0]; |
|
| 21 | + $args['op'] = @$args_str[0]; |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | $article_id = Request::getInt('article', Request::getInt('article', @$args['article'], 'POST'), 'GET');//(int)(empty($_GET['article']) ? (empty($_POST['article']) ? @$args['article'] : $_POST['article']) : $_GET['article']); |
@@ -27,33 +27,33 @@ discard block |
||
| 27 | 27 | $op = strtolower(trim($op)); |
| 28 | 28 | |
| 29 | 29 | if (empty($article_id)) { |
| 30 | - if (empty(Request::getUrl('HTTP_REFERER', '', 'SERVER'))) { |
|
| 31 | - //$_SERVER['HTTP_REFERER'])) |
|
| 30 | + if (empty(Request::getUrl('HTTP_REFERER', '', 'SERVER'))) { |
|
| 31 | + //$_SERVER['HTTP_REFERER'])) |
|
| 32 | 32 | |
| 33 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
| 34 | - xoops_error(_NOPERM); |
|
| 35 | - $xoopsOption['output_type'] = 'plain'; |
|
| 36 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 37 | - exit(); |
|
| 38 | - } else { |
|
| 39 | - $ref_parser = parse_url(Request::getUrl('HTTP_REFERER', '', 'SERVER')); //$_SERVER['HTTP_REFERER']); |
|
| 40 | - $uri_parser = parse_url(Request::getUrl('REQUEST_URI', '', 'SERVER'));// $_SERVER['REQUEST_URI']); |
|
| 41 | - if ((!empty($ref_parser['host']) && !empty($uri_parser['host']) && $uri_parser['host'] != $ref_parser['host']) |
|
| 42 | - || ($ref_parser['path'] != $uri_parser['path'])) { |
|
| 43 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
| 44 | - include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
| 45 | - xoops_confirm([], 'javascript: window.close();', sprintf(planet_constant('MD_TRANSFER_DONE'), ''), _CLOSE, Request::getUrl('HTTP_REFERER', '', 'SERVER')); |
|
| 46 | - $xoopsOption['output_type'] = 'plain'; |
|
| 47 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 48 | - exit(); |
|
| 49 | - } else { |
|
| 50 | - include XOOPS_ROOT_PATH . '/header.php'; |
|
| 51 | - xoops_error(_NOPERM); |
|
| 52 | - $xoopsOption['output_type'] = 'plain'; |
|
| 53 | - include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 54 | - exit(); |
|
| 55 | - } |
|
| 56 | - } |
|
| 33 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
| 34 | + xoops_error(_NOPERM); |
|
| 35 | + $xoopsOption['output_type'] = 'plain'; |
|
| 36 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 37 | + exit(); |
|
| 38 | + } else { |
|
| 39 | + $ref_parser = parse_url(Request::getUrl('HTTP_REFERER', '', 'SERVER')); //$_SERVER['HTTP_REFERER']); |
|
| 40 | + $uri_parser = parse_url(Request::getUrl('REQUEST_URI', '', 'SERVER'));// $_SERVER['REQUEST_URI']); |
|
| 41 | + if ((!empty($ref_parser['host']) && !empty($uri_parser['host']) && $uri_parser['host'] != $ref_parser['host']) |
|
| 42 | + || ($ref_parser['path'] != $uri_parser['path'])) { |
|
| 43 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
| 44 | + include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
| 45 | + xoops_confirm([], 'javascript: window.close();', sprintf(planet_constant('MD_TRANSFER_DONE'), ''), _CLOSE, Request::getUrl('HTTP_REFERER', '', 'SERVER')); |
|
| 46 | + $xoopsOption['output_type'] = 'plain'; |
|
| 47 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 48 | + exit(); |
|
| 49 | + } else { |
|
| 50 | + include XOOPS_ROOT_PATH . '/header.php'; |
|
| 51 | + xoops_error(_NOPERM); |
|
| 52 | + $xoopsOption['output_type'] = 'plain'; |
|
| 53 | + include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 54 | + exit(); |
|
| 55 | + } |
|
| 56 | + } |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
@@ -61,37 +61,37 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | // Display option form |
| 63 | 63 | if (empty($op)) { |
| 64 | - $module_variables .= "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">"; |
|
| 65 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/option.transfer.php'; |
|
| 66 | - exit(); |
|
| 64 | + $module_variables .= "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">"; |
|
| 65 | + include XOOPS_ROOT_PATH . '/Frameworks/transfer/option.transfer.php'; |
|
| 66 | + exit(); |
|
| 67 | 67 | } else { |
| 68 | - $data = []; |
|
| 69 | - $data['id'] = $article_id; |
|
| 70 | - $data['title'] = $article_obj->getVar('art_title'); |
|
| 71 | - $data['time'] = $article_obj->getTime('l'); |
|
| 72 | - $data['image'] = ''; |
|
| 73 | - $data['source'] = $article_obj->getVar('art_link'); |
|
| 74 | - $data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id'); |
|
| 75 | - $data['author'] = $article_obj->getVar('art_author'); |
|
| 68 | + $data = []; |
|
| 69 | + $data['id'] = $article_id; |
|
| 70 | + $data['title'] = $article_obj->getVar('art_title'); |
|
| 71 | + $data['time'] = $article_obj->getTime('l'); |
|
| 72 | + $data['image'] = ''; |
|
| 73 | + $data['source'] = $article_obj->getVar('art_link'); |
|
| 74 | + $data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article_obj->getVar('art_id'); |
|
| 75 | + $data['author'] = $article_obj->getVar('art_author'); |
|
| 76 | 76 | |
| 77 | - switch ($op) { |
|
| 77 | + switch ($op) { |
|
| 78 | 78 | |
| 79 | - // Use title |
|
| 80 | - case 'bookmark': |
|
| 81 | - break; |
|
| 79 | + // Use title |
|
| 80 | + case 'bookmark': |
|
| 81 | + break; |
|
| 82 | 82 | |
| 83 | - case 'print': |
|
| 84 | - case 'pdf': |
|
| 85 | - ${"{$op}_data"} =& $data; |
|
| 86 | - ${"{$op}_data"}['date'] = $pdf_data['time']; |
|
| 87 | - ${"{$op}_data"}['content'] = $article_obj->getVar('art_content'); |
|
| 88 | - break; |
|
| 83 | + case 'print': |
|
| 84 | + case 'pdf': |
|
| 85 | + ${"{$op}_data"} =& $data; |
|
| 86 | + ${"{$op}_data"}['date'] = $pdf_data['time']; |
|
| 87 | + ${"{$op}_data"}['content'] = $article_obj->getVar('art_content'); |
|
| 88 | + break; |
|
| 89 | 89 | |
| 90 | - case 'newbb': |
|
| 91 | - default: |
|
| 92 | - $data['content'] = $article_obj->getSummary(); |
|
| 93 | - break; |
|
| 94 | - } |
|
| 95 | - include XOOPS_ROOT_PATH . '/Frameworks/transfer/action.transfer.php'; |
|
| 96 | - exit(); |
|
| 90 | + case 'newbb': |
|
| 91 | + default: |
|
| 92 | + $data['content'] = $article_obj->getSummary(); |
|
| 93 | + break; |
|
| 94 | + } |
|
| 95 | + include XOOPS_ROOT_PATH . '/Frameworks/transfer/action.transfer.php'; |
|
| 96 | + exit(); |
|
| 97 | 97 | } |
@@ -30,16 +30,16 @@ discard block |
||
| 30 | 30 | include __DIR__ . '/include/vars.php'; |
| 31 | 31 | |
| 32 | 32 | $modversion = [ |
| 33 | - 'name' => planet_constant('MI_NAME'), |
|
| 34 | - 'version' => 2.10, |
|
| 35 | - 'module_status' => 'Final', |
|
| 36 | - 'release_date' => '2016/08/01', |
|
| 37 | - 'description' => planet_constant('MI_DESC'), |
|
| 38 | - 'author' => 'D.J. (phppp)', |
|
| 39 | - 'credits' => 'XOOPS Project', |
|
| 40 | - 'image' => 'assets/images/logoModule.png', |
|
| 41 | - 'dirname' => $GLOBALS['moddirname'], |
|
| 42 | - 'help' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/readme.html' |
|
| 33 | + 'name' => planet_constant('MI_NAME'), |
|
| 34 | + 'version' => 2.10, |
|
| 35 | + 'module_status' => 'Final', |
|
| 36 | + 'release_date' => '2016/08/01', |
|
| 37 | + 'description' => planet_constant('MI_DESC'), |
|
| 38 | + 'author' => 'D.J. (phppp)', |
|
| 39 | + 'credits' => 'XOOPS Project', |
|
| 40 | + 'image' => 'assets/images/logoModule.png', |
|
| 41 | + 'dirname' => $GLOBALS['moddirname'], |
|
| 42 | + 'help' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/readme.html' |
|
| 43 | 43 | ]; |
| 44 | 44 | $modversion['help'] = 'page=help'; |
| 45 | 45 | $modversion['license'] = 'GNU see LICENSE'; |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | // database tables |
| 63 | 63 | $modversion['sqlfile']['mysql'] = 'sql/mysql.sql'; |
| 64 | 64 | $modversion['tables'] = [ |
| 65 | - $GLOBALS['MOD_DB_PREFIX'] . '_category', |
|
| 66 | - $GLOBALS['MOD_DB_PREFIX'] . '_article', |
|
| 67 | - $GLOBALS['MOD_DB_PREFIX'] . '_blog', |
|
| 68 | - $GLOBALS['MOD_DB_PREFIX'] . '_blogcat', |
|
| 69 | - $GLOBALS['MOD_DB_PREFIX'] . '_bookmark', |
|
| 70 | - $GLOBALS['MOD_DB_PREFIX'] . '_rate' |
|
| 65 | + $GLOBALS['MOD_DB_PREFIX'] . '_category', |
|
| 66 | + $GLOBALS['MOD_DB_PREFIX'] . '_article', |
|
| 67 | + $GLOBALS['MOD_DB_PREFIX'] . '_blog', |
|
| 68 | + $GLOBALS['MOD_DB_PREFIX'] . '_blogcat', |
|
| 69 | + $GLOBALS['MOD_DB_PREFIX'] . '_bookmark', |
|
| 70 | + $GLOBALS['MOD_DB_PREFIX'] . '_rate' |
|
| 71 | 71 | ]; |
| 72 | 72 | |
| 73 | 73 | // Admin things |
@@ -149,162 +149,162 @@ discard block |
||
| 149 | 149 | // Configs |
| 150 | 150 | // Config items |
| 151 | 151 | $modversion['config'][] = [ |
| 152 | - 'name' => 'do_debug', |
|
| 153 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DODEBUG', |
|
| 154 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DODEBUG_DESC', |
|
| 155 | - 'formtype' => 'yesno', |
|
| 156 | - 'valuetype' => 'int', |
|
| 157 | - 'default' => 1 |
|
| 152 | + 'name' => 'do_debug', |
|
| 153 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DODEBUG', |
|
| 154 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DODEBUG_DESC', |
|
| 155 | + 'formtype' => 'yesno', |
|
| 156 | + 'valuetype' => 'int', |
|
| 157 | + 'default' => 1 |
|
| 158 | 158 | ]; |
| 159 | 159 | |
| 160 | 160 | $modversion['config'][] = [ |
| 161 | - 'name' => 'do_urw', |
|
| 162 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOURLREWRITE', |
|
| 163 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOURLREWRITE_DESC', |
|
| 164 | - 'formtype' => 'yesno', |
|
| 165 | - 'valuetype' => 'int', |
|
| 166 | - 'default' => in_array(php_sapi_name(), ['apache', 'apache2handler']) |
|
| 161 | + 'name' => 'do_urw', |
|
| 162 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOURLREWRITE', |
|
| 163 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOURLREWRITE_DESC', |
|
| 164 | + 'formtype' => 'yesno', |
|
| 165 | + 'valuetype' => 'int', |
|
| 166 | + 'default' => in_array(php_sapi_name(), ['apache', 'apache2handler']) |
|
| 167 | 167 | ]; |
| 168 | 168 | |
| 169 | 169 | $modversion['config'][] = [ |
| 170 | - 'name' => 'theme_set', |
|
| 171 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_THEMESET', |
|
| 172 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_THEMESET_DESC', |
|
| 173 | - 'formtype' => 'select', |
|
| 174 | - 'valuetype' => 'text', |
|
| 175 | - 'options' => [_NONE => '0'], |
|
| 176 | - 'default' => '' |
|
| 170 | + 'name' => 'theme_set', |
|
| 171 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_THEMESET', |
|
| 172 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_THEMESET_DESC', |
|
| 173 | + 'formtype' => 'select', |
|
| 174 | + 'valuetype' => 'text', |
|
| 175 | + 'options' => [_NONE => '0'], |
|
| 176 | + 'default' => '' |
|
| 177 | 177 | ]; |
| 178 | 178 | |
| 179 | 179 | $modversion['config'][] = [ |
| 180 | - 'name' => 'timeformat', |
|
| 181 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_TIMEFORMAT', |
|
| 182 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_TIMEFORMAT_DESC', |
|
| 183 | - 'formtype' => 'select', |
|
| 184 | - 'valuetype' => 'text', |
|
| 185 | - 'options' => [ |
|
| 186 | - _DATESTRING => 'l', |
|
| 187 | - _MEDIUMDATESTRING => 'm', |
|
| 188 | - _SHORTDATESTRING => 's', |
|
| 189 | - $GLOBALS['VAR_PREFIXU'] . '_MI_TIMEFORMAT_CUSTOM' => 'c' |
|
| 190 | - ], |
|
| 191 | - 'default' => 'c' |
|
| 180 | + 'name' => 'timeformat', |
|
| 181 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_TIMEFORMAT', |
|
| 182 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_TIMEFORMAT_DESC', |
|
| 183 | + 'formtype' => 'select', |
|
| 184 | + 'valuetype' => 'text', |
|
| 185 | + 'options' => [ |
|
| 186 | + _DATESTRING => 'l', |
|
| 187 | + _MEDIUMDATESTRING => 'm', |
|
| 188 | + _SHORTDATESTRING => 's', |
|
| 189 | + $GLOBALS['VAR_PREFIXU'] . '_MI_TIMEFORMAT_CUSTOM' => 'c' |
|
| 190 | + ], |
|
| 191 | + 'default' => 'c' |
|
| 192 | 192 | ]; |
| 193 | 193 | |
| 194 | 194 | $modversion['config'][] = [ |
| 195 | - 'name' => 'articles_perpage', |
|
| 196 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLESPERPAGE', |
|
| 197 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLESPERPAGE_DESC', |
|
| 198 | - 'formtype' => 'textbox', |
|
| 199 | - 'valuetype' => 'int', |
|
| 200 | - 'default' => 10 |
|
| 195 | + 'name' => 'articles_perpage', |
|
| 196 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLESPERPAGE', |
|
| 197 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLESPERPAGE_DESC', |
|
| 198 | + 'formtype' => 'textbox', |
|
| 199 | + 'valuetype' => 'int', |
|
| 200 | + 'default' => 10 |
|
| 201 | 201 | ]; |
| 202 | 202 | |
| 203 | 203 | $modversion['config'][] = [ |
| 204 | - 'name' => 'list_perpage', |
|
| 205 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_LISTPERPAGE', |
|
| 206 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_LISTPERPAGE_DESC', |
|
| 207 | - 'formtype' => 'textbox', |
|
| 208 | - 'valuetype' => 'int', |
|
| 209 | - 'default' => 20 |
|
| 204 | + 'name' => 'list_perpage', |
|
| 205 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_LISTPERPAGE', |
|
| 206 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_LISTPERPAGE_DESC', |
|
| 207 | + 'formtype' => 'textbox', |
|
| 208 | + 'valuetype' => 'int', |
|
| 209 | + 'default' => 20 |
|
| 210 | 210 | ]; |
| 211 | 211 | |
| 212 | 212 | $modversion['config'][] = [ |
| 213 | - 'name' => 'blogs_perupdate', |
|
| 214 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_BLOGSPERUPDATE', |
|
| 215 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_BLOGSPERUPDATE_DESC', |
|
| 216 | - 'formtype' => 'textbox', |
|
| 217 | - 'valuetype' => 'int', |
|
| 218 | - 'default' => 10 |
|
| 213 | + 'name' => 'blogs_perupdate', |
|
| 214 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_BLOGSPERUPDATE', |
|
| 215 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_BLOGSPERUPDATE_DESC', |
|
| 216 | + 'formtype' => 'textbox', |
|
| 217 | + 'valuetype' => 'int', |
|
| 218 | + 'default' => 10 |
|
| 219 | 219 | ]; |
| 220 | 220 | |
| 221 | 221 | $modversion['config'][] = [ |
| 222 | - 'name' => 'article_expire', |
|
| 223 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLE_EXPIRE', |
|
| 224 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLE_EXPIRE_DESC', |
|
| 225 | - 'formtype' => 'textbox', |
|
| 226 | - 'valuetype' => 'int', |
|
| 227 | - 'default' => 30 |
|
| 222 | + 'name' => 'article_expire', |
|
| 223 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLE_EXPIRE', |
|
| 224 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLE_EXPIRE_DESC', |
|
| 225 | + 'formtype' => 'textbox', |
|
| 226 | + 'valuetype' => 'int', |
|
| 227 | + 'default' => 30 |
|
| 228 | 228 | ]; |
| 229 | 229 | |
| 230 | 230 | $modversion['config'][] = [ |
| 231 | - 'name' => 'display_summary', |
|
| 232 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DISPLAY_SUMMARY', |
|
| 233 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DISPLAY_SUMMARY_DESC', |
|
| 234 | - 'formtype' => 'textbox', |
|
| 235 | - 'valuetype' => 'int', |
|
| 236 | - 'default' => 0 |
|
| 231 | + 'name' => 'display_summary', |
|
| 232 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DISPLAY_SUMMARY', |
|
| 233 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DISPLAY_SUMMARY_DESC', |
|
| 234 | + 'formtype' => 'textbox', |
|
| 235 | + 'valuetype' => 'int', |
|
| 236 | + 'default' => 0 |
|
| 237 | 237 | ]; |
| 238 | 238 | |
| 239 | 239 | $modversion['config'][] = [ |
| 240 | - 'name' => 'do_sibling', |
|
| 241 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOSIBLING', |
|
| 242 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOSIBLING_DESC', |
|
| 243 | - 'formtype' => 'yesno', |
|
| 244 | - 'valuetype' => 'int', |
|
| 245 | - 'default' => 1 |
|
| 240 | + 'name' => 'do_sibling', |
|
| 241 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOSIBLING', |
|
| 242 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOSIBLING_DESC', |
|
| 243 | + 'formtype' => 'yesno', |
|
| 244 | + 'valuetype' => 'int', |
|
| 245 | + 'default' => 1 |
|
| 246 | 246 | ]; |
| 247 | 247 | |
| 248 | 248 | $modversion['config'][] = [ |
| 249 | - 'name' => 'pings', |
|
| 250 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_PING', |
|
| 251 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_PING_DESC', |
|
| 252 | - 'formtype' => 'textarea', |
|
| 253 | - 'valuetype' => 'text', |
|
| 254 | - 'default' => '' |
|
| 249 | + 'name' => 'pings', |
|
| 250 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_PING', |
|
| 251 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_PING_DESC', |
|
| 252 | + 'formtype' => 'textarea', |
|
| 253 | + 'valuetype' => 'text', |
|
| 254 | + 'default' => '' |
|
| 255 | 255 | ]; |
| 256 | 256 | |
| 257 | 257 | $modversion['config'][] = [ |
| 258 | - 'name' => 'trackback_option', |
|
| 259 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_TRACKBACK_OPTION', |
|
| 260 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_TRACKBACK_OPTION_DESC', |
|
| 261 | - 'formtype' => 'select', |
|
| 262 | - 'valuetype' => 'int', |
|
| 263 | - 'default' => 0, |
|
| 264 | - 'options' => [planet_constant('MI_MODERATION') => 0, _ALL => 1, _NONE => 2] |
|
| 258 | + 'name' => 'trackback_option', |
|
| 259 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_TRACKBACK_OPTION', |
|
| 260 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_TRACKBACK_OPTION_DESC', |
|
| 261 | + 'formtype' => 'select', |
|
| 262 | + 'valuetype' => 'int', |
|
| 263 | + 'default' => 0, |
|
| 264 | + 'options' => [planet_constant('MI_MODERATION') => 0, _ALL => 1, _NONE => 2] |
|
| 265 | 265 | ]; |
| 266 | 266 | |
| 267 | 267 | $modversion['config'][] = [ |
| 268 | - 'name' => 'copyright', |
|
| 269 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_COPYRIGHT', |
|
| 270 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_COPYRIGHT_DESC', |
|
| 271 | - 'formtype' => 'textbox', |
|
| 272 | - 'valuetype' => 'text', |
|
| 273 | - 'default' => 'Copyright© %s & ' . $xoopsConfig['sitename'] |
|
| 268 | + 'name' => 'copyright', |
|
| 269 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_COPYRIGHT', |
|
| 270 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_COPYRIGHT_DESC', |
|
| 271 | + 'formtype' => 'textbox', |
|
| 272 | + 'valuetype' => 'text', |
|
| 273 | + 'default' => 'Copyright© %s & ' . $xoopsConfig['sitename'] |
|
| 274 | 274 | ]; |
| 275 | 275 | |
| 276 | 276 | $modversion['config'][] = [ |
| 277 | - 'name' => 'newblog_submit', |
|
| 278 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_NEWBLOG_SUBMIT', |
|
| 279 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_NEWBLOG_SUBMIT_DESC', |
|
| 280 | - 'formtype' => 'select', |
|
| 281 | - 'valuetype' => 'int', |
|
| 282 | - 'default' => 2, |
|
| 283 | - 'options' => [ |
|
| 284 | - _NONE => 0, |
|
| 285 | - planet_constant('MI_MODERATION') => 1, |
|
| 286 | - planet_constant('MI_MEMBER') => 2, |
|
| 287 | - _ALL => 3 |
|
| 288 | - ] |
|
| 289 | - // 0 - Only admin; 1 - all but need approval; 2 - members auto approved; 3 - all |
|
| 277 | + 'name' => 'newblog_submit', |
|
| 278 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_NEWBLOG_SUBMIT', |
|
| 279 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_NEWBLOG_SUBMIT_DESC', |
|
| 280 | + 'formtype' => 'select', |
|
| 281 | + 'valuetype' => 'int', |
|
| 282 | + 'default' => 2, |
|
| 283 | + 'options' => [ |
|
| 284 | + _NONE => 0, |
|
| 285 | + planet_constant('MI_MODERATION') => 1, |
|
| 286 | + planet_constant('MI_MEMBER') => 2, |
|
| 287 | + _ALL => 3 |
|
| 288 | + ] |
|
| 289 | + // 0 - Only admin; 1 - all but need approval; 2 - members auto approved; 3 - all |
|
| 290 | 290 | ]; |
| 291 | 291 | |
| 292 | 292 | $modversion['config'][] = [ |
| 293 | - 'name' => 'anonymous_rate', |
|
| 294 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_ANONYMOUSRATE', |
|
| 295 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_ANONYMOUSRATE_DESC', |
|
| 296 | - 'formtype' => 'yesno', |
|
| 297 | - 'valuetype' => 'int', |
|
| 298 | - 'default' => 0 |
|
| 293 | + 'name' => 'anonymous_rate', |
|
| 294 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_ANONYMOUSRATE', |
|
| 295 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_ANONYMOUSRATE_DESC', |
|
| 296 | + 'formtype' => 'yesno', |
|
| 297 | + 'valuetype' => 'int', |
|
| 298 | + 'default' => 0 |
|
| 299 | 299 | ]; |
| 300 | 300 | |
| 301 | 301 | $modversion['config'][] = [ |
| 302 | - 'name' => 'do_pseudocron', |
|
| 303 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_PSEUDOCRON', |
|
| 304 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_PSEUDOCRON_DESC', |
|
| 305 | - 'formtype' => 'yesno', |
|
| 306 | - 'valuetype' => 'int', |
|
| 307 | - 'default' => 1 |
|
| 302 | + 'name' => 'do_pseudocron', |
|
| 303 | + 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_PSEUDOCRON', |
|
| 304 | + 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_PSEUDOCRON_DESC', |
|
| 305 | + 'formtype' => 'yesno', |
|
| 306 | + 'valuetype' => 'int', |
|
| 307 | + 'default' => 1 |
|
| 308 | 308 | ]; |
| 309 | 309 | |
| 310 | 310 | // Notification |
@@ -32,51 +32,51 @@ |
||
| 32 | 32 | include __DIR__ . '/header.php'; |
| 33 | 33 | global $pdf_data; |
| 34 | 34 | if (!empty($_POST['pdf_data'])) { |
| 35 | - $pdf_data = unserialize(base64_decode(Request::getText('pdf_data', '', 'POST'))); |
|
| 35 | + $pdf_data = unserialize(base64_decode(Request::getText('pdf_data', '', 'POST'))); |
|
| 36 | 36 | } elseif (!empty($pdf_data)) { |
| 37 | 37 | } else { |
| 38 | - error_reporting(0); |
|
| 39 | - include __DIR__ . '/header.php'; |
|
| 40 | - error_reporting(0); |
|
| 38 | + error_reporting(0); |
|
| 39 | + include __DIR__ . '/header.php'; |
|
| 40 | + error_reporting(0); |
|
| 41 | 41 | |
| 42 | - if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
|
| 43 | - $args['article'] = @$args_num[0]; |
|
| 44 | - } |
|
| 42 | + if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
|
| 43 | + $args['article'] = @$args_num[0]; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
| 46 | + $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
| 47 | 47 | |
| 48 | - $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 49 | - $article_obj = $articleHandler->get($article_id); |
|
| 48 | + $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 49 | + $article_obj = $articleHandler->get($article_id); |
|
| 50 | 50 | |
| 51 | - $article_data = []; |
|
| 51 | + $article_data = []; |
|
| 52 | 52 | |
| 53 | - // title |
|
| 54 | - $article_data['title'] = $article_obj->getVar('art_title'); |
|
| 53 | + // title |
|
| 54 | + $article_data['title'] = $article_obj->getVar('art_title'); |
|
| 55 | 55 | |
| 56 | - $article_data['author'] = $article_obj->getVar('art_author'); |
|
| 56 | + $article_data['author'] = $article_obj->getVar('art_author'); |
|
| 57 | 57 | |
| 58 | - // source |
|
| 59 | - $article_data['source'] = $article_obj->getVar('art_link'); |
|
| 58 | + // source |
|
| 59 | + $article_data['source'] = $article_obj->getVar('art_link'); |
|
| 60 | 60 | |
| 61 | - // publish time |
|
| 62 | - $article_data['time'] = $article_obj->getTime(); |
|
| 61 | + // publish time |
|
| 62 | + $article_data['time'] = $article_obj->getTime(); |
|
| 63 | 63 | |
| 64 | - // summary |
|
| 65 | - $article_data['summary'] = $article_obj->getSummary(); |
|
| 64 | + // summary |
|
| 65 | + $article_data['summary'] = $article_obj->getSummary(); |
|
| 66 | 66 | |
| 67 | - // text of page |
|
| 68 | - $article_data['text'] = $article_obj->getVar('art_content'); |
|
| 67 | + // text of page |
|
| 68 | + $article_data['text'] = $article_obj->getVar('art_content'); |
|
| 69 | 69 | |
| 70 | - // Build the pdf_data array |
|
| 71 | - $pdf_data['title'] = $article_data['title']; |
|
| 72 | - $pdf_data['author'] = $article_data['author']; |
|
| 73 | - $pdf_data['date'] = $article_data['time']; |
|
| 74 | - $pdf_data['content'] = ''; |
|
| 75 | - if ($article_data['summary']) { |
|
| 76 | - $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
| 77 | - } |
|
| 78 | - $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
| 79 | - $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER . $article_obj->getVar('art_id'); |
|
| 70 | + // Build the pdf_data array |
|
| 71 | + $pdf_data['title'] = $article_data['title']; |
|
| 72 | + $pdf_data['author'] = $article_data['author']; |
|
| 73 | + $pdf_data['date'] = $article_data['time']; |
|
| 74 | + $pdf_data['content'] = ''; |
|
| 75 | + if ($article_data['summary']) { |
|
| 76 | + $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
| 77 | + } |
|
| 78 | + $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
| 79 | + $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER . $article_obj->getVar('art_id'); |
|
| 80 | 80 | } |
| 81 | 81 | $pdf_data['filename'] = preg_replace("/[^0-9a-z\-_\.]/i", '', $pdf_data['title']); |
| 82 | 82 | |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | |
| 25 | 25 | $moduleDirName = basename(dirname(__DIR__)); |
| 26 | 26 | $uploadFolders = [ |
| 27 | - NEWBB_UPLOAD_PATH, |
|
| 28 | - NEWBB_UPLOAD_PATH . '/thumbs' |
|
| 27 | + NEWBB_UPLOAD_PATH, |
|
| 28 | + NEWBB_UPLOAD_PATH . '/thumbs' |
|
| 29 | 29 | ]; |
| 30 | 30 | |
| 31 | 31 | //$copyFiles = array( |
@@ -32,88 +32,88 @@ |
||
| 32 | 32 | |
| 33 | 33 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 34 | 34 | if (!defined('PLANET_INI')) { |
| 35 | - exit(); |
|
| 35 | + exit(); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | if (!defined('PLANET_FUNCTIONS_INI')): |
| 39 | - define('PLANET_FUNCTIONS_INI', 1); |
|
| 39 | + define('PLANET_FUNCTIONS_INI', 1); |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * @param $name |
|
| 43 | - * @return mixed |
|
| 44 | - */ |
|
| 45 | - function planet_constant($name) |
|
| 46 | - { |
|
| 47 | - return mod_constant($name); |
|
| 48 | - } |
|
| 41 | + /** |
|
| 42 | + * @param $name |
|
| 43 | + * @return mixed |
|
| 44 | + */ |
|
| 45 | + function planet_constant($name) |
|
| 46 | + { |
|
| 47 | + return mod_constant($name); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * @param $name |
|
| 52 | - * @param bool $isRel |
|
| 53 | - * @return string |
|
| 54 | - */ |
|
| 55 | - function planet_DB_prefix($name, $isRel = false) |
|
| 56 | - { |
|
| 57 | - return mod_DB_prefix($name, $isRel); |
|
| 58 | - } |
|
| 50 | + /** |
|
| 51 | + * @param $name |
|
| 52 | + * @param bool $isRel |
|
| 53 | + * @return string |
|
| 54 | + */ |
|
| 55 | + function planet_DB_prefix($name, $isRel = false) |
|
| 56 | + { |
|
| 57 | + return mod_DB_prefix($name, $isRel); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * @return bool |
|
| 62 | - */ |
|
| 63 | - function planet_load_object() |
|
| 64 | - { |
|
| 65 | - return load_object(); |
|
| 66 | - } |
|
| 60 | + /** |
|
| 61 | + * @return bool |
|
| 62 | + */ |
|
| 63 | + function planet_load_object() |
|
| 64 | + { |
|
| 65 | + return load_object(); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * @return array|mixed |
|
| 70 | - */ |
|
| 71 | - function planet_load_config() |
|
| 72 | - { |
|
| 73 | - static $moduleConfig; |
|
| 74 | - if (isset($moduleConfig)) { |
|
| 75 | - return $moduleConfig; |
|
| 76 | - } |
|
| 68 | + /** |
|
| 69 | + * @return array|mixed |
|
| 70 | + */ |
|
| 71 | + function planet_load_config() |
|
| 72 | + { |
|
| 73 | + static $moduleConfig; |
|
| 74 | + if (isset($moduleConfig)) { |
|
| 75 | + return $moduleConfig; |
|
| 76 | + } |
|
| 77 | 77 | |
| 78 | - if (is_object($GLOBALS['xoopsModule']) |
|
| 79 | - && $GLOBALS['xoopsModule']->getVar('dirname') == $GLOBALS['moddirname']) { |
|
| 80 | - if (isset($GLOBALS['xoopsModuleConfig'])) { |
|
| 81 | - $moduleConfig = $GLOBALS['xoopsModuleConfig']; |
|
| 82 | - } |
|
| 83 | - } else { |
|
| 84 | - /** @var XoopsModuleHandler $moduleHandler */ |
|
| 85 | - $moduleHandler = xoops_getHandler('module'); |
|
| 86 | - $module = $moduleHandler->getByDirname($GLOBALS['moddirname']); |
|
| 78 | + if (is_object($GLOBALS['xoopsModule']) |
|
| 79 | + && $GLOBALS['xoopsModule']->getVar('dirname') == $GLOBALS['moddirname']) { |
|
| 80 | + if (isset($GLOBALS['xoopsModuleConfig'])) { |
|
| 81 | + $moduleConfig = $GLOBALS['xoopsModuleConfig']; |
|
| 82 | + } |
|
| 83 | + } else { |
|
| 84 | + /** @var XoopsModuleHandler $moduleHandler */ |
|
| 85 | + $moduleHandler = xoops_getHandler('module'); |
|
| 86 | + $module = $moduleHandler->getByDirname($GLOBALS['moddirname']); |
|
| 87 | 87 | |
| 88 | - $configHandler = xoops_getHandler('config'); |
|
| 89 | - $criteria = new CriteriaCompo(new Criteria('conf_modid', $module->getVar('mid'))); |
|
| 90 | - $configs = $configHandler->getConfigs($criteria); |
|
| 91 | - foreach (array_keys($configs) as $i) { |
|
| 92 | - $moduleConfig[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput(); |
|
| 93 | - } |
|
| 94 | - unset($configs); |
|
| 95 | - } |
|
| 96 | - if ($customConfig = @include XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/plugin.php') { |
|
| 97 | - $moduleConfig = array_merge($moduleConfig, $customConfig); |
|
| 98 | - } |
|
| 88 | + $configHandler = xoops_getHandler('config'); |
|
| 89 | + $criteria = new CriteriaCompo(new Criteria('conf_modid', $module->getVar('mid'))); |
|
| 90 | + $configs = $configHandler->getConfigs($criteria); |
|
| 91 | + foreach (array_keys($configs) as $i) { |
|
| 92 | + $moduleConfig[$configs[$i]->getVar('conf_name')] = $configs[$i]->getConfValueForOutput(); |
|
| 93 | + } |
|
| 94 | + unset($configs); |
|
| 95 | + } |
|
| 96 | + if ($customConfig = @include XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/plugin.php') { |
|
| 97 | + $moduleConfig = array_merge($moduleConfig, $customConfig); |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - return $moduleConfig; |
|
| 101 | - } |
|
| 100 | + return $moduleConfig; |
|
| 101 | + } |
|
| 102 | 102 | |
| 103 | - function planet_define_url_delimiter() |
|
| 104 | - { |
|
| 105 | - if (defined('URL_DELIMITER')) { |
|
| 106 | - if (!in_array(URL_DELIMITER, ['?', '/'])) { |
|
| 107 | - die('Exit on security'); |
|
| 108 | - } |
|
| 109 | - } else { |
|
| 110 | - $moduleConfig = planet_load_config(); |
|
| 111 | - if (empty($moduleConfig['do_urw'])) { |
|
| 112 | - define('URL_DELIMITER', '?'); |
|
| 113 | - } else { |
|
| 114 | - define('URL_DELIMITER', '/'); |
|
| 115 | - } |
|
| 116 | - } |
|
| 117 | - } |
|
| 103 | + function planet_define_url_delimiter() |
|
| 104 | + { |
|
| 105 | + if (defined('URL_DELIMITER')) { |
|
| 106 | + if (!in_array(URL_DELIMITER, ['?', '/'])) { |
|
| 107 | + die('Exit on security'); |
|
| 108 | + } |
|
| 109 | + } else { |
|
| 110 | + $moduleConfig = planet_load_config(); |
|
| 111 | + if (empty($moduleConfig['do_urw'])) { |
|
| 112 | + define('URL_DELIMITER', '?'); |
|
| 113 | + } else { |
|
| 114 | + define('URL_DELIMITER', '/'); |
|
| 115 | + } |
|
| 116 | + } |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | 119 | endif; |
@@ -43,28 +43,28 @@ |
||
| 43 | 43 | $categories_option = $categoryHandler->getList(); |
| 44 | 44 | natsort($categories_option); |
| 45 | 45 | if (count($categories_option)) { |
| 46 | - $cat_option_tray = new XoopsFormElementTray(planet_constant('MD_CATEGORY'), '<br>'); |
|
| 47 | - $options = [0 => _NONE]; |
|
| 48 | - foreach ($categories_option as $id => $title) { |
|
| 49 | - $options[$id] = $title; |
|
| 50 | - } |
|
| 51 | - $cat_select = new XoopsFormSelect('', 'categories', $categories, 3, true); |
|
| 52 | - $cat_select->addOptionArray($options); |
|
| 53 | - $cat_option_tray->addElement($cat_select); |
|
| 54 | - $form->addElement($cat_option_tray); |
|
| 46 | + $cat_option_tray = new XoopsFormElementTray(planet_constant('MD_CATEGORY'), '<br>'); |
|
| 47 | + $options = [0 => _NONE]; |
|
| 48 | + foreach ($categories_option as $id => $title) { |
|
| 49 | + $options[$id] = $title; |
|
| 50 | + } |
|
| 51 | + $cat_select = new XoopsFormSelect('', 'categories', $categories, 3, true); |
|
| 52 | + $cat_select->addOptionArray($options); |
|
| 53 | + $cat_option_tray->addElement($cat_select); |
|
| 54 | + $form->addElement($cat_option_tray); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /* For admin only */ |
| 58 | 58 | if (is_object($xoopsUser) && $xoopsUser->isAdmin()) { |
| 59 | - $status_option_tray = new XoopsFormElementTray(planet_constant('MD_STATUS'), '<br>'); |
|
| 60 | - $status_select = new XoopsFormSelect('', 'blog_status', $blog_obj->getVar('blog_status')); |
|
| 61 | - $status_select->addOptionArray([ |
|
| 62 | - '0' => planet_constant('MD_PENDING'), |
|
| 63 | - '1' => planet_constant('MD_ACTIVE'), |
|
| 64 | - '2' => planet_constant('MD_FEATURED') |
|
| 65 | - ]); |
|
| 66 | - $status_option_tray->addElement($status_select); |
|
| 67 | - $form->addElement($status_option_tray); |
|
| 59 | + $status_option_tray = new XoopsFormElementTray(planet_constant('MD_STATUS'), '<br>'); |
|
| 60 | + $status_select = new XoopsFormSelect('', 'blog_status', $blog_obj->getVar('blog_status')); |
|
| 61 | + $status_select->addOptionArray([ |
|
| 62 | + '0' => planet_constant('MD_PENDING'), |
|
| 63 | + '1' => planet_constant('MD_ACTIVE'), |
|
| 64 | + '2' => planet_constant('MD_FEATURED') |
|
| 65 | + ]); |
|
| 66 | + $status_option_tray->addElement($status_select); |
|
| 67 | + $form->addElement($status_option_tray); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $form->addElement(new XoopsFormHidden('blog', $blog_id)); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 16 | 16 | |
| 17 | 17 | if (!@require_once XOOPS_ROOT_PATH . '/Frameworks/transfer/transfer.php') { |
| 18 | - return null; |
|
| 18 | + return null; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | // Specify the addons to skip for the module |
@@ -28,41 +28,41 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | class ModuleTransferHandler extends TransferHandler |
| 30 | 30 | { |
| 31 | - /** |
|
| 32 | - * ModuleTransferHandler constructor. |
|
| 33 | - */ |
|
| 34 | - public function __construct() |
|
| 35 | - { |
|
| 36 | - parent::__construct(); |
|
| 37 | - } |
|
| 31 | + /** |
|
| 32 | + * ModuleTransferHandler constructor. |
|
| 33 | + */ |
|
| 34 | + public function __construct() |
|
| 35 | + { |
|
| 36 | + parent::__construct(); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Get valid addon list |
|
| 41 | - * |
|
| 42 | - * @param array $skip Addons to skip |
|
| 43 | - * @param boolean $sort To sort the list upon 'level' |
|
| 44 | - * return array $list |
|
| 45 | - */ |
|
| 46 | - public function &getList($skip = [], $sort = true) |
|
| 47 | - { |
|
| 48 | - $list = parent::getList($skip, $sort); |
|
| 39 | + /** |
|
| 40 | + * Get valid addon list |
|
| 41 | + * |
|
| 42 | + * @param array $skip Addons to skip |
|
| 43 | + * @param boolean $sort To sort the list upon 'level' |
|
| 44 | + * return array $list |
|
| 45 | + */ |
|
| 46 | + public function &getList($skip = [], $sort = true) |
|
| 47 | + { |
|
| 48 | + $list = parent::getList($skip, $sort); |
|
| 49 | 49 | |
| 50 | - return $list; |
|
| 51 | - } |
|
| 50 | + return $list; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * If need change config of an item |
|
| 55 | - * 1 parent::load_item |
|
| 56 | - * 2 $this->config |
|
| 57 | - * 3 $this->do_transfer |
|
| 58 | - * @param $item |
|
| 59 | - * @param $data |
|
| 60 | - * @return |
|
| 61 | - */ |
|
| 62 | - public function do_transfer($item, &$data) |
|
| 63 | - { |
|
| 64 | - $ret = parent::do_transfer($item, $data); |
|
| 53 | + /** |
|
| 54 | + * If need change config of an item |
|
| 55 | + * 1 parent::load_item |
|
| 56 | + * 2 $this->config |
|
| 57 | + * 3 $this->do_transfer |
|
| 58 | + * @param $item |
|
| 59 | + * @param $data |
|
| 60 | + * @return |
|
| 61 | + */ |
|
| 62 | + public function do_transfer($item, &$data) |
|
| 63 | + { |
|
| 64 | + $ret = parent::do_transfer($item, $data); |
|
| 65 | 65 | |
| 66 | - return $ret; |
|
| 67 | - } |
|
| 66 | + return $ret; |
|
| 67 | + } |
|
| 68 | 68 | } |