Aktionen

Benutzer

Robert

Aus TCG 1874

			<!-- Start Test Menu -->
			<ul class="left">
				<li class="divider"></li>
                    <?php
					// Tiefer
					/*$EbeneM = '</a>
					<ul class="dropdown">
						<li class="title back js-generated"><h5><a href="javascript:void(0)">Back</a></h5></li>
						<li class="parent-link hide-for-medium-up"><a class="parent-link js-generated" href="#">Item 1</a></li>';*/
					// Höher
					$EbeneW = '</a></li>
					</ul>
				</li>';
					// Gleich
					$EbeneG = '</a></li>';
					
					$SidebarReturn = '';
					$CustomSidebarRaw = wfMessage( 'TCGsidebar' )->inContentLanguage()->text();
					$CustomSidebarClean = trim( preg_replace( array('/<!--(.*)-->/s'), array(''), $CustomSidebarRaw ) );
					$SidebarElements = explode( "\n", $CustomSidebarClean );
					foreach ($SidebarElements as $SidebarElement) {
						$tmp = explode( '|', $SidebarElement );
						
						# silently ignore lines that have more than one '|':
						if ( count( $tmp ) > 2 || count( $tmp ) < 1 ) {
							continue;
						} else {
							# Rang bestimmen
							$RangNeu = substr_count($tmp[0], '*');
							if (isset($RangAlt)) {
								if ($RangNeu == $RangAlt) {
									$SidebarReturn .= $SidebarReturnRTE[0];
									$SidebarReturn .= $EbeneG;
								}
								if ($RangNeu > $RangAlt) {
									$SidebarReturn .= $SidebarReturnRTE[1];
									$SidebarReturn .= $EbeneM;
								}
								if ($RangNeu < $RangAlt) {
									$SidebarReturn .= $SidebarReturnRTE[0];
									$SidebarReturn .= $EbeneW;
								}
								if ($RangNeu == 1) {
										$SidebarReturn .=  '
				<li class="divider"></li>
			</ul>
			<ul class="left">';
								}
							}
							$tmp[0] = substr($tmp[0], strpos($tmp[0], ' ')+1);
							
							# externe Links in neuem Fenster öffnen
							if (preg_match("http:", $SidebarElement)==1 || preg_match("https:", $SidebarElement)==1 || preg_match("ftp:", $SidebarElement)==1) {
								//$SidebarReturn .= '<li><a href="'. $tmp[0] .'" target="_new">'. $tmp[1];
								$SidebarReturnRTE[0] = '
							<li><a href="'. $tmp[0] .'" target="_new">'. $tmp[1];
								$SidebarReturnRTE[1] = '
							<li class="has-dropdown not-click"><a href="'. $tmp[0] .'" target="_new">'. $tmp[1];
								$EbeneM = '</a>
					<ul class="dropdown">
						<li class="title back js-generated"><h5><a href="javascript:void(0)">Back</a></h5></li>
						<li class="parent-link hide-for-medium-up"><a class="parent-link js-generated" href="'. $tmp[0] .'">'. $tmp[1] .'</a></li>
						<li><label>'. $tmp[1] .'</label></li>';

								$RangAlt = $RangNeu;
								continue;
							}
							$SidebarReturnRTE[1] =  '
							<li class="has-dropdown not-click"><a href="/index.php/'. $tmp[0] .'">'. $tmp[1];								
							$SidebarReturnRTE[0] =  '
							<li><a href="/index.php/'. $tmp[0] .'">'. $tmp[1];
								$EbeneM = '</a>
					<ul class="dropdown">
						<li class="title back js-generated"><h5><a href="javascript:void(0)">Back</a></h5></li>
						<li class="parent-link hide-for-medium-up"><a class="parent-link js-generated" href="/index.php/'. $tmp[0] .'">'. $tmp[1] .'</a></li>
						<li><label>'. $tmp[1] .'</label></li>';
							$RangAlt = $RangNeu;
						}
					}
					$SidebarReturn .= $SidebarReturnRTE[0];
					$SidebarReturn .= '
';
					echo $SidebarReturn;
					?>
					</a></li>
				<li class="divider"></li>
           	</ul>
        	<!-- End Test Menu -->