コード例 #1
0
ファイル: async_show.php プロジェクト: nouphet/rata
function b_d3pipes_async_show($options)
{
    $mydirname = empty($options[0]) ? 'd3pipes' : $options[0];
    $unique_id = empty($options[1]) ? uniqid(rand()) : htmlspecialchars($options[1], ENT_QUOTES);
    $pipe_ids = empty($options[2]) ? array(0) : explode(',', preg_replace('/[^0-9,:]/', '', $options[2]));
    $max_entries = empty($options[3]) ? 0 : intval($options[3]);
    $this_template = empty($options[4]) ? 'db:' . $mydirname . '_block_async.html' : trim($options[4]);
    $union_class = @$options[5] == 'separated' ? 'separated' : 'mergesort';
    $link2clipping = empty($options[6]) ? false : true;
    $keep_pipeinfo = empty($options[7]) ? false : true;
    if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
        die('Invalid mydirname');
    }
    $module_handler =& xoops_gethandler('module');
    $module =& $module_handler->getByDirname($mydirname);
    $config_handler =& xoops_gethandler('config');
    $configs = $config_handler->getConfigList($module->mid());
    $constpref = '_MB_' . strtoupper($mydirname);
    // insert javascript if necessary
    d3pipes_insert_javascript4async();
    $block = array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $configs['images_dir'], 'mod_config' => $configs, 'unique_id' => $unique_id, 'pipe_ids' => $pipe_ids, 'max_entries' => $max_entries, 'union_class' => $union_class, 'link2clipping' => $link2clipping, 'keep_pipeinfo' => $keep_pipeinfo, 'lang_async_noscript' => constant($constpref . "_ASYNC_NOSCRIPT"));
    if (empty($options['disable_renderer'])) {
        require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
        $tpl = new D3Tpl();
        $tpl->assign('block', $block);
        $ret['content'] = $tpl->fetch($this_template);
        return $ret;
    } else {
        return $block;
    }
}
コード例 #2
0
ファイル: async_edit.php プロジェクト: nouphet/rata
function b_d3pipes_blockedit_common($options, $type = 'async')
{
    $mydirname = empty($options[0]) ? 'd3pipes' : $options[0];
    //$unique_id = empty( $options[1] ) ? uniqid(rand()) : $options[1] ;
    $pipe_ids = empty($options[2]) ? array('') : explode(',', preg_replace('/[^0-9,:]/', '', $options[2]));
    $max_entries = empty($options[3]) ? 0 : intval($options[3]);
    $this_template = empty($options[4]) ? '' : trim($options[4]);
    $union_class = @$options[5] == 'separated' ? 'separated' : 'mergesort';
    $link2clipping = empty($options[6]) ? false : true;
    $keep_pipeinfo = empty($options[7]) ? false : true;
    if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
        die('Invalid mydirname');
    }
    require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
    $tpl = new D3Tpl();
    $tpl->assign(array('mydirname' => $mydirname, 'type' => $type, 'uniqid' => uniqid(rand()), 'pipe_ids' => $pipe_ids, 'pipe_options' => b_d3pipes_get_pipe_options($mydirname), 'max_entries' => $max_entries, 'this_template' => $this_template, 'union_class' => $union_class, 'link2clipping' => $link2clipping, 'keep_pipeinfo' => $keep_pipeinfo, 'union_options' => array('separated' => _MB_D3PIPES_UNIONOPTION_SEPARATED, 'mergesort' => _MB_D3PIPES_UNIONOPTION_MERGESORT)));
    return $tpl->fetch('db:' . $mydirname . '_blockedit_async.html');
}
コード例 #3
0
ファイル: sync_show.php プロジェクト: nouphet/rata
function b_d3pipes_sync_show($options)
{
    $mydirname = empty($options[0]) ? 'd3pipes' : $options[0];
    $unique_id = empty($options[1]) ? uniqid(rand()) : htmlspecialchars($options[1], ENT_QUOTES);
    // just dummy
    $pipe_ids = empty($options[2]) ? array(0) : explode(',', preg_replace('/[^0-9,:]/', '', $options[2]));
    $max_entries = empty($options[3]) ? 0 : intval($options[3]);
    $this_template = empty($options[4]) ? 'db:' . $mydirname . '_block_sync.html' : trim($options[4]);
    $union_class = @$options[5] == 'separated' ? 'separated' : 'mergesort';
    $link2clipping = empty($options[6]) ? false : true;
    $keep_pipeinfo = empty($options[7]) ? false : true;
    if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
        die('Invalid mydirname');
    }
    $module_handler =& xoops_gethandler('module');
    $module =& $module_handler->getByDirname($mydirname);
    $config_handler =& xoops_gethandler('config');
    $configs = $config_handler->getConfigList($module->mid());
    $constpref = '_MB_' . strtoupper($mydirname);
    // Union object
    $union_obj =& d3pipes_common_get_joint_object($mydirname, 'union', $union_class, sizeof($pipe_ids) == 1 ? $pipe_ids[0] . ':' . $max_entries : implode(',', $pipe_ids) . '||' . ($keep_pipeinfo ? 1 : 0));
    $union_obj->setModConfigs($configs);
    $entries = $union_obj->execute(array(), $max_entries);
    $pipes_entries = method_exists($union_obj, 'getPipesEntries') ? $union_obj->getPipesEntries() : array();
    $errors = $union_obj->getErrors();
    // language file of main.php
    $langman =& D3LanguageManager::getInstance();
    $langman->read('main.php', $mydirname, basename(dirname(dirname(__FILE__))));
    $block = array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $configs['images_dir'], 'xoops_config' => $GLOBALS['xoopsConfig'], 'mod_config' => $configs, 'pipe_ids' => $pipe_ids, 'max_entries' => $max_entries, 'union_class' => $union_class, 'link2clipping' => $link2clipping, 'keep_pipeinfo' => $keep_pipeinfo, 'errors' => $errors, 'entries' => $entries, 'pipes_entries' => $pipes_entries, 'timezone_offset' => xoops_getUserTimestamp(0));
    if (empty($options['disable_renderer'])) {
        require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
        $tpl = new D3Tpl();
        $tpl->assign('block', $block);
        $ret['content'] = $tpl->fetch($this_template);
        return $ret;
    } else {
        return $block;
    }
}
コード例 #4
0
ファイル: main_css.php プロジェクト: nouphet/rata
<?php

// send header
if (!headers_sent()) {
    $cache_limit = 3600;
    session_cache_limiter('public');
    header("Expires: " . date('r', intval(time() / $cache_limit) * $cache_limit + $cache_limit));
    header("Cache-Control: public, max-age={$cache_limit}");
    header("Last-Modified: " . date('r', intval(time() / $cache_limit) * $cache_limit));
    header('Content-Type: text/css');
}
if (is_object($xoopsUser)) {
    $xoops_isuser = true;
    $xoops_userid = $xoopsUser->getVar('uid');
    $xoops_uname = $xoopsUser->getVar('uname');
    $xoops_isadmin = $xoopsUserIsAdmin;
} else {
    $xoops_isuser = false;
    $xoops_userid = 0;
    $xoops_uname = '';
    $xoops_isadmin = false;
}
require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
$tpl = new D3Tpl();
$tpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'xoops_config' => $xoopsConfig, 'mod_config' => $xoopsModuleConfig, 'xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', 'xoops_themecss' => xoops_getcss($xoopsConfig['theme_set']), 'xoops_isuser' => $xoops_isuser, 'xoops_userid' => $xoops_userid, 'xoops_uname' => $xoops_uname, 'xoops_isadmin' => $xoops_isadmin));
$tpl->display('db:' . $mydirname . '_main.css');
exit;
コード例 #5
0
ファイル: wizard_inner.php プロジェクト: nouphet/rata
    if (!empty($_POST['create_union_pipe'])) {
        $values4sql = "UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),'" . mysql_real_escape_string(serialize(array(array('joint' => 'union', 'joint_class' => 'mergesort', 'option' => implode(',', $pipe_ids))))) . "','" . _MD_A_D3PIPES_TITLE_WIZ_INNERUNION . "','" . mysql_real_escape_string(XOOPS_URL . '/') . "','{$weight}'";
        $db->queryF("INSERT INTO " . $db->prefix($mydirname . "_pipes") . " (created_time,modified_time,joints,name,url,weight) VALUES ({$values4sql})");
    }
    redirect_header(XOOPS_URL . "/modules/{$mydirname}/admin/index.php?page=pipe", 3, _MD_A_D3PIPES_MSG_PIPEUPDATED);
    exit;
}
//
// form stage
//
$modules = array();
foreach ($module_handler->getList(null, true) as $dirname => $name) {
    $modules[$dirname] = array('name' => $name, 'joints' => array());
}
$joint_objs = d3pipes_common_get_joint_objects($mydirname, 'block');
foreach ($joint_objs as $joint_obj) {
    foreach ($joint_obj->getValidDirnames() as $dirname) {
        if (isset($modules[$dirname])) {
            $modules[$dirname]['joints'][] = array('type' => 'block', 'class' => strtolower(substr(get_class($joint_obj), strlen('D3pipesBlock'))), 'name' => $joint_obj->getMyname4disp());
        }
    }
}
//
// display stage
//
xoops_cp_header();
include dirname(__FILE__) . '/mymenu.php';
$tpl = new D3Tpl();
$tpl->assign(array('mydirname' => $mydirname, 'mod_name' => $xoopsModule->getVar('name'), 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig, 'yesno_options' => array(1 => _YES, 0 => _NO), 'modules' => $modules, 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'd3pipes_admin')));
$tpl->display('db:' . $mydirname . '_admin_wizard_inner.html');
xoops_cp_footer();
コード例 #6
0
 function form_edit($bid, $mode = 'edit')
 {
     $bid = intval($bid);
     //HACK by domifara
     $block = new XoopsBlock($bid);
     if (!$block->getVar('bid')) {
         // new defaults
         $bid = 0;
         $mode = 'new';
         $block->setVar('mid', 0);
         $block->setVar('block_type', 'C');
     }
     switch ($mode) {
         case 'clone':
             $form_title = _MD_A_MYBLOCKSADMIN_CLONEFORM;
             $button_value = _MD_A_MYBLOCKSADMIN_BTN_CLONE;
             $next_op = 'clone_ok';
             // breadcrumbs
             $breadcrumbsObj =& AltsysBreadcrumbs::getInstance();
             $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_CLONEFORM);
             break;
         case 'new':
             $form_title = _MD_A_MYBLOCKSADMIN_NEWFORM;
             $button_value = _MD_A_MYBLOCKSADMIN_BTN_NEW;
             $next_op = 'new_ok';
             // breadcrumbs
             $breadcrumbsObj =& AltsysBreadcrumbs::getInstance();
             $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_NEWFORM);
             break;
         case 'edit':
         default:
             $form_title = _MD_A_MYBLOCKSADMIN_EDITFORM;
             $button_value = _MD_A_MYBLOCKSADMIN_BTN_EDIT;
             $next_op = 'edit_ok';
             // breadcrumbs
             $breadcrumbsObj =& AltsysBreadcrumbs::getInstance();
             $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_EDITFORM);
             break;
     }
     $is_custom = in_array($block->getVar('block_type'), array('C', 'E')) ? true : false;
     $block_template = $block->getVar('template', 'n');
     $block_template_tplset = '';
     if (!$is_custom && $block_template) {
         // find template of the block
         $tplfile_handler =& xoops_gethandler('tplfile');
         $found_templates = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', null, null, $block_template);
         $block_template_tplset = count($found_templates) > 0 ? $GLOBALS['xoopsConfig']['template_set'] : 'default';
     }
     //HACK by domifara
     /*
     	if ( !($block->getVar('c_type')) ){
     		$block->setVar('c_type','S');
     	}
     */
     $block_data = $this->preview_request + array('bid' => $bid, 'name' => $block->getVar('name', 'n'), 'title' => $block->getVar('title', 'n'), 'weight' => intval($block->getVar('weight')), 'bcachetime' => intval($block->getVar('bcachetime')), 'side' => intval($block->getVar('side')), 'visible' => intval($block->getVar('visible')), 'template' => $block_template, 'template_tplset' => $block_template_tplset, 'options' => $block->getVar('options'), 'content' => $block->getVar('content', 'n'), 'is_custom' => $is_custom, 'type' => $block->getVar('block_type'), 'ctype' => $block->getVar('c_type'));
     $block4assign = array('name_raw' => $block_data['name'], 'title_raw' => $block_data['title'], 'content_raw' => $block_data['content'], 'cell_position' => $this->renderCell4BlockPosition($block_data), 'cell_module_link' => $this->renderCell4BlockModuleLink($block_data), 'cell_group_perm' => $this->renderCell4BlockReadGroupPerm($block_data), 'cell_options' => $this->renderCell4BlockOptions($block_data), 'content_preview' => $this->previewContent($block_data)) + $block_data;
     // display
     require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
     $tpl = new D3Tpl();
     //dhtml
     include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     if ($block_data['ctype'] == 'H' || empty($block_data['ctype'])) {
         $editor_configs = array();
         $editor_configs["name"] = "content_block";
         $editor_configs["value"] = $block_data['content'];
         $editor_configs["rows"] = 20;
         $editor_configs["cols"] = 100;
         $editor_configs["width"] = "100%";
         $editor_configs["height"] = "400px";
         $editor_configs["editor"] = xoops_getModuleOption('blocks_editor', 'system');
         $form = new XoopsFormEditor('', "textarea_content", $editor_configs);
         $rendered = $form->render();
         $tpl->assign('altsys_x25_dhtmltextarea', $rendered);
     } else {
         $form = new XoopsFormDhtmlTextArea('', 'textarea_content', $block_data['content'], 80, 20);
         $rendered = $form->render();
         $rendered = '<div id="textarea_content_bbcode_buttons_pre" style="display:block;">' . str_replace(array('<textarea', '</textarea><br />'), array('</div><textarea', '</textarea><div id="textarea_content_bbcode_buttons_post" style="display:block;">'), $rendered) . '</div>';
         $tpl->assign('altsys_x25_dhtmltextarea', $rendered);
     }
     $tpl->assign(array('target_dirname' => $this->target_dirname, 'target_mname' => $this->target_mname, 'language' => $this->lang, 'cachetime_options' => $this->cachetime_options, 'ctype_options' => $this->ctype_options, 'block' => $block4assign, 'op' => $next_op, 'form_title' => $form_title, 'submit_button' => $button_value, 'common_fck_installed' => file_exists(XOOPS_ROOT_PATH . '/common/fckeditor/fckeditor.js'), 'gticket_hidden' => $GLOBALS['xoopsGTicket']->getTicketHtml(__LINE__, 1800, 'myblocksadmin')));
     //HACK by domifara
     $tpl->display('db:altsys_main_myblocksadmin_edit_4x25.html');
     return;
 }
