Permalink
Browse files

Initial commit, added a Timing field the the campaign event form.

  • Loading branch information...
collinkrawll committed Oct 11, 2016
0 parents commit a5a7c9b0280e97a852e37008de97dd888216ef44
Showing with 738 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +20 −0 Config/config.php
  3. +47 −0 Form/Extension/EventTypeExtension.php
  4. +2 −0 README.md
  5. +43 −0 ThirdSetMauticTimingBundle.php
  6. +621 −0 license.txt
@@ -0,0 +1,5 @@
# NetBeans
/nbproject/private/
# OSX
.DS_Store
@@ -0,0 +1,20 @@
<?php
/**
* @package ThirdSetMauticTimingBundle
* @copyright 2016 Third Set Productions. All rights reserved.
* @author Third Set Productions
* @link http://www.thirdset.com
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
/**
* Configure the plugin.
* Note: there are additional services defined in the ThirdSetMauticTimingBundle
* class.
*/
return array(
'name' => 'Timing',
'description' => 'Allows for processing actions only during certain times.',
'version' => '1.0',
'author' => 'Third Set Productions',
);
@@ -0,0 +1,47 @@
<?php
/**
* @package ThirdSetMauticTimingBundle
* @copyright 2016 Third Set Productions. All rights reserved.
* @author Third Set Productions
* @link http://www.thirdset.com
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
namespace MauticPlugin\ThirdSetMauticTimingBundle\Form\Extension;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormBuilderInterface;
/**
* Class EventTypeExtension
*
* @package ThirdSetMauticTimingBundle
*/
class EventTypeExtension extends AbstractTypeExtension
{
/**
* Returns the name of the type being extended.
*
* @return string The name of the type being extended
*/
public function getExtendedType()
{
return 'Mautic\CampaignBundle\Form\Type\EventType';
}
/**
* Build the form (starting with the form built by the parent type).
* @param FormBuilderInterface $builder The builder from the parent type.
* @param array $options Any options from the parent type.
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('timing', 'text', array(
'attr' => array(
'title' => 'Enter when the email can be sent.',
'style' => 'margin-top: 1em',
)
)
);
}
}
@@ -0,0 +1,2 @@
# ThirdSetMauticTimingBundle
@@ -0,0 +1,43 @@
<?php
/**
* @package ThirdSetMauticTimingBundle
* @copyright 2016 Third Set Productions. All rights reserved.
* @author Third Set Productions
* @link http://www.thirdset.com
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
namespace MauticPlugin\ThirdSetMauticTimingBundle;
use Mautic\PluginBundle\Bundle\PluginBundleBase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Class ThirdSetMauticTimingBundle
*
* @package MauticPlugin\ThirdSetMauticTimingBundle
*/
class ThirdSetMauticTimingBundle extends PluginBundleBase
{
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
{
parent::build($container);
/**
* Type Extensions
* Note: these are registered here because Mautic's config system
* doesn't seem to be able to handle complex tags.
*/
$container
->register(
'plugin.thirdset.timing.event_type_extension',
'MauticPlugin\ThirdSetMauticTimingBundle\Form\Extension\EventTypeExtension'
)
->addTag('form.type_extension', array('extended_type' => 'Mautic\CampaignBundle\Form\Type\EventType'));
}
}
Oops, something went wrong.

0 comments on commit a5a7c9b

Please sign in to comment.