Documentation

ActionAjaxReload

string
CAdminList::ActionAjaxReload(
  string $url
)

ActionAjaxReload returns a string which is a JavaScript call required for dynamic list update using the specified URL. A link to the update script is specified in the $url parameter. The update script can use the [link= 506982]CAdminList:CheckListMode[/link] method to check the action type.

Example

The following code builds a context menu for a group of files in the Site Explorer.

$defaultEdit = COption::GetOptionString("fileman", "default_edit", "text");

if($FILE_ACCESS > "U")
{
  $arDDMenu = array();

  $isB = false;
  $dbRes = CGroup::GetDropDownList();
  while ($arRes = $dbRes->Fetch())
  {
    if($show_perms_for == $arRes["REFERENCE_ID"])
      $isB = true;

    $arDDMenu[] = array(
      "TEXT" => $arRes["REFERENCE"],
      "ACTION" => $lAdmin->ActionAjaxReload("fileman_admin.php?".$addUrl."&site=".UrlEncode($site)."&path=".UrlEncode($path)."&show_perms_for=".$arRes["REFERENCE_ID"]).';return false;',
      "ICON" =>  ($show_perms_for == $arRes["REFERENCE_ID"] ? "checked" : "" ),
    );
  }

  $arDDMenu[] = array(
    "TEXT" => GetMessage("FILEMAN_ADM_CUR_USER"),
    "ACTION" => $lAdmin->ActionAjaxReload("fileman_admin.php?".$addUrl."&site=".UrlEncode($site)."&path=".UrlEncode($path)."&show_perms_for=0").';return false;',
    "ICON" =>  (!$isB ? "checked" : "" ),
  );

  $aContext = array(
    array(
      "TEXT" => GetMessage("FILEMAN_ADMIN_NEW_FOLDER"),
      "ICON" => "btn_new_folder",
      "LINK" => "fileman_newfolder.php?".$addUrl."&site=".$site."&path=".UrlEncode($path)."",
      "TITLE" => GetMessage("FILEMAN_ADMIN_NEW_FOLDER")
    ),
    array(
      "TEXT" => GetMessage("FILEMAN_ADMIN_NEW_FILE"),
      "ICON" => "btn_new_file",
      "LINK" =>
        ($defaultEdit == 'html'?
          "fileman_html_edit.php?".$addUrl."&site=".$site."&path=".UrlEncode($path)."&new=y"
        :
          (
          $defaultEdit == 'php' && $USER->IsAdmin()?
            "fileman_file_edit.php?".$addUrl."&site=".$site."&full_src=Y&path=".UrlEncode($path)."&new=y"
          :
            "fileman_file_edit.php?".$addUrl."&site=".$site."&path=".UrlEncode($path)."&new=y"
          )
        ),
      "TITLE" => GetMessage("FILEMAN_ADMIN_NEW_FILE")
    ),
    array(
      "TEXT" => GetMessage("FILEMAN_ADMIN_FILE_UPLOAD"),
      "ICON" => "btn_upload",
      "LINK" => "fileman_file_upload.php?".$addUrl."&site=".$site."&path=".UrlEncode($path)."",
      "TITLE" => GetMessage("FILEMAN_ADMIN_FILE_UPLOAD")
    ),
    array(
      "TEXT" => GetMessage("FILEMAN_ADMIN_MENU_ADD"),
      "ICON" => "btn_new_menu",
      "LINK" => "fileman_menu_edit.php?".$addUrl."&site=".$site."&path=".UrlEncode($path)."&new=y",
      "TITLE" => GetMessage("FILEMAN_ADMIN_MENU_ADD")
    ),
    array(
      "NEWBAR" => True
    ),
    array(
      "TEXT" => GetMessage("FILEMAN_ADMIN_FOLDER_PROP"),
      "LINK" => "fileman_folder.php?".$addUrl."&site=".$site."&path=".UrlEncode($path)."",
      "ICON" => "btn_folder_prop",
      "TITLE" => GetMessage("FILEMAN_ADMIN_FOLDER_PROP")
    ),
    array(
      "TEXT" => GetMessage('FILEMAN_SHOW_PRM_FOR'),
      "TITLE" => GetMessage('FILEMAN_SHOW_PRM_FOR'),
      "MENU" => $arDDMenu
    ),
    array(
      "NEWBAR" => True
    ),
  );
}
© «Bitrix24», 2001-2024
Up