public static function render_bm_cust(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$choices = $preparedOption['option_value'];
$editLink = $view->createTemplateObject('option_list_option_editlink', array(
'preparedOption' => $preparedOption,
'canEditOptionDefinition' => $canEdit
));
$configs = XenForo_Model::create('KingK_BbCodeManager_Model_CustomButtons')->getAllConfig('strict');
//Check if there is any custom configs
if(!is_array($configs) || empty($configs))
{
unset($configs);
$configs['disable'] = array(
'value' => 'disable',
'phrase' => new XenForo_Phrase('Bbcm_no_custom_editor_available')
);
}
else
{
foreach($configs as &$config)
{
if(isset($config['config_type']))
{
$title = 'button_manager_config_' . $config['config_type'];
$config['phrase'] = new XenForo_Phrase($title);
}
}
}
return $view->createTemplateObject('option_bbcm_bm_cust', array(
'fieldPrefix' => $fieldPrefix,
'listedFieldName' => $fieldPrefix . '_listed[]',
'preparedOption' => $preparedOption,
'formatParams' => $preparedOption['formatParams'],
'editLink' => $editLink,
'choices' => $choices,
'configs' => $configs,
'nextCounter' => count($choices) + 1
));
}