Ejemplo n.º 1
0
 /**
  * Finalize User Profile
  * @author Howard R <*****@*****.**>
  * @static
  * @param int $user_id
  * @return boolean
  */
 public static function finalize($user_id)
 {
     /** create folder **/
     $folder_path = wpl_items::get_path($user_id, 2);
     if (!wpl_folder::exists($folder_path)) {
         wpl_folder::create($folder_path);
     }
     /** Multilingual **/
     if (wpl_global::check_multilingual_status()) {
         $languages = wpl_addon_pro::get_wpl_languages();
         $current_language = wpl_global::get_current_language();
         foreach ($languages as $language) {
             wpl_global::switch_language($language);
             /** Generate Rendered Data **/
             wpl_users::generate_rendered_data($user_id);
             wpl_users::update_text_search_field($user_id);
         }
         /** Switch to current language again **/
         wpl_global::switch_language($current_language);
     } else {
         /** Generate Rendered Data **/
         wpl_users::generate_rendered_data($user_id);
         wpl_users::update_text_search_field($user_id);
     }
     /** Generate Email Files **/
     wpl_users::generate_email_files($user_id);
     /** throwing event **/
     wpl_events::trigger('user_finalized', $user_id);
     return true;
 }