Changeset 1581607
- Timestamp:
- 01/25/2017 12:36:13 AM (9 years ago)
- Location:
- elevio/trunk
- Files:
-
- 7 edited
-
elevio.php (modified) (1 diff)
-
plugin_files/Elevio.class.php (modified) (3 diffs)
-
plugin_files/ElevioAdmin.class.php (modified) (2 diffs)
-
plugin_files/helpers/SettingsHelper.class.php (modified) (2 diffs)
-
plugin_files/helpers/TrackingCodeInfoHelper.class.php (modified) (1 diff)
-
plugin_files/models/post.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
elevio/trunk/elevio.php
r1468150 r1581607 6 6 Author: Elevio 7 7 Author URI: https://elev.io 8 Version: 3.5.58 Version: 4.0.1 9 9 */ 10 10 -
elevio/trunk/plugin_files/Elevio.class.php
r1459968 r1581607 19 19 protected $category_taxonomy = null; 20 20 protected $post_taxonomy = null; 21 protected $tag_taxonomy = null; 22 protected $version = null; 21 23 22 24 /** … … 127 129 128 130 /** 131 * Returns Elevio tag taxonomy 132 * 133 * @return int 134 */ 135 public function get_tag_taxonomy() 136 { 137 if (is_null($this->tag_taxonomy)) 138 { 139 $this->tag_taxonomy = get_option('elevio_tag_taxonomy', 'post_tag'); 140 } 141 142 return $this->tag_taxonomy; 143 } 144 145 /** 129 146 * Returns Elevio secret_id 130 147 * … … 139 156 140 157 return $this->secret_id; 158 } 159 160 /** 161 * Returns version they want to load 162 * This is a new setting, so needs to backfill 163 * 164 * @return int 165 */ 166 public function get_version() 167 { 168 169 if (is_null($this->version)) 170 { 171 $this->version = (int)get_option('elevio_version'); 172 173 if (!($this->version)) { 174 if(!($this->get_account_id())) { 175 // they are new, load v4 176 $this->version = 4; 177 } else { 178 // they were already using... be safe and load v3 179 $this->version = 3; 180 } 181 } 182 } 183 184 return $this->version; 141 185 } 142 186 -
elevio/trunk/plugin_files/ElevioAdmin.class.php
r1450968 r1581607 151 151 delete_option('elevio_category_taxonomy'); 152 152 delete_option('elevio_post_taxonomy'); 153 delete_option('elevio_tag_taxonomy'); 154 delete_option('elevio_version'); 153 155 } 154 156 155 157 protected function update_options($data) 156 158 { 159 157 160 // check if we are handling Elevio settings form 158 161 if (isset($data['settings_form']) == false && isset($data['new_account_id_form']) == false) … … 181 184 } 182 185 186 if(isset($data['elevio_tag_taxonomy'])) { 187 update_option('elevio_tag_taxonomy', $data['elevio_tag_taxonomy']); 188 } 189 190 if(isset($data['elevio_version'])) { 191 update_option('elevio_version', $data['elevio_version']); 192 } 193 183 194 184 195 if (isset($data['changes_saved']) && $data['changes_saved'] == '1') -
elevio/trunk/plugin_files/helpers/SettingsHelper.class.php
r1450968 r1581607 52 52 </td> 53 53 </tr> 54 <tr> 54 55 <tr> 56 <th scope="row"> 57 <label for="elevio_is_enabled">I would like to load versions: <?php echo Elevio::get_instance()->get_version() ?></label> 58 </th> 59 <td> 60 <select name="elevio_version" id="elevio_version" > 61 <?php foreach (array(3, 4) as $version) { ?> 62 <option <?php echo(Elevio::get_instance()->get_version() === $version?'selected="selected"':'')?>><?php echo $version;?></option> 63 <?php }?> 64 </select> 65 (Version 4 is recommended) 66 </td> 67 </tr> 68 <tr> 55 69 <th scope="row"> 56 70 <label for="elevio_category_taxonomy">Category taxonomy:</label> … … 74 88 <?php }?> 75 89 </select> 90 </td> 91 </tr> 92 <tr> 93 <th scope="row"> 94 <label for="elevio_tag_taxonomy">Tag taxonomy:</label> 95 </th> 96 <td> 97 <select name="elevio_category_taxonomy" id="elevio_category_taxonomy" > 98 <?php foreach (get_taxonomies() as $term) { ?> 99 <option <?php echo(Elevio::get_instance()->get_category_taxonomy() === $term?'selected="selected"':'')?>><?php echo $term;?></option> 100 <?php }?> 101 </select> 76 102 </td> 77 103 </tr> -
elevio/trunk/plugin_files/helpers/TrackingCodeInfoHelper.class.php
r1450968 r1581607 17 17 </strong>)</p></div> 18 18 19 <form method="post" action="?page=elevio_settings"> 19 <div class="postbox"> 20 <form method="post" action="?page=elevio_settings"> 21 <div class="postbox_content"> 22 <table class="form-table"> 23 <tr> 24 <th scope="row"> 25 <label for="elevio_is_enabled">Show elevio on site?</label> 26 </th> 27 <td> 28 <input type="checkbox" name="elevio_is_enabled" id="elevio_is_enabled" value="1" <?php echo Elevio::get_instance()->is_enabled()?'checked="checked"':''; ?> /> 29 </td> 30 </tr> 20 31 21 <table class="form-table"> 22 <tr> 23 <th scope="row"> 24 <label for="elevio_is_enabled">Show elevio on site?</label> 25 </th> 26 <td> 27 <input type="checkbox" name="elevio_is_enabled" id="elevio_is_enabled" value="1" <?php echo Elevio::get_instance()->is_enabled()?'checked="checked"':''; ?> /> 28 </td> 29 </tr> 32 <tr> 33 <th scope="row"> 34 <label for="elevio_version">I would like to load version: </label> 35 </th> 36 <td> 37 <select name="elevio_version" id="elevio_version" > 38 <?php foreach (array(3, 4) as $version) { ?> 39 <option <?php echo(Elevio::get_instance()->get_version() === $version?'selected="selected"':'')?>><?php echo $version;?></option> 40 <?php }?> 41 </select> 42 (Version 4 is recommended) 43 </td> 44 </tr> 30 45 31 <tr> 32 <th scope="row"> 33 <label for="elevio_category_taxonomy">Category taxonomy:</label> 34 </th> 35 <td> 36 <select name="elevio_category_taxonomy" id="elevio_category_taxonomy" > 37 <?php foreach (get_taxonomies() as $term) { ?> 38 <option <?php echo(Elevio::get_instance()->get_category_taxonomy() === $term?'selected="selected"':'')?>><?php echo $term;?></option> 39 <?php }?> 40 </select> 41 </td> 42 </tr> 43 <tr> 44 <th scope="row"> 45 <label for="elevio_post_taxonomy">Post taxonomy:</label> 46 </th> 47 <td> 48 <select name="elevio_post_taxonomy" id="elevio_post_taxonomy" > 49 <?php foreach (get_post_types() as $term) { ?> 50 <option <?php echo(Elevio::get_instance()->get_post_taxonomy() === $term?'selected="selected"':'')?>><?php echo $term;?></option> 51 <?php }?> 52 </select> 53 </td> 54 </tr> 46 <tr> 47 <th scope="row"> 48 <label for="elevio_category_taxonomy">Category taxonomy:</label> 49 </th> 50 <td> 51 <select name="elevio_category_taxonomy" id="elevio_category_taxonomy" > 52 <?php foreach (get_taxonomies() as $term) { ?> 53 <option <?php echo(Elevio::get_instance()->get_category_taxonomy() === $term?'selected="selected"':'')?>><?php echo $term;?></option> 54 <?php }?> 55 </select> 56 </td> 57 </tr> 58 <tr> 59 <th scope="row"> 60 <label for="elevio_post_taxonomy">Post taxonomy:</label> 61 </th> 62 <td> 63 <select name="elevio_post_taxonomy" id="elevio_post_taxonomy" > 64 <?php foreach (get_post_types() as $term) { ?> 65 <option <?php echo(Elevio::get_instance()->get_post_taxonomy() === $term?'selected="selected"':'')?>><?php echo $term;?></option> 66 <?php }?> 67 </select> 68 </td> 69 </tr> 70 <tr> 71 <th scope="row"> 72 <label for="elevio_post_taxonomy">Tag taxonomy:</label> 73 </th> 74 <td> 75 <select name="elevio_tag_taxonomy" id="elevio_tag_taxonomy" > 76 <?php foreach (get_taxonomies() as $term) { ?> 77 <option <?php echo(Elevio::get_instance()->get_tag_taxonomy() === $term?'selected="selected"':'')?>><?php echo $term;?></option> 78 <?php }?> 79 </select> 80 </td> 81 </tr> 55 82 56 </table>83 </table> 57 84 58 <p class="submit"> 59 <input type="hidden" name="settings_form" value="1"> 60 <input type="hidden" name="elevio_enable_form" value="1"> 61 <input type="submit" class="button-primary" value="<?php _e('Save changes') ?>" /> 62 </p> 63 </form> 85 <p class="submit"> 86 <input type="hidden" name="settings_form" value="1"> 87 <input type="hidden" name="elevio_enable_form" value="1"> 88 <input type="submit" class="button-primary" value="<?php _e('Save changes') ?>" /> 89 </p> 90 </div> 91 </form> 92 </div> 64 93 <?php 65 94 -
elevio/trunk/plugin_files/models/post.php
r1468150 r1581607 76 76 77 77 function set_tags_value() { 78 $args['tag_taxonomy'] = Elevio::get_instance()->get_tag_taxonomy(); 78 79 global $json_api; 79 80 $this->tags = array(); 80 if ($wp_tags = get_the_t ags($this->id)) {81 if ($wp_tags = get_the_terms($this->id, $args['tag_taxonomy'])) { 81 82 foreach ($wp_tags as $wp_tag) { 82 83 $this->tags[] = new Elevio_Sync_Tag($wp_tag); -
elevio/trunk/readme.txt
r1468150 r1581607 2 2 Contributors: Elevio 3 3 Tags: zendesk, desk.com, uservoice, zopim, olark, snapengage, livechat, knowledge base, live chat, support, intercom, statuspage, freshdesk, intercom 4 Stable tag: 3.5.54 Stable tag: 4.0.1 5 5 Requires at least: 2.8 6 6 Tested up to: 4.4.2 … … 51 51 == Changelog == 52 52 53 = 4.0.1 = 54 * Allows direct loading of Version 4 55 * Allows for custom taxonomy 56 53 57 = 3.5.0 = 54 58 * Choose the category and post taxonomy you want to sync, in case you are using something other than the standard structure.
Note: See TracChangeset
for help on using the changeset viewer.