示例#1
0
$modversion['config'][27]['formtype'] = 'textbox';
$modversion['config'][27]['valuetype'] = 'text';
$modversion['config'][27]['default'] = '/usr/sbin/sendmail -bs';
$modversion['config'][28]['name'] = 'rss_enable';
$modversion['config'][28]['title'] = '_MI_RMC_RSSENABLE';
$modversion['config'][28]['description'] = '';
$modversion['config'][28]['formtype'] = 'yesno';
$modversion['config'][28]['valuetype'] = 'int';
$modversion['config'][28]['default'] = 1;
$modversion['config'][29]['name'] = 'blocks_enable';
$modversion['config'][29]['title'] = '_MI_RMC_BLOCKSENABLE';
$modversion['config'][29]['description'] = '';
$modversion['config'][29]['formtype'] = 'yesno';
$modversion['config'][29]['valuetype'] = 'int';
$modversion['config'][29]['default'] = 0;
$modversion['blocks'][] = array('file' => "comments.php", 'name' => __('Comments', 'rmcommon'), 'description' => __('Show comments from internal comments system', 'rmcommon'), 'show_func' => "rmc_bkcomments_show", 'edit_func' => "rmc_bkcomments_edit", 'template' => 'rmc_bk_comments.html', 'options' => "5|1|1|1|1");
$modversion['blocks'][] = array('file' => "custom.php", 'name' => __('Custom Block', 'rmcommon'), 'description' => __('Allows to create a block with custom content.', 'rmcommon'), 'show_func' => "", 'type' => 'custom');
$amod = xoops_getActiveModules();
if (in_array("rmcommon", $amod)) {
    $plugins = RMFunctions::installed_plugins();
    foreach ($plugins as $plugin) {
        $p = RMFunctions::load_plugin($plugin);
        if (!method_exists($p, 'blocks')) {
            continue;
        }
        foreach ($p->blocks() as $block) {
            $block['plugin'] = 1;
            $modversion['blocks'][] = $block;
        }
    }
}
示例#2
0
function rd_section_forpdf($all = 0)
{
    global $section, $res, $xoopsConfig, $xoopsModuleConfig;
    $plugin = RMFunctions::load_plugin('topdf');
    if ($xoopsModuleConfig['permalinks']) {
        $print_book_url = RDFunctions::url() . '/printbook/' . $section->id() . '/';
        $print_section_url = RDFunctions::url() . '/printsection/' . $section->id() . '/';
    } else {
        $print_book_url = XOOPS_URL . '/modules/docs/index.php?page=content&id=' . $section->id() . '&action=printbook';
        $print_section_url = XOOPS_URL . '/modules/docs/index.php?page=content&id=' . $section->id() . '&action=printsection';
    }
    // This options only works when pdfmyurl is enabled on topdf plugin
    $options = array('--filename' => $res->getVar('title') . '.pdf', '--header-left' => $res->getVar('title'), '--header-right' => $xoopsConfig['sitename'], '--header-line' => '1');
    header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    $plugin->create_pdf_url($all ? $print_book_url : $print_section_url, $res->getVar('title') . '.pdf', $options);
}
示例#3
0
 /**
  * This event save the current page if is neccesary
  */
 public function eventRmcommonEndFlush($output)
 {
     global $xoopsUser, $xoopsConfig;
     $plugin = RMFunctions::load_plugin('booster');
     if (!$plugin->get_config('enabled')) {
         return $output;
     }
     if (defined('BOOSTER_NOTSAVE')) {
         return $output;
     }
     $url = RMFunctions::current_url();
     $path = parse_url($url);
     if ($plugin->is_excluded($url)) {
         return $output;
     }
     if ($xoopsUser) {
         $file = XOOPS_CACHE_PATH . '/booster/files/' . md5($url . session_id() . '|' . $xoopsConfig['language']);
         setcookie('booster_session', session_id() . '|' . $xoopsConfig['language'], 0, '/');
     } else {
         $file = XOOPS_CACHE_PATH . '/booster/files/' . md5($url . $xoopsConfig['language']);
     }
     $data = array('uri' => $url, 'created' => time(), 'language' => $xoopsConfig['language']);
     $pos = strpos($output, '<div id="xo-logger-output">');
     if ($pos !== FALSE) {
         file_put_contents($file . '.html', substr($output, 0, $pos) . '<!-- Cached by Booster -->');
     } else {
         file_put_contents($file . '.html', $output . '<!-- Cached by Booster -->');
     }
     file_put_contents($file . '.meta', json_encode($data));
     $plugin->delete_expired();
     return $output;
 }