Example #1
0
 /**
  * Main dispatcher
  *
  * @return string   Return the compiled view content
  */
 public function dispatch()
 {
     ob_start();
     // Module and action are not defined by setters
     if (!$this->_explicit) {
         // Get uri from routes
         $uri = Route::getInstance()->parseUrl();
         // No uri found, try to load asset
         if (!$uri->isDefined() && Config::get('route.routed_only') == '1' && $uri->getUri(false) != '/') {
             $this->_loadAsset();
             Error::show404();
         }
         // Get module and action from route
         $this->_parseFromRequest($uri);
     }
     // Convert module/action to className
     $this->_getActionClassName();
     // Add to chaining for logs
     $this->_addToChain();
     // Initialize result
     $mv = '';
     // If action is authorized ...
     if ($this->_isAuthorized()) {
         //... process execute()
         $mv = $this->_processAction();
     } else {
         //... else process handleError()
         $mv = $this->_handleError();
     }
     // Action method result is an object, render view
     if (is_object($mv)) {
         $mv = $this->_processView($mv);
     }
     // Display to browser
     echo $mv;
     // Remove action from chain for logs
     $this->_removeFromChain();
     // No more actions in chain, render to browser
     if (empty($this->_chain['classNames'])) {
         ob_end_flush();
     }
 }
Example #2
0
<?php

namespace ThemeCheck;

require_once 'include/Bootstrap.php';
function ErrorHandler($errLevel, $errMsg, $errFile, $errLine)
{
    if ($errLevel & E_USER_ERROR) {
        $response["error"] = $errMsg;
        ob_clean();
        header('Content-Type: application/json');
        echo json_encode($response);
        die;
    }
}
set_error_handler(__NAMESPACE__ . "\\ErrorHandler");
// Multilingual url un-rewriting
$routeParts = Route::getInstance()->match();
if (empty($_GET["controller"]) || empty($_GET["action"])) {
    die;
}
$controller = $_GET["controller"];
$action = $_GET["action"];
if ($controller == "home" && $action == "seemore" || $controller == "home" && $action == "sort" || $controller == "massimport" && ($action == "importnext" || $action == "updatenext") || $controller == "unittests" && $action == "sample") {
    include TC_ROOTDIR . '/controllers/controller_' . $controller . '.php';
    $classname = '\\ThemeCheck\\Controller_' . $controller;
    $controller = new $classname();
    $action = "ajax_" . $action;
    $controller->{$action}();
}
 public function ajax_sample()
 {
     $time_start = microtime(true);
     $response["error"] = "none";
     $response["html"] = "";
     $themeid = 1;
     if (isset($_POST["themeid"])) {
         $themeid = intval($_POST["themeid"]);
     }
     if ($themeid < 1) {
         $themeid = 1;
     }
     $checkid = $_POST["checkid"];
     if (USE_DB) {
         $history = new History();
         $themInfo = $history->getFewInfo($themeid);
         $hash = $themInfo["hash"];
         $fileValidator = FileValidator::unserialize($hash);
         $fileValidator->validate($checkid);
         //if (UserMessage::getCount(ERRORLEVEL_FATAL) == 0) // serialize only if no fatal errors
         $validationResults = $fileValidator->getValidationResults(I18N::getCurLang());
         if (count($validationResults->check_critical) > 0 || count($validationResults->check_warnings) > 0 || count($validationResults->check_info) > 0) {
             $url = TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => "en", "phpfile" => "results", "hash" => $hash));
             $html = '<h2 style="color:#D00;">' . $themInfo["name"] . '<a href="' . $url . '" target="_blank" style="font-size:14px;margin-left:6px"><span class="glyphicon glyphicon-new-window"></span></a>' . '</h2>';
         }
         if (count($validationResults->check_critical) > 0) {
             //$html .= '<h2 style="line-height:100px;color:#D00;">'.__("Critical alerts").'</h2>';
             $html .= '<ol>';
             foreach ($validationResults->check_critical as $check) {
                 $html .= '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>';
                 if (!empty($check->messages)) {
                     $html .= '<p style="color:#c94b4b;">' . implode('<br/>', $check->messages) . '</p>';
                 }
             }
             $html .= '</ol>';
         }
         if (count($validationResults->check_warnings) > 0) {
             //$html .= '<h2 style="line-height:100px;color:#eea43a;">'.__("Warnings").'</h2>';
             $html .= '<ol>';
             foreach ($validationResults->check_warnings as $check) {
                 $html .= '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>';
                 if (!empty($check->messages)) {
                     $html .= '<p style="color:#eea43a;">' . implode('<br/>', $check->messages) . '</p>';
                 }
             }
             $html .= '</ol>';
         }
         if (count($validationResults->check_info) > 0) {
             //$html .= '<h2 style="line-height:100px;color:#eea43a;">'.__("Warnings").'</h2>';
             $html .= '<ol>';
             foreach ($validationResults->check_info as $check) {
                 $html .= '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>';
                 if (!empty($check->messages)) {
                     $html .= '<p style="color:#00b6e3;">' . implode('<br/>', $check->messages) . '</p>';
                 }
             }
             $html .= '</ol>';
         }
         $response["html"] = $html;
         $prevId = $history->getPrevId($themeid);
         if (!empty($prevId)) {
             $themInfoNext = $history->getFewInfo($prevId);
             $response["next_id"] = $prevId;
             $response["next_name"] = $themInfoNext["name"];
         } else {
             $response["next_id"] = null;
             $response["next_name"] = null;
         }
     }
     $time_end = microtime(true);
     $time = $time_end - $time_start;
     $response["duration"] = $time;
     //ob_clean();
     header('Content-Type: application/json');
     echo json_encode($response);
 }
