public function setup()
 {
     parent::setup();
     unset($this['id']);
     unset($this['community_event_id']);
     unset($this['member_id']);
     unset($this['number']);
     unset($this['created_at']);
     unset($this['updated_at']);
     $this->widgetSchema->setLabel('body', sfContext::getInstance()->getI18N()->__('Comment') . ' <strong>*</strong>');
     $this->setValidator('body', new opValidatorString(array('rtrim' => true)));
 }
 public function setup()
 {
     parent::setup();
     unset($this['id']);
     unset($this['community_event_id']);
     unset($this['member_id']);
     unset($this['number']);
     unset($this['created_at']);
     unset($this['updated_at']);
     if ('mobile_frontend' == sfConfig::get('sf_app')) {
         $label = sprintf('<font color="%s">*</font>', opColorConfig::get('core_color_22')) . sfContext::getInstance()->getI18N()->__('Comment');
     } else {
         $label = sfContext::getInstance()->getI18N()->__('Comment') . ' <strong>*</strong>';
     }
     $this->widgetSchema->setLabel('body', $label);
     $this->setValidator('body', new opValidatorString(array('rtrim' => true)));
     if (opMobileUserAgent::getInstance()->getMobile()->isNonMobile()) {
         $images = array();
         if (!$this->isNew()) {
             $images = $this->getObject()->getImages();
         }
         $max = (int) sfConfig::get('app_community_topic_max_image_file_num', 3);
         for ($i = 0; $i < $max; $i++) {
             $key = 'photo_' . ($i + 1);
             if (isset($images[$i])) {
                 $image = $images[$i];
             } else {
                 $image = new CommunityEventCommentImage();
                 $image->setCommunityEventComment($this->getObject());
                 $image->setNumber($i + 1);
             }
             $imageForm = new opCommunityTopicPluginImageForm($image);
             $imageForm->getWidgetSchema()->setFormFormatterName('list');
             $this->embedForm($key, $imageForm, '<ul id="community_event_comment_' . $key . '">%content%</ul>');
         }
     }
 }