Documentation

GetAdminFilterHTML

string
CIBlockProperty*::GetAdminFilterHTML(
 arProperty,
 strHTMLControlName
);

Prints HTML for property filter on the admin page of iblock element list. Static method when using standard properties. Must be static for properties, created by client when using php7.

Call parameters

Parameter Description
arProperty
Property metadata. See Iblock element properties
strHTMLControlNameName of control elements to fill in property value and its description. Array type:
array( 
    "VALUE" => html //safe name for value, 
    "DESCRIPTION" => html //safe name for description, 
    "MODE" => //can have value "FORM_FILL" when calling from the element edit form 
              //or "iblock_element_admin" when editing in the element list view mode, 
              //as well as "EDIT_FORM" when editing iblock. 
    "FORM_NAME" => //form name with in-built control element. 
    );

Returned value

Returned value - html code.

Examples

For Date/Time type:

function GetAdminFilterHTML($arProperty, $strHTMLControlName)
   {
      $from_name = $strHTMLControlName["VALUE"].'_from';
      $to_name = $strHTMLControlName["VALUE"].'_to';

      $lAdmin = new CAdminList($strHTMLControlName["TABLE_ID"]);
      $lAdmin->InitFilter(array(
         $from_name,
         $to_name,
      ));

      $from = isset($GLOBALS[$from_name])? $GLOBALS[$from_name]: "";
      $to = isset($GLOBALS[$to_name])? $GLOBALS[$to_name]: "";

      return  CAdminCalendar::CalendarPeriod($from_name, $to_name, $from, $to);
   }

© «Bitrix24», 2001-2024
Up