Configuration & Layout architecture updates

Fixed production bug
Fixed styles
Updated Action Controller

Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
Gregory PLANCHAT 2012-01-13 23:36:03 +01:00
commit 66805034a6
815 changed files with 4020 additions and 1138 deletions

View file

@ -0,0 +1,21 @@
<?php $fleet = $this->getData('fleet')?>
<?php $user = $this->getData('user')?>
<tr class="<?php echo $this->getData('class')?>">
<?php echo $this->getData('fleet_javai')?>
<td>
<div class="z">-</div>
<font color="lime"><?php echo $fleet->getArrivalTime()?></font>
</td>
<td colspan="3">
<?php if (!$fleet->isOwnedBy($user) || $fleet->isMission(Legacies_Empire::ID_MISSION_TRANSPORT) || $fleet->isMission(Legacies_Empire::ID_MISSION_STATION) || $fleet->isMission(Legacies_Empire::ID_MISSION_STATION_ALLY)):?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('An hostile fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php elseif ($fleet->isOwnedBy($user) || $fleet->isMission(Legacies_Empire::ID_MISSION_ATTACK) || $fleet->isMission(Legacies_Empire::ID_MISSION_GROUP_ATTACK) || $fleet->isMission(Legacies_Empire::ID_MISSION_DESTROY) || $fleet->isMission(Legacies_Empire::ID_MISSION_MISSILES) || $fleet->isMission(Legacies_Empire::ID_MISSION_SPY)):?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('Your hostile fleet, sent from %1$s, reaches %2$d\'s planet %3$d. It has been sent with the mission: %4$d', $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getUser()->getUsername(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php elseif ($fleet->isOwnedBy($user)):?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('Your peaceful fleet, sent from %2$s, reaches the planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php else:?>
<span class="<?php echo $fleet->getRowClass($user)?>"><?php echo $this->__('A peaceful fleet sent by %1$s, coming from %2$s, reaches your planet %3$d. It has been sent with the mission: %4$d', $fleet->getOwner()->getUsername(), $fleet->getOriginPlanet()->getName(), $fleet->getDestinationPlanet()->getName(), $fleet->getMissionLabel())?></span>
<?php endif?>
</td>
<?php echo $this->getData('fleet_javas')?>
</tr>

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,16 @@
<form name="rename-planet" class="form rename-planet" id="overview:rename-planet" method="post" action="">
<fieldset>
<input type="hidden" name="form_key" value="<?php echo $this->getFormKey()?>" />
<p>
<label for="overview:rename-planet:name"><?php echo $this->__('New name:')?></label>
<input id="overview:rename-planet:name" type="text" name="name" />
</p>
<p>
<label for="overview:rename-planet:password"><?php echo $this->__('Password:')?></label>
<input id="overview:rename-planet:password" type="password" name="password" />
</p>
<p>
<input type="submit" />
</p>
</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,14 @@
<td>
<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->getSkinUrl('graphics/planeten/small/s_' . $this['planet']->getData('image') . '.jpg')?>" height="50" width="50" />
</a></p>
<?php if (isset($this['queue']) && $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?>
</td>
<?php if ($this['even']):?>
</tr><tr>
<?php endif?>

View file

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

View file

@ -0,0 +1,28 @@
<div id="buildings" class="buildings item-list">
<h1><?php echo $this->__('Buildings')?></h1>
<?php echo $this->getPartial('item-list.items')->render()?>
<div class="clear"></div>
</div>
<script type="text/javascript">
/*<![CDATA[*/
(function($){
jQuery(document).ready(function(){
var items = jQuery('#buildings .item');
jQuery('.image', items).hover(function(e){
jQuery('.details', jQuery(this).parent()).show();
}, function(e){
jQuery('.details', jQuery(this).parent()).hide();
});
jQuery('.buy', items).hover(function(e){
jQuery('.details', jQuery(this)).addClass('hover');
}, function(e){
jQuery('.details', jQuery(this)).removeClass('hover');
});
jQuery('.buy', items).click(function(e){
e.preventDefault();
document.location.href = jQuery('a', jQuery(this)).attr('href');
});
});
})(jQuery);
/*]]>*/
</script>

View file

@ -0,0 +1,30 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item-container">
<div class="item title">
<h2><a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a></h2>
<h3 class="level"><?php echo $this->__('Level %d', $this->renderNumber($this->getLevel()))?></h3>
</div>
<div class="item details">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="120" height="120" /></a>
<div class="buy">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('building' => $this->getItemId()))?>"><?php echo $this->__('Build next level (%s)', $this->renderNumber($this->getNextLevel()))?></a></p>
</div>
<div class="details">
<p><?php echo $this->getDescription()?></p>
<ul>
<?php foreach ($this->getResourcesConfigForNextLevel() as $resourceId => $resourceConfig):?>
<li class="resource">
<span class="label"><?php echo $this->getResourceName($resourceId)?></span>
<span class="cost<?php if ($resourceConfig->hasData('requirement')):?> capped<?php endif?>"><?php echo $this->renderNumber($resourceConfig->getData('value'))?></span>
<?php if ($resourceConfig->hasData('requirement')):?>
<span class="requirement">(<?php echo $this->renderNumber($resourceConfig->getData('requirement'))?>)</span>
<?php else:?>
<span class="overflow">(<?php echo $this->renderNumber($resourceConfig->getData('overflow'))?>)</span>
<?php endif?>
</li>
<?php endforeach?>
</ul>
<p class="time"><?php echo $this->__('Building time: %s', $this->renderTime($this->getBuildingTimeForNextLevel(), true))?>
</div>
</div>
</div>

View file

@ -0,0 +1,6 @@
<?php if (!$this->isEmpty()):?>
<div class="building queue">
<h1><?php echo $this->__('Work in progress')?></h1>
<?php echo $this->getPartial('item-list')->render() ?>
</div>
<?php endif?>

View file

@ -0,0 +1,8 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item queue">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="30" height="30" /></a>
<a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getItemQueuedLevel())?>)
<div class="cancel">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('cancel' => $this->getItem()->getIndex()))?>"><?php echo $this->__('Cancel')?></a></p>
</div>
</div>

