<?php
define('RENDER_MODE', 'catalyz');
ob_start();
$ContentTreeNode = $ContentTree->getCurrentNode();
include_partial('catalyz/header');

?>
<div id="catalyz-content">
<div id="catalyz-content-internal">
<h1><?php echo __('Delete page "%s"?', array('%s' =>
        sprintf('<a href="%s">%s</a>', $ContentTreeNode->getUrl(), $ContentTreeNode->getTitle())
        ), 'catalyz');

?></h1>

<p><?php echo __('You are about to delete a page from your website.', null, 'catalyz'); ?> <b><?php echo __('This action cannot be cancelled.', null, 'catalyz'); ?></b></p>
<?php if (count(sfConfig::get('app_translations_available_languages')) > 1):?>
<p><?php echo __('This operation will remove all translations. If you want to remove only a specific translation, please use the "delete" link in the %link_start%translation management section%link_end%.', array('%link_start%' => sprintf('<a href="%s">', url_for('@node-translations?node_id=' . $ContentTreeNode->getId())), '%link_end%' => '</a>'), 'catalyz'); ?></p>
<?php endif; ?>
<?php
$count = $ContentTreeNode->getNumberOfDescendants();

if ($count > 0) {
    echo '<p>';
    echo format_number_choice('[1]This page currently has <b>one child</b>.|(1,+Inf]This page currently has <b>%children% children</b>.', array('%children%' => $count), $count, 'catalyz')
     . __('All subpages will also be removed if you confirm this action.', array(), 'catalyz');
    echo '</p>';
}

?>


<p><?php echo __('Are you sure?', null, 'catalyz'); ?></p>
<?php

use_helper('Form');
echo form_tag('@node-delete?node_id=' . $ContentTreeNode->getId());
echo input_hidden_tag('node_id', $ContentTreeNode->getId());
echo input_tag('Confirm', __('Yes', null, 'catalyz'), array('type' => 'submit'));
echo '&nbsp;';
echo input_tag('Cancel', __('No', null, 'catalyz'), array('type' => 'submit'));

?>

</form></div></div>

<?php

$content = ob_get_contents();

ob_end_clean();

$properties = array();
$properties['page'] = $page;
// $properties['node'] = $node;
// $properties['culture'] = $culture;
$properties['ContentTree'] = $ContentTree;

use_helper('Catalyz');
$layout = LayoutManager::instance()->getCatalyzTemplate($ContentTree->getCurrentNode()->getCurrentLayoutNameForAction());
$properties['layout_family'] = $layout[0];
$properties['layout_name'] = $layout[1];

embed_with_layout($content, $layout, $properties);

?>