Example #4
0
        echo $script . "\n";
        echo '</script>' . "\n";
    }
}
?>
    <div class="navbar navbar-inverse">
		<!--<div class="navbar navbar-inverse">-->
      <div class="container">
        <div class="navbar-header">
					<a class="navbar-brand" href="<?php 
echo TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "index.php"));
?>
"><img src="<?php 
echo TC_HTTPDOMAIN;
?>
/img/headerlogo.png"></a>
        </div>
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul	class="nav navbar-nav navbar-right">
						<li><a href="<?php 
echo TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "contact"));
?>
"><?php 
echo __("Contact us");
?>
</a></li>
					</ul>
				</div>	
      </div>
    </div>
<?php 
Example #5
0
    public function render()
    {
        if (isset($_POST['send'])) {
            $errors = array();
            if (isset($_SESSION['token_' . $_POST['token']])) {
                unset($_SESSION['token_' . $_POST['token']]);
                if (empty($_POST['name'])) {
                    $errors['name'] = __("Required field");
                }
                if (empty($_POST['email'])) {
                    $errors['email'] = __("Required field");
                } elseif (false === filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
                    $errors['email'] = __("invalid email address");
                }
                if (empty($_POST['message'])) {
                    $errors['message'] = __("Required field");
                }
                // Send email
                if (count($errors) == 0) {
                    require_once TC_INCDIR . '/Swift-4.3.0/lib/swift_required.php';
                    $message = \Swift_Message::newInstance();
                    $message->setSubject('CONTACT THEMECHECK');
                    $message->setFrom(array('mailer@themecheck.org' => 'Themecheck.org'));
                    $text = "Contact from : " . htmlspecialchars($_POST['name']) . " : " . htmlspecialchars($_POST['email']) . "<br>";
                    if (!empty($_POST['website'])) {
                        $text .= "Website: " . htmlspecialchars($_POST['website']) . "<br>";
                    }
                    $text .= "<br>Message:<br>";
                    $text .= nl2br(htmlspecialchars($_POST['message']));
                    $message->setBody($text, 'text/html');
                    $to = array();
                    $to[TC_CONTACT_MAIL] = TC_CONTACT_NAME;
                    $message->setTo($to);
                    if (TC_ENVIRONMENT == 'dev') {
                        // for unconfigured php.ini smtp use (xampp/wamp etc...):
                        $transport = \Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')->setUsername('username')->setPassword('password');
                    } else {
                        $transport = \Swift_SmtpTransport::newInstance();
                    }
                    $mailer = \Swift_Mailer::newInstance($transport);
                    $test = $mailer->send($message);
                    echo '<div class="container"><div class="alert alert-success">' . __("Message sent. We&#39;ll contact you soon.") . '</div><a href="' . TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "index.php")) . '">' . __("Back to home page") . '</a></div>';
                }
            } else {
                $errors['token'] = __("Invalid form");
            }
        }
        if (!isset($_POST['send']) || count($errors) > 0) {
            $token = uniqid(true);
            $_SESSION['token_' . $token] = time();
            ?>
			<div class="container">
			<h1><?php 
            echo __("Contact us");
            ?>
</h1>
			<br/><br/>
					<div id="contact-form">
						<form method="post" action="">
							<div class="row">
								<div class="form-group <?php 
            if (isset($errors['name'])) {
                ?>
has-error<?php 
            }
            ?>
 col-md-4 col-sm-6">
									<label class="label-text control-label" for="name"><?php 
            echo __("Name (required)");
            ?>
</label>
									<input type="text" class="name form-control" value="" id="name" name="name">
									<?php 
            if (isset($errors['name'])) {
                ?>
<span class='control-label'><?php 
                echo $errors['name'];
                ?>
</span><?php 
            }
            ?>
								</div>
							</div>
							<div class="row">
								<div class="form-group <?php 
            if (isset($errors['email'])) {
                ?>
has-error<?php 
            }
            ?>
 col-md-4 col-sm-6">
									<label class="label-email control-label" for="email"><?php 
            echo __("Email (required)");
            ?>
</label>
									<input type="text" class="email font-primary form-control" value="" id="email" name="email">
									<?php 
            if (isset($errors['email'])) {
                ?>
<span class='control-label'><?php 
                echo $errors['email'];
                ?>
</span><?php 
            }
            ?>
								</div>
							</div>
							<div class="row">
								<div class="form-group <?php 
            if (isset($errors['website'])) {
                ?>
has-error<?php 
            }
            ?>
 col-md-4 col-sm-6">
									<label class="label-text control-label" for="website"><?php 
            echo __("Website");
            ?>
</label>
									<input type="text" class="url font-primary form-control" value="" id="website" name="website">
									<?php 
            if (isset($errors['website'])) {
                ?>
<span class='control-label'><?php 
                echo $errors['website'];
                ?>
</span><?php 
            }
            ?>
								</div>
							</div>
							<div class="row">
								<div class="form-group <?php 
            if (isset($errors['message'])) {
                ?>
has-error<?php 
            }
            ?>
 col-md-9">
									<label class="label-textarea control-label" for="message"><?php 
            echo __("Message (required)");
            ?>
</label>
									<textarea rows="10" id="message" name="message" class="font-primary form-control"></textarea>
									<?php 
            if (isset($errors['message'])) {
                ?>
<span class='control-label'><?php 
                echo $errors['message'];
                ?>
</span><?php 
            }
            ?>
								</div>
							</div>
							<p class="contact-submit form-group <?php 
            if (isset($errors['token'])) {
                ?>
has-error<?php 
            }
            ?>
">
								<input type="submit" class="btn btn-primary" name="send" value="<?php 
            echo __("Submit");
            ?>
">
								<input type="hidden" name="token" value="<?php 
            echo $token;
            ?>
">
								<?php 
            if (isset($errors['token'])) {
                ?>
<span class='control-label'><?php 
                echo $errors['token'];
                ?>
</span><?php 
            }
            ?>
							</p>
						</form>
					</div>

			</div>
			
			<?php 
        }
    }
