70 lines
1.5 KiB
PHP
70 lines
1.5 KiB
PHP
<?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(
|
||
'always' => 'Always',
|
||
'hourly' => 'Hourly',
|
||
'daily' => 'Daily',
|
||
'weekly' => 'Weekly',
|
||
'monthly' => 'Monthly',
|
||
'yearly' => 'Yearly',
|
||
'never' => 'Never'
|
||
|
||
);
|
||
|
||
return $frequencys;
|
||
}
|
||
}
|