deblan.tv/vendor/trinity/src/Trinity/Bundle/ContentManagerBundle/Form/Type/PageSitemapType.php

70 lines
1.5 KiB
PHP
Raw Normal View History

2015-03-02 21:57:49 +01:00
<?php
namespace Trinity\Bundle\ContentManagerBundle\Form\Type;
use Symfony\Component\Form\FormBuilderInterface;
class PageSitemapType extends PageType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('sitemap_status');
$builder->add(
'sitemap_priority',
'choice',
array(
'choices' => $this->getPagesPriority(),
'required' => false,
)
);
$builder->add(
'sitemap_frequency',
'choice',
array(
'choices' => $this->getPagesFrequency(),
'required' => false,
)
);
}
public function getPagesPriority()
{
$prioritys = array(
'0.1' => '0.1',
'0.2' => '0.2',
'0.3' => '0.3',
'0.4' => '0.4',
'0.5' => '0.5',
'0.6' => '0.6',
'0.7' => '0.7',
'0.8' => '0.8',
'0.9' => '0.9',
'1' => '1'
);
return $prioritys;
}
public function getPagesFrequency()
{
$frequencys = array(
2015-05-04 19:34:46 +02:00
'always' => 'Always',
'hourly' => 'Hourly',
'daily' => 'Daily',
'weekly' => 'Weekly',
'monthly' => 'Monthly',
'yearly' => 'Yearly',
'never' => 'Never'
2015-03-02 21:57:49 +01:00
);
return $frequencys;
}
}