current = $this->currentItemMenu(); if( $this->current == 'dash' ) { $this->catch_reset(); } if( in_array( $this->current, array('currency', 'api', 'updates', 'cleanup') ) ) { $this->catch_request(); } if( $this->current == 'scheduled' ) $this->catch_cron(); if( $this->current == 'review' ) $this->catch_cron_review(); //读取wp_option数据 $this->AppKey = get_site_option('aliprice-app-key'); $this->trackingId = get_site_option('aliprice-tracking'); $this->appsignature = get_site_option('aliprice-appsignature'); $this->Partner_username = get_site_option('aliprice-partner_username'); $this->appearance = get_site_option('aliprice-appearance'); $this->todaysdeal = get_site_option('aliprice-todaysdeal'); $this->hotdeal = get_site_option('aliprice-hotdeal'); $this->alibaba = get_site_option('aliprice-alibaba'); $this->alibaba_href = get_site_option('aliprice-alibaba_href'); } /** * show current template */ public function getTemplate() { $current = $this->current; $tmpls = $this->templList(); $args = $this->listMenu(); if( !isset( $tmpls[$current] ) ) return false; $cancel = false; foreach($args as $key => $val) { if( $cancel ) continue; if( $key == $current ) { $this->title = $val['title']; $this->description = $val['description']; $this->icon = $val['icon']; $cancel = true; } if( isset($val['submenu']) ) { foreach( $val['submenu'] as $skey => $sval ) { if( $skey == $current ) { $this->title = $sval['title']; $this->description = $sval['description']; $this->icon = $val['icon']; $cancel = true; } } } } $method = $tmpls[$current]; if( method_exists( $this, $method ) ) { ob_start(); $this->$method(); $content = ob_get_contents(); ob_end_clean(); $this->createTpl( $content ); } else return false; } /** * list template slugs */ public function templList() { return array( 'dash' => 'tmplDashboard', 'bulkimport' => 'tmplBulk', 'advancedimport' => 'tmplAdvanced', 'scheduledimport' => 'tmplScheduled', 'translate' => 'tmplTranslate', 'review' => 'tmplReview', 'currency' => 'tmplCurrency', 'updates' => 'tmplUpdates', 'api' => 'tmplAPI', 'cleanup' => 'tmplCleanup' ); } /** * list menu array */ public function listMenu() { return array( 'dash' => array( 'title' => __('Dashboard', 'aliprice'), 'description' => __('This displays the current information about your online store', 'aliprice'), 'icon' => 'tachometer', 'submenu' => array() ), 'advancedimport' => array( 'title' => __('Import Products', 'aliprice'), 'icon' => 'cloud-download', 'description' => __('Using this module you can bulk import multiple products at once on your store', 'aliprice'), 'submenu' => array( 'advancedimport' => array( 'title' => __('Selective Import', 'aliprice'), 'description' => __('Find and select particular products to import', 'aliprice') ), 'bulkimport' => array( 'title' => __('Bulk Import', 'aliprice'), 'description' => __('Using this module you can bulk import multiple products at once on your store', 'aliprice') ), 'scheduledimport' => array( 'title' => __('Scheduled Import', 'aliprice'), 'description' => __('Using this module the system will automatically import and update products on your site according to given parameters', 'aliprice') ) ) ), 'review' => array( 'title' => __('Reviews', 'aliprice'), 'icon' => 'comment', 'description' => __('Add Reviews to your products.', 'aliprice'), 'submenu' => array() ), 'api' => array( 'title' => __('Settings', 'aliprice'), 'description' => __('Mandatory fields are APP Key and Tracking ID', 'aliprice'), 'icon' => 'cog', 'submenu' => array( 'api' => array( 'title' => __('General', 'aliprice'), 'description' => __('The following fields are required in order to send requests to AliExpress and retrieve data about products.', 'aliprice') ), 'currency' => array( 'title' => __('Currency', 'aliprice'), 'description' => __('Standards and formats are used to calculate such things as product price.', 'aliprice') ), 'updates' => array( 'title' => __('Updates', 'aliprice'), 'description' => '' ), 'cleanup' => array( 'title' => __('Cleanup', 'aliprice'), 'description' => __('All existent products imported in your store will be removed.', 'aliprice') ), 'translate' => array( 'title' => __('Translation', 'aliprice'), 'description' => __('Translate Page Titles and Categories', 'aliprice'), 'icon' => 'language', 'submenu' => array() ), ), ) ); } public function tmplUpdates() { ?>
|
|
Setting saved.
.
.
.
.
.