<?php
/*
 * Copyright (c) 2013, webvariants GbR, http://www.webvariants.de
 *
 * This file is released under the terms of the MIT license. You can find the
 * complete text in the attached LICENSE file or online at:
 *
 * http://www.opensource.org/licenses/mit-license.php
 */

$urlParams = array('article_id' => $article->getId(), 'clang' => $article->getClang());
$menu      = '';
$isMeta    = $this instanceof sly_Controller_Contentmeta;
$url       = sly_Util_HTTP::getAbsoluteUrl($article);

$listElements = array();
$listElements[] = '<a href="'.$_router->getUrl('content', null, $urlParams).'"'.($isMeta ? '' : ' class="sly-active"').'>'.t('edit_mode').'</a>';
$listElements[] = '<a href="'.$_router->getUrl('contentmeta', null, $urlParams).'"'.($isMeta ? ' class="sly-active"' : '').'>'.t('metadata').'</a>';
$listElements[] = '<a href="'.$url.'" class="sly-blank">'.t('show').'</a>';

$listElements = sly_Core::dispatcher()->filter('SLY_PAGE_CONTENT_ACTIONS_MENU', $listElements, array(
	'article_id' => $article->getId(),
	'clang'      => $article->getClang()
));
?>
<ul class="sly-navi-content">
	<?php
	foreach ($listElements as $idx => $element) {
		$class = $idx == 0 ? ' class="sly-first"' : '';
		$menu .= '<li'.$class.'>'.$element.'</li>';
	}

	print $menu;
	?>
</ul>
