Пример #1
0
 /**
  * Defines the settings interface
  *
  * @author Jonathan Davis
  * @since 1.1
  *
  * @return void
  **/
 public function settings()
 {
     $this->ui->text(0, array('name' => 'account', 'value' => $this->settings['account'], 'size' => 30, 'label' => Shopp::__('Enter your PayPal account email.')));
     $this->ui->checkbox(0, array('name' => 'pdtverify', 'checked' => $this->settings['pdtverify'], 'label' => Shopp::__('Enable order verification')));
     $this->ui->text(0, array('name' => 'pdttoken', 'size' => 30, 'value' => $this->settings['pdttoken'], 'label' => Shopp::__('PDT identity token for validating orders.')));
     $this->ui->checkbox(0, array('name' => 'testmode', 'label' => Shopp::_mi('Use the [PayPal Sandbox](%s)', ShoppSupport::DOCS . 'payment-processing/paypal-standard/'), 'checked' => $this->settings['testmode']));
     $script = "var s='shopppaypalstandard';jQuery(document).bind(s+'Settings',function(){var \$=jQuery,p='#'+s+'-pdt',v=\$(p+'verify'),t=\$(p+'token');v.change(function(){v.prop('checked')?t.parent().fadeIn('fast'):t.parent().hide();}).change();});";
     $this->ui->behaviors($script);
 }
Пример #2
0
 public function advanced()
 {
     if (!current_user_can('shopp_settings_system')) {
         wp_die(__('You do not have sufficient permissions to access this page.'));
     }
     if (!empty($_POST['save'])) {
         check_admin_referer('shopp-system-advanced');
         if (!isset($_POST['settings']['error_notifications'])) {
             $_POST['settings']['error_notifications'] = array();
         }
         shopp_set_formsettings();
         // Reinitialize Error System
         ShoppErrors()->reporting((int) shopp_setting('error_logging'));
         ShoppErrorLogging()->loglevel((int) shopp_setting('error_logging'));
         ShoppErrorNotification()->setup();
         if (isset($_POST['shopp_services_plugins']) && $this->helper_installed()) {
             add_option('shopp_services_plugins');
             // Add if it doesn't exist
             update_option('shopp_services_plugins', $_POST['shopp_services_plugins']);
         }
         $this->notice(Shopp::__('Advanced settings saved.'));
     } elseif (!empty($_POST['rebuild'])) {
         check_admin_referer('shopp-system-advanced');
         $assets = ShoppDatabaseObject::tablename(ProductImage::$table);
         $query = "DELETE FROM {$assets} WHERE context='image' AND type='image'";
         if (sDB::query($query)) {
             $this->notice(Shopp::__('All cached images have been cleared.'));
         }
     } elseif (!empty($_POST['resum'])) {
         check_admin_referer('shopp-system-advanced');
         $summaries = ShoppDatabaseObject::tablename(ProductSummary::$table);
         $query = "UPDATE {$summaries} SET modified='" . ProductSummary::RECALCULATE . "'";
         if (sDB::query($query)) {
             $this->notice(Shopp::__('Product summaries are set to recalculate.'));
         }
     } elseif (isset($_POST['shopp_services_helper'])) {
         check_admin_referer('shopp-system-advanced');
         $plugin = 'ShoppServices.php';
         $source = SHOPP_PATH . "/core/library/{$plugin}";
         $install = WPMU_PLUGIN_DIR . '/' . $plugin;
         if (false === ($creds = request_filesystem_credentials($this->url, '', false, false, null))) {
             return true;
         }
         // stop the normal page form from displaying
         if (!WP_Filesystem($creds)) {
             // credentials were no good, ask for them again
             request_filesystem_credentials($this->url, '', false, false, null);
             return true;
         }
         global $wp_filesystem;
         if ('install' == $_POST['shopp_services_helper']) {
             if (!$wp_filesystem->exists($install)) {
                 if ($wp_filesystem->exists(WPMU_PLUGIN_DIR) || $wp_filesystem->mkdir(WPMU_PLUGIN_DIR, FS_CHMOD_DIR)) {
                     // Install the mu-plugin helper
                     $wp_filesystem->copy($source, $install, true, FS_CHMOD_FILE);
                 } else {
                     $this->notice(Shopp::_mi('The services helper could not be installed because the `mu-plugins` directory could not be created. Check the file permissions of the `%s` directory on the web aserver.', WP_CONTENT_DIR), 'error');
                 }
             }
             if ($wp_filesystem->exists($install)) {
                 shopp_set_setting('shopp_services_helper', 'on');
                 $this->notice(Shopp::__('Services helper installed.'));
             } else {
                 $this->notice(Shopp::__('The services helper failed to install.'), 'error');
             }
         } elseif ('remove' == $_POST['shopp_services_helper']) {
             global $wp_filesystem;
             if ($wp_filesystem->exists($install)) {
                 $wp_filesystem->delete($install);
             }
             if (!$wp_filesystem->exists($install)) {
                 shopp_set_setting('shopp_services_helper', 'off');
                 $this->notice(Shopp::__('Services helper uninstalled.'));
             } else {
                 $this->notice(Shopp::__('Services helper could not be uninstalled.'), 'error');
             }
         }
     }
     $notifications = shopp_setting('error_notifications');
     if (empty($notifications)) {
         $notifications = array();
     }
     $notification_errors = array(SHOPP_TRXN_ERR => Shopp::__('Transaction Errors'), SHOPP_AUTH_ERR => Shopp::__('Login Errors'), SHOPP_ADDON_ERR => Shopp::__('Add-on Errors'), SHOPP_COMM_ERR => Shopp::__('Communication Errors'), SHOPP_STOCK_ERR => Shopp::__('Inventory Warnings'));
     $errorlog_levels = array(0 => Shopp::__('Disabled'), SHOPP_ERR => Shopp::__('General Shopp Errors'), SHOPP_TRXN_ERR => Shopp::__('Transaction Errors'), SHOPP_AUTH_ERR => Shopp::__('Login Errors'), SHOPP_ADDON_ERR => Shopp::__('Add-on Errors'), SHOPP_COMM_ERR => Shopp::__('Communication Errors'), SHOPP_STOCK_ERR => Shopp::__('Inventory Warnings'), SHOPP_ADMIN_ERR => Shopp::__('Admin Errors'), SHOPP_DB_ERR => Shopp::__('Database Errors'), SHOPP_PHP_ERR => Shopp::__('PHP Errors'), SHOPP_ALL_ERR => Shopp::__('All Errors'), SHOPP_DEBUG_ERR => Shopp::__('Debugging Messages'));
     $plugins = get_plugins();
     $service_plugins = get_option('shopp_services_plugins');
     include $this->ui('advanced.php');
 }
Пример #3
0
 public static function buykey()
 {
     return Shopp::_mi('%s<big>Upgrade for Support</big>%s<big>You&apos;re missing out on **expert support**, **early access** to Shopp updates, and **one-click add-on updates**!</big>Don&apos;t have a Shopp Support Key? Support the project and get expert support, buy one today!', '<a href="' . ShoppSupport::STORE . '?utm_source=wpadmin-' . $_REQUEST['page'] . '&utm_medium=Shopp&utm_campaign=Plugin" class="button button-primary" target="_blank">', '</a>');
 }