Changeset 764107
- Timestamp:
- 08/29/2013 10:22:33 AM (12 years ago)
- Location:
- travel-search/tags/1.2.5
- Files:
-
- 10 edited
-
classes/searchboxesSettingsFormRenderer.class.php (modified) (1 diff)
-
controllers/controller-admin.php (modified) (9 diffs)
-
controllers/controller-frontend.php (modified) (3 diffs)
-
views/admin/demo/content.php (modified) (5 diffs)
-
views/admin/settings/content.php (modified) (1 diff)
-
views/admin/tg_searchboxes/160x600/content.php (modified) (1 diff)
-
views/admin/tg_searchboxes/300x250/content.php (modified) (1 diff)
-
views/admin/tg_searchboxes/300x533/content.php (modified) (1 diff)
-
views/admin/tg_searchboxes/728x90/content.php (modified) (1 diff)
-
views/admin/tg_searchboxes/dynamic/content.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
travel-search/tags/1.2.5/classes/searchboxesSettingsFormRenderer.class.php
r751809 r764107 48 48 function admin_init() { 49 49 // registering the settings 50 register_setting('tg_searchboxes_options', 'tg_searchboxes_options', array( &$this, 'validate_options'));51 add_settings_section('tg_searchboxes_options', 'Default Searchbox Values and Targeting Options', array( &$this, 'description_text'), 'tg_searchboxes_options');50 register_setting('tg_searchboxes_options', 'tg_searchboxes_options', array($this, 'validate_options')); 51 add_settings_section('tg_searchboxes_options', 'Default Searchbox Values and Targeting Options', array($this, 'description_text'), 'tg_searchboxes_options'); 52 52 // adding the id referral field to the form as a setting field 53 add_settings_field('tg_searchboxes_options_id_referral', 'Your unique Travelgrove affiliate ID:', array( &$this, 'id_referral_input'), 'tg_searchboxes_options', 'tg_searchboxes_options');53 add_settings_field('tg_searchboxes_options_id_referral', 'Your unique Travelgrove affiliate ID:', array($this, 'id_referral_input'), 'tg_searchboxes_options', 'tg_searchboxes_options'); 54 54 // adding the date format select to the form as a setting field 55 add_settings_field('tg_searchboxes_options_date_format', 'Date Format:', array( &$this, 'date_format_select'), 'tg_searchboxes_options', 'tg_searchboxes_options');55 add_settings_field('tg_searchboxes_options_date_format', 'Date Format:', array($this, 'date_format_select'), 'tg_searchboxes_options', 'tg_searchboxes_options'); 56 56 // adding the departure date select to the form as a setting field 57 add_settings_field('tg_searchboxes_options_departure_date', 'Default Departure Date:', array( &$this, 'departure_date_select'), 'tg_searchboxes_options', 'tg_searchboxes_options');57 add_settings_field('tg_searchboxes_options_departure_date', 'Default Departure Date:', array($this, 'departure_date_select'), 'tg_searchboxes_options', 'tg_searchboxes_options'); 58 58 // adding the return date select to the form as a setting field 59 add_settings_field('tg_searchboxes_options_return_date', 'Default Return Date:', array( &$this, 'return_date_select'), 'tg_searchboxes_options', 'tg_searchboxes_options');59 add_settings_field('tg_searchboxes_options_return_date', 'Default Return Date:', array($this, 'return_date_select'), 'tg_searchboxes_options', 'tg_searchboxes_options'); 60 60 } 61 61 -
travel-search/tags/1.2.5/controllers/controller-admin.php
r751809 r764107 69 69 function __construct() { 70 70 // activation hook used to install the plugin - saving the default options into WP options table 71 register_activation_hook( TG_SEARCHBOXES__FILE__, array( &$this, 'tg_searchboxes_install' ) );71 register_activation_hook( TG_SEARCHBOXES__FILE__, array( $this, 'tg_searchboxes_install' ) ); 72 72 // deac.hook - deleting the options for TG-searchboxes from WP options table 73 register_deactivation_hook(TG_SEARCHBOXES__FILE__, array( &$this, 'tg_searchboxes_deactivate'));73 register_deactivation_hook(TG_SEARCHBOXES__FILE__, array($this, 'tg_searchboxes_deactivate')); 74 74 // call parent's constructor for reading the options from WP options table 75 75 parent::__construct(); … … 78 78 79 79 // adding a menu to the menues on the left of the dashboard 80 add_action( 'admin_menu', array( &$this, 'tg_searchboxes_create_menu'));80 add_action( 'admin_menu', array($this, 'tg_searchboxes_create_menu')); 81 81 82 82 // initializing the class needed to display the html for the searchboxes settings page 83 83 $this->searchboxesSettingsFormRenderer = new searchboxesSettingsFormRenderer($this); 84 add_action('admin_init', array( &$this->searchboxesSettingsFormRenderer, 'admin_init'));85 // add_action('admin_init', array( &$this, 'jquery_ui'), 0);84 add_action('admin_init', array($this->searchboxesSettingsFormRenderer, 'admin_init')); 85 // add_action('admin_init', array($this, 'jquery_ui'), 0); 86 86 // is an AJAX request or not; DOING_AJAX is set by WP automatically; AJAX req. is triggered on Add-TG-Box button click 87 87 $doing_ajax = defined('DOING_AJAX') ? DOING_AJAX : false; … … 92 92 // valid ajax req. => Editor Button clicked => then on the thickbox popup div show the content of the specified views 93 93 // currently there's only 1 action+fn. for that:do_action_tg_searchboxes 94 add_action( 'init', array( &$this, 'do_action_' . $_GET['action'] ) );94 add_action( 'init', array( $this, 'do_action_' . $_GET['action'] ) ); 95 95 } 96 96 // the editor button will be present only on the pages in the array below … … 98 98 foreach ( $pages_with_editor_button as $page ) { 99 99 // if any of the given pages are loaded => edd the editor button 100 add_action( 'load-' . $page, array( &$this, 'add_editor_button' ) );100 add_action( 'load-' . $page, array( $this, 'add_editor_button' ) ); 101 101 } 102 102 return; … … 144 144 $this->page_slug, 145 145 // The function that displays the page content for the menu page 146 array( &$this, 'tg_searchboxes_load_view'),147 // array( &$this, 'tg_searchboxes_settings'),146 array($this, 'tg_searchboxes_load_view'), 147 // array($this, 'tg_searchboxes_settings'), 148 148 // The url to the icon to be used for this menu 149 149 plugins_url( '/images/tg20x20.gif', TG_SEARCHBOXES__FILE__ ) … … 152 152 add_action( 'admin_print_styles-'.$searchboxesSettingsPage, 153 153 // enqueuing the needed JS+CSS files via WP 154 array( &$this, 'tg_searchboxes_admin_head'));154 array($this, 'tg_searchboxes_admin_head')); 155 155 156 156 $demoPage = add_submenu_page( … … 166 166 'tg_searchboxes_demo', 167 167 // the function to be called to output the content for this page. 168 array( &$this, 'tg_searchboxes_load_view')168 array($this, 'tg_searchboxes_load_view') 169 169 ); 170 170 // loading the JS+CSS needed when the demo page is displayed; the same as on the post page 171 add_action('admin_print_styles-'.$demoPage, array( &$this, 'tg_searchboxes_frontend_head'));171 add_action('admin_print_styles-'.$demoPage, array($this, 'tg_searchboxes_frontend_head')); 172 172 return true; 173 173 } … … 236 236 $jsfile = "admin/admin-editor-buttons-script.min.js"; 237 237 // printing the scripts needed 238 add_action('wp_print_scripts', array( &$this, 'tg_searchboxes_admin_scripts'));238 add_action('wp_print_scripts', array($this, 'tg_searchboxes_admin_scripts')); 239 239 240 240 // HTML editor integration … … 256 256 // TinyMCE integration 257 257 if ( user_can_richedit() ) { 258 add_filter( 'mce_external_plugins', array( &$this, 'add_tinymce_plugin' ));259 add_filter( 'mce_buttons', array( &$this, 'add_tinymce_button' ), 0);258 add_filter( 'mce_external_plugins', array( $this, 'add_tinymce_plugin' )); 259 add_filter( 'mce_buttons', array( $this, 'add_tinymce_button' ), 0); 260 260 } 261 261 262 add_action( 'admin_print_footer_scripts', array( &$this, '_print_editor_button' ), 51);262 add_action( 'admin_print_footer_scripts', array( $this, '_print_editor_button' ), 51); 263 263 } 264 264 -
travel-search/tags/1.2.5/controllers/controller-frontend.php
r741552 r764107 24 24 /** call parent's constructor for reading the options from WP options table */ 25 25 parent::__construct(); 26 // add_action('wp_enqueue_scripts', array( &$this, 'jquery_ui'), 0);26 // add_action('wp_enqueue_scripts', array($this, 'jquery_ui'), 0); 27 27 /** adding to the dom the css files needed by the plugin in the frontend */ 28 28 $this->enqueue_tg_searchboxes_css(); … … 31 31 /** adding a hook for the shortcode "tg_searchboxes"; 32 32 * WP will automatically pass the found arguments: [shortcode argument1=value1 argument2=value2] */ 33 add_shortcode($this->shortcode_tg_searchboxes, array( &$this, 'tg_searchboxes_handle_tg_shortcode'));33 add_shortcode($this->shortcode_tg_searchboxes, array($this, 'tg_searchboxes_handle_tg_shortcode')); 34 34 35 35 // checking if current request is to load the searchbox via external JS file … … 146 146 function tg_searchboxes_handle_tg_shortcode($attr) { 147 147 /** init the renderer w/ the params. found in the source, by WP fn. */ 148 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $attr);148 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $attr); 149 149 // return the generated searchbox 150 150 return $tgSearchboxesRenderer->renderSearchboxes(); -
travel-search/tags/1.2.5/views/admin/demo/content.php
r723445 r764107 16 16 <?php 17 17 $atts = array( 'options' => '{"size":"dynamic"}'); 18 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $atts);18 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $atts); 19 19 echo $tgSearchboxesRenderer->renderSearchboxes(); 20 20 ?> … … 25 25 <?php 26 26 $atts = array( 'options' => '{"size":"160x600"}'); 27 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $atts);27 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $atts); 28 28 echo $tgSearchboxesRenderer->renderSearchboxes(); 29 29 ?> … … 35 35 <?php 36 36 $atts = array( 'options' => '{"size":"300x250"}'); 37 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $atts);37 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $atts); 38 38 echo $tgSearchboxesRenderer->renderSearchboxes(); 39 39 ?> … … 44 44 <?php 45 45 $atts = array( 'options' => '{"size":"300x533"}'); 46 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $atts);46 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $atts); 47 47 echo $tgSearchboxesRenderer->renderSearchboxes(); 48 48 ?> … … 53 53 <?php 54 54 $atts = array( 'options' => '{"size":"728x90"}'); 55 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $atts);55 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $atts); 56 56 echo $tgSearchboxesRenderer->renderSearchboxes(); 57 57 ?> -
travel-search/tags/1.2.5/views/admin/settings/content.php
r723445 r764107 73 73 <?php 74 74 $atts = array('options' =>'{"size":"300x250", "defaultSettings":true}'); 75 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $atts);75 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $atts); 76 76 echo $tgSearchboxesRenderer->renderSearchboxes(); 77 77 ?> -
travel-search/tags/1.2.5/views/admin/tg_searchboxes/160x600/content.php
r723445 r764107 14 14 <?php 15 15 $atts = array( 'options' => '{"size":"160x600", "ajaxSettings":true}'); 16 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $atts);16 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $atts); 17 17 echo $tgSearchboxesRenderer->renderSearchboxes(); 18 18 ?> -
travel-search/tags/1.2.5/views/admin/tg_searchboxes/300x250/content.php
r723445 r764107 14 14 <?php 15 15 $atts = array( 'options' => '{"size":"300x250", "ajaxSettings":true}'); 16 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $atts);16 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $atts); 17 17 echo $tgSearchboxesRenderer->renderSearchboxes(); 18 18 ?> -
travel-search/tags/1.2.5/views/admin/tg_searchboxes/300x533/content.php
r723445 r764107 14 14 <?php 15 15 $atts = array( 'options' => '{"size":"300x533", "ajaxSettings":true}'); 16 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $atts);16 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $atts); 17 17 echo $tgSearchboxesRenderer->renderSearchboxes(); 18 18 ?> -
travel-search/tags/1.2.5/views/admin/tg_searchboxes/728x90/content.php
r723445 r764107 14 14 <?php 15 15 $atts = array( 'options' => '{"size":"728x90", "ajaxSettings":true}'); 16 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $atts);16 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $atts); 17 17 echo $tgSearchboxesRenderer->renderSearchboxes(); 18 18 ?> -
travel-search/tags/1.2.5/views/admin/tg_searchboxes/dynamic/content.php
r723445 r764107 14 14 <?php 15 15 $atts = array( 'options' => '{"size":"dynamic", "ajaxSettings":true}'); 16 $tgSearchboxesRenderer = new tgSearchboxesRenderer( &$this, $atts);16 $tgSearchboxesRenderer = new tgSearchboxesRenderer($this, $atts); 17 17 echo $tgSearchboxesRenderer->renderSearchboxes(); 18 18 ?>
Note: See TracChangeset
for help on using the changeset viewer.