View file

@ -0,0 +1,19 @@
<div class="shipyard item-list" id="reasearch-lab">
<h1><?php echo $this->__('Research Laboratory')?></h1>
<?php echo $this->getPartial('item-list.items')->render()?>
<div class="clear"></div>
</div>
<script type="text/javascript">
/*<![CDATA[*/
(function($){
$(document).ready(function(){
var items = jQuery('#reasearch-lab .item');
jQuery('.image', items).hover(function(e){
jQuery('.details', jQuery(this).parent()).show();
}, function(e){
jQuery('.details', jQuery(this).parent()).hide();
});
});
})(jQuery);
/*]]>*/
</script>

View file

@ -0,0 +1,30 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item-container">
<div class="item title">
<h2><a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a></h2>
<h3 class="level"><?php echo $this->__('Level %d', $this->renderNumber($this->getLevel()))?></h3>
</div>
<div class="item details">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="120" height="120" /></a>
<div class="buy">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('building' => $this->getItemId(), 'mode' => 'research'))?>"><?php echo $this->__('Build next level (%s)', $this->renderNumber($this->getNextLevel()))?></a></p>
</div>
<div class="details">
<p><?php echo $this->getDescription()?></p>
<ul>
<?php foreach ($this->getResourcesConfigForNextLevel() as $resourceId => $resourceConfig):?>
<li class="resource">
<span class="label"><?php echo $this->getResourceName($resourceId)?></span>
<span class="cost<?php if ($resourceConfig->hasData('requirement')):?> capped<?php endif?>"><?php echo $this->renderNumber($resourceConfig->getData('value'))?></span>
<?php if ($resourceConfig->hasData('requirement')):?>
<span class="requirement">(<?php echo $this->renderNumber($resourceConfig->getData('requirement'))?>)</span>
<?php else:?>
<span class="overflow">(<?php echo $this->renderNumber($resourceConfig->getData('overflow'))?>)</span>
<?php endif?>
</li>
<?php endforeach?>
</ul>
<p><?php echo $this->__('Building time: %s', $this->renderTime($this->getBuildingTime(1), false))?>
</div>
</div>
</div>

View file

@ -0,0 +1,6 @@
<?php if (!$this->isEmpty()):?>
<div class="building queue">
<h1><?php echo $this->__('Work in progress')?></h1>
<?php echo $this->getPartial('item-list')->render() ?>
</div>
<?php endif?>

View file

