Changeset 493292
- Timestamp:
- 01/21/2012 06:11:44 PM (14 years ago)
- Location:
- wordpress-move/trunk
- Files:
-
- 4 added
- 8 edited
-
backup/converted (added)
-
backup/converted/index.html (added)
-
backup/index.html (added)
-
backup/old/index.html (added)
-
docs/index.html (modified) (3 diffs)
-
lang/wpmove.pot (modified) (2 diffs)
-
libs/functions-database-backup.php (modified) (1 diff)
-
libs/js/jquery.jstree.js (modified) (1 diff)
-
libs/js/themes/default/d.png (modified) (previous)
-
libs/js/themes/default/style.css (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
wordpress-move.php (modified) (32 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-move/trunk/docs/index.html
r459287 r493292 16 16 <ul> 17 17 <li><a href="#domain" title="Changing Domain Name">Change Domain Name</a></li> 18 <li><a href="# start" title="Start Migration">Start Migration</a></li>19 <li><a href="# complete" title="Complete Migration">Complete Migration</a></li>18 <li><a href="#migrate" title="Migrate">Migrate</a></li> 19 <li><a href="#restore" title="Restore">Restore</a></li> 20 20 </ul> 21 21 </li> … … 44 44 <p>Using the plugin is fairly simple. If you want to change your domain name, start migrating to another server or complete the migration you have already started from another server, you need to navigate to Migration Assistant page under the tools menu. However, if you want to manage the backup files under the backup directory, you need to navigate to Backup Manager page under the tools menu.</p> 45 45 <h2 id="assistant">Migration Assistant</h2> 46 <p>Migration Assistant welcomes you with three different actions you may want to perform: Change Domain Name, Start Migration and Complete Migration. If you wish to only change the domain name of your current installation, you should click the Change Domain Name link. If you wish to migrate to another server, you should click the Start Migration link. Once again, do not forget that you need to configure the plugin by going to WordPress Move page under the Settings menu before starting the migration. And finally, if you wish to complete the migration process started from another server, click the Complete Migration link.</p>46 <p>Migration Assistant welcomes you with three different actions you may want to perform: Change Domain Name, Start Migration and Restore. If you wish to only change the domain name of your current installation, you should click the Change Domain Name link. If you wish to migrate to another server, you should click the Start Migration link. Once again, do not forget that you need to configure the plugin by going to WordPress Move page under the Settings menu before starting the migration. And finally, if you wish to complete the migration process started from another server, click the Complete Migration link.</p> 47 47 <h3 id="domain">Change Domain Name</h3> 48 48 <p>Changing the domain name that your current installation operates on is quite easy. Just type in the new domain name you want to use instead of the current domain name and click the Change button. Plugin will immediately change all instances of your old domain name in the database with your new domain name. WordPress Move also backups your database before starting the operation so if something goes wrong, it rolls back all the changes made. Of course, rolling back may also fail under some circumstances so creating a backup of your database manually beforehand is always a good idea. WordPress Move actually saves the backup file it creates beforehand to the old backup directory in case something goes wrong either during the domain name changing procedure or afterwards. Note that database backup files WordPress Move creates are not like normal database backup files, so you will need a working instance of WordPress Move on that server to be able to restore using those backup files. Still, creating a backup file yourself is highly encouraged. Do not forget that WordPress Move only replaces instances of your old domain name in the database with your new domain name and does not make any further configurations needed to make your domain work on your host. Please refer to the question in the FAQ section for some additional information about this.</p> 49 <h3 id="start">Start Migration</h3> 50 <p>Start Migration page provides two different types of migration: Simple Migration and Advanced Migration.</p> 51 <ul> 52 <li><strong>Simple Migration:</strong> Simple Migration creates the backup of your files and database, and uploads them to the remote server right after you click the Start Migration button on the confirmation page. Therefore, Simple Migration requires no extra input.</li> 53 <li><strong>Advanced Migration:</strong> Advanced Migration displays all the files under your WordPress installation directory and asks you the files to backup. Once you click the Start Migration button, it creates the backup of your database and the files you selected, and uploads them to the remote server. If you do not select any files, only a backup of your database will be uploaded to the server you want to migrate to.</li> 54 </ul> 55 <p>Both of these methods creates backup files in chunks if you set a Chunk Size on the settings page of the plugin and also provides you the option to change the domain name that will be used on your new server. When starting the migration succeeds, you can run WordPress Move on the remote server in Complete Migration mode to complete the migration process.</p> 56 <h3 id="complete">Complete Migration</h3> 57 <p>Complete Migration basically imports database backups and extracts filesystem backups, created and uploaded by WordPress Move on the server you want to migrate from. When you navigate to Complete Migration page, it lists all the backup files that are going to be imported or extracted once you click the Complete Migration button. To select which files to import or extract, please navigate to Backup Manager page under the Tools menu. Do not forget that this process does not create a backup of your existing installation so if something goes wrong, it will not be possible to rollback the changes. It is your responsibility to backup your files and the database before clicking the Complete Migration button. If there are no files listed on the Complete Migration page, please make sure you started the migration successfully using WordPress Move on the server you want to migrate from.</p> 49 <h3 id="migrate">Migrate</h3> 50 <p>Migration page displays all the files under your WordPress installation directory and asks you which files to backup. Once you click the Start Migration button, it creates the backup of your database and the files (in chunks if you set a Chunk Size on the settings page of the plugin) you selected, and uploads them to the remote server. If you do not select any files, only a backup of your database will be uploaded to the server you want to migrate to. Also, the option to change the domain name that will be used on your new server is provided as well. It only changes the domain name that will be used by the installation in the receiving end. When starting the migration succeeds, you can run WordPress Move on the remote server in Complete Migration mode to complete the migration process.</p> 51 <h3 id="restore">Restore</h3> 52 <p>Restore option basically imports database backups and extracts filesystem backups, created and uploaded by WordPress Move on the server you want to migrate from. When you navigate to Restore page, it lists all the backup files inside the main backup directory aka Current Backups that you can choose from to complete the migration. Do not forget that this process does not create a backup of your existing installation so if something goes wrong, it will not be possible to rollback the changes. It is your responsibility to backup your files and the database before clicking the Complete Migration button. If there are no files listed on the Complete Migration page, please make sure you started the migration successfully using WordPress Move on the server you are migrating from.</p> 58 53 <h2 id="backup">Backup Manager</h2> 59 <p>Backup Manager is the place to organize the backup files either created by the plugin on the same server, or uploaded by the server you want to migrate from. If this is the server you want to migrate from, you can delete backup files after the Migration Assistant completes uploading them to the remote server. If you do not want to delete them, you can Archive them which basically means moving them to a sub-directory called <code>old</code>. You can always Unarchive the files you Archived using the Backup Manager. Files listed under Current Backups are the files that will be used by the Complete Migration mode so you can either delete or achive the files you do not want Complete Migration to use. Files listed under the Old Backups section are not used for anything so you can safely Archive the backup files you do not want to use but also do not want to delete.</p> 54 <p>Backup Manager is the place to organize the backup files either created by the plugin on the same server, or uploaded by the server you are migrating from. If this is the server you want to migrate from, you can delete backup files after the Migration Assistant completes uploading them to the remote server. If you do not want to delete them, you can Archive them which basically means moving them to a sub-directory called <code>old</code>. You can always Unarchive the files you Archived using the Backup Manager. Files listed under Current Backups are the files that will be used by the Complete Migration mode so you can either delete or achive the files you do not want Complete Migration to use. Files listed under the Old Backups section are not used for anything so you can safely Archive the backup files you do not want to use but also do not want to delete.</p> 55 <p>Since version 1.3, there is also Converted Database Backups section where which lists the database backup files that can be used outside the WordPress Move. As you might have noticed, database backups generated by WordPress Move have a different structure than normal database backup files which is the reason why you cannot use them outside the WordPress Move. To use database backup file outside the WordPress Move, simply find it in either Current Backups or Old Backups section, select the checkbox on the left, select the Convert option from the dropdown and click the Apply button. This will convert the files you have selected into generic SQL files that you can use outside the plugin. This feature is particularly useful if the plugin fails to migrate your installation properly or if you need to use the database backup file outside the plugin.</p> 60 56 <h2 id="faq">Frequently Asked Questions</h2> 61 57 <ol> … … 72 68 <li><strong>Plugin fails to create backup files because it says my backup directory is not writable. How can I fix this?</strong> 73 69 <br>As the warning suggests, you need to make the backup directory writable by the plugin. Permission settings vary from server to server so there is no specific value to set the directory permissions to. The easiest way to fix this problem yourself is using an FTP client to alter permission settings of the backup directory until plugin successfully creates backup files. You may also prefer requesting assistance from your hosting company.</li> 74 <li><strong> What will happen to the FTP Password that is already stored in my database?</strong>70 <li><strong>I am a pre-1.2 user, what will happen to the FTP Password that is already stored in my database?</strong> 75 71 <br>Visiting the WordPress Move Settings page any time after updating the plugin will remove it from the database permanently.</li> 72 <li><strong>Can I use the database backup files that WordPress Move generates with phpMyAdmin?</strong> 73 <br>You can convert a database backup file using the Convert option in the Backup Manager to use it outside the plugin. So, yes, you can use the <strong>converted</strong> database backup files with phpMyAdmin or any other script.</li> 76 74 </ol> 77 75 <p class="credits"><small>Project sponsored by <a href="http://code.google.com/soc/" title="Google Summer of Code">Google</a>, developed by <a href="http://twitter.com/_mert" title="Mert Yazicioglu">Mert Yazicioglu</a> and mentored by <a href="http://twitter.com/petemall" title="Pete Mall">Pete Mall</a> and <a href="http://twitter.com/brianlayman" title="Brian Layman">Brian Layman</a>.</small></p> -
wordpress-move/trunk/lang/wpmove.pot
r459287 r493292 3 3 "Project-Id-Version: WPMove\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 201 1-11-04 02:10+0200\n"6 "PO-Revision-Date: 201 1-11-04 02:11+0200\n"5 "POT-Creation-Date: 2012-01-21 19:57+0200\n" 6 "PO-Revision-Date: 2012-01-21 19:57+0200\n" 7 7 "Last-Translator: Mert Yazicioglu <[email protected]>\n" 8 8 "Language-Team: \n" … … 14 14 "X-Poedit-SearchPath-0: C:\\xampp\\htdocs\\wp\\wp-content\\plugins\\wordpress-move\n" 15 15 16 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:141 17 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:957 18 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1104 16 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:131 17 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:955 19 18 msgid "Change Domain Name" 20 19 msgstr "" 21 20 22 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 4221 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:132 23 22 msgid "Migrate" 24 23 msgstr "" 25 24 26 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 4325 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:133 27 26 msgid "Restore" 28 27 msgstr "" 29 28 30 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:177 29 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:134 30 msgid "FTP Settings" 31 msgstr "" 32 33 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:135 34 msgid "Change Domain Name (Optional)" 35 msgstr "" 36 37 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:136 38 msgid "Files to Transfer" 39 msgstr "" 40 41 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:170 31 42 msgid "FTP Connection Details" 32 43 msgstr "" 33 44 34 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:17 845 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:171 35 46 msgid "Database Backup Settings" 36 47 msgstr "" 37 48 38 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:17 949 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:172 39 50 msgid "File Backup Settings" 40 51 msgstr "" 41 52 42 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:25 753 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:254 43 54 msgid "Settings saved." 44 55 msgstr "" 45 56 46 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:26 357 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:260 47 58 msgid "Please fill in FTP Connection Details in order to start the migration process." 48 59 msgstr "" 49 60 50 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:2 7061 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:267 51 62 msgid "WordPress Move Settings" 52 63 msgstr "" 53 64 54 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:2 7265 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:269 55 66 msgid "Please configure the plugin using the settings below before starting to use the Migration Assistant under the Tools menu. If connecting to the remote server fails, please toggle the Passive Mode setting and try again." 56 67 msgstr "" 57 68 58 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:31 369 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:310 59 70 msgid "These are the FTP connection details of your new server." 60 71 msgstr "" 61 72 73 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:316 74 msgid "Hostname" 75 msgstr "" 76 62 77 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:319 63 msgid "Hostname"64 msgstr ""65 66 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:32267 78 msgid "The hostname you use to establish an FTP connection to the remote server. Might be an IP address or a domain name." 68 79 msgstr "" 69 80 81 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:324 82 msgid "Port" 83 msgstr "" 84 70 85 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:327 71 msgid "Port"72 msgstr ""73 74 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:33075 86 msgid "If you do not know what to write, it is most probably 21." 76 87 msgstr "" 77 88 89 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:332 90 msgid "Username" 91 msgstr "" 92 78 93 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:335 79 msgid "Username"80 msgstr ""81 82 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:33883 94 msgid "The username you use to establish an FTP connection to the remote server." 84 95 msgstr "" 85 96 97 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:340 98 msgid "Password" 99 msgstr "" 100 86 101 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:343 87 msgid "Password"88 msgstr ""89 90 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:34691 102 msgid "You will be asked to enter your FTP Password you use to establish an FTP connection to the remote server, right before starting the migration process." 92 103 msgstr "" 93 104 105 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:348 106 msgid "Remote Backup Path" 107 msgstr "" 108 94 109 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:351 95 msgid "Remote Backup Path"96 msgstr ""97 98 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:35499 110 msgid "Path from the top directory that your FTP account has access to, to the backup directory of the WordPress Move plugin on the remote server. For instance:" 100 111 msgstr "" 101 112 102 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:35 9113 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:356 103 114 msgid "Use Passive Mode" 104 115 msgstr "" 105 116 106 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:36 4117 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:361 107 118 msgid "Yes" 108 119 msgstr "" 109 120 110 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:36 9121 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:366 111 122 msgid "No" 112 123 msgstr "" 113 124 114 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:38 9125 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:386 115 126 msgid "The size of each chunk of your database backup. Actual sizes of chunks may exceed this size limit. 0 means unlimited." 116 127 msgstr "" 117 128 118 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:39 5119 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:42 3129 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:392 130 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:420 120 131 msgid "Chunk Size" 121 132 msgstr "" 122 133 123 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:41 7134 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:414 124 135 msgid "The size of files to compress per filesystem backup chunk. Sizes of chunks will be less than or equal to this size limit, depending on the compression ratio. 0 means unlimited." 125 136 msgstr "" 126 137 127 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:461 128 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:795 129 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1818 138 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:458 139 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:783 140 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:867 141 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1825 130 142 msgid "Migration Assistant" 131 143 msgstr "" 132 144 133 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:46 3145 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:460 134 146 msgid "Please make sure you read the documentation carefully, before selecting an action to proceed..." 135 147 msgstr "" 136 148 149 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:503 150 msgid "If you wish to do the following..." 151 msgstr "" 152 137 153 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:506 138 msgid " If you wish to do the following..."154 msgid "Just change the domain name this installation uses." 139 155 msgstr "" 140 156 141 157 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:509 142 msgid "Use this installation with a different domain name while staying on this server." 158 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:553 159 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:594 160 msgid "Do not forget that..." 143 161 msgstr "" 144 162 145 163 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:512 164 msgid "Your files and database will not be transferred to another server." 165 msgstr "" 166 167 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:513 168 msgid "Only instances of your old domain name in the database will be replaced." 169 msgstr "" 170 171 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:514 172 msgid "You need to manually configure your server and new domain name to use it on this server." 173 msgstr "" 174 175 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:515 176 msgid "A backup of your database will be made available under the backup directory." 177 msgstr "" 178 179 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:516 180 msgid "Creating a manual backup of your database is still highly encouraged." 181 msgstr "" 182 183 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:521 184 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:563 185 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:602 186 msgid "Begin" 187 msgstr "" 188 189 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:539 190 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:581 191 msgid "If you wish to do one or more of the following..." 192 msgstr "" 193 194 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:542 195 msgid "Transfer your database to another server.\t" 196 msgstr "" 197 198 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:543 199 msgid "Transfer some/all of your files to another server." 200 msgstr "" 201 202 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:544 203 msgid "Use a different domain name on the target server." 204 msgstr "" 205 206 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:547 207 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:588 208 msgid "Make sure that..." 209 msgstr "" 210 211 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:550 212 msgid "WordPress and WordPress Move are installed on the target server." 213 msgstr "" 214 146 215 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:556 216 msgid "This installation will stay as-is after the operation." 217 msgstr "" 218 219 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:557 220 msgid "You need to configure the plugin using the WordPress Move page under the Settings menu." 221 msgstr "" 222 223 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:558 224 msgid "You need to manually configure your existing domain to use it on the target server." 225 msgstr "" 226 227 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:584 228 msgid "Complete migrating to this server." 229 msgstr "" 230 231 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:585 232 msgid "Restore backup files listed under the Current Backups section of the Backup Manager." 233 msgstr "" 234 235 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:591 236 msgid "You have backup files to use for this process under the backup directory." 237 msgstr "" 238 147 239 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:597 148 msgid "Do not forget that..."149 msgstr ""150 151 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:515152 msgid "Your files and database will not be transferred to another server."153 msgstr ""154 155 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:516156 msgid "Only instances of your old domain name in the database will be replaced."157 msgstr ""158 159 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:517160 msgid "You need to manually configure your server and new domain name to use it on this server."161 msgstr ""162 163 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:518164 msgid "A backup of your database will be made available under the backup directory."165 msgstr ""166 167 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:519168 msgid "Creating a manual backup of your database is still highly encouraged."169 msgstr ""170 171 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:524172 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:566173 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:606174 msgid "Begin"175 msgstr ""176 177 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:542178 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:584179 msgid "If you wish to do one or more of the following..."180 msgstr ""181 182 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:545183 msgid "Transfer your database to another server.\t"184 msgstr ""185 186 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:546187 msgid "Transfer some/all of your files to another server."188 msgstr ""189 190 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:547191 msgid "Use a different domain name on the target server."192 msgstr ""193 194 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:550195 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:591196 msgid "Make sure that..."197 msgstr ""198 199 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:553200 msgid "WordPress and WordPress Move are installed on the target server."201 msgstr ""202 203 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:559204 msgid "This installation will stay as-is after the operation."205 msgstr ""206 207 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:560208 msgid "You need to configure the plugin using the WordPress Move page under the Settings menu."209 msgstr ""210 211 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:561212 msgid "You need to manually configure your existing domain to use it on the target server."213 msgstr ""214 215 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:587216 msgid "Complete migrating to this server."217 msgstr ""218 219 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:588220 msgid "Restore backup files listed under the Current Backups section of the Backup Manager."221 msgstr ""222 223 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:594224 msgid "You have backup files to use for this process under the backup directory."225 msgstr ""226 227 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:600228 msgid "You can select which files to use in this method by visiting the Backup Manager."229 msgstr ""230 231 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:601232 240 msgid "Backups will be processed starting from old to new." 233 241 msgstr "" 234 242 235 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:66 4236 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 179237 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 190238 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 272239 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 286243 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:660 244 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1027 245 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1041 246 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1133 247 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1149 240 248 msgid "Success!" 241 249 msgstr "" 242 250 243 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:66 6251 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:662 244 252 msgid "Your domain name has been changed successfully." 245 253 msgstr "" 246 254 247 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:66 7255 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:663 248 256 #, php-format 249 257 msgid "<a href=\"%s\">Click here</a> to go to your site using your new domain." 250 258 msgstr "" 251 259 260 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:676 261 msgid "Failure!" 262 msgstr "" 263 252 264 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:680 253 msgid "Failure!"254 msgstr ""255 256 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:684257 265 msgid "An error occured while changing instances of your domain name." 258 266 msgstr "" 259 267 260 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:70 4268 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:700 261 269 msgid "Changes on your domain has been rolled back automatically." 262 270 msgstr "" 263 271 264 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:7 12272 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:708 265 273 msgid "Rolling back to the previous state also failed. Please try importing the database backup stored under the backup folder manually." 266 274 msgstr "" 267 275 268 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:7 31276 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:727 269 277 msgid "Changing Domain Name" 270 278 msgstr "" 271 279 272 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:7 33280 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:729 273 281 msgid "Please enter exact paths to your WordPress installations on both domains without the trailing slash. After replacing instances of your old domain name in the database with the new one completes, please do not forget to update your nameservers." 274 282 msgstr "" 275 283 276 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:739 277 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:935 278 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1082 284 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:735 285 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:923 279 286 msgid "Old Domain Name" 280 287 msgstr "" 281 288 282 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:747 283 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:943 284 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1090 289 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:743 290 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:931 285 291 msgid "New Domain Name" 286 292 msgstr "" 287 293 288 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:75 6294 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:752 289 295 msgid "Change" 290 296 msgstr "" 291 297 292 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:797 293 msgid "Please select a migration type to proceed..." 294 msgstr "" 295 296 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:803 297 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:839 298 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:916 299 msgid "Simple Migration" 300 msgstr "" 301 302 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:806 303 msgid "Simple Migration creates a backup of your database and files excluding the plugin directory. Uploading backup files to the remote server starts once the backup files are created." 304 msgstr "" 305 306 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:811 307 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:979 308 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1063 309 msgid "Advanced Migration" 310 msgstr "" 311 312 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:814 313 msgid "Advanced Migration creates a backup of the database but lets you select the files to backup. Uploading backup files to the remote server starts once the backup files are created." 314 msgstr "" 315 316 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:885 317 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1031 298 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:835 318 299 msgid "Could not create backup files. Please make sure the backup directory is writable. For further info, please refer to the documentation." 319 300 msgstr "" 320 301 321 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:893 322 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1039 302 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:843 323 303 msgid "Creating and uploading backups have been completed. You can now go to your new installation and run the migration assistant in Complete Migration mode." 324 304 msgstr "" 325 305 326 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:902 327 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1048 306 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:852 328 307 msgid "Please check your FTP connection details on the settings page." 329 308 msgstr "" 330 309 331 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:918 332 msgid "This will backup your database and files as is and upload them to the server you want to migrate to." 333 msgstr "" 334 335 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:922 336 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1069 310 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:869 311 msgid "Please select the files you want to include in the backup from the list below." 312 msgstr "" 313 314 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:878 315 msgid "Start Migration" 316 msgstr "" 317 318 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:898 337 319 msgid "If your FTP account uses a password, please enter it below." 338 320 msgstr "" 339 321 340 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:924 341 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1071 322 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:900 342 323 msgid "FTP Password:" 343 324 msgstr "" 344 325 345 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:929 346 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1076 326 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:917 347 327 msgid "Please enter the exact path to your WordPress installation on your new domain name without the trailing slash and then click Start Migration button to start the migration process." 348 328 msgstr "" 349 329 350 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:955 351 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1142 352 msgid "Start Migration" 353 msgstr "" 354 355 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1065 356 msgid "Please select the files you want to include in the backup from the list below." 357 msgstr "" 358 359 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1102 330 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:953 360 331 msgid "Select All" 361 332 msgstr "" 362 333 363 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php: 1103334 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:954 364 335 msgid "Unselect All" 365 336 msgstr "" 366 337 367 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php: 1123338 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:974 368 339 msgid "Loading..." 369 340 msgstr "" 370 341 371 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 171342 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1018 372 343 #, php-format 373 344 msgid "Connecting to %s:%d..." 374 345 msgstr "" 375 346 376 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 183347 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1032 377 348 #, php-format 378 349 msgid "Logging in as %s using password..." 379 350 msgstr "" 380 351 381 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 185352 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1034 382 353 #, php-format 383 354 msgid "Logging in as %s without a password..." 384 355 msgstr "" 385 356 386 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 190357 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1041 387 358 msgid "Starting uploading files..." 388 359 msgstr "" 389 360 390 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 200361 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1053 391 362 #, php-format 392 363 msgid "%s is being uploaded..." 393 364 msgstr "" 394 365 366 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1056 367 msgid " Success!" 368 msgstr "" 369 370 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1058 371 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1087 372 msgid " Failed!" 373 msgstr "" 374 375 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1066 376 #, php-format 377 msgid "Uploading files is completed with %d error..." 378 msgstr "" 379 380 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1068 381 msgid "Uploading files is completed without an error..." 382 msgstr "" 383 384 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1073 385 msgid "Closing the FTP connection..." 386 msgstr "" 387 388 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1087 389 msgid "Operation terminated..." 390 msgstr "" 391 392 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1109 393 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1178 394 msgid "Completing Migration" 395 msgstr "" 396 397 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1128 398 #, php-format 399 msgid "%s is being imported... " 400 msgstr "" 401 402 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1136 403 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1152 404 msgid "Failed!" 405 msgstr "" 406 407 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1144 408 #, php-format 409 msgid "%s is being extracted... " 410 msgstr "" 411 412 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1160 413 msgid "Please select files to migrate before proceeding!" 414 msgstr "" 415 416 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1164 417 #, php-format 418 msgid "Migration has been completed but with %d error." 419 msgstr "" 420 421 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1166 422 msgid "Migration has been completed successfully!" 423 msgstr "" 424 425 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1192 426 msgid "Below are the files stored under the main backup directory. Please select backup files below to proceed." 427 msgstr "" 428 395 429 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1202 396 msgid " Success!" 397 msgstr "" 398 399 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1204 400 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1230 401 msgid " Failed!" 402 msgstr "" 403 404 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1211 405 #, php-format 406 msgid "Uploading files is completed with %d error..." 407 msgstr "" 408 409 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1213 410 msgid "Uploading files is completed without an error..." 411 msgstr "" 412 413 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1216 414 msgid "Closing the FTP connection..." 415 msgstr "" 416 417 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1230 418 msgid "Operation terminated..." 419 msgstr "" 420 421 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1252 422 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1310 423 msgid "Completing Migration" 424 msgstr "" 425 426 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1269 427 #, php-format 428 msgid "%s is being imported... " 429 msgstr "" 430 431 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1275 432 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1289 433 msgid "Failed!" 434 msgstr "" 435 436 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1283 437 #, php-format 438 msgid "%s is being extracted... " 439 msgstr "" 440 441 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1297 442 #, php-format 443 msgid "Migration has been completed but with %d error." 444 msgstr "" 445 446 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1299 447 msgid "Migration has been completed successfully!" 448 msgstr "" 449 450 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1324 451 msgid "Proceeding will use the following files and database backups. You can choose which files to use by going to the Backup Manager." 452 msgstr "" 453 454 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1333 455 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1352 456 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1553 457 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1572 458 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1679 459 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1698 460 msgid "Name" 461 msgstr "" 462 463 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1336 464 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1355 430 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1221 431 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1429 432 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1448 465 433 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1556 466 434 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1575 467 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1682 468 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1701 469 msgid "Type" 470 msgstr "" 471 472 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1339 473 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1358 435 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1681 436 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1700 437 msgid "Name" 438 msgstr "" 439 440 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1205 441 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1224 442 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1432 443 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1451 474 444 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1559 475 445 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1578 476 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1685 477 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1704 478 msgid "Size" 479 msgstr "" 480 481 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1342 482 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1361 446 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1684 447 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1703 448 msgid "Type" 449 msgstr "" 450 451 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1208 452 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1227 453 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1435 454 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1454 483 455 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1562 484 456 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1581 485 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1688 486 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1707 457 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1687 458 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1706 459 msgid "Size" 460 msgstr "" 461 462 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1211 463 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1230 464 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1438 465 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1457 466 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1565 467 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1584 468 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1690 469 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1709 487 470 msgid "Date Created" 488 471 msgstr "" 489 472 490 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1379 491 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1605 473 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1248 474 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1481 475 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1608 492 476 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1731 493 477 msgid "Database Backup" 494 478 msgstr "" 495 479 496 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 382497 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 608498 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 734480 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1251 481 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1484 482 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1611 499 483 msgid "Filesystem Backup" 500 484 msgstr "" 501 485 502 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 422486 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1290 503 487 msgid "Complete Migration" 504 488 msgstr "" 505 489 506 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 427490 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1295 507 491 msgid "There are no backup files to use to complete the migration. Please start the migration using WordPress Move on the server you want to migrate from." 508 492 msgstr "" 509 493 510 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 504511 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:18 19494 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1375 495 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1826 512 496 msgid "Backup Manager" 513 497 msgstr "" 514 498 515 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 504516 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 505499 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1375 500 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1376 517 501 msgid "Backup Now" 518 502 msgstr "" 519 503 520 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 507504 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1378 521 505 msgid "You can always create backups of your WordPress installation to use as restoration points. Select one of the methods below to create a quick backup." 522 506 msgstr "" 523 507 524 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 513508 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1384 525 509 msgid "Create a Database Backup" 526 510 msgstr "" 527 511 528 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 515512 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1386 529 513 msgid "Create a Full Backup" 530 514 msgstr "" 531 515 532 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 519516 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1390 533 517 msgid "Current Backups" 534 518 msgstr "" 535 519 536 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 521520 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1392 537 521 msgid "Below are the files stored under your backup directory. These files will be used if you choose to complete the migration." 538 522 msgstr "" 539 523 540 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 540524 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1415 541 525 msgid "Archive" 542 526 msgstr "" 543 527 544 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1541 545 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1667 528 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1416 529 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1543 530 msgid "Convert" 531 msgstr "" 532 533 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1417 534 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1544 535 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1669 546 536 msgid "Delete" 547 537 msgstr "" 548 538 549 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1543 550 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1669 539 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1419 540 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1546 541 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1671 551 542 msgid "Apply" 552 543 msgstr "" 553 544 554 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 647555 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 773545 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1523 546 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1650 556 547 msgid "No backup files found." 557 548 msgstr "" 558 549 559 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 656550 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1532 560 551 msgid "Old Backups" 561 552 msgstr "" 562 553 563 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 658554 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1534 564 555 msgid "Below are the files stored under your old backup directory. These files will not be used while completing the migration unless you unarchive them." 565 556 msgstr "" 566 557 567 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1 666558 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1542 568 559 msgid "Unarchive" 569 560 msgstr "" 570 561 571 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1822 562 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1659 563 msgid "Converted Database Backups" 564 msgstr "" 565 566 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1661 567 msgid "Below are the converted database backup files which, unlike the files listed above, can be used outside WordPress Move. You may need the converted versions of your databsae backups if the plugin fails to migrate your installation properly. These files will not be used by the plugin at any stage." 568 msgstr "" 569 570 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1769 571 msgid "No converted database backup files found. You can convert a database backup file using the Convert option from the dropdown lists above." 572 msgstr "" 573 574 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1829 572 575 msgid "Settings" 573 576 msgstr "" 574 577 575 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:182 2578 #: C:\xampp\htdocs\wp\wp-content\plugins\wordpress-move/wordpress-move.php:1829 576 579 msgid "WordPress Move" 577 580 msgstr "" -
wordpress-move/trunk/libs/functions-database-backup.php
r459287 r493292 6 6 * @date 2011-11-04 02:42:00 +02:00 7 7 */ 8 9 /** 10 * Converts the database backup to an SQL file. 11 * 12 * @param string $filename Filename of the backup file 13 * @param string $directory Directory the file is inside of (optional) 14 * @return void 15 */ 16 function wpmove_convert_db_backup( $filename ) { 17 18 if ( file_exists( $filename ) && preg_match( '/DBBackup-([0-9]*).sql/', basename( $filename ) ) ) { 19 20 // Read the whole database backup file into a variable 21 if ( $f = fopen( $filename, 'r' ) ) { 22 $serialized = fread( $f, filesize( $filename ) ); 23 fclose( $f ); 24 } else { 25 return false; 26 } 27 28 // Unserialize the queries 29 $queries = unserialize( $serialized ); 30 31 // Create an output file 32 $output = touch( trailingslashit( WPMOVE_CONVERTED_BACKUP_DIR ) . 'Converted-' . basename( $filename ) ); 33 34 // Display an error message if creating an output file fails 35 if ( ! $output ) 36 return false; 37 38 // Open the output file and write each query one by one 39 if ( $f = fopen( trailingslashit( WPMOVE_CONVERTED_BACKUP_DIR ) . 'Converted-' . basename( $filename ), 'w' ) ) { 40 foreach ( $queries as $q ) 41 fwrite( $f, $q, strlen( $q ) ); 42 fclose( $f ); 43 } else { 44 return false; 45 } 46 47 return true; 48 } 49 50 return false; 51 } 8 52 9 53 /** -
wordpress-move/trunk/libs/js/jquery.jstree.js
r426854 r493292 12 12 * $Revision: 236 $ 13 13 */ 14 15 /*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */ 16 /*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/ 17 18 "use strict"; 19 20 // top wrapper to prevent multiple inclusion (is this OK?) 21 (function () { if(jQuery && jQuery.jstree) { return; } 22 var is_ie6 = false, is_ie7 = false, is_ff2 = false; 23 24 /* 25 * jsTree core 26 */ 27 (function ($) { 28 // Common functions not related to jsTree 29 // decided to move them to a `vakata` "namespace" 30 $.vakata = {}; 31 // CSS related functions 32 $.vakata.css = { 33 get_css : function(rule_name, delete_flag, sheet) { 34 rule_name = rule_name.toLowerCase(); 35 var css_rules = sheet.cssRules || sheet.rules, 36 j = 0; 37 do { 38 if(css_rules.length && j > css_rules.length + 5) { return false; } 39 if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) { 40 if(delete_flag === true) { 41 if(sheet.removeRule) { sheet.removeRule(j); } 42 if(sheet.deleteRule) { sheet.deleteRule(j); } 43 return true; 44 } 45 else { return css_rules[j]; } 46 } 47 } 48 while (css_rules[++j]); 49 return false; 50 }, 51 add_css : function(rule_name, sheet) { 52 if($.jstree.css.get_css(rule_name, false, sheet)) { return false; } 53 if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); } 54 return $.vakata.css.get_css(rule_name); 55 }, 56 remove_css : function(rule_name, sheet) { 57 return $.vakata.css.get_css(rule_name, true, sheet); 58 }, 59 add_sheet : function(opts) { 60 var tmp = false, is_new = true; 61 if(opts.str) { 62 if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; } 63 if(tmp) { is_new = false; } 64 else { 65 tmp = document.createElement("style"); 66 tmp.setAttribute('type',"text/css"); 67 if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); } 68 } 69 if(tmp.styleSheet) { 70 if(is_new) { 71 document.getElementsByTagName("head")[0].appendChild(tmp); 72 tmp.styleSheet.cssText = opts.str; 73 } 74 else { 75 tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str; 76 } 77 } 78 else { 79 tmp.appendChild(document.createTextNode(opts.str)); 80 document.getElementsByTagName("head")[0].appendChild(tmp); 81 } 82 return tmp.sheet || tmp.styleSheet; 83 } 84 if(opts.url) { 85 if(document.createStyleSheet) { 86 try { tmp = document.createStyleSheet(opts.url); } catch (e) { } 87 } 88 else { 89 tmp = document.createElement('link'); 90 tmp.rel = 'stylesheet'; 91 tmp.type = 'text/css'; 92 tmp.media = "all"; 93 tmp.href = opts.url; 94 document.getElementsByTagName("head")[0].appendChild(tmp); 95 return tmp.styleSheet; 96 } 97 } 98 } 99 }; 100 101 // private variables 102 var instances = [], // instance array (used by $.jstree.reference/create/focused) 103 focused_instance = -1, // the index in the instance array of the currently focused instance 104 plugins = {}, // list of included plugins 105 prepared_move = {}; // for the move_node function 106 107 // jQuery plugin wrapper (thanks to jquery UI widget function) 108 $.fn.jstree = function (settings) { 109 var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node") 110 args = Array.prototype.slice.call(arguments, 1), 111 returnValue = this; 112 113 // if a method call execute the method on all selected instances 114 if(isMethodCall) { 115 if(settings.substring(0, 1) == '_') { return returnValue; } 116 this.each(function() { 117 var instance = instances[$.data(this, "jstree_instance_id")], 118 methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance; 119 if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; } 120 }); 121 } 122 else { 123 this.each(function() { 124 // extend settings and allow for multiple hashes and $.data 125 var instance_id = $.data(this, "jstree_instance_id"), 126 a = [], 127 b = settings ? $.extend({}, true, settings) : {}, 128 c = $(this), 129 s = false, 130 t = []; 131 a = a.concat(args); 132 if(c.data("jstree")) { a.push(c.data("jstree")); } 133 b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b; 134 135 // if an instance already exists, destroy it first 136 if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); } 137 // push a new empty object to the instances array 138 instance_id = parseInt(instances.push({}),10) - 1; 139 // store the jstree instance id to the container element 140 $.data(this, "jstree_instance_id", instance_id); 141 // clean up all plugins 142 b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice(); 143 b.plugins.unshift("core"); 144 // only unique plugins 145 b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(","); 146 147 // extend defaults with passed data 148 s = $.extend(true, {}, $.jstree.defaults, b); 149 s.plugins = b.plugins; 150 $.each(plugins, function (i, val) { 151 if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; } 152 else { t.push(i); } 153 }); 154 s.plugins = t; 155 156 // push the new object to the instances array (at the same time set the default classes to the container) and init 157 instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s); 158 // init all activated plugins for this instance 159 $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; }); 160 $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } }); 161 // initialize the instance 162 setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0); 163 }); 164 } 165 // return the jquery selection (or if it was a method call that returned a value - the returned value) 166 return returnValue; 167 }; 168 // object to store exposed functions and objects 169 $.jstree = { 170 defaults : { 171 plugins : [] 172 }, 173 _focused : function () { return instances[focused_instance] || null; }, 174 _reference : function (needle) { 175 // get by instance id 176 if(instances[needle]) { return instances[needle]; } 177 // get by DOM (if still no luck - return null 178 var o = $(needle); 179 if(!o.length && typeof needle === "string") { o = $("#" + needle); } 180 if(!o.length) { return null; } 181 return instances[o.closest(".jstree").data("jstree_instance_id")] || null; 182 }, 183 _instance : function (index, container, settings) { 184 // for plugins to store data in 185 this.data = { core : {} }; 186 this.get_settings = function () { return $.extend(true, {}, settings); }; 187 this._get_settings = function () { return settings; }; 188 this.get_index = function () { return index; }; 189 this.get_container = function () { return container; }; 190 this.get_container_ul = function () { return container.children("ul:eq(0)"); }; 191 this._set_settings = function (s) { 192 settings = $.extend(true, {}, settings, s); 193 }; 194 }, 195 _fn : { }, 196 plugin : function (pname, pdata) { 197 pdata = $.extend({}, { 198 __init : $.noop, 199 __destroy : $.noop, 200 _fn : {}, 201 defaults : false 202 }, pdata); 203 plugins[pname] = pdata; 204 205 $.jstree.defaults[pname] = pdata.defaults; 206 $.each(pdata._fn, function (i, val) { 207 val.plugin = pname; 208 val.old = $.jstree._fn[i]; 209 $.jstree._fn[i] = function () { 210 var rslt, 211 func = val, 212 args = Array.prototype.slice.call(arguments), 213 evnt = new $.Event("before.jstree"), 214 rlbk = false; 215 216 if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; } 217 218 // Check if function belongs to the included plugins of this instance 219 do { 220 if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; } 221 func = func.old; 222 } while(func); 223 if(!func) { return; } 224 225 // context and function to trigger events, then finally call the function 226 if(i.indexOf("_") === 0) { 227 rslt = func.apply(this, args); 228 } 229 else { 230 rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin }); 231 if(rslt === false) { return; } 232 if(typeof rslt !== "undefined") { args = rslt; } 233 234 rslt = func.apply( 235 $.extend({}, this, { 236 __callback : function (data) { 237 this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk }); 238 }, 239 __rollback : function () { 240 rlbk = this.get_rollback(); 241 return rlbk; 242 }, 243 __call_old : function (replace_arguments) { 244 return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) ); 245 } 246 }), args); 247 } 248 249 // return the result 250 return rslt; 251 }; 252 $.jstree._fn[i].old = val.old; 253 $.jstree._fn[i].plugin = pname; 254 }); 255 }, 256 rollback : function (rb) { 257 if(rb) { 258 if(!$.isArray(rb)) { rb = [ rb ]; } 259 $.each(rb, function (i, val) { 260 instances[val.i].set_rollback(val.h, val.d); 261 }); 262 } 263 } 264 }; 265 // set the prototype for all instances 266 $.jstree._fn = $.jstree._instance.prototype = {}; 267 268 // load the css when DOM is ready 269 $(function() { 270 // code is copied from jQuery ($.browser is deprecated + there is a bug in IE) 271 var u = navigator.userAgent.toLowerCase(), 272 v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], 273 css_string = '' + 274 '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' + 275 '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' + 276 '.jstree-rtl li { margin-left:0; margin-right:18px; } ' + 277 '.jstree > ul > li { margin-left:0px; } ' + 278 '.jstree-rtl > ul > li { margin-right:0px; } ' + 279 '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' + 280 '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' + 281 '.jstree a:focus { outline: none; } ' + 282 '.jstree a > ins { height:16px; width:16px; } ' + 283 '.jstree a > .jstree-icon { margin-right:3px; } ' + 284 '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' + 285 'li.jstree-open > ul { display:block; } ' + 286 'li.jstree-closed > ul { display:none; } '; 287 // Correct IE 6 (does not support the > CSS selector) 288 if(/msie/.test(u) && parseInt(v, 10) == 6) { 289 is_ie6 = true; 290 291 // fix image flicker and lack of caching 292 try { 293 document.execCommand("BackgroundImageCache", false, true); 294 } catch (err) { } 295 296 css_string += '' + 297 '.jstree li { height:18px; margin-left:0; margin-right:0; } ' + 298 '.jstree li li { margin-left:18px; } ' + 299 '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' + 300 'li.jstree-open ul { display:block; } ' + 301 'li.jstree-closed ul { display:none !important; } ' + 302 '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' + 303 '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' + 304 '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } '; 305 } 306 // Correct IE 7 (shifts anchor nodes onhover) 307 if(/msie/.test(u) && parseInt(v, 10) == 7) { 308 is_ie7 = true; 309 css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } '; 310 } 311 // correct ff2 lack of display:inline-block 312 if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) { 313 is_ff2 = true; 314 css_string += '' + 315 '.jstree ins { display:-moz-inline-box; } ' + 316 '.jstree li { line-height:12px; } ' + // WHY?? 317 '.jstree a { display:-moz-inline-box; } ' + 318 '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } '; 319 /* this shouldn't be here as it is theme specific */ 320 } 321 // the default stylesheet 322 $.vakata.css.add_sheet({ str : css_string, title : "jstree" }); 323 }); 324 325 // core functions (open, close, create, update, delete) 326 $.jstree.plugin("core", { 327 __init : function () { 328 this.data.core.locked = false; 329 this.data.core.to_open = this.get_settings().core.initially_open; 330 this.data.core.to_load = this.get_settings().core.initially_load; 331 }, 332 defaults : { 333 html_titles : false, 334 animation : 500, 335 initially_open : [], 336 initially_load : [], 337 open_parents : true, 338 notify_plugins : true, 339 rtl : false, 340 load_open : false, 341 strings : { 342 loading : "Loading ...", 343 new_node : "New node", 344 multiple_selection : "Multiple selection" 345 } 346 }, 347 _fn : { 348 init : function () { 349 this.set_focus(); 350 if(this._get_settings().core.rtl) { 351 this.get_container().addClass("jstree-rtl").css("direction", "rtl"); 352 } 353 this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins> </ins><a class='jstree-loading' href='#'><ins class='jstree-icon'> </ins>" + this._get_string("loading") + "</a></li></ul>"); 354 this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18; 355 356 this.get_container() 357 .delegate("li > ins", "click.jstree", $.proxy(function (event) { 358 var trgt = $(event.target); 359 // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); } 360 this.toggle_node(trgt); 361 }, this)) 362 .bind("mousedown.jstree", $.proxy(function () { 363 this.set_focus(); // This used to be setTimeout(set_focus,0) - why? 364 }, this)) 365 .bind("dblclick.jstree", function (event) { 366 var sel; 367 if(document.selection && document.selection.empty) { document.selection.empty(); } 368 else { 369 if(window.getSelection) { 370 sel = window.getSelection(); 371 try { 372 sel.removeAllRanges(); 373 sel.collapse(); 374 } catch (err) { } 375 } 376 } 377 }); 378 if(this._get_settings().core.notify_plugins) { 379 this.get_container() 380 .bind("load_node.jstree", $.proxy(function (e, data) { 381 var o = this._get_node(data.rslt.obj), 382 t = this; 383 if(o === -1) { o = this.get_container_ul(); } 384 if(!o.length) { return; } 385 o.find("li").each(function () { 386 var th = $(this); 387 if(th.data("jstree")) { 388 $.each(th.data("jstree"), function (plugin, values) { 389 if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) { 390 t["_" + plugin + "_notify"].call(t, th, values); 391 } 392 }); 393 } 394 }); 395 }, this)); 396 } 397 if(this._get_settings().core.load_open) { 398 this.get_container() 399 .bind("load_node.jstree", $.proxy(function (e, data) { 400 var o = this._get_node(data.rslt.obj), 401 t = this; 402 if(o === -1) { o = this.get_container_ul(); } 403 if(!o.length) { return; } 404 o.find("li.jstree-open:not(:has(ul))").each(function () { 405 t.load_node(this, $.noop, $.noop); 406 }); 407 }, this)); 408 } 409 this.__callback(); 410 this.load_node(-1, function () { this.loaded(); this.reload_nodes(); }); 411 }, 412 destroy : function () { 413 var i, 414 n = this.get_index(), 415 s = this._get_settings(), 416 _this = this; 417 418 $.each(s.plugins, function (i, val) { 419 try { plugins[val].__destroy.apply(_this); } catch(err) { } 420 }); 421 this.__callback(); 422 // set focus to another instance if this one is focused 423 if(this.is_focused()) { 424 for(i in instances) { 425 if(instances.hasOwnProperty(i) && i != n) { 426 instances[i].set_focus(); 427 break; 428 } 429 } 430 } 431 // if no other instance found 432 if(n === focused_instance) { focused_instance = -1; } 433 // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events 434 this.get_container() 435 .unbind(".jstree") 436 .undelegate(".jstree") 437 .removeData("jstree_instance_id") 438 .find("[class^='jstree']") 439 .andSelf() 440 .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); }); 441 $(document) 442 .unbind(".jstree-" + n) 443 .undelegate(".jstree-" + n); 444 // remove the actual data 445 instances[n] = null; 446 delete instances[n]; 447 }, 448 449 _core_notify : function (n, data) { 450 if(data.opened) { 451 this.open_node(n, false, true); 452 } 453 }, 454 455 lock : function () { 456 this.data.core.locked = true; 457 this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7"); 458 this.__callback({}); 459 }, 460 unlock : function () { 461 this.data.core.locked = false; 462 this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1"); 463 this.__callback({}); 464 }, 465 is_locked : function () { return this.data.core.locked; }, 466 save_opened : function () { 467 var _this = this; 468 this.data.core.to_open = []; 469 this.get_container_ul().find("li.jstree-open").each(function () { 470 if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } 471 }); 472 this.__callback(_this.data.core.to_open); 473 }, 474 save_loaded : function () { }, 475 reload_nodes : function (is_callback) { 476 var _this = this, 477 done = true, 478 current = [], 479 remaining = []; 480 if(!is_callback) { 481 this.data.core.reopen = false; 482 this.data.core.refreshing = true; 483 this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); }); 484 this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); }); 485 if(this.data.core.to_open.length) { 486 this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open); 487 } 488 } 489 if(this.data.core.to_load.length) { 490 $.each(this.data.core.to_load, function (i, val) { 491 if(val == "#") { return true; } 492 if($(val).length) { current.push(val); } 493 else { remaining.push(val); } 494 }); 495 if(current.length) { 496 this.data.core.to_load = remaining; 497 $.each(current, function (i, val) { 498 if(!_this._is_loaded(val)) { 499 _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); }); 500 done = false; 501 } 502 }); 503 } 504 } 505 if(this.data.core.to_open.length) { 506 $.each(this.data.core.to_open, function (i, val) { 507 _this.open_node(val, false, true); 508 }); 509 } 510 if(done) { 511 // TODO: find a more elegant approach to syncronizing returning requests 512 if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); } 513 this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50); 514 this.data.core.refreshing = false; 515 this.reopen(); 516 } 517 }, 518 reopen : function () { 519 var _this = this; 520 if(this.data.core.to_open.length) { 521 $.each(this.data.core.to_open, function (i, val) { 522 _this.open_node(val, false, true); 523 }); 524 } 525 this.__callback({}); 526 }, 527 refresh : function (obj) { 528 var _this = this; 529 this.save_opened(); 530 if(!obj) { obj = -1; } 531 obj = this._get_node(obj); 532 if(!obj) { obj = -1; } 533 if(obj !== -1) { obj.children("UL").remove(); } 534 else { this.get_container_ul().empty(); } 535 this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); }); 536 }, 537 // Dummy function to fire after the first load (so that there is a jstree.loaded event) 538 loaded : function () { 539 this.__callback(); 540 }, 541 // deal with focus 542 set_focus : function () { 543 if(this.is_focused()) { return; } 544 var f = $.jstree._focused(); 545 if(f) { f.unset_focus(); } 546 547 this.get_container().addClass("jstree-focused"); 548 focused_instance = this.get_index(); 549 this.__callback(); 550 }, 551 is_focused : function () { 552 return focused_instance == this.get_index(); 553 }, 554 unset_focus : function () { 555 if(this.is_focused()) { 556 this.get_container().removeClass("jstree-focused"); 557 focused_instance = -1; 558 } 559 this.__callback(); 560 }, 561 562 // traverse 563 _get_node : function (obj) { 564 var $obj = $(obj, this.get_container()); 565 if($obj.is(".jstree") || obj == -1) { return -1; } 566 $obj = $obj.closest("li", this.get_container()); 567 return $obj.length ? $obj : false; 568 }, 569 _get_next : function (obj, strict) { 570 obj = this._get_node(obj); 571 if(obj === -1) { return this.get_container().find("> ul > li:first-child"); } 572 if(!obj.length) { return false; } 573 if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; } 574 575 if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); } 576 else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); } 577 else { return obj.parentsUntil(".jstree","li").next("li").eq(0); } 578 }, 579 _get_prev : function (obj, strict) { 580 obj = this._get_node(obj); 581 if(obj === -1) { return this.get_container().find("> ul > li:last-child"); } 582 if(!obj.length) { return false; } 583 if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; } 584 585 if(obj.prev("li").length) { 586 obj = obj.prev("li").eq(0); 587 while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); } 588 return obj; 589 } 590 else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; } 591 }, 592 _get_parent : function (obj) { 593 obj = this._get_node(obj); 594 if(obj == -1 || !obj.length) { return false; } 595 var o = obj.parentsUntil(".jstree", "li:eq(0)"); 596 return o.length ? o : -1; 597 }, 598 _get_children : function (obj) { 599 obj = this._get_node(obj); 600 if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); } 601 if(!obj.length) { return false; } 602 return obj.children("ul:eq(0)").children("li"); 603 }, 604 get_path : function (obj, id_mode) { 605 var p = [], 606 _this = this; 607 obj = this._get_node(obj); 608 if(obj === -1 || !obj || !obj.length) { return false; } 609 obj.parentsUntil(".jstree", "li").each(function () { 610 p.push( id_mode ? this.id : _this.get_text(this) ); 611 }); 612 p.reverse(); 613 p.push( id_mode ? obj.attr("id") : this.get_text(obj) ); 614 return p; 615 }, 616 617 // string functions 618 _get_string : function (key) { 619 return this._get_settings().core.strings[key] || key; 620 }, 621 622 is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); }, 623 is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); }, 624 is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); }, 625 correct_state : function (obj) { 626 obj = this._get_node(obj); 627 if(!obj || obj === -1) { return false; } 628 obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove(); 629 this.__callback({ "obj" : obj }); 630 }, 631 // open/close 632 open_node : function (obj, callback, skip_animation) { 633 obj = this._get_node(obj); 634 if(!obj.length) { return false; } 635 if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; } 636 var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation, 637 t = this; 638 if(!this._is_loaded(obj)) { 639 obj.children("a").addClass("jstree-loading"); 640 this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback); 641 } 642 else { 643 if(this._get_settings().core.open_parents) { 644 obj.parentsUntil(".jstree",".jstree-closed").each(function () { 645 t.open_node(this, false, true); 646 }); 647 } 648 if(s) { obj.children("ul").css("display","none"); } 649 obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"); 650 if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); } 651 else { t.after_open(obj); } 652 this.__callback({ "obj" : obj }); 653 if(callback) { callback.call(); } 654 } 655 }, 656 after_open : function (obj) { this.__callback({ "obj" : obj }); }, 657 close_node : function (obj, skip_animation) { 658 obj = this._get_node(obj); 659 var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation, 660 t = this; 661 if(!obj.length || !obj.hasClass("jstree-open")) { return false; } 662 if(s) { obj.children("ul").attr("style","display:block !important"); } 663 obj.removeClass("jstree-open").addClass("jstree-closed"); 664 if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); } 665 else { t.after_close(obj); } 666 this.__callback({ "obj" : obj }); 667 }, 668 after_close : function (obj) { this.__callback({ "obj" : obj }); }, 669 toggle_node : function (obj) { 670 obj = this._get_node(obj); 671 if(obj.hasClass("jstree-closed")) { return this.open_node(obj); } 672 if(obj.hasClass("jstree-open")) { return this.close_node(obj); } 673 }, 674 open_all : function (obj, do_animation, original_obj) { 675 obj = obj ? this._get_node(obj) : -1; 676 if(!obj || obj === -1) { obj = this.get_container_ul(); } 677 if(original_obj) { 678 obj = obj.find("li.jstree-closed"); 679 } 680 else { 681 original_obj = obj; 682 if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); } 683 else { obj = obj.find("li.jstree-closed"); } 684 } 685 var _this = this; 686 obj.each(function () { 687 var __this = this; 688 if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); } 689 else { _this.open_node(this, false, !do_animation); } 690 }); 691 // so that callback is fired AFTER all nodes are open 692 if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); } 693 }, 694 close_all : function (obj, do_animation) { 695 var _this = this; 696 obj = obj ? this._get_node(obj) : this.get_container(); 697 if(!obj || obj === -1) { obj = this.get_container_ul(); } 698 obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); }); 699 this.__callback({ "obj" : obj }); 700 }, 701 clean_node : function (obj) { 702 obj = obj && obj != -1 ? $(obj) : this.get_container_ul(); 703 obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li"); 704 obj.removeClass("jstree-last") 705 .filter("li:last-child").addClass("jstree-last").end() 706 .filter(":has(li)") 707 .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed"); 708 obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove(); 709 this.__callback({ "obj" : obj }); 710 }, 711 // rollback 712 get_rollback : function () { 713 this.__callback(); 714 return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data }; 715 }, 716 set_rollback : function (html, data) { 717 this.get_container().empty().append(html); 718 this.data = data; 719 this.__callback(); 720 }, 721 // Dummy functions to be overwritten by any datastore plugin included 722 load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); }, 723 _is_loaded : function (obj) { return true; }, 724 725 // Basic operations: create 726 create_node : function (obj, position, js, callback, is_loaded) { 727 obj = this._get_node(obj); 728 position = typeof position === "undefined" ? "last" : position; 729 var d = $("<li />"), 730 s = this._get_settings().core, 731 tmp; 732 733 if(obj !== -1 && !obj.length) { return false; } 734 if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; } 735 736 this.__rollback(); 737 738 if(typeof js === "string") { js = { "data" : js }; } 739 if(!js) { js = {}; } 740 if(js.attr) { d.attr(js.attr); } 741 if(js.metadata) { d.data(js.metadata); } 742 if(js.state) { d.addClass("jstree-" + js.state); } 743 if(!js.data) { js.data = this._get_string("new_node"); } 744 if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); } 745 $.each(js.data, function (i, m) { 746 tmp = $("<a />"); 747 if($.isFunction(m)) { m = m.call(this, js); } 748 if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); } 749 else { 750 if(!m.attr) { m.attr = {}; } 751 if(!m.attr.href) { m.attr.href = '#'; } 752 tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title); 753 if(m.language) { tmp.addClass(m.language); } 754 } 755 tmp.prepend("<ins class='jstree-icon'> </ins>"); 756 if(!m.icon && js.icon) { m.icon = js.icon; } 757 if(m.icon) { 758 if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); } 759 else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); } 760 } 761 d.append(tmp); 762 }); 763 d.prepend("<ins class='jstree-icon'> </ins>"); 764 if(obj === -1) { 765 obj = this.get_container(); 766 if(position === "before") { position = "first"; } 767 if(position === "after") { position = "last"; } 768 } 769 switch(position) { 770 case "before": obj.before(d); tmp = this._get_parent(obj); break; 771 case "after" : obj.after(d); tmp = this._get_parent(obj); break; 772 case "inside": 773 case "first" : 774 if(!obj.children("ul").length) { obj.append("<ul />"); } 775 obj.children("ul").prepend(d); 776 tmp = obj; 777 break; 778 case "last": 779 if(!obj.children("ul").length) { obj.append("<ul />"); } 780 obj.children("ul").append(d); 781 tmp = obj; 782 break; 783 default: 784 if(!obj.children("ul").length) { obj.append("<ul />"); } 785 if(!position) { position = 0; } 786 tmp = obj.children("ul").children("li").eq(position); 787 if(tmp.length) { tmp.before(d); } 788 else { obj.children("ul").append(d); } 789 tmp = obj; 790 break; 791 } 792 if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; } 793 this.clean_node(tmp); 794 this.__callback({ "obj" : d, "parent" : tmp }); 795 if(callback) { callback.call(this, d); } 796 return d; 797 }, 798 // Basic operations: rename (deal with text) 799 get_text : function (obj) { 800 obj = this._get_node(obj); 801 if(!obj.length) { return false; } 802 var s = this._get_settings().core.html_titles; 803 obj = obj.children("a:eq(0)"); 804 if(s) { 805 obj = obj.clone(); 806 obj.children("INS").remove(); 807 return obj.html(); 808 } 809 else { 810 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0]; 811 return obj.nodeValue; 812 } 813 }, 814 set_text : function (obj, val) { 815 obj = this._get_node(obj); 816 if(!obj.length) { return false; } 817 obj = obj.children("a:eq(0)"); 818 if(this._get_settings().core.html_titles) { 819 var tmp = obj.children("INS").clone(); 820 obj.html(val).prepend(tmp); 821 this.__callback({ "obj" : obj, "name" : val }); 822 return true; 823 } 824 else { 825 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0]; 826 this.__callback({ "obj" : obj, "name" : val }); 827 return (obj.nodeValue = val); 828 } 829 }, 830 rename_node : function (obj, val) { 831 obj = this._get_node(obj); 832 this.__rollback(); 833 if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); } 834 }, 835 // Basic operations: deleting nodes 836 delete_node : function (obj) { 837 obj = this._get_node(obj); 838 if(!obj.length) { return false; } 839 this.__rollback(); 840 var p = this._get_parent(obj), prev = $([]), t = this; 841 obj.each(function () { 842 prev = prev.add(t._get_prev(this)); 843 }); 844 obj = obj.detach(); 845 if(p !== -1 && p.find("> ul > li").length === 0) { 846 p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"); 847 } 848 this.clean_node(p); 849 this.__callback({ "obj" : obj, "prev" : prev, "parent" : p }); 850 return obj; 851 }, 852 prepare_move : function (o, r, pos, cb, is_cb) { 853 var p = {}; 854 855 p.ot = $.jstree._reference(o) || this; 856 p.o = p.ot._get_node(o); 857 p.r = r === - 1 ? -1 : this._get_node(r); 858 p.p = (typeof pos === "undefined" || pos === false) ? "last" : pos; // TODO: move to a setting 859 if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) { 860 this.__callback(prepared_move); 861 if(cb) { cb.call(this, prepared_move); } 862 return; 863 } 864 p.ot = $.jstree._reference(p.o) || this; 865 p.rt = $.jstree._reference(p.r) || this; // r === -1 ? p.ot : $.jstree._reference(p.r) || this 866 if(p.r === -1 || !p.r) { 867 p.cr = -1; 868 switch(p.p) { 869 case "first": 870 case "before": 871 case "inside": 872 p.cp = 0; 873 break; 874 case "after": 875 case "last": 876 p.cp = p.rt.get_container().find(" > ul > li").length; 877 break; 878 default: 879 p.cp = p.p; 880 break; 881 } 882 } 883 else { 884 if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) { 885 return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); }); 886 } 887 switch(p.p) { 888 case "before": 889 p.cp = p.r.index(); 890 p.cr = p.rt._get_parent(p.r); 891 break; 892 case "after": 893 p.cp = p.r.index() + 1; 894 p.cr = p.rt._get_parent(p.r); 895 break; 896 case "inside": 897 case "first": 898 p.cp = 0; 899 p.cr = p.r; 900 break; 901 case "last": 902 p.cp = p.r.find(" > ul > li").length; 903 p.cr = p.r; 904 break; 905 default: 906 p.cp = p.p; 907 p.cr = p.r; 908 break; 909 } 910 } 911 p.np = p.cr == -1 ? p.rt.get_container() : p.cr; 912 p.op = p.ot._get_parent(p.o); 913 p.cop = p.o.index(); 914 if(p.op === -1) { p.op = p.ot ? p.ot.get_container() : this.get_container(); } 915 if(!/^(before|after)$/.test(p.p) && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp++; } 916 //if(p.p === "before" && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp--; } 917 p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")"); 918 prepared_move = p; 919 this.__callback(prepared_move); 920 if(cb) { cb.call(this, prepared_move); } 921 }, 922 check_move : function () { 923 var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r; 924 if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; } 925 if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; } 926 obj.o.each(function () { 927 if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; } 928 }); 929 return ret; 930 }, 931 move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) { 932 if(!is_prepared) { 933 return this.prepare_move(obj, ref, position, function (p) { 934 this.move_node(p, false, false, is_copy, true, skip_check); 935 }); 936 } 937 if(is_copy) { 938 prepared_move.cy = true; 939 } 940 if(!skip_check && !this.check_move()) { return false; } 941 942 this.__rollback(); 943 var o = false; 944 if(is_copy) { 945 o = obj.o.clone(true); 946 o.find("*[id]").andSelf().each(function () { 947 if(this.id) { this.id = "copy_" + this.id; } 948 }); 949 } 950 else { o = obj.o; } 951 952 if(obj.or.length) { obj.or.before(o); } 953 else { 954 if(!obj.np.children("ul").length) { $("<ul />").appendTo(obj.np); } 955 obj.np.children("ul:eq(0)").append(o); 956 } 957 958 try { 959 obj.ot.clean_node(obj.op); 960 obj.rt.clean_node(obj.np); 961 if(!obj.op.find("> ul > li").length) { 962 obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove(); 963 } 964 } catch (e) { } 965 966 if(is_copy) { 967 prepared_move.cy = true; 968 prepared_move.oc = o; 969 } 970 this.__callback(prepared_move); 971 return prepared_move; 972 }, 973 _get_move : function () { return prepared_move; } 974 } 975 }); 976 })(jQuery); 977 //*/ 978 979 /* 980 * jsTree themes plugin 981 * Handles loading and setting themes, as well as detecting path to themes, etc. 982 */ 983 (function ($) { 984 var themes_loaded = []; 985 // this variable stores the path to the themes folder - if left as false - it will be autodetected 986 $.jstree._themes = false; 987 $.jstree.plugin("themes", { 988 __init : function () { 989 this.get_container() 990 .bind("init.jstree", $.proxy(function () { 991 var s = this._get_settings().themes; 992 this.data.themes.dots = s.dots; 993 this.data.themes.icons = s.icons; 994 this.set_theme(s.theme, s.url); 995 }, this)) 996 .bind("loaded.jstree", $.proxy(function () { 997 // bound here too, as simple HTML tree's won't honor dots & icons otherwise 998 if(!this.data.themes.dots) { this.hide_dots(); } 999 else { this.show_dots(); } 1000 if(!this.data.themes.icons) { this.hide_icons(); } 1001 else { this.show_icons(); } 1002 }, this)); 1003 }, 1004 defaults : { 1005 theme : "default", 1006 url : false, 1007 dots : true, 1008 icons : true 1009 }, 1010 _fn : { 1011 set_theme : function (theme_name, theme_url) { 1012 if(!theme_name) { return false; } 1013 if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; } 1014 if($.inArray(theme_url, themes_loaded) == -1) { 1015 $.vakata.css.add_sheet({ "url" : theme_url }); 1016 themes_loaded.push(theme_url); 1017 } 1018 if(this.data.themes.theme != theme_name) { 1019 this.get_container().removeClass('jstree-' + this.data.themes.theme); 1020 this.data.themes.theme = theme_name; 1021 } 1022 this.get_container().addClass('jstree-' + theme_name); 1023 if(!this.data.themes.dots) { this.hide_dots(); } 1024 else { this.show_dots(); } 1025 if(!this.data.themes.icons) { this.hide_icons(); } 1026 else { this.show_icons(); } 1027 this.__callback(); 1028 }, 1029 get_theme : function () { return this.data.themes.theme; }, 1030 1031 show_dots : function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); }, 1032 hide_dots : function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); }, 1033 toggle_dots : function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } }, 1034 1035 show_icons : function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); }, 1036 hide_icons : function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); }, 1037 toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } } 1038 } 1039 }); 1040 // autodetect themes path 1041 $(function () { 1042 if($.jstree._themes === false) { 1043 $("script").each(function () { 1044 if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) { 1045 $.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/'; 1046 return false; 1047 } 1048 }); 1049 } 1050 if($.jstree._themes === false) { $.jstree._themes = "themes/"; } 1051 }); 1052 // include the themes plugin by default 1053 $.jstree.defaults.plugins.push("themes"); 1054 })(jQuery); 1055 //*/ 1056 1057 /* 1058 * jsTree checkbox plugin 1059 * Inserts checkboxes in front of every node 1060 * Depends on the ui plugin 1061 * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP 1062 */ 1063 (function ($) { 1064 $.jstree.plugin("checkbox", { 1065 __init : function () { 1066 this.data.checkbox.noui = this._get_settings().checkbox.override_ui; 1067 if(this.data.ui && this.data.checkbox.noui) { 1068 this.select_node = this.deselect_node = this.deselect_all = $.noop; 1069 this.get_selected = this.get_checked; 1070 } 1071 1072 this.get_container() 1073 .bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree", $.proxy(function (e, data) { 1074 this._prepare_checkboxes(data.rslt.obj); 1075 }, this)) 1076 .bind("loaded.jstree", $.proxy(function (e) { 1077 this._prepare_checkboxes(); 1078 }, this)) 1079 .delegate( (this.data.ui && this.data.checkbox.noui ? "a" : "ins.jstree-checkbox") , "click.jstree", $.proxy(function (e) { 1080 e.preventDefault(); 1081 if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); } 1082 else { this.check_node(e.target); } 1083 if(this.data.ui && this.data.checkbox.noui) { 1084 this.save_selected(); 1085 if(this.data.cookies) { this.save_cookie("select_node"); } 1086 } 1087 else { 1088 e.stopImmediatePropagation(); 1089 return false; 1090 } 1091 }, this)); 1092 }, 1093 defaults : { 1094 override_ui : false, 1095 two_state : false, 1096 real_checkboxes : false, 1097 checked_parent_open : true, 1098 real_checkboxes_names : function (n) { return [ ("check_" + (n[0].id || Math.ceil(Math.random() * 10000))) , 1]; } 1099 }, 1100 __destroy : function () { 1101 this.get_container() 1102 .find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end() 1103 .find("ins.jstree-checkbox").remove(); 1104 }, 1105 _fn : { 1106 _checkbox_notify : function (n, data) { 1107 if(data.checked) { 1108 this.check_node(n, false); 1109 } 1110 }, 1111 _prepare_checkboxes : function (obj) { 1112 obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj); 1113 if(obj === false) { return; } // added for removing root nodes 1114 var c, _this = this, t, ts = this._get_settings().checkbox.two_state, rc = this._get_settings().checkbox.real_checkboxes, rcn = this._get_settings().checkbox.real_checkboxes_names; 1115 obj.each(function () { 1116 t = $(this); 1117 c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked"; 1118 t.find("li").andSelf().each(function () { 1119 var $t = $(this), nm; 1120 $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c ); 1121 if(rc) { 1122 if(!$t.children(":checkbox").length) { 1123 nm = rcn.call(_this, $t); 1124 $t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='" + nm[0] + "' name='" + nm[0] + "' value='" + nm[1] + "' />"); 1125 } 1126 else { 1127 $t.children(":checkbox").addClass("jstree-real-checkbox"); 1128 } 1129 } 1130 if(!ts) { 1131 if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) { 1132 $t.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked", true); 1133 } 1134 } 1135 else { 1136 if($t.hasClass("jstree-checked") || $t.children(':checked').length) { 1137 $t.addClass("jstree-checked").children(":checkbox").prop("checked", true); 1138 } 1139 } 1140 }); 1141 }); 1142 if(!ts) { 1143 obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); }); 1144 } 1145 }, 1146 change_state : function (obj, state) { 1147 obj = this._get_node(obj); 1148 var coll = false, rc = this._get_settings().checkbox.real_checkboxes; 1149 if(!obj || obj === -1) { return false; } 1150 state = (state === false || state === true) ? state : obj.hasClass("jstree-checked"); 1151 if(this._get_settings().checkbox.two_state) { 1152 if(state) { 1153 obj.removeClass("jstree-checked").addClass("jstree-unchecked"); 1154 if(rc) { obj.children(":checkbox").prop("checked", false); } 1155 } 1156 else { 1157 obj.removeClass("jstree-unchecked").addClass("jstree-checked"); 1158 if(rc) { obj.children(":checkbox").prop("checked", true); } 1159 } 1160 } 1161 else { 1162 if(state) { 1163 coll = obj.find("li").andSelf(); 1164 if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; } 1165 coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"); 1166 if(rc) { coll.children(":checkbox").prop("checked", false); } 1167 } 1168 else { 1169 coll = obj.find("li").andSelf(); 1170 if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; } 1171 coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"); 1172 if(rc) { coll.children(":checkbox").prop("checked", true); } 1173 if(this.data.ui) { this.data.ui.last_selected = obj; } 1174 this.data.checkbox.last_selected = obj; 1175 } 1176 obj.parentsUntil(".jstree", "li").each(function () { 1177 var $this = $(this); 1178 if(state) { 1179 if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) { 1180 $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); 1181 if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); } 1182 return false; 1183 } 1184 else { 1185 $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"); 1186 if(rc) { $this.children(":checkbox").prop("checked", false); } 1187 } 1188 } 1189 else { 1190 if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) { 1191 $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); 1192 if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); } 1193 return false; 1194 } 1195 else { 1196 $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"); 1197 if(rc) { $this.children(":checkbox").prop("checked", true); } 1198 } 1199 } 1200 }); 1201 } 1202 if(this.data.ui && this.data.checkbox.noui) { this.data.ui.selected = this.get_checked(); } 1203 this.__callback(obj); 1204 return true; 1205 }, 1206 check_node : function (obj) { 1207 if(this.change_state(obj, false)) { 1208 obj = this._get_node(obj); 1209 if(this._get_settings().checkbox.checked_parent_open) { 1210 var t = this; 1211 obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); }); 1212 } 1213 this.__callback({ "obj" : obj }); 1214 } 1215 }, 1216 uncheck_node : function (obj) { 1217 if(this.change_state(obj, true)) { this.__callback({ "obj" : this._get_node(obj) }); } 1218 }, 1219 check_all : function () { 1220 var _this = this, 1221 coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li"); 1222 coll.each(function () { 1223 _this.change_state(this, false); 1224 }); 1225 this.__callback(); 1226 }, 1227 uncheck_all : function () { 1228 var _this = this, 1229 coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li"); 1230 coll.each(function () { 1231 _this.change_state(this, true); 1232 }); 1233 this.__callback(); 1234 }, 1235 1236 is_checked : function(obj) { 1237 obj = this._get_node(obj); 1238 return obj.length ? obj.is(".jstree-checked") : false; 1239 }, 1240 get_checked : function (obj, get_all) { 1241 obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj); 1242 return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-checked") : obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked"); 1243 }, 1244 get_unchecked : function (obj, get_all) { 1245 obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj); 1246 return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-unchecked") : obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked"); 1247 }, 1248 1249 show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); }, 1250 hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); }, 1251 1252 _repair_state : function (obj) { 1253 obj = this._get_node(obj); 1254 if(!obj.length) { return; } 1255 if(this._get_settings().checkbox.two_state) { 1256 obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true); 1257 return; 1258 } 1259 var rc = this._get_settings().checkbox.real_checkboxes, 1260 a = obj.find("> ul > .jstree-checked").length, 1261 b = obj.find("> ul > .jstree-undetermined").length, 1262 c = obj.find("> ul > li").length; 1263 if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.change_state(obj, false); } } 1264 else if(a === 0 && b === 0) { this.change_state(obj, true); } 1265 else if(a === c) { this.change_state(obj, false); } 1266 else { 1267 obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); 1268 if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); } 1269 } 1270 }, 1271 reselect : function () { 1272 if(this.data.ui && this.data.checkbox.noui) { 1273 var _this = this, 1274 s = this.data.ui.to_select; 1275 s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); }); 1276 this.deselect_all(); 1277 $.each(s, function (i, val) { _this.check_node(val); }); 1278 this.__callback(); 1279 } 1280 else { 1281 this.__call_old(); 1282 } 1283 }, 1284 save_loaded : function () { 1285 var _this = this; 1286 this.data.core.to_load = []; 1287 this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function () { 1288 if(this.id) { _this.data.core.to_load.push("#" + this.id); } 1289 }); 1290 } 1291 } 1292 }); 1293 $(function() { 1294 var css_string = '.jstree .jstree-real-checkbox { display:none; } '; 1295 $.vakata.css.add_sheet({ str : css_string, title : "jstree" }); 1296 }); 1297 })(jQuery); 1298 //*/ 1299 1300 /* 1301 * jsTree types plugin 1302 * Adds support types of nodes 1303 * You can set an attribute on each li node, that represents its type. 1304 * According to the type setting the node may get custom icon/validation rules 1305 */ 1306 (function ($) { 1307 $.jstree.plugin("types", { 1308 __init : function () { 1309 var s = this._get_settings().types; 1310 this.data.types.attach_to = []; 1311 this.get_container() 1312 .bind("init.jstree", $.proxy(function () { 1313 var types = s.types, 1314 attr = s.type_attr, 1315 icons_css = "", 1316 _this = this; 1317 1318 $.each(types, function (i, tp) { 1319 $.each(tp, function (k, v) { 1320 if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); } 1321 }); 1322 if(!tp.icon) { return true; } 1323 if( tp.icon.image || tp.icon.position) { 1324 if(i == "default") { icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; } 1325 else { icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '="' + i + '"] > a > .jstree-icon { '; } 1326 if(tp.icon.image) { icons_css += ' background-image:url(' + tp.icon.image + '); '; } 1327 if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; } 1328 else { icons_css += ' background-position:0 0; '; } 1329 icons_css += '} '; 1330 } 1331 }); 1332 if(icons_css !== "") { $.vakata.css.add_sheet({ 'str' : icons_css, title : "jstree-types" }); } 1333 }, this)) 1334 .bind("before.jstree", $.proxy(function (e, data) { 1335 var s, t, 1336 o = this._get_settings().types.use_data ? this._get_node(data.args[0]) : false, 1337 d = o && o !== -1 && o.length ? o.data("jstree") : false; 1338 if(d && d.types && d.types[data.func] === false) { e.stopImmediatePropagation(); return false; } 1339 if($.inArray(data.func, this.data.types.attach_to) !== -1) { 1340 if(!data.args[0] || (!data.args[0].tagName && !data.args[0].jquery)) { return; } 1341 s = this._get_settings().types.types; 1342 t = this._get_type(data.args[0]); 1343 if( 1344 ( 1345 (s[t] && typeof s[t][data.func] !== "undefined") || 1346 (s["default"] && typeof s["default"][data.func] !== "undefined") 1347 ) && this._check(data.func, data.args[0]) === false 1348 ) { 1349 e.stopImmediatePropagation(); 1350 return false; 1351 } 1352 } 1353 }, this)); 1354 if(is_ie6) { 1355 this.get_container() 1356 .bind("load_node.jstree set_type.jstree", $.proxy(function (e, data) { 1357 var r = data && data.rslt && data.rslt.obj && data.rslt.obj !== -1 ? this._get_node(data.rslt.obj).parent() : this.get_container_ul(), 1358 c = false, 1359 s = this._get_settings().types; 1360 $.each(s.types, function (i, tp) { 1361 if(tp.icon && (tp.icon.image || tp.icon.position)) { 1362 c = i === "default" ? r.find("li > a > .jstree-icon") : r.find("li[" + s.type_attr + "='" + i + "'] > a > .jstree-icon"); 1363 if(tp.icon.image) { c.css("backgroundImage","url(" + tp.icon.image + ")"); } 1364 c.css("backgroundPosition", tp.icon.position || "0 0"); 1365 } 1366 }); 1367 }, this)); 1368 } 1369 }, 1370 defaults : { 1371 // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking) 1372 max_children : -1, 1373 // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking) 1374 max_depth : -1, 1375 // defines valid node types for the root nodes 1376 valid_children : "all", 1377 1378 // whether to use $.data 1379 use_data : false, 1380 // where is the type stores (the rel attribute of the LI element) 1381 type_attr : "rel", 1382 // a list of types 1383 types : { 1384 // the default type 1385 "default" : { 1386 "max_children" : -1, 1387 "max_depth" : -1, 1388 "valid_children": "all" 1389 1390 // Bound functions - you can bind any other function here (using boolean or function) 1391 //"select_node" : true 1392 } 1393 } 1394 }, 1395 _fn : { 1396 _types_notify : function (n, data) { 1397 if(data.type && this._get_settings().types.use_data) { 1398 this.set_type(data.type, n); 1399 } 1400 }, 1401 _get_type : function (obj) { 1402 obj = this._get_node(obj); 1403 return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default"; 1404 }, 1405 set_type : function (str, obj) { 1406 obj = this._get_node(obj); 1407 var ret = (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str); 1408 if(ret) { this.__callback({ obj : obj, type : str}); } 1409 return ret; 1410 }, 1411 _check : function (rule, obj, opts) { 1412 obj = this._get_node(obj); 1413 var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types, data = false; 1414 if(obj === -1) { 1415 if(!!s[rule]) { v = s[rule]; } 1416 else { return; } 1417 } 1418 else { 1419 if(t === false) { return; } 1420 data = s.use_data ? obj.data("jstree") : false; 1421 if(data && data.types && typeof data.types[rule] !== "undefined") { v = data.types[rule]; } 1422 else if(!!s.types[t] && typeof s.types[t][rule] !== "undefined") { v = s.types[t][rule]; } 1423 else if(!!s.types["default"] && typeof s.types["default"][rule] !== "undefined") { v = s.types["default"][rule]; } 1424 } 1425 if($.isFunction(v)) { v = v.call(this, obj); } 1426 if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) { 1427 // also include the node itself - otherwise if root node it is not checked 1428 obj.children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) { 1429 // check if current depth already exceeds global tree depth 1430 if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; } 1431 d = (i === 0) ? v : _this._check(rule, this, false); 1432 // check if current node max depth is already matched or exceeded 1433 if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; } 1434 // otherwise - set the max depth to the current value minus current depth 1435 if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); } 1436 // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited 1437 if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); } 1438 }); 1439 } 1440 return v; 1441 }, 1442 check_move : function () { 1443 if(!this.__call_old()) { return false; } 1444 var m = this._get_move(), 1445 s = m.rt._get_settings().types, 1446 mc = m.rt._check("max_children", m.cr), 1447 md = m.rt._check("max_depth", m.cr), 1448 vc = m.rt._check("valid_children", m.cr), 1449 ch = 0, d = 1, t; 1450 1451 if(vc === "none") { return false; } 1452 if($.isArray(vc) && m.ot && m.ot._get_type) { 1453 m.o.each(function () { 1454 if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; } 1455 }); 1456 if(d === false) { return false; } 1457 } 1458 if(s.max_children !== -2 && mc !== -1) { 1459 ch = m.cr === -1 ? this.get_container().find("> ul > li").not(m.o).length : m.cr.find("> ul > li").not(m.o).length; 1460 if(ch + m.o.length > mc) { return false; } 1461 } 1462 if(s.max_depth !== -2 && md !== -1) { 1463 d = 0; 1464 if(md === 0) { return false; } 1465 if(typeof m.o.d === "undefined") { 1466 // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node) 1467 t = m.o; 1468 while(t.length > 0) { 1469 t = t.find("> ul > li"); 1470 d ++; 1471 } 1472 m.o.d = d; 1473 } 1474 if(md - m.o.d < 0) { return false; } 1475 } 1476 return true; 1477 }, 1478 create_node : function (obj, position, js, callback, is_loaded, skip_check) { 1479 if(!skip_check && (is_loaded || this._is_loaded(obj))) { 1480 var p = (typeof position == "string" && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj), 1481 s = this._get_settings().types, 1482 mc = this._check("max_children", p), 1483 md = this._check("max_depth", p), 1484 vc = this._check("valid_children", p), 1485 ch; 1486 if(typeof js === "string") { js = { data : js }; } 1487 if(!js) { js = {}; } 1488 if(vc === "none") { return false; } 1489 if($.isArray(vc)) { 1490 if(!js.attr || !js.attr[s.type_attr]) { 1491 if(!js.attr) { js.attr = {}; } 1492 js.attr[s.type_attr] = vc[0]; 1493 } 1494 else { 1495 if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; } 1496 } 1497 } 1498 if(s.max_children !== -2 && mc !== -1) { 1499 ch = p === -1 ? this.get_container().find("> ul > li").length : p.find("> ul > li").length; 1500 if(ch + 1 > mc) { return false; } 1501 } 1502 if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; } 1503 } 1504 return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check); 1505 } 1506 } 1507 }); 1508 })(jQuery); 1509 //*/ 1510 1511 /* 1512 * jsTree HTML plugin 1513 * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions. 1514 */ 1515 (function ($) { 1516 $.jstree.plugin("html_data", { 1517 __init : function () { 1518 // this used to use html() and clean the whitespace, but this way any attached data was lost 1519 this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true); 1520 // remove white space from LI node - otherwise nodes appear a bit to the right 1521 this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove(); 1522 }, 1523 defaults : { 1524 data : false, 1525 ajax : false, 1526 correct_state : true 1527 }, 1528 _fn : { 1529 load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); }, 1530 _is_loaded : function (obj) { 1531 obj = this._get_node(obj); 1532 return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0; 1533 }, 1534 load_node_html : function (obj, s_call, e_call) { 1535 var d, 1536 s = this.get_settings().html_data, 1537 error_func = function () {}, 1538 success_func = function () {}; 1539 obj = this._get_node(obj); 1540 if(obj && obj !== -1) { 1541 if(obj.data("jstree_is_loading")) { return; } 1542 else { obj.data("jstree_is_loading",true); } 1543 } 1544 switch(!0) { 1545 case ($.isFunction(s.data)): 1546 s.data.call(this, obj, $.proxy(function (d) { 1547 if(d && d !== "" && d.toString && d.toString().replace(/^[\s\n]+$/,"") !== "") { 1548 d = $(d); 1549 if(!d.is("ul")) { d = $("<ul />").append(d); } 1550 if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); } 1551 else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); } 1552 this.clean_node(obj); 1553 if(s_call) { s_call.call(this); } 1554 } 1555 else { 1556 if(obj && obj !== -1) { 1557 obj.children("a.jstree-loading").removeClass("jstree-loading"); 1558 obj.removeData("jstree_is_loading"); 1559 if(s.correct_state) { 1560 this.correct_state(obj); 1561 if(s_call) { s_call.call(this); } 1562 } 1563 } 1564 else { 1565 if(s.correct_state) { 1566 this.get_container().children("ul").empty(); 1567 if(s_call) { s_call.call(this); } 1568 } 1569 } 1570 } 1571 }, this)); 1572 break; 1573 case (!s.data && !s.ajax): 1574 if(!obj || obj == -1) { 1575 this.get_container() 1576 .children("ul").empty() 1577 .append(this.data.html_data.original_container_html) 1578 .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end() 1579 .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); 1580 this.clean_node(); 1581 } 1582 if(s_call) { s_call.call(this); } 1583 break; 1584 case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)): 1585 if(!obj || obj == -1) { 1586 d = $(s.data); 1587 if(!d.is("ul")) { d = $("<ul />").append(d); } 1588 this.get_container() 1589 .children("ul").empty().append(d.children()) 1590 .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end() 1591 .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); 1592 this.clean_node(); 1593 } 1594 if(s_call) { s_call.call(this); } 1595 break; 1596 case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1): 1597 obj = this._get_node(obj); 1598 error_func = function (x, t, e) { 1599 var ef = this.get_settings().html_data.ajax.error; 1600 if(ef) { ef.call(this, x, t, e); } 1601 if(obj != -1 && obj.length) { 1602 obj.children("a.jstree-loading").removeClass("jstree-loading"); 1603 obj.removeData("jstree_is_loading"); 1604 if(t === "success" && s.correct_state) { this.correct_state(obj); } 1605 } 1606 else { 1607 if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); } 1608 } 1609 if(e_call) { e_call.call(this); } 1610 }; 1611 success_func = function (d, t, x) { 1612 var sf = this.get_settings().html_data.ajax.success; 1613 if(sf) { d = sf.call(this,d,t,x) || d; } 1614 if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) { 1615 return error_func.call(this, x, t, ""); 1616 } 1617 if(d) { 1618 d = $(d); 1619 if(!d.is("ul")) { d = $("<ul />").append(d); } 1620 if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); } 1621 else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); } 1622 this.clean_node(obj); 1623 if(s_call) { s_call.call(this); } 1624 } 1625 else { 1626 if(obj && obj !== -1) { 1627 obj.children("a.jstree-loading").removeClass("jstree-loading"); 1628 obj.removeData("jstree_is_loading"); 1629 if(s.correct_state) { 1630 this.correct_state(obj); 1631 if(s_call) { s_call.call(this); } 1632 } 1633 } 1634 else { 1635 if(s.correct_state) { 1636 this.get_container().children("ul").empty(); 1637 if(s_call) { s_call.call(this); } 1638 } 1639 } 1640 } 1641 }; 1642 s.ajax.context = this; 1643 s.ajax.error = error_func; 1644 s.ajax.success = success_func; 1645 if(!s.ajax.dataType) { s.ajax.dataType = "html"; } 1646 if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); } 1647 if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); } 1648 $.ajax(s.ajax); 1649 break; 1650 } 1651 } 1652 } 1653 }); 1654 // include the HTML data plugin by default 1655 $.jstree.defaults.plugins.push("html_data"); 1656 })(jQuery); 1657 //*/ 1658 1659 })(); 14 "use strict";(function(){if(jQuery&&jQuery.jstree){return}var c=false,b=false,a=false;(function(g){g.vakata={};g.vakata.css={get_css:function(n,k,l){n=n.toLowerCase();var m=l.cssRules||l.rules,i=0;do{if(m.length&&i>m.length+5){return false}if(m[i].selectorText&&m[i].selectorText.toLowerCase()==n){if(k===true){if(l.removeRule){l.removeRule(i)}if(l.deleteRule){l.deleteRule(i)}return true}else{return m[i]}}}while(m[++i]);return false},add_css:function(j,i){if(g.jstree.css.get_css(j,false,i)){return false}if(i.insertRule){i.insertRule(j+" { }",0)}else{i.addRule(j,null,0)}return g.vakata.css.get_css(j)},remove_css:function(j,i){return g.vakata.css.get_css(j,true,i)},add_sheet:function(j){var i=false,l=true;if(j.str){if(j.title){i=g("style[id='"+j.title+"-stylesheet']")[0]}if(i){l=false}else{i=document.createElement("style");i.setAttribute("type","text/css");if(j.title){i.setAttribute("id",j.title+"-stylesheet")}}if(i.styleSheet){if(l){document.getElementsByTagName("head")[0].appendChild(i);i.styleSheet.cssText=j.str}else{i.styleSheet.cssText=i.styleSheet.cssText+" "+j.str}}else{i.appendChild(document.createTextNode(j.str));document.getElementsByTagName("head")[0].appendChild(i)}return i.sheet||i.styleSheet}if(j.url){if(document.createStyleSheet){try{i=document.createStyleSheet(j.url)}catch(k){}}else{i=document.createElement("link");i.rel="stylesheet";i.type="text/css";i.media="all";i.href=j.url;document.getElementsByTagName("head")[0].appendChild(i);return i.styleSheet}}}};var h=[],f=-1,e={},d={};g.fn.jstree=function(l){var i=(typeof l=="string"),j=Array.prototype.slice.call(arguments,1),k=this;if(i){if(l.substring(0,1)=="_"){return k}this.each(function(){var m=h[g.data(this,"jstree_instance_id")],n=(m&&g.isFunction(m[l]))?m[l].apply(m,j):m;if(typeof n!=="undefined"&&(l.indexOf("is_")===0||(n!==true&&n!==false))){k=n;return false}})}else{this.each(function(){var q=g.data(this,"jstree_instance_id"),n=[],m=l?g.extend({},true,l):{},r=g(this),p=false,o=[];n=n.concat(j);if(r.data("jstree")){n.push(r.data("jstree"))}m=n.length?g.extend.apply(null,[true,m].concat(n)):m;if(typeof q!=="undefined"&&h[q]){h[q].destroy()}q=parseInt(h.push({}),10)-1;g.data(this,"jstree_instance_id",q);m.plugins=g.isArray(m.plugins)?m.plugins:g.jstree.defaults.plugins.slice();m.plugins.unshift("core");m.plugins=m.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");p=g.extend(true,{},g.jstree.defaults,m);p.plugins=m.plugins;g.each(e,function(s,t){if(g.inArray(s,p.plugins)===-1){p[s]=null;delete p[s]}else{o.push(s)}});p.plugins=o;h[q]=new g.jstree._instance(q,g(this).addClass("jstree jstree-"+q),p);g.each(h[q]._get_settings().plugins,function(s,t){h[q].data[t]={}});g.each(h[q]._get_settings().plugins,function(s,t){if(e[t]){e[t].__init.apply(h[q])}});setTimeout(function(){if(h[q]){h[q].init()}},0)})}return k};g.jstree={defaults:{plugins:[]},_focused:function(){return h[f]||null},_reference:function(i){if(h[i]){return h[i]}var j=g(i);if(!j.length&&typeof i==="string"){j=g("#"+i)}if(!j.length){return null}return h[j.closest(".jstree").data("jstree_instance_id")]||null},_instance:function(j,i,k){this.data={core:{}};this.get_settings=function(){return g.extend(true,{},k)};this._get_settings=function(){return k};this.get_index=function(){return j};this.get_container=function(){return i};this.get_container_ul=function(){return i.children("ul:eq(0)")};this._set_settings=function(l){k=g.extend(true,{},k,l)}},_fn:{},plugin:function(i,j){j=g.extend({},{__init:g.noop,__destroy:g.noop,_fn:{},defaults:false},j);e[i]=j;g.jstree.defaults[i]=j.defaults;g.each(j._fn,function(k,l){l.plugin=i;l.old=g.jstree._fn[k];g.jstree._fn[k]=function(){var m,o=l,n=Array.prototype.slice.call(arguments),q=new g.Event("before.jstree"),p=false;if(this.data.core.locked===true&&k!=="unlock"&&k!=="is_locked"){return}do{if(o&&o.plugin&&g.inArray(o.plugin,this._get_settings().plugins)!==-1){break}o=o.old}while(o);if(!o){return}if(k.indexOf("_")===0){m=o.apply(this,n)}else{m=this.get_container().triggerHandler(q,{func:k,inst:this,args:n,plugin:o.plugin});if(m===false){return}if(typeof m!=="undefined"){n=m}m=o.apply(g.extend({},this,{__callback:function(r){this.get_container().triggerHandler(k+".jstree",{inst:this,args:n,rslt:r,rlbk:p})},__rollback:function(){p=this.get_rollback();return p},__call_old:function(r){return o.old.apply(this,(r?Array.prototype.slice.call(arguments,1):n))}}),n)}return m};g.jstree._fn[k].old=l.old;g.jstree._fn[k].plugin=i})},rollback:function(i){if(i){if(!g.isArray(i)){i=[i]}g.each(i,function(j,k){h[k.i].set_rollback(k.h,k.d)})}}};g.jstree._fn=g.jstree._instance.prototype={};g(function(){var k=navigator.userAgent.toLowerCase(),j=(k.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],i=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } ";if(/msie/.test(k)&&parseInt(j,10)==6){c=true;try{document.execCommand("BackgroundImageCache",false,true)}catch(l){}i+=".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } .jstree li a ins { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a ins { margin-right:0px; margin-left:3px; } "}if(/msie/.test(k)&&parseInt(j,10)==7){b=true;i+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } "}if(!/compatible/.test(k)&&/mozilla/.test(k)&&parseFloat(j,10)<1.9){a=true;i+=".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } "}g.vakata.css.add_sheet({str:i,title:"jstree"})});g.jstree.plugin("core",{__init:function(){this.data.core.locked=false;this.data.core.to_open=this.get_settings().core.initially_open;this.data.core.to_load=this.get_settings().core.initially_load},defaults:{html_titles:false,animation:500,initially_open:[],initially_load:[],open_parents:true,notify_plugins:true,rtl:false,load_open:false,strings:{loading:"Loading ...",new_node:"New node",multiple_selection:"Multiple selection"}},_fn:{init:function(){this.set_focus();if(this._get_settings().core.rtl){this.get_container().addClass("jstree-rtl").css("direction","rtl")}this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins> </ins><a class='jstree-loading' href='#'><ins class='jstree-icon'> </ins>"+this._get_string("loading")+"</a></li></ul>");this.data.core.li_height=this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height()||18;this.get_container().delegate("li > ins","click.jstree",g.proxy(function(j){var i=g(j.target);this.toggle_node(i)},this)).bind("mousedown.jstree",g.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(j){var k;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(window.getSelection){k=window.getSelection();try{k.removeAllRanges();k.collapse()}catch(i){}}}});if(this._get_settings().core.notify_plugins){this.get_container().bind("load_node.jstree",g.proxy(function(k,j){var l=this._get_node(j.rslt.obj),i=this;if(l===-1){l=this.get_container_ul()}if(!l.length){return}l.find("li").each(function(){var m=g(this);if(m.data("jstree")){g.each(m.data("jstree"),function(o,n){if(i.data[o]&&g.isFunction(i["_"+o+"_notify"])){i["_"+o+"_notify"].call(i,m,n)}})}})},this))}if(this._get_settings().core.load_open){this.get_container().bind("load_node.jstree",g.proxy(function(k,j){var l=this._get_node(j.rslt.obj),i=this;if(l===-1){l=this.get_container_ul()}if(!l.length){return}l.find("li.jstree-open:not(:has(ul))").each(function(){i.load_node(this,g.noop,g.noop)})},this))}this.__callback();this.load_node(-1,function(){this.loaded();this.reload_nodes()})},destroy:function(){var j,m=this.get_index(),k=this._get_settings(),l=this;g.each(k.plugins,function(n,p){try{e[p].__destroy.apply(l)}catch(o){}});this.__callback();if(this.is_focused()){for(j in h){if(h.hasOwnProperty(j)&&j!=m){h[j].set_focus();break}}}if(m===f){f=-1}this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree_instance_id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")});g(document).unbind(".jstree-"+m).undelegate(".jstree-"+m);h[m]=null;delete h[m]},_core_notify:function(j,i){if(i.opened){this.open_node(j,false,true)}},lock:function(){this.data.core.locked=true;this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");this.__callback({})},unlock:function(){this.data.core.locked=false;this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");this.__callback({})},is_locked:function(){return this.data.core.locked},save_opened:function(){var i=this;this.data.core.to_open=[];this.get_container_ul().find("li.jstree-open").each(function(){if(this.id){i.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}});this.__callback(i.data.core.to_open)},save_loaded:function(){},reload_nodes:function(j){var m=this,i=true,l=[],k=[];if(!j){this.data.core.reopen=false;this.data.core.refreshing=true;this.data.core.to_open=g.map(g.makeArray(this.data.core.to_open),function(o){return"#"+o.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.data.core.to_load=g.map(g.makeArray(this.data.core.to_load),function(o){return"#"+o.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});if(this.data.core.to_open.length){this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open)}}if(this.data.core.to_load.length){g.each(this.data.core.to_load,function(n,o){if(o=="#"){return true}if(g(o).length){l.push(o)}else{k.push(o)}});if(l.length){this.data.core.to_load=k;g.each(l,function(n,o){if(!m._is_loaded(o)){m.load_node(o,function(){m.reload_nodes(true)},function(){m.reload_nodes(true)});i=false}})}}if(this.data.core.to_open.length){g.each(this.data.core.to_open,function(n,o){m.open_node(o,false,true)})}if(i){if(this.data.core.reopen){clearTimeout(this.data.core.reopen)}this.data.core.reopen=setTimeout(function(){m.__callback({},m)},50);this.data.core.refreshing=false;this.reopen()}},reopen:function(){var i=this;if(this.data.core.to_open.length){g.each(this.data.core.to_open,function(j,k){i.open_node(k,false,true)})}this.__callback({})},refresh:function(i){var j=this;this.save_opened();if(!i){i=-1}i=this._get_node(i);if(!i){i=-1}if(i!==-1){i.children("UL").remove()}else{this.get_container_ul().empty()}this.load_node(i,function(){j.__callback({obj:i});j.reload_nodes()})},loaded:function(){this.__callback()},set_focus:function(){if(this.is_focused()){return}var i=g.jstree._focused();if(i){i.unset_focus()}this.get_container().addClass("jstree-focused");f=this.get_index();this.__callback()},is_focused:function(){return f==this.get_index()},unset_focus:function(){if(this.is_focused()){this.get_container().removeClass("jstree-focused");f=-1}this.__callback()},_get_node:function(i){var j=g(i,this.get_container());if(j.is(".jstree")||i==-1){return -1}j=j.closest("li",this.get_container());return j.length?j:false},_get_next:function(j,i){j=this._get_node(j);if(j===-1){return this.get_container().find("> ul > li:first-child")}if(!j.length){return false}if(i){return(j.nextAll("li").size()>0)?j.nextAll("li:eq(0)"):false}if(j.hasClass("jstree-open")){return j.find("li:eq(0)")}else{if(j.nextAll("li").size()>0){return j.nextAll("li:eq(0)")}else{return j.parentsUntil(".jstree","li").next("li").eq(0)}}},_get_prev:function(j,i){j=this._get_node(j);if(j===-1){return this.get_container().find("> ul > li:last-child")}if(!j.length){return false}if(i){return(j.prevAll("li").length>0)?j.prevAll("li:eq(0)"):false}if(j.prev("li").length){j=j.prev("li").eq(0);while(j.hasClass("jstree-open")){j=j.children("ul:eq(0)").children("li:last")}return j}else{var k=j.parentsUntil(".jstree","li:eq(0)");return k.length?k:false}},_get_parent:function(i){i=this._get_node(i);if(i==-1||!i.length){return false}var j=i.parentsUntil(".jstree","li:eq(0)");return j.length?j:-1},_get_children:function(i){i=this._get_node(i);if(i===-1){return this.get_container().children("ul:eq(0)").children("li")}if(!i.length){return false}return i.children("ul:eq(0)").children("li")},get_path:function(k,i){var j=[],l=this;k=this._get_node(k);if(k===-1||!k||!k.length){return false}k.parentsUntil(".jstree","li").each(function(){j.push(i?this.id:l.get_text(this))});j.reverse();j.push(i?k.attr("id"):this.get_text(k));return j},_get_string:function(i){return this._get_settings().core.strings[i]||i},is_open:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-open")},is_closed:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-closed")},is_leaf:function(i){i=this._get_node(i);return i&&i!==-1&&i.hasClass("jstree-leaf")},correct_state:function(i){i=this._get_node(i);if(!i||i===-1){return false}i.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:i})},open_node:function(l,m,j){l=this._get_node(l);if(!l.length){return false}if(!l.hasClass("jstree-closed")){if(m){m.call()}return false}var k=j||c?0:this._get_settings().core.animation,i=this;if(!this._is_loaded(l)){l.children("a").addClass("jstree-loading");this.load_node(l,function(){i.open_node(l,m,j)},m)}else{if(this._get_settings().core.open_parents){l.parentsUntil(".jstree",".jstree-closed").each(function(){i.open_node(this,false,true)})}if(k){l.children("ul").css("display","none")}l.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");if(k){l.children("ul").stop(true,true).slideDown(k,function(){this.style.display="";i.after_open(l)})}else{i.after_open(l)}this.__callback({obj:l});if(m){m.call()}}},after_open:function(i){this.__callback({obj:i})},close_node:function(l,j){l=this._get_node(l);var k=j||c?0:this._get_settings().core.animation,i=this;if(!l.length||!l.hasClass("jstree-open")){return false}if(k){l.children("ul").attr("style","display:block !important")}l.removeClass("jstree-open").addClass("jstree-closed");if(k){l.children("ul").stop(true,true).slideUp(k,function(){this.style.display="";i.after_close(l)})}else{i.after_close(l)}this.__callback({obj:l})},after_close:function(i){this.__callback({obj:i})},toggle_node:function(i){i=this._get_node(i);if(i.hasClass("jstree-closed")){return this.open_node(i)}if(i.hasClass("jstree-open")){return this.close_node(i)}},open_all:function(k,j,i){k=k?this._get_node(k):-1;if(!k||k===-1){k=this.get_container_ul()}if(i){k=k.find("li.jstree-closed")}else{i=k;if(k.is(".jstree-closed")){k=k.find("li.jstree-closed").andSelf()}else{k=k.find("li.jstree-closed")}}var l=this;k.each(function(){var m=this;if(!l._is_loaded(this)){l.open_node(this,function(){l.open_all(m,j,i)},!j)}else{l.open_node(this,false,!j)}});if(i.find("li.jstree-closed").length===0){this.__callback({obj:i})}},close_all:function(j,i){var k=this;j=j?this._get_node(j):this.get_container();if(!j||j===-1){j=this.get_container_ul()}j.find("li.jstree-open").andSelf().each(function(){k.close_node(this,!i)});this.__callback({obj:j})},clean_node:function(i){i=i&&i!=-1?g(i):this.get_container_ul();i=i.is("li")?i.find("li").andSelf():i.find("li");i.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");i.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();this.__callback({obj:i})},get_rollback:function(){this.__callback();return{i:this.get_index(),h:this.get_container().children("ul").clone(true),d:this.data}},set_rollback:function(i,j){this.get_container().empty().append(i);this.data=j;this.__callback()},load_node:function(k,i,j){this.__callback({obj:k})},_is_loaded:function(i){return true},create_node:function(n,i,m,p,j){n=this._get_node(n);i=typeof i==="undefined"?"last":i;var o=g("<li />"),l=this._get_settings().core,k;if(n!==-1&&!n.length){return false}if(!j&&!this._is_loaded(n)){this.load_node(n,function(){this.create_node(n,i,m,p,true)});return false}this.__rollback();if(typeof m==="string"){m={data:m}}if(!m){m={}}if(m.attr){o.attr(m.attr)}if(m.metadata){o.data(m.metadata)}if(m.state){o.addClass("jstree-"+m.state)}if(!m.data){m.data=this._get_string("new_node")}if(!g.isArray(m.data)){k=m.data;m.data=[];m.data.push(k)}g.each(m.data,function(r,q){k=g("<a />");if(g.isFunction(q)){q=q.call(this,m)}if(typeof q=="string"){k.attr("href","#")[l.html_titles?"html":"text"](q)}else{if(!q.attr){q.attr={}}if(!q.attr.href){q.attr.href="#"}k.attr(q.attr)[l.html_titles?"html":"text"](q.title);if(q.language){k.addClass(q.language)}}k.prepend("<ins class='jstree-icon'> </ins>");if(!q.icon&&m.icon){q.icon=m.icon}if(q.icon){if(q.icon.indexOf("/")===-1){k.children("ins").addClass(q.icon)}else{k.children("ins").css("background","url('"+q.icon+"') center center no-repeat")}}o.append(k)});o.prepend("<ins class='jstree-icon'> </ins>");if(n===-1){n=this.get_container();if(i==="before"){i="first"}if(i==="after"){i="last"}}switch(i){case"before":n.before(o);k=this._get_parent(n);break;case"after":n.after(o);k=this._get_parent(n);break;case"inside":case"first":if(!n.children("ul").length){n.append("<ul />")}n.children("ul").prepend(o);k=n;break;case"last":if(!n.children("ul").length){n.append("<ul />")}n.children("ul").append(o);k=n;break;default:if(!n.children("ul").length){n.append("<ul />")}if(!i){i=0}k=n.children("ul").children("li").eq(i);if(k.length){k.before(o)}else{n.children("ul").append(o)}k=n;break}if(k===-1||k.get(0)===this.get_container().get(0)){k=-1}this.clean_node(k);this.__callback({obj:o,parent:k});if(p){p.call(this,o)}return o},get_text:function(j){j=this._get_node(j);if(!j.length){return false}var i=this._get_settings().core.html_titles;j=j.children("a:eq(0)");if(i){j=j.clone();j.children("INS").remove();return j.html()}else{j=j.contents().filter(function(){return this.nodeType==3})[0];return j.nodeValue}},set_text:function(j,k){j=this._get_node(j);if(!j.length){return false}j=j.children("a:eq(0)");if(this._get_settings().core.html_titles){var i=j.children("INS").clone();j.html(k).prepend(i);this.__callback({obj:j,name:k});return true}else{j=j.contents().filter(function(){return this.nodeType==3})[0];this.__callback({obj:j,name:k});return(j.nodeValue=k)}},rename_node:function(i,j){i=this._get_node(i);this.__rollback();if(i&&i.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments))){this.__callback({obj:i,name:j})}},delete_node:function(l){l=this._get_node(l);if(!l.length){return false}this.__rollback();var k=this._get_parent(l),j=g([]),i=this;l.each(function(){j=j.add(i._get_prev(this))});l=l.detach();if(k!==-1&&k.find("> ul > li").length===0){k.removeClass("jstree-open jstree-closed").addClass("jstree-leaf")}this.clean_node(k);this.__callback({obj:l,prev:j,parent:k});return l},prepare_move:function(m,k,n,i,j){var l={};l.ot=g.jstree._reference(m)||this;l.o=l.ot._get_node(m);l.r=k===-1?-1:this._get_node(k);l.p=(typeof n==="undefined"||n===false)?"last":n;if(!j&&d.o&&d.o[0]===l.o[0]&&d.r[0]===l.r[0]&&d.p===l.p){this.__callback(d);if(i){i.call(this,d)}return}l.ot=g.jstree._reference(l.o)||this;l.rt=g.jstree._reference(l.r)||this;if(l.r===-1||!l.r){l.cr=-1;switch(l.p){case"first":case"before":case"inside":l.cp=0;break;case"after":case"last":l.cp=l.rt.get_container().find(" > ul > li").length;break;default:l.cp=l.p;break}}else{if(!/^(before|after)$/.test(l.p)&&!this._is_loaded(l.r)){return this.load_node(l.r,function(){this.prepare_move(m,k,n,i,true)})}switch(l.p){case"before":l.cp=l.r.index();l.cr=l.rt._get_parent(l.r);break;case"after":l.cp=l.r.index()+1;l.cr=l.rt._get_parent(l.r);break;case"inside":case"first":l.cp=0;l.cr=l.r;break;case"last":l.cp=l.r.find(" > ul > li").length;l.cr=l.r;break;default:l.cp=l.p;l.cr=l.r;break}}l.np=l.cr==-1?l.rt.get_container():l.cr;l.op=l.ot._get_parent(l.o);l.cop=l.o.index();if(l.op===-1){l.op=l.ot?l.ot.get_container():this.get_container()}if(!/^(before|after)$/.test(l.p)&&l.op&&l.np&&l.op[0]===l.np[0]&&l.o.index()<l.cp){l.cp++}l.or=l.np.find(" > ul > li:nth-child("+(l.cp+1)+")");d=l;this.__callback(d);if(i){i.call(this,d)}},check_move:function(){var k=d,i=true,j=k.r===-1?this.get_container():k.r;if(!k||!k.o||k.or[0]===k.o[0]){return false}if(k.op&&k.np&&k.op[0]===k.np[0]&&k.cp-1===k.o.index()){return false}k.o.each(function(){if(j.parentsUntil(".jstree","li").andSelf().index(this)!==-1){i=false;return false}});return i},move_node:function(p,l,i,k,j,n){if(!j){return this.prepare_move(p,l,i,function(o){this.move_node(o,false,false,k,true,n)})}if(k){d.cy=true}if(!n&&!this.check_move()){return false}this.__rollback();var q=false;if(k){q=p.o.clone(true);q.find("*[id]").andSelf().each(function(){if(this.id){this.id="copy_"+this.id}})}else{q=p.o}if(p.or.length){p.or.before(q)}else{if(!p.np.children("ul").length){g("<ul />").appendTo(p.np)}p.np.children("ul:eq(0)").append(q)}try{p.ot.clean_node(p.op);p.rt.clean_node(p.np);if(!p.op.find("> ul > li").length){p.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}}catch(m){}if(k){d.cy=true;d.oc=q}this.__callback(d);return d},_get_move:function(){return d}}})})(jQuery);(function(d){var e=[];d.jstree._themes=false;d.jstree.plugin("themes",{__init:function(){this.get_container().bind("init.jstree",d.proxy(function(){var f=this._get_settings().themes;this.data.themes.dots=f.dots;this.data.themes.icons=f.icons;this.set_theme(f.theme,f.url)},this)).bind("loaded.jstree",d.proxy(function(){if(!this.data.themes.dots){this.hide_dots()}else{this.show_dots()}if(!this.data.themes.icons){this.hide_icons()}else{this.show_icons()}},this))},defaults:{theme:"default",url:false,dots:true,icons:true},_fn:{set_theme:function(g,f){if(!g){return false}if(!f){f=d.jstree._themes+g+"/style.css"}if(d.inArray(f,e)==-1){d.vakata.css.add_sheet({url:f});e.push(f)}if(this.data.themes.theme!=g){this.get_container().removeClass("jstree-"+this.data.themes.theme);this.data.themes.theme=g}this.get_container().addClass("jstree-"+g);if(!this.data.themes.dots){this.hide_dots()}else{this.show_dots()}if(!this.data.themes.icons){this.hide_icons()}else{this.show_icons()}this.__callback()},get_theme:function(){return this.data.themes.theme},show_dots:function(){this.data.themes.dots=true;this.get_container().children("ul").removeClass("jstree-no-dots")},hide_dots:function(){this.data.themes.dots=false;this.get_container().children("ul").addClass("jstree-no-dots")},toggle_dots:function(){if(this.data.themes.dots){this.hide_dots()}else{this.show_dots()}},show_icons:function(){this.data.themes.icons=true;this.get_container().children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this.data.themes.icons=false;this.get_container().children("ul").addClass("jstree-no-icons")},toggle_icons:function(){if(this.data.themes.icons){this.hide_icons()}else{this.show_icons()}}}});d(function(){if(d.jstree._themes===false){d("script").each(function(){if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)){d.jstree._themes=this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/,"")+"themes/";return false}})}if(d.jstree._themes===false){d.jstree._themes="themes/"}});d.jstree.defaults.plugins.push("themes")})(jQuery);(function(d){d.jstree.plugin("checkbox",{__init:function(){this.data.checkbox.noui=this._get_settings().checkbox.override_ui;if(this.data.ui&&this.data.checkbox.noui){this.select_node=this.deselect_node=this.deselect_all=d.noop;this.get_selected=this.get_checked}this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree",d.proxy(function(g,f){this._prepare_checkboxes(f.rslt.obj)},this)).bind("loaded.jstree",d.proxy(function(f){this._prepare_checkboxes()},this)).delegate((this.data.ui&&this.data.checkbox.noui?"a":"ins.jstree-checkbox"),"click.jstree",d.proxy(function(f){f.preventDefault();if(this._get_node(f.target).hasClass("jstree-checked")){this.uncheck_node(f.target)}else{this.check_node(f.target)}if(this.data.ui&&this.data.checkbox.noui){this.save_selected();if(this.data.cookies){this.save_cookie("select_node")}}else{f.stopImmediatePropagation();return false}},this))},defaults:{override_ui:false,two_state:false,real_checkboxes:false,checked_parent_open:true,real_checkboxes_names:function(e){return[("check_"+(e[0].id||Math.ceil(Math.random()*10000))),1]}},__destroy:function(){this.get_container().find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end().find("ins.jstree-checkbox").remove()},_fn:{_checkbox_notify:function(f,e){if(e.checked){this.check_node(f,false)}},_prepare_checkboxes:function(i){i=!i||i==-1?this.get_container().find("> ul > li"):this._get_node(i);if(i===false){return}var k,j=this,e,g=this._get_settings().checkbox.two_state,h=this._get_settings().checkbox.real_checkboxes,f=this._get_settings().checkbox.real_checkboxes_names;i.each(function(){e=d(this);k=e.is("li")&&(e.hasClass("jstree-checked")||(h&&e.children(":checked").length))?"jstree-checked":"jstree-unchecked";e.find("li").andSelf().each(function(){var m=d(this),l;m.children("a"+(j.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(g?"jstree-unchecked":k);if(h){if(!m.children(":checkbox").length){l=f.call(j,m);m.prepend("<input type='checkbox' class='jstree-real-checkbox' id='"+l[0]+"' name='"+l[0]+"' value='"+l[1]+"' />")}else{m.children(":checkbox").addClass("jstree-real-checkbox")}}if(!g){if(k==="jstree-checked"||m.hasClass("jstree-checked")||m.children(":checked").length){m.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked",true)}}else{if(m.hasClass("jstree-checked")||m.children(":checked").length){m.addClass("jstree-checked").children(":checkbox").prop("checked",true)}}})});if(!g){i.find(".jstree-checked").parent().parent().each(function(){j._repair_state(this)})}},change_state:function(h,g){h=this._get_node(h);var e=false,f=this._get_settings().checkbox.real_checkboxes;if(!h||h===-1){return false}g=(g===false||g===true)?g:h.hasClass("jstree-checked");if(this._get_settings().checkbox.two_state){if(g){h.removeClass("jstree-checked").addClass("jstree-unchecked");if(f){h.children(":checkbox").prop("checked",false)}}else{h.removeClass("jstree-unchecked").addClass("jstree-checked");if(f){h.children(":checkbox").prop("checked",true)}}}else{if(g){e=h.find("li").andSelf();if(!e.filter(".jstree-checked, .jstree-undetermined").length){return false}e.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(f){e.children(":checkbox").prop("checked",false)}}else{e=h.find("li").andSelf();if(!e.filter(".jstree-unchecked, .jstree-undetermined").length){return false}e.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(f){e.children(":checkbox").prop("checked",true)}if(this.data.ui){this.data.ui.last_selected=h}this.data.checkbox.last_selected=h}h.parentsUntil(".jstree","li").each(function(){var i=d(this);if(g){if(i.children("ul").children("li.jstree-checked, li.jstree-undetermined").length){i.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(f){i.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}return false}else{i.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");if(f){i.children(":checkbox").prop("checked",false)}}}else{if(i.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length){i.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(f){i.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}return false}else{i.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");if(f){i.children(":checkbox").prop("checked",true)}}}})}if(this.data.ui&&this.data.checkbox.noui){this.data.ui.selected=this.get_checked()}this.__callback(h);return true},check_node:function(f){if(this.change_state(f,false)){f=this._get_node(f);if(this._get_settings().checkbox.checked_parent_open){var e=this;f.parents(".jstree-closed").each(function(){e.open_node(this,false,true)})}this.__callback({obj:f})}},uncheck_node:function(e){if(this.change_state(e,true)){this.__callback({obj:this._get_node(e)})}},check_all:function(){var f=this,e=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");e.each(function(){f.change_state(this,false)});this.__callback()},uncheck_all:function(){var f=this,e=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");e.each(function(){f.change_state(this,true)});this.__callback()},is_checked:function(e){e=this._get_node(e);return e.length?e.is(".jstree-checked"):false},get_checked:function(f,e){f=!f||f===-1?this.get_container():this._get_node(f);return e||this._get_settings().checkbox.two_state?f.find(".jstree-checked"):f.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(f,e){f=!f||f===-1?this.get_container():this._get_node(f);return e||this._get_settings().checkbox.two_state?f.find(".jstree-unchecked"):f.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked")},show_checkboxes:function(){this.get_container().children("ul").removeClass("jstree-no-checkboxes")},hide_checkboxes:function(){this.get_container().children("ul").addClass("jstree-no-checkboxes")},_repair_state:function(h){h=this._get_node(h);if(!h.length){return}if(this._get_settings().checkbox.two_state){h.find("li").andSelf().not(".jstree-checked").removeClass("jstree-undetermined").addClass("jstree-unchecked").children(":checkbox").prop("checked",true);return}var g=this._get_settings().checkbox.real_checkboxes,f=h.find("> ul > .jstree-checked").length,e=h.find("> ul > .jstree-undetermined").length,i=h.find("> ul > li").length;if(i===0){if(h.hasClass("jstree-undetermined")){this.change_state(h,false)}}else{if(f===0&&e===0){this.change_state(h,true)}else{if(f===i){this.change_state(h,false)}else{h.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");if(g){h.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",false)}}}}},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var f=this,e=this.data.ui.to_select;e=d.map(d.makeArray(e),function(g){return"#"+g.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")});this.deselect_all();d.each(e,function(g,h){f.check_node(h)});this.__callback()}else{this.__call_old()}},save_loaded:function(){var e=this;this.data.core.to_load=[];this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){if(this.id){e.data.core.to_load.push("#"+this.id)}})}}});d(function(){var e=".jstree .jstree-real-checkbox { display:none; } ";d.vakata.css.add_sheet({str:e,title:"jstree"})})})(jQuery);(function(d){d.jstree.plugin("types",{__init:function(){var e=this._get_settings().types;this.data.types.attach_to=[];this.get_container().bind("init.jstree",d.proxy(function(){var h=e.types,g=e.type_attr,f="",i=this;d.each(h,function(j,k){d.each(k,function(m,l){if(!/^(max_depth|max_children|icon|valid_children)$/.test(m)){i.data.types.attach_to.push(m)}});if(!k.icon){return true}if(k.icon.image||k.icon.position){if(j=="default"){f+=".jstree-"+i.get_index()+" a > .jstree-icon { "}else{f+=".jstree-"+i.get_index()+" li["+g+'="'+j+'"] > a > .jstree-icon { '}if(k.icon.image){f+=" background-image:url("+k.icon.image+"); "}if(k.icon.position){f+=" background-position:"+k.icon.position+"; "}else{f+=" background-position:0 0; "}f+="} "}});if(f!==""){d.vakata.css.add_sheet({str:f,title:"jstree-types"})}},this)).bind("before.jstree",d.proxy(function(i,h){var g,f,k=this._get_settings().types.use_data?this._get_node(h.args[0]):false,j=k&&k!==-1&&k.length?k.data("jstree"):false;if(j&&j.types&&j.types[h.func]===false){i.stopImmediatePropagation();return false}if(d.inArray(h.func,this.data.types.attach_to)!==-1){if(!h.args[0]||(!h.args[0].tagName&&!h.args[0].jquery)){return}g=this._get_settings().types.types;f=this._get_type(h.args[0]);if(((g[f]&&typeof g[f][h.func]!=="undefined")||(g["default"]&&typeof g["default"][h.func]!=="undefined"))&&this._check(h.func,h.args[0])===false){i.stopImmediatePropagation();return false}}},this));if(c){this.get_container().bind("load_node.jstree set_type.jstree",d.proxy(function(i,h){var g=h&&h.rslt&&h.rslt.obj&&h.rslt.obj!==-1?this._get_node(h.rslt.obj).parent():this.get_container_ul(),j=false,f=this._get_settings().types;d.each(f.types,function(k,l){if(l.icon&&(l.icon.image||l.icon.position)){j=k==="default"?g.find("li > a > .jstree-icon"):g.find("li["+f.type_attr+"='"+k+"'] > a > .jstree-icon");if(l.icon.image){j.css("backgroundImage","url("+l.icon.image+")")}j.css("backgroundPosition",l.icon.position||"0 0")}})},this))}},defaults:{max_children:-1,max_depth:-1,valid_children:"all",use_data:false,type_attr:"rel",types:{"default":{max_children:-1,max_depth:-1,valid_children:"all"}}},_fn:{_types_notify:function(f,e){if(e.type&&this._get_settings().types.use_data){this.set_type(e.type,f)}},_get_type:function(e){e=this._get_node(e);return(!e||!e.length)?false:e.attr(this._get_settings().types.type_attr)||"default"},set_type:function(g,f){f=this._get_node(f);var e=(!f.length||!g)?false:f.attr(this._get_settings().types.type_attr,g);if(e){this.__callback({obj:f,type:g})}return e},_check:function(j,g,e){g=this._get_node(g);var k=false,l=this._get_type(g),i=0,h=this,m=this._get_settings().types,f=false;if(g===-1){if(!!m[j]){k=m[j]}else{return}}else{if(l===false){return}f=m.use_data?g.data("jstree"):false;if(f&&f.types&&typeof f.types[j]!=="undefined"){k=f.types[j]}else{if(!!m.types[l]&&typeof m.types[l][j]!=="undefined"){k=m.types[l][j]}else{if(!!m.types["default"]&&typeof m.types["default"][j]!=="undefined"){k=m.types["default"][j]}}}}if(d.isFunction(k)){k=k.call(this,g)}if(j==="max_depth"&&g!==-1&&e!==false&&m.max_depth!==-2&&k!==0){g.children("a:eq(0)").parentsUntil(".jstree","li").each(function(n){if(m.max_depth!==-1&&m.max_depth-(n+1)<=0){k=0;return false}i=(n===0)?k:h._check(j,this,false);if(i!==-1&&i-(n+1)<=0){k=0;return false}if(i>=0&&(i-(n+1)<k||k<0)){k=i-(n+1)}if(m.max_depth>=0&&(m.max_depth-(n+1)<k||k<0)){k=m.max_depth-(n+1)}})}return k},check_move:function(){if(!this.__call_old()){return false}var e=this._get_move(),i=e.rt._get_settings().types,k=e.rt._check("max_children",e.cr),j=e.rt._check("max_depth",e.cr),g=e.rt._check("valid_children",e.cr),h=0,l=1,f;if(g==="none"){return false}if(d.isArray(g)&&e.ot&&e.ot._get_type){e.o.each(function(){if(d.inArray(e.ot._get_type(this),g)===-1){l=false;return false}});if(l===false){return false}}if(i.max_children!==-2&&k!==-1){h=e.cr===-1?this.get_container().find("> ul > li").not(e.o).length:e.cr.find("> ul > li").not(e.o).length;if(h+e.o.length>k){return false}}if(i.max_depth!==-2&&j!==-1){l=0;if(j===0){return false}if(typeof e.o.d==="undefined"){f=e.o;while(f.length>0){f=f.find("> ul > li");l++}e.o.d=l}if(j-e.o.d<0){return false}}return true},create_node:function(h,i,f,o,k,n){if(!n&&(k||this._is_loaded(h))){var g=(typeof i=="string"&&i.match(/^before|after$/i)&&h!==-1)?this._get_parent(h):this._get_node(h),q=this._get_settings().types,m=this._check("max_children",g),l=this._check("max_depth",g),j=this._check("valid_children",g),e;if(typeof f==="string"){f={data:f}}if(!f){f={}}if(j==="none"){return false}if(d.isArray(j)){if(!f.attr||!f.attr[q.type_attr]){if(!f.attr){f.attr={}}f.attr[q.type_attr]=j[0]}else{if(d.inArray(f.attr[q.type_attr],j)===-1){return false}}}if(q.max_children!==-2&&m!==-1){e=g===-1?this.get_container().find("> ul > li").length:g.find("> ul > li").length;if(e+1>m){return false}}if(q.max_depth!==-2&&l!==-1&&(l-1)<0){return false}}return this.__call_old(true,h,i,f,o,k,n)}}})})(jQuery);(function(d){d.jstree.plugin("html_data",{__init:function(){this.data.html_data.original_container_html=this.get_container().find(" > ul > li").clone(true);this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function(){return this.nodeType==3}).remove()},defaults:{data:false,ajax:false,correct_state:true},_fn:{load_node:function(g,e,f){var h=this;this.load_node_html(g,function(){h.__callback({obj:h._get_node(g)});e.call(this)},f)},_is_loaded:function(e){e=this._get_node(e);return e==-1||!e||(!this._get_settings().html_data.ajax&&!d.isFunction(this._get_settings().html_data.data))||e.is(".jstree-open, .jstree-leaf")||e.children("ul").children("li").size()>0},load_node_html:function(i,e,g){var k,h=this.get_settings().html_data,f=function(){},j=function(){};i=this._get_node(i);if(i&&i!==-1){if(i.data("jstree_is_loading")){return}else{i.data("jstree_is_loading",true)}}switch(!0){case (d.isFunction(h.data)):h.data.call(this,i,d.proxy(function(l){if(l&&l!==""&&l.toString&&l.toString().replace(/^[\s\n]+$/,"")!==""){l=d(l);if(!l.is("ul")){l=d("<ul />").append(l)}if(i==-1||!i){this.get_container().children("ul").empty().append(l.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon")}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.append(l).children("ul").find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");i.removeData("jstree_is_loading")}this.clean_node(i);if(e){e.call(this)}}else{if(i&&i!==-1){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree_is_loading");if(h.correct_state){this.correct_state(i);if(e){e.call(this)}}}else{if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}}},this));break;case (!h.data&&!h.ajax):if(!i||i==-1){this.get_container().children("ul").empty().append(this.data.html_data.original_container_html).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");this.clean_node()}if(e){e.call(this)}break;case (!!h.data&&!h.ajax)||(!!h.data&&!!h.ajax&&(!i||i===-1)):if(!i||i==-1){k=d(h.data);if(!k.is("ul")){k=d("<ul />").append(k)}this.get_container().children("ul").empty().append(k.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");this.clean_node()}if(e){e.call(this)}break;case (!h.data&&!!h.ajax)||(!!h.data&&!!h.ajax&&i&&i!==-1):i=this._get_node(i);f=function(m,n,o){var l=this.get_settings().html_data.ajax.error;if(l){l.call(this,m,n,o)}if(i!=-1&&i.length){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree_is_loading");if(n==="success"&&h.correct_state){this.correct_state(i)}}else{if(n==="success"&&h.correct_state){this.get_container().children("ul").empty()}}if(g){g.call(this)}};j=function(o,m,l){var n=this.get_settings().html_data.ajax.success;if(n){o=n.call(this,o,m,l)||o}if(o===""||(o&&o.toString&&o.toString().replace(/^[\s\n]+$/,"")==="")){return f.call(this,l,m,"")}if(o){o=d(o);if(!o.is("ul")){o=d("<ul />").append(o)}if(i==-1||!i){this.get_container().children("ul").empty().append(o.children()).find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon")}else{i.children("a.jstree-loading").removeClass("jstree-loading");i.append(o).children("ul").find("li, a").filter(function(){return !this.firstChild||!this.firstChild.tagName||this.firstChild.tagName!=="INS"}).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");i.removeData("jstree_is_loading")}this.clean_node(i);if(e){e.call(this)}}else{if(i&&i!==-1){i.children("a.jstree-loading").removeClass("jstree-loading");i.removeData("jstree_is_loading");if(h.correct_state){this.correct_state(i);if(e){e.call(this)}}}else{if(h.correct_state){this.get_container().children("ul").empty();if(e){e.call(this)}}}}};h.ajax.context=this;h.ajax.error=f;h.ajax.success=j;if(!h.ajax.dataType){h.ajax.dataType="html"}if(d.isFunction(h.ajax.url)){h.ajax.url=h.ajax.url.call(this,i)}if(d.isFunction(h.ajax.data)){h.ajax.data=h.ajax.data.call(this,i)}d.ajax(h.ajax);break}}}});d.jstree.defaults.plugins.push("html_data")})(jQuery)})(); -
wordpress-move/trunk/libs/js/themes/default/style.css
r426854 r493292 46 46 47 47 .jstree-default.jstree-focused { 48 background: #f fffff;48 background: #f7f7f7; 49 49 } 50 50 -
wordpress-move/trunk/readme.txt
r470144 r493292 4 4 Tags: domain, migrate, migration, move 5 5 Requires at least: 3.2 6 Tested up to: 3.3 7 Stable tag: 1. 26 Tested up to: 3.3.1 7 Stable tag: 1.3 8 8 9 9 A migration assistant for WordPress capable of changing the domain name in use and/or migrating your installation to another server. … … 48 48 As the warning suggests, you need to make the backup directory writable by the plugin. Permission settings vary from server to server so there is no specific value to set the directory permissions to. The easiest way to fix this problem yourself is using an FTP client to alter permission settings of the backup directory until plugin successfully creates backup files. You may also prefer requesting assistance from your hosting company. 49 49 50 = What will happen to the FTP Password that is already stored in my database? =50 = I am a pre-1.2 user, what will happen to the FTP Password that is already stored in my database? = 51 51 52 52 Visiting the WordPress Move Settings page any time after updating the plugin will remove it from the database permanently. 53 53 54 = Can I use the database backup files that WordPress Move generates with phpMyAdmin? 55 56 You can convert a database backup file using the Convert option in the Backup Manager to use it outside the plugin. So, yes, you can use the *converted* database backup files with phpMyAdmin or any other script. 57 54 58 == Changelog == 59 60 = 1.3 = 61 * Explanation for Change Domain Name is rephrased. 62 * Simple and Advanced Migration methods are merged. 63 * Meta boxes are added to the migration page. 64 * A database backup converter is integrated to convert WordPress-Move-only database backup files to generic SQL files. 65 * Backup files to use for restoration can now be selected right on the Restore page. 66 * Messages are now displayed in real-time on migration and restoration pages. 67 * Empty HTML files are added to backup directories to prevent them being listed by people trying to access the directory via their browsers. 55 68 56 69 = 1.2 = … … 77 90 == Upgrade Notice == 78 91 92 = 1.3 = 93 Simple and Advanced Migration methods are merged and a database backup converter is integrated into the Backup Manager. 94 79 95 = 1.2 = 80 81 96 FTP Passwords are no longer stored in the database, for security reasons. It is now possible to create either a full backup or a database backup, using Backup Manager. Explanations on the Migration Assistant page are replaced with more clear ones. 82 97 -
wordpress-move/trunk/wordpress-move.php
r460783 r493292 4 4 Plugin URI: http://www.mertyazicioglu.com/wordpress-move/ 5 5 Description: WordPress Move is a migration assistant for WordPress that can take care of changing your domain name and/or moving your database and files to another server. After activating the plugin, please navigate to WordPress Move page under the Settings menu to configure it. Then, you can start using the Migration Assistant under the Tools menu. 6 Version: 1. 26 Version: 1.3 7 7 Author: Mert Yazicioglu 8 8 Author URI: http://www.mertyazicioglu.com … … 29 29 define( 'WPMOVE_DIR', WP_PLUGIN_DIR . '/' . basename( dirname( __FILE__ ) ) ); 30 30 define( 'WPMOVE_BACKUP_DIR', WPMOVE_DIR . '/backup' ); 31 define( 'WPMOVE_CONVERTED_BACKUP_DIR', WPMOVE_BACKUP_DIR . '/converted' ); 31 32 define( 'WPMOVE_OLD_BACKUP_DIR', WPMOVE_BACKUP_DIR . '/old' ); 32 33 define( 'WPMOVE_URL', WP_PLUGIN_URL . '/' . basename( dirname( __FILE__ ) ) ); … … 86 87 $( "#wpmove-ma-domain-desc" ).css( 'min-height', $( "#wpmove-ma-migrate-desc" ).css( 'height' ) ); 87 88 $( "#wpmove-ma-restore-desc" ).css( 'min-height', $( "#wpmove-ma-migrate-desc" ).css( 'height' ) ); 88 $( "#wpmove_change_domain_name" ).css( 'display', 'none' );89 $( "#wpmove_change_domain_name_br" ).css( 'display', 'none' );90 $( "#wpmove_toggle_change_domain_name" ).css( 'display', 'inline' );91 $( "#wpmove_toggle_change_domain_name" ).click( function () {92 if ( $( "#wpmove_change_domain_name" ).css( 'display' ) == "none" ) {93 $( "#wpmove_change_domain_name" ).css( 'display', 'block' );94 $( "#wpmove_change_domain_name_br" ).css( 'display', 'block' );95 } else {96 $( "#wpmove_change_domain_name" ).css( 'display', 'none' );97 $( "#wpmove_change_domain_name_br" ).css( 'display', 'none' );98 }99 } );100 89 if ( $( "#wpmove_file_tree" ).length ) { 101 90 $( "#wpmove_file_tree_loading" ).css( 'display', 'block' ); … … 106 95 $( "#wpmove_file_tree_check_all" ).click( function () { $( "#wpmove_file_tree" ).jstree( "check_all" ); } ); 107 96 $( "#wpmove_file_tree_uncheck_all" ).click( function () { $( "#wpmove_file_tree" ).jstree( "uncheck_all" ); } ); 97 $( "#wpmove_file_tree" ).jstree( "check_all" ); 108 98 }).jstree( { 109 99 "themes" : { "dots" : false }, … … 114 104 } 115 105 $( '.if-js-closed' ).removeClass( 'if-js-closed' ).addClass( 'closed' ); 116 postboxes.add_postbox_toggles( 'wpmove- domain' );117 postboxes.add_postbox_toggles( 'wpmove-m igrate' );118 postboxes.add_postbox_toggles( 'wpmove- restore' );106 postboxes.add_postbox_toggles( 'wpmove-ma-domain' ); 107 postboxes.add_postbox_toggles( 'wpmove-ma-migrate' ); 108 postboxes.add_postbox_toggles( 'wpmove-ma-restore' ); 119 109 } ); 120 110 </script> … … 142 132 add_meta_box( 'wpmove-ma-migrate', __( 'Migrate', 'WPMove' ), array( $this, 'metabox_ma_migrate' ), 'wpmove-migrate' ); 143 133 add_meta_box( 'wpmove-ma-restore', __( 'Restore', 'WPMove' ), array( $this, 'metabox_ma_restore' ), 'wpmove-restore' ); 134 add_meta_box( 'wpmove-ma-migrate-ftp', __( 'FTP Settings', 'WPMove' ), array( $this, 'metabox_ma_migrate_ftp' ), 'wpmove-ma-migrate' ); 135 add_meta_box( 'wpmove-ma-migrate-domain', __( 'Change Domain Name (Optional)', 'WPMove' ), array( $this, 'metabox_ma_migrate_domain' ), 'wpmove-ma-migrate' ); 136 add_meta_box( 'wpmove-ma-migrate-filetree', __( 'Files to Transfer', 'WPMove' ), array( $this, 'metabox_ma_migrate_filetree' ), 'wpmove-ma-migrate' ); 144 137 } 145 138 … … 452 445 case 'domain': $this->print_change_domain_name_page(); 453 446 break; 454 case 'migrate': $this->print_ start_migration_page();447 case 'migrate': $this->print_migration_page(); 455 448 break; 456 449 case 'complete': $this->print_complete_migration_page(); … … 511 504 </p> 512 505 <p> 513 <strong>•</strong> <?php _e( ' Use this installation with a different domain name while staying on this server.', 'WPMove' ); ?><br>506 <strong>•</strong> <?php _e( 'Just change the domain name this installation uses.', 'WPMove' ); ?><br> 514 507 </p> 515 508 <p> … … 602 595 </p> 603 596 <p> 604 <strong>•</strong> <?php _e( 'You can select which files to use in this method by visiting the Backup Manager.', 'WPMove' ); ?><br>605 597 <strong>•</strong> <?php _e( 'Backups will be processed starting from old to new.', 'WPMove' ); ?><br> 606 598 </p> … … 767 759 768 760 /** 769 * Handles the migration startingprocess.761 * Handles the advanced migration process. 770 762 * 771 763 * @param void 772 764 * @return void 773 765 */ 774 function print_ start_migration_page() {766 function print_migration_page() { 775 767 776 768 // Load plugin settings … … 782 774 } 783 775 784 // Call the requested function if there's any 785 if ( isset( $_GET['type'] ) ) { 786 787 if ( $_GET['type'] == 'simple' ) 788 $this->print_simple_migration_page(); 789 elseif ( $_GET['type'] == 'advanced' ) 790 $this->print_advanced_migration_page(); 791 792 } else { 776 if ( $_POST && check_admin_referer( 'wpmove_advanced_migration_start' ) ) { 793 777 794 778 ?> … … 799 783 <h2><?php _e( 'Migration Assistant', 'WPMove' ); ?></h2> 800 784 <p> 801 <?php _e( 'Please select a migration type to proceed...', 'WPMove' ); ?>802 </p>803 <table class="widefat" cellspacing="0">804 <tbody>805 <tr class="alternate">806 <td class="row-title" style="width: 10%;">807 <a href="<?php echo esc_url( admin_url( 'tools.php?page=wpmove&do=migrate&type=simple' ) ); ?>"><?php _e( 'Simple Migration', 'WPMove' ); ?></a>808 </td>809 <td class="desc">810 <?php _e( 'Simple Migration creates a backup of your database and files excluding the plugin directory. Uploading backup files to the remote server starts once the backup files are created.', 'WPMove' ); ?>811 </th>812 </tr>813 <tr>814 <td class="row-title">815 <a href="<?php echo esc_url( admin_url( 'tools.php?page=wpmove&do=migrate&type=advanced' ) ); ?>"><?php _e( 'Advanced Migration', 'WPMove' ); ?></a>816 </td>817 <td class="desc">818 <?php _e( 'Advanced Migration creates a backup of the database but lets you select the files to backup. Uploading backup files to the remote server starts once the backup files are created.', 'WPMove' ); ?>819 </td>820 </tr>821 </tbody>822 </table>823 </div>824 <?php825 }826 }827 828 /**829 * Handles the simple migration process.830 *831 * @param void832 * @return void833 */834 function print_simple_migration_page() {835 836 if ( $_POST && check_admin_referer( 'wpmove_simple_migration_start' ) ) {837 838 ?>839 <div class="wrap">840 <div id="icon-tools" class="icon32">841 <br>842 </div>843 <h2><?php _e( 'Simple Migration', 'WPMove' ); ?></h2>844 <p>845 785 <?php 846 786 … … 848 788 $wpmove_options = $this->get_admin_options(); 849 789 850 // An array to hold backup files that will be uploaded790 // Create an array to hold backup files that will be uploaded 851 791 $backups = array(); 852 792 … … 871 811 $backups = array_merge( $backups, $db_backups ); 872 812 873 // List all of the files inside the main directory 874 $abspath = substr( ABSPATH, 0, strlen( ABSPATH ) - 1 ); 875 $files = wpmove_list_all_files( $abspath, FALSE, array( WPMOVE_DIR, WPMOVE_BACKUP_DIR, WPMOVE_OLD_BACKUP_DIR ) ); 876 877 // Create chunks from the selected files 878 $chunks = wpmove_divide_into_chunks( $files, $wpmove_options['fs_chunk_size'] ); 879 880 // To prevent overwriting archives created in the same second 881 $chunk_id = 1; 882 883 // Create an archive of the each chunk 884 foreach ( $chunks as $chunk ) 885 array_push( $backups, wpmove_create_archive( $chunk, ABSPATH, $chunk_id++ ) ); 813 // Check whether an array is actually posted or not 814 if ( isset( $_POST['files'] ) && is_array( $_POST['files'] ) ) { 815 816 // Use the POST data directly, if the fallback method is being used 817 $files = array_map( 'sanitize_text_field', $_POST['files'] ); 818 819 // Remove non-empty directories from the array 820 $files = array_filter( $files ); 821 822 // Create chunks from the selected files 823 $chunks = wpmove_divide_into_chunks( $files, $wpmove_options['fs_chunk_size'] ); 824 825 // To prevent overwriting archives created in the same second 826 $chunk_id = 1; 827 828 // Create an archive of the each chunk 829 foreach ( $chunks as $chunk ) 830 array_push( $backups, wpmove_create_archive( $chunk, ABSPATH, $chunk_id++ ) ); 831 } 886 832 887 833 // Check whether creating backups files succeeded or not … … 890 836 } else { 891 837 892 // Upload files to the new serverand display a success message on success838 // Upload files and display a success message on success 893 839 if ( $this->upload_files( $backups, sanitize_text_field( $_POST['ftp_password'] ) ) ) { 894 840 … … 911 857 } 912 858 } 913 859 914 860 } else { 915 ?>916 <div class="wrap">917 <div id="icon-tools" class="icon32">918 <br>919 </div>920 <h2><?php _e( 'Simple Migration', 'WPMove' ); ?></h2>921 <p>922 <?php _e( 'This will backup your database and files as is and upload them to the server you want to migrate to.', 'WPMove' ); ?>923 </p>924 <form method="post" action="<?php echo esc_url( admin_url( 'tools.php?page=wpmove&do=migrate&type=simple' ) ); ?>">925 <p>926 <?php _e( 'If your FTP account uses a password, please enter it below.', 'WPMove' ); ?><br>927 <blockquote>928 <b><?php _e( 'FTP Password:', 'WPMove' ); ?></b> <input id="ftp_password" name="ftp_password" type="password" /><br>929 </blockquote>930 </p>931 <div id="wpmove_change_domain_name">932 <p>933 <?php _e( 'Please enter the exact path to your WordPress installation on your new domain name without the trailing slash and then click Start Migration button to start the migration process.', 'WPMove' ); ?><br>934 </p>935 <table class="form-table">936 <tbody>937 <tr valign="top">938 <th scope="row">939 <label for="old_domain_name"><?php _e( 'Old Domain Name', 'WPMove' ); ?></label>940 </th>941 <td>942 <input class="regular-text code" id="old_domain_name" name="old_domain_name" type="text" value="<?php echo home_url(); ?>" />943 </td>944 </tr>945 <tr valign="top">946 <th scope="row">947 <label for="new_domain_name"><?php _e( 'New Domain Name', 'WPMove' ); ?></label>948 </th>949 <td>950 <input class="regular-text code" id="new_domain_name" name="new_domain_name" type="text" />951 </td>952 </tr>953 </tbody>954 </table>955 <br>956 </div>957 <?php958 wp_nonce_field( 'wpmove_simple_migration_start' );959 submit_button( __( 'Start Migration', 'WPMove' ), 'primary', 'submit', FALSE );960 ?>961 <input type="button" name="wpmove_toggle_change_domain_name" id="wpmove_toggle_change_domain_name" class="button-secondary" value="<?php _e( 'Change Domain Name', 'WPMove' ); ?>" style="display:none;" />962 </form>963 </div>964 <?php965 }966 }967 968 /**969 * Handles the advanced migration process.970 *971 * @param void972 * @return void973 */974 function print_advanced_migration_page() {975 976 if ( $_POST && check_admin_referer( 'wpmove_advanced_migration_start' ) ) {977 861 978 862 ?> … … 981 865 <br> 982 866 </div> 983 <h2><?php _e( 'Advanced Migration', 'WPMove' ); ?></h2> 984 <p> 985 <?php 986 987 // Load plugin settings 988 $wpmove_options = $this->get_admin_options(); 989 990 // Create an array to hold backup files that will be uploaded 991 $backups = array(); 992 993 // If changing the current domain name is also requested... 994 if ( ! empty( $_POST['old_domain_name'] ) && ! empty( $_POST['new_domain_name'] ) ) { 995 996 // Apply filters to the given domain names 997 $old_domain_name = esc_url_raw( $_POST['old_domain_name'] ); 998 $new_domain_name = esc_url_raw( $_POST['new_domain_name'] ); 999 1000 // Create a backup of the database by changing instances of the old domain name with the newer one 1001 $db_backups = wpmove_create_db_backup( $wpmove_options['db_chunk_size'], 1, $old_domain_name, $new_domain_name ); 1002 1003 } else { 1004 1005 // Create a backup of the database 1006 $db_backups = wpmove_create_db_backup( $wpmove_options['db_chunk_size'] ); 1007 1008 } 1009 1010 // Add names of database backup files to the array of backup files 1011 $backups = array_merge( $backups, $db_backups ); 1012 1013 // Check whether an array is actually posted or not 1014 if ( isset( $_POST['files'] ) && is_array( $_POST['files'] ) ) { 1015 1016 // Use the POST data directly, if the fallback method is being used 1017 $files = array_map( 'sanitize_text_field', $_POST['files'] ); 1018 1019 // Remove non-empty directories from the array 1020 $files = array_filter( $files ); 1021 1022 // Create chunks from the selected files 1023 $chunks = wpmove_divide_into_chunks( $files, $wpmove_options['fs_chunk_size'] ); 1024 1025 // To prevent overwriting archives created in the same second 1026 $chunk_id = 1; 1027 1028 // Create an archive of the each chunk 1029 foreach ( $chunks as $chunk ) 1030 array_push( $backups, wpmove_create_archive( $chunk, ABSPATH, $chunk_id++ ) ); 1031 } 1032 1033 // Check whether creating backups files succeeded or not 1034 if ( ! file_exists( trailingslashit( WPMOVE_BACKUP_DIR ) . $backups['0'] ) ) { 1035 _e( 'Could not create backup files. Please make sure the backup directory is writable. For further info, please refer to the documentation.', 'WPMove' ); 1036 } else { 1037 1038 // Upload files and display a success message on success 1039 if ( $this->upload_files( $backups, sanitize_text_field( $_POST['ftp_password'] ) ) ) { 1040 1041 ?> 1042 <br> 1043 <?php _e( 'Creating and uploading backups have been completed. You can now go to your new installation and run the migration assistant in Complete Migration mode.', 'WPMove' ); ?> 1044 </p> 1045 </div> 1046 <?php 1047 1048 } else { 1049 1050 ?> 1051 <br> 1052 <?php _e( 'Please check your FTP connection details on the settings page.', 'WPMove' ); ?> 1053 </p> 1054 </div> 1055 <?php 1056 1057 } 1058 } 1059 1060 } else { 1061 1062 ?> 1063 <div class="wrap"> 1064 <div id="icon-tools" class="icon32"> 1065 <br> 1066 </div> 1067 <h2><?php _e( 'Advanced Migration', 'WPMove' ); ?></h2> 867 <h2><?php _e( 'Migration Assistant', 'WPMove' ); ?></h2> 1068 868 <p> 1069 869 <?php _e( 'Please select the files you want to include in the backup from the list below.', 'WPMove' ); ?> 1070 870 </p> 1071 <form method="post" action="<?php echo esc_url( admin_url( 'tools.php?page=wpmove&do=migrate&type=advanced' ) ); ?>"> 1072 <p> 1073 <?php _e( 'If your FTP account uses a password, please enter it below.', 'WPMove' ); ?><br> 1074 <blockquote> 1075 <b><?php _e( 'FTP Password:', 'WPMove' ); ?></b> <input id="ftp_password" name="ftp_password" type="password" /><br> 1076 </blockquote> 1077 </p> 1078 <div id="wpmove_change_domain_name"> 1079 <p> 1080 <?php _e( 'Please enter the exact path to your WordPress installation on your new domain name without the trailing slash and then click Start Migration button to start the migration process.', 'WPMove' ); ?><br> 1081 </p> 1082 <table class="form-table"> 1083 <tbody> 1084 <tr valign="top"> 1085 <th scope="row"> 1086 <label for="old_domain_name"><?php _e( 'Old Domain Name', 'WPMove' ); ?></label> 1087 </th> 1088 <td> 1089 <input class="regular-text code" id="old_domain_name" name="old_domain_name" type="text" value="<?php echo home_url(); ?>" /> 1090 </td> 1091 </tr> 1092 <tr valign="top"> 1093 <th scope="row"> 1094 <label for="new_domain_name"><?php _e( 'New Domain Name', 'WPMove' ); ?></label> 1095 </th> 1096 <td> 1097 <input class="regular-text code" id="new_domain_name" name="new_domain_name" type="text" /> 1098 </td> 1099 </tr> 1100 </tbody> 1101 </table> 1102 <br> 1103 </div> 1104 <?php wp_nonce_field( 'wpmove_advanced_migration_start' ); ?> 1105 <div id="wpmove_file_tree_buttons" style="display: none;"> 1106 <input type="button" name="wpmove_file_tree_check_all" id="wpmove_file_tree_check_all" class="button-secondary" value="<?php _e( 'Select All', 'WPMove' ); ?>" /> 1107 <input type="button" name="wpmove_file_tree_uncheck_all" id="wpmove_file_tree_uncheck_all" class="button-secondary" value="<?php _e( 'Unselect All', 'WPMove' ); ?>" /> 1108 <input type="button" name="wpmove_toggle_change_domain_name" id="wpmove_toggle_change_domain_name" class="button-secondary" value="<?php _e( 'Change Domain Name', 'WPMove' ); ?>" style="display:none;" /> 1109 </div> 1110 <blockquote> 871 <div id="poststuff" class="metabox-holder"> 872 <form method="post" action="<?php echo esc_url( admin_url( 'tools.php?page=wpmove&do=migrate&type=advanced' ) ); ?>"> 1111 873 <?php 1112 1113 // To use as a file ID 1114 $i = 0; 1115 1116 // List all of the files inside the main directory 1117 $abspath = substr( ABSPATH, 0, strlen( ABSPATH ) - 1 ); 1118 $files = wpmove_generate_file_tree( $abspath, FALSE, array( WPMOVE_DIR, WPMOVE_BACKUP_DIR, WPMOVE_OLD_BACKUP_DIR ) ); 1119 874 wp_nonce_field( 'wpmove_advanced_migration_start' ); 875 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); 876 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); 877 do_meta_boxes( 'wpmove-ma-migrate', 'advanced', null ); 878 submit_button( __( 'Start Migration', 'WPMove' ), 'primary', 'submit', FALSE ); 1120 879 ?> 1121 <div id="wpmove_file_tree" style="display:none;"> 1122 <ul> 1123 <?php wpmove_display_file_tree( $files ); ?> 1124 </ul> 1125 </div> 1126 <div id="wpmove_file_tree_loading" style="display:none;"> 1127 <?php echo '<img src="' . WPMOVE_URL . '/libs/js/themes/default/throbber.gif" alt="' . __( 'Loading...', 'WPMove' ) . '" style="vertical-align:middle;" /> <strong>' . __( 'Loading...', 'WPMove' ) . '</strong>'; ?> 1128 </div> 1129 <noscript> 1130 <?php 1131 1132 // Prepare the file list 1133 $files = wpmove_list_all_files( $abspath, FALSE, array( WPMOVE_DIR, WPMOVE_BACKUP_DIR, WPMOVE_OLD_BACKUP_DIR ) ); 1134 1135 // Display each file with a checked checkbox 1136 foreach ( $files as $file ) { 1137 if ( is_file( $file ) ) { 1138 $short_path = str_replace( ABSPATH, '', $file ); 1139 echo '<input id="file-' . $i . '" name="files[]" type="checkbox" value="' . $file . '" checked> <label for="file-' . $i++ . '"><span class="code">' . $short_path . '</span></label><br>'; 1140 } 1141 } 1142 1143 ?> 1144 </noscript> 1145 </blockquote> 1146 <?php submit_button( __( 'Start Migration', 'WPMove' ), 'primary', 'submit', FALSE ); ?> 1147 </form> 880 </form> 881 </div> 1148 882 <br> 1149 883 </div> … … 1153 887 1154 888 /** 889 * Callback function for the Migration FTP Settings meta box. 890 * 891 * @param $wpmove_options Plugin settings array 892 * @return void 893 */ 894 function metabox_ma_migrate_ftp() { 895 896 ?> 897 <p> 898 <?php _e( 'If your FTP account uses a password, please enter it below.', 'WPMove' ); ?><br> 899 <blockquote> 900 <b><?php _e( 'FTP Password:', 'WPMove' ); ?></b> <input id="ftp_password" name="ftp_password" type="password" /><br> 901 </blockquote> 902 </p> 903 <?php 904 905 } 906 907 /** 908 * Callback function for the Migration Change Domain Name meta box. 909 * 910 * @param $wpmove_options Plugin settings array 911 * @return void 912 */ 913 function metabox_ma_migrate_domain() { 914 915 ?> 916 <p> 917 <?php _e( 'Please enter the exact path to your WordPress installation on your new domain name without the trailing slash and then click Start Migration button to start the migration process.', 'WPMove' ); ?><br> 918 </p> 919 <table class="form-table"> 920 <tbody> 921 <tr valign="top"> 922 <th scope="row"> 923 <label for="old_domain_name"><?php _e( 'Old Domain Name', 'WPMove' ); ?></label> 924 </th> 925 <td> 926 <input class="regular-text code" id="old_domain_name" name="old_domain_name" type="text" value="<?php echo home_url(); ?>" /> 927 </td> 928 </tr> 929 <tr valign="top"> 930 <th scope="row"> 931 <label for="new_domain_name"><?php _e( 'New Domain Name', 'WPMove' ); ?></label> 932 </th> 933 <td> 934 <input class="regular-text code" id="new_domain_name" name="new_domain_name" type="text" /> 935 </td> 936 </tr> 937 </tbody> 938 </table> 939 <?php 940 941 } 942 943 /** 944 * Callback function for the Migration Files to Transfer meta box. 945 * 946 * @param $wpmove_options Plugin settings array 947 * @return void 948 */ 949 function metabox_ma_migrate_filetree() { 950 951 ?> 952 <p id="wpmove_file_tree_buttons" style="display: none;"> 953 <input type="button" name="wpmove_file_tree_check_all" id="wpmove_file_tree_check_all" class="button-secondary" value="<?php _e( 'Select All', 'WPMove' ); ?>" /> 954 <input type="button" name="wpmove_file_tree_uncheck_all" id="wpmove_file_tree_uncheck_all" class="button-secondary" value="<?php _e( 'Unselect All', 'WPMove' ); ?>" /> 955 <input type="button" name="wpmove_toggle_change_domain_name" id="wpmove_toggle_change_domain_name" class="button-secondary" value="<?php _e( 'Change Domain Name', 'WPMove' ); ?>" style="display:none;" /> 956 </p> 957 <blockquote> 958 <?php 959 960 // To use as a file ID 961 $i = 0; 962 963 // List all of the files inside the main directory 964 $abspath = substr( ABSPATH, 0, strlen( ABSPATH ) - 1 ); 965 $files = wpmove_generate_file_tree( $abspath, FALSE, array( WPMOVE_DIR, WPMOVE_BACKUP_DIR, WPMOVE_OLD_BACKUP_DIR ) ); 966 967 ?> 968 <div id="wpmove_file_tree" style="display:none;"> 969 <ul> 970 <?php wpmove_display_file_tree( $files ); ?> 971 </ul> 972 </div> 973 <div id="wpmove_file_tree_loading" style="display:none;"> 974 <?php echo '<img src="' . WPMOVE_URL . '/libs/js/themes/default/throbber.gif" alt="' . __( 'Loading...', 'WPMove' ) . '" style="vertical-align:middle;" /> <strong>' . __( 'Loading...', 'WPMove' ) . '</strong>'; ?> 975 </div> 976 <noscript> 977 <?php 978 979 // Prepare the file list 980 $files = wpmove_list_all_files( $abspath, FALSE, array( WPMOVE_DIR, WPMOVE_BACKUP_DIR, WPMOVE_OLD_BACKUP_DIR ) ); 981 982 // Display each file with a checked checkbox 983 foreach ( $files as $file ) { 984 if ( is_file( $file ) ) { 985 $short_path = str_replace( ABSPATH, '', $file ); 986 echo '<input id="file-' . $i . '" name="files[]" type="checkbox" value="' . $file . '" checked> <label for="file-' . $i++ . '"><span class="code">' . $short_path . '</span></label><br>'; 987 } 988 } 989 990 ?> 991 </noscript> 992 </blockquote> 993 <?php 994 995 } 996 997 /** 1155 998 * Handles uploading processes of the migration 1156 999 * … … 1174 1017 1175 1018 printf( __( 'Connecting to %s:%d...', 'WPMove' ), $wpmove_options['ftp_hostname'], $wpmove_options['ftp_port'] ); 1019 $this->flush_output(); 1176 1020 1177 1021 // Set the hostname and the port … … 1182 1026 1183 1027 echo ' <strong>' . __( 'Success!', 'WPMove' ) . '</strong><br>'; 1028 $this->flush_output(); 1184 1029 1185 1030 // Display a different message if no password is given … … 1189 1034 printf( __( 'Logging in as %s without a password...', 'WPMove' ), $wpmove_options['ftp_username'] ); 1190 1035 1036 $this->flush_output(); 1037 1191 1038 // Login to the server using the supplied credentials 1192 1039 if ( $ftp->login( $wpmove_options['ftp_username'], $ftp_password ) ) { 1193 1040 1194 1041 echo ' <strong>' . __( 'Success!', 'WPMove' ) . '</strong><br>' . __( 'Starting uploading files...', 'WPMove' ) . '<br>'; 1042 1043 $this->flush_output(); 1195 1044 1196 1045 // Changes the present working directory to the backup directory on the remote server … … 1203 1052 foreach ( $files as $file ) { 1204 1053 printf( __( '%s is being uploaded...', 'WPMove' ), basename( $file ) ); 1054 $this->flush_output(); 1205 1055 if ( FALSE !== ( $ftp->put( trailingslashit( WPMOVE_BACKUP_DIR ) . $file, basename( $file ) ) ) ) { 1206 1056 echo '<strong>' . __( ' Success!', 'WPMove' ) . '</strong><br>'; … … 1209 1059 $error_count++; 1210 1060 } 1061 $this->flush_output(); 1211 1062 } 1212 1063 … … 1216 1067 else 1217 1068 _e( 'Uploading files is completed without an error...', 'WPMove' ); 1069 1070 $this->flush_output(); 1218 1071 1219 1072 echo '<br>'; … … 1257 1110 <br> 1258 1111 <?php 1259 1260 // Create a list of all the files inside the backup directory 1261 $files = wpmove_list_all_files( WPMOVE_BACKUP_DIR, TRUE ); 1262 1263 // Categorize the files listed 1264 $backups = $this->categorize_files( $files ); 1265 1266 // Set the error counter to zero 1267 $errors_occured = 0; 1268 1269 // Import every single database backup one by one 1270 foreach ( $backups['db'] as $file ) { 1271 1272 echo '<span class="code">'; 1273 printf( __( '%s is being imported... ', 'WPMove' ), basename( $file ) ); 1274 1275 if ( wpmove_import_db_backup( basename( $file ) ) ) { 1276 echo '<b>' . __( 'Success!', 'WPMove' ) . '</b></span><br>'; 1277 } else { 1278 $errors_occured++; 1279 echo '<b>' . __( 'Failed!', 'WPMove' ) . '</b></span><br>'; 1112 // If there's an actual array sent 1113 if ( isset( $_POST['files'] ) && is_array( $_POST['files'] ) ) { 1114 1115 // Sanitize the POST data 1116 $files = array_map( 'sanitize_text_field', $_POST['files'] ); 1117 1118 // Categorize the files listed 1119 $backups = $this->categorize_files( $files ); 1120 1121 // Set the error counter to zero 1122 $errors_occured = 0; 1123 1124 // Import every single database backup one by one 1125 foreach ( $backups['db'] as $file ) { 1126 1127 echo '<span class="code">'; 1128 printf( __( '%s is being imported... ', 'WPMove' ), basename( $file ) ); 1129 1130 $this->flush_output(); 1131 1132 if ( wpmove_import_db_backup( basename( $file ) ) ) { 1133 echo '<b>' . __( 'Success!', 'WPMove' ) . '</b></span><br>'; 1134 } else { 1135 $errors_occured++; 1136 echo '<b>' . __( 'Failed!', 'WPMove' ) . '</b></span><br>'; 1137 } 1280 1138 } 1139 1140 // Extract every single file system backup one by one 1141 foreach ( $backups['fs'] as $file ) { 1142 1143 echo '<span class="code">'; 1144 printf( __( '%s is being extracted... ', 'WPMove' ), basename( $file ) ); 1145 1146 $this->flush_output(); 1147 1148 if ( wpmove_extract_archive( basename( $file ), ABSPATH ) ) { 1149 echo '<b>' . __( 'Success!', 'WPMove' ) . '</b></span><br>'; 1150 } else { 1151 $errors_occured++; 1152 echo '<b>' . __( 'Failed!', 'WPMove' ) . '</b></span><br>'; 1153 } 1154 } 1155 1281 1156 } 1282 1157 1283 // Extract every single file system backup one by one 1284 foreach ( $backups['fs'] as $file ) { 1285 1286 echo '<span class="code">'; 1287 printf( __( '%s is being extracted... ', 'WPMove' ), basename( $file ) ); 1288 1289 if ( wpmove_extract_archive( basename( $file ), ABSPATH ) ) { 1290 echo '<b>' . __( 'Success!', 'WPMove' ) . '</b></span><br>'; 1291 } else { 1292 $errors_occured++; 1293 echo '<b>' . __( 'Failed!', 'WPMove' ) . '</b></span><br>'; 1294 } 1158 // If there were errors, notify the user 1159 if ( ! isset( $errors_occured ) ) 1160 _e( 'Please select files to migrate before proceeding!', 'WPMove' ); 1161 else { 1162 echo '<br />'; 1163 if ( $errors_occured > 0 ) 1164 printf( _n( 'Migration has been completed but with %d error.', 'Migration has been completed but with %d errors.', $errors_occured, 'WPMove' ), $errors_occured ); 1165 else 1166 _e( 'Migration has been completed successfully!', 'WPMove' ); 1295 1167 } 1296 1297 echo '<br>';1298 1299 // If there were errors, notify the user1300 if ( $errors_occured > 0 )1301 printf( _n( 'Migration has been completed but with %d error.', 'Migration has been completed but with %d errors.', $errors_occured, 'WPMove' ), $errors_occured );1302 else1303 _e( 'Migration has been completed successfully!', 'WPMove' );1304 1168 1305 1169 ?> … … 1326 1190 1327 1191 ?> 1328 <?php _e( ' Proceeding will use the following files and database backups. You can choose which files to use by going to the Backup Manager.', 'WPMove' ); ?>1192 <?php _e( 'Below are the files stored under the main backup directory. Please select backup files below to proceed.', 'WPMove' ); ?> 1329 1193 <br><br> 1330 <table class="wp-list-table widefat fixed" cellspacing="0"> 1331 <thead> 1332 <tr> 1333 <th scope="col" id="cb" class="manage-column column-cb check-column" style> 1334 <input type="checkbox" checked disabled> 1335 </th> 1336 <th scope="col" id="name" class="manage-column column-name" style> 1337 <a href="#"><?php _e( 'Name', 'WPMove' ); ?></a> 1338 </th> 1339 <th scope="col" id="type" class="manage-column column-type" style> 1340 <a href="#"><?php _e( 'Type', 'WPMove' ); ?></a> 1341 </th> 1342 <th scope="col" id="size" class="manage-column column-size" style> 1343 <a href="#"><?php _e( 'Size', 'WPMove' ); ?></a> 1344 </th> 1345 <th scope="col" id="date" class="manage-column column-date" style> 1346 <a href="#"><?php _e( 'Date Created', 'WPMove' ); ?></a> 1347 </th> 1348 </tr> 1349 </thead> 1350 <tfoot> 1351 <tr> 1352 <th scope="col" id="cb" class="manage-column column-cb check-column" style> 1353 <input type="checkbox" checked disabled> 1354 </th> 1355 <th scope="col" id="name" class="manage-column column-name" style> 1356 <a href="#"><?php _e( 'Name', 'WPMove' ); ?></a> 1357 </th> 1358 <th scope="col" id="type" class="manage-column column-type" style> 1359 <a href="#"><?php _e( 'Type', 'WPMove' ); ?></a> 1360 </th> 1361 <th scope="col" id="size" class="manage-column column-size" style> 1362 <a href="#"><?php _e( 'Size', 'WPMove' ); ?></a> 1363 </th> 1364 <th scope="col" id="date" class="manage-column column-date" style> 1365 <a href="#"><?php _e( 'Date Created', 'WPMove' ); ?></a> 1366 </th> 1367 </tr> 1368 </tfoot> 1369 <tbody id="the-list"> 1370 <?php 1371 1372 // For zebra striping 1373 $i = 0; 1374 1375 foreach ( $files as $file ) { 1376 1377 // Get the file extension 1378 $ext = substr( $file, -3, 3 ); 1379 1380 // Decide the type of the backup 1381 if ( 'sql' == $ext ) { 1382 preg_match( '/DBBackup-([0-9]*).sql/', basename( $file ), $timestamp ); 1383 $type = __( 'Database Backup', 'WPMove' ); 1384 } else if ( 'zip' == $ext ) { 1385 preg_match( '/Backup-([0-9]*).zip/', basename( $file ), $timestamp ); 1386 $type = __( 'Filesystem Backup', 'WPMove' ); 1194 <form method="post" action="<?php echo esc_url( admin_url( 'tools.php?page=wpmove&do=complete' ) ); ?>"> 1195 <table class="wp-list-table widefat fixed" cellspacing="0"> 1196 <thead> 1197 <tr> 1198 <th scope="col" id="cb" class="manage-column column-cb check-column" style> 1199 <input type="checkbox" checked> 1200 </th> 1201 <th scope="col" id="name" class="manage-column column-name" style> 1202 <a href="#"><?php _e( 'Name', 'WPMove' ); ?></a> 1203 </th> 1204 <th scope="col" id="type" class="manage-column column-type" style> 1205 <a href="#"><?php _e( 'Type', 'WPMove' ); ?></a> 1206 </th> 1207 <th scope="col" id="size" class="manage-column column-size" style> 1208 <a href="#"><?php _e( 'Size', 'WPMove' ); ?></a> 1209 </th> 1210 <th scope="col" id="date" class="manage-column column-date" style> 1211 <a href="#"><?php _e( 'Date Created', 'WPMove' ); ?></a> 1212 </th> 1213 </tr> 1214 </thead> 1215 <tfoot> 1216 <tr> 1217 <th scope="col" id="cb" class="manage-column column-cb check-column" style> 1218 <input type="checkbox" checked> 1219 </th> 1220 <th scope="col" id="name" class="manage-column column-name" style> 1221 <a href="#"><?php _e( 'Name', 'WPMove' ); ?></a> 1222 </th> 1223 <th scope="col" id="type" class="manage-column column-type" style> 1224 <a href="#"><?php _e( 'Type', 'WPMove' ); ?></a> 1225 </th> 1226 <th scope="col" id="size" class="manage-column column-size" style> 1227 <a href="#"><?php _e( 'Size', 'WPMove' ); ?></a> 1228 </th> 1229 <th scope="col" id="date" class="manage-column column-date" style> 1230 <a href="#"><?php _e( 'Date Created', 'WPMove' ); ?></a> 1231 </th> 1232 </tr> 1233 </tfoot> 1234 <tbody id="the-list"> 1235 <?php 1236 1237 // For zebra striping 1238 $i = 0; 1239 1240 foreach ( $files as $file ) { 1241 1242 // Get the file extension 1243 $ext = substr( $file, -3, 3 ); 1244 1245 // Decide the type of the backup 1246 if ( 'sql' == $ext ) { 1247 preg_match( '/DBBackup-([0-9]*).sql/', basename( $file ), $timestamp ); 1248 $type = __( 'Database Backup', 'WPMove' ); 1249 } else if ( 'zip' == $ext ) { 1250 preg_match( '/Backup-([0-9]*).zip/', basename( $file ), $timestamp ); 1251 $type = __( 'Filesystem Backup', 'WPMove' ); 1252 } 1253 1254 // For zebra striping 1255 if ( $i % 2 !== 0 ) 1256 $class = ' class="alternate"'; 1257 else 1258 $class = ''; 1259 1260 // Display the row 1261 echo ' <tr id="file-' . $i . '" valign="middle"' . $class . '> 1262 <th scope="row" class="check-column"> 1263 <input id="file-' . $i . '" name="files[]" type="checkbox" value="' . $file . '" checked> 1264 </th> 1265 <td class="column-name"> 1266 <strong> 1267 <a href="#">' . esc_html( basename( $file ) ) . '</a> 1268 </strong> 1269 </td> 1270 <td class="column-type"> 1271 <a href="#">' . esc_html( $type ) . '</a> 1272 </td> 1273 <td class="column-size"> 1274 ' . esc_html( round( filesize( $file ) / 1024, 2 ) ) . ' KB 1275 </td> 1276 <td class="column-date"> 1277 ' . esc_html( date( 'd.m.Y H:i:s', substr( $timestamp['1'], 0, 10 ) ) ) . ' 1278 </td> 1279 </tr>'; 1280 1281 // Increase the counter for zebra striping 1282 $i++; 1387 1283 } 1388 1284 1389 // For zebra striping 1390 if ( $i % 2 !== 0 ) 1391 $class = ' class="alternate"'; 1392 else 1393 $class = ''; 1394 1395 // Display the row 1396 echo ' <tr id="file-' . $i . '" valign="middle"' . $class . '> 1397 <th scope="row" class="check-column"> 1398 <input id="file-' . $i . '" name="files[]" type="checkbox" value="' . $file . '" checked disabled> 1399 </th> 1400 <td class="column-name"> 1401 <strong> 1402 <a href="#">' . esc_html( basename( $file ) ) . '</a> 1403 </strong> 1404 </td> 1405 <td class="column-type"> 1406 <a href="#">' . esc_html( $type ) . '</a> 1407 </td> 1408 <td class="column-size"> 1409 ' . esc_html( round( filesize( $file ) / 1024, 2 ) ) . ' KB 1410 </td> 1411 <td class="column-date"> 1412 ' . esc_html( date( 'd.m.Y H:i:s', substr( $timestamp['1'], 0, 10 ) ) ) . ' 1413 </td> 1414 </tr>'; 1415 1416 // Increase the counter for zebra striping 1417 $i++; 1418 } 1419 1420 ?> 1421 </tbody> 1422 </table> 1423 <br> 1424 <form method="post" action="<?php echo esc_url( admin_url( 'tools.php?page=wpmove&do=complete' ) ); ?>"> 1285 ?> 1286 </tbody> 1287 </table> 1288 <br> 1425 1289 <?php wp_nonce_field( 'wpmove_complete_migration_start' ); ?> 1426 1290 <input class="button-primary" type="submit" name="wpmove_complete_migration" value="<?php _e( 'Complete Migration', 'WPMove' ); ?>" /> … … 1468 1332 foreach ( $files as $file ) 1469 1333 rename( $file, trailingslashit( $move_target ) . basename( $file ) ); 1334 else if ( 'convert' == $action ) 1335 foreach ( $files as $file ) 1336 wpmove_convert_db_backup( $file ); 1470 1337 } 1471 1338 … … 1535 1402 $old_backups = $this->categorize_files( $old_files ); 1536 1403 1404 // List all converted database backup files 1405 $converted_files = wpmove_list_all_files( WPMOVE_CONVERTED_BACKUP_DIR ); 1406 $converted_backups = $this->categorize_files( $converted_files ); 1407 1537 1408 ?> 1538 1409 <form method="post" action="<?php echo esc_url( admin_url( 'tools.php?page=wpmove-backup-manager' ) ); ?>"> … … 1543 1414 <select name="action" size="1" height="1"> 1544 1415 <option value="toggle"><?php _e( 'Archive', 'WPMove' ); ?></option> 1416 <option value="convert"><?php _e( 'Convert', 'WPMove' ); ?></option> 1545 1417 <option value="delete"><?php _e( 'Delete', 'WPMove' ); ?></option> 1546 1418 </select> … … 1669 1541 <select name="action" size="1" height="1"> 1670 1542 <option value="toggle"><?php _e( 'Unarchive', 'WPMove' ); ?></option> 1543 <option value="convert"><?php _e( 'Convert', 'WPMove' ); ?></option> 1671 1544 <option value="delete"><?php _e( 'Delete', 'WPMove' ); ?></option> 1672 1545 </select> … … 1783 1656 </table> 1784 1657 </form> 1658 <br> 1659 <h3><?php _e( 'Converted Database Backups', 'WPMove' ); ?></h3> 1660 <p> 1661 <?php _e( 'Below are the converted database backup files which, unlike the files listed above, can be used outside WordPress Move. You may need the converted versions of your databsae backups if the plugin fails to migrate your installation properly. These files will not be used by the plugin at any stage.', 'WPMove' ); ?> 1662 </p> 1663 <form method="post" action="<?php echo esc_url( admin_url( 'tools.php?page=wpmove-backup-manager' ) ); ?>"> 1664 <?php wp_nonce_field( 'wpmove_backup_manager_submit' ); ?> 1665 <input name="act" type="hidden" value="manage" /> 1666 <div class="tablenav top"> 1667 <div class="alignleft actions"> 1668 <select name="action" size="1" height="1"> 1669 <option value="delete"><?php _e( 'Delete', 'WPMove' ); ?></option> 1670 </select> 1671 <?php submit_button( __( 'Apply', 'WPMove' ), 'secondary', 'wpmove_converted_backups', FALSE ); ?> 1672 </div> 1673 </div> 1674 <table class="wp-list-table widefat fixed" cellspacing="0"> 1675 <thead> 1676 <tr> 1677 <th scope="col" id="cb" class="manage-column column-cb check-column" style> 1678 <input type="checkbox"> 1679 </th> 1680 <th scope="col" id="name" class="manage-column column-name" style> 1681 <a href="#"><?php _e( 'Name', 'WPMove' ); ?></a> 1682 </th> 1683 <th scope="col" id="type" class="manage-column column-type" style> 1684 <a href="#"><?php _e( 'Type', 'WPMove' ); ?></a> 1685 </th> 1686 <th scope="col" id="size" class="manage-column column-size" style> 1687 <a href="#"><?php _e( 'Size', 'WPMove' ); ?></a> 1688 </th> 1689 <th scope="col" id="date" class="manage-column column-date" style> 1690 <a href="#"><?php _e( 'Date Created', 'WPMove' ); ?></a> 1691 </th> 1692 </tr> 1693 </thead> 1694 <tfoot> 1695 <tr> 1696 <th scope="col" id="cb" class="manage-column column-cb check-column" style> 1697 <input type="checkbox"> 1698 </th> 1699 <th scope="col" id="name" class="manage-column column-name" style> 1700 <a href="#"><?php _e( 'Name', 'WPMove' ); ?></a> 1701 </th> 1702 <th scope="col" id="type" class="manage-column column-type" style> 1703 <a href="#"><?php _e( 'Type', 'WPMove' ); ?></a> 1704 </th> 1705 <th scope="col" id="size" class="manage-column column-size" style> 1706 <a href="#"><?php _e( 'Size', 'WPMove' ); ?></a> 1707 </th> 1708 <th scope="col" id="date" class="manage-column column-date" style> 1709 <a href="#"><?php _e( 'Date Created', 'WPMove' ); ?></a> 1710 </th> 1711 </tr> 1712 </tfoot> 1713 <tbody id="the-list"> 1714 <?php 1715 1716 // Display a message if no backup files found 1717 if ( count( $converted_backups, COUNT_RECURSIVE ) > 2 ) { 1718 1719 // For zebra striping 1720 $i = 0; 1721 1722 // Display all current backups starting with database backups 1723 foreach ( $converted_backups as $backups ) { 1724 1725 foreach ( $backups as $file ) { 1726 1727 // Get the file extension 1728 $ext = substr( $file, -3, 3 ); 1729 1730 // Decide the type of the backup 1731 $type = __( 'Database Backup', 'WPMove' ); 1732 1733 // For zebra striping 1734 if ( $i % 2 !== 0 ) 1735 $class = ' class="alternate"'; 1736 else 1737 $class = ''; 1738 1739 // Display the row 1740 echo ' <tr id="file-' . $i . '" valign="middle"' . $class . '> 1741 <th scope="row" class="check-column"> 1742 <input id="file-' . $i . '" name="files[]" type="checkbox" value="' . $file . '"> 1743 </th> 1744 <td class="column-name"> 1745 <strong> 1746 <a href="#">' . esc_html( basename( $file ) ) . '</a> 1747 </strong> 1748 </td> 1749 <td class="column-type"> 1750 <a href="#">' . esc_html( $type ) . '</a> 1751 </td> 1752 <td class="column-size"> 1753 ' . esc_html( round( filesize( $file ) / 1024, 2 ) ) . ' KB 1754 </td> 1755 <td class="column-date"> 1756 ' . esc_html( date( 'd.m.Y H:i:s', substr( $timestamp['1'], 0, 10 ) ) ) . ' 1757 </td> 1758 </tr>'; 1759 1760 // Increase the counter for zebra striping 1761 $i++; 1762 } 1763 } 1764 1765 } else { 1766 1767 echo '<tr class="no-items"> 1768 <td class="colspanchange" colspan="5"> 1769 ' . __( 'No converted database backup files found. You can convert a database backup file using the Convert option from the dropdown lists above.', 'WPMove' ) . ' 1770 </td> 1771 </tr>'; 1772 } 1773 ?> 1774 </tbody> 1775 </table> 1776 </form> 1785 1777 </div> 1786 1778 <?php … … 1812 1804 1813 1805 /** 1806 * Flushes the output buffer. 1807 * 1808 * @param void 1809 * @return void 1810 */ 1811 function flush_output() { 1812 wp_ob_end_flush_all(); 1813 flush(); 1814 } 1815 1816 /** 1814 1817 * Adds a menu to the ACP 1815 1818 *
Note: See TracChangeset
for help on using the changeset viewer.