function b_shortcut_show($options) { global $xoopsDB, $xoopsUser, $xoopsModule; $myts =& MyTextSanitizer::getInstance(); include_once dirname(dirname(__FILE__)) . "/functions.php"; $mydirname = basename(dirname(dirname(__FILE__))); $block = array(); $action = ''; if ($options[0]) { if (!is_object($xoopsUser)) { return $block; } $uid = $xoopsUser->getVar('uid'); if (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $mydirname) { $module =& $xoopsModule; } else { $module_handler =& xoops_gethandler('module'); $module =& $module_handler->getByDirname($mydirname); } if ($xoopsUser->isAdmin($module->getVar('mid'))) { $action = XOOPS_URL . "/modules/{$mydirname}/register.php"; } } else { $uid = 0; $action = XOOPS_URL . "/modules/{$mydirname}/admin/index.php?op=edit"; } $block['links'] = shortcut_links($uid, $thispage); $block['action'] = $action; $block['thispage'] = htmlspecialchars($thispage); return $block; }
} else { die('wrong request'); } } exit; } xoops_cp_header(); include "mymenu.php"; switch ($op) { case 'list': echo "<h4>" . _AM_SHORTCUT_LIST . "</h4>\n"; $ents = array('title' => _AM_SHORTCUT_TITLE, 'weight' => _AM_SHORTCUT_WEIGHT, 'url' => _AM_SHORTCUT_URL, 'modified' => _AM_UPDATE_TIME, 'cutid' => _AM_SHORTCUT_ID, 'active' => _AM_SHORTCUT_ACT, 'refer' => _AM_SHORTCUT_REF); $acts = explode(',', _MD_FORM_ACTIVE_VALUE); echo "<table class='outer' cellpadding='4' border='0' cellspacing='1'>\n"; echo "<tr><th>" . join('</th><th>', $ents) . "</th><th>" . _AM_SHORTCUT_OP . "</th></tr>\n"; $links = shortcut_links(0, $thispage, _SC_ACTIVE_NONE . "," . _SC_ACTIVE_PUBLIC . "," . _SC_ACTIVE_PRIVATE); foreach ($links as $k => $data) { echo display_entry('', $data, $ents); if (!empty($data['sub'])) { foreach ($data['sub'] as $data) { echo display_entry(' ', $data, $ents); } } } echo "</table>\n"; echo import_module_select_form(); echo "<hr/>\n"; case 'edit': $scid = isset($_GET['scid']) ? intval($_GET['scid']) : 0; $res = $xoopsDB->query('SELECT * FROM ' . SHORT . ' WHERE scid=' . $scid); if ($res && $xoopsDB->getRowsNum($res)) {
<?php # shortcut user main page # $Id: index.php,v 1.2 2008/07/06 07:36:56 nobu Exp $ include "../../mainfile.php"; include "functions.php"; include XOOPS_ROOT_PATH . "/header.php"; $xoopsOption['template_main'] = 'shortcut_index.html'; $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : 0; $xoopsTpl->assign('links', shortcut_links($uid, $thispage)); $xoopsTpl->assign('sc_script', shortcut_script()); include XOOPS_ROOT_PATH . "/footer.php";