Код |
---|
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); class CIBlockPropertyCustomButton { function GetUserTypeDescription() { return array( "PROPERTY_TYPE" => "S", "USER_TYPE" => "custom_button", "DESCRIPTION" => 'Кнопка', "GetPublicViewHTML" => array("CIBlockPropertyCustomButton","GetPublicViewHTML"), "GetAdminListViewHTML" => array("CIBlockPropertyCustomButton","GetAdminListViewHTML"), "GetPropertyFieldHtml" => array("CIBlockPropertyCustomButton","GetPropertyFieldHtml"), "ConvertToDB" => array("CIBlockPropertyCustomButton","ConvertToDB"), "ConvertFromDB" => array("CIBlockPropertyCustomButton","ConvertFromDB"), ); } function GetPublicViewHTML($arProperty, $value, $strHTMLControlName) { return ''; } function GetAdminListViewHTML($arProperty, $value, $strHTMLControlName) { return '<button onclick="alert("Click on list"); return false;">Click</button>'; } function GetPropertyFieldHtml($arProperty, $value, $strHTMLControlName) { return '<button onclick="alert("Click on edit page"); return false;">Click</button>'; } function ConvertToDB($arProperty, $value) { return ''; } function ConvertFromDB($arProperty, $value) { return ''; } } AddEventHandler('iblock', 'OnIBlockPropertyBuildList', array('CIBlockPropertyCustomButton', 'GetUserTypeDescription')); ?> |
Код |
---|
<? $tabControl->BeginCustomField("PREVIEW_TEXT", GetMessage("IBLOCK_FIELD_PREVIEW_TEXT"), $arIBlock["FIELDS"]["PREVIEW_TEXT"]["IS_REQUIRED"] === "Y"); ?> <form> <button>Кнопка</button> // кнопка </form> <tr class="heading" id="tr_PREVIEW_TEXT_LABEL"> <td colspan="2"><?echo $tabControl->GetCustomLabelHTML()?></td> </tr> <?if($ID && $PREV_ID && $bWorkflow):?> <tr id="tr_PREVIEW_TEXT_DIFF"> <td colspan="2"> <div style="width:95%;background-color:white;border:1px solid black;padding:5px"> <?echo getDiff($prev_arElement["PREVIEW_TEXT"], $arElement["PREVIEW_TEXT"])?> </div> </td> </tr> <?elseif(COption::GetOptionString("iblock", "use_htmledit", "Y")=="Y" && $bFileman):?> <tr id="tr_PREVIEW_TEXT_EDITOR"> <td colspan="2" align="center"> <?CFileMan::AddHTMLEditorFrame( "PREVIEW_TEXT", $str_PREVIEW_TEXT, "PREVIEW_TEXT_TYPE", $str_PREVIEW_TEXT_TYPE, //300, array( 'height' => 450, 'width' => '100%' ), "N", 0, "", "", $arIBlock["LID"], true, false, array( 'toolbarConfig' => CFileman::GetEditorToolbarConfig("iblock_".(defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1 ? 'public' : 'admin')), 'saveEditorKey' => $IBLOCK_ID ) );?> </td> </tr> <?else:?> <tr id="tr_PREVIEW_TEXT_TYPE"> <td><?echo GetMessage("IBLOCK_DESC_TYPE")?></td> <td><input type="radio" name="PREVIEW_TEXT_TYPE" id="PREVIEW_TEXT_TYPE_text" value="text"<?if($str_PREVIEW_TEXT_TYPE!="html")echo " checked"?>> <label for="PREVIEW_TEXT_TYPE_text"><?echo GetMessage("IBLOCK_DESC_TYPE_TEXT")?></label> / <input type="radio" name="PREVIEW_TEXT_TYPE" id="PREVIEW_TEXT_TYPE_html" value="html"<?if($str_PREVIEW_TEXT_TYPE=="html")echo " checked"?>> <label for="PREVIEW_TEXT_TYPE_html"><?echo GetMessage("IBLOCK_DESC_TYPE_HTML")?></label></td> </tr> <tr id="tr_PREVIEW_TEXT"> <td colspan="2" align="center"> <textarea cols="60" rows="10" name="PREVIEW_TEXT" style="width:100%"><?echo $str_PREVIEW_TEXT?></textarea> </td> </tr> <?endif; $tabControl->EndCustomField("PREVIEW_TEXT", '<input type="hidden" name="PREVIEW_TEXT" value="'.$str_PREVIEW_TEXT.'">'. '<input type="hidden" name="PREVIEW_TEXT_TYPE" value="'.$str_PREVIEW_TEXT_TYPE.'">' ); $tabControl->BeginNextFormTab(); ?> |
Цитата |
---|
Олег Сапегин пишет:
Андрей, а куда код нужно вставить? |