Example #6
0
<?php

header('Content-type:text/html; charset=UTF-8');
require '../lib/Route.class.php';
$rulelist = array('rule_startpage' => array('rule' => '/', 'action' => 'homepage.php'), 'rule_homepage' => array('rule' => '/home', 'action' => 'homepage.php'), 'rule_produto' => array('rule' => '/produto/{titulo_slug}_{id}.{_format}', 'action' => 'produto.php', 'params' => array('id' => array('pattern' => '\\d+'), 'titulo_slug' => array('pattern' => '[a-z0-9-_]+'), '_format' => array('pattern' => 'html|pdf|txt'))));
$my_protocol = 'http';
$my_domain = 'localhost';
$my_basedir = '/jonas-php-library/demo/';
$my_url_prefix = $my_protocol . '://' . $my_domain . $my_basedir;
try {
    $myRoute = Route::getInstance();
    $myRoute->setConfig($rulelist, $my_domain, $my_basedir, $my_protocol)->init($_SERVER['REQUEST_URI'])->check();
    include $myRoute->getMatchedRouteAction();
} catch (RouteNotFoundException $e) {
    include 'route-not-found.php';
}
Example #7
0
*********************************************/
//Variables globales d'accès au fichiers
define('ROOT', str_replace('index.php', '', $_SERVER['SCRIPT_FILENAME']));
define('WEBROOT', str_replace('index.php', '', $_SERVER['SCRIPT_NAME']));
define('MODEL', "model/");
define('VIEW', "view/");
define('CONTROLLER', "controller/");
define('CSS', WEBROOT . "src/css/");
define('JS', WEBROOT . "src/js/");
define('IMG', WEBROOT . "src/img/");
//Instanciation de la session
session_start();
//Inclusion de l'autoloader
require_once 'autoloader.php';
//On instancie le routeur
$r = Route::getInstance();
//Si l'utilisateur vient de se connecter ou de se déconnecter on rafraichi l'état de connexion
$r->refreshConnection();
?>
<!DOCTYPE HTML>

