Changeset 890024
- Timestamp:
- 04/09/2014 11:44:30 AM (12 years ago)
- Location:
- pricemesh/trunk
- Files:
-
- 5 edited
-
admin/pricemesh-admin.php (modified) (8 diffs)
-
pricemesh-base.php (modified) (1 diff)
-
pricemesh.php (modified) (1 diff)
-
public/pricemesh-public.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pricemesh/trunk/admin/pricemesh-admin.php
r874063 r890024 98 98 */ 99 99 public function enqueue_admin_styles() { 100 101 if($this->is_on_post_screen()){ 100 if($this->is_on_supported_screen()){ 102 101 wp_enqueue_style( $this->plugin_slug .'pm-metabox-styles', plugins_url('assets/css/metabox.css', __FILE__ ), array(), PricemeshPublic::VERSION ); 103 102 } … … 123 122 public function enqueue_admin_scripts(){ 124 123 125 if($this->is_on_ post_screen()){124 if($this->is_on_supported_screen()){ 126 125 wp_enqueue_script($this->plugin_slug.'pm-handlebars', plugins_url('assets/js/handlebars-v1.3.0.js', __FILE__ ), array('jquery'), PricemeshPublic::VERSION ); 127 126 wp_enqueue_script($this->plugin_slug.'pm-metabox', plugins_url('assets/js/metabox.js', __FILE__ ), array('jquery'), PricemeshPublic::VERSION ); … … 322 321 $option_name = "WP Robot"; 323 322 $option_callback = "settings_3rd_party_wp_robot_callback"; 323 add_settings_field( 324 $option, __($option_name, $this->plugin_slug), array($this, $option_callback), $this->plugin_slug, $section 325 ); 326 register_setting($group, $option); 327 328 //woocommerce 329 $option = "pricemesh_option_woocommerce_integration"; 330 $option_name = "WooCommerce"; 331 $option_callback = "settings_3rd_party_woocommerce_callback"; 324 332 add_settings_field( 325 333 $option, __($option_name, $this->plugin_slug), array($this, $option_callback), $this->plugin_slug, $section … … 552 560 */ 553 561 public function settings_section_3rd_party_callback(){ 554 echo __("Pricemesh kann auf andere Plugins zugreifen und einen Preisvergleich anzeigen, wenn ein Barcode erkannt wird.", $this->plugin_slug);562 echo __("Pricemesh kann auf andere Plugins zugreifen und zusätzliche Funktionen freischalten.", $this->plugin_slug); 555 563 } 556 564 … … 563 571 $setting = $opts["wp_robot_integration"]; 564 572 if($this->is_wp_robot_installed()){ 565 $checked = checked('1', $setting); 566 echo "<input name='pricemesh_option_wp_robot_integration' type='checkbox' value='1' $checked/>"; 573 $checked = checked('1', $setting, false); 574 575 echo "<p class='description'>". 576 "<input name='pricemesh_option_wp_robot_integration' type='checkbox' value='1' $checked/>". 577 " ".__("Fügt automatisch importierte ASINs zu dem aktuellen Post hinzu.", $this->plugin_slug). 578 "</p>"; 567 579 }else{ 568 580 //echo "<input name='pricemesh_option_wp_robot_integration' type='checkbox' value='1' disabled/>"; 569 581 echo "<p class='description'>".__("WPRobot ist nicht installiert", $this->plugin_slug)."</p>"; 582 } 583 } 584 585 /** 586 * woocommerce callback 587 * @since 1.3.1 588 */ 589 public function settings_3rd_party_woocommerce_callback(){ 590 $opts = self::get_pricemesh_settings(); 591 $setting = $opts["woocommerce_integration"]; 592 if($this->is_woocommerce_installed()){ 593 $checked = checked('1', $setting, false); 594 echo "<p class='description'>". 595 "<input name='pricemesh_option_woocommerce_integration' type='checkbox' value='1' $checked/>". 596 " ".__("Schaltet die Pricemesh auf Produktseiten frei", $this->plugin_slug). 597 "</p>"; 598 }else{ 599 //echo "<input name='pricemesh_option_wp_robot_integration' type='checkbox' value='1' disabled/>"; 600 echo "<p class='description'>".__("WooCommerce ist nicht installiert", $this->plugin_slug)."</p>"; 570 601 } 571 602 } … … 604 635 function is_on_post_screen(){ 605 636 $screen = get_current_screen(); 606 607 637 if($screen->base == "post"){ 638 return True; 639 } 640 return False; 641 } 642 643 /** 644 * Checks if the current page is one of the supported types: post or page 645 * 646 * @since 1.3.1 647 * @return boolean true if the current screen is of type post or page 648 */ 649 function is_on_supported_screen(){ 650 $screen = get_current_screen(); 651 var_dump($screen->base); 652 if($screen->base == "post" || $screen->base == "page"){ 608 653 return True; 609 654 } … … 614 659 // create our custom meta box 615 660 add_meta_box('pricemesh-meta',__('Pricemesh', 'pricemesh-plugin'), array($this, 'meta_box'),'post','normal','high'); 661 add_meta_box('pricemesh-meta',__('Pricemesh', 'pricemesh-plugin'), array($this, 'meta_box'),'page','normal','high'); 662 $opts = self::get_pricemesh_settings(); 663 if($opts["woocommerce_integration"]){ 664 add_meta_box('pricemesh-meta',__('Pricemesh', 'pricemesh-plugin'), array($this, 'meta_box'),'product','normal','high'); 665 } 616 666 } 617 667 … … 668 718 } 669 719 720 /** 721 * Checks if WooCommerce is installed 722 * @since 1.0.1 723 * @return boolean true if WooCommerce is installed. false otherwise 724 */ 725 function is_woocommerce_installed(){ 726 /*** 727 * checks if WooCommerce is installed 728 * Note: only works in the admin area. 729 */ 730 if(is_plugin_active("woocommerce/woocommerce.php")){ 731 return true; 732 } 733 return false; 734 } 735 736 737 670 738 }?> -
pricemesh/trunk/pricemesh-base.php
r874063 r890024 29 29 30 30 "wp_robot_integration" => get_option("pricemesh_option_wp_robot_integration", 0), 31 "woocommerce_integration" => get_option("pricemesh_option_woocommerce_integration", 0), 31 32 ); 32 33 } -
pricemesh/trunk/pricemesh.php
r874063 r890024 4 4 Plugin URI: https://www.pricemesh.io/plugins/wordpress/ 5 5 Description: Mit diesem Plugin ist es möglich Wordpress um einen eigenen Preisvergleich zu erweitern. 6 Version: 1.3 6 Version: 1.3.1 7 7 Author: pricemesh 8 8 Author URI: https://www.pricemesh.io -
pricemesh/trunk/public/pricemesh-public.php
r874063 r890024 22 22 * @var string 23 23 */ 24 const VERSION = '1.3 ';24 const VERSION = '1.3.1'; 25 25 26 26 /** … … 285 285 */ 286 286 public function add_pricemesh($content){ 287 if( is_single() && $this->is_injection_needed()){287 if((is_single() || is_page()) && $this->is_injection_needed()){ 288 288 $injection_point = $this->get_injection_point(); 289 289 if($injection_point == PricemeshRender::IN_CONTENT){ … … 313 313 */ 314 314 public static function is_injection_needed(){ 315 316 if(is_single()){ 315 if(is_single() || is_page()){ 317 316 $opts = self::get_pricemesh_settings(); 318 317 if(strlen($opts["pids"])>=8 && strlen($opts["token"])>5){ -
pricemesh/trunk/readme.txt
r874063 r890024 3 3 Tags: affiliate, commerce, e-commerce, ecommerce, sales, sell, shop, shopping, widgets, wordpress ecommerce, amazon, preisvergleich, ads, advertising 4 4 Requires at least: 3.4 5 Tested up to: 3.8 6 Stable tag: 1.3 5 Tested up to: 3.8.2 6 Stable tag: 1.3.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 73 73 == Changelog == 74 74 75 = 1.3.1 = 76 * Pricemesh kann nun auf Pages eingesetzt werden 77 * Integration von WooCommerce Produktseiten 78 75 79 = 1.3 = 76 80 Es gibt nun zahlreiche Möglichkeiten das Design und das Verhalten des Preisvergleichs anzupassen.
Note: See TracChangeset
for help on using the changeset viewer.