Plugin Directory

Changeset 3229045


Ignore:
Timestamp:
01/27/2025 03:36:53 AM (14 months ago)
Author:
xssdevelopment
Message:

Update Classes

Location:
compress-pdf
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • compress-pdf/tags/1.0.0/includes/classes/CommonComponents.php

    r3222633 r3229045  
    44class CROSS_SERVICE_SOLUTIONS_CommonComponents {
    55    // Text Input Component
    6     public static function text_input_component($name, $label, $id = '', $required = true, $hint = '') {
     6    public static function text_input_component($name, $label, $id = '', $required = true, $hint = '', $placeholder = '') {
    77        ob_start();
    88        ?>
    99        <label class="solution__label">
    1010            <span><?php echo esc_html($label); ?></span>
    11             <input type="text" name="<?php echo esc_attr($name); ?>" id="<?php echo esc_attr($id); ?>" class="solution__input" <?php echo $required ? 'required' : ''; ?> />
     11            <input type="text"
     12                name="<?php echo esc_attr($name); ?>"
     13                id="<?php echo esc_attr($id); ?>"
     14                placeholder="<?php echo esc_attr($placeholder); ?>"
     15                class="solution__input"
     16                <?php echo $required ? 'required' : ''; ?> />
    1217            <?php if ($hint): ?>
    1318                <span class="solution__hint"><?php echo esc_html($hint); ?></span>
     
    1924
    2025    // Text Area Input Component
    21     public static function textarea_input_component($name, $label, $id = '', $required = true, $hint = '') {
     26    public static function textarea_input_component($name, $label, $id = '', $required = true, $hint = '', $placeholder = '') {
    2227        ob_start();
    2328        ?>
    2429        <label class="solution__label">
    2530            <span><?php echo esc_html($label); ?></span>
    26             <textarea name="<?php echo esc_attr($name); ?>" id="<?php echo esc_attr($id); ?>" class="solution__textarea" <?php echo $required ? 'required' : ''; ?>></textarea>
     31            <textarea name="<?php echo esc_attr($name); ?>"
     32                placeholder="<?php echo esc_attr($placeholder); ?>"
     33                id="<?php echo esc_attr($id); ?>"
     34                class="solution__textarea"
     35                <?php echo $required ? 'required' : ''; ?>
     36                ></textarea>
    2737            <?php if ($hint): ?>
    2838                <span class="solution__hint"><?php echo esc_html($hint); ?></span>
     
    3444
    3545    // Number Input Component
    36     public static function number_input_component($name, $label, $id = '', $min = null, $max = null, $default = '', $required = true, $hint = '', $use_slider = false) {
     46    public static function number_input_component($name, $label, $id = '', $min = null, $max = null, $default = '', $required = true, $hint = '', $use_slider = false, $placeholder = '') {
    3747        ob_start();
    3848        ?>
     
    5060                   class="<?php echo esc_attr($input_class); ?>"
    5161                   value="<?php echo esc_attr($default); ?>"
     62                   placeholder="<?php echo esc_attr($placeholder); ?>"
    5263                   <?php echo ($min !== null) ? 'min="' . esc_attr($min) . '"' : ''; ?>
    5364                   <?php echo ($max !== null) ? 'max="' . esc_attr($max) . '"' : ''; ?>
  • compress-pdf/tags/1.0.0/includes/classes/FormBuilder.php

    r3222633 r3229045  
    1818            'required'  => array(),
    1919            'multiple' => array(),
     20            'placeholder' => array(),
    2021            'min' => array(),
    2122            'max' => array()
     
    2627            'id'        => array(),
    2728            'required'  => array(),
     29            'placeholder' => array(),
    2830        ),
    2931        'select' => array(
     
    6365    }
    6466
    65     public function text_input_component($name, $label, $id = '', $required = true, $hint = '') {
    66         $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::text_input_component($name, $label, $id, $required, $hint);
     67    public function text_input_component($name, $label, $id = '', $required = true, $hint = '', $placeholder = '') {
     68        $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::text_input_component($name, $label, $id, $required, $hint, $placeholder);
    6769        return $this;
    6870    }
    6971
    70     public function textarea_input_component($name, $label, $id = '', $required = true, $hint = '') {
    71         $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::textarea_input_component($name, $label, $id, $required, $hint);
     72    public function textarea_input_component($name, $label, $id = '', $required = true, $hint = '', $placeholder = '') {
     73        $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::textarea_input_component($name, $label, $id, $required, $hint, $placeholder);
    7274        return $this;
    7375    }
    7476
    75     public function number_input_component($name, $label, $id = '', $min = null, $max = null, $default = '', $required = true, $hint = '', $use_slider = false) {
    76         $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::number_input_component($name, $label, $id, $min, $max, $default, $required, $hint, $use_slider);
     77    public function number_input_component($name, $label, $id = '', $min = null, $max = null, $default = '', $required = true, $hint = '', $use_slider = false, $placeholder = '') {
     78        $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::number_input_component($name, $label, $id, $min, $max, $default, $required, $hint, $use_slider, $placeholder);
    7779        return $this;
    7880    }
  • compress-pdf/trunk/includes/classes/CommonComponents.php

    r3222633 r3229045  
    44class CROSS_SERVICE_SOLUTIONS_CommonComponents {
    55    // Text Input Component
    6     public static function text_input_component($name, $label, $id = '', $required = true, $hint = '') {
     6    public static function text_input_component($name, $label, $id = '', $required = true, $hint = '', $placeholder = '') {
    77        ob_start();
    88        ?>
    99        <label class="solution__label">
    1010            <span><?php echo esc_html($label); ?></span>
    11             <input type="text" name="<?php echo esc_attr($name); ?>" id="<?php echo esc_attr($id); ?>" class="solution__input" <?php echo $required ? 'required' : ''; ?> />
     11            <input type="text"
     12                name="<?php echo esc_attr($name); ?>"
     13                id="<?php echo esc_attr($id); ?>"
     14                placeholder="<?php echo esc_attr($placeholder); ?>"
     15                class="solution__input"
     16                <?php echo $required ? 'required' : ''; ?> />
    1217            <?php if ($hint): ?>
    1318                <span class="solution__hint"><?php echo esc_html($hint); ?></span>
     
    1924
    2025    // Text Area Input Component
    21     public static function textarea_input_component($name, $label, $id = '', $required = true, $hint = '') {
     26    public static function textarea_input_component($name, $label, $id = '', $required = true, $hint = '', $placeholder = '') {
    2227        ob_start();
    2328        ?>
    2429        <label class="solution__label">
    2530            <span><?php echo esc_html($label); ?></span>
    26             <textarea name="<?php echo esc_attr($name); ?>" id="<?php echo esc_attr($id); ?>" class="solution__textarea" <?php echo $required ? 'required' : ''; ?>></textarea>
     31            <textarea name="<?php echo esc_attr($name); ?>"
     32                placeholder="<?php echo esc_attr($placeholder); ?>"
     33                id="<?php echo esc_attr($id); ?>"
     34                class="solution__textarea"
     35                <?php echo $required ? 'required' : ''; ?>
     36                ></textarea>
    2737            <?php if ($hint): ?>
    2838                <span class="solution__hint"><?php echo esc_html($hint); ?></span>
     
    3444
    3545    // Number Input Component
    36     public static function number_input_component($name, $label, $id = '', $min = null, $max = null, $default = '', $required = true, $hint = '', $use_slider = false) {
     46    public static function number_input_component($name, $label, $id = '', $min = null, $max = null, $default = '', $required = true, $hint = '', $use_slider = false, $placeholder = '') {
    3747        ob_start();
    3848        ?>
     
    5060                   class="<?php echo esc_attr($input_class); ?>"
    5161                   value="<?php echo esc_attr($default); ?>"
     62                   placeholder="<?php echo esc_attr($placeholder); ?>"
    5263                   <?php echo ($min !== null) ? 'min="' . esc_attr($min) . '"' : ''; ?>
    5364                   <?php echo ($max !== null) ? 'max="' . esc_attr($max) . '"' : ''; ?>
  • compress-pdf/trunk/includes/classes/FormBuilder.php

    r3222633 r3229045  
    1818            'required'  => array(),
    1919            'multiple' => array(),
     20            'placeholder' => array(),
    2021            'min' => array(),
    2122            'max' => array()
     
    2627            'id'        => array(),
    2728            'required'  => array(),
     29            'placeholder' => array(),
    2830        ),
    2931        'select' => array(
     
    6365    }
    6466
    65     public function text_input_component($name, $label, $id = '', $required = true, $hint = '') {
    66         $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::text_input_component($name, $label, $id, $required, $hint);
     67    public function text_input_component($name, $label, $id = '', $required = true, $hint = '', $placeholder = '') {
     68        $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::text_input_component($name, $label, $id, $required, $hint, $placeholder);
    6769        return $this;
    6870    }
    6971
    70     public function textarea_input_component($name, $label, $id = '', $required = true, $hint = '') {
    71         $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::textarea_input_component($name, $label, $id, $required, $hint);
     72    public function textarea_input_component($name, $label, $id = '', $required = true, $hint = '', $placeholder = '') {
     73        $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::textarea_input_component($name, $label, $id, $required, $hint, $placeholder);
    7274        return $this;
    7375    }
    7476
    75     public function number_input_component($name, $label, $id = '', $min = null, $max = null, $default = '', $required = true, $hint = '', $use_slider = false) {
    76         $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::number_input_component($name, $label, $id, $min, $max, $default, $required, $hint, $use_slider);
     77    public function number_input_component($name, $label, $id = '', $min = null, $max = null, $default = '', $required = true, $hint = '', $use_slider = false, $placeholder = '') {
     78        $this->elements[] = CROSS_SERVICE_SOLUTIONS_CommonComponents::number_input_component($name, $label, $id, $min, $max, $default, $required, $hint, $use_slider, $placeholder);
    7779        return $this;
    7880    }
Note: See TracChangeset for help on using the changeset viewer.