Permalink
Browse files

moving stylesheet addition to the template

  • Loading branch information...
1 parent a1750cb commit 7d5e1861c8d13f1cd76eb27b4bb11c34e428c337 @nibsirahsieu committed May 3, 2011
@@ -10,10 +10,6 @@ public function initialize()
if (in_array('sfNestedComment', sfConfig::get('sf_enabled_modules', array())))
{
$this->dispatcher->connect('routing.load_configuration', array('sfNestedCommentRouting', 'listenToRoutingLoadConfigurationEvent'));
- if (sfNestedCommentConfig::isUsePluginStylesheet())
- {
- $this->dispatcher->connect('context.load_factories', array('sfNestedCommentRouting', 'listenToContextLoadFactoriesEvent'));
- }
}
if (in_array('sfNestedCommentAdmin', sfConfig::get('sf_enabled_modules', array())))
{
@@ -10,13 +10,6 @@ static public function listenToRoutingLoadConfigurationEvent(sfEvent $event)
$r->prependRoute('sf_nested_commend_add', new sfRoute('/comment/add', array('module' => 'sfNestedComment', 'action' => 'addComment')));
}
- public static function listenToContextLoadFactoriesEvent(sfEvent $event)
- {
- /** @var sfContext */
- $context = $event->getSubject();
- $context->getResponse()->addStylesheet('/sfNestedCommentPlugin/css/sfNestedComment.css');
- }
-
static public function addRouteForNestedCommentAdmin(sfEvent $event)
{
$event->getSubject()->prependRoute('sf_nested_comment', new sfPropel15RouteCollection(array(
@@ -1,4 +1,7 @@
<?php use_helper('I18N') ?>
+<?php if (sfNestedCommentConfig::isUsePluginStylesheet()): ?>
+ <?php use_stylesheet('/sfNestedCommentPlugin/css/sfNestedComment.css') ?>
+<?php endif; ?>
<?php use_javascript('/sfNestedCommentPlugin/js/sfNestedComment.reply.js') ?>
<?php $use_ajax = sfNestedCommentConfig::isAjaxEnabled() ?>
@@ -26,4 +29,4 @@
<script type="text/javascript">
setupAjaxListComments('<?php echo $model ?>', '<?php echo $object->getPrimaryKey() ?>', <?php echo sfNestedCommentConfig::isNestedEnabled() ?>);
</script>
-<?php endif; ?>
+<?php endif; ?>

0 comments on commit 7d5e186

Please sign in to comment.