<html>

	<head>
		<meta charset='utf-8'>
		<meta author='Cédric Eloundou & Guillaume Fauvet'>
		<link rel="icon" href=<?php 
echo "'" . IMG . "site.ico'";
?>
 />
Example #8
0
		ga('send', 'pageview', loc, '<?php 
        if ($themeInfo->themetype == 1) {
            echo '[WP] ';
        }
        if ($themeInfo->themetype == 2) {
            echo '[Joomla] ';
        }
        if ($themeInfo->themetype == 4) {
            echo '[WP child] ';
        }
        echo $themeInfo->namesanitized;
        ?>
');
		</script>
		<?php 
        $href = TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => $lang, "phpfile" => "results", "hash" => $hash));
        displayShield($themeInfo, $lang, $size, $href, '');
    } else {
        ?>
<script>
			ga('send', 'pageview');
		</script><?php 
        echo __("Error : non existant id.", $lang);
    }
} else {
    ?>
<script>
			ga('send', 'pageview');
		</script><?php 
    echo __("Error : invalid id.", $lang);
}
Example #9
0
    public function render()
    {
        $max_size = Helpers::returnBytes(ini_get('upload_max_filesize'));
        if ($max_size > Helpers::returnBytes(ini_get('post_max_size'))) {
            $max_size = Helpers::returnBytes(ini_get('post_max_size'));
        }
        $max_size_MB = $max_size / (1024 * 1024);
        $token = uniqid(true);
        $_SESSION['token_' . $token] = time();
        ?>
 
				<div class="jumbotron">
					<div class="container">
						<h1><?php 
        echo __("Verify web themes and templates");
        ?>
</h1>
						<p><?php 
        echo __("Themecheck.org is a quick service that lets you verify web themes or templates for security and code quality. This service is free and compatible with Wordpress themes and Joomla templates.");
        ?>
						<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"><?php 
        echo __("More...");
        ?>
</a>
						</p>
						<div class="row">
							
							<div id="collapseOne" class="panel-collapse collapse">
								<div class="panel-body">
									<div class="col-lg-6">
										<h2><?php 
        echo __("Website owners");
        ?>
</h2>
										<p><?php 
        echo __("Check themes or templates you download before installing them on your site");
        ?>
</p>
										<ul>
										<li><?php 
        echo __("Check code quality");
        ?>
</li>
										<li><?php 
        echo __("Check presence of malware");
        ?>
</li>
										</ul>
									</div>
									<div class="col-lg-6">
										<h2><?php 
        echo __("Developers");
        ?>
</h2>
										<p><?php 
        echo __("Your create or distribute themes ?");
        ?>
</p>
										<ul>
										<li><?php 
        echo __("Themecheck.org helps you verify they satisfy CMS standards and common users needs.");
        ?>
</li>
										<li><?php 
        echo __("Share verification score on your site with ThemeCheck.org widget  ");
        ?>
&nbsp;<img src="<?php 
        echo TC_HTTPDOMAIN;
        ?>
/img/pictosuccess40.png"></li>
										</ul>
									</div>
								</div>
							</div>
							
						</div>
					</div>
				</div>

				<div class="container text-center">
					<h2 ><?php 
        echo __("Upload a zip file and get its verification score :");
        ?>
</h2><br/>
					<form role="form" class="text-center" action="<?php 
        echo TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "results"));
        ?>
" method="post" enctype="multipart/form-data">
						<div class="form-group">
							<input type="hidden" name="MAX_FILE_SIZE" value="<?php 
        echo Helpers::returnBytes(ini_get('upload_max_filesize'));
        ?>
" />
							<input type="file" name="file" id="file" class="filestyle" data-buttonText="<?php 
        echo __("Select file");
        ?>
