Development

#2899: optional_css.patch

You must first sign up to be able to contribute.

Ticket #2899: optional_css.patch

File optional_css.patch, 2.9 kB (added by Michael.Nolan, 1 year ago)

Make sf_comment.css optional

  • plugins/sfPropelActAsCommentableBehaviorPlugin/config/app.yml.sample

    old new  
    2222    namespaces: 
    2323      frontend:        
    2424      backend:        administrator 
    25     use_ajax:         true        
     25    use_ajax:         true 
     26    css:              false 
    2627    count: 
    2728      enabled:        true 
    2829      method:         setSfCommentCount 
  • plugins/sfPropelActAsCommentableBehaviorPlugin/modules/sfComment/lib/BasesfCommentComponents.class.php

    old new  
    2222   
    2323  public function executeCommentForm() 
    2424  { 
    25     sfContext::getInstance()->getResponse()->addStylesheet('/sfPropelActAsCommentableBehaviorPlugin/css/sf_comment'); 
    2625    $this->getConfig(); 
     26    if ($this->config['css']) 
     27    { 
     28      sfContext::getInstance()->getResponse()->addStylesheet('/sfPropelActAsCommentableBehaviorPlugin/css/sf_comment'); 
     29    } 
    2730 
    2831    if ($this->object instanceof sfOutputEscaperObjectDecorator) 
    2932    { 
     
    100103    $config = array('user'             => $config_user, 
    101104                    'anonymous'        => $config_anonymous, 
    102105                    'use_ajax'         => sfConfig::get('app_sfPropelActAsCommentableBehaviorPlugin_use_ajax', false), 
     106                    'css'              => sfConfig::get('app_sfPropelActAsCommentableBehaviorPlugin_css', true), 
    103107                    'namespaces'       => array()); 
    104108 
    105109    $this->config = $config; 
  • plugins/sfPropelActAsCommentableBehaviorPlugin/README

    old new  
    7272all: 
    7373  sfPropelActAsCommentableBehaviorPlugin: 
    7474    use_ajax:         true 
     75    css:              true 
    7576    anonymous: 
    7677      enabled:        true 
    7778      layout: 
     
    105106file, you can tweak the default setup: 
    106107 * the '''use_ajax''' rule indicates whether or not the comment system must use  
    107108 ajax. 
     109 * the '''css''' rule indicates whether or not to load the supplied styles. 
    108110 * the '''anonymous''' rules will tweak the way the plugin handles anonymous  
    109111 comments: 
    110112   * '''enabled''' : enables or disables anonymous comments. 
     
    378380all: 
    379381  sfPropelActAsCommentableBehaviorPlugin: 
    380382    use_ajax:         true 
     383    css:              true 
    381384    anonymous: 
    382385      enabled:        true 
    383386      layout: