Exemplo n.º 1
0
 public function deleteAjaxAction(\Difra\Param\AnyInt $id, \Difra\Param\AjaxCheckbox $confirm = null)
 {
     if (!$confirm or !$confirm->val()) {
         $cat = \Difra\Plugins\Catalog\Category::get($id->val());
         $this->ajax->display('<span>' . $this->locale->getXPath('catalog/adm/category-delete-confirm-1') . htmlspecialchars($cat->getName()) . $this->locale->getXPath('catalog/adm/category-delete-confirm-2') . '</span>' . '<form action="/adm/catalog/categories/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::getInstance()->deleteCategory($id->val());
         $this->ajax->refresh();
     }
 }
Exemplo n.º 2
0
 /**
  * Возвращает полный URI к элементу
  * @return string
  */
 public function getFullLink()
 {
     return Category::get($this->category)->getFullLink() . '/' . $this->id . '-' . $this->link;
 }
Exemplo n.º 3
0
 /**
  * Переместить категорию «ниже»
  * @param int $id
  */
 public function moveCategoryDown($id)
 {
     \Difra\Plugins\Catalog\Category::get($id)->moveDown();
 }