" data-classButton="btn btn-default btn-lg" data-classInput="input input-lg">
						</div>
						<?php 
        echo __("Maximum file size") . " : {$max_size_MB} MB";
        ?>
 
						<br/><br/>
						
						<input type="checkbox" name="donotstore" value="donotstore">&nbsp;<?php 
        echo __('Forget uploaded data after results') . '&nbsp;<a id="forgetresultsmoreinfo" data-container="body" data-toggle="popover" data-placement="right" data-content="' . __("<ul><li>No data will be kept on themecheck.org servers (or any other)<li>Validation won't be visible to the public<li>If you want to see the results in the future, you'll have to re-submit your file</ul>") . '" href="#!">( ? )</a>';
        ?>
<br>

						<br/>
						<button type="submit" class="btn btn-primary btn-lg" ><?php 
        echo __("Submit");
        ?>
</button>
						<input type="hidden" name="token" value="<?php 
        echo $token;
        ?>
"/>
					</form>
		<?php 
        // display recent validated file if	history is available
        if (USE_DB) {
            $history = new History();
            ?>
					<hr>
					<h2><?php 
            echo __("Recently checked themes");
            ?>
</h2>
					<div class="row">
						<form id="sortform">
							<div style="font-size:20px;" class="col-sm-4 col-sm-offset-4">
								wordpress <input type='checkbox' name='theme[]' value='wordpress' <?php 
            if (isset($_SESSION['theme'])) {
                if (in_array("wordpress", $_SESSION['theme'])) {
                    echo 'checked="checked"';
                }
            } else {
                echo 'checked="checked"';
            }
            ?>
 class='sortdropdown'/>
								&nbsp;&nbsp;&nbsp;joomla <input type='checkbox' name='theme[]' value='joomla' <?php 
            if (isset($_SESSION['theme'])) {
                if (in_array("joomla", $_SESSION['theme'])) {
                    echo 'checked="checked"';
                }
            } else {
                echo 'checked="checked"';
            }
            ?>
 class='sortdropdown'/>
							</div>
							<div class="col-sm-3 col-sm-offset-1 col-xs-12">
								<select name='sort' class='sortdropdown form-control' style="width:180px;margin:auto">
									<option value='id' <?php 
            if (isset($_SESSION['sort']) && $_SESSION['sort'] == 'creationDate') {
                echo 'selected="selected"';
            }
            ?>
><?php 
            echo __("Newer first");
            ?>
</option>
									<option value='score' <?php 
            if (isset($_SESSION['sort']) && $_SESSION['sort'] == 'score') {
                echo 'selected="selected"';
            }
            ?>
><?php 
            echo __("Higher scores first");
            ?>
</option>
								</select>
							</div>
						</form>
					</div>
					<div id="alreadyvalidated">
					<?php 
            if (isset($_SESSION['sort']) && isset($_SESSION['theme'])) {
                $pagination = $history->getSorted($_SESSION['sort'], $_SESSION['theme']);
            } else {
                $pagination = $history->getRecent();
            }
            foreach ($pagination as $t) {
                echo $this->getThumb($t);
            }
            ?>
					</div>
			<div style="text-align:center;"><button type="button" id="seemore-btn" class="btn">
				<?php 
            echo __("See more");
            ?>
			</button>
			</div>
		<?php 
        }
        ?>
		
				</div> <!-- /container --> 
				<script>
				  $('#seemore-btn').click(function () {
						$.ajax({
							type: "POST",
							url: "<?php 
        echo TC_HTTPDOMAIN . '/ajax.php?controller=home&action=seemore';
        ?>
",
							data: { olderthan: $("#alreadyvalidated div.validated-theme").last().data("id"), lang: "<?php 
        echo I18N::getCurLang();
        ?>
" }
						}).done(function( obj ) {
							$("#alreadyvalidated").append(obj.html);
							if (obj.nomore) $("#seemore-btn").hide();
							smallestid = obj.smallestid; 
						}).fail(function() {
							console.log("ajax error");
						})

				  });
				  
				$('.sortdropdown').on("change", function(){
					$.ajax({
						type: "POST",
						url: "<?php 
        echo TC_HTTPDOMAIN . '/ajax.php?controller=home&action=sort';
        ?>
",
						data: $("#sortform").serialize()
					}).done(function(obj){
						$("#alreadyvalidated").html(obj.html);
					});
				})
				</script>
				<?php 
    }
