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 addButtonEditIblockSection(\CBitrixComponentTemplate &$template, IblockSection $element, $title = "Редактировать")
 {
     $template->AddEditAction($element->ID, Iblock::getSectionUpdateUrl($element), $title);
 }