diff options
author | filip <filip.komar@gmail.com> | 2016-12-07 00:03:58 +0100 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2016-12-07 00:03:58 +0100 |
commit | 2b31400895682a2e4186953c9d2a33460370f790 (patch) | |
tree | 6716192151abe4f36d39726c41ac8961e93f9f1e | |
parent | 79f49efbc9a3caa77aafe1fa9b3d201744eb608f (diff) | |
download | www-2b31400895682a2e4186953c9d2a33460370f790.tar www-2b31400895682a2e4186953c9d2a33460370f790.tar.gz www-2b31400895682a2e4186953c9d2a33460370f790.tar.bz2 www-2b31400895682a2e4186953c9d2a33460370f790.tar.xz www-2b31400895682a2e4186953c9d2a33460370f790.zip |
convert timeline html to php function
-rw-r--r-- | en/timeline/index.php | 186 |
1 files changed, 70 insertions, 116 deletions
diff --git a/en/timeline/index.php b/en/timeline/index.php index 317c09f6e..e04a4453c 100644 --- a/en/timeline/index.php +++ b/en/timeline/index.php @@ -4,6 +4,75 @@ define('ALIGNMENT', 'Center'); require '../../langs.php'; $dictionary = read_translation_file($locale, array('timeline', 'common_footer')); +/** + * Output all events + * + * @param array $events + * + * @return string $timeline html code of all events +*/ +function list_events($events = array()) +{ + $indent = "\t\t\t\t"; + $timeline = ''; + foreach ($events as $year => $events_in_year) { + $timeline .= "$indent<li class=\"tliy\">\n"; + $timeline .= "$indent\t<h2>$year</h2>\n"; + $timeline .= "$indent\t<ul class=\"hl\">\n"; + foreach ($events_in_year as $month => $events_in_month) { + $timeline .= "$indent\t\t<li class=\"tlim\">\n"; + $timeline .= "$indent\t\t\t<h3>$month</h3>\n"; + $timeline .= "$indent\t\t\t<ul class=\"hl\">\n"; + foreach ($events_in_month as $event) { + $timeline .= "$indent\t\t\t\t<li class=\"tlie\">$event</li>\n"; + } + $timeline .= "$indent\t\t\t</ul>\n"; + $timeline .= "$indent\t\t</li>\n"; + } + $timeline .= "$indent\t</ul>\n"; + $timeline .= "$indent</li>\n"; + } + return $timeline; +} + +$events = array( + _r('2016') => array( + _r('February') => array(_r('Sixth General Assembly during FOSDEM in Brussels, Belgium.')), + ), + _r('2015') => array( + _r('June') => array(sprintf(_r('<a href=%s>Mageia 5</a> is released.'), '"../5/"')), + _r('February') => array(_r('Fifth General Assembly during FOSDEM in Brussels, Belgium.')), + ), + _r('2014') => array( + _r('February') => array( + _r('<a href="/4/">Mageia 4</a> is released.'), + _r('Fourth General Assembly during FOSDEM in Brussels, Belgium.'), + ), + ), + _r('2013') => array( + _r('May') => array(_r('<a href="/3/">Mageia 3</a> is released.')), + _r('February') => array(_r('Third General Assembly during FOSDEM in Brussels, Belgium.')), + ), + _r('2012') => array( + _r('May') => array(_r('<a href="/2/">Mageia 2</a> is released.')), + _r('February') => array(_r('Second General Assembly during FOSDEM in Brussels, Belgium.')), + ), + _r('2011') => array( + _r('June') => array(_r('<a href="/1/">Mageia 1</a> is released.')), + _r('February') => array(_r('First General Assembly during FOSDEM in Brussels, Belgium.')), + _r('January') => array(_r('Build system is ready to run for the first alpha ISOs.')), + ), + _r('2010') => array( + _r('End of year') => array( + _r('With an incredible response, first donations and discussions abound.'), + _r('Project gets structured, governance takes slowly shape (first board, teams).'), + ), + _r('September') => array( + _r('Mageia starts as a <a href="../about/2010-sept-announcement.html">fork of Mandriva Linux</a>.'), + _r('Mageia.Org is registered in Paris, France.'), + ), + ), +); ?> <!DOCTYPE html> <html lang="<?php echo $locale; ?>"> @@ -35,122 +104,7 @@ $dictionary = read_translation_file($locale, array('timeline', 'common_footer')) <div id="bd" role="main"> <div class="yui-g"><div class="para"> <ul class="hl" id="tl0"> - <li class="tliy"> - <h2><?php _g('2016')?></h2> - <ul class="hl"> - <li class="tlim"> - <h3><?php _g('February')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('Sixth General Assembly during FOSDEM in Brussels, Belgium.')?></li> - </ul> - </li> - </ul> - </li> - <li class="tliy"> - <h2><?php _g('2015')?></h2> - <ul class="hl"> - <li class="tlim"> - <h3><?php _g('June')?></h3> - <ul class="hl"> - <?php _g('<a href=%s>Mageia 5</a> is released.', array('"../5/"'),'li class="tlie"')?> - </ul> - </li> - <li class="tlim"> - <h3><?php _g('February')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('Fifth General Assembly during FOSDEM in Brussels, Belgium.')?></li> - </ul> - </li> - </ul> - </li> - <li class="tliy"> - <h2><?php _g('2014')?></h2> - <ul class="hl"> - <li class="tlim"> - <h3><?php _g('February')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('<a href="/4/">Mageia 4</a> is released.')?></li> - <li class="tlie"><?php _g('Fourth General Assembly during FOSDEM in Brussels, Belgium.')?></li> - </ul> - </li> - </ul> - </li> - <li class="tliy"> - <h2><?php _g('2013')?></h2> - <ul class="hl"> - <li class="tlim"> - <h3><?php _g('May')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('<a href="/3/">Mageia 3</a> is released.')?></li> - </ul> - </li> - <li class="tlim"> - <h3><?php _g('February')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('Third General Assembly during FOSDEM in Brussels, Belgium.')?></li> - </ul> - </li> - </ul> - </li> - <li class="tliy"> - <h2><?php _g('2012')?></h2> - <ul class="hl"> - <li class="tlim"> - <h3><?php _g('May')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('<a href="/2/">Mageia 2</a> is released.')?></li> - </ul> - </li> - <li class="tlim"> - <h3><?php _g('February')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('Second General Assembly during FOSDEM in Brussels, Belgium.')?></li> - </ul> - </li> - </ul> - </li> - <li class="tliy"> - <h2><?php _g('2011')?></h2> - <ul class="hl"> - <li class="tlim"> - <h3><?php _g('June')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('<a href="/1/">Mageia 1</a> is released.')?></li> - </ul> - </li> - <li class="tlim"> - <h3><?php _g('February')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('First General Assembly during FOSDEM in Brussels, Belgium.')?></li> - </ul> - </li> - <li class="tlim"> - <h3><?php _g('January')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('Build system is ready to run for the first alpha ISOs.')?></li> - </ul> - </li> - </ul> - </li> - <li class="tliy"> - <h2><?php _g('2010')?></h2> - <ul class="hl"> - <li class="tlim"> - <h3><?php _g('End of year')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('With an incredible response, first donations and discussions abound.')?></li> - <li class="tlie"><?php _g('Project gets structured, governance takes slowly shape (first board, teams).')?></li> - </ul> - </li> - <li class="tlim"> - <h3><?php _g('September')?></h3> - <ul class="hl"> - <li class="tlie"><?php _g('Mageia starts as a <a href="../about/2010-sept-announcement.html">fork of Mandriva Linux</a>.')?></li> - <li class="tlie"><?php _g('Mageia.Org is registered in Paris, France.')?></li> - </ul> - </li> - </ul> - </li> +<?php echo list_events($events); ?> </ul> </div></div> </div> |