Example #10
0
    <!-- Main jumbotron for a primary marketing message or call to action -->
    <div class="jumbotron">
      <div class="container">
        <h1><?php 
echo __("Error 404.");
?>
</h1>
        <p><?php 
echo __("Sorry, the page you requested doesn't exist.");
?>
</p>
      </div>
    </div>

		<?php 
$samepage_i18n = array('en' => TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => "en", "phpfile" => "error404.php")), 'fr' => TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => "fr", "phpfile" => "error404.php")));
require "footer.php";
?>
		<!-- /container -->        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="<?php 
echo TC_HTTPDOMAIN;
?>
/js/vendor/jquery-1.10.1.min.js"><\/script>')</script>

        <script src="<?php 
echo TC_HTTPDOMAIN;
?>
/js/vendor/bootstrap.min.js"></script>
				<script src="<?php 
echo TC_HTTPDOMAIN;
?>
Example #11
0
    private function renderRulesSet($themeInfo, $validationResults)
    {
        ?>
						<div class="row" style="color:#888;font-weight:normal;margin:30px 0 0 0;background:#F8F8F8;border-radius: 3px;">
						<div class="col-md-8 text-center" style="">
						<br/>
						<?php 
        $userMessage = UserMessage::getInstance();
        echo UserMessage::getInstance()->getMessagesHtml();
        $img = 'shieldperfect240.png';
        $color = 'a6af11';
        $text = sprintf(__('Validation score : %s%%'), intval($themeInfo->score));
        if ($themeInfo->score < 100.0) {
            if ($themeInfo->score > 95) {
                $img = "shieldgreen240.png";
                $color = 'cbd715';
            } else {
                if ($themeInfo->score > 80) {
                    $img = "shieldorange240.png";
                    $color = 'ff8214';
                } else {
                    $img = "shieldred240.png";
                    $color = 'ff1427';
                }
            }
            if ($themeInfo->criticalCount > 0) {
                $text = sprintf(__('Validation score : %s%% (%s critical alerts)'), intval($themeInfo->score), $themeInfo->criticalCount);
            } else {
                $text = sprintf(__('Validation score : %s%%'), intval($themeInfo->score));
            }
        }
        ?>
								<div class="shield1" style="width:201px;height:240px;background-image:url(<?php 
        echo TC_HTTPDOMAIN;
        ?>
/img/<?php 
        echo $img;
        ?>
);" title="<?php 
        echo $text;
        ?>
">
										<div class="shield2" style="color:#<?php 
        echo $color;
        ?>
