Fixed login

Started building page cleanup
Modified code pools
Backported layout/blocks/templates 3-step view system
Reforged Overview page
Moved graphics, added topnav template, fixed number render bug
Added BCMath optionnal usage
Updated BC Math comparison for capped resources
Fixed planet resource production updates
Various additions

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
Gregory PLANCHAT 2011-07-25 08:45:57 +02:00
commit f2d4b0f7e2
384 changed files with 2727 additions and 1364 deletions

View file

@ -0,0 +1 @@
<?php

View file

@ -0,0 +1 @@
<?php

View file

@ -0,0 +1,10 @@
<form name="destroy-planet" id="overview:destroy-planet" method="post" action="">
<fieldset>
<input type="hidden" name="form_key" value="<?php echo $this->getFormKey()?>" />
<label for="overview:destroy-planet:password"><?php echo $this->__('Password:')?></label>
<input id="overview:destroy-planet:password" type="password" name="password" />
<label for="overview:destroy-planet:confirm"><?php echo $this->__('I want to destroy this planet')?></label>
<input id="overview:destroy-planet:confirm" type="checkbox" name="confirm" />
<input type="submit" />
</fieldset>
</form>

View file

@ -0,0 +1,10 @@
<form name="rename-planet" id="overview:rename-planet" method="post" action="">
<fieldset>
<input type="hidden" name="form_key" value="<?php echo $this->getFormKey()?>" />
<label for="overview:rename-planet:password"><?php echo $this->__('Password:')?></label>
<input id="overview:rename-planet:password" type="password" name="password" />
<label for="overview:rename-planet:name"><?php echo $this->__('New name:')?></label>
<input id="overview:rename-planet:name" type="text" name="name" />
<input type="submit" />
</fieldset>
</form>

View file

@ -0,0 +1,11 @@
<?php if ($this['count'] > 0):?>
<tr>
<th colspan=4>
<?php if ($this['count'] == 1):?>
<a href=messages.php><?php echo $this->__('You have 1 unread message.')?></a>
<?php else:?>
<a href=messages.php><?php echo $this->__('You have %1$d unread messages.', $this['count'])?></a>
<?php endif?>
</th>
</tr>
<?php endif?>

View file

@ -0,0 +1,10 @@
<th>
<h1><?php echo $this->escape($this['planet']->getData('name'))?></h1>
<p><a href="<?php echo $this->getUrl('overview.php', array('cp' => $this['planet']->getId()))?>" title="<?php echo $this->escape($this['planet']->getData('name'))?>">
<img src="<?php echo $this->getUrl('planeten/small/s_' . $this['planet']->getData('image') . '.jpg')?>" height="50" width="50" />
</a></p>
<?php if ($this['queue']->count() > 0):?>
<p><?php echo $this->escape($this['queue_item']->getData('building_id'))?></p>
<?php else:?>
<p><?php echo $this->__('Idle.')?></p>
<?php endif?>

View file

@ -0,0 +1 @@
<?php echo $this->planetList->render() ?>

View file

@ -0,0 +1,77 @@
<div id="header_top">
<table class="header">
<tbody>
<tr class="header">
<td class="header">
<center>
<table class="header">
<tbody>
<tr class="header">
<td class="header"><img src="<?php echo $this->getSkinUrl($this->getCurrentPlanet()->getSmallImage())?>" height="50" width="50"></td>
<td class="header" valign="middle">
<select size="1" onchange="document.location.href=this.options[this.selectedIndex].value;">
<?php foreach ($this->getPlanetCollection() as $planet):?>
<option value="<?php echo $this->getUrl('', array('cp' => $planet->getId()))?>"<?php if ($planet->getId() == $this->getCurrentPlanet()->getId()):?> selected="selected"<?php endif?>><?php echo $this->escape($planet->getName())?> [<?php echo $this->escape($planet->getCoords())?>]</option>
<?php endforeach?>
</select>
</td>
</tr>
</tbody>
</table>
</center>
</td>
<td class="header">
<table style="width: 508px;" class="header" id="resources" padding-right="30" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr class="header">
<td class="header" align="center" width="140"><img src="<?php echo $this->getSkinUrl('graphics/images/metall.gif')?>" border="0" height="22" width="42"></td>
<td class="header" align="center" width="140"><img src="<?php echo $this->getSkinUrl('graphics/images/kristall.gif')?>" border="0" height="22" width="42"></td>
<td class="header" align="center" width="140"><img src="<?php echo $this->getSkinUrl('graphics/images/deuterium.gif')?>" border="0" height="22" width="42"></td>
<td class="header" align="center" width="140"><img src="<?php echo $this->getSkinUrl('graphics/images/energie.gif')?>" border="0" height="22" width="42"></td>
<td class="header" align="center" width="140"><img src="<?php echo $this->getSkinUrl('graphics/images/message.gif')?>" border="0" height="22" width="42"></td>
</tr>
<tr class="header">
<td class="header" align="center" width="140"><i><b><font color="white"><?php echo $this->__('Metal')?></font></b></i></td>
<td class="header" align="center" width="140"><i><b><font color="white"><?php echo $this->__('Cristal')?></font></b></i></td>
<td class="header" align="center" width="140"><i><b><font color="white"><?php echo $this->__('Deuterium')?></font></b></i></td>
<td class="header" align="center" width="140"><i><b><font color="white"><?php echo $this->__('Energy')?></font></b></i></td>
<td class="header" align="center" width="140"><i><b><font color="white"><?php echo $this->__('Messages')?></font></b></i></td>
</tr>
<tr class="header">
<td class="header" align="center" width="140">
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_METAL)):?>
<span style="color:red;"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_METAL))?>
<?php endif?>
</td>
<td class="header" align="center" width="140">
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_CRISTAL)):?>
<span style="color:red;"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_CRISTAL))?>
<?php endif?>
</td>
<td class="header" align="center" width="140">
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_DEUTERIUM)):?>
<span style="color:red;"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_DEUTERIUM))?>
<?php endif?>
</td>
<td class="header" align="center" width="140">
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_ENERGY)):?>
<span style="color:red;"><?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / <?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceAmount(Legacies_Empire::RESOURCE_ENERGY))?> / <?php echo $this->renderNumber($this->getCurrentPlanet()->getResourceCap(Legacies_Empire::RESOURCE_ENERGY))?>
<?php endif?>
</td>
<td class="header" align="center" width="140"><a href="<?php echo $this->getUrl('messages.php')?>"><?php echo $this->getCurrentUser()->getNewMessagesCount()?></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>

