From: <be...@us...> - 2015-02-17 00:26:36
|
Revision: 12988 http://sourceforge.net/p/xoops/svn/12988 Author: beckmi Date: 2015-02-17 00:26:34 +0000 (Tue, 17 Feb 2015) Log Message: ----------- Adding hack for SystemInfo link (pre-Alpha, proof of concept) Added Paths: ----------- XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/docs_hack/ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/docs_hack/readme.txt XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/docs_hack/systeminfo.jpg XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/class/ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/class/XoopsSystemInfo.php XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/ZeroClipboard.swf XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/index.html XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/jquery.zclip.js XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/jquery.zclip.min.js XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/xoopssysteminfo.js XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/default.php XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/default.php_original XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/xotpl/ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/xotpl/xo_accordion.html XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/xotpl/xo_accordion.html_original Added: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/docs_hack/readme.txt =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/docs_hack/readme.txt (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/docs_hack/readme.txt 2015-02-17 00:26:34 UTC (rev 12988) @@ -0,0 +1,43 @@ +Many times, we ask the users asking for support, to provide us with the info about their installation. + +To make it easier, this hack, requested by Jim Garrett (aka Zyspec), adds a link in the Admin (see the picture systeminfo.jpg in this directory). When you click it, it will extract the info about your configuration (see an example below), and place it in your clipboard. You just need to paste it in the XOOPS Forums, when you ask for help. + +This is right now a proof of concept, looking for testers. + +EXAMPLE that would be copied to your clipboard: +============= + +XOOPS 2.5.8_Beta1 +PHP Version: 5.6.5 +mySQL Version: 5.6.22 +Server API: apache2handler +OS: WINNT +safe_mode: Off +register_globals: Off +register_globals: Off +allow_url_fopen: On +fsockopen: On +allow_call_time_pass_reference: Off +post_max_size: 8M +max_input_time: 120 +output_buffering: 4096 +max_execution_time: 60 +memory_limit: 512M +file_uploads: On +upload_max_filesize: 2M + +Active Modules: +--------------- +eXtCal 2.38 +News 1.71 +Publisher 1.02 +System 2.11 +User Profile 1.86 +Wfdownloads 3.23 + +Deactivated Modules: +--------------- +Forum 4.33 +My Links 3.11 +Private Messaging 1.1 +Protector 3.52 Added: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/docs_hack/systeminfo.jpg =================================================================== (Binary files differ) Index: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/docs_hack/systeminfo.jpg =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/docs_hack/systeminfo.jpg 2015-02-16 22:27:26 UTC (rev 12987) +++ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/docs_hack/systeminfo.jpg 2015-02-17 00:26:34 UTC (rev 12988) Property changes on: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/docs_hack/systeminfo.jpg ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/class/XoopsSystemInfo.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/class/XoopsSystemInfo.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/class/XoopsSystemInfo.php 2015-02-17 00:26:34 UTC (rev 12988) @@ -0,0 +1,152 @@ +<?php + +/* +if (!isset($GLOBALS['xoTheme']) || !is_object($GLOBALS['xoTheme'])) { + include_once $GLOBALS['xoops']->path("/class/theme.php"); + $GLOBALS['xoTheme'] = new xos_opal_Theme(); +} + +$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/jquery.js'); +$GLOBALS['xoTheme']->addScript('browse.php?Frameworks/jquery/plugins/jquery.zclip.js'); +*/ + +/** + * Class XoopsSystemInfo + */ +class XoopsSystemInfo +{ + + function __construct() + { + } + + public function getSystemInfoValues() + { + //<{$lang_php_vesion}> +// $moduleVersion = $wfdownloads->getModule()->getInfo('version'); + $systemInformation = ''; + $systemInformation .= $GLOBALS['xoopsTpl']->get_template_vars('xoops_version') . '\n'; + $systemInformation .= _OXYGEN_VERSION_PHP . ': ' . PHP_VERSION . '\n'; + $systemInformation .= _OXYGEN_VERSION_MYSQL . ': ' . mysql_get_server_info() . ' \n'; + $systemInformation .= _OXYGEN_Server_API . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('lang_server_api') . ' \n'; + $systemInformation .= _OXYGEN_OS . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('lang_os_name') . ' \n'; + $systemInformation .= 'safe_mode' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('safe_mode') . ' \n'; + $systemInformation .= 'register_globals' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('register_globals') . ' \n'; + $systemInformation .= 'register_globals' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('magic_quotes_gpc') . ' \n'; + $systemInformation .= 'allow_url_fopen' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('allow_url_fopen') . ' \n'; + $systemInformation .= 'fsockopen' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('fsockopen') . ' \n'; + $systemInformation .= 'allow_call_time_pass_reference' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('allow_call_time_pass_reference') . ' \n'; + $systemInformation .= 'post_max_size' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('post_max_size') . ' \n'; + $systemInformation .= 'max_input_time' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('max_input_time') . ' \n'; + $systemInformation .= 'output_buffering' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('output_buffering') . ' \n'; + $systemInformation .= 'max_execution_time' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('max_execution_time') . ' \n'; + $systemInformation .= 'memory_limit' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('memory_limit') . ' \n'; + $systemInformation .= 'file_uploads' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('file_uploads') . ' \n'; + $systemInformation .= 'upload_max_filesize' . ': ' . $GLOBALS['xoopsTpl']->get_template_vars('upload_max_filesize') . ' \n'; +//$systemInformation = 'Module ' . $wfdownloads->getModule()->getInfo('name') . ' ' . $wfdownloads->getModule()->getInfo('version') . '\n'; + return $systemInformation; + } + + public function getSystemInfoLabels() + { + } + + public function getSystemInfoLabelsAndValues() + { + } + + public function assignSystemInfoValuesToSmarty($tpl) + { + //$tpl->assign('lang_xoops_version', XOOPS_VERSION); + $tpl->assign('lang_php_vesion', PHP_VERSION); + $tpl->assign('lang_mysql_version', mysql_get_server_info()); + $tpl->assign('lang_server_api', PHP_SAPI); + $tpl->assign('lang_os_name', PHP_OS); + $tpl->assign('safe_mode', ini_get('safe_mode') ? 'On' : 'Off'); + $tpl->assign('register_globals', ini_get('register_globals') ? 'On' : 'Off'); + $tpl->assign('magic_quotes_gpc', ini_get('magic_quotes_gpc') ? 'On' : 'Off'); + $tpl->assign('allow_url_fopen', ini_get('allow_url_fopen') ? 'On' : 'Off'); + $tpl->assign('fsockopen', function_exists('fsockopen') ? 'On' : 'Off'); + $tpl->assign('allow_call_time_pass_reference', ini_get('allow_call_time_pass_reference') ? 'On' : 'Off'); + $tpl->assign('post_max_size', ini_get('post_max_size')); + $tpl->assign('max_input_time', ini_get('max_input_time')); + $tpl->assign('output_buffering', ini_get('output_buffering')); + $tpl->assign('max_execution_time', ini_get('max_execution_time')); + $tpl->assign('memory_limit', ini_get('memory_limit')); + $tpl->assign('file_uploads', ini_get('file_uploads') ? 'On' : 'Off'); + $tpl->assign('upload_max_filesize', ini_get('upload_max_filesize')); + $tpl->assign('xoops_sitename', $GLOBALS['xoopsConfig']['sitename']); + } + + public function getActiveModules() + { + $module_handler = xoops_gethandler('module'); + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('isactive', 1)); + $criteria->setSort('name'); + $criteria->setOrder('ASC'); + +// $tempModulesList = $module_handler->getList($criteria); + $tempModulesObj = $module_handler->getObjects($criteria); + +// sort($tempModulesList); + $activeModules = array(); + foreach ($tempModulesObj as $moduleObj) { + $activeModules[] = $moduleObj->getVar('name') . ' ' . round($moduleObj->getVar('version') / 100, 2); + } + + //sort the array + natcasesort($activeModules); + return $activeModules; + } + + public function getNonActiveModules() + { + $module_handler = xoops_gethandler('module'); + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('isactive', 0)); + $criteria->setSort('name'); + $criteria->setOrder('ASC'); + +// $tempModulesList = $module_handler->getList($criteria); + $tempModulesObj = $module_handler->getObjects($criteria); + +// sort($tempModulesList); + $nonActiveModules = array(); + foreach ($tempModulesObj as $moduleObj) { + $nonActiveModules[] = $moduleObj->getVar('name') . ' ' . round($moduleObj->getVar('version') / 100, 2); + } + + //sort the array + natcasesort($nonActiveModules); + return $nonActiveModules; + } + + public function getActiveModulesList() + { + $activeModulesList = ''; + $activeModulesList .= ' \n'; + $activeModulesList .= 'Active Modules:' . ' \n'; + $activeModulesList .= '---------------' . ' \n'; + $activeModules = $this->getActiveModules(); + foreach ($activeModules as $key => $value) { + $activeModulesList .= $value . ' \n'; + } + return $activeModulesList; + } + + public function getNonActiveModulesList() + { + $nonActiveModulesList = ''; + $nonActiveModulesList .= ' \n'; + $nonActiveModulesList .= 'Deactivated Modules:' . ' \n'; + $nonActiveModulesList .= '---------------' . ' \n'; + $nonActiveModules = $this->getNonActiveModules(); + foreach ($nonActiveModules as $key => $value) { + $nonActiveModulesList .= $value . ' \n'; + } + return $nonActiveModulesList; + } + + +} Added: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/ZeroClipboard.swf =================================================================== (Binary files differ) Index: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/ZeroClipboard.swf =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/ZeroClipboard.swf 2015-02-16 22:27:26 UTC (rev 12987) +++ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/ZeroClipboard.swf 2015-02-17 00:26:34 UTC (rev 12988) Property changes on: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/ZeroClipboard.swf ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/index.html =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/index.html (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/index.html 2015-02-17 00:26:34 UTC (rev 12988) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/jquery.zclip.js =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/jquery.zclip.js (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/jquery.zclip.js 2015-02-17 00:26:34 UTC (rev 12988) @@ -0,0 +1,495 @@ +/* + * zClip :: jQuery ZeroClipboard v1.1.1 + * http://steamdev.com/zclip + * + * Copyright 2011, SteamDev + * Released under the MIT license. + * http://www.opensource.org/licenses/mit-license.php + * + * Date: Wed Jun 01, 2011 + */ + + +(function ($) { + + $.fn.zclip = function (params) { + + if (typeof params == "object" && !params.length) { + + var settings = $.extend({ + + path: 'ZeroClipboard.swf', + copy: null, + beforeCopy: null, + afterCopy: null, + clickAfter: true, + setHandCursor: true, + setCSSEffects: true + + }, params); + + + return this.each(function () { + + var o = $(this); + + if (o.is(':visible') && (typeof settings.copy == 'string' || $.isFunction(settings.copy))) { + + ZeroClipboard.setMoviePath(settings.path); + var clip = new ZeroClipboard.Client(); + + if($.isFunction(settings.copy)){ + o.bind('zClip_copy',settings.copy); + } + if($.isFunction(settings.beforeCopy)){ + o.bind('zClip_beforeCopy',settings.beforeCopy); + } + if($.isFunction(settings.afterCopy)){ + o.bind('zClip_afterCopy',settings.afterCopy); + } + + clip.setHandCursor(settings.setHandCursor); + clip.setCSSEffects(settings.setCSSEffects); + clip.addEventListener('mouseOver', function (client) { + o.trigger('mouseenter'); + }); + clip.addEventListener('mouseOut', function (client) { + o.trigger('mouseleave'); + }); + clip.addEventListener('mouseDown', function (client) { + + o.trigger('mousedown'); + + if(!$.isFunction(settings.copy)){ + clip.setText(settings.copy); + } else { + clip.setText(o.triggerHandler('zClip_copy')); + } + + if ($.isFunction(settings.beforeCopy)) { + o.trigger('zClip_beforeCopy'); + } + + }); + + clip.addEventListener('complete', function (client, text) { + + if ($.isFunction(settings.afterCopy)) { + + o.trigger('zClip_afterCopy'); + + } else { + if (text.length > 500) { + text = text.substr(0, 500) + "...\n\n(" + (text.length - 500) + " characters not shown)"; + } + + o.removeClass('hover'); + alert("Copied text to clipboard:\n\n " + text); + } + + if (settings.clickAfter) { + o.trigger('click'); + } + + }); + + + clip.glue(o[0], o.parent()[0]); + + $(window).bind('load resize',function(){clip.reposition();}); + + + } + + }); + + } else if (typeof params == "string") { + + return this.each(function () { + + var o = $(this); + + params = params.toLowerCase(); + var zclipId = o.data('zclipId'); + var clipElm = $('#' + zclipId + '.zclip'); + + if (params == "remove") { + + clipElm.remove(); + o.removeClass('active hover'); + + } else if (params == "hide") { + + clipElm.hide(); + o.removeClass('active hover'); + + } else if (params == "show") { + + clipElm.show(); + + } + + }); + + } + + } + + + +})(jQuery); + + + + + + + +// ZeroClipboard +// Simple Set Clipboard System +// Author: Joseph Huckaby +var ZeroClipboard = { + + version: "1.0.7", + clients: {}, + // registered upload clients on page, indexed by id + moviePath: 'ZeroClipboard.swf', + // URL to movie + nextId: 1, + // ID of next movie + $: function (thingy) { + // simple DOM lookup utility function + if (typeof(thingy) == 'string') thingy = document.getElementById(thingy); + if (!thingy.addClass) { + // extend element with a few useful methods + thingy.hide = function () { + this.style.display = 'none'; + }; + thingy.show = function () { + this.style.display = ''; + }; + thingy.addClass = function (name) { + this.removeClass(name); + this.className += ' ' + name; + }; + thingy.removeClass = function (name) { + var classes = this.className.split(/\s+/); + var idx = -1; + for (var k = 0; k < classes.length; k++) { + if (classes[k] == name) { + idx = k; + k = classes.length; + } + } + if (idx > -1) { + classes.splice(idx, 1); + this.className = classes.join(' '); + } + return this; + }; + thingy.hasClass = function (name) { + return !!this.className.match(new RegExp("\\s*" + name + "\\s*")); + }; + } + return thingy; + }, + + setMoviePath: function (path) { + // set path to ZeroClipboard.swf + this.moviePath = path; + }, + + dispatch: function (id, eventName, args) { + // receive event from flash movie, send to client + var client = this.clients[id]; + if (client) { + client.receiveEvent(eventName, args); + } + }, + + register: function (id, client) { + // register new client to receive events + this.clients[id] = client; + }, + + getDOMObjectPosition: function (obj, stopObj) { + // get absolute coordinates for dom element + var info = { + left: 0, + top: 0, + width: obj.width ? obj.width : obj.offsetWidth, + height: obj.height ? obj.height : obj.offsetHeight + }; + + if (obj && (obj != stopObj)) { + info.left += obj.offsetLeft; + info.top += obj.offsetTop; + } + + return info; + }, + + Client: function (elem) { + // constructor for new simple upload client + this.handlers = {}; + + // unique ID + this.id = ZeroClipboard.nextId++; + this.movieId = 'ZeroClipboardMovie_' + this.id; + + // register client with singleton to receive flash events + ZeroClipboard.register(this.id, this); + + // create movie + if (elem) this.glue(elem); + } +}; + +ZeroClipboard.Client.prototype = { + + id: 0, + // unique ID for us + ready: false, + // whether movie is ready to receive events or not + movie: null, + // reference to movie object + clipText: '', + // text to copy to clipboard + handCursorEnabled: true, + // whether to show hand cursor, or default pointer cursor + cssEffects: true, + // enable CSS mouse effects on dom container + handlers: null, + // user event handlers + glue: function (elem, appendElem, stylesToAdd) { + // glue to DOM element + // elem can be ID or actual DOM element object + this.domElement = ZeroClipboard.$(elem); + + // float just above object, or zIndex 99 if dom element isn't set + var zIndex = 99; + if (this.domElement.style.zIndex) { + zIndex = parseInt(this.domElement.style.zIndex, 10) + 1; + } + + if (typeof(appendElem) == 'string') { + appendElem = ZeroClipboard.$(appendElem); + } else if (typeof(appendElem) == 'undefined') { + appendElem = document.getElementsByTagName('body')[0]; + } + + // find X/Y position of domElement + var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem); + + // create floating DIV above element + this.div = document.createElement('div'); + this.div.className = "zclip"; + this.div.id = "zclip-" + this.movieId; + $(this.domElement).data('zclipId', 'zclip-' + this.movieId); + var style = this.div.style; + style.position = 'absolute'; + style.left = '' + box.left + 'px'; + style.top = '' + box.top + 'px'; + style.width = '' + box.width + 'px'; + style.height = '' + box.height + 'px'; + style.zIndex = zIndex; + + if (typeof(stylesToAdd) == 'object') { + for (addedStyle in stylesToAdd) { + style[addedStyle] = stylesToAdd[addedStyle]; + } + } + + // style.backgroundColor = '#f00'; // debug + appendElem.appendChild(this.div); + + this.div.innerHTML = this.getHTML(box.width, box.height); + }, + + getHTML: function (width, height) { + // return HTML for movie + var html = ''; + var flashvars = 'id=' + this.id + '&width=' + width + '&height=' + height; + + if (navigator.userAgent.match(/MSIE/)) { + // IE gets an OBJECT tag + var protocol = location.href.match(/^https/i) ? 'https://' : 'http://'; + html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="' + protocol + 'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="' + width + '" height="' + height + '" id="' + this.movieId + '" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="' + ZeroClipboard.moviePath + '" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="' + flashvars + '"/><param name="wmode" value="transparent"/></object>'; + } else { + // all other browsers get an EMBED tag + html += '<embed id="' + this.movieId + '" src="' + ZeroClipboard.moviePath + '" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="' + width + '" height="' + height + '" name="' + this.movieId + '" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="' + flashvars + '" wmode="transparent" />'; + } + return html; + }, + + hide: function () { + // temporarily hide floater offscreen + if (this.div) { + this.div.style.left = '-2000px'; + } + }, + + show: function () { + // show ourselves after a call to hide() + this.reposition(); + }, + + destroy: function () { + // destroy control and floater + if (this.domElement && this.div) { + this.hide(); + this.div.innerHTML = ''; + + var body = document.getElementsByTagName('body')[0]; + try { + body.removeChild(this.div); + } catch (e) {; + } + + this.domElement = null; + this.div = null; + } + }, + + reposition: function (elem) { + // reposition our floating div, optionally to new container + // warning: container CANNOT change size, only position + if (elem) { + this.domElement = ZeroClipboard.$(elem); + if (!this.domElement) this.hide(); + } + + if (this.domElement && this.div) { + var box = ZeroClipboard.getDOMObjectPosition(this.domElement); + var style = this.div.style; + style.left = '' + box.left + 'px'; + style.top = '' + box.top + 'px'; + } + }, + + setText: function (newText) { + // set text to be copied to clipboard + this.clipText = newText; + if (this.ready) { + this.movie.setText(newText); + } + }, + + addEventListener: function (eventName, func) { + // add user event listener for event + // event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel + eventName = eventName.toString().toLowerCase().replace(/^on/, ''); + if (!this.handlers[eventName]) { + this.handlers[eventName] = []; + } + this.handlers[eventName].push(func); + }, + + setHandCursor: function (enabled) { + // enable hand cursor (true), or default arrow cursor (false) + this.handCursorEnabled = enabled; + if (this.ready) { + this.movie.setHandCursor(enabled); + } + }, + + setCSSEffects: function (enabled) { + // enable or disable CSS effects on DOM container + this.cssEffects = !! enabled; + }, + + receiveEvent: function (eventName, args) { + // receive event from flash + eventName = eventName.toString().toLowerCase().replace(/^on/, ''); + + // special behavior for certain events + switch (eventName) { + case 'load': + // movie claims it is ready, but in IE this isn't always the case... + // bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function + this.movie = document.getElementById(this.movieId); + if (!this.movie) { + var self = this; + setTimeout(function () { + self.receiveEvent('load', null); + }, 1); + return; + } + + // firefox on pc needs a "kick" in order to set these in certain cases + if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) { + var self = this; + setTimeout(function () { + self.receiveEvent('load', null); + }, 100); + this.ready = true; + return; + } + + this.ready = true; + try { + this.movie.setText(this.clipText); + } catch (e) {} + try { + this.movie.setHandCursor(this.handCursorEnabled); + } catch (e) {} + break; + + case 'mouseover': + if (this.domElement && this.cssEffects) { + this.domElement.addClass('hover'); + if (this.recoverActive) { + this.domElement.addClass('active'); + } + + + } + + + break; + + case 'mouseout': + if (this.domElement && this.cssEffects) { + this.recoverActive = false; + if (this.domElement.hasClass('active')) { + this.domElement.removeClass('active'); + this.recoverActive = true; + } + this.domElement.removeClass('hover'); + + } + break; + + case 'mousedown': + if (this.domElement && this.cssEffects) { + this.domElement.addClass('active'); + } + break; + + case 'mouseup': + if (this.domElement && this.cssEffects) { + this.domElement.removeClass('active'); + this.recoverActive = false; + } + break; + } // switch eventName + if (this.handlers[eventName]) { + for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) { + var func = this.handlers[eventName][idx]; + + if (typeof(func) == 'function') { + // actual function reference + func(this, args); + } else if ((typeof(func) == 'object') && (func.length == 2)) { + // PHP style object + method, i.e. [myObject, 'myMethod'] + func[0][func[1]](this, args); + } else if (typeof(func) == 'string') { + // name of function + window[func](this, args); + } + } // foreach event handler defined + } // user defined handler for event + } + +}; + Added: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/jquery.zclip.min.js =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/jquery.zclip.min.js (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/jquery.zclip.min.js 2015-02-17 00:26:34 UTC (rev 12988) @@ -0,0 +1,12 @@ +/* + * zClip :: jQuery ZeroClipboard v1.1.1 + * http://steamdev.com/zclip + * + * Copyright 2011, SteamDev + * Released under the MIT license. + * http://www.opensource.org/licenses/mit-license.php + * + * Date: Wed Jun 01, 2011 + */ + +(function(a){a.fn.zclip=function(c){if(typeof c=="object"&&!c.length){var b=a.extend({path:"ZeroClipboard.swf",copy:null,beforeCopy:null,afterCopy:null,clickAfter:true,setHandCursor:true,setCSSEffects:true},c);return this.each(function(){var e=a(this);if(e.is(":visible")&&(typeof b.copy=="string"||a.isFunction(b.copy))){ZeroClipboard.setMoviePath(b.path);var d=new ZeroClipboard.Client();if(a.isFunction(b.copy)){e.bind("zClip_copy",b.copy)}if(a.isFunction(b.beforeCopy)){e.bind("zClip_beforeCopy",b.beforeCopy)}if(a.isFunction(b.afterCopy)){e.bind("zClip_afterCopy",b.afterCopy)}d.setHandCursor(b.setHandCursor);d.setCSSEffects(b.setCSSEffects);d.addEventListener("mouseOver",function(f){e.trigger("mouseenter")});d.addEventListener("mouseOut",function(f){e.trigger("mouseleave")});d.addEventListener("mouseDown",function(f){e.trigger("mousedown");if(!a.isFunction(b.copy)){d.setText(b.copy)}else{d.setText(e.triggerHandler("zClip_copy"))}if(a.isFunction(b.beforeCopy)){e.trigger("zClip_beforeCopy")}});d.addEventListener("complete",function(f,g){if(a.isFunction(b.afterCopy)){e.trigger("zClip_afterCopy")}else{if(g.length>500){g=g.substr(0,500)+"...\n\n("+(g.length-500)+" characters not shown)"}e.removeClass("hover");alert("Copied text to clipboard:\n\n "+g)}if(b.clickAfter){e.trigger("click")}});d.glue(e[0],e.parent()[0]);a(window).bind("load resize",function(){d.reposition()})}})}else{if(typeof c=="string"){return this.each(function(){var f=a(this);c=c.toLowerCase();var e=f.data("zclipId");var d=a("#"+e+".zclip");if(c=="remove"){d.remove();f.removeClass("active hover")}else{if(c=="hide"){d.hide();f.removeClass("active hover")}else{if(c=="show"){d.show()}}}})}}}})(jQuery);var ZeroClipboard={version:"1.0.7",clients:{},moviePath:"ZeroClipboard.swf",nextId:1,$:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}if(!a.addClass){a.hide=function(){this.style.display="none"};a.show=function(){this.style.display=""};a.addClass=function(b){this.removeClass(b);this.className+=" "+b};a.removeClass=function(d){var e=this.className.split(/\s+/);var b=-1;for(var c=0;c<e.length;c++){if(e[c]==d){b=c;c=e.length}}if(b>-1){e.splice(b,1);this.className=e.join(" ")}return this};a.hasClass=function(b){return !!this.className.match(new RegExp("\\s*"+b+"\\s*"))}}return a},setMoviePath:function(a){this.moviePath=a},dispatch:function(d,b,c){var a=this.clients[d];if(a){a.receiveEvent(b,c)}},register:function(b,a){this.clients[b]=a},getDOMObjectPosition:function(c,a){var b={left:0,top:0,width:c.width?c.width:c.offsetWidth,height:c.height?c.height:c.offsetHeight};if(c&&(c!=a)){b.left+=c.offsetLeft;b.top+=c.offsetTop}return b},Client:function(a){this.handlers={};this.id=ZeroClipboard.nextId++;this.movieId="ZeroClipboardMovie_"+this.id;ZeroClipboard.register(this.id,this);if(a){this.glue(a)}}};ZeroClipboard.Client.prototype={id:0,ready:false,movie:null,clipText:"",handCursorEnabled:true,cssEffects:true,handlers:null,glue:function(d,b,e){this.domElement=ZeroClipboard.$(d);var f=99;if(this.domElement.style.zIndex){f=parseInt(this.domElement.style.zIndex,10)+1}if(typeof(b)=="string"){b=ZeroClipboard.$(b)}else{if(typeof(b)=="undefined"){b=document.getElementsByTagName("body")[0]}}var c=ZeroClipboard.getDOMObjectPosition(this.domElement,b);this.div=document.createElement("div");this.div.className="zclip";this.div.id="zclip-"+this.movieId;$(this.domElement).data("zclipId","zclip-"+this.movieId);var a=this.div.style;a.position="absolute";a.left=""+c.left+"px";a.top=""+c.top+"px";a.width=""+c.width+"px";a.height=""+c.height+"px";a.zIndex=f;if(typeof(e)=="object"){for(addedStyle in e){a[addedStyle]=e[addedStyle]}}b.appendChild(this.div);this.div.innerHTML=this.getHTML(c.width,c.height)},getHTML:function(d,a){var c="";var b="id="+this.id+"&width="+d+"&height="+a;if(navigator.userAgent.match(/MSIE/)){var e=location.href.match(/^https/i)?"https://":"http://";c+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+e+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+d+'" height="'+a+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+b+'"/><param name="wmode" value="transparent"/></object>'}else{c+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+d+'" height="'+a+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+b+'" wmode="transparent" />'}return c},hide:function(){if(this.div){this.div.style.left="-2000px"}},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(b){}this.domElement=null;this.div=null}},reposition:function(c){if(c){this.domElement=ZeroClipboard.$(c);if(!this.domElement){this.hide()}}if(this.domElement&&this.div){var b=ZeroClipboard.getDOMObjectPosition(this.domElement);var a=this.div.style;a.left=""+b.left+"px";a.top=""+b.top+"px"}},setText:function(a){this.clipText=a;if(this.ready){this.movie.setText(a)}},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");if(!this.handlers[a]){this.handlers[a]=[]}this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a;if(this.ready){this.movie.setHandCursor(a)}},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(d,f){d=d.toString().toLowerCase().replace(/^on/,"");switch(d){case"load":this.movie=document.getElementById(this.movieId);if(!this.movie){var c=this;setTimeout(function(){c.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var c=this;setTimeout(function(){c.receiveEvent("load",null)},100);this.ready=true;return}this.ready=true;try{this.movie.setText(this.clipText)}catch(h){}try{this.movie.setHandCursor(this.handCursorEnabled)}catch(h){}break;case"mouseover":if(this.domElement&&this.cssEffects){this.domElement.addClass("hover");if(this.recoverActive){this.domElement.addClass("active")}}break;case"mouseout":if(this.domElement&&this.cssEffects){this.recoverActive=false;if(this.domElement.hasClass("active")){this.domElement.removeClass("active");this.recoverActive=true}this.domElement.removeClass("hover")}break;case"mousedown":if(this.domElement&&this.cssEffects){this.domElement.addClass("active")}break;case"mouseup":if(this.domElement&&this.cssEffects){this.domElement.removeClass("active");this.recoverActive=false}break}if(this.handlers[d]){for(var b=0,a=this.handlers[d].length;b<a;b++){var g=this.handlers[d][b];if(typeof(g)=="function"){g(this,f)}else{if((typeof(g)=="object")&&(g.length==2)){g[0][g[1]](this,f)}else{if(typeof(g)=="string"){window[g](this,f)}}}}}}}; \ No newline at end of file Added: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/xoopssysteminfo.js =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/xoopssysteminfo.js (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/js/systeminfo/xoopssysteminfo.js 2015-02-17 00:26:34 UTC (rev 12988) @@ -0,0 +1,23 @@ +/** + * Created by mamba on 2015-02-16. + * source: http://www.steamdev.com/zclip + */ +$(document).ready(function () { + + $("a#copy-callbacks").zclip({ + path: 'modules/system/js/systeminfo/ZeroClipboard.swf', +// copy:$('#callback-paragraph').text(), + + copy: systemInformation, + + beforeCopy: function () { + $('#callback-paragraph').css('background', 'yellow'); + $(this).css('color', 'orange'); + }, + afterCopy: function () { + $('#callback-paragraph').css('background', 'green'); + $(this).css('color', 'purple'); + $(this).next('.check').show(); + } + }); +}); Added: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/default.php =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/default.php (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/default.php 2015-02-17 00:26:34 UTC (rev 12988) @@ -0,0 +1,339 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +xoops_load('gui', 'system'); + +/* + * Xoops Cpanel default GUI class + * + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package system + * @usbpackage GUI + * @since 2.4 + * @author Mamba XXXXXXXXXXXXXXXXXXX + * @author Mojtabajml <jam...@gm...> + * @author Voltan <djv...@gm...> + * @author BitC3R0 <Bi...@gm...> + * @author trabis <lus...@gm...> + * @version 1.2 + * @version $Id: default.php 12852 2014-11-17 03:34:31Z rgriffith $ + */ + +/** + * Class XoopsGuiDefault + */ + +class XoopsGuiDefault extends XoopsSystemGui +{ + + /** + * + */ + function __construct() + { + } + + function XoopsGuiDefault() + { + $this->__construct(); + } + + /** + * @return bool + */ + function validate() + { + return true; + } + + function header() + { + parent::header(); + + global $xoopsConfig, $xoopsUser, $xoopsModule, $xoTheme, $xoopsTpl; + $tpl =& $this->template; + + $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js'); + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/styleswitch.js'); + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/formenu.js'); + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/menu.js'); + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/tooltip.js'); + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/tabs.jquery.tools.min.js'); + + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/style.css' ); + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/dark.css', array('title' => 'dark', 'media' => 'screen')); + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/silver.css', array('title' => 'silver', 'media' => 'screen')); + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/orange.css', array('title' => 'orange', 'media' => 'screen')); + + $tpl->assign('lang_cp', _CPHOME); + //start system overview + +//mamba ------------- start ----------------- + + include_once __DIR__ . '/../../class/XoopsSystemInfo.php'; + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/../js/systeminfo/jquery.zclip.min.js'); + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/../js/systeminfo/xoopssysteminfo.js'); + + $systemInfo = new XoopsSystemInfo; + $systemInfo->assignSystemInfoValuesToSmarty($tpl); + $systemInformation = $systemInfo->getSystemInfoValues(); + $systemInformation .= $systemInfo->getActiveModulesList(); + $systemInformation .= $systemInfo->getNonActiveModulesList(); + ?> + <script type="text/javascript"> + var systemInformation = "<?php echo $systemInformation ?>"; + </script> + <?php + + + //$tpl->assign('lang_xoops_version', XOOPS_VERSION); + +// $tpl->assign('lang_php_vesion', PHP_VERSION); +// $tpl->assign('lang_mysql_version', mysql_get_server_info()); +// $tpl->assign('lang_server_api', PHP_SAPI); +// $tpl->assign('lang_os_name', PHP_OS); +// $tpl->assign('safe_mode', ini_get( 'safe_mode' ) ? 'On' : 'Off'); +// $tpl->assign('register_globals', ini_get( 'register_globals' ) ? 'On' : 'Off'); +// $tpl->assign('magic_quotes_gpc', ini_get( 'magic_quotes_gpc' ) ? 'On' : 'Off'); +// $tpl->assign('allow_url_fopen', ini_get( 'allow_url_fopen' ) ? 'On' : 'Off'); +// $tpl->assign('fsockopen', function_exists( 'fsockopen' ) ? 'On' : 'Off'); +// $tpl->assign('allow_call_time_pass_reference', ini_get( 'allow_call_time_pass_reference' ) ? 'On' : 'Off'); +// $tpl->assign('post_max_size', ini_get( 'post_max_size' )); +// $tpl->assign('max_input_time', ini_get( 'max_input_time' )); +// $tpl->assign('output_buffering', ini_get( 'output_buffering' )); +// $tpl->assign('max_execution_time', ini_get( 'max_execution_time' )); +// $tpl->assign('memory_limit', ini_get( 'memory_limit' )); +// $tpl->assign('file_uploads', ini_get( 'file_uploads' ) ? 'On' : 'Off'); +// $tpl->assign('upload_max_filesize', ini_get( 'upload_max_filesize' )); +// $tpl->assign('xoops_sitename', $xoopsConfig['sitename']); + +//mamba ------------- end ----------------- + + + // ADD MENU ***************************************** + + //Add CONTROL PANEL Menu items + $menu = array(); + $menu[0]['link'] = XOOPS_URL; + $menu[0]['title'] = _YOURHOME; + $menu[0]['absolute'] = 1; + $menu[1]['link'] = XOOPS_URL . '/admin.php?xoopsorgnews=1'; + $menu[1]['title'] = _OXYGEN_NEWS; + $menu[1]['absolute'] = 1; + $menu[1]['icon'] = XOOPS_ADMINTHEME_URL . '/default/images/xoops.png'; + $menu[2]['link'] = XOOPS_URL . '/user.php?op=logout'; + $menu[2]['title'] = _LOGOUT; + $menu[2]['absolute'] = 1; + $menu[2]['icon'] = XOOPS_ADMINTHEME_URL . '/default/images/logout.png'; + $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php', 'text' => _CPHOME, 'menu' => $menu)); + + //add SYSTEM Menu items + include __DIR__ . '/menu.php'; + if (empty($xoopsModule) || 'system' == $xoopsModule->getVar('dirname', 'n')) { + $modpath = XOOPS_URL . '/admin.php'; + $modname = _OXYGEN_SYSOPTIONS; + $modid = 1; + $moddir = 'system'; + + $mod_options = $adminmenu; + foreach (array_keys($mod_options) as $item) { + $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . '/modules/'.$moddir.'/' . $mod_options[$item]['link'] : $mod_options[$item]['link']; + $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_ADMINTHEME_URL . '/default/' . $mod_options[$item]['icon']; + unset($mod_options[$item]['icon_small']); + } + } else { + $moddir = $xoopsModule->getVar('dirname', 'n'); + $modpath = XOOPS_URL . '/modules/' . $moddir; + $modname = $xoopsModule->getVar('name'); + $modid = $xoopsModule->getVar('mid'); + + $mod_options = $xoopsModule->getAdminMenu(); + foreach (array_keys($mod_options) as $item) { + $mod_options[$item]['link'] = empty($mod_options[$item]['absolute']) ? XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['link'] : $mod_options[$item]['link']; + $mod_options[$item]['icon'] = empty($mod_options[$item]['icon']) ? '' : XOOPS_URL . "/modules/{$moddir}/" . $mod_options[$item]['icon']; + } + } + + $tpl->assign('mod_options', $mod_options); + $tpl->assign('modpath', $modpath); + $tpl->assign('modname', $modname); + $tpl->assign('modid', $modid); + $tpl->assign('moddir', $moddir); + + // add MODULES Menu items + $module_handler =& xoops_gethandler('module'); + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('hasadmin', 1)); + $criteria->add(new Criteria('isactive', 1)); + $criteria->setSort('mid'); + $mods = $module_handler->getObjects($criteria); + + $menu = array(); + $moduleperm_handler =& xoops_gethandler('groupperm'); + foreach ($mods as $mod) { + $rtn = array(); + $modOptions = array(); //add for sub menus + $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups()); + if ($sadmin) { + $info = $mod->getInfo(); + if (!empty($info['adminindex'])) { + $rtn['link'] = XOOPS_URL . '/modules/'. $mod->getVar('dirname', 'n') . '/' . $info['adminindex']; + } else { + $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid'); + } + $rtn['title'] = htmlspecialchars($mod->name(), ENT_QUOTES); + $rtn['absolute'] = 1; + $rtn['url'] = XOOPS_URL . '/modules/'. $mod->getVar('dirname', 'n') . '/'; //add for sub menus + $modOptions = $mod->getAdminMenu(); //add for sub menus + $rtn['options'] = $modOptions; //add for sub menus + + if (isset($info['icon']) && $info['icon'] != '' ) { + $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon']; + } + $menu[] = $rtn; + } + + } + $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin', + 'text' => _AM_SYSTEM_MODULES, 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu)); + + // add preferences menu + $menu = array(); + + $OPT = array(); + $OPT[] = array( + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=1', + 'title' => _OXYGEN_GENERAL, + 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + $OPT[] = array( + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=2', + 'title' => _OXYGEN_USERSETTINGS, + 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + $OPT[] = array( + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=3', + 'title' => _OXYGEN_METAFOOTER, + 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + $OPT[] = array( + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=4', + 'title' => _OXYGEN_CENSOR, + 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + $OPT[] = array( + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=5', + 'title' => _OXYGEN_SEARCH, + 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + $OPT[] = array( + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=6', + 'title' => _OXYGEN_MAILER, + 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + $OPT[] = array( + 'link' => 'admin.php?fct=preferences&op=show&confcat_id=7', + 'title' => _OXYGEN_AUTHENTICATION, + 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + $OPT[] = array( + 'link' => 'admin.php?fct=preferences&op=showmod&mod=1', + 'title' => _OXYGEN_MODULESETTINGS, + 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/icons/prefs_small.png'); + + $menu[] = array( + 'link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences', + 'title' => _OXYGEN_SYSOPTIONS, + 'absolute' => 1, + 'url' => XOOPS_URL . '/modules/system/', + 'options' => $OPT); + + foreach ($mods as $mod) { + $rtn = array(); + $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups()); + if ($sadmin && ($mod->getVar('hasnotification') || is_array($mod->getInfo('config')) || is_array($mod->getInfo('comments')))) { + $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid'); + $rtn['title'] = htmlspecialchars($mod->name(), ENT_QUOTES); + $rtn['absolute'] = 1; + $rtn['icon'] = XOOPS_ADMINTHEME_URL . '/gui/oxygen/icons/prefs_small.png'; + $menu[] = $rtn; + } + } + $tpl->append('navitems', array('link' => XOOPS_URL . '/modules/system/admin.php?fct=preferences', 'text' => _OXYGEN_SITEPREF, 'dir' => $mod->getVar('dirname', 'n'), 'menu' => $menu)); + + //add OPTIONS/Links Menu Items + $menu = array(); + $menu[] = array( + 'link' => 'http://sourceforge.net/projects/xoops/', + 'title' => _OXYGEN_XOOPSPROJECT, + 'absolute' => 1); + $menu[] = array( + 'link' => 'http://xoops.org', + 'title' => _OXYGEN_WEBSITE, + 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/images/xoops.png'); + $menu[] = array( + 'link' => 'http://www.xoops.org/modules/repository/', + 'title' => _OXYGEN_XOOPSMODULES, + 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/images/xoops.png'); + $menu[] = array( + 'link' => 'http://www.xoops.org/modules/extgallery/', + 'title' => _OXYGEN_XOOPSTHEMES, + 'absolute' => 1, + 'icon' => XOOPS_ADMINTHEME_URL . '/default/images/tweb.png'); + + $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php','text' => _OXYGEN_INTERESTSITES, 'menu' => $menu)); + + //add OPTIONS/links for local support + if (file_exists($file = XOOPS_ADMINTHEME_PATH . '/default/language/' . $xoopsConfig['language'] . '/localsupport.php' )) { + $links = include XOOPS_ADMINTHEME_PATH . '/default/language/' . $xoopsConfig['language'] . '/localsupport.php'; + if ( count($links) > 0 ) { + $tpl->append('navitems', array('link' => XOOPS_URL . '/admin.php','text' => _OXYGEN_LOCALSUPPORT, 'menu' => $links)); + } + } + + if (is_object($xoopsModule) || !empty($_GET['xoopsorgnews'])) { + if (is_object($xoopsModule) && file_exists($file = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/' . $xoopsModule->getInfo('adminmenu'))) { + include $file; + } + + return; + } + + foreach ($mods as $mod) { + + $sadmin = $moduleperm_handler->checkRight ( 'module_admin', $mod->getVar ( 'mid' ), $xoopsUser->getGroups () ); + if ($sadmin) { + $rtn = array (); + $info = $mod->getInfo (); + if (! empty ( $info ['adminindex'] )) { + $rtn ['link'] = XOOPS_URL . '/modules/' . $mod->getVar ( 'dirname', 'n' ) . '/' . $info ['adminindex']; + } else { + $rtn ['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar ( 'mid' ); + } + $rtn ['title'] = htmlspecialchars($mod->getVar ('name'), ENT_QUOTES); + $rtn ['description'] = $mod->getInfo('description'); + $rtn ['absolute'] = 1; + if (isset ( $info ['icon_big'] )) { + $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar ( 'dirname', 'n' ) . '/' . $info ['icon_big']; + } elseif (isset ( $info ['image'] )) { + $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar ( 'dirname', 'n' ) . '/' . $info ['image']; + } + + $tpl->append ( 'modules', $rtn ); + } + + } + } +} Added: XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/default.php_original =================================================================== --- XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/default.php_original (rev 0) +++ XoopsCore/branches/2.5.x/2.5.8_hack_systeminfo/htdocs/modules/system/themes/default/default.php_original 2015-02-17 00:26:34 UTC (rev 12988) @@ -0,0 +1,315 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +xoops_load('gui', 'system'); + +/* + * Xoops Cpanel default GUI class + * + * @copyright (c) 2000-2014 XOOPS Project (www.xoops.org) + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package system + * @usbpackage GUI + * @since 2.4 + * @author Mamba XXXXXXXXXXXXXXXXXXX + * @author Mojtabajml <jam...@gm...> + * @author Voltan <djv...@gm...> + * @author BitC3R0 <Bi...@gm...> + * @author trabis <lus...@gm...> + * @version 1.2 + * @version $Id: default.php 12852 2014-11-17 03:34:31Z rgriffith $ + */ + +/** + * Class XoopsGuiDefault + */ +class XoopsGuiDefault extends XoopsSystemGui +{ + + /** + * + */ + function __construct() + { + } + + function XoopsGuiDefault() + { + $this->__construct(); + } + + /** + * @return bool + */ + function validate() + { + return true; + } + + function header() + { + parent::header(); + + global $xoopsConfig, $xoopsUser, $xoopsModule, $xoTheme, $xoopsTpl; + $tpl =& $this->template; + + $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js'); + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/styleswitch.js'); + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/formenu.js'); + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/menu.js'); + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/tooltip.js'); + $xoTheme->addScript(XOOPS_ADMINTHEME_URL . '/default/js/tabs.jquery.tools.min.js'); + + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/style.css' ); + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/dark.css', array('title' => 'dark', 'media' => 'screen')); + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/silver.css', array('title' => 'silver', 'media' => 'screen')); + $xoTheme->addStylesheet(XOOPS_ADMINTHEME_URL . '/default/css/orange.css', array('title' => 'orange', 'media' => 'screen')); + + $tpl->assign('lang_cp', _CPHOME); + //start system overview + //$tpl->assign('lang_xoops_version', XOOPS_VERSION); + $tpl->assign('lang_php_vesion', PHP_VERSION); + $tpl->assign('lang_mysql_version', mysql_get_server_info()); + $tpl->assign('lang_server_api', PHP_SAPI); + $tpl->assign('lang_os_name', PHP_OS); + $tpl->assign('safe_mode', ini_get( 'safe_mode' ) ? 'On' : 'Off'); + $tpl->assign('register_globals', ini_get( 'register_globals' ) ? 'On' : 'Off'); + $tpl->assign('magic_quotes_gpc', ini_get( 'magic_quotes_gpc' ) ? 'On' : 'Off'); + $tpl->assign('allow_url_fopen', ini_get( 'allow_url_fopen' ) ? 'On' : 'Off'); + $tpl->assign('fsockopen', function_exists( 'fsockopen' ) ? 'On' : 'Off'); + $tpl->assign('allow_call_time_pass_reference', ini_get( 'allow_call_time_pass_reference' ) ? ... [truncated message content] |