;">			
									<?php 
        if ($themeInfo->score < 100.0) {
            echo intval($themeInfo->score);
        }
        ?>
										</div>	
								</div>
								<?php 
        echo '<p "color:#' . $color . '">' . __("validation score") . ' : ' . intval($themeInfo->score) . ' %</p>';
        echo '<p>' . sprintf(__("%s critical alerts. %s warnings."), $themeInfo->criticalCount, $themeInfo->warningsCount) . '</p>';
        if (!isset($_POST["donotstore"]) && UserMessage::getCount(ERRORLEVEL_FATAL) == 0) {
            ?>
									<br/><br/>
									<?php 
            echo __("Share this page with the following link :");
            ?>
									<p>
									<?php 
            echo '<a href="' . $this->samepage_i18n[I18N::getCurLang()] . '">' . $this->samepage_i18n[I18N::getCurLang()] . '</a>';
            ?>
									</p>
									<?php 
            echo __("Display this score on your website with the following HTML code that links to this page :");
            ?>
									<p style="color:red"><i>( corrected 2014-06-09 )</i></p>
									<pre style="font-size:11px;width:70%;margin:auto;"><?php 
            echo htmlspecialchars('<iframe src="' . TC_HTTPDOMAIN . '/score.php?lang=' . I18N::getCurLang() . '&id=' . $themeInfo->hash . '&size=big" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:240px; width:200px;" allowTransparency="true"></iframe>');
            ?>
</pre>		
									
									<button class="btn" data-toggle="collapse" data-target="#moreembedoptions" style="height:20px;padding:1px;font-size:12px">more options</button>
									<div id="moreembedoptions" class="collapse">
									<?php 
            displayShield($themeInfo, I18N::getCurLang(), 80, '#', TC_HTTPDOMAIN . '/');
            ?>
									<?php 
            echo __("Medium size icon (default) :");
            ?>
									<pre style="font-size:11px;width:70%;margin:auto;"><?php 
            echo htmlspecialchars('<iframe src="' . TC_HTTPDOMAIN . '/score.php?id=' . $themeInfo->hash . '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px; width:67px;" allowTransparency="true"></iframe>');
            ?>
</pre>	
									<?php 
            displayShield($themeInfo, I18N::getCurLang(), 40, '#', TC_HTTPDOMAIN . '/');
            ?>
									<?php 
            echo __("Small size icon :");
            ?>
									<pre style="font-size:11px;width:70%;margin:auto;"><?php 
            echo htmlspecialchars('<iframe src="' . TC_HTTPDOMAIN . '/score.php?id=' . $themeInfo->hash . '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px; width:40px;" allowTransparency="true"></iframe>');
            ?>
</pre>	
									<?php 
            echo htmlspecialchars(__("You can switch language with <strong>lang</strong> parameter in iframe's url. So far <strong>fr</strong> and <strong>en</strong> are supported. Default value is <strong>en</strong>."));
            ?>
									<pre style="font-size:11px;width:70%;margin:auto;"><?php 
            echo htmlspecialchars('<iframe src="' . TC_HTTPDOMAIN . '/score.php?lang=' . I18N::getCurLang() . '&id=' . $themeInfo->hash . '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px; width:67px;" allowTransparency="true"></iframe>');
            ?>
</pre>	
									</div>
									<br/>
								<?php 
        } else {
            echo '<br>' . __("These results were not saved on themecheck.org servers and will be lost when you quit this page.");
        }
        ?>
						</div>
						<div class="col-md-4" style="border-radius: 3px;background:#444; overflow:hidden; font-size:12px">
							<?php 
        $characteristics = array();
        $characteristics[] = array(__("Theme name"), htmlspecialchars($themeInfo->name));
        if ($themeInfo->themetype == TT_WORDPRESS) {
            if (empty($themeInfo->cmsVersion)) {
                $characteristics[] = array(__("Theme type"), __("Wordpress theme"));
            } else {
                $characteristics[] = array(__("Theme type"), __("Wordpress theme") . ' ' . $themeInfo->cmsVersion);
            }
        } else {
            if ($themeInfo->themetype == TT_WORDPRESS_CHILD) {
                if (empty($themeInfo->cmsVersion)) {
                    $characteristics[] = array(__("Theme type"), __("Wordpress child theme"));
                } else {
                    $characteristics[] = array(__("Theme type"), __("Wordpress child theme") . ' ' . $themeInfo->cmsVersion);
                }
                if (!empty($themeInfo->parentName)) {
                    $url = TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "results", "namesanitized" => $themeInfo->parentNameSanitized, "themetype" => $themeInfo->parentThemeType));
                    $characteristics[] = array(__("Parent theme name"), "<a href='" . $url . "'>" . htmlspecialchars($themeInfo->parentName) . "</a>");
                }
            } else {
                if ($themeInfo->themetype == TT_JOOMLA) {
                    if (empty($themeInfo->cmsVersion)) {
                        $characteristics[] = array(__("Theme type"), __("Joomla template"));
                    } else {
                        $characteristics[] = array(__("Theme type"), __("Joomla template") . ' ' . $themeInfo->cmsVersion);
                    }
                }
            }
        }
        $characteristics[] = array(__("File name"), htmlspecialchars($themeInfo->zipfilename, defined('ENT_HTML5') ? ENT_QUOTES | ENT_HTML5 : ENT_QUOTES));
        $characteristics[] = array(__("File size"), $themeInfo->zipfilesize . ' ' . __('bytes'));
        $characteristics[] = array(__("MD5"), strtolower($themeInfo->hash_md5));
        $characteristics[] = array(__("SHA1"), strtolower($themeInfo->hash_sha1));
        if (empty($themeInfo->licenseUri)) {
            if (!empty($themeInfo->licenseText)) {
                $characteristics[] = array(__("License"), ThemeInfo::getLicenseName($themeInfo->license) . '<br>' . htmlspecialchars($themeInfo->licenseText));
            } else {
                $characteristics[] = array(__("License"), ThemeInfo::getLicenseName($themeInfo->license));
            }
        } else {
            if (!empty($themeInfo->licenseText)) {
                $characteristics[] = array(__("License"), '<a href="' . $themeInfo->licenseUri . '" rel="nofollow">' . ThemeInfo::getLicenseName($themeInfo->license) . '</a>' . '<br>' . htmlspecialchars($themeInfo->licenseText));
            } else {
                $characteristics[] = array(__("License"), '<a href="' . $themeInfo->licenseUri . '" rel="nofollow">' . ThemeInfo::getLicenseName($themeInfo->license) . '</a>');
            }
        }
        $characteristics[] = array(__("Files included"), htmlspecialchars($themeInfo->filesIncluded, defined('ENT_HTML5') ? ENT_QUOTES | ENT_HTML5 : ENT_QUOTES));
        if (!empty($themeInfo->themeUri)) {
            if (strpos($themeInfo->themeUri, 'themeforest.net') !== false) {
                $characteristics[] = array(__("Theme URI"), '<a href="' . $themeInfo->themeUri . '?ref=peol">' . htmlspecialchars($themeInfo->themeUri) . '</a>');
            } else {
                $characteristics[] = array(__("Theme URI"), '<a href="' . $themeInfo->themeUri . '">' . htmlspecialchars($themeInfo->themeUri) . '</a>');
            }
        }
        if (!empty($themeInfo->version)) {
            $characteristics[] = array(__("Version"), htmlspecialchars($themeInfo->version));
        }
        if (!empty($themeInfo->authorUri)) {
            $characteristics[] = array(__("Author URI"), '<a href="' . $themeInfo->authorUri . '">' . htmlspecialchars($themeInfo->authorUri) . '</a>');
        }
        if (!empty($themeInfo->tags)) {
            $characteristics[] = array(__("Tags"), htmlspecialchars($themeInfo->tags));
        }
        if (!empty($themeInfo->layout)) {
            if ($themeInfo->layout == 1) {
                $characteristics[] = array(__("Layout"), __("Fixed"));
            } else {
                if ($themeInfo->layout == 2) {
                    $characteristics[] = array(__("Layout"), __("Fluid"));
                } else {
                    if ($themeInfo->layout == 3) {
                        $characteristics[] = array(__("Layout"), __("Responsive"));
                    }
                }
            }
        }
        if (!empty($themeInfo->copyright)) {
            $characteristics[] = array(__("Copyright"), htmlspecialchars($themeInfo->copyright));
        }
        if (!empty($themeInfo->creationDate)) {
            $characteristics[] = array(__("Creation date"), date("Y-m-d", $themeInfo->creationDate));
        }
        if (!empty($themeInfo->modificationDate)) {
            $characteristics[] = array(__("Last file update"), date("Y-m-d", $themeInfo->modificationDate));
        }
        if (!empty($themeInfo->validationDate)) {
            $characteristics[] = array(__("Last validation"), date("Y-m-d H:i", $themeInfo->validationDate));
        }
        foreach ($characteristics as $c) {
            echo '<p style="text-transform:uppercase;margin:0;margin-top:10px;">' . $c[0] . '</p><span style="color:#CCC">' . $c[1] . '</span>';
        }
        ?>
								
						</div>
					</div>

							<?php 
        echo '<div class="row"><div class="col-md-12">';
        if (count($validationResults->check_critical) > 0) {
            echo '<h2 style="line-height:100px;color:#D00;">' . __("Critical alerts") . '</h2>';
            echo '<ol>';
            foreach ($validationResults->check_critical as $check) {
                echo '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>';
                if (!empty($check->messages)) {
                    echo '<p style="color:#c94b4b;">' . implode('<br/>', $check->messages) . '</p>';
                }
            }
            echo '</ol>';
        }
        if (count($validationResults->check_warnings) > 0) {
            echo '<h2 style="line-height:100px;color:#eea43a;">' . __("Warnings") . '</h2>';
            echo '<ol>';
            foreach ($validationResults->check_warnings as $check) {
                echo '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>';
                if (!empty($check->messages)) {
                    echo '<p style="color:#eea43a;">' . implode('<br/>', $check->messages) . '</p>';
                }
            }
            echo '</ol>';
        }
        if (count($validationResults->check_info) > 0) {
            echo '<h2 style="line-height:100px;color:#00b6e3;">' . __("Info") . '</h2>';
            echo '<ol>';
            foreach ($validationResults->check_info as $check) {
                echo '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>';
                if (!empty($check->messages)) {
                    echo '<p style="color:#00b6e3;">' . implode('<br/>', $check->messages) . '</p>';
                }
            }
            echo '</ol>';
        }
        echo '</div></div>';
    }