Plugin Directory

Changeset 3118716


Ignore:
Timestamp:
07/15/2024 08:35:39 PM (21 months ago)
Author:
atlsoftware
Message:

Fix issue with the js files not loading

Location:
aec-kiosque
Files:
4 edited
9 copied

Legend:

Unmodified
Added
Removed
  • aec-kiosque/tags/1.7.3/admin/class-aec-admin-settings.php

    r3118693 r3118716  
    8787    public function setup_plugin_admin_settings()
    8888    {
    89         register_setting( 'aec-options', 'aec_load_kiosque_aec_build');
    9089        register_setting( 'aec-options', 'aec_instance_name' );
    9190        register_setting( 'aec-options', 'aec_extranet_instance_name' );
  • aec-kiosque/tags/1.7.3/admin/class-aec-admin.php

    r3118693 r3118716  
    134134
    135135        $data = array(
    136             'aec_course_detail_page_url' => get_option( 'aec_course_detail_page_url' ),
    137             'aec_load_kiosque_aec_build' => get_option( 'aec_load_kiosque_aec_build' )
     136            'aec_course_detail_page_url' => get_option( 'aec_course_detail_page_url' )
    138137        );
    139138
  • aec-kiosque/tags/1.7.3/admin/partials/aec-admin-help.php

    r3118693 r3118716  
    309309            </ul>
    310310            <p>For example, if you want to display only Adults Beginner classes and Adults age bracket is ID 3 in
    311                 AEC, and Beginner Level is ID 12, you can use this shortcode : [aec_classes_list id-classification="3"
     311                AEC, and Beginner Level is ID 12, you can use this shortcode : [aec_classes id-classification="3"
    312312                id-level="12"]
    313313                <br/><br/><i>Note : ID values can be found in AEC in configuration module > Lists. This is the
  • aec-kiosque/tags/1.7.3/public/class-aec-shortcodes.php

    r3118693 r3118716  
    1010 * @subpackage Aec/public
    1111 */
    12 
    13 require_once AEC_PATH . 'includes/class-kiosque-component-loader.php';
    1412
    1513/**
     
    2523{
    2624
    27     /**
    28      * The AEC client instance name.
    29      *
     25    /**
     26     * The AEC client instance name.
     27     *
     28     * @since    1.0.0
     29     * @access   private
     30     * @var      string $client_instance The AEC client instance name.
     31     */
     32    private $client_instance;
     33
     34    /**
     35     * Initialize the class and set its properties.
     36     *
     37     * @param string $client_instance The AEC client instance name.
     38     * @since    1.0.0
     39     */
     40    public function __construct( $client_instance )
     41    {
     42
     43        $this->client_instance = $client_instance;
     44
     45    }
     46
     47    /**
     48     * Combine user attributes with known attributes and fill in defaults when needed. Also checks URL query string.
     49     *
     50     * @param $pairs array Entire list of supported attributes and their defaults.
     51     * @param $atts array User defined attributes in shortcode tag.
     52     * @return array
     53     */
     54    private function parse_atts( $pairs, $atts )
     55    {
     56        $atts = (array)$atts;
     57        $out = array();
     58        foreach( $pairs as $name => $default )
     59        {
     60            if( array_key_exists( $name, $atts ) )
     61            {
     62                $out[$name] = $atts[$name];
     63            }
     64            else if( isset( $_GET[$name] ) )
     65            {
     66                $out[$name] = sanitize_text_field( $_GET[$name] );
     67            }
     68            else
     69            {
     70                $out[$name] = $default;
     71            }
     72        }
     73
     74        if( !empty( $atts ) )
     75        {
     76            foreach( $atts as $name => $unknow_att )
     77            {
     78                if( !array_key_exists( $name, $out ) )
     79                {
     80                    $out[$name] = $unknow_att;
     81                }
     82            }
     83        }
     84
     85        return $out;
     86    }
     87
     88    /**
     89     * Get webapp components data parameters from shortcode attributes.
     90     *
     91     * @param $atts array User defined attributes in shortcode tag.
     92     * @return string
     93     */
     94    private function get_data_from_attributes( $atts )
     95    {
     96        $atts = (array)$atts;
     97        $data = 'data-instance="' . $this->client_instance . '"';
     98        foreach( $atts as $key => $value )
     99        {
     100            $data .= ' data-param-' . str_replace( '_', '-', $key ) . '="' . do_shortcode( str_replace( [ '{', '}' ], [ '[', ']' ], $value ) ) . '"';
     101        }
     102        return $data;
     103    }
     104
     105    /**
     106     * Webapp AEC account creation form.
     107     *
     108     * @param $atts array User defined attributes in shortcode tag.
     109     * @return string
     110     * @since    1.0.0
     111     */
     112    public function webapp_account_creation( $atts )
     113    {
     114        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="register" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     115    }
     116
     117    /**
     118     * Webapp AEC events.
     119     *
     120     * @param $atts array User defined attributes in shortcode tag.
     121     * @return string
    30122     * @since    1.0.0
    31      * @access   private
    32      * @var      string $client_instance The AEC client instance name.
    33      */
    34     private $client_instance;
    35 
    36     /**
    37      * Initialize the class and set its properties.
    38      *
    39      * @param string $client_instance The AEC client instance name.
    40      * @since    1.0.0
    41      */
    42     public function __construct($client_instance)
    43     {
    44 
    45         $this->client_instance = $client_instance;
    46 
    47     }
    48 
    49     /**
    50      * Combine user attributes with known attributes and fill in defaults when needed. Also checks URL query string.
    51      *
    52      * @param $pairs array Entire list of supported attributes and their defaults.
    53      * @param $atts array User defined attributes in shortcode tag.
    54      * @return array
    55      */
    56     private function parse_atts($pairs, $atts)
    57     {
    58         $atts = (array)$atts;
    59         $out = array();
    60         foreach ($pairs as $name => $default) {
    61             if (array_key_exists($name, $atts)) {
    62                 $out[$name] = $atts[$name];
    63             } else if (isset($_GET[$name])) {
    64                 $out[$name] = sanitize_text_field($_GET[$name]);
    65             } else {
    66                 $out[$name] = $default;
    67             }
    68         }
    69 
    70         if (!empty($atts)) {
    71             foreach ($atts as $name => $unknow_att) {
    72                 if (!array_key_exists($name, $out)) {
    73                     $out[$name] = $unknow_att;
    74                 }
    75             }
    76         }
    77 
    78         return $out;
    79     }
    80 
    81     /**
    82      * Get webapp components data parameters from shortcode attributes.
    83      *
    84      * @param $atts array User defined attributes in shortcode tag.
    85      * @return string
    86      */
    87     private function get_data_from_attributes($atts)
    88     {
    89         $atts = (array)$atts;
    90         $data = 'data-instance="' . $this->client_instance . '"';
    91         foreach ($atts as $key => $value) {
    92             $data .= ' data-param-' . str_replace('_', '-', $key) . '="' . do_shortcode(str_replace(['{', '}'], ['[', ']'], $value)) . '"';
    93         }
    94         return $data;
    95     }
    96 
    97     private function getComponentLoader($function, $attr)
    98     {
    99         $attr['lang'] = AEC()->get_locale();
    100         $componentLoader = (new KiosqueComponentLoader())->getKiosqueComponentLoader();
    101         return $componentLoader->$function($attr);
    102     }
    103 
    104     /**
    105      * Webapp AEC account creation form.
    106      *
    107      * @param $atts array User defined attributes in shortcode tag.
    108      * @return string
    109      * @since    1.0.0
    110      */
    111     public function webapp_account_creation($atts)
    112     {
    113         return $this->getComponentLoader('getStudentRegisterComponent', $atts);
    114     }
    115 
    116     /**
    117      * Webapp AEC events.
    118      *
    119      * @param $atts array User defined attributes in shortcode tag.
    120      * @return string
    121      * @since    1.0.0
    122      */
    123     public function webapp_events($atts)
    124     {
    125         return $this->getComponentLoader('getEventListComponent', $atts);
    126     }
    127 
    128     /**
    129      * Webapp AEC events list.
    130      *
    131      * @param $atts array User defined attributes in shortcode tag.
    132      * @return string
    133      * @since    1.0.0
    134      */
    135     public function webapp_events_list($atts)
    136     {
    137         $atts = $this->parse_atts([
    138             'detail_link' => '',
    139         ], $atts);
    140 
    141         $atts['event-url'] = $atts['detail_link'];
    142 
    143         return $this->getComponentLoader('getEventsListComponent', $atts);
    144     }
    145 
    146     /**
    147      * Webapp AEC next events.
    148      *
    149      * @param $atts array User defined attributes in shortcode tag.
    150      * @return string
    151      * @since    1.0.0
    152      */
    153     public function webapp_next_events($atts)
    154     {
    155         $atts = $this->parse_atts([
    156             'detail_link' => '',
    157             'quantity-column' => 3,
    158         ], $atts);
    159 
    160         $atts['event-url'] = $atts['detail_link'];
    161 
    162         return $this->getComponentLoader('getNextEventComponent', $atts);
    163     }
    164 
    165     /**
    166      * Webapp AEC event detail.
    167      *
    168      * @param $atts array User defined attributes in shortcode tag.
    169      * @return string
    170      * @since    1.0.0
    171      */
    172     public function webapp_event_detail($atts)
    173     {
    174         return $this->getComponentLoader('getEventDetailComponent', $atts);
    175     }
    176 
    177     /**
    178      * Webapp AEC events list grid.
    179      *
    180      * @param $atts array User defined attributes in shortcode tag.
    181      * @return string
    182      * @since    1.0.0
    183      */
    184     public function webapp_events_list_grid($atts)
    185     {
    186         $atts = $this->parse_atts([
    187             'detail_link' => '',
    188             'quantity-column' => 3,
    189         ], $atts);
    190 
    191         $atts['event-url'] = $atts['detail_link'];
    192 
    193         return $this->getComponentLoader('getEventListGridComponent', $atts);
    194     }
    195 
    196     /**
    197      * Webapp AEC events list wide.
    198      *
    199      * @param $atts array User defined attributes in shortcode tag.
    200      * @return string
    201      * @since    1.0.0
    202      */
    203     public function webapp_events_list_wide($atts)
    204     {
    205         $atts = $this->parse_atts([
    206             'detail_link' => '',
    207         ], $atts);
    208 
    209         $atts['event-url'] = $atts['detail_link'];
    210 
    211         return $this->getComponentLoader('getEventListWideComponent', $atts);
    212     }
     123     */
     124    public function webapp_events( $atts )
     125    {
     126        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="list" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     127    }
     128
     129    /**
     130     * Webapp AEC events list.
     131     *
     132     * @param $atts array User defined attributes in shortcode tag.
     133     * @return string
     134     * @since    1.0.0
     135     */
     136    public function webapp_events_list( $atts )
     137    {
     138        $atts = $this->parse_atts( [
     139            'detail_link' => '',
     140        ], $atts );
     141
     142        $atts['event-url'] = $atts['detail_link'];
     143
     144        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="events-list" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '" class="listing"></div></div>';
     145    }
     146
     147    /**
     148     * Webapp AEC next events.
     149     *
     150     * @param $atts array User defined attributes in shortcode tag.
     151     * @return string
     152     * @since    1.0.0
     153     */
     154    public function webapp_next_events( $atts )
     155    {
     156        $atts = $this->parse_atts( [
     157            'detail_link' => '',
     158            'quantity-column' => 3,
     159        ], $atts );
     160
     161        $atts['event-url'] = $atts['detail_link'];
     162
     163        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="events-next" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     164    }
     165
     166    /**
     167     * Webapp AEC event detail.
     168     *
     169     * @param $atts array User defined attributes in shortcode tag.
     170     * @return string
     171     * @since    1.0.0
     172     */
     173    public function webapp_event_detail( $atts )
     174    {
     175        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="event-view"  data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     176    }
     177
     178    /**
     179     * Webapp AEC events list grid.
     180     *
     181     * @param $atts array User defined attributes in shortcode tag.
     182     * @return string
     183     * @since    1.0.0
     184     */
     185    public function webapp_events_list_grid( $atts )
     186    {
     187        $atts = $this->parse_atts( [
     188            'detail_link' => '',
     189            'quantity-column' => 3,
     190        ], $atts );
     191
     192        $atts['event-url'] = $atts['detail_link'];
     193
     194        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="events-list-grid" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     195    }
     196
     197    /**
     198     * Webapp AEC events list wide.
     199     *
     200     * @param $atts array User defined attributes in shortcode tag.
     201     * @return string
     202     * @since    1.0.0
     203     */
     204    public function webapp_events_list_wide( $atts )
     205    {
     206        $atts = $this->parse_atts( [
     207            'detail_link' => '',
     208        ], $atts );
     209
     210        $atts['event-url'] = $atts['detail_link'];
     211
     212        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="events-list-wide" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     213    }
    213214
    214215    /**
     
    219220     * @since    1.1.4
    220221     */
    221     public function webapp_classes_list($atts)
    222     {
    223         return $this->getComponentLoader('getCourseListComponent', $atts);
    224     }
    225 
    226     /**
    227     * Webapp AEC course detail.
    228     *
    229     * @param $atts array User defined attributes in shortcode tag.
    230     * @return string
    231     * @since    1.0.0
    232     */
    233     public function webapp_class_detail($atts)
    234     {
    235         return $this->getComponentLoader('getCourseDetailComponent', $atts);
    236     }
    237 
    238     /**
    239     * Webapp AEC contact map.
    240     *
    241     * @param $atts
    242     * @return string
    243     * @since    1.0.0
    244     */
    245     public function webapp_contact_map($atts = [])
    246     {
    247         $atts = $this->parse_atts([
    248             'display-details' => 'true',
    249             'etablishment_id' => 0,
    250             'height' => 500
    251         ], $atts);
    252 
    253         $atts['etablishment-branch-id'] = $atts['etablishment_id'];
    254         $atts['height'] .= 'px';
    255 
    256         return $this->getComponentLoader('getDisplayContactInfoComponent', $atts);
    257     }
    258 
    259     /**
    260     * Webapp AEC google maps.
    261     *
    262     * @param $atts array User defined attributes in shortcode tag.
    263     * @return string
    264     * @since    1.0.0
    265     */
    266     public function webapp_google_map($atts)
    267     {
    268         if (empty($atts))
    269             return '';
    270 
    271         $atts = $this->parse_atts([
    272             'etablishment-branch-id' => 0,
    273             'height' => 380
    274         ], $atts);
    275 
    276         $atts['height'] .= 'px';
    277 
    278         return "<div class='arc-en-ciel'><div class='loading'
     222    public function webapp_classes_list( $atts )
     223    {
     224        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="classes-list" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     225    }
     226
     227    /**
     228    * Webapp AEC course detail.
     229    *
     230    * @param $atts array User defined attributes in shortcode tag.
     231    * @return string
     232    * @since    1.0.0
     233    */
     234    public function webapp_class_detail( $atts )
     235    {
     236        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="course-detail"  data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     237    }
     238
     239    /**
     240    * Webapp AEC contact map.
     241    *
     242    * @param $atts
     243    * @return string
     244    * @since    1.0.0
     245    */
     246    public function webapp_contact_map( $atts = [] )
     247    {
     248        $atts = $this->parse_atts( [
     249            'display-details' => 'true',
     250            'etablishment_id' => 0,
     251            'height' => 500
     252        ], $atts );
     253
     254        $atts['etablishment-branch-id'] = $atts['etablishment_id'];
     255        $atts['height'] .= 'px';
     256
     257        return "<div class='arc-en-ciel'><div class='loading' data-module='contact' data-action='display-contact-info' data-show-loading='true' {$this->get_data_from_attributes( $atts )} data-param-lang='" . AEC()->get_locale() . "'></div></div>";
     258    }
     259
     260    /**
     261    * Webapp AEC google maps.
     262    *
     263    * @param $atts array User defined attributes in shortcode tag.
     264    * @return string
     265    * @since    1.0.0
     266    */
     267    public function webapp_google_map( $atts )
     268    {
     269        if( empty( $atts ) )
     270            return '';
     271
     272        $atts = $this->parse_atts( [
     273            'etablishment-branch-id' => 0,
     274            'height' => 380
     275        ], $atts );
     276
     277        $atts['height'] .= 'px';
     278
     279        return "<div class='arc-en-ciel'><div class='loading'
    279280                  data-module='contact'
    280281                  data-action='google-maps'
     
    283284                  data-param-lang='" . AEC()->get_locale() . "'>
    284285            </div></div>";
    285     }
    286 
    287     /**
    288      * Webapp AEC private tuition form.
     286    }
     287
     288    /**
     289     * Webapp AEC private tuition form.
     290     *
     291     * @param $atts array User defined attributes in shortcode tag.
     292     * @return string
     293     * @since    1.0.0
     294     */
     295    public function webapp_private_tuition( $atts )
     296    {
     297        $atts = $this->parse_atts([
     298            'product-type-id' => '',
     299        ], $atts);
     300        return '<div class="arc-en-ciel"><div class="loading" data-module="private-tuition" data-action="showPrivateTuitionForm" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     301    }
     302
     303    /**
     304     * Webapp AEC class selection.
     305     *
     306     * @param $atts array User defined attributes in shortcode tag.
     307     * @return string
     308     * @since    1.0.0
     309     */
     310    public function webapp_class_selection( $atts )
     311    {
     312        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="select-class" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     313    }
     314
     315    /**
     316     * Webapp AEC products list.
     317     *
     318     * @param $atts array User defined attributes in shortcode tag.
     319     * @return string
     320     * @since    1.0.0
     321     */
     322    public function webapp_products_list( $atts )
     323    {
     324        return '<div class="arc-en-ciel"><div class="loading" data-module="products" data-action="show-products" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     325    }
     326
     327    /**
     328     * Webapp AEC donation form.
     329     *
     330     * @param $atts array User defined attributes in shortcode tag.
     331     * @return string
     332     * @since    1.0.0
     333     */
     334    public function webapp_donation_form( $atts )
     335    {
     336        return '<div class="arc-en-ciel"><div class="loading" data-module="products" data-action="donation_form" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     337    }
     338
     339    /**
     340     * Webapp AEC donation form.
     341     *
     342     * @param $atts array User defined attributes in shortcode tag.
     343     * @return string
     344     * @since    1.0.0
     345     */
     346    public function webapp_donation_form_free( $atts )
     347    {
     348        return '<div class="arc-en-ciel"><div class="loading" data-module="donation" data-action="free-form" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     349    }
     350
     351    /**
     352     * Webapp AEC donation form list.
     353     *
     354     * @param $atts array User defined attributes in shortcode tag.
     355     * @return string
     356     * @since    1.0.0
     357     */
     358    public function webapp_donation_list( $atts )
     359    {
     360        return '<div class="arc-en-ciel"><div class="loading" data-module="donation" data-action="list" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     361    }
     362
     363    /**
     364     * Webapp AEC student login form.
     365     *
     366     * @param $atts array User defined attributes in shortcode tag.
     367     * @return string
     368     * @since    1.0.0
     369     */
     370    public function webapp_student_login( $atts )
     371    {
     372        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="login" data-show-loading="true" data-param-show-registration-link="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     373    }
     374
     375    /**
     376     * Webapp AEC student password recover form.
     377     *
     378     * @param $atts array User defined attributes in shortcode tag.
     379     * @return string
     380     * @since    1.0.11
     381     */
     382    public function webapp_student_password_recover( $atts )
     383    {
     384        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="reminder" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     385    }
     386
     387    /**
     388     * Webapp AEC student password update form.
     389     *
     390     * @param $atts array User defined attributes in shortcode tag.
     391     * @return string
     392     * @since    1.1.6
     393     */
     394    public function webapp_student_password_update( $atts )
     395    {
     396        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="password-update" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     397    }
     398
     399    /**
     400     * Webapp AEC student password reset form.
     401     *
     402     * @param $atts array User defined attributes in shortcode tag.
     403     * @return string
     404     * @since    1.0.11
     405     */
     406    public function webapp_student_password_reset( $atts )
     407    {
     408        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="password-reset" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     409    }
     410
     411    /**
     412     * Webapp AEC student registration form.
     413     *
     414     * @param $atts array User defined attributes in shortcode tag.
     415     * @return string
     416     * @since    1.0.0
     417     */
     418    public function webapp_student_register( $atts )
     419    {
     420        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="register" data-show-loading="true" data-param-is-wordpress-site="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-form_action="create_student" data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     421    }
     422
     423    /**
     424     * Webapp AEC student account.
     425     *
     426     * @return string
     427     * @since    1.0.0
     428     */
     429    public function webapp_student_account()
     430    {
     431        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-show-loading="true" data-action="accountInformation" data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     432    }
     433
     434    /**
     435     * Webapp AEC student account dashboard.
     436     *
     437     * @return string
     438     * @since    1.0.0
     439     */
     440    public function webapp_student_account_dashboard( $atts )
     441    {
     442        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-show-loading="true" data-action="account-dashboard" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     443    }
     444
     445    /**
     446     * Webapp AEC student controls.
     447     *
     448     * @param $atts array User defined attributes in shortcode tag.
     449     * @return string
     450     * @since    1.0.0
     451     */
     452    public function webapp_student_controls( $atts )
     453    {
     454        $atts = $this->parse_atts( [
     455            'is-wordpress-site' => '',
     456            'login-link' => '',
     457            'register-link' => '',
     458            'account-link' => '',
     459            'logout-link' => '',
     460            'my-cart-link' => '',
     461        ], $atts );
     462
     463        return "<div class='arc-en-ciel'><div data-module='student'
     464                 data-show-loading='true'
     465                 data-action='student-controls'
     466                 {$this->get_data_from_attributes( $atts )}
     467                 data-param-lang='" . AEC()->get_locale() . "'></div></div>";
     468    }
     469
     470    /**
     471     * Webapp AEC classes catalog.
     472     *
     473     * @param $atts array User defined attributes in shortcode tag.
     474     * @return string
     475     * @since    1.0.0
     476     */
     477    public function webapp_classes_catalog( $atts )
     478    {
     479        $atts = $this->parse_atts( [
     480            'etablishment-branch-id' => '',
     481            'period-id' => '',
     482            'classification-id' => '',
     483            'subject-id' => '',
     484            'class-type-id' => '',
     485            'level-id' => '',
     486            'sidebar' => '',
     487            'show-filter-choices' => '',
     488        ], $atts );
     489
     490        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-catalogue" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . '  data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     491    }
     492
     493    /**
     494     * Webapp AEC classes catalog with filter.
    289495     *
    290496     * @param $atts array User defined attributes in shortcode tag.
     
    292498     * @since    1.0.0
    293499     */
    294     public function webapp_private_tuition($atts)
    295     {
    296         $atts = $this->parse_atts([
    297             'product-type-id' => '',
    298         ], $atts);
    299         return $this->getComponentLoader('getPrivateTuitionComponent', $atts);
    300     }
    301 
    302     /**
    303      * Webapp AEC class selection.
    304      *
    305      * @param $atts array User defined attributes in shortcode tag.
    306      * @return string
    307      * @since    1.0.0
    308      */
    309     public function webapp_class_selection($atts)
    310     {
    311         return $this->getComponentLoader('getSelectClassComponent', $atts);
    312     }
    313 
    314     /**
    315      * Webapp AEC products list.
    316      *
    317      * @param $atts array User defined attributes in shortcode tag.
    318      * @return string
    319      * @since    1.0.0
    320      */
    321     public function webapp_products_list($atts)
    322     {
    323         return $this->getComponentLoader('getShowProductComponent', $atts);
    324     }
    325 
    326     /**
    327      * Webapp AEC donation form.
    328      *
    329      * @param $atts array User defined attributes in shortcode tag.
    330      * @return string
    331      * @since    1.0.0
    332      */
    333     public function webapp_donation_form($atts)
    334     {
    335         return $this->getComponentLoader('getDonationFormComponent', $atts);
    336     }
    337 
    338     /**
    339      * Webapp AEC donation form.
    340      *
    341      * @param $atts array User defined attributes in shortcode tag.
    342      * @return string
    343      * @since    1.0.0
    344      */
    345     public function webapp_donation_form_free($atts)
    346     {
    347         return $this->getComponentLoader('getDonationFormFreeComponent', $atts);
    348     }
    349 
    350     /**
    351      * Webapp AEC donation form list.
    352      *
    353      * @param $atts array User defined attributes in shortcode tag.
    354      * @return string
    355      * @since    1.0.0
    356      */
    357     public function webapp_donation_list($atts)
    358     {
    359         return $this->getComponentLoader('getDonationListComponent', $atts);
    360     }
    361 
    362     /**
    363      * Webapp AEC student login form.
    364      *
    365      * @param $atts array User defined attributes in shortcode tag.
    366      * @return string
    367      * @since    1.0.0
    368      */
    369     public function webapp_student_login($atts)
    370     {
    371         return $this->getComponentLoader('getStudentLoginComponent', $atts);
    372     }
    373 
    374     /**
    375      * Webapp AEC student password recover form.
    376      *
    377      * @param $atts array User defined attributes in shortcode tag.
    378      * @return string
    379      * @since    1.0.11
    380      */
    381     public function webapp_student_password_recover($atts)
    382     {
    383         return $this->getComponentLoader('getStudentPasswordRecoverComponent', $atts);
    384     }
    385 
    386     /**
    387      * Webapp AEC student password update form.
    388      *
    389      * @param $atts array User defined attributes in shortcode tag.
    390      * @return string
    391      * @since    1.1.6
    392      */
    393     public function webapp_student_password_update($atts)
    394     {
    395         return $this->getComponentLoader('getStudentPasswordUpdateComponent', $atts);
    396     }
    397 
    398     /**
    399      * Webapp AEC student password reset form.
    400      *
    401      * @param $atts array User defined attributes in shortcode tag.
    402      * @return string
    403      * @since    1.0.11
    404      */
    405     public function webapp_student_password_reset($atts)
    406     {
    407         return $this->getComponentLoader('getStudentPasswordResetComponent', $atts);
    408     }
    409 
    410     /**
    411      * Webapp AEC student registration form.
    412      *
    413      * @param $atts array User defined attributes in shortcode tag.
    414      * @return string
    415      * @since    1.0.0
    416      */
    417     public function webapp_student_register($atts)
    418     {
    419         return $this->getComponentLoader('getStudentRegisterComponent', $atts);
    420     }
    421 
    422     /**
    423      * Webapp AEC student account.
    424      *
    425      * @return string
    426      * @since    1.0.0
    427      */
    428     public function webapp_student_account()
    429     {
    430         return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-show-loading="true" data-action="accountInformation" data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    431     }
    432 
    433     /**
    434      * Webapp AEC student account dashboard.
    435      *
    436      * @return string
    437      * @since    1.0.0
    438      */
    439     public function webapp_student_account_dashboard($atts)
    440     {
    441         return $this->getComponentLoader('getAccountDashboardComponent', $atts);
    442     }
    443 
    444     /**
    445      * Webapp AEC student controls.
    446      *
    447      * @param $atts array User defined attributes in shortcode tag.
    448      * @return string
    449      * @since    1.0.0
    450      */
    451     public function webapp_student_controls($atts)
    452     {
    453         $atts = $this->parse_atts([
    454             'is-wordpress-site' => '',
    455             'login-link' => '',
    456             'register-link' => '',
    457             'account-link' => '',
    458             'logout-link' => '',
    459             'my-cart-link' => '',
    460         ], $atts);
    461 
    462         return $this->getComponentLoader('getStudentControlsComponent', $atts);
    463     }
    464 
    465     /**
    466      * Webapp AEC classes catalog.
    467      *
    468      * @param $atts array User defined attributes in shortcode tag.
    469      * @return string
    470      * @since    1.0.0
    471      */
    472     public function webapp_classes_catalog($atts)
    473     {
    474         $atts = $this->parse_atts([
    475             'etablishment-branch-id' => '',
    476             'period-id' => '',
    477             'classification-id' => '',
    478             'subject-id' => '',
    479             'class-type-id' => '',
    480             'level-id' => '',
    481             'sidebar' => '',
    482             'show-filter-choices' => '',
    483         ], $atts);
    484 
    485         return $this->getComponentLoader('getCourseCatalogueComponent', $atts);
    486     }
    487 
    488     /**
    489      * Webapp AEC classes catalog with filter.
    490      *
    491      * @param $atts array User defined attributes in shortcode tag.
    492      * @return string
    493      * @since    1.0.0
    494      */
    495     public function webapp_classes_catalog_with_filter($atts)
    496     {
    497         $atts = $this->parse_atts([
    498             'etablishment-branch-id' => '',
    499             'period-id' => '',
    500             'classification-id' => '',
    501             'subject-id' => '',
    502             'class-type-id' => '',
    503             'level-id' => '',
    504             'sidebar' => '',
    505             'show-filter-choices' => '',
    506         ], $atts);
    507 
    508         return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-catalogue-with-filters" data-show-loading="true" ' . $this->get_data_from_attributes($atts) . '  data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    509     }
    510 
    511     /**
    512      * Webapp AEC courses search bar.
    513      *
    514      * @param $atts array User defined attributes in shortcode tag.
    515      * @return string
    516      * @since    1.0.0
    517      */
    518     public function webapp_classes_search_box($atts)
    519     {
    520         if (isset($atts['url-configuration'])) {
    521             $atts['url-configuration'] = htmlentities(trim($atts['url-configuration']));
    522         }
    523 
    524         return $this->getComponentLoader('getCourseSearchBarComponent', $atts);
    525     }
    526 
    527     /**
    528      * Webapp AEC student account.
    529      *
     500    public function webapp_classes_catalog_with_filter( $atts )
     501    {
     502        $atts = $this->parse_atts( [
     503            'etablishment-branch-id' => '',
     504            'period-id' => '',
     505            'classification-id' => '',
     506            'subject-id' => '',
     507            'class-type-id' => '',
     508            'level-id' => '',
     509            'sidebar' => '',
     510            'show-filter-choices' => '',
     511        ], $atts );
     512
     513        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-catalogue-with-filters" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . '  data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     514    }
     515
     516    /**
     517     * Webapp AEC courses search bar.
     518     *
     519     * @param $atts array User defined attributes in shortcode tag.
     520     * @return string
     521     * @since    1.0.0
     522     */
     523    public function webapp_classes_search_box( $atts )
     524    {
     525        if( isset( $atts['url-configuration'] ) )
     526        {
     527            $atts['url-configuration'] = htmlentities( trim( $atts['url-configuration'] ) );
     528        }
     529
     530        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-search-bar" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     531    }
     532
     533    /**
     534     * Webapp AEC student account.
     535     *
     536     * @return string
     537     * @since    1.0.4
     538     */
     539    public function webapp_shopping_cart()
     540    {
     541        return '<div class="arc-en-ciel"><div class="loading" data-module="cart" data-show-loading="true" data-action="cart-form" data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     542    }
     543
     544    /**
     545     * Webapp AEC examination list.
     546     *
     547     * @param $atts array User defined attributes in shortcode tag.
     548     * @return string
     549     * @since    1.0.4
     550     */
     551    public function webapp_examination_list( $atts )
     552    {
     553        $atts = $this->parse_atts( [
     554            'examination-type-ids' => '',
     555            'show-category-title' => '',
     556        ], $atts );
     557
     558        return '<div class="arc-en-ciel"><div class="loading" data-module="examination" data-show-loading="true" data-action="list" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     559    }
     560
     561    /**
     562     * Webapp AEC examination type list.
     563     *
     564     * @param $atts array User defined attributes in shortcode tag.
    530565     * @return string
    531566     * @since    1.0.4
    532567     */
    533     public function webapp_shopping_cart()
    534     {
    535         return $this->getComponentLoader('getShoppingComponent', []);
    536     }
    537 
    538     /**
    539      * Webapp AEC examination list.
    540      *
    541      * @param $atts array User defined attributes in shortcode tag.
    542      * @return string
    543      * @since    1.0.4
    544      */
    545     public function webapp_examination_list($atts)
    546     {
    547         $atts = $this->parse_atts([
    548             'examination-type-ids' => '',
    549             'show-category-title' => '',
    550         ], $atts);
    551 
    552         return $this->getComponentLoader('getExaminationListComponent', $atts);
    553     }
    554 
    555     /**
    556      * Webapp AEC examination type list.
    557      *
    558      * @param $atts array User defined attributes in shortcode tag.
    559      * @return string
    560      * @since    1.0.4
    561      */
    562     public function webapp_examination_type_list($atts)
    563     {
    564         $atts = $this->parse_atts([
     568    public function webapp_examination_type_list( $atts )
     569    {
     570        $atts = $this->parse_atts( [
    565571            'examination-type-ids' => '',
    566572            'etablishment-branch-id' => ''
    567         ], $atts);
    568 
    569         return $this->getComponentLoader('getExaminationTypeListComponent', $atts);
     573        ], $atts );
     574
     575        return '<div class="arc-en-ciel"><div class="loading" data-module="examination" data-show-loading="true" data-action="examination-type-list" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    570576    }
    571577
     
    577583     * @since    1.0.4
    578584     */
    579     public function webapp_examination_type_detail($atts)
    580     {
    581         $atts = $this->parse_atts([
     585    public function webapp_examination_type_detail( $atts )
     586    {
     587        $atts = $this->parse_atts( [
    582588            'examination-type-id' => '',
    583589            'etablishment-branch-id' => ''
    584         ], $atts);
    585 
    586         return $this->getComponentLoader('getExaminationTypeDetailComponent', $atts);
     590        ], $atts );
     591
     592        return '<div class="arc-en-ciel"><div class="loading" data-module="examination" data-show-loading="true" data-action="examination-type-detail" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    587593    }
    588594
     
    594600     * @since    1.0.4
    595601     */
    596     public function webapp_examination_detail($atts)
    597     {
    598         $atts = $this->parse_atts(['examination-id' => ''], $atts);
    599 
    600         return $this->getComponentLoader('getExaminationDetailComponent', $atts);
    601     }
    602 
    603     /**
    604      * Webapp AEC Identify Panel.
    605      *
     602    public function webapp_examination_detail( $atts )
     603    {
     604        $atts = $this->parse_atts( [ 'examination-id' => '' ], $atts );
     605
     606        return '<div class="arc-en-ciel"><div class="loading" data-module="examination" data-action="examination-detail" data-show-loading="true"' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     607    }
     608
     609    /**
     610     * Webapp AEC Identify Panel.
     611     *
     612     * @return string
     613     * @since    1.0.0
     614     */
     615    public function webapp_identify_panel( $atts )
     616    {
     617        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-show-loading="true" data-action="identify-panel" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     618    }
     619
     620    /**
     621     * Webapp AEC courses catalog.
     622     *
     623     * @param $atts array User defined attributes in shortcode tag.
    606624     * @return string
    607625     * @since    1.0.0
    608626     */
    609     public function webapp_identify_panel($atts)
    610     {
    611         return $this->getComponentLoader('getIdentityPanelComponent', $atts);
    612     }
    613 
    614     /**
    615      * Webapp AEC courses catalog.
    616      *
    617      * @param $atts array User defined attributes in shortcode tag.
    618      * @return string
    619      * @since    1.0.0
    620      */
    621     public function webapp_courses_catalog($atts)
    622     {
    623         $atts = $this->parse_atts([
     627    public function webapp_courses_catalog( $atts )
     628    {
     629        $atts = $this->parse_atts( [
    624630            'etablishment-branch-id' => '',
    625631            'period-id' => '',
     
    632638            'localization' => '',
    633639            'show-filter-choices' => '',
    634         ], $atts);
    635 
    636         return $this->getComponentLoader('getCourseCatalogComponent', $atts);
     640        ], $atts );
     641
     642        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-catalog" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . '  data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    637643    }
    638644
     
    644650     * @since    1.0.0
    645651     */
    646     public function webapp_courses_selection_tiles($atts)
    647     {
    648         $atts = $this->parse_atts([
     652    public function webapp_courses_selection_tiles( $atts )
     653    {
     654        $atts = $this->parse_atts( [
    649655            'etablishment-branch-id' => '',
    650656            'period-id' => '',
     
    657663            'class-format-id' => '',
    658664            'show-filter-choices' => true,
    659         ], $atts);
    660 
    661         return $this->getComponentLoader('getCourseSelectionTilesComponent', $atts);
     665        ], $atts );
     666
     667        return '<div class="arc-en-ciel"><div class="loading" data-module="classes"
     668               data-action="courses-selection-tiles"
     669               data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' 
     670               data-param-lang="' . AEC()->get_locale() . '"
     671            ></div></div>';
    662672    }
    663673
     
    669679     * @since    1.0.0
    670680     */
    671     public function webapp_courses_wizard($atts)
    672     {
    673 
    674         $atts = $this->parse_atts([
     681    public function webapp_courses_wizard( $atts )
     682    {
     683        $atts = $this->parse_atts( [
    675684            'id-subject' => '',
    676685            'id-classification' => '',
    677         ], $atts);
    678         return $this->getComponentLoader('getCourseWizardComponent', $atts);
     686        ], $atts );
     687        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-wizard" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    679688    }
    680689
     
    686695     * @since    1.0.4
    687696     */
    688     public function webapp_newsletter()
    689     {
    690         return $this->getComponentLoader('getNewsLetterSubscribeFormComponent', []);
     697    public function webapp_newsletter( )
     698    {
     699        return '<div class="arc-en-ciel"><div class="loading" data-module="newsletter" data-action="subscribe-form" data-show-loading="true"' . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    691700    }
    692701
     
    698707     * @since    1.0.4
    699708     */
    700     public function webapp_unsubscribe_newsletter($atts)
    701     {
    702         $atts = $this->parse_atts([
     709    public function webapp_unsubscribe_newsletter( $atts )
     710    {
     711        $atts = $this->parse_atts( [
    703712            'redirect' => ''
    704         ], $atts);
    705 
    706         return $this->getComponentLoader('getNewsLetterUnsubscribeFormComponent', $atts);
     713        ], $atts );
     714
     715        return '<div class="arc-en-ciel"><div class="loading" data-module="newsletter" data-action="unsubscribe-form" data-show-loading="true"' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    707716    }
    708717}
  • aec-kiosque/trunk/admin/class-aec-admin-settings.php

    r3118693 r3118716  
    8787    public function setup_plugin_admin_settings()
    8888    {
    89         register_setting( 'aec-options', 'aec_load_kiosque_aec_build');
    9089        register_setting( 'aec-options', 'aec_instance_name' );
    9190        register_setting( 'aec-options', 'aec_extranet_instance_name' );
  • aec-kiosque/trunk/admin/class-aec-admin.php

    r3118693 r3118716  
    134134
    135135        $data = array(
    136             'aec_course_detail_page_url' => get_option( 'aec_course_detail_page_url' ),
    137             'aec_load_kiosque_aec_build' => get_option( 'aec_load_kiosque_aec_build' )
     136            'aec_course_detail_page_url' => get_option( 'aec_course_detail_page_url' )
    138137        );
    139138
  • aec-kiosque/trunk/admin/partials/aec-admin-help.php

    r3118693 r3118716  
    309309            </ul>
    310310            <p>For example, if you want to display only Adults Beginner classes and Adults age bracket is ID 3 in
    311                 AEC, and Beginner Level is ID 12, you can use this shortcode : [aec_classes_list id-classification="3"
     311                AEC, and Beginner Level is ID 12, you can use this shortcode : [aec_classes id-classification="3"
    312312                id-level="12"]
    313313                <br/><br/><i>Note : ID values can be found in AEC in configuration module > Lists. This is the
  • aec-kiosque/trunk/public/class-aec-shortcodes.php

    r3118693 r3118716  
    1010 * @subpackage Aec/public
    1111 */
    12 
    13 require_once AEC_PATH . 'includes/class-kiosque-component-loader.php';
    1412
    1513/**
     
    2523{
    2624
    27     /**
    28      * The AEC client instance name.
    29      *
     25    /**
     26     * The AEC client instance name.
     27     *
     28     * @since    1.0.0
     29     * @access   private
     30     * @var      string $client_instance The AEC client instance name.
     31     */
     32    private $client_instance;
     33
     34    /**
     35     * Initialize the class and set its properties.
     36     *
     37     * @param string $client_instance The AEC client instance name.
     38     * @since    1.0.0
     39     */
     40    public function __construct( $client_instance )
     41    {
     42
     43        $this->client_instance = $client_instance;
     44
     45    }
     46
     47    /**
     48     * Combine user attributes with known attributes and fill in defaults when needed. Also checks URL query string.
     49     *
     50     * @param $pairs array Entire list of supported attributes and their defaults.
     51     * @param $atts array User defined attributes in shortcode tag.
     52     * @return array
     53     */
     54    private function parse_atts( $pairs, $atts )
     55    {
     56        $atts = (array)$atts;
     57        $out = array();
     58        foreach( $pairs as $name => $default )
     59        {
     60            if( array_key_exists( $name, $atts ) )
     61            {
     62                $out[$name] = $atts[$name];
     63            }
     64            else if( isset( $_GET[$name] ) )
     65            {
     66                $out[$name] = sanitize_text_field( $_GET[$name] );
     67            }
     68            else
     69            {
     70                $out[$name] = $default;
     71            }
     72        }
     73
     74        if( !empty( $atts ) )
     75        {
     76            foreach( $atts as $name => $unknow_att )
     77            {
     78                if( !array_key_exists( $name, $out ) )
     79                {
     80                    $out[$name] = $unknow_att;
     81                }
     82            }
     83        }
     84
     85        return $out;
     86    }
     87
     88    /**
     89     * Get webapp components data parameters from shortcode attributes.
     90     *
     91     * @param $atts array User defined attributes in shortcode tag.
     92     * @return string
     93     */
     94    private function get_data_from_attributes( $atts )
     95    {
     96        $atts = (array)$atts;
     97        $data = 'data-instance="' . $this->client_instance . '"';
     98        foreach( $atts as $key => $value )
     99        {
     100            $data .= ' data-param-' . str_replace( '_', '-', $key ) . '="' . do_shortcode( str_replace( [ '{', '}' ], [ '[', ']' ], $value ) ) . '"';
     101        }
     102        return $data;
     103    }
     104
     105    /**
     106     * Webapp AEC account creation form.
     107     *
     108     * @param $atts array User defined attributes in shortcode tag.
     109     * @return string
     110     * @since    1.0.0
     111     */
     112    public function webapp_account_creation( $atts )
     113    {
     114        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="register" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     115    }
     116
     117    /**
     118     * Webapp AEC events.
     119     *
     120     * @param $atts array User defined attributes in shortcode tag.
     121     * @return string
    30122     * @since    1.0.0
    31      * @access   private
    32      * @var      string $client_instance The AEC client instance name.
    33      */
    34     private $client_instance;
    35 
    36     /**
    37      * Initialize the class and set its properties.
    38      *
    39      * @param string $client_instance The AEC client instance name.
    40      * @since    1.0.0
    41      */
    42     public function __construct($client_instance)
    43     {
    44 
    45         $this->client_instance = $client_instance;
    46 
    47     }
    48 
    49     /**
    50      * Combine user attributes with known attributes and fill in defaults when needed. Also checks URL query string.
    51      *
    52      * @param $pairs array Entire list of supported attributes and their defaults.
    53      * @param $atts array User defined attributes in shortcode tag.
    54      * @return array
    55      */
    56     private function parse_atts($pairs, $atts)
    57     {
    58         $atts = (array)$atts;
    59         $out = array();
    60         foreach ($pairs as $name => $default) {
    61             if (array_key_exists($name, $atts)) {
    62                 $out[$name] = $atts[$name];
    63             } else if (isset($_GET[$name])) {
    64                 $out[$name] = sanitize_text_field($_GET[$name]);
    65             } else {
    66                 $out[$name] = $default;
    67             }
    68         }
    69 
    70         if (!empty($atts)) {
    71             foreach ($atts as $name => $unknow_att) {
    72                 if (!array_key_exists($name, $out)) {
    73                     $out[$name] = $unknow_att;
    74                 }
    75             }
    76         }
    77 
    78         return $out;
    79     }
    80 
    81     /**
    82      * Get webapp components data parameters from shortcode attributes.
    83      *
    84      * @param $atts array User defined attributes in shortcode tag.
    85      * @return string
    86      */
    87     private function get_data_from_attributes($atts)
    88     {
    89         $atts = (array)$atts;
    90         $data = 'data-instance="' . $this->client_instance . '"';
    91         foreach ($atts as $key => $value) {
    92             $data .= ' data-param-' . str_replace('_', '-', $key) . '="' . do_shortcode(str_replace(['{', '}'], ['[', ']'], $value)) . '"';
    93         }
    94         return $data;
    95     }
    96 
    97     private function getComponentLoader($function, $attr)
    98     {
    99         $attr['lang'] = AEC()->get_locale();
    100         $componentLoader = (new KiosqueComponentLoader())->getKiosqueComponentLoader();
    101         return $componentLoader->$function($attr);
    102     }
    103 
    104     /**
    105      * Webapp AEC account creation form.
    106      *
    107      * @param $atts array User defined attributes in shortcode tag.
    108      * @return string
    109      * @since    1.0.0
    110      */
    111     public function webapp_account_creation($atts)
    112     {
    113         return $this->getComponentLoader('getStudentRegisterComponent', $atts);
    114     }
    115 
    116     /**
    117      * Webapp AEC events.
    118      *
    119      * @param $atts array User defined attributes in shortcode tag.
    120      * @return string
    121      * @since    1.0.0
    122      */
    123     public function webapp_events($atts)
    124     {
    125         return $this->getComponentLoader('getEventListComponent', $atts);
    126     }
    127 
    128     /**
    129      * Webapp AEC events list.
    130      *
    131      * @param $atts array User defined attributes in shortcode tag.
    132      * @return string
    133      * @since    1.0.0
    134      */
    135     public function webapp_events_list($atts)
    136     {
    137         $atts = $this->parse_atts([
    138             'detail_link' => '',
    139         ], $atts);
    140 
    141         $atts['event-url'] = $atts['detail_link'];
    142 
    143         return $this->getComponentLoader('getEventsListComponent', $atts);
    144     }
    145 
    146     /**
    147      * Webapp AEC next events.
    148      *
    149      * @param $atts array User defined attributes in shortcode tag.
    150      * @return string
    151      * @since    1.0.0
    152      */
    153     public function webapp_next_events($atts)
    154     {
    155         $atts = $this->parse_atts([
    156             'detail_link' => '',
    157             'quantity-column' => 3,
    158         ], $atts);
    159 
    160         $atts['event-url'] = $atts['detail_link'];
    161 
    162         return $this->getComponentLoader('getNextEventComponent', $atts);
    163     }
    164 
    165     /**
    166      * Webapp AEC event detail.
    167      *
    168      * @param $atts array User defined attributes in shortcode tag.
    169      * @return string
    170      * @since    1.0.0
    171      */
    172     public function webapp_event_detail($atts)
    173     {
    174         return $this->getComponentLoader('getEventDetailComponent', $atts);
    175     }
    176 
    177     /**
    178      * Webapp AEC events list grid.
    179      *
    180      * @param $atts array User defined attributes in shortcode tag.
    181      * @return string
    182      * @since    1.0.0
    183      */
    184     public function webapp_events_list_grid($atts)
    185     {
    186         $atts = $this->parse_atts([
    187             'detail_link' => '',
    188             'quantity-column' => 3,
    189         ], $atts);
    190 
    191         $atts['event-url'] = $atts['detail_link'];
    192 
    193         return $this->getComponentLoader('getEventListGridComponent', $atts);
    194     }
    195 
    196     /**
    197      * Webapp AEC events list wide.
    198      *
    199      * @param $atts array User defined attributes in shortcode tag.
    200      * @return string
    201      * @since    1.0.0
    202      */
    203     public function webapp_events_list_wide($atts)
    204     {
    205         $atts = $this->parse_atts([
    206             'detail_link' => '',
    207         ], $atts);
    208 
    209         $atts['event-url'] = $atts['detail_link'];
    210 
    211         return $this->getComponentLoader('getEventListWideComponent', $atts);
    212     }
     123     */
     124    public function webapp_events( $atts )
     125    {
     126        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="list" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     127    }
     128
     129    /**
     130     * Webapp AEC events list.
     131     *
     132     * @param $atts array User defined attributes in shortcode tag.
     133     * @return string
     134     * @since    1.0.0
     135     */
     136    public function webapp_events_list( $atts )
     137    {
     138        $atts = $this->parse_atts( [
     139            'detail_link' => '',
     140        ], $atts );
     141
     142        $atts['event-url'] = $atts['detail_link'];
     143
     144        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="events-list" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '" class="listing"></div></div>';
     145    }
     146
     147    /**
     148     * Webapp AEC next events.
     149     *
     150     * @param $atts array User defined attributes in shortcode tag.
     151     * @return string
     152     * @since    1.0.0
     153     */
     154    public function webapp_next_events( $atts )
     155    {
     156        $atts = $this->parse_atts( [
     157            'detail_link' => '',
     158            'quantity-column' => 3,
     159        ], $atts );
     160
     161        $atts['event-url'] = $atts['detail_link'];
     162
     163        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="events-next" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     164    }
     165
     166    /**
     167     * Webapp AEC event detail.
     168     *
     169     * @param $atts array User defined attributes in shortcode tag.
     170     * @return string
     171     * @since    1.0.0
     172     */
     173    public function webapp_event_detail( $atts )
     174    {
     175        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="event-view"  data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     176    }
     177
     178    /**
     179     * Webapp AEC events list grid.
     180     *
     181     * @param $atts array User defined attributes in shortcode tag.
     182     * @return string
     183     * @since    1.0.0
     184     */
     185    public function webapp_events_list_grid( $atts )
     186    {
     187        $atts = $this->parse_atts( [
     188            'detail_link' => '',
     189            'quantity-column' => 3,
     190        ], $atts );
     191
     192        $atts['event-url'] = $atts['detail_link'];
     193
     194        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="events-list-grid" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     195    }
     196
     197    /**
     198     * Webapp AEC events list wide.
     199     *
     200     * @param $atts array User defined attributes in shortcode tag.
     201     * @return string
     202     * @since    1.0.0
     203     */
     204    public function webapp_events_list_wide( $atts )
     205    {
     206        $atts = $this->parse_atts( [
     207            'detail_link' => '',
     208        ], $atts );
     209
     210        $atts['event-url'] = $atts['detail_link'];
     211
     212        return '<div class="arc-en-ciel"><div class="loading" data-module="events" data-action="events-list-wide" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     213    }
    213214
    214215    /**
     
    219220     * @since    1.1.4
    220221     */
    221     public function webapp_classes_list($atts)
    222     {
    223         return $this->getComponentLoader('getCourseListComponent', $atts);
    224     }
    225 
    226     /**
    227     * Webapp AEC course detail.
    228     *
    229     * @param $atts array User defined attributes in shortcode tag.
    230     * @return string
    231     * @since    1.0.0
    232     */
    233     public function webapp_class_detail($atts)
    234     {
    235         return $this->getComponentLoader('getCourseDetailComponent', $atts);
    236     }
    237 
    238     /**
    239     * Webapp AEC contact map.
    240     *
    241     * @param $atts
    242     * @return string
    243     * @since    1.0.0
    244     */
    245     public function webapp_contact_map($atts = [])
    246     {
    247         $atts = $this->parse_atts([
    248             'display-details' => 'true',
    249             'etablishment_id' => 0,
    250             'height' => 500
    251         ], $atts);
    252 
    253         $atts['etablishment-branch-id'] = $atts['etablishment_id'];
    254         $atts['height'] .= 'px';
    255 
    256         return $this->getComponentLoader('getDisplayContactInfoComponent', $atts);
    257     }
    258 
    259     /**
    260     * Webapp AEC google maps.
    261     *
    262     * @param $atts array User defined attributes in shortcode tag.
    263     * @return string
    264     * @since    1.0.0
    265     */
    266     public function webapp_google_map($atts)
    267     {
    268         if (empty($atts))
    269             return '';
    270 
    271         $atts = $this->parse_atts([
    272             'etablishment-branch-id' => 0,
    273             'height' => 380
    274         ], $atts);
    275 
    276         $atts['height'] .= 'px';
    277 
    278         return "<div class='arc-en-ciel'><div class='loading'
     222    public function webapp_classes_list( $atts )
     223    {
     224        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="classes-list" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     225    }
     226
     227    /**
     228    * Webapp AEC course detail.
     229    *
     230    * @param $atts array User defined attributes in shortcode tag.
     231    * @return string
     232    * @since    1.0.0
     233    */
     234    public function webapp_class_detail( $atts )
     235    {
     236        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="course-detail"  data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     237    }
     238
     239    /**
     240    * Webapp AEC contact map.
     241    *
     242    * @param $atts
     243    * @return string
     244    * @since    1.0.0
     245    */
     246    public function webapp_contact_map( $atts = [] )
     247    {
     248        $atts = $this->parse_atts( [
     249            'display-details' => 'true',
     250            'etablishment_id' => 0,
     251            'height' => 500
     252        ], $atts );
     253
     254        $atts['etablishment-branch-id'] = $atts['etablishment_id'];
     255        $atts['height'] .= 'px';
     256
     257        return "<div class='arc-en-ciel'><div class='loading' data-module='contact' data-action='display-contact-info' data-show-loading='true' {$this->get_data_from_attributes( $atts )} data-param-lang='" . AEC()->get_locale() . "'></div></div>";
     258    }
     259
     260    /**
     261    * Webapp AEC google maps.
     262    *
     263    * @param $atts array User defined attributes in shortcode tag.
     264    * @return string
     265    * @since    1.0.0
     266    */
     267    public function webapp_google_map( $atts )
     268    {
     269        if( empty( $atts ) )
     270            return '';
     271
     272        $atts = $this->parse_atts( [
     273            'etablishment-branch-id' => 0,
     274            'height' => 380
     275        ], $atts );
     276
     277        $atts['height'] .= 'px';
     278
     279        return "<div class='arc-en-ciel'><div class='loading'
    279280                  data-module='contact'
    280281                  data-action='google-maps'
     
    283284                  data-param-lang='" . AEC()->get_locale() . "'>
    284285            </div></div>";
    285     }
    286 
    287     /**
    288      * Webapp AEC private tuition form.
     286    }
     287
     288    /**
     289     * Webapp AEC private tuition form.
     290     *
     291     * @param $atts array User defined attributes in shortcode tag.
     292     * @return string
     293     * @since    1.0.0
     294     */
     295    public function webapp_private_tuition( $atts )
     296    {
     297        $atts = $this->parse_atts([
     298            'product-type-id' => '',
     299        ], $atts);
     300        return '<div class="arc-en-ciel"><div class="loading" data-module="private-tuition" data-action="showPrivateTuitionForm" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     301    }
     302
     303    /**
     304     * Webapp AEC class selection.
     305     *
     306     * @param $atts array User defined attributes in shortcode tag.
     307     * @return string
     308     * @since    1.0.0
     309     */
     310    public function webapp_class_selection( $atts )
     311    {
     312        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="select-class" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     313    }
     314
     315    /**
     316     * Webapp AEC products list.
     317     *
     318     * @param $atts array User defined attributes in shortcode tag.
     319     * @return string
     320     * @since    1.0.0
     321     */
     322    public function webapp_products_list( $atts )
     323    {
     324        return '<div class="arc-en-ciel"><div class="loading" data-module="products" data-action="show-products" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     325    }
     326
     327    /**
     328     * Webapp AEC donation form.
     329     *
     330     * @param $atts array User defined attributes in shortcode tag.
     331     * @return string
     332     * @since    1.0.0
     333     */
     334    public function webapp_donation_form( $atts )
     335    {
     336        return '<div class="arc-en-ciel"><div class="loading" data-module="products" data-action="donation_form" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     337    }
     338
     339    /**
     340     * Webapp AEC donation form.
     341     *
     342     * @param $atts array User defined attributes in shortcode tag.
     343     * @return string
     344     * @since    1.0.0
     345     */
     346    public function webapp_donation_form_free( $atts )
     347    {
     348        return '<div class="arc-en-ciel"><div class="loading" data-module="donation" data-action="free-form" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     349    }
     350
     351    /**
     352     * Webapp AEC donation form list.
     353     *
     354     * @param $atts array User defined attributes in shortcode tag.
     355     * @return string
     356     * @since    1.0.0
     357     */
     358    public function webapp_donation_list( $atts )
     359    {
     360        return '<div class="arc-en-ciel"><div class="loading" data-module="donation" data-action="list" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     361    }
     362
     363    /**
     364     * Webapp AEC student login form.
     365     *
     366     * @param $atts array User defined attributes in shortcode tag.
     367     * @return string
     368     * @since    1.0.0
     369     */
     370    public function webapp_student_login( $atts )
     371    {
     372        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="login" data-show-loading="true" data-param-show-registration-link="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     373    }
     374
     375    /**
     376     * Webapp AEC student password recover form.
     377     *
     378     * @param $atts array User defined attributes in shortcode tag.
     379     * @return string
     380     * @since    1.0.11
     381     */
     382    public function webapp_student_password_recover( $atts )
     383    {
     384        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="reminder" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     385    }
     386
     387    /**
     388     * Webapp AEC student password update form.
     389     *
     390     * @param $atts array User defined attributes in shortcode tag.
     391     * @return string
     392     * @since    1.1.6
     393     */
     394    public function webapp_student_password_update( $atts )
     395    {
     396        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="password-update" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     397    }
     398
     399    /**
     400     * Webapp AEC student password reset form.
     401     *
     402     * @param $atts array User defined attributes in shortcode tag.
     403     * @return string
     404     * @since    1.0.11
     405     */
     406    public function webapp_student_password_reset( $atts )
     407    {
     408        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="password-reset" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     409    }
     410
     411    /**
     412     * Webapp AEC student registration form.
     413     *
     414     * @param $atts array User defined attributes in shortcode tag.
     415     * @return string
     416     * @since    1.0.0
     417     */
     418    public function webapp_student_register( $atts )
     419    {
     420        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-action="register" data-show-loading="true" data-param-is-wordpress-site="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-form_action="create_student" data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     421    }
     422
     423    /**
     424     * Webapp AEC student account.
     425     *
     426     * @return string
     427     * @since    1.0.0
     428     */
     429    public function webapp_student_account()
     430    {
     431        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-show-loading="true" data-action="accountInformation" data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     432    }
     433
     434    /**
     435     * Webapp AEC student account dashboard.
     436     *
     437     * @return string
     438     * @since    1.0.0
     439     */
     440    public function webapp_student_account_dashboard( $atts )
     441    {
     442        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-show-loading="true" data-action="account-dashboard" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     443    }
     444
     445    /**
     446     * Webapp AEC student controls.
     447     *
     448     * @param $atts array User defined attributes in shortcode tag.
     449     * @return string
     450     * @since    1.0.0
     451     */
     452    public function webapp_student_controls( $atts )
     453    {
     454        $atts = $this->parse_atts( [
     455            'is-wordpress-site' => '',
     456            'login-link' => '',
     457            'register-link' => '',
     458            'account-link' => '',
     459            'logout-link' => '',
     460            'my-cart-link' => '',
     461        ], $atts );
     462
     463        return "<div class='arc-en-ciel'><div data-module='student'
     464                 data-show-loading='true'
     465                 data-action='student-controls'
     466                 {$this->get_data_from_attributes( $atts )}
     467                 data-param-lang='" . AEC()->get_locale() . "'></div></div>";
     468    }
     469
     470    /**
     471     * Webapp AEC classes catalog.
     472     *
     473     * @param $atts array User defined attributes in shortcode tag.
     474     * @return string
     475     * @since    1.0.0
     476     */
     477    public function webapp_classes_catalog( $atts )
     478    {
     479        $atts = $this->parse_atts( [
     480            'etablishment-branch-id' => '',
     481            'period-id' => '',
     482            'classification-id' => '',
     483            'subject-id' => '',
     484            'class-type-id' => '',
     485            'level-id' => '',
     486            'sidebar' => '',
     487            'show-filter-choices' => '',
     488        ], $atts );
     489
     490        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-catalogue" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . '  data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     491    }
     492
     493    /**
     494     * Webapp AEC classes catalog with filter.
    289495     *
    290496     * @param $atts array User defined attributes in shortcode tag.
     
    292498     * @since    1.0.0
    293499     */
    294     public function webapp_private_tuition($atts)
    295     {
    296         $atts = $this->parse_atts([
    297             'product-type-id' => '',
    298         ], $atts);
    299         return $this->getComponentLoader('getPrivateTuitionComponent', $atts);
    300     }
    301 
    302     /**
    303      * Webapp AEC class selection.
    304      *
    305      * @param $atts array User defined attributes in shortcode tag.
    306      * @return string
    307      * @since    1.0.0
    308      */
    309     public function webapp_class_selection($atts)
    310     {
    311         return $this->getComponentLoader('getSelectClassComponent', $atts);
    312     }
    313 
    314     /**
    315      * Webapp AEC products list.
    316      *
    317      * @param $atts array User defined attributes in shortcode tag.
    318      * @return string
    319      * @since    1.0.0
    320      */
    321     public function webapp_products_list($atts)
    322     {
    323         return $this->getComponentLoader('getShowProductComponent', $atts);
    324     }
    325 
    326     /**
    327      * Webapp AEC donation form.
    328      *
    329      * @param $atts array User defined attributes in shortcode tag.
    330      * @return string
    331      * @since    1.0.0
    332      */
    333     public function webapp_donation_form($atts)
    334     {
    335         return $this->getComponentLoader('getDonationFormComponent', $atts);
    336     }
    337 
    338     /**
    339      * Webapp AEC donation form.
    340      *
    341      * @param $atts array User defined attributes in shortcode tag.
    342      * @return string
    343      * @since    1.0.0
    344      */
    345     public function webapp_donation_form_free($atts)
    346     {
    347         return $this->getComponentLoader('getDonationFormFreeComponent', $atts);
    348     }
    349 
    350     /**
    351      * Webapp AEC donation form list.
    352      *
    353      * @param $atts array User defined attributes in shortcode tag.
    354      * @return string
    355      * @since    1.0.0
    356      */
    357     public function webapp_donation_list($atts)
    358     {
    359         return $this->getComponentLoader('getDonationListComponent', $atts);
    360     }
    361 
    362     /**
    363      * Webapp AEC student login form.
    364      *
    365      * @param $atts array User defined attributes in shortcode tag.
    366      * @return string
    367      * @since    1.0.0
    368      */
    369     public function webapp_student_login($atts)
    370     {
    371         return $this->getComponentLoader('getStudentLoginComponent', $atts);
    372     }
    373 
    374     /**
    375      * Webapp AEC student password recover form.
    376      *
    377      * @param $atts array User defined attributes in shortcode tag.
    378      * @return string
    379      * @since    1.0.11
    380      */
    381     public function webapp_student_password_recover($atts)
    382     {
    383         return $this->getComponentLoader('getStudentPasswordRecoverComponent', $atts);
    384     }
    385 
    386     /**
    387      * Webapp AEC student password update form.
    388      *
    389      * @param $atts array User defined attributes in shortcode tag.
    390      * @return string
    391      * @since    1.1.6
    392      */
    393     public function webapp_student_password_update($atts)
    394     {
    395         return $this->getComponentLoader('getStudentPasswordUpdateComponent', $atts);
    396     }
    397 
    398     /**
    399      * Webapp AEC student password reset form.
    400      *
    401      * @param $atts array User defined attributes in shortcode tag.
    402      * @return string
    403      * @since    1.0.11
    404      */
    405     public function webapp_student_password_reset($atts)
    406     {
    407         return $this->getComponentLoader('getStudentPasswordResetComponent', $atts);
    408     }
    409 
    410     /**
    411      * Webapp AEC student registration form.
    412      *
    413      * @param $atts array User defined attributes in shortcode tag.
    414      * @return string
    415      * @since    1.0.0
    416      */
    417     public function webapp_student_register($atts)
    418     {
    419         return $this->getComponentLoader('getStudentRegisterComponent', $atts);
    420     }
    421 
    422     /**
    423      * Webapp AEC student account.
    424      *
    425      * @return string
    426      * @since    1.0.0
    427      */
    428     public function webapp_student_account()
    429     {
    430         return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-show-loading="true" data-action="accountInformation" data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    431     }
    432 
    433     /**
    434      * Webapp AEC student account dashboard.
    435      *
    436      * @return string
    437      * @since    1.0.0
    438      */
    439     public function webapp_student_account_dashboard($atts)
    440     {
    441         return $this->getComponentLoader('getAccountDashboardComponent', $atts);
    442     }
    443 
    444     /**
    445      * Webapp AEC student controls.
    446      *
    447      * @param $atts array User defined attributes in shortcode tag.
    448      * @return string
    449      * @since    1.0.0
    450      */
    451     public function webapp_student_controls($atts)
    452     {
    453         $atts = $this->parse_atts([
    454             'is-wordpress-site' => '',
    455             'login-link' => '',
    456             'register-link' => '',
    457             'account-link' => '',
    458             'logout-link' => '',
    459             'my-cart-link' => '',
    460         ], $atts);
    461 
    462         return $this->getComponentLoader('getStudentControlsComponent', $atts);
    463     }
    464 
    465     /**
    466      * Webapp AEC classes catalog.
    467      *
    468      * @param $atts array User defined attributes in shortcode tag.
    469      * @return string
    470      * @since    1.0.0
    471      */
    472     public function webapp_classes_catalog($atts)
    473     {
    474         $atts = $this->parse_atts([
    475             'etablishment-branch-id' => '',
    476             'period-id' => '',
    477             'classification-id' => '',
    478             'subject-id' => '',
    479             'class-type-id' => '',
    480             'level-id' => '',
    481             'sidebar' => '',
    482             'show-filter-choices' => '',
    483         ], $atts);
    484 
    485         return $this->getComponentLoader('getCourseCatalogueComponent', $atts);
    486     }
    487 
    488     /**
    489      * Webapp AEC classes catalog with filter.
    490      *
    491      * @param $atts array User defined attributes in shortcode tag.
    492      * @return string
    493      * @since    1.0.0
    494      */
    495     public function webapp_classes_catalog_with_filter($atts)
    496     {
    497         $atts = $this->parse_atts([
    498             'etablishment-branch-id' => '',
    499             'period-id' => '',
    500             'classification-id' => '',
    501             'subject-id' => '',
    502             'class-type-id' => '',
    503             'level-id' => '',
    504             'sidebar' => '',
    505             'show-filter-choices' => '',
    506         ], $atts);
    507 
    508         return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-catalogue-with-filters" data-show-loading="true" ' . $this->get_data_from_attributes($atts) . '  data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    509     }
    510 
    511     /**
    512      * Webapp AEC courses search bar.
    513      *
    514      * @param $atts array User defined attributes in shortcode tag.
    515      * @return string
    516      * @since    1.0.0
    517      */
    518     public function webapp_classes_search_box($atts)
    519     {
    520         if (isset($atts['url-configuration'])) {
    521             $atts['url-configuration'] = htmlentities(trim($atts['url-configuration']));
    522         }
    523 
    524         return $this->getComponentLoader('getCourseSearchBarComponent', $atts);
    525     }
    526 
    527     /**
    528      * Webapp AEC student account.
    529      *
     500    public function webapp_classes_catalog_with_filter( $atts )
     501    {
     502        $atts = $this->parse_atts( [
     503            'etablishment-branch-id' => '',
     504            'period-id' => '',
     505            'classification-id' => '',
     506            'subject-id' => '',
     507            'class-type-id' => '',
     508            'level-id' => '',
     509            'sidebar' => '',
     510            'show-filter-choices' => '',
     511        ], $atts );
     512
     513        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-catalogue-with-filters" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . '  data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     514    }
     515
     516    /**
     517     * Webapp AEC courses search bar.
     518     *
     519     * @param $atts array User defined attributes in shortcode tag.
     520     * @return string
     521     * @since    1.0.0
     522     */
     523    public function webapp_classes_search_box( $atts )
     524    {
     525        if( isset( $atts['url-configuration'] ) )
     526        {
     527            $atts['url-configuration'] = htmlentities( trim( $atts['url-configuration'] ) );
     528        }
     529
     530        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-search-bar" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     531    }
     532
     533    /**
     534     * Webapp AEC student account.
     535     *
     536     * @return string
     537     * @since    1.0.4
     538     */
     539    public function webapp_shopping_cart()
     540    {
     541        return '<div class="arc-en-ciel"><div class="loading" data-module="cart" data-show-loading="true" data-action="cart-form" data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     542    }
     543
     544    /**
     545     * Webapp AEC examination list.
     546     *
     547     * @param $atts array User defined attributes in shortcode tag.
     548     * @return string
     549     * @since    1.0.4
     550     */
     551    public function webapp_examination_list( $atts )
     552    {
     553        $atts = $this->parse_atts( [
     554            'examination-type-ids' => '',
     555            'show-category-title' => '',
     556        ], $atts );
     557
     558        return '<div class="arc-en-ciel"><div class="loading" data-module="examination" data-show-loading="true" data-action="list" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     559    }
     560
     561    /**
     562     * Webapp AEC examination type list.
     563     *
     564     * @param $atts array User defined attributes in shortcode tag.
    530565     * @return string
    531566     * @since    1.0.4
    532567     */
    533     public function webapp_shopping_cart()
    534     {
    535         return $this->getComponentLoader('getShoppingComponent', []);
    536     }
    537 
    538     /**
    539      * Webapp AEC examination list.
    540      *
    541      * @param $atts array User defined attributes in shortcode tag.
    542      * @return string
    543      * @since    1.0.4
    544      */
    545     public function webapp_examination_list($atts)
    546     {
    547         $atts = $this->parse_atts([
    548             'examination-type-ids' => '',
    549             'show-category-title' => '',
    550         ], $atts);
    551 
    552         return $this->getComponentLoader('getExaminationListComponent', $atts);
    553     }
    554 
    555     /**
    556      * Webapp AEC examination type list.
    557      *
    558      * @param $atts array User defined attributes in shortcode tag.
    559      * @return string
    560      * @since    1.0.4
    561      */
    562     public function webapp_examination_type_list($atts)
    563     {
    564         $atts = $this->parse_atts([
     568    public function webapp_examination_type_list( $atts )
     569    {
     570        $atts = $this->parse_atts( [
    565571            'examination-type-ids' => '',
    566572            'etablishment-branch-id' => ''
    567         ], $atts);
    568 
    569         return $this->getComponentLoader('getExaminationTypeListComponent', $atts);
     573        ], $atts );
     574
     575        return '<div class="arc-en-ciel"><div class="loading" data-module="examination" data-show-loading="true" data-action="examination-type-list" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    570576    }
    571577
     
    577583     * @since    1.0.4
    578584     */
    579     public function webapp_examination_type_detail($atts)
    580     {
    581         $atts = $this->parse_atts([
     585    public function webapp_examination_type_detail( $atts )
     586    {
     587        $atts = $this->parse_atts( [
    582588            'examination-type-id' => '',
    583589            'etablishment-branch-id' => ''
    584         ], $atts);
    585 
    586         return $this->getComponentLoader('getExaminationTypeDetailComponent', $atts);
     590        ], $atts );
     591
     592        return '<div class="arc-en-ciel"><div class="loading" data-module="examination" data-show-loading="true" data-action="examination-type-detail" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    587593    }
    588594
     
    594600     * @since    1.0.4
    595601     */
    596     public function webapp_examination_detail($atts)
    597     {
    598         $atts = $this->parse_atts(['examination-id' => ''], $atts);
    599 
    600         return $this->getComponentLoader('getExaminationDetailComponent', $atts);
    601     }
    602 
    603     /**
    604      * Webapp AEC Identify Panel.
    605      *
     602    public function webapp_examination_detail( $atts )
     603    {
     604        $atts = $this->parse_atts( [ 'examination-id' => '' ], $atts );
     605
     606        return '<div class="arc-en-ciel"><div class="loading" data-module="examination" data-action="examination-detail" data-show-loading="true"' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     607    }
     608
     609    /**
     610     * Webapp AEC Identify Panel.
     611     *
     612     * @return string
     613     * @since    1.0.0
     614     */
     615    public function webapp_identify_panel( $atts )
     616    {
     617        return '<div class="arc-en-ciel"><div class="loading" data-module="student" data-show-loading="true" data-action="identify-panel" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
     618    }
     619
     620    /**
     621     * Webapp AEC courses catalog.
     622     *
     623     * @param $atts array User defined attributes in shortcode tag.
    606624     * @return string
    607625     * @since    1.0.0
    608626     */
    609     public function webapp_identify_panel($atts)
    610     {
    611         return $this->getComponentLoader('getIdentityPanelComponent', $atts);
    612     }
    613 
    614     /**
    615      * Webapp AEC courses catalog.
    616      *
    617      * @param $atts array User defined attributes in shortcode tag.
    618      * @return string
    619      * @since    1.0.0
    620      */
    621     public function webapp_courses_catalog($atts)
    622     {
    623         $atts = $this->parse_atts([
     627    public function webapp_courses_catalog( $atts )
     628    {
     629        $atts = $this->parse_atts( [
    624630            'etablishment-branch-id' => '',
    625631            'period-id' => '',
     
    632638            'localization' => '',
    633639            'show-filter-choices' => '',
    634         ], $atts);
    635 
    636         return $this->getComponentLoader('getCourseCatalogComponent', $atts);
     640        ], $atts );
     641
     642        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-catalog" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . '  data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    637643    }
    638644
     
    644650     * @since    1.0.0
    645651     */
    646     public function webapp_courses_selection_tiles($atts)
    647     {
    648         $atts = $this->parse_atts([
     652    public function webapp_courses_selection_tiles( $atts )
     653    {
     654        $atts = $this->parse_atts( [
    649655            'etablishment-branch-id' => '',
    650656            'period-id' => '',
     
    657663            'class-format-id' => '',
    658664            'show-filter-choices' => true,
    659         ], $atts);
    660 
    661         return $this->getComponentLoader('getCourseSelectionTilesComponent', $atts);
     665        ], $atts );
     666
     667        return '<div class="arc-en-ciel"><div class="loading" data-module="classes"
     668               data-action="courses-selection-tiles"
     669               data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' 
     670               data-param-lang="' . AEC()->get_locale() . '"
     671            ></div></div>';
    662672    }
    663673
     
    669679     * @since    1.0.0
    670680     */
    671     public function webapp_courses_wizard($atts)
    672     {
    673 
    674         $atts = $this->parse_atts([
     681    public function webapp_courses_wizard( $atts )
     682    {
     683        $atts = $this->parse_atts( [
    675684            'id-subject' => '',
    676685            'id-classification' => '',
    677         ], $atts);
    678         return $this->getComponentLoader('getCourseWizardComponent', $atts);
     686        ], $atts );
     687        return '<div class="arc-en-ciel"><div class="loading" data-module="classes" data-action="courses-wizard" data-show-loading="true" ' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    679688    }
    680689
     
    686695     * @since    1.0.4
    687696     */
    688     public function webapp_newsletter()
    689     {
    690         return $this->getComponentLoader('getNewsLetterSubscribeFormComponent', []);
     697    public function webapp_newsletter( )
     698    {
     699        return '<div class="arc-en-ciel"><div class="loading" data-module="newsletter" data-action="subscribe-form" data-show-loading="true"' . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    691700    }
    692701
     
    698707     * @since    1.0.4
    699708     */
    700     public function webapp_unsubscribe_newsletter($atts)
    701     {
    702         $atts = $this->parse_atts([
     709    public function webapp_unsubscribe_newsletter( $atts )
     710    {
     711        $atts = $this->parse_atts( [
    703712            'redirect' => ''
    704         ], $atts);
    705 
    706         return $this->getComponentLoader('getNewsLetterUnsubscribeFormComponent', $atts);
     713        ], $atts );
     714
     715        return '<div class="arc-en-ciel"><div class="loading" data-module="newsletter" data-action="unsubscribe-form" data-show-loading="true"' . $this->get_data_from_attributes( $atts ) . ' data-param-lang="' . AEC()->get_locale() . '"></div></div>';
    707716    }
    708717}
Note: See TracChangeset for help on using the changeset viewer.