'overview','courierapp-carriers'=>'carriers','courierapp-catalog'=>'catalogue','courierapp-catalog-ai'=>'ai','courierapp-packing'=>'packing','courierapp-carrier-logos'=>'branding'];} function courierapp_connect_is_hub(){return isset($_GET['page'])&&is_string($_GET['page'])&&isset(courierapp_connect_hub_aliases()[sanitize_key(wp_unslash($_GET['page']))]);} function courierapp_connect_hub_tabs(){return [ 'overview'=>['Σύνδεση καταστήματος','Store connection','overview'], 'carriers'=>['Courier & τιμοκατάλογοι','Carriers & tariffs','carriers'], 'catalogue'=>['Προϊόντα','Products','catalogue'], 'ai'=>['Προϊόντα & AI','Products & AI','catalogue'], 'packing'=>['3D συσκευασία','3D packing','catalogue'], 'notifications'=>['Αυτοματισμοί & SMS','Automation & SMS','notifications'], 'billing'=>['Το πρόγραμμά μου','My plan','billing'], 'branding'=>['Εμφάνιση checkout','Checkout appearance','checkout'], 'diagnostics'=>['Έλεγχοι σύνδεσης','Connection checks','overview'] ];} add_action('admin_menu',function(){ add_menu_page('CourierAPP Connect','CourierAPP Connect','manage_woocommerce','courierapp-connect','courierapp_connect_hub_page','dashicons-networking',56); foreach(courierapp_connect_hub_aliases() as $slug=>$tab){ remove_submenu_page('woocommerce',$slug); if($slug==='courierapp-connect')continue; add_submenu_page('','CourierAPP Connect','CourierAPP Connect','manage_woocommerce',$slug,'courierapp_connect_hub_page'); remove_submenu_page('',$slug); } remove_submenu_page('courierapp-connect','courierapp-connect'); },99); add_filter('parent_file',function($parent){return courierapp_connect_is_hub()?'courierapp-connect':$parent;}); add_action('admin_enqueue_scripts',function(){ if(!courierapp_connect_is_hub()||!current_user_can('manage_woocommerce')||isset($_GET['courierapp_print_orders']))return; wp_enqueue_style('courierapp-hub',plugins_url('assets/admin-hub.css',__FILE__),[],COURIERAPP_CONNECT_VERSION); wp_enqueue_script('courierapp-hub',plugins_url('assets/admin-hub.js',__FILE__),[],COURIERAPP_CONNECT_VERSION,true); }); add_action('admin_head',function(){if(current_user_can('manage_woocommerce'))echo '';}); function courierapp_connect_hub_page(){ if(!current_user_can('manage_woocommerce'))wp_die('Not allowed.','',['response'=>403]); if(isset($_GET['courierapp_print_orders'])){courierapp_connect_print_page();return;} $tabs=courierapp_connect_hub_tabs();$page=isset($_GET['page'])&&is_string($_GET['page'])?sanitize_key(wp_unslash($_GET['page'])):'courierapp-connect'; $selected=courierapp_connect_hub_aliases()[$page]??'overview'; if(isset($_GET['tab'])&&is_string($_GET['tab'])&&isset($tabs[sanitize_key(wp_unslash($_GET['tab']))]))$selected=sanitize_key(wp_unslash($_GET['tab'])); $en=!str_starts_with(determine_locale(),'el'); echo '
).')
'.esc_html($en?'Your store, your couriers. Everything in one place.':'Το κατάστημά σου, οι courier σου. Όλα σε ένα σημείο.').'