Bitrix Site Manager

CAdminList::ActionRedirect

string
CAdminList::ActionRedirect(
  string $url
)

The method ActionRedirect returns a string which is a JavaScript call required to redirect a user to the specified page. The link to the page is defined in the $url parameter. The method can be used to create links for the Control Panel menu or a list element context menu.

Example


while($arRes = $rsData->NavNext(true, "f_")):
  
  // create a row; the result is the CAdminListRow class instance
$row =& $lAdmin->AddRow($f_ID, $arRes); // then add fields in the appropriate format
// the NAME parameter is edited as text and displayed as a link
$row->AddInputField("NAME", array("size"=>20)); $row->AddViewField("NAME", '<a href="rubric_edit.php?id='.$f_id.'&lang='.lang.'">'.$f_name.'</a>'); // the LID parameter is edited as a drop-down list of languages $row->AddEditField("LID", CLang::SelectBox("LID", $f_LID)); // the SORT parameter is edited as text $row->AddInputField("SORT", array("size"=>20)); // the ACTIVE and VISIBLE flags are edited as checkboxes $row->AddCheckField("ACTIVE"); $row->AddCheckField("VISIBLE"); // the AUTO parameter is displayed as Yes or NO in bold in the editing mode $row->AddViewField("AUTO", $f_AUTO=="Y"?GetMessage("POST_U_YES"):GetMessage("POST_U_NO")); $row->AddEditField("AUTO", "<b>".($f_AUTO=="Y"?GetMessage("POST_U_YES"):GetMessage("POST_U_NO"))."</b>"); // build the context menu $arActions = Array(); // element editing
$arActions[] = array( "ICON"=>"edit", "DEFAULT"=>true, "TEXT"=>GetMessage("rub_edit"), "ACTION"=>$lAdmin->ActionRedirect("rubric_edit.php?ID=".$f_ID) ); // element deletion if ($POST_RIGHT>="W") $arActions[] = array( "ICON"=>"delete", "TEXT"=>GetMessage("rub_del"), "ACTION"=>"if(confirm('".GetMessage('rub_del_conf')."')) ".$lAdmin->ActionDoGroup($f_ID, "delete") ); // insert the separator $arActions[] = array("SEPARATOR"=>true); // check the automated mail list template if (strlen($f_TEMPLATE)>0 && $f_AUTO=="Y") $arActions[] = array( "ICON"=>"", "TEXT"=>GetMessage("rub_check"), "ACTION"=>$lAdmin->ActionRedirect("template_test.php?ID=".$f_ID) ); // if the separator comes last, delete it if(is_set($arActions[count($arActions)-1], "SEPARATOR")) unset($arActions[count($arActions)-1]); // attach the context menu to the row $row->AddActions($arActions); endwhile;