コード例 #7
0
ファイル: mylangadmin.php プロジェクト: hiro1173/legacy
        <strike>if ( file_exists(XOOPS_ROOT_PATH."/modules/"...."/main.php") ) {
            include_once XOOPS_ROOT_PATH."/modules/"...."/main.php";
        } else {
            if ( file_exists(XOOPS_ROOT_PATH..../english/main.php") ) {
                include_once XOOPS_ROOT_PATH..../english/main.php";
            }
        }</strike>
        require_once XOOPS_TRUST_PATH."/libs/altsys/class/D3LanguageManager.class.php" ;
        $langman =& D3LanguageManager::getInstance() ;
        $langman->read( "main.php" , $xoopsModule->getVar("dirname") ) ;
		</pre>
	';
}
//
// display stage
//
xoops_cp_header();
// mymenu
altsys_include_mymenu();
// breadcrumbs
$breadcrumbsObj =& AltsysBreadcrumbs::getInstance();
if ($breadcrumbsObj->hasPaths()) {
    $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&amp;lib=altsys&amp;page=mylangadmin', _MI_ALTSYS_MENU_MYLANGADMIN);
    $breadcrumbsObj->appendPath('', $target_mname);
}
require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
$tpl = new D3Tpl();
$tpl->assign(array('target_dirname' => $target_dirname, 'target_mname' => $target_mname, 'target_lang' => $target_lang, 'languages' => $languages, 'languages4disp' => $languages4disp, 'target_file' => $target_file, 'lang_files' => $lang_files, 'langfile_constants' => $langfile_constants, 'mylang_constants' => $mylang_constants, 'use_my_language' => strlen($langman->my_language) > 0, 'mylang_file_name' => htmlspecialchars($mylang_unique_path, ENT_QUOTES), 'cache_file_name' => htmlspecialchars($cache_file_name, ENT_QUOTES), 'cache_file_mtime' => intval($cache_file_mtime), 'timezone_offset' => xoops_getUserTimestamp(0), 'notice' => $notice4disp, 'already_read' => $already_read, 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'altsys')));
$tpl->display('db:altsys_main_mylangadmin.html');
xoops_cp_footer();
exit;
コード例 #8
0
ファイル: mytplsadmin.php プロジェクト: hiro1173/legacy
if (!defined('XOOPS_ROOT_PATH')) {
    exit;
}
$current_dirname = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['dirname']);
$db =& Database::getInstance();
// get custom templates
list($count) = $db->fetchRow($db->query("SELECT COUNT(t.tpl_module) AS tpl_count FROM " . $db->prefix("tplfile") . " t WHERE t.tpl_type='custom'"));
if ($current_dirname == '_custom') {
    //	$GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'name' => _MYTPLSADMIN_CUSTOMTEMPLATE ) ;
    $custom_selected = true;
} else {
    $custom_selected = false;
}
$adminmenu = array(array('selected' => $custom_selected, 'title' => _MYTPLSADMIN_CUSTOMTEMPLATE . " ({$count})", 'link' => '?mode=admin&lib=altsys&page=mytplsadmin&dirname=_custom'));
// get modules/templates
$mrs = $db->query("SELECT m.name,m.dirname,COUNT(t.tpl_module) AS tpl_count FROM " . $db->prefix("modules") . " m LEFT JOIN " . $db->prefix("tplfile") . " t ON m.dirname=t.tpl_module WHERE m.isactive GROUP BY m.mid HAVING tpl_count>0 ORDER BY m.weight,m.mid");
// module loop
while (list($name, $dirname, $count) = $db->fetchRow($mrs)) {
    if ($dirname == $current_dirname) {
        $adminmenu[] = array('selected' => true, 'title' => $name . " ({$count})", 'link' => '?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $dirname);
        //$GLOBALS['altsysXoopsBreadcrumbs'][] = array( 'name' => htmlspecialchars( $name , ENT_QUOTES ) ) ;
    } else {
        $adminmenu[] = array('selected' => false, 'title' => $name . " ({$count})", 'link' => '?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $dirname);
    }
}
// display
require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
$tpl = new D3Tpl();
$tpl->assign(array('adminmenu' => $adminmenu, 'highlight_color' => '#99ff99'));
$tpl->display('db:altsys_inc_mymenusub.html');
コード例 #9
0
ファイル: cache.php プロジェクト: nouphet/rata
require_once dirname(dirname(__FILE__)) . '/include/common_functions.php';
require_once dirname(dirname(__FILE__)) . '/include/admin_functions.php';
require_once dirname(dirname(__FILE__)) . '/class/gtickets.php';
$myts =& MyTextSanitizer::getInstance();
$db =& Database::getInstance();
//
// transaction stage
//
if (!empty($_POST['do_deletefetchcache'])) {
    d3pipes_common_delete_all_cache($mydirname);
    redirect_header(XOOPS_URL . "/modules/{$mydirname}/admin/index.php?page=cache", 3, _MD_A_D3PIPES_MSG_CACHEDELETED);
    exit;
}
if (!empty($_POST['do_clearlastfetch'])) {
    $db->query("UPDATE " . $db->prefix($mydirname . "_pipes") . " SET lastfetch_time=0");
    redirect_header(XOOPS_URL . "/modules/{$mydirname}/admin/index.php?page=cache", 3, _MD_A_D3PIPES_MSG_PIPEUPDATED);
    exit;
}
//
// form stage
//
//
// display stage
//
xoops_cp_header();
include dirname(__FILE__) . '/mymenu.php';
$tpl = new D3Tpl();
$tpl->assign(array('mydirname' => $mydirname, 'mod_name' => $xoopsModule->getVar('name'), 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig));
$tpl->display('db:' . $mydirname . '_admin_cache.html');
xoops_cp_footer();
コード例 #10
0
 function form_edit($bid, $mode = 'edit')
 {
     $bid = intval($bid);
     //HACK by domifara
     if (defined('XOOPS_CUBE_LEGACY')) {
         $handler =& xoops_gethandler('block');
         $block =& $handler->create(false);
         $block->load($bid);
     } else {
         $block = new XoopsBlock($bid);
     }
     if (!$block->getVar('bid')) {
         // new defaults
         $bid = 0;
         $mode = 'new';
         $block->setVar('mid', 0);
         $block->setVar('block_type', 'C');
     }
     switch ($mode) {
         case 'clone':
             $form_title = _MD_A_MYBLOCKSADMIN_CLONEFORM;
             $button_value = _MD_A_MYBLOCKSADMIN_BTN_CLONE;
             $next_op = 'clone_ok';
             // breadcrumbs
             $breadcrumbsObj =& AltsysBreadcrumbs::getInstance();
             $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_CLONEFORM);
             break;
         case 'new':
             $form_title = _MD_A_MYBLOCKSADMIN_NEWFORM;
             $button_value = _MD_A_MYBLOCKSADMIN_BTN_NEW;
             $next_op = 'new_ok';
             // breadcrumbs
             $breadcrumbsObj =& AltsysBreadcrumbs::getInstance();
             $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_NEWFORM);
             break;
         case 'edit':
         default:
             $form_title = _MD_A_MYBLOCKSADMIN_EDITFORM;
             $button_value = _MD_A_MYBLOCKSADMIN_BTN_EDIT;
             $next_op = 'edit_ok';
             // breadcrumbs
             $breadcrumbsObj =& AltsysBreadcrumbs::getInstance();
             $breadcrumbsObj->appendPath('', _MD_A_MYBLOCKSADMIN_EDITFORM);
             break;
     }
     $is_custom = in_array($block->getVar('block_type'), array('C', 'E')) ? true : false;
     $block_template = $block->getVar('template', 'n');
     $block_template_tplset = '';
     if (!$is_custom && $block_template) {
         // find template of the block
         $tplfile_handler =& xoops_gethandler('tplfile');
         $found_templates = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', null, null, $block_template);
         $block_template_tplset = count($found_templates) > 0 ? $GLOBALS['xoopsConfig']['template_set'] : 'default';
     }
     //HACK by domifara
     /*
     	if ( !($block->getVar('c_type')) ){
     		$block->setVar('c_type','S');
     	}
     */
     $block_data = $this->preview_request + array('bid' => $bid, 'name' => $block->getVar('name', 'n'), 'title' => $block->getVar('title', 'n'), 'weight' => intval($block->getVar('weight')), 'bcachetime' => intval($block->getVar('bcachetime')), 'side' => intval($block->getVar('side')), 'visible' => intval($block->getVar('visible')), 'template' => $block_template, 'template_tplset' => $block_template_tplset, 'options' => $block->getVar('options'), 'content' => $block->getVar('content', 'n'), 'is_custom' => $is_custom, 'type' => $block->getVar('block_type'), 'ctype' => $block->getVar('c_type'));
     $block4assign = array('name_raw' => $block_data['name'], 'title_raw' => $block_data['title'], 'content_raw' => $block_data['content'], 'cell_position' => $this->renderCell4BlockPosition($block_data), 'cell_module_link' => $this->renderCell4BlockModuleLink($block_data), 'cell_group_perm' => $this->renderCell4BlockReadGroupPerm($block_data), 'cell_options' => $this->renderCell4BlockOptions($block_data), 'content_preview' => $this->previewContent($block_data)) + $block_data;
     // display
     require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
     $tpl = new D3Tpl();
     //HACK by domifara
     if (defined('XOOPS_CUBE_LEGACY')) {
         $tpl->assign('xoops_cube_legacy', true);
         include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
     } else {
         $tpl->assign('xoops_cube_legacy', false);
     }
     $tpl->assign(array('target_dirname' => $this->target_dirname, 'target_mname' => $this->target_mname, 'language' => $this->lang, 'cachetime_options' => $this->cachetime_options, 'ctype_options' => $this->ctype_options, 'block' => $block4assign, 'op' => $next_op, 'form_title' => $form_title, 'submit_button' => $button_value, 'common_fck_installed' => file_exists(XOOPS_ROOT_PATH . '/common/fckeditor/fckeditor.js'), 'gticket_hidden' => $GLOBALS['xoopsGTicket']->getTicketHtml(__LINE__, 1800, 'myblocksadmin')));
     if (defined('XOOPS_CUBE_LEGACY')) {
         $tpl->display('db:altsys_main_myblocksadmin_edit_4legacy.html');
     } else {
         $tpl->display('db:altsys_main_myblocksadmin_edit.html');
     }
     return;
 }
