芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/public_html/wp-content/plugins/fluentformpro/src/Components/ColorPicker.php
15, 'element' => $this->key, 'attributes' => [ 'name' => $this->key, 'class' => '', 'value' => '', 'type' => 'text', 'placeholder' => __('Choose Color', 'fluentformpro') ], 'settings' => [ 'container_class' => '', 'placeholder' => '', 'label' => $this->title, 'label_placement' => '', 'help_message' => '', 'admin_field_label' => '', 'validation_rules' => [ 'required' => [ 'value' => false, 'global' => true, 'message' => Helper::getGlobalDefaultMessage('required'), 'global_message' => Helper::getGlobalDefaultMessage('required'), ] ], 'conditional_logics' => [] ], 'editor_options' => [ 'title' => $this->title, 'icon_class' => 'ff-edit-tint', 'template' => 'inputText' ], ]; } public function getGeneralEditorElements() { return [ 'label', 'admin_field_label', 'placeholder', 'value', 'label_placement', 'validation_rules', ]; } public function render($data, $form) { $elementName = $data['element']; $data = apply_filters_deprecated( 'fluentform_rendering_field_data_' . $elementName, [ $data, $form ], FLUENTFORM_FRAMEWORK_UPGRADE, 'fluentform/rendering_field_data_' . $elementName, 'Use fluentform/rendering_field_data_' . $elementName . ' instead of fluentform_rendering_field_data_' . $elementName ); $data = apply_filters('fluentform/rendering_field_data_' . $elementName, $data, $form); $data['attributes']['class'] = @trim('ff-el-form-control ff-el-color ' . $data['attributes']['class']); $data['attributes']['id'] = $this->makeElementId($data, $form); $data['attributes']['readonly'] = 'true'; if ($tabIndex = \FluentForm\App\Helpers\Helper::getNextTabIndex()) { $data['attributes']['tabindex'] = $tabIndex; } $ariaRequired = 'false'; if (ArrayHelper::get($data, 'settings.validation_rules.required.value')) { $ariaRequired = 'true'; } $elMarkup = "
buildAttributes($data['attributes'], $form) . " aria-invalid='false' aria-required={$ariaRequired}>"; $html = $this->buildElementMarkup($elMarkup, $data, $form); $this->pushScripts($data, $form); $html = apply_filters_deprecated( 'fluentform_rendering_field_html_' . $elementName, [ $html, $data, $form ], FLUENTFORM_FRAMEWORK_UPGRADE, 'fluentform/rendering_field_html_' . $elementName, 'Use fluentform/rendering_field_html_' . $elementName . ' instead of fluentform_rendering_field_html_' . $elementName ); echo apply_filters('fluentform/rendering_field_html_' . $elementName, $html, $data, $form); } private function pushScripts($data, $form) { // We can add assets for this field wp_enqueue_style('pickr'); wp_enqueue_script('pickr'); add_action('wp_footer', function () use ($data, $form) { ?>