View file

@ -0,0 +1,15 @@
<html>
<head>
<?php echo $this->head->render()?>
</head>
<body<?php if ($classes = $this->getBodyClasses()):?> class="<?php echo $this->escape($classes)?>"<?php endif?>>
<div class="global">
<div class="content">
<?php if (isset($this->topnav)):?>
<?php echo $this->topnav->render()?>
<?php endif?>
<?php echo $this->content->render()?>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,18 @@
<html>
<head>
<?php echo $this->head->render()?>
</head>
<body<?php if ($classes = $this->getBodyClasses()):?> class="<?php echo $this->escape($classes)?>"<?php endif?>>
<div class="global">
<div class="left">
<?php echo $this->left->render()?>
</div>
<div class="content">
<?php if (isset($this->topnav)):?>
<?php echo $this->topnav->render()?>
<?php endif?>
<?php echo $this->content->render()?>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,18 @@
<html>
<head>
<?php echo $this->head->render()?>
</head>
<body<?php if ($classes = $this->getBodyClasses()):?> class="<?php echo $this->escape($classes)?>"<?php endif?>>
<div class="global">
<div class="content">
<?php if (isset($this->topnav)):?>
<?php echo $this->topnav->render()?>
<?php endif?>
<?php echo $this->content->render()?>
</div>
<div class="right">
<?php echo $this->left->render()?>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,21 @@
<html>
<head>
<?php echo $this->head->render()?>
</head>
<body<?php if ($classes = $this->getBodyClasses()):?> class="<?php echo $this->escape($classes)?>"<?php endif?>>
<div class="global">
<div class="left">
<?php echo $this->left->render()?>
</div>
<div class="content">
<?php if (isset($this->topnav)):?>
<?php echo $this->topnav->render()?>
<?php endif?>
<?php echo $this->content->render()?>
</div>
<div class="right">
<?php echo $this->left->render()?>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,26 @@
<title>XNova:Legacies</title>
<link rel="shortcut icon" href="<?php echo $this->getUrl('favicon.ico')?>">
<?php foreach ($this->getCss() as $css):?>
<link rel="stylesheet" type="<?php echo $css['type']?>" href="<?php echo $this->getSkinUrl($css['path'])?>" />
<?php endforeach?>
<?php foreach ($this->getInlineCss() as $css):?>
<style type="<?php echo $css['type']?>">
/*<![CDATA[*/
<?php echo $css['content']?>
/*]]>*/
</style>
<?php endforeach?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php foreach ($this->getJs() as $js):?>
<script type="<?php echo $js['type']?>" src="<?php echo $this->getUrl($js['path'])?>"></script>
<?php endforeach?>
<?php foreach ($this->getSkinJs() as $js):?>
<script type="<?php echo $js['type']?>" src="<?php echo $this->getSkinUrl($js['path'])?>"></script>
<?php endforeach?>
<?php foreach ($this->getInlineJs() as $js):?>
<script type="<?php echo $js['type']?>">
/*<![CDATA[*/
<?php echo $js['content']?>
/*]]>*/
</script>
<?php endforeach?>