protected function init() { parent::init(); $this->registerInternalProperty('post', SwatDBClassMap::get('BlorgPost')); $this->registerInternalProperty('author', SwatDBClassMap::get('BlorgAuthor')); $this->table = 'BlorgComment'; }
protected function init() { parent::init(); $this->registerInternalProperty('photo', SwatDBClassMap::get('PinholePhoto')); $this->registerInternalProperty('photographer', SwatDBClassMap::get('PinholePhotographer')); $this->table = 'PinholeComment'; }
protected function buildInternal() { parent::buildInternal(); if ($this->id === null || $this->comment->author !== null) { $this->ui->getWidget('edit_form')->action = sprintf('%s?post=%d', $this->source, $this->comment->post->id); $this->ui->getWidget('author_field')->visible = true; $instance_id = $this->app->getInstanceId(); $sql = sprintf('select BlorgAuthor.*, AdminUserInstanceBinding.usernum from BlorgAuthor left outer join AdminUserInstanceBinding on AdminUserInstanceBinding.default_author = BlorgAuthor.id where BlorgAuthor.instance %s %s and BlorgAuthor.visible = %s order by displayorder', SwatDB::equalityOperator($instance_id), $this->app->db->quote($instance_id, 'integer'), $this->app->db->quote(true, 'boolean')); $rs = SwatDB::query($this->app->db, $sql); $default_author = null; $authors = array(); foreach ($rs as $row) { $authors[$row->id] = $row->name; if ($this->id === null && $row->usernum == $this->app->session->user->id) { $this->ui->getWidget('author')->value = $row->id; } } $this->ui->getWidget('author')->addOptionsByArray($authors); } $statuses = SiteComment::getStatusArray(); $this->ui->getWidget('status')->addOptionsByArray($statuses); }
protected function buildInternal() { parent::buildInternal(); $this->ui->getWidget('edit_form')->action = sprintf('%s?photo=%d', $this->source, $this->comment->photo->id); if (count($this->photographers) > 0) { $this->ui->getWidget('photographer_field')->visible = true; $this->ui->getWidget('fullname_field')->visible = false; $this->ui->getWidget('link_field')->visible = false; $this->ui->getWidget('email_field')->visible = false; $this->ui->getWidget('status_field')->visible = false; $this->ui->getWidget('photographer')->addOptionsByArray($photographers); if ($this->comment->photographer !== null) { $this->ui->getWidget('photographer')->value = $this->comment->photographer->id; } } $statuses = SiteComment::getStatusArray(); $this->ui->getWidget('status')->addOptionsByArray($statuses); }
echo in_array('description', $active) ? 'active' : ''; ?> " id="description"> <?php echo $product->add_description; ?> </div> <div class="tab-pane fade in <?php echo in_array('reviews', $active) ? 'active' : ''; ?> " id="reviews"> <div class="p20 clearfix"> <?php // comments $comments = SiteComment::model()->provider(SiteComment::TYPE_PRODUCT, $product->id); $this->widget('comment.widgets.SiteComments', ['dataProvider' => $comments, 'type' => SiteComment::TYPE_PRODUCT, 'objectId' => $product->id]); ?> </div> </div> </div> <?php $this->endWidget(); ?> <br class="clear"> <?php // АЛЬТЕРНАТИВНЫЙ ВАРИАНТ portlet if ($ids = Product::getAlternativeProducts($product->id, 20)) { $this->widget('ProductsGroupPortlet', ['id' => 'products-group-portlet', 'linkTitle' => 'АЛЬТЕРНАТИВНЫЙ ВАРИАНТ', 'item_count' => 5, 'portlet_width' => '800px', 'noPagination' => true, 'run_carousel' => true, 'bigImg' => 'alternative', 'arrow' => true, 'ids' => $ids, 'linkHtmlOptions' => ['class' => 'd1-d2 products-group-portlet']]); }