public function test_highlight()
 {
     $str = 'inuit amma nunanga';
     $regexp = '\\S*?nga';
     $lang = 'iu';
     $highlighted = Alignment::highlight($str, $regexp, $lang);
     $expected = 'inuit amma <font color=red><b>nunanga</b></font>';
     $this->assertEquals($expected, $highlighted, "Wrong highlighting of inuktitut text");
 }
Exemple #2
0
    <link rel="stylesheet" href="css.css">
    <link rel="stylesheet" href="rotate.css">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="server.js" type="text/javascript"></script>
</head>

<body class="bg2">
    <?php 
require "server/DatabasePDO.php";
require "server/Superhero.php";
require "server/Team.php";
require "server/MemberOf.php";
require "server/Alignment.php";
$team = Team::findById($_POST["teamID"]);
$memberof = MemberOf::findByTeamId($team->getId());
$alignment = Alignment::findById($team->getAlignmentId());
?>
    <img id="upper_left" class="back_pic reflect" src="images/superman.png" width="500px" >

    <div class="container result">
        <div class="row text-center header">
            <div id="logo"></div>
        </div>

        <!--Character Start-->
        <div class="panel panel-success ">
            <div class="panel-heading text-center">
                <h4>Team
                </h4>
            </div>
            <div class="panel-body">
</head>

<body class="bg2">
    <?php 
require "server/DatabasePDO.php";
require "server/Superhero.php";
require "server/Team.php";
require "server/Power.php";
require "server/Gallery.php";
require "server/Alignment.php";
require "server/MemberOf.php";
require "server/PortraitedBy.php";
require "server/Star.php";
$superhero = Superhero::findById($_POST["superheroID"]);
$power = Power::findBySuperheroId($superhero->getId());
$alignment = Alignment::findBySuperheroId($superhero->getId());
$memberof = MemberOf::findBySuperheroId($superhero->getId());
$portraitedby = PortraitedBy::findBySuperheroId($superhero->getId());
$gallerys = Gallery::findBySuperheroId($superhero->getId());
?>
    <img id="upper_right" class="reflect ironman" src="images/ironman.png" width="450px">

    <div class="container result">
        <div class="row text-center header">
            <div id="logo"></div>
        </div>

        <!--Character Start-->
        <div class="panel panel-warning ">
            <div class="panel-heading text-center">
                <h4>CHARACTER
 private static function initializeConnection()
 {
     if (is_null(self::$dbConn)) {
         self::$dbConn = DatabasePDO::getInstance();
     }
 }
Exemple #5
0
 public function alignInside(BoundingBox $container, Alignment $align = NULL, $mode = self::ALIGN_MODE_CENTER, $disableZoom = false)
 {
     if ($align === NULL) {
         $align = Alignment::center();
     }
     $scaleW = $this->width / $container->width;
     $scaleH = $this->height / $container->height;
     $scale = 1;
     switch ($mode) {
         case self::ALIGN_MODE_CENTER:
             $scale = 1;
             break;
         case self::ALIGN_MODE_CONTAIN:
             $scale = max($scaleW, $scaleH);
             break;
         case self::ALIGN_MODE_COVER:
             $scale = min($scaleW, $scaleH);
             break;
     }
     if ($disableZoom && $scale < 1) {
         $scale = 1;
     }
     $newWidth = $container->width * $scale;
     $newHeight = $container->height * $scale;
     if ($align->isHorizontalCenter()) {
         $this->left += round(($this->width - $newWidth) / 2);
     } elseif ($align->isRight()) {
         $this->left += $this->width - $newWidth;
     }
     if ($align->isVerticalCenter()) {
         $this->top += round(($this->height - $newHeight) / 2);
     } elseif ($align->isBottom()) {
         $this->top += $this->height - $newHeight;
     }
     $this->width = $newWidth;
     $this->height = $newHeight;
 }