@ -0,0 +1,8 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item queue">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="30" height="30" /></a>
<a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a> (<?php echo $this->renderNumber($this->getItemQueuedLevel())?>)
<div class="cancel">
<p><a class="build" href="<?php echo $this->getUrl('buildings.php', array('cancel' => $this->getItem()->getIndex()))?>"><?php echo $this->__('Cancel')?></a></p>
</div>
</div>

View file

@ -0,0 +1,31 @@
<div class="shipyard item-list countable" id="shipyard">
<h1><?php echo $this->__('Shipyard')?></h1>
<form action="<?php echo $this->getUrl('buildings.php', array('mode' => 'fleet'))?>" method="post" id="shipyard-form">
<?php echo $this->getPartial('item-list.items')->render()?>
<input type="submit" value="<?php echo $this->__('Build')?>">
</form>
<div class="clear"></div>
<script type="text/javascript">
/*<![CDATA[*/
(function($){
$(document).ready(function(){
$('.shipyard .max a').click(function(){
var rel = this.rel.replace(/\:/, '\\\\:');
$('#' + rel).val($('#' + rel + '\\:max').val());
var hidden = $('#' + rel + '\\:max');
var input = $('#' + rel);
$('#shipyard-form').submit();
});
});
var items = jQuery('#shipyard .item');
$('.image', items).hover(function(e){
$('.details', $(this).parent()).show();
}, function(e){
$('.details', $(this).parent()).hide();
});
})(jQuery);
jQuery(document).ready(function(){
});
/*]]>*/
</script>
</div>

View file

@ -0,0 +1,34 @@
<?php /** @var Legacies_Core_Block_Template $this */?>
<div class="item-container">
<div class="item title">
<h2><a href="<?php echo $this->getItemInfoUrl()?>"><?php echo $this->escape($this->getName())?></a></h2>
<h3 class="count"><?php echo $this->__('Current count: %s', $this->renderNumber($this->getQty()))?></h3>
</div>
<div class="item details">
<a href="<?php echo $this->getItemInfoUrl()?>" class="image"><img src="<?php echo $this->getItemImageUrl()?>" alt="" width="120" height="120" /></a>
<div class="qty">
<p><input type="text" name="ship[<?php echo $this->getItemId()?>]" id="ship:<?php echo $this->getItemId()?>" /></p>
<input type="hidden" id="ship:<?php echo $this->getItemId()?>:max" value="<?php echo $this->escape($this->getMaximumBuildableElementsCount())?>" />
</div>
<div class="max">
<p><a rel="ship:<?php echo $this->getItemId()?>"><?php echo $this->__('Build max (%s)', $this->renderNumber($this->getMaximumBuildableElementsCount()))?></a></p>
</div>
<div class="details">
<p><?php echo $this->getDescription()?></p>
<ul>
<?php foreach ($this->getResourcesConfigForQty(1) as $resourceId => $resourceConfig):?>
<li class="resource">
<span class="label"><?php echo $this->getResourceName($resourceId)?></span>
<span class="cost<?php if ($resourceConfig->hasData('requirement')):?> capped<?php endif?>"><?php echo $this->renderNumber($resourceConfig->getData('value'))?></span>
<?php if ($resourceConfig->hasData('requirement')):?>
<span class="requirement">(<?php echo $this->renderNumber($resourceConfig->getData('requirement'))?>)</span>
<?php else:?>
<span class="overflow">(<?php echo $this->renderNumber($resourceConfig->getData('overflow'))?>)</span>
<?php endif?>
</li>
<?php endforeach?>
</ul>
<p><?php echo $this->__('Building time: %s', $this->renderTime($this->getBuildingTime(1), false))?>
</div>
</div>
</div>

View file

@ -0,0 +1,5 @@
<?php if ($this->getData('overload')) :?>
<span class="overload"><?php echo $this->renderNumber($this->getData('stock'))?></span>
<?php else:?>
<?php echo $this->renderNumber($this->getData('stock'))?>
<?php endif?>

View file

@ -0,0 +1,5 @@
<?php if ($this->getData('overload')) :?>
<span class="overload"><?php echo $this->renderNumber($this->getData('usage'))?></span> / <?php echo $this->renderNumber($this->getData('stock'))?>
<?php else:?>
<?php echo $this->renderNumber($this->getData('usage'))?> / <?php echo $this->renderNumber($this->getData('stock'))?>
<?php endif?>

View file

@ -0,0 +1,95 @@
<?php $currentPlanet = $this->getCurrentPlanet();?>
<div class="planet-carrousel">
<div class="items">
<?php foreach ($this->getPlanetCollection() as $planet):?>
<?php if ($planet->getId() != $currentPlanet->getId()):?>
<div class="planet item">
<p class="planet-name"><a href="<?php echo $this->getUrl('overview.php', array('cp' => $planet->getId()))?>"><?php echo $this->escape($planet->getName())?></a></p>
<div class="planet-image">
<?php if (false && ($moon = $planet->getMoon()) !== null): ?>
<a href="<?php echo $this->getUrl('overview.php', array('cp' => $moon->getId()))?>" class="moon">
<img src="<?php echo $this->getSkinUrl($moon->getImage())?>" width="20" height="20"/>
</a>
<?php endif?>
<a href="<?php echo $this->getUrl('overview.php', array('cp' => $planet->getId()))?>" class="planet">
<img src="<?php echo $this->getSkinUrl($planet->getImage())?>" width="50" height="50"/>
</a>
</div>
<p class="planet-position"><a href="<?php echo $this->getUrl('overview.php', array('cp' => $planet->getId()))?>">[<?php echo $this->escape($planet->getCoords())?>]</a></p>
</div>
<?php else:?>
<div class="planet item selected">
<p class="planet-name"><?php echo $this->escape($planet->getName())?></p>
<div class="planet-image">
<?php if (false && ($moon = $planet->getMoon()) !== null): ?>
<span class="moon">
<img src="<?php echo $this->getSkinUrl($moon->getImage())?>" width="20" height="20"/>
</span>
<?php endif?>
<span class="planet">
<img src="<?php echo $this->getSkinUrl($planet->getImage())?>" width="50" height="50"/>
</span>
</div>
<p class="planet-position">[<?php echo $this->escape($planet->getCoords())?>]</p>
</div>
<?php endif?>
<?php endforeach?>
</div>
<div class="end"></div>
</div>
<div class="resources-display-container">
<div class="resources-display">
<div class="resource metal">
<img src="<?php echo $this->getSkinUrl('graphics/images/metall.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Metal')?>" title="<?php echo $this->__('Metal')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_METAL)):?>
<span class="resource-capped"><?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?>
</p>
</div>
<div class="resource cristal">
<img src="<?php echo $this->getSkinUrl('graphics/images/kristall.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Cristal')?>" title="<?php echo $this->__('Cristal')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_CRISTAL)):?>
<span class="resource-capped"><?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?>
</p>
</div>
<div class="resource deuterium">
<img src="<?php echo $this->getSkinUrl('graphics/images/deuterium.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Deuterium')?>" title="<?php echo $this->__('Deuterium')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_DEUTERIUM)):?>
<span class="resource-capped"><?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?>
</p>
</div>
<div class="resource energy">
<img src="<?php echo $this->getSkinUrl('graphics/images/energie.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Energy')?>" title="<?php echo $this->__('Energy')?>" />
<p>
<?php if ($this->getCurrentPlanet()->isResourceCapped(Legacies_Empire::RESOURCE_ENERGY)):?>
<span class="resource-capped"><?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?>
</p>
</div>
<div class="messages">
<img src="<?php echo $this->getSkinUrl('graphics/images/message.gif')?>" border="0" height="22" width="42" alt="<?php echo $this->__('Messages')?>" title="<?php echo $this->__('Messages')?>" />
<p>
<?php if (($count = $this->getCurrentUser()->getNewMessagesCount()) > 1):?>
<a href="<?php echo $this->getUrl('messages.php')?>" title="<?php echo $this->__('You have %1$d new messages.', $count)?>"><?php echo $this->__('%1$d messages.', $count)?></a>
<?php elseif ($count == 1):?>
<a href="<?php echo $this->getUrl('messages.php')?>" title="<?php echo $this->__('You have 1 new message.')?>"><?php echo $this->__('1 message.')?></a>
<?php else:?>
<a href="<?php echo $this->getUrl('messages.php')?>" title="<?php echo $this->__('You have no new message.')?>"><?php echo $this->__('No message.')?></a>
<?php endif?>
</p>
</div>
</div>
</div>