Esempio n. 1
0
$available_plugins = \Xoops\Module\Plugin::getPlugins('comments');
if (!empty($available_plugins)) {
    $criteria = new Criteria('dirname', "('" . implode("','", array_keys($available_plugins)) . "')", 'IN');
    $module_array = $module_handler->getNameList($criteria);
}
$module_array[0] = _AM_COMMENTS_FORM_ALL_MODS;
$comment_handler = $helper->getHandlerComment();
switch ($op) {
    case 'comments_jump':
        $id = $system->cleanVars($_GET, 'item_id', 0, 'int');
        if ($id > 0) {
            $comment = $comment_handler->get($id);
            if (is_object($comment)) {
                /* @var $plugin CommentsPluginInterface */
                $module = $xoops->getModuleById($comment->getVar('modid'));
                $plugin = Xoops\Module\Plugin::getPlugin($module->getVar('dirname'), 'comments');
                header('Location: ' . \XoopsBaseConfig::get('url') . '/modules/' . $module->getVar('dirname') . '/' . $plugin->pageName() . '?' . $plugin->itemName() . '=' . $comment->getVar('itemid') . '&id=' . $comment->getVar('id') . '&rootid=' . $comment->getVar('rootid') . '&mode=thread&' . str_replace('&', '&', $comment->getVar('exparams')) . '#comment' . $comment->getVar('id'));
                exit;
            }
        }
        $helper->redirect('admin/main.php', 1, _AM_COMMENTS_NO_COMMENTS);
        break;
    case 'comments_form_purge':
        //Affichage du formulaire de purge
        $form_purge = new Xoops\Form\ThemeForm(_AM_COMMENTS_FORM_PURGE, 'form', $helper->url('admin/main.php'), 'post', true);
        $form_purge->addElement(new Xoops\Form\DateSelect(_AM_COMMENTS_FORM_PURGE_DATE_AFTER, 'comments_after', '15'));
        $form_purge->addElement(new Xoops\Form\DateSelect(_AM_COMMENTS_FORM_PURGE_DATE_BEFORE, 'comments_before', '15'));
        //user
        $form_purge->addElement(new Xoops\Form\SelectUser(_AM_COMMENTS_FORM_PURGE_USER, "comments_userid", false, @$_REQUEST['comments_userid'], 5, true));
        //groups
        $groupe_select = new Xoops\Form\SelectGroup(_AM_COMMENTS_FORM_PURGE_GROUPS, "comments_groupe", false, '', 5, true);
Esempio n. 2
0
 $tpl->assign('channel_lastbuild', XoopsLocale::formatTimestamp(time(), 'rss'));
 $tpl->assign('channel_webmaster', $xoops->checkEmail($xoops->getConfig('adminmail'), true));
 $tpl->assign('channel_editor', $xoops->checkEmail($xoops->getConfig('adminmail'), true));
 $tpl->assign('channel_category', 'News');
 $tpl->assign('channel_generator', 'XOOPS');
 $tpl->assign('channel_language', XoopsLocale::getLangCode());
 $xoTheme = $xoops->theme();
 $imgPath = $xoTheme->resourcePath('/images/logo.png');
 $tpl->assign('image_url', $xoops->url($imgPath));
 $dimension = getimagesize($xoops->path($imgPath));
 $tpl->assign('image_width', $dimension[0]);
 $tpl->assign('image_height', $dimension[1]);
 $items = array();
 if ($xoops->isModule()) {
     /* @var $plugin SystemPluginInterface */
     $plugin = Xoops\Module\Plugin::getPlugin($dirname, 'system');
     $res = $plugin->backend(10);
     if (is_array($res) && count($res) > 0) {
         foreach ($res as $item) {
             $date[] = array('date' => $item['date']);
             $items[] = array('date' => XoopsLocale::formatTimestamp($item['date'], 'rss'), 'title' => $myts->htmlSpecialChars($item['title']), 'content' => $myts->htmlSpecialChars($item['content']), 'link' => $item['link'], 'guid' => $item['link']);
         }
     }
 } else {
     $plugins = Xoops\Module\Plugin::getPlugins('system');
     /* @var $plugin SystemPluginInterface */
     foreach ($plugins as $plugin) {
         $res = $plugin->backend(10);
         if (is_array($res) && count($res) > 0) {
             foreach ($res as $item) {
                 $date[] = array('date' => $item['date']);