Пример #1
0
 public function deleteAjaxAction(\Difra\Param\AnyInt $id, \Difra\Param\AjaxCheckbox $confirm = null)
 {
     if (!$confirm or !$confirm->val()) {
         $ext = \Difra\Plugins\Catalog\Ext::get($id->val());
         $this->ajax->display('<span>' . $this->locale->getXPath('catalog/adm/ext/delete-confirm-1') . htmlspecialchars($ext->getName()) . $this->locale->getXPath('catalog/adm/ext/delete-confirm-2') . '</span>' . '<form action="/adm/catalog/ext/delete/' . $id . '" method="post" class="ajaxer">' . '<input type="hidden" name="confirm" value="1"/>' . '<input type="submit" value="Да"/>' . '<a href="#" onclick="ajaxer.close(this)" class="button">Нет</a>' . '</form>');
     } else {
         \Difra\Plugins\Catalog\Ext::get($id->val())->delete();
         $this->ajax->refresh();
     }
 }
Пример #2
0
 public function editAction(\Difra\Param\AnyInt $id)
 {
     /** @var \DOMElement $editNode */
     $editNode = $this->root->appendChild($this->xml->createElement('CatalogItemEdit'));
     \Difra\Plugins\Catalog::getInstance()->getCategoriesListXML($editNode);
     \Difra\Plugins\Catalog\Ext::getListXML($editNode, true, true);
     $itemNode = $editNode->appendChild($this->xml->createElement('item'));
     $item = \Difra\Plugins\Catalog\Item::get($id->val());
     $item->loadExt();
     $item->getXML($itemNode);
     $editNode->setAttribute('category', $item->getCategory());
 }
Пример #3
0
 public function deleteAjaxAction(\Difra\Param\AnyInt $id)
 {
     \Difra\Plugins\Catalog\Ext::deleteValue($id);
     $this->ajax->refresh();
 }
Пример #4
0
 /**
  * Изменение расширенного поля
  * @param int $id
  * @param string $name
  * @param int $set
  * @param int|null $group
  * @return Catalog\Ext|null
  */
 public function editExt($id, $name, $set, $group = null)
 {
     $ext = \Difra\Plugins\Catalog\Ext::get($id);
     if (!$ext) {
         return null;
     }
     $ext->setName($name);
     $ext->setSet($set);
     $ext->setGroup($group);
     return $ext;
 }