コード例 #11
0
ファイル: pipe.php プロジェクト: nouphet/rata
    if (isset($pipes4assign[$pipe_id])) {
        // EDIT (DETAIL)
        $template = 'admin_pipe_edit.html';
        $pipe4edit = $pipes4assign[$pipe_id];
        $pipe4edit['joints'] = array_merge($pipe4edit['joints'], array_fill(0, 3, $blank_joint));
    } else {
        // NEW
        $pipe_id = -1;
        $template = 'admin_pipe_edit.html';
        $pipe4edit = array('id' => -1, 'name' => '', 'joints' => array(array('joint' => 'fetch', 'joint_class' => d3pipes_common_get_default_joint_class($mydirname, 'fetch'), 'option' => ''), array('joint' => 'parse', 'joint_class' => d3pipes_common_get_default_joint_class($mydirname, 'parse'), 'option' => ''), array('joint' => 'utf8to', 'joint_class' => d3pipes_common_get_default_joint_class($mydirname, 'utf8to'), 'option' => $xoopsModuleConfig['internal_encoding']), array('joint' => 'clip', 'joint_class' => d3pipes_common_get_default_joint_class($mydirname, 'clip'), 'option' => '')));
        $pipe4edit['joints'] = array_merge($pipe4edit['joints'], array_fill(0, 3, $blank_joint));
    }
}
// joint_classes options
$joint_classes_options = array();
foreach ($all_joints as $joint_type => $joint_type_name) {
    $joint_classes_options[$joint_type_name] = array();
    foreach (d3pipes_admin_fetch_classes($mydirname, $joint_type) as $joint_class) {
        $joint_classes_options[$joint_type_name][$joint_type . '::' . $joint_class] = defined('_MD_D3PIPES_CLASS_' . strtoupper($joint_type . $joint_class)) ? constant('_MD_D3PIPES_CLASS_' . strtoupper($joint_type . $joint_class)) : $joint_class;
    }
}
$joint_classes_options[_NONE] = array('::' => '----');
//
// display stage
//
xoops_cp_header();
include dirname(__FILE__) . '/mymenu.php';
$tpl = new D3Tpl();
$tpl->assign(array('mydirname' => $mydirname, 'mod_name' => $xoopsModule->getVar('name'), 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig, 'pipe_id' => $pipe_id, 'pipes' => $pipes4assign, 'pipe' => $pipe4edit, 'all_joints' => $all_joints, 'joint_classes_options' => $joint_classes_options, 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'd3pipes_admin')));
$tpl->display('db:' . $mydirname . '_' . $template);
xoops_cp_footer();
コード例 #12
0
ファイル: wizard_fetch.php プロジェクト: nouphet/rata
// create form for pipe admin
$post_hiddens = array();
if (empty($lacked_requests)) {
    // base (fetch & parse)
    $post_hiddens = array('name' => $requests['name'], 'url' => $requests['url'], 'joint_weights[0]' => 0, 'joint_classes[0]' => 'fetch::', 'joint_option[0]' => $requests['rssurl'], 'joint_weights[2]' => 20, 'joint_classes[2]' => 'parse::', 'joint_option[2]' => '', 'joint_weights[9]' => 90, 'joint_classes[9]' => 'cache::', 'joint_option[9]' => '3600');
    // xml's encoding to UTF-8 if necessary
    if (strtolower($requests['rssencoding']) != 'utf-8') {
        $post_hiddens += array('joint_weights[1]' => 10, 'joint_classes[1]' => 'utf8from::', 'joint_option[1]' => $requests['rssencoding']);
    }
    // UTF8 to internal_encoding for entries if necessary
    if (strtolower($xoopsModuleConfig['internal_encoding']) != 'utf-8') {
        $post_hiddens += array('joint_weights[3]' => 30, 'joint_classes[3]' => 'utf8to::', 'joint_option[3]' => $xoopsModuleConfig['internal_encoding']);
    }
    // allowhtml -> reassign::contentencoded
    if ($requests['allowhtml']) {
        $post_hiddens += array('joint_weights[4]' => 40, 'joint_classes[4]' => 'reassign::allowhtml');
    }
    // clip or cache
    if ($requests['clip']) {
        $post_hiddens += array('joint_weights[5]' => 50, 'joint_classes[5]' => 'clip::', 'joint_option[5]' => '3600');
    }
}
//
// display stage
//
xoops_cp_header();
include dirname(__FILE__) . '/mymenu.php';
$tpl = new D3Tpl();
$tpl->assign(array('mydirname' => $mydirname, 'mod_name' => $xoopsModule->getVar('name'), 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig, 'yesno_options' => array(1 => _YES, 0 => _NO), 'requests_raw' => $requests, 'lacked_requests' => $lacked_requests, 'error_messages' => $error_messages, 'post_hiddens' => $post_hiddens, 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'd3pipes_admin')));
$tpl->display('db:' . $mydirname . '_admin_wizard_fetch.html');
xoops_cp_footer();
コード例 #13
0
ファイル: clipping.php プロジェクト: nouphet/rata
    }
}
if (!empty($_POST['do_deleteolder']) || !empty($_POST['count_deleteolder'])) {
    $olderthan = intval(@$_POST['olderthan']);
    $result = $db->query("SELECT clipping_id FROM " . $db->prefix($mydirname . "_clippings") . " c {$d3comment_join4sql} WHERE c.pubtime<UNIX_TIMESTAMP()-({$olderthan}*86400) AND ({$whr_protect})");
    while (list($clipping_id) = $db->fetchRow($result)) {
        $target_clipping_ids[] = intval($clipping_id);
    }
}
if ((!empty($_POST['do_deleteunlinks']) || !empty($_POST['do_deleteolder'])) && !empty($target_clipping_ids)) {
    if (!$xoopsGTicket->check(true, 'd3pipes_admin')) {
        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
    }
    $db->query("DELETE FROM " . $db->prefix($mydirname . "_clippings") . " WHERE clipping_id IN (" . implode(",", $target_clipping_ids) . ")");
    redirect_header(XOOPS_URL . "/modules/{$mydirname}/admin/index.php?page=clipping", 3, _MD_A_D3PIPES_MSG_CLIPPINGUPDATED);
    exit;
}
//
// form stage
//
list($total_clippings) = $db->fetchRow($db->query("SELECT COUNT(*) FROM " . $db->prefix($mydirname . "_clippings")));
$selected_clippings = sizeof($target_clipping_ids);
//
// display stage
//
xoops_cp_header();
include dirname(__FILE__) . '/mymenu.php';
$tpl = new D3Tpl();
$tpl->assign(array('mydirname' => $mydirname, 'mod_name' => $xoopsModule->getVar('name'), 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig, 'total_clippings' => $total_clippings, 'selected_clippings' => empty($_POST) ? -1 : $selected_clippings, 'olderthan' => $olderthan, 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'd3pipes_admin')));
$tpl->display('db:' . $mydirname . '_admin_clipping.html');
xoops_cp_footer();
コード例 #14
0
ファイル: block_functions.php プロジェクト: hiro1173/legacy
function b_altsys_admin_menu_show($options)
{
    global $xoopsUser;
    $mydirname = empty($options[0]) ? 'altsys' : $options[0];
    $this_template = empty($options[1]) ? 'db:' . $mydirname . '_block_admin_menu.html' : trim($options[1]);
    if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) {
        die('Invalid mydirname');
    }
    if (!is_object(@$xoopsUser)) {
        return array();
    }
    // coretype
    $coretype = altsys_get_core_type();
    // mid_selected
    if (is_object(@$GLOBALS["xoopsModule"])) {
        $mid_selected = $GLOBALS["xoopsModule"]->getVar("mid");
        // for system->preferences
        if ($mid_selected == 1 && @$_GET["fct"] == "preferences" && @$_GET["op"] == "showmod" && !empty($_GET["mod"])) {
            $mid_selected = intval($_GET["mod"]);
        }
    } else {
        $mid_selected = 0;
    }
    $db =& Database::getInstance();
    $myts =& MyTextSanitizer::getInstance();
    $module_handler =& xoops_gethandler('module');
    $current_module =& $module_handler->getByDirname($mydirname);
    $config_handler =& xoops_gethandler('config');
    $current_configs = $config_handler->getConfigList($current_module->mid());
    $moduleperm_handler =& xoops_gethandler('groupperm');
    $admin_mids = $moduleperm_handler->getItemIds('module_admin', $xoopsUser->getGroups());
    $modules = $module_handler->getObjects(new Criteria('mid', '(' . implode(',', $admin_mids) . ')', 'IN'), true);
    $block = array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $current_configs['images_dir'], 'mod_config' => $current_configs);
    foreach ($modules as $mod) {
        $mid = intval($mod->getVar('mid'));
        $dirname = $mod->getVar('dirname');
        $modinfo = $mod->getInfo();
        $submenus4assign = array();
        $adminmenu = array();
        $adminmenu4altsys = array();
        unset($adminmenu_use_altsys);
        @(include XOOPS_ROOT_PATH . '/modules/' . $dirname . '/' . @$modinfo['adminmenu']);
        // from admin_menu.php etc.
        $adminmenu = array_merge($adminmenu, $adminmenu4altsys);
        foreach ($adminmenu as $sub) {
            $link = empty($sub['altsys_link']) ? $sub['link'] : $sub['altsys_link'];
            if (isset($sub['show']) && $sub['show'] === false) {
                continue;
            }
            $submenus4assign[] = array('title' => $myts->makeTboxData4Show($sub['title']), 'url' => XOOPS_URL . '/modules/' . $dirname . '/' . htmlspecialchars($link, ENT_QUOTES));
        }
        // for modules overriding Module.class.php (eg. Analyzer for XC)
        if (empty($submenus4assign) && defined('XOOPS_CUBE_LEGACY') && !empty($modinfo['cube_style'])) {
            $module_handler =& xoops_gethandler('module');
            $module =& $module_handler->get($mid);
            $moduleObj =& Legacy_Utils::createModule($module);
            $modinfo['adminindex'] = $moduleObj->getAdminIndex();
            $modinfo['adminindex_absolute'] = true;
            foreach ($moduleObj->getAdminMenu() as $sub) {
                if (@$sub['show'] === false) {
                    continue;
                }
                $submenus4assign[] = array('title' => $myts->makeTboxData4Show($sub['title']), 'url' => strncmp($sub['link'], 'http', 4) === 0 ? htmlspecialchars($sub['link'], ENT_QUOTES) : XOOPS_URL . '/modules/' . $dirname . '/' . htmlspecialchars($sub['link'], ENT_QUOTES));
            }
        } else {
            if (empty($adminmenu4altsys)) {
                // add preferences
                if ($mod->getVar('hasconfig') && !in_array($mod->getVar('dirname'), array('system', 'legacy'))) {
                    $submenus4assign[] = array('title' => _PREFERENCES, 'url' => htmlspecialchars(altsys_get_link2modpreferences($mid, $coretype), ENT_QUOTES));
                }
                // add help
                if (defined('XOOPS_CUBE_LEGACY') && !empty($modinfo['help'])) {
                    $submenus4assign[] = array('title' => _HELP, 'url' => XOOPS_URL . '/modules/legacy/admin/index.php?action=Help&amp;dirname=' . $dirname);
                }
            }
        }
        $module4assign = array('mid' => $mid, 'dirname' => $dirname, 'name' => $mod->getVar('name'), 'version_in_db' => sprintf('%.2f', $mod->getVar('version') / 100.0), 'version_in_file' => sprintf('%.2f', $modinfo['version']), 'description' => htmlspecialchars(@$modinfo['description'], ENT_QUOTES), 'image' => htmlspecialchars($modinfo['image'], ENT_QUOTES), 'isactive' => $mod->getVar('isactive'), 'hasmain' => $mod->getVar('hasmain'), 'hasadmin' => $mod->getVar('hasadmin'), 'hasconfig' => $mod->getVar('hasconfig'), 'weight' => $mod->getVar('weight'), 'adminindex' => htmlspecialchars(@$modinfo['adminindex'], ENT_QUOTES), 'adminindex_absolute' => @$modinfo['adminindex_absolute'], 'submenu' => $submenus4assign, 'selected' => $mid == $mid_selected ? true : false, 'dot_suffix' => $mid == $mid_selected ? 'selected_opened' : 'closed');
        $block['modules'][] = $module4assign;
    }
    require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
    $tpl = new D3Tpl();
    $tpl->assign('block', $block);
    $ret['content'] = $tpl->fetch($this_template);
    return $ret;
}
コード例 #15
0
ファイル: jsbackend.php プロジェクト: nouphet/rata
// fetch link2clipping
$link2clipping = empty($_GET['link2clipping']) ? false : true;
// fetch keep_pipeinfo
$keep_pipeinfo = empty($_GET['keep_pipeinfo']) ? false : true;
// fetch pipe_row
$pipe_ids = empty($_GET['pipe_ids']) ? array(0) : explode(',', preg_replace('/[^0-9,:]/', '', $_GET['pipe_ids']));
if (sizeof($pipe_ids) == 1) {
    // single pipe
    $pipe4assign = d3pipes_common_get_pipe4assign($mydirname, intval($pipe_ids[0]));
    if (empty($pipe4assign)) {
        $entries = array();
        $errors = array('Invalid pipe_id');
    } else {
        $entries = d3pipes_common_fetch_entries($mydirname, $pipe4assign, $max_entries, $errors, $xoopsModuleConfig);
    }
    $pipes_entries = array();
} else {
    // Union object
    $union_obj =& d3pipes_common_get_joint_object($mydirname, 'union', $union_class, implode(',', $pipe_ids) . '||' . ($keep_pipeinfo ? 1 : 0));
    $union_obj->setModConfigs($xoopsModuleConfig);
    $entries = $union_obj->execute(array(), $max_entries);
    $pipes_entries = method_exists($union_obj, 'getPipesEntries') ? $union_obj->getPipesEntries() : array();
    $errors = $union_obj->getErrors();
}
// assign
require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
$xoopsTpl = new D3Tpl();
$xoopsTpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'xoops_config' => $xoopsConfig, 'mod_config' => @$xoopsModuleConfig, 'xoops_breadcrumbs' => @$xoops_breadcrumbs, 'xoops_pagetitle' => @$pagetitle4assign, 'errors' => $errors, 'entries' => $entries, 'pipes_entries' => $pipes_entries, 'link2clipping' => $link2clipping, 'keep_pipeinfo' => $keep_pipeinfo, 'timezone_offset' => xoops_getUserTimestamp(0), 'xoops_module_header' => d3pipes_main_get_link2maincss($mydirname) . "\n" . $xoopsTpl->get_template_vars("xoops_module_header")));
$html = addslashes(strtr($xoopsTpl->fetch('db:' . $mydirname . '_main_jsbackend.html'), "\n\r", "  "));
echo "d3pipes_insert_html('{$mydirname}_async_block_{$unique_id}','{$html}');";
exit;
コード例 #16
0
ファイル: mymenu.php プロジェクト: hmoritake/xelfinder
$mymenu_link = substr(strstr($mymenu_uri, '/admin/'), 1);
// highlight
foreach (array_keys($adminmenu) as $i) {
    if ($mymenu_link == $adminmenu[$i]['link']) {
        $adminmenu[$i]['selected'] = true;
        $adminmenu_hilighted = true;
        $GLOBALS['altsysAdminPageTitle'] = $adminmenu[$i]['title'];
    } else {
        $adminmenu[$i]['selected'] = false;
    }
}
if (empty($adminmenu_hilighted)) {
    foreach (array_keys($adminmenu) as $i) {
        if (substr($adminmenu[$i]['link'], 0, 6) === 'admin/' && stristr($mymenu_uri, $adminmenu[$i]['link'])) {
            $adminmenu[$i]['selected'] = true;
            $GLOBALS['altsysAdminPageTitle'] = $adminmenu[$i]['title'];
            break;
        }
    }
}
// link conversion from relative to absolute
foreach (array_keys($adminmenu) as $i) {
    if (stristr($adminmenu[$i]['link'], XOOPS_URL) === false) {
        $adminmenu[$i]['link'] = XOOPS_MODULE_URL . "/{$mydirname}/" . $adminmenu[$i]['link'];
    }
}
// display
require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
$tpl = new D3Tpl();
$tpl->assign(array('adminmenu' => $adminmenu));
$tpl->display('db:altsys_inc_mymenu.html');
コード例 #17
0
ファイル: xml.php プロジェクト: nouphet/rata
        redirect_header(XOOPS_URL . '/modules/' . $mydirname . '/', 3, _MD_D3PIPES_ERR_INVALIDPIPEID);
        exit;
    }
    // fetch entries
    $entries = d3pipes_common_fetch_entries($mydirname, $pipe4assign, $max_entries, $errors, $xoopsModuleConfig);
    // check lastfetch_time
    if (empty($pipe4assign['lastfetch_time'])) {
        $lastfetch_time = 0;
        foreach ($entries as $entry) {
            $lastfetch_time = max(@$entry['pipe']['lastfetch_time'], $lastfetch_time);
        }
        $pipe4assign['lastfetch_time'] = empty($lastfetch_time) ? time() : $lastfetch_time;
    }
}
// get lastmodified of all over of entries
$entries_lastmodified = 0;
foreach ($entries as $entry) {
    $entries_lastmodified = max($entries_lastmodified, $entry['pubtime']);
}
// Utf8from object
$utf8from_obj =& d3pipes_common_get_joint_object_default($mydirname, 'utf8from', $xoopsModuleConfig['internal_encoding']);
// assign
require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php';
$xoopsTpl = new D3Tpl();
$xoopsTpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'xoops_config' => $xoopsConfig, 'xoops_config_utf8' => array_map('d3pipes_common_filter_ietoutf8', $xoopsConfig), 'mod_config' => @$xoopsModuleConfig, 'xoops_breadcrumbs' => @$xoops_breadcrumbs, 'xoops_pagetitle' => @$pagetitle4assign, 'errors' => $errors, 'pipe' => $utf8from_obj->execute($pipe4assign), 'entries' => $utf8from_obj->execute($entries), 'entries_lastmodified' => $entries_lastmodified, 'timezone_offset' => xoops_getUserTimestamp(0), 'style' => $style, 'link_prefer' => $link_prefer, 'xoops_module_header' => d3pipes_main_get_link2maincss($mydirname) . "\n" . $xoopsTpl->get_template_vars("xoops_module_header")));
if (function_exists('mb_http_output')) {
    mb_http_output('pass');
}
header('Content-Type:text/xml; charset=utf-8');
$xoopsTpl->display('db:' . $mydirname . '_independent_' . $style . '.html');
exit;