Exemplo n.º 1
0
 /**
  * Example:
  * <code>
  * <div id="<?=$item->area($this)?>"></div>
  * </code>
  * @param CBitrixComponentTemplate $component
  * @param bool $edit
  * @param bool $delete
  * @return string
  */
 function area($component, $edit = true, $delete = true)
 {
     if ($edit) {
         $component->AddEditAction($this->id(), $this->get('EDIT_LINK'), CIBlock::GetArrayByID($this->iblock(), "ELEMENT_EDIT"));
     }
     if ($delete) {
         $component->AddDeleteAction($this->id(), $this->get('DELETE_LINK'), CIBlock::GetArrayByID($this->iblock(), "ELEMENT_DELETE"), array("CONFIRM" => GetMessage('CT_BNL_ELEMENT_DELETE_CONFIRM')));
     }
     return $component->GetEditAreaId($this->id());
 }
Exemplo n.º 2
0
 /**
  * Добавляет кнопку удаление элемента инфоблока
  * @param \CBitrixComponent $template
  * @param IblockElement $element
  */
 public static function addButtonDeleteIblockSection(\CBitrixComponentTemplate &$template, IblockSection $element, $title = "Удалить")
 {
     $template->AddDeleteAction($element->ID, Iblock::getSectionDeleteUrl($element), $title, ["CONFIRM" => "Вы уверены что хотите удалить запись?"]);
 }