Source for file FeedEditor.class.php
Documentation is available at FeedEditor.class.php
* Содержит класс FeedEditor
* @copyright Energine 2007
* Класс для построения редакторов управляющихся из панели управления
* Включен ли режим редактировани
* @param Document $document
public function __construct($name, $module, Document $document, array $params = null) {
parent::__construct($name, $module, $document, $params);
* Добавляем параметр - имя связанного компонента
* Для форм поле smap_id віводим как string
* @return DataDescription
if (in_array($this->getType(), array(self::COMPONENT_TYPE_FORM_ADD, self::COMPONENT_TYPE_FORM_ALTER))) {
$field = $result->getFieldDescriptionByName('smap_id');
* Определяем данные для smap_id
$result = parent::createData();
if (in_array($this->getType(), array(self::COMPONENT_TYPE_FORM_ADD, self::COMPONENT_TYPE_FORM_ALTER))) {
$field = $result->getFieldByName('smap_id');
$field->setRowData($i, $info['Name']);
protected function main() {
$_SESSION['feed_smap_id'] =
$this->document->componentManager->getComponentByName(
//unset($_SESSION['feed_smap_id']);
* Для метода main убираем вызов построителя
public function build() {
if ($param = $this->getParam('linkTo')) {
if (($component = $this->document->componentManager->getComponentByName($param)) && ($component->getAction() != 'view') && $this->isEditable) {
$result->documentElement->appendChild($result->importNode($this->js, true));
$result->documentElement->appendChild($result->createElement('recordset'));
if (($tbs = $this->getToolbar()) && (!empty($tbs))) {
if($toolbar = $tb->build()) {
$result->documentElement->appendChild($result->importNode($toolbar, true));
if ($this->getType() !== self::COMPONENT_TYPE_LIST ) {
$result = parent::build();
* Выставляем smap_id в текущее значение
|