39 private $branch_property;
53 parent::__construct(
'wpdk_preferences_view-' . $property );
55 if ( !empty( $property ) && isset( $this->preferences->$property ) ) {
56 $this->branch_property = $property;
57 $this->branch = $this->preferences->$property;
69 $nonce = md5( $this->
id );
72 $input_hidden_nonce->value = wp_create_nonce( $this->
id );
76 $input_hidden_class->value = get_class( $this->preferences );
78 $input_hidden_branch =
new WPDKHTMLTagInput(
'',
'wpdk_preferences_branch' );
80 $input_hidden_branch->value = $this->branch_property;
83 $form =
new WPDKHTMLTagForm( $input_hidden_nonce->html() . $input_hidden_class->html() . $input_hidden_branch->html() . $layout->html() . $this->
buttonsUpdateReset() );
84 $form->name =
'wpdk_preferences_view_form-' . $this->branch_property;
85 $form->id = $form->name;
86 $form->class[] =
'wpdk-form wpdk-preferences-view-' . $this->branch_property;
87 $form->method =
'post';
90 do_action(
'wpdk_preferences_feedback-' . $this->branch_property );
106 die( __METHOD__ .
' must be override in your subclass' );
120 'name' =>
'update-preferences',
122 $button_update =
WPDKUI::button( __(
'Update', WPDK_TEXTDOMAIN ), $args );
124 $confirm = __(
"Are you sure to reset this preferences to default values?\n\nThis operation is not reversible!", WPDK_TEXTDOMAIN );
125 $confirm = apply_filters(
'wpdk_preferences_reset_to_default_confirm_message', $confirm );
128 'name' =>
'reset-to-default-preferences',
129 'classes' =>
'button-secondary',
130 'data' => array(
'confirm' => $confirm )
132 $button_reset =
WPDKUI::button( __(
'Reset to default', WPDK_TEXTDOMAIN ), $args );
134 return sprintf(
'<p>%s%s</p>', $button_reset, $button_update );