public function __construct(sfWidgetFormSchema $widgetSchema) { $this->rowFormat = '<font color="' . opColorConfig::get('core_color_19') . '">%label%:</font><br>%field%%help%%hidden_fields%%error%<br><br>'; $this->errorListFormatInARow = '<font color="' . opColorConfig::get('core_color_22') . '">' . "\n" . '%errors%</font>'; $this->helpFormat = '<br><font color="' . opColorConfig::get('core_color_19') . '">%help%</font>'; $this->setWidgetSchema($widgetSchema); }
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>'); } } }
public function save() { foreach ($this->getValues() as $k => $v) { opColorConfig::set($k, $v, 'mobile_frontend'); } }
?> <hr color="<?php echo $op_color['core_color_11']; ?> "> <div id="formEventComment"> <table> <form action="<?php echo url_for('communityEvent_comment_create', $communityEvent); ?> " method="post"> <?php echo __('%0% is required field.', array('%0%' => sprintf('<font color="%s">*</font>', opColorConfig::get('core_color_22')))); ?> <hr color="<?php echo opColorConfig::get('core_color_11'); ?> "> <?php echo $form; if (!$communityEvent->isClosed() && !$communityEvent->isExpired()) { if ($communityEvent->isEventMember($sf_user->getMemberId())) { ?> <input name="cancel" class="input_submit" type="submit" value="<?php echo __('Cancel'); ?> " /> <?php } elseif (!$communityEvent->isAtCapacity()) { ?> <input name="participate" class="input_submit" type="submit" value="<?php