Exemplo n.º 1
0
 }
 $page->MainTitle($title, 'allsteps');
 // Display the keys and values
 $page->StartTable(2, array('class' => 'dbtests'));
 foreach ($sett as $key => $value) {
     $show = GetSettingsValue($value);
     $page->AddTableData('<b>' . $key . '</b>', array('style' => 'text-align:right; padding-right:12px;'));
     $page->AddTableData('<tt>' . $show . '</tt>');
 }
 $page->EndTable();
 // Make sure this mask file exists!
 if (isset($sett['maskname'])) {
     if ($mask->DoesMaskExistAndIsReadable($sett['maskname'])) {
         $page->SuccessBox('The mask file <b>' . $sett['maskname'] . '</b> exists and is readable');
         // The mask is checked for few things
         $maskContent = $mask->GetMask($sett['maskname'], false);
         // Get if ANY keyword is found in the mask
         $counts = $mask->GetReplaceKeywordCount($maskContent);
         if (is_array($counts) && count($counts) > 0) {
             $str = '';
             foreach ($counts as $word => $count) {
                 $str .= "\n" . '<br /><tt><b>' . $keywords['open_bracket'] . $word . $keywords['close_bracket'] . '</b></tt> = <b>' . $count . '</b>';
             }
             $page->SuccessBox('The mask file contains the following keywords:' . $str);
         } else {
             $page->InfoBox('This mask file does not contain any keywords to replace.');
         }
         // Check if there is SEPARATOR KEYWORD in the sql file
         $ext = $mask->GetMaskExtension($sett['maskname'], true);
         if ($ext == 'sql') {
             $counts = $mask->GetSqlSeparatorCount($maskContent);
Exemplo n.º 2
0
					{
						$keyword = $keywords['open_bracket'].$key.$keywords['close_bracket'];
						$query = str_replace($keyword, '<b>'.$keyword.'</b>', $query);
					}

					// Replace newlines with html break before displaying
					$query = str_replace("\n", "<br />", $query);
					echo '<div class="query">'.$query.'</div>';
				}			
			}
		}

		// Load the mask normally
		else
		{
			$content = $mask->GetMask($_GET['showmask'], true);

			// Text files do not contain HTML
			if($ext == 'txt')
				echo '<div class="query">'.str_replace("\n", "&nbsp;<br />", $content).'</div>';

			else if($ext == 'php')
				echo '<div class="phpcode">'.str_replace("\n", "&nbsp;<br />", htmlentities($content)).'</div>';

			else 
				echo '<div class="query">'.$content.'</div>';
		}
?>
</body>
</html>
<?