| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/Engineering/V2/plugins/content/GlossyAccordionMenu/ |
Upload File : |
<?php
/**
* GlossyAccordionMenu plugin
* This plugin allows you to insert the Glossy Accordion Menu
* with the tags {Glossy_Accordion_Menu} ... {/Glossy_Accordion_Menu}.
* Author: kksou
* Copyright (C) 2006-2008. kksou.com. All Rights Reserved
* Website: http://www.kksou.com/php-gtk2
* v1.0 October 3, 2008
*/
#defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
class GlossyAccordionMenu_base2 {
function process(&$row, $matches) {
$this->menu_height = 100;
if (preg_match('/^(\d+)/', $matches[1], $matches2)) {
$this->menu_height = $matches2[1];
}
$this->float = '';
if (preg_match('/float:(left|right)(\d*)/', $matches[1], $matches2)) {
$this->float = $matches2[1];
$this->float_padding = $matches2[2];
}
$str = $this->fix_str2($matches[3]);
if (preg_match('/revealtype:(click|mouseover)/', $matches[1], $matches2)) {
$this->revealtype = $matches2[1];
}
$this->css = 'GlossyAccordionMenu.css';
if (preg_match('/css:([^\s]*)/', $matches[1], $matches2)) {
$this->css = $matches2[1];
}
$this->setup_css();
$str2 = $this->process_menu($str);
$row->text = str_replace($matches[0], $this->menu.$str2, $row->text);
}
function print_r2($label, $var) {
print $label."<br>";
$i = 0;
foreach($var as $k=>$v) {
print "[$k] ".htmlentities($v)."<br>";
++$i;
}
}
function process_menu($str) {
$lines = explode("\n", $str);
$i = 0;
$submenu_on = 0;
$str2 = '';
$lines2 = array();
foreach($lines as $line) {
if (trim($line)!='') $lines2[] = $line;
}
$has_submenu = array();
$level1 = 0;
for ($i=0; $i<count($lines2); ++$i) {
$line = $lines2[$i];
if (!preg_match('/^- /', $line)) {
$level1 = $i;
$has_submenu[$i] = 0;
} else {
$has_submenu[$level1] = 1;
}
}
for ($i=0; $i<count($lines2); ++$i) {
$line = $lines2[$i];
#if (trim($line)=='') continue;
$level = 1;
if (!preg_match('/^- /', $line)) {
$a = $line;
if ($has_submenu[$i]) {
$a = preg_replace('%<a\s(.*?href=.*?>.*?<\/a>)%s', '<a class="menuitem submenuheader" $1', $a);
} else {
$a = preg_replace('%<a\s(.*?href=.*?>.*?<\/a>)%s', '<a class="menuitem" $1', $a);
}
if ($line == strip_tags($line)) {
if ($has_submenu[$i]) {
$a = "<em class=\"menuitem submenuheader\">$line</em>";
} else {
$a = "<em class=\"menuitem\">$line</em>";
}
}
} else {
$level = 2;
$a = substr($line,2);
}
if ($level==1) {
if ($submenu_on) {
$str2 .= ' </ul></div>';
$submenu_on = 0;
}
$str2 .= $a;
} elseif ($level==2) {
if (!$submenu_on) {
$str2 .= ' <div class="submenu"><ul>';
$submenu_on = 1;
}
if (preg_match('/^\s*<img\ssrc=(.*)/s', $a)) {
$a = preg_replace('/^\s*<img\ssrc=(.*)/s', '<img style="padding-left:10px;padding-top:'.$this->img_top_padding.'px;padding-bottom:'.$this->img_bottom_padding.'px;" src=$1', $a);
$str2 .= $a;
} elseif (preg_match('/img/', $a)) {
if (preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) {
$a = preg_replace('/(.*)<img\ssrc=(.*)/s', '$1<img style="padding-top:'.$this->img_top_padding.'px;padding-bottom:'.$this->img_bottom_padding.'px;" src=$2', $a);
} else {
$a = preg_replace('/(.*)<img\ssrc=(.*)/s', '$1<img style="padding-left:10px;padding-top:'.$this->img_top_padding.'px;padding-bottom:'.$this->img_bottom_padding.'px;" src=$2', $a);
}
$str2 .= $a;
} elseif (trim($a) == '') {
$str2 .= '<br>';
} else {
$str2 .= " <li>$a</li>";
}
}
}
if ($submenu_on) {
$str2 .= ' </ul></div>';
$submenu_on = 0;
}
if (preg_match('/(left|right)/', $this->float)) {
$padding = '';
if ($this->float=='right') $padding = "padding-left:{$this->float_padding}px;";
elseif ($this->float=='left') $padding = "padding-right:{$this->float_padding}px;";
#$str2 = "<div style=\"float:$this->float;$padding\"><div class=\"applemenu\">".$str2.'</div></div>';
$str2 = "<div class=\"b1\" style=\"float:$this->float;$padding\"><div class=\"glossymenu\">".$str2."</div>$this->z</div>";
} else {
#$str2 = '<div class="applemenu">'.$str2.'</div>';
$str2 = "<table cellpadding=\"0\" cellspacing=\"0\" border=0><tr><td><div class=\"glossymenu\">".$str2."</div></td></tr><tr><td>$this->z</td></tr></table>";
}
return $str2;
}
function fix_str($str) {
$str = preg_replace(array('%<\?php(\s| |<br\s/>|<br>|<p>|</p>)%s', '/\?>/s', '/->/'), array('<?php ', '?>', '->'), $str);
return $str;
}
function fix_str2($str) {
$str = str_replace('<br>', "\n", $str);
$str = str_replace('<br />', "\n", $str);
$str = str_replace('<p>', "\n", $str);
$str = str_replace('</p>', "\n", $str);
$str = str_replace(''', "'", $str);
$str = str_replace('"', '"', $str);
$str = str_replace('<', '<', $str);
$str = str_replace('>', '>', $str);
$str = str_replace('&', '&', $str);
$str = str_replace(' ', ' ', $str);
$str = str_replace(' ', "\t", $str);
$str = str_replace("\r", "", $str);
$str = str_replace("\n\n", "\n", $str);
$str = str_replace(chr(hexdec('C2')).chr(hexdec('A0')), '', $str);
return $str;
}
function get_param($module, $ver) {
if ($ver=='1.0') {
$this->get_param10($module);
} elseif ($ver=='1.5') {
$this->get_param15($module);
}
if ($this->revealtype=='') $this->revealtype = 'click';
if ($this->menu_width<=10) $this->menu_width = 170;
}
function get_param10($module) {
global $database, $_MAMBOTS;
if ( !isset($_MAMBOTS->_content_mambot_params[$module]) ) {
$query = "SELECT params"
. "\n FROM #__mambots"
. "\n WHERE element = '$module'"
. "\n AND folder = 'content'"
;
$database->setQuery( $query );
$database->loadObject($mambot);
$_MAMBOTS->_content_mambot_params[$module] = $mambot;
}
$mambot = $_MAMBOTS->_content_mambot_params[$module];
$botParams = new mosParameters( $mambot->params );
$this->revealtype = $botParams->def( 'revealtype', 'click' );
$this->menu_width = $botParams->def( 'width', '170' );
$this->img_top_padding = $botParams->def( 'img_top_padding', '6' );
$this->img_bottom_padding = $botParams->def( 'img_bottom_padding', '4' );
global $mosConfig_live_site;
$this->base_url = $mosConfig_live_site."/mambots/content";
$this->base_url2 = $mosConfig_live_site."/mambots/content/GlossyAccordionMenu";
}
function get_param15($module) {
$plugin =& JPluginHelper::getPlugin('content', $module);
$pluginParams = new JParameter( $plugin->params );
$this->revealtype = $pluginParams->get('revealtype');
$this->menu_width = $pluginParams->get('width');
$this->img_top_padding = $pluginParams->get('img_top_padding');
$this->img_bottom_padding = $pluginParams->get('img_bottom_padding');
$mosConfig_live_site = JURI::base();
$this->base_url = $mosConfig_live_site."plugins/content";
$this->base_url2 = $mosConfig_live_site."plugins/content/GlossyAccordionMenu";
}
}
?>