Subversion Repositories LCARS

Compare Revisions

Last modification

Ignore whitespace Rev 192 → Rev 193

/trunk/media/video/series/application/layouts/index/index.phtml
183,7 → 183,7
<tr>
<td style="text-align: center"><?php
$recommended = ($name === $min_series);
if (isset($serie['ignore']) && $serie['ignore'])
if ($serie->ignore)
{
?>&#9646;&#9646;<?php
}
193,45 → 193,45
}
?></td>
<th<?php if ($recommended) { ?> class="recommended"<?php } ?>><?php
$ep_list = isset($serie['episode_list']);
$ep_list = $serie->episode_list;
if ($ep_list)
{
?><a href="<?php
echo $this->escape($serie['episode_list']);
echo $this->escape($serie->episode_list);
?>" title="<?php echo $this->escape($this->_('Episode list')); ?>"><?php
}
echo $name;
echo $serie->title;
if ($ep_list) { ?></a><?php }
?><br>
<span style="font-weight: normal"><?php
if (array_key_exists('channel', $serie)) echo $serie['channel'];
if ($serie->channel) echo $serie->channel;
 
if (array_key_exists('showtimes', $serie))
if ($serie->showtimes)
{
echo ', ' . $serie['showtimes'];
echo ', ' . $serie->showtimes;
}
?></span></th>
<td<?php if ($recommended) { ?> class="recommended"<?php } ?>>
<div><?php echo $this->_('Watched:'); ?> <?php
echo implode(', ', $serie['coverage']) . ' ('. $serie['count'];
?> von <?php $total = $serie['total']; echo $total; ?> Episoden)<?php
if (isset($serie['last_seen']))
echo $this->getCoverage($serie->seen) . ' ('. $serie->count;
?> von <?php $total = $serie->total; echo $total; ?> Episoden)<?php
if ($serie->last_seen)
{
?>; zuletzt am <?php
echo utf8_encode(strftime_portable('%A, %e. %B %Y %H:%M %z', $serie['last_seen']));
echo utf8_encode(strftime_portable('%A, %e. %B %Y %H:%M %z', $serie->last_seen));
}
?></div>
<div class="box">
<div class="meter"
style="width: <?php
$percentage = $serie['percentage'];
$percentage = $serie->percentage;
echo $percentage; ?>%"
></div>
<?php
if (array_key_exists('seasons', $serie))
if ($serie->seasons)
{
$offset = 0;
foreach ($serie['seasons'] as $key => $season)
foreach ($serie->seasons as $key => $season)
{
?>
<div class="season"
263,15 → 263,15
}
}
 
if (isset($serie['episodes']))
if ($serie->episodes)
{
$prevNumber = null;
foreach ($serie['episodes'] as $episode => $description)
foreach ($serie->episodes as $episode => $description)
{
$episode_str = $episode;
if (isset($serie['season_ranges']) && is_array($serie['season_ranges']))
if (is_array($serie->season_ranges))
{
foreach ($serie['season_ranges'] as $season_key => $season_range)
foreach ($serie->season_ranges as $season_key => $season_range)
{
if ($episode >= $season_range[0] && $episode <= $season_range[1])
{
298,9 → 298,9
}
}
 
if (isset($serie['seen']))
if ($serie->seen)
{
foreach ($serie['seen'] as $range)
foreach ($serie->seen as $range)
{
if (!is_array($range))
{
323,9 → 323,9
for ($episode = $range[0]; $episode <= $range[1]; ++$episode)
{
$episode_str = $episode;
if (isset($serie['season_ranges']) && is_array($serie['season_ranges']))
if ($serie->season_ranges)
{
foreach ($serie['season_ranges'] as $season_key => $season_range)
foreach ($serie->season_ranges as $season_key => $season_range)
{
if ($episode >= $season_range[0] && $episode <= $season_range[1])
{
338,10 → 338,10
style="left: <?php echo ($episode - 1) / $total * 100; ?>%;
width: <?php echo 1 / $total * 100; ?>%"
<?php
if (isset($serie['episodes']) && array_key_exists($episode, $serie['episodes']))
if ($serie->episodes && array_key_exists($episode, $serie->episodes))
{
?>title="<?php
echo "{$episode_str}: " . $this->escape($serie['episodes'][$episode]);
echo "{$episode_str}: " . $this->escape($serie->episodes[$episode]);
?>"<?php
}
?>></div>
359,4 → 359,4
?>
</table>
</body>
</html>
</html>
/trunk/media/video/series/application/controllers/IndexController.php
1,7 → 1,7
<?php
 
require_once 'application/views/IndexView.php';
// require_once 'application/models/mappers/SeriesMapper.php';
require_once 'application/models/mappers/SeriesMapper.php';
 
class IndexController extends \PointedEars\PHPX\Controller
{
23,6 → 23,38
$min_series = null;
 
$data = array(
'urns' => array(
'wiki' => 'http://de.wikipedia.org/wiki/'
)
);
 
$serien = SeriesMapper::getInstance()->getList($serien);
 
foreach ($serien as $key => &$serie)
{
if ($serie->total > 0)
{
if (!$serie->ignore && $serie->percentage < $min_percentage)
{
$min_percentage = $serie->percentage;
$min_series = $key;
}
}
}
 
$this->assign('serien', $serien);
$this->assign('min_series', $min_series);
$this->render();
}
 
private function oldIndexAction ()
{
require_once 'data.inc';
 
$min_percentage = 100;
$min_series = null;
 
$data = array(
'urns' => array(
'wiki' => 'http://de.wikipedia.org/wiki/'
),
/trunk/media/video/series/application/views/IndexView.php
56,8 → 56,35
* @param string $s
* @return string
*/
function _ ($s)
public function _ ($s)
{
return $this->_translator->translate($s, $this->_textDomain, $this->_language);
}
 
public function getCoverage ($seen)
{
if (!is_array($seen))
{
return '';
}
 
return implode(', ',
array_map(
function ($e) {
if (is_array($e))
{
if ($e[1] === $e[0] + 1)
{
return implode(', ', $e);
}
 
return $e[0] . '&ndash;' . $e[1];
}
 
return $e;
},
$seen
)
);
}
}