Home computickets Displays the "Edit" buttons, "Delete" in Bitrix

Displays the “Edit” buttons, “Delete” in Bitrix

Author

Date

Category

No buttons are displayed when you enter the mouse.

& lt; if (! Defined ("b_prolog_included") || b_prolog_included! == true) DIE ();
$ i = 0;
Foreach ($ Arresult ["Items"] AS $ AITEM):
  $ this- & gt; additaction ($ aritem ['id'], $ aritem ['edit_link'], ciblock :: getArrayByid ($ aitem ["iblock_id"], "element_edit"));
  $ this- & gt; AdddeleteAction ($ aritem ['id'], $ aritem ['delete_link'], ciblock :: getArrayByid ($ aitem ["iblock_id"], "element_delete"), array ("confirm" = & gt; getmessage ('Ct_bnl_element_delete_confirm')));
  $ file = CFile :: ResizeImageGet ($ aritem ["Detail_PICTURE"], array ('width' = & gt; 1600, 'height' = & gt; 900), bx_resize_image_proporional, true);
  If (CModule :: Includemodule ("iblock")) {
    $ Res = CiblockSection :: GetByid ($ aritem ["iblock_section_id"]);
    if ($ ar_res = $ res- & gt; getnext ())
      $ section = $ Ar_res ['Name'];
  }
  if ($ i == 0) :? & gt;
    & lt; div class = "main-news" id = "& lt;? = $ this- & gt; getDitareAID ($ aritem ['id']);? & gt;" & gt;
      & lt; a href = "& lt;? echo $ aritem [" detail_page_url "]? & gt;" & gt;
        & lt; img src = "& lt;? = $ File ['src']? & gt;" & gt;
        & lt; div class = "title" & gt;
          & lt;? echo $ aritem ["Name"]? & gt;
        & lt; / div & gt;
      & lt; / a & gt;
      & lt; div class = "date" & gt;
        & lt;? echo $ aritem ["display_active_from"]? & gt; | & lt; span & gt; & lt;? = $ Section? & gt; & lt; / span & gt;
      & lt; / div & gt;
    & lt; / div & gt;
    & lt; div class = "all-news" & gt;
  & lt;? ELSE:? & GT;
    & lt; div class = "news-item" id = "& lt;? = $ this- & gt; GeteditareAID ($ aritem ['id']);? & gt;" & gt;
      & lt;? if ($ file ['src']! = "") :? & gt;
      & lt; a href = "& lt;? echo $ aritem [" detail_page_url "]? & gt;" & gt;
        & lt; img src = "& lt;? = $ File ['src']? & gt;" & gt;
        & lt; div class = "title" & gt;
          & lt;? echo $ aritem ["Name"]? & gt;
        & lt; / div & gt;
      & lt;? ELSE:? & GT;
      & lt; a href = "& lt;? Echo $ aritem [" detail_page_url "]? & gt;" Class = "Picholder" & gt;
        & lt;? echo $ aritem ["Name"]? & gt;
      & lt;? endif; ? & gt;
      & lt; / a & gt;
      & lt; div class = "date" & gt;
        & lt;? echo $ aritem ["display_active_from"]? & gt; | & lt; span & gt; & lt;? = $ Section? & gt; & lt; / span & gt;
      & lt; / div & gt;
    & lt; / div & gt;
  & lt;? endif;
  $ i ++;
EndForeach;? & gt;
& lt; / div & gt;

In the code, everything seems correctly written but the buttons next to Main-News and News-Item are not displayed.

What am I doing wrong?


Answer 1

You at the very beginning of the cycle connects the Hermitage support. Try to clean the cache of the component / page

$ this- & gt; additaction ($ aritem ['id'], $ aritem ['edit_link'], ciblock :: GetArrayByid ($ aritem ["iblock_id"], "element_edit"));
  $ this- & gt; AdddeleteAction ($ aritem ['id'], $ aritem ['delete_link'], ciblock :: getArrayByid ($ aitem ["iblock_id"], "element_delete"), array ("confirm" = & gt; getmessage ('Ct_bnl_element_